Thanks,
Slim
There are a few ways to answer this question. Partially it depends
what you mean by "merge". I'm assuming you don't mean you wish to
merge the content of the two placemarks so one balloon shows both.
In KML, if you have too many points to display in the client, a common
technique that is in the KML spec is to use Region based views (See
http://code.google.com/apis/kml/documentation/regions.html ), so that
as you zoom in, more Placemarks will appear.
However this is not quite the same as having two Placemarks actually
'merge' into one when they get close, based on the zoom level. For
your KML data, this will have to take place on the client side.
Assuming you are using either Earth or Maps, the behavior will be
different. By default, Google Earth will take a KML you created that
has some Placemarks that are close to eachother at a given zoom level,
and display them as a single 'clustered' placemark. If you click one
of these 'clusters' it will split them up and display each individual
Placemark so you can then select which to view.
There are also a variety of ways to have Google Maps display clustered
markers, but it will not automatically do this if you simply load a
KML into it using, for example, GGeoXml. If you wish to process the
KML manually, you can add individual GMarkers to Google Maps, and use
one of variety of methods to then cluster them. One example of this
type of clustering can be found at
http://gmaps-utility-library-dev.googlecode.com/svn/trunk/markerclusterer/examples/simple_example.html
Cheers,
-Josh