1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
var s = new OpenLayers.Style({
strokeColor: '#794a31',
pointRadius: 5,
fillColor: '#00ce00'
});
var mstyle = new OpenLayers.StyleMap(s);
var clusterStrategy = new OpenLayers.Strategy.Cluster({distance: 10, threshold: 3}); //je regroupe touts les points distant de moins de 10 pixels ,quand il y en au moins 3
var trees = viewer.getMap().addLayer(
"WFS",
'Trees',
"http://localhost/cgi-bin/mapserv.exe?map=c%3A%5Cms4w%5Cdev%5Cwfs%5Cwfs.map&",
{
typename:'trees_wfs',
strategies: [clusterStrategy]
},
{
featurePrefix:'ms',
featureNS:'http://mapserver.gis.umn.edu/mapserver',
geometryName:'msGeometry',
projection:'EPSG:2154',
maxExtent:new OpenLayers.Bounds(653227.687500,6858349.000000, 657171.625000, 6861778.000000),
styleMap:mstyle,
visibility:true
}
); |
Partager