[OpenLayers-Users] refresh map

?? weimin_su at 126.com
Wed Jul 2 00:42:47 EDT 2008


Fabio D'Ovidio,
I used this codes to refresh my georss layer.I don't know whether it will be helpful for you or not.

//categoryMapMarkers = new OpenLayers.Layer.GeoRSSM2Ex( '??????', loca, {'icon':schoolIcon});

categoryMapMarkers.clearFeatures();
categoryMapMarkers.initialize(categoryMapMarkers.name, categoryMapMarkers.location, categoryMapMarkers.options);

And as to refresh map, I just destroy it and rebuild.
    if(map)
    {
        map.destroy();
        map = null;
    }
map = new OpenLayers.Map("map", options);


----- Original Message ----- 
From: "Fabio D'Ovidio" <fabiodovidio at gmail.com>
To: <users at openlayers.org>
Sent: Tuesday, July 01, 2008 4:27 PM
Subject: [OpenLayers-Users] refresh map


> Hi!
> Is there a simple way to refresh map (for example ajaxable) after doing 
> some changes on my layers (i am drawing them trought WFS-T).
> Now i am simply using something like that:
> 
> JavaScript:location.reload(true);
> 
> I could use also:
> WMS_LAYER.mergeNewParams({'foo': Math.random()});
> 
> but i'd like to refresh the whole map..
> 
> Thanks
> 
> -- 
> Ing. Fabio D'Ovidio
> 
> INOVA Open Solutions s.r.l.
> Web : http://www.inovaos.it
> Tel.: 081 197 57 600
> mail: fabiodovidio at gmail.com
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


More information about the Users mailing list