Hi Denis,<br/><br/>thanks for your answer.<br/>addBuilding is a custom function that creates a vector on the vector layer with a special icon.<br/>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?<br/><br/>I really appreciate your fast and competent answer!<br/><br/>Regards<br/>Stefan<br/><br/><br/><br/><blockquote style="border-left: 2px solid blue; margin-left: 5px; padding-left:5px; padding-top:5px;"><hr/><b>Von:</b> "dr [via OSGeo.org]" <<a href="/user/SendEmail.jtp?type=node&node=6779018&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>><br/><b>Gesendet:</b> Sep 10, 2011 2:16:52 PM<br/><b>An:</b> chemiker <<a href="/user/SendEmail.jtp?type=node&node=6779018&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>><br/><b>Betreff:</b> Re: Can't get clustering work<br/><br/>Hi!<br/><br/>What is addBuilding function?<br/><br/>I'm not sure about cluster strategy may be used with markers. I'm prefer to use features, because markers are deprecated:<br/><br/><pre><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></pre><br/><br/><div class="signature" style="margin-top:1em;color:#666666;font-size:11px;">Denis Rykov<br/>NextGIS<br/><a href="" target="_top" rel="nofollow" link="external">click here</a>.</div></blockquote> <br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="https://img.ui-portal.de/p.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font-size:12px; line-height:17px;">Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die <br>Toolbar eingebaut! <a href="http://produkte.web.de/go/toolbar" target="_top" rel="nofollow" link="external"><b>http://produkte.web.de/go/toolbar</b></a></td></tr></table>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Can-t-get-clustering-work-tp6777723p6779018.html">Re: Can't get clustering work</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>