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?

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked Oct 16, 2013 at 4:03

1 Answer 1

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.

answered Oct 16, 2013 at 11:15
3
  • 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! Commented 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. Commented Dec 2, 2013 at 21:38
  • Done @AndreSilva :-) Commented Jul 6, 2015 at 9:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.