Problems with a WebGMapsMainDemo descendent

Hello 

I have problems with a WebGMapsMainDemo descendent. If I add markers in the Vienna region
I calculate the mean value for the coordinates MeanLat and MeanLon and pan to it. 
 WebGMaps1.MapPanTo(MeanLat,MeanLon);
  WebGmaps1.MapOptions.ZoomMap := 6;

But the map is opened at Paris afterwards. But I cannot find, where Paris is selected neither by its coordinates 48.8 and 2.34 nor by address.

I searched all files in project but no hint, why Paris is selected.


If I then run  
procedure TFrmMain.btnPanto1Click(Sender: TObject);
begin
  WebGMaps1.MapPanTo(MeanLat,MeanLon);
  WebGmaps1.MapOptions.ZoomMap := 6;
end;

the map is opened correctly in the Vienna region.

What do I overlook?

Sincerely Peter

Hi,


Assuming you are calling MapPanTo before the OnDownloadFinish event was triggered, can you please try calling MapPanTo and ZoomMap from the OnDownloadFinish event?

The default location where the map is displayed is indeed Paris. This is defined in the MapOptions.DefaultLatitude and MapOptions.DefaultLongitude properties.

Hi,


Thank you a lot. Putting

  WebGMaps1.MapPanTo(MeanLat,MeanLon);
  WebGmaps1.MapOptions.ZoomMap := 6;

in the OnDownloadFinish event did the trick!
Sincerely Peter

Thank you for confirming the issue was resolved.