[OpenLayers-Users] http protocol problem
Christopher Schmidt
crschmidt at metacarta.com
Wed Nov 5 09:30:51 EST 2008
On Wed, Nov 05, 2008 at 06:26:16AM -0800, Jerome Freyre wrote:
>
> Hi Didrik,
>
> It is strange... I do almost the same thing and it is working...
> The only change is that I use the OpenLayers.Strategy.Fixed() and
> OpenLayers.Strategy.Cluster()
Yes, you need to use a strategy that requests features. Cluster does
not. Fixed does. So use a Fixed strategy, and a cluster strategy:
strategies: [ new OpenLayers.Strategy.Fixed(), new
OpenLayers.Strategy.Cluster()]
> In Firebug, can you see the HTTP Request when the layer is loaded? In the
> response do you have the correct geojson?
>
> In my case the protocol work fine on the first load but if I want to load
> new features, I have to use protocol.read() and a callback function like
> you.
>
>
> Didrik Pinte-5 wrote:
> >
> > vector_layer = new OpenLayers.Layer.Vector('Points', {
> > styleMap : styleMap,
> > strategies : [
> > new OpenLayers.Strategy.Cluster()
> > ],
> > protocol: new OpenLayers.Protocol.HTTP( {
> > url : 'stream.json',
> > format: new OpenLayers.Format.GeoJSON()
> > })
> > });
> >
>
> --
> View this message in context: http://www.nabble.com/http-protocol-problem-tp20341795p20342693.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
--
Christopher Schmidt
MetaCarta
More information about the Users
mailing list