[OpenLayers-Users] Polygon Cluster
Jerome Freyre
jerome.freyre at hispeed.ch
Mon Oct 27 12:15:24 EDT 2008
It's Jerome ;)
Unfortunaly not... All the feature added in a Layer that use the cluster
strategy will be represented as a point.
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().
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.
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 at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
View this message in context: http://www.nabble.com/Polygon-Cluster-tp20189385p20190954.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list