Release/2.6/Notes

Version 8 (modified by rdewit, 5 years ago)

unwikify ProxyHost

The following behaviors have changed in a way that may affect applications. If you are using previous versions of OpenLayers, you are encouraged to read these sections carefully so as to understand how these issues may affect your application.

  • The style of a selected feature, in the past, was treated as an explicit setting of all the properties of the style of the feature. In OpenLayers 2.6, the 'select' style is instead an *extension* of the existing style. This means that if you have a feature which is styled with an externalGraphic, and you select it, you will still see an externalGraphic unless you explicitly mark that property as an empty string, for example. This allows for features to change only some properties when selected: if you have a set of features with varying pointRadius style attributes, you can set your select style to 'strokeColor': 'red', and the feature will keep its current size, and only change stroke style.
  • The style property of a feature in the past to the default style if it had no style property when it was added to the layer. In 2.6, this has changed; if you wish to extend the feature.style in the preFeatureInsert method or something similar, you must first create a feature.style property, like:
    feature.style = OpenLayers.Util.extend({}, 
        OpenLayers.Feature.Vector.style['default']);
    
  • The GeoRSS and Text layer data loading has been refactored slightly. Instead of loading data on instantiation, this load now happens the first time that the layer is visible and moved (via the moveTo command). If you'd like to mimic the old behavior, you can call layer.loadRSS() or layer.loadText() immediately after creating the layer. However, it would be better to tie your functionality to a loadend event from the layer: this way, you can be notified when the data is actually loaded, since it happens asynchronously. In either case, in order to take advantage of reprojection support, you will need to first ensure that a map is set on the layer by adding the layer to a map.
  • The fallThrough property on the map was set to 'false' by default before OpenLayers 2.6. This means that it will stop events from passing through the map: this also prevents browser default behaviors like the ability to have a 'title' set when you hover over an image, or stops global mousemove handlers which are used for dragging elements over an OpenLayers map. In 2.6, this behavior has changed. We are unable to find any use case that will be negatively affected by this change, but if you are using OpenLayers in a situation where you depend on events being stopped by the map, you should set the fallThrough property to 'false' in your map creation options.
  • ProxyHost is now respected with regard to the Ajax.Request class. If your ProxyHost starts with "http", and you were adding it to the front of your Ajax.Request manually at the application level, it will now be added twice. It is recommended taht you simply change your proxyhost to be a relative URL; this will prevent the behavior described from occurring.