Cluster Demo

Hi,

Where can I download the cluster demo shown in the documentation but not in the demos folder?

Ken

Hi,


Unfortunately this demo was missing from the TMS WebGMaps download.
The missing demo files have now been added, can you please re-download?

Many thanks.

I would like to automatically cluster markers that overlay other markers depending on the zoom the same way as is done in MarkerClusterer. Any advice on how to achieve this?

All Markers that are part of the same Cluster will automatically be clustered or separated based on the zoom level of the map.

The behavior can be configured with the Cluster properties. Please see the "TWebGmaps.Clusters properties" section in the PDF manual for detailed information.

Markers can be added to a Cluster by assigning the Marker.Cluster property.
Examples can be found in the MarkerClusterDemo.




Perhaps I didn't explain what I wanted very well. My markers are houses. They will be fairly local and could well overlay one anothe depending on the zoom level. I want to cluster themif they are too close together but don't know what to cluster them on? I also want to automatically zoom to whatever level shows all of the markers.

  • Although there is no specific property to automatically cluster overlapping Markers, you can try to set the Cluster.GridSize property to a low value.

    - You can use the Markers.Bounds call to retrieve the bounds coordinates of all markers.
    Then use MapZoomTo(TBounds) to zoom to the level where all markers are visible.

Thanks. I previously tried using WebGMaps1.MapZoomTo(WebGMaps1Markers.Bounds)but this seemingly had no effect.

Further to this, in my Form's OnShow event I have the following code:

  LoadMarkers;
  WebGMap.Launch;
  Bnds:=WebGMap.Markers.Bounds;
  Ok:=WebGMap.MapZoomTo(Bnds);
  Bnds.Free;

There are 63 markers and they do appear on the screen but the result of the function MapZoomTo is false!

Ken

Hi,


Can you please use the WebGMaps OnDownloadFinish event to call MapZoomTo instead of the Form OnShow event?
This event is triggered as soon as the map has finished loading.

Thanks, that solved it.