[OpenLayers-Dev] Modifiying Vector layer protocol URL and forcing a layer refresh

Zac Spitzer zac.spitzer at gmail.com
Mon Aug 22 11:23:14 EDT 2011


try creating the refresh strategy as an object itself, adding it to the layer
and then calling refresh on that object, or access the strategy under
the layer object and call refresh on it

On Tue, Aug 23, 2011 at 1:19 AM, joe.tito <joetito1 at gmail.com> wrote:
> I have created a vector layer with an auto refreshing georss feed and I'm
> trying to figure out how to force the layer to refresh after I change the
> URL of the protocol. Whenever a user moves the map, I'm trying to pass the
> current extent of the map to my PHP page that returns my GeoRSS feed.
>
> Here is the code I have used to create the vector layer:
>
> *markers = new OpenLayers.Layer.Vector("Markers", {
>    strategies: [new OpenLayers.Strategy.Fixed(),
>                     new OpenLayers.Strategy.Refresh({interval:
> refreshTime}),
>                    new OpenLayers.Strategy.Cluster({distance: 15, threshold: 1})],
>    protocol: new OpenLayers.Protocol.HTTP({
>        url:  "http://mysite.com/maps/georss.php",
>        format: new OpenLayers.Format.GeoRSS()
>    }),
>    styleMap: new OpenLayers.StyleMap({"default": style})
>  });*
>
> Here is how I am changing the protocol url:
>
> *markers.protocol.url = "http://zoobl.com/maps/georss.php?pointCount=10";*
>
> I just can't seem to figure out the proper way to force my vector layer to
> refresh on command instead of waiting for the next refresh period to hit.
>
>
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Modifiying-Vector-layer-protocol-URL-and-forcing-a-layer-refresh-tp6711991p6711991.html
> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>



-- 
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168


More information about the Dev mailing list