The example you provided specifically demonstrates the ability to select features from different layers. In order to do this it includes an OpenLayers.Control.SelectFeature
that is setup to capture featureselected
events on the two different vector layers. Removing (or deactivating) the OpenLayers.Control.SelectFeature
control will revert to default behaviour, that is to say the feature does not capture the mouse event and instead the map does, allowing it to be dragged.
The example given by simo does not include the OpenLayers.Control.SelectFeature
control and therefore demonstrates the map can dragged regardless of whether a feature or the underlying map is clicked on.
If you need the ability to select the feature as well as being able to drag the map when a feature is initially clicked then you will need to look at extending the event so that fallThrough
is set to true
- which allows the event to fall through after it has been handled. This might then allow the map to pick up the click and drag event. I've not tried that so don't know if it would work.