OpenLayers 3 get map by id or class?

المشرف العام

Administrator
طاقم الإدارة
How can I get hold of a OpenLayers3 map object associated with a specific id or class (unique)?

I searched and found this thread, which says something like:

var map = $('.my_map_class').data('openlayers'); //assuming there is just one map on the pageBut I got an typeerror saying that map is not defined. I have tried replacing $ with jQuery, and it didn't work either.

Any pointers?

Thanks.



أكثر...
 
أعلى