I tried you're example but no luck so far.<br>
I've added the strategie;<br>
<pre>kml_layer = new OpenLayers.Layer.Vector("KML", {
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
styleMap: myClusterStyleMap,
protocol: new OpenLayers.Protocol.HTTP({
url: filename,
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true,
maxDepth: 3
})
})
});</pre>And my style map;<br><br>
<pre> var myClusterStyleMap = OpenLayers.StyleMap(
{
'default': new OpenLayers.Style(
{
externalGraphic: '${myGrafic}',
label: '${count}'
},
{
context:
{
count: function(feature)
{
if (feature.cluster)
{ // is `.cluster` the array of clustered features
return feature.cluster.length; // or feature.attributes.count, is the same
} else
{ // is not clustered
return ''; // no label
}
},
myGrafic: function(feature)
{
if (feature.cluster)
{
return 'OpenLayers-2.12/img/marker.png';
} else {
return 'OpenLayers-2.12/img/marker-green.png';
}
}
}
}
}); </pre>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/Need-help-for-Cluster-strategy-using-externalGraphic-tp5037985p5038006.html">Re: Need help for Cluster strategy using externalGraphic</a><br/>
Sent from the <a href="http://osgeo-org.1560.n6.nabble.com/OpenLayers-Users-f3910695.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>