Hi Denis, thanks for your answer. addBuilding is a custom function that creates
a vector on the vector layer with a special icon. I already use vectors instead
of markers, apologies for my unclear description. I do have a vector layer and
place different vectors of OL.Features.Vector on it. But I can't get the
clustering work so far. The only difference between your code and mine is that
you add 'autoactivate: true' to your Cluster constructor, I don't know if this
is mandatory for the clustering to work, I will test it on Monday. Any other
comments on that? I really appreciate your fast and competent answer! Regards
Stefan Von: "dr [via OSGeo.org]"
<[email protected]> Gesendet: Sep 10, 2011
2:16:52 PM An: chemiker <[email protected]> Betreff: Re: Can't get
clustering work Hi! What is addBuilding function? I'm not sure about cluster
strategy may be used with markers. I'm prefer to use features, because markers
are deprecated: <html><body>
<div id="mapdiv"></div>
<script
src="http://openlayers.org/dev/OpenLayers.js"></script>
<script>
map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer('', {isBaseLayer: true, maxExtent: new
OpenLayers.Bounds(-200,-200,200,200)}));
var buildingLayer= new OpenLayers.Layer.Vector("Buildings",
{maxExtent: new OpenLayers.Bounds(-200,-200,200,200),
strategies: [new OpenLayers.Strategy.Cluster({autoActivate: true,
distance: 100})]
});
map.addLayer(buildingLayer);
buildingLayer.addFeatures([new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(-50.126,36.755)),
new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(-100.196,43.215)),
new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(-150.556,56.615)),
new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(-170.423,35.510))]);
map.zoomToMaxExtent();
</script>
</body></html> Denis Rykov NextGIS http://www.nextgis.org/ If you
reply to this email, your message will be added to the discussion below:
http://osgeo-org.1803224.n2.nabble.com/Can-t-get-clustering-work-tp6777723p6778619.html
To unsubscribe from Can't get clustering work, click here . Schon
gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Can-t-get-clustering-work-tp6777723p6779018.html
Sent from the OpenLayers Users mailing list archive at Nabble.com._______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users