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 Answer 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– TingSky2013年11月24日 05:36:27 +00:00Commented Nov 24, 2013 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– Jorge Sanz2013年12月02日 21:38:44 +00:00Commented Dec 2, 2013 at 21:38
-
Done @AndreSilva :-)Jorge Sanz– Jorge Sanz2015年07月06日 09:36:16 +00:00Commented Jul 6, 2015 at 9:36
Explore related questions
See similar questions with these tags.