ZoomToBounds Issue

Using the following code in procedure TFormFNCMaps.TMSFNCGoogleMaps1MapInitialized(Sender: TObject), a lot of the LH marker's popup info is obscured as you can see here:

BoundsRec:= CreateBounds(Max(LatD,LatA), Max(LongD,LongA), Min(LatD,LatA), Min(LongD,LongA));

While the map can be moved (or zoomed out) to reveal the whole popup, it would be helpful to have a variable buffer zone to allow both popups to be displayed in full on initial display. This can be done 'manually' using, for example:

BoundsRec:= CreateBounds(Max(LatD,LatA), Max(LongD,LongA) + 3, Min(LatD,LatA), Min(LongD,LongA) - 3);

the zoomout factor is too great. Perhaps there is a better way of doing this?

Happy New Year!

Hi William,

Unfortunately there is currently no built-in functionality available to include the size of the popups in the Bounds calculation.
You'll indeed have to manually change the Bounds values to change the map's position and/or change the zoom level.

Ok Bart, thanks.