[OpenLayers-Users] Polygon Cluster
Jacolin Yves
yjacolin at free.fr
Mon Oct 27 12:07:46 EDT 2008
Le Monday 27 October 2008 16:42:39 Jerome Freyre, vous avez écrit :
> It's normal because the cluster strategy replace your features with points.
>
> The main goal for a cluster strategy is to regroup features that are close
> and make the map the more "readable".
>
> And with the cluster strategy you can change the radius of the clustered
> points like that :
>
> // Définit les styles des features
> var style = new OpenLayers.Style({
> fillColor: "#ee9900",
> fillOpacity: 0.8,
> hoverFillColor: "#ee9900",
> hoverFillOpacity: 0.8,
> strokeColor: "#ee9900",
> strokeOpacity: 0.8,
> strokeWidth: 1,
> strokeLinecap: "round",
> strokeDashstyle: "solid",
> hoverStrokeColor: "blue",
> hoverStrokeOpacity: 1,
> hoverStrokeWidth: 0.2,
> pointRadius: "${radius}",
> hoverPointRadius: 1,
> hoverPointUnit: "%",
> pointerEvents: "visiblePainted",
> cursor: "inherit"
> }, {
> context: {
> radius: function(feature) {
> return Math.min(feature.attributes.count, 9) + 4;
> }
> });
>
> view = new OpenLayers.Layer.Vector("View", {
> // strategies: [fixedStrategy, clusterStrategy,
> lineStringclusterStrategy],
> strategies: [fixedStrategy, clusterStrategy],
> protocol: myprotocol,
> styleMap: new OpenLayers.StyleMap({
> "default": style,
> "select": {
> fillColor: "#8aeeef",
> strokeColor: "#32a8a9"
> }
> })
> });
>
>
> Hope it will help you ;)
Hi Jeremy,
Unfortunately not! The polygons are never shown even if I decrease the
distance to 1 or 2px. I expected to see polygone at some zoom level, even
when I am supposed to see them.
I may be wrong but even the cluster strategy is to regroup features that are
close, I suppose to see polygons when they are quiet far away. Isn't it?
One of the polygon in the link I gave in my first email is quiet big but never
shown (the northest point, surrounding the 9).
Thanks,
Y.
--
Yves Jacolin
---
http://softlibre.gloobe.org
More information about the Users
mailing list