[OpenLayers-Users] OpenLayers.Map + DOM Object - How to get Map Object from DOM Element

Jürgen Dankoweit Juergen.Dankoweit at T-Online.de
Tue Jul 31 07:15:56 PDT 2012


Hello Andreas,

thanks for your answer.
I thought that there is a possibility to find out the map object.

Best regards

Jürgen

Am 31.07.2012 15:27, schrieb Andreas Hocevar:
> If you are referring to an OpenLayers.Map instance with "map object",
> you won't find it in the DOM. You need to assign it a global variable
> if you want that, e.g.
> 
> window.map = new OpenLayers.Map('worldmap');
> 
> Andreas.
> 
> On Tue, Jul 31, 2012 at 3:15 PM, Jürgen Dankoweit
> <Juergen.Dankoweit at t-online.de> wrote:
>> Hello to the list,
>>
>> the following situation: I have a OpenLayers.Map object which is
>> "connected" to the DOM element "div" like in the code snippet below:
>>
>> <div id='worldmap'></div>
>>
>> map = new OpenLayers.Map(document.getElementById('worldmap'), ... );
>>
>> An examination with Firebug shows me a lot of OpenLayer objects but no
>> map object. I think that the object "map" should be a child of the DOM
>> element "div". But how to find out the map object?
>>
>> The background is that I don't want to declare the map object as a
>> global variable - old school :)
>>
>> Many thanks for the answers.
>>
>> Best regards
>>
>> Jürgen
>>
>> --
>> Meine stets unfertige Homepage: www.dankoweit.de
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 
> 
> 


-- 
Meine stets unfertige Homepage: www.dankoweit.de


More information about the Users mailing list