I am currently trying to convert a project from TWebGMaps to TMSFNCGoogleMaps.
Hi,
We are investigating if a similar OnClusterClick event can be added in the next version of TTMSFNCGoogleMaps.
That would be very much appreciated. We'll continue to convert the project in hopes to soon have the means to read into the cluster data.
Note that cluster support is already available in the current version of TMS FNC Maps for TTMSFNCGoogleMaps.
This update will be available with the next release of TMS FNC Maps.
Awesome, thank you!
Hello Bart,
Thanks for the update, we've downloaded and are working on it.
We're trying to put together sample project that demonstrates the new cluster support, and specifically the ability to assign custom images.
var
Marker : TTMSFNCGoogleMapsMarker;
c : TTMSFNCGoogleMapsCluster;
begin
c := TMSFNCGoogleMaps1.Clusters.Add;
c.ImagePath := 'file:///c:/temp/';
Marker := TTMSFNCGoogleMapsMarker(TMSFNCGoogleMaps1.AddMarker(72, -90, 'test'));
Marker.DataString := 'test marker';
Marker.Cluster := c;
Marker := TTMSFNCGoogleMapsMarker(TMSFNCGoogleMaps1.AddMarker(72.555, -90, 'test'));
Marker.DataString := 'test marker 2';
Marker.Cluster := c;
TMSFNCGoogleMaps1.Clusters[0].ImagePath := 'file:///c:/temp/';
Setting the ImagePath for the clusters isn't working for us under this sample. We can copy/paste the ImagePath into Windows Explorer and it opens correctly into the temp folder.
We've also tried setting it directly to the png ( c.ImagePath := 'file:///c:/temp/1.png';
) which doesn't work.
Your sample code is working as expected when tested here.
Can you please make sure the code is executed after OnMapInitialized event has fired?
Example:
procedure TForm1.mMapInitialized(Sender: TObject);
var
Marker : TTMSFNCGoogleMapsMarker;
c : TTMSFNCGoogleMapsCluster;
begin
c := m.Clusters.Add;
c.ImagePath := 'file:///c:/temp/';
Marker := TTMSFNCGoogleMapsMarker(m.AddMarker(72, -90, 'test'));
Marker.DataString := 'test marker';
Marker.Cluster := c;
Marker := TTMSFNCGoogleMapsMarker(m.AddMarker(72.555, -90, 'test'));
Marker.DataString := 'test marker 2';
Marker.Cluster := c;
end;
Something must be different. Here's some debugging steps I took.
I used the Debug console and inspected the cluster. I found the img tag (see first attachment).
I copied the image tag to index.html (saved in C:\Temp) (See second attachment).
index.html works and loads the image.
index.html (169 Bytes)
Can you please make sure the LocalFileAccess property is set to True?
That did it. Thank you sir.