[OpenLayers-Users] reload map

Arnd Wippermann arnd.wippermann at web.de
Thu Apr 23 16:35:16 EDT 2009


Hi,

I use map.destroy and then build the map with the new options and the
previous layers and controls. I believe there is no other possibility.

function destroyKarte()
{
    if(map.layers)
      for(var i=0;i<map.layers.length;i++)
          map.removeLayer(map.layers[i]);

    if(map.events)
        map.events.remove('click');

    try{
        for(var i=0;i<map.controls.length;i++)
            map.controls[i].destroy();
    }catch(err){;}

    try{
        map.destroy();
    }catch(err){;}
}

function mapInit()
{
    if(typeof map == 'object')
        destroyKarte();

    map with new options
    
    layers as previous
    
    controls as previous

} 

Arnd

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von k_karo at web.de
Gesendet: Donnerstag, 23. April 2009 20:09
An: users at openlayers.org
Betreff: [OpenLayers-Users] reload map

Hi,

how can I reload the map (baselayer + overlays) with a different projection?
I can use setOptions to change projection, mapExtent and units, but how can
I reload the map?


Thanks!
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list