1

version: OpenLayers-2.13.1

brower : IE8 (I Hit it!!! But I need to work on it)

I create a div with id 'map' to display OpenLayers map. Sometimes, I need disable map div catch any mouse events, let me enable "drag" items into map (not really drag and drop event). But I don't know how to disable the map receives mouse events, so, I dynamically create a new div into the HTML body to cover above the map, make the new div receive all mouse events and without pass these events to the map, by this way, Google Chrome works well, but in IE8 is not!!!! So..... sad!!

In IE8, the created new div only receive mousemove event at itself's border, when mouse inner blank area of the new div, the mousemove events be received by the map div, upper level's new div receive nothing. In Chrome, when mouse move onto the new div, no matter on the border or inner blank area, all mouse event pass to upper level's new div first, the map div would not receive!

Could anybody told me how to make OpenLayers map div avoid receive mouse events and how to restore receive mouse events ability? If use new div cover upper the map, how to let upper div receive all mouse events in IE?

1

If you are creating your map without any initial controls definition the Navigation control is added to answer mouse events.

Create a map defining the controls you want to add (or an empty list). Check this example to see how to pass the controls list on map creation.

You can also activate/deactivate the control at your will, check the docs.

See an example: adding a "controls:[]" to your map options creates it without any control so no navigation is possible.

  • I found that even I deactive all controls on the map, still fail drag and drop on the map. Now, i use a way to walk around the issue:when enable the drop function, create a new translate div on the map, it works well. Thank you for your replay, Thank You! – TingSky Nov 24 '13 at 5:36
  • Sorry for the delay, see an example of what I was trying to explain jsfiddle.net/jsanz/5rArM/1 Adding a "controls:[]" to your map options creates it without any control so no navigation is possible. – Jorge Sanz Dec 2 '13 at 21:38
  • Done @AndreSilva :-) – Jorge Sanz Jul 6 '15 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.