[OpenLayers-Users] IE strategies
Yves Moisan
yves.moisan at boreal-is.com
Thu Jan 8 16:03:54 EST 2009
> What you are describing looks like you do not use the BBOX strategy.
Andreas,
Here's my vector layer :
pts_gps = new OpenLayers.Layer.Vector("GeoJSON", {
strategies: [new OpenLayers.Strategy.BBOX(),new
OpenLayers.Strategy.Cluster()],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://myserver:8080/PGTEST4326/all.json",
format: new OpenLayers.Format.GeoJSON(),
params:{maxfeatures: 100}
}),
format: new OpenLayers.Format.GeoJSON(),
styleMap: new OpenLayers.StyleMap({
"default": style,
"select": {
fillColor: "#8aeeef",
strokeColor: "#32a8a9"
}
})
});
> Add
> OpenLayers.Strategy.BBOX to your vector layer's strategies array. This
> will also ensure that, once you are zoomed in far enough, all features
> will be visible, even if you set a maxfeatures parameter.
To illustrate what I was saying in the previous email, here's a bunch of
screenshots :
maxFeatures= 1000 :
http://www.flickr.com/photos/30818159@N05/3180683492/
maxFeatures= 1000, zoomed in :
http://www.flickr.com/photos/30818159@N05/3179845579/
maxFeatures= 5 : http://www.flickr.com/photos/30818159@N05/3180683598/
maxFeatures= 5, zoomed in :
http://www.flickr.com/photos/30818159@N05/3179845687/
The first level of zoom is the same for both maxFeature values. Zooming
in mean I hit the + sign on the OL control once. You can see (well
almost) that when I zoom in with maxFeature = 5, i get *3* clusters each
worth 1 feature. It is clear from the zoomed in example with
maxFeatures = 1000 that there *are* more than 3 features at that zoom
level so I was expecting to see 5 features spread into N <= 5 clusters
so something is wrong there. If I zoom into the top right portion of my
zoomed out window, I see no feature. The same rubberband zoom with
maxFeatures = 1000 gives me some features ??
I saw a thread explaining the issue but I don't remember where. I will
investigate further and report if I find an explanation.
Cheers,
Yves
More information about the Users
mailing list