| Version 13 (modified by euzuro, 7 years ago) |
|---|
OpenLayers 2.2 Release Notes
General
- Script-adding is now XHTML Compliant (#177) -- Thanks Steve Pomeroy!
Removal of Prototype Library
- Improvement of class definition vs instantiation (#75)
old syntax:
OpenLayers.A = Class.create(); OpenLayers.A.prototype = Object.extent( new OpenLayers.X(), Object.extent( new OpenLayers.Y(), { //prototype goes here }));new syntax:OpenLayers.A = OpenLayers.Class.create(); OpenLayers.A.prototype = OpenLayers.Class.inherit( OpenLayers.X, OpenLayers.Y, { //prototype goes here });Besides simply being more readable and understandable, the main benefit of this new enhancement (see r1647 for details) is that it removes the extraneous calls to classes' initialize() method during class definitions. This means no more do you need to testif (arguments.length > 0)
inside a superclass's constructor before doing instance-specific work, because it will only be called on instantiation of a new class.
Layers
- Scale-dependent layer visibility (#99)
All overlays now test to make sure that the current map's resolution (or scale) falls in between their minResolution and maxResolution* values. If it does not, then the layer is hidden and greyed out in the LayerSwitcher.
*For a refresher on how resolution values are calculated, see SettingZoomLevels - Raise/Lower Layers (#105)
New map functions
getNumLayers() getLayerIndex() setLayerIndex() raiseLayer()
to support raising and lowering layers in vertical map space. (see r1604)
- Switching BaseLayers Maintains Map Resolution (#182) Instead of merely jumping to the same zoom level (index into the resolutions array) in the new base layer, we call zoomToExtent() on the old layer's extent. This picks the closest resolution available.
- WFS Layers now work in Firefox, IE, Safari. (#138)
- Mapserver CGI Layer (#175) -- Thanks Arnd Wipperman!
- Allow click-through to Google Terms of Use Link (#185)
Controls
- Overview Map (#104) -- Thanks Tim Schaub!
We now have a control for an overview map that hangs out in the lower-righthand corner of the map.
See it in action here: examples/controls.html - ArgsParser (#148)
Instead of having Permalink deal with pulling parameters from the location bar's query string, we now have a new control that is dedicated to doing this. ArgsParser is one of the DefaultControls, so you can initialize any openlayers map by setting the lon and lat and/or zoom parameters in the query string.
Ex: http://www.openlayers.org/dev/examples/controls.html?lat=-12.91952&lon=-38.60199&zoom=10 - Permalink (#148)
- As mentioned above, PermaLink no longer is responsible for reading in query parameters -- that is delegated to ArgsParser.
- If the PermaLink control is added to the map which has no ArgsParser, it takes care to add one itself.
- Now besides storing lon, lat, and zoom for a map, the PermaLink control also stores a record of which layers were visible.
Ex: http://www.openlayers.org/dev/examples/controls.html?lat=-13.08191&lon=-38.73143&zoom=12&layers=0BF
