Search code examples
jqueryopenlayers

How can I access existing map object by dom element?


Is there any method to acces an existing openlayers map object, using dom?

e.g: $("#map_div").data("openLayers") is not working..

Thanx!


Solution

  • You can't access the OpenLayers.Map instance using the DOM. You need to keep that reference stored in a variable.