Hello, Le Monday 27 October 2008 17:15:24 Jerome Freyre, vous avez écrit : > It's Jerome ;) oupss, sorry Jerome! > Unfortunaly not... All the feature added in a Layer that use the cluster > strategy will be represented as a point. Ok I undestand now :) > If at a certain level of zoom you want to display the feature as his "real > representation" (point, polygon, linestring), you can use the method > deactivate(). hum, I will try this as all my polygon seems to need to be not clustered for the same zoom level.
> In a project, I purpose to the user to (de)activate the "clustering mode". > If the user feel that the map is not "readable" he can (de)activate the > mode by clicking a checkbox. Well, why not, but it could be interesting to get something to simplify the polygon in a point for some zoome level, then a simplier polygon and finally to get the real polygon. It could be interesting to cluster the polygon vertex as it was point. Anyway, thanks Jerome you answered to my problem :) Y. > I think it is interessant to let the user choose to activate or not the > mode!? > > Jacolin Yves wrote: > > 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 > > _______________________________________________ > > Users mailing list > > Users@openlayers.org > > http://openlayers.org/mailman/listinfo/users -- Yves Jacolin --- http://softlibre.gloobe.org _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users