I've got a KML, where several points have the same coordinate, similar to following code:
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>test.kml</name>
<visibility>0</visibility>
<open>1</open>
<Placemark>
<name>Place 1</name>
<Point>
<coordinates>7.0901548880586,50.723973666434,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Place 2</name>
<Point>
<coordinates>7.0901548880586,50.723973666434,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
If I click on the POI in an OpenLayers-map, only the last point can be selected. Google Maps' solution to the problem are next- and previous-buttons, in Google Earth the placemark "splits" into two (or more) placemarks so you can select one of the placemarks.
Is it possible to create a similar behaviour in OpenLayers?
There is an analog problem if there are two KMLs with placemarks with the same coordinate. I need a solution for this problem, too.
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>test1.kml</name>
<visibility>0</visibility>
<open>1</open>
<Placemark>
<name>Place 1</name>
<Point>
<coordinates>7.0901548880586,50.723973666434,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>test2.kml</name>
<visibility>0</visibility>
<open>1</open>
<Placemark>
<name>Place 2</name>
<Point>
<coordinates>7.0901548880586,50.723973666434,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
contextallows you to view all the features of the cluster (see arrayfeature.clustereach item of them have a style (from KML) get byfeature.cluster[i].attributes.styleUrlandfeature.cluster[i].style ...) . – xamamano -jorix- Apr 08 '13 at 15:02feature.cluster[0].style.externalGraphicwas the right hint. When I'll cluster features with different icons I'll a) use circles as proposed by you, b) the icon of the most important feature (like http://openflights.org/blog/2009/10/21/customized-openlayers-cluster-strategies/ ) or c) the icon, which represent the most features of the cluster.Once again many thanks for your help! When I'll ever get >15 reputation I'll +1 your comments! You provided great answers to my (newbie-) questions!
– ischas Apr 08 '13 at 15:27