Search code examples
gmlib

How to use TGMCircle?


I am having some issues when trying to plot a Marker and for some cases a Circle. The problem itself is about how to do that with the proper manner.

Here is the flow I am using:

  1. set GMap.RequiredProp.Center values

  2. on the AfterPageLoaded event I will wait the First to be false value so I set my GMMarker and GMCircle (this one as needed). I am using one design time object for the Marker and the Circle, so I only to change it´s values.

  3. When I get a new information, such Lat/Lon, I set it´s visibility to false, apply the new values and set it again to true.

Also, to ensure that the new position will appear centered in the map, after the first load I set a flag so next time I will use the GMMap1.PanTo() do force center. If I don't use that, the map will no be centered and if I use I have some issues when using the mouse to pan, and sometimes the Circle gets very huge, not respecting the value of Radius...

I will appreciate any reply about that.


Solution

  • To center the map on a figure, you can use the CenterMapTo method that have all the figures (for TMarker is CenterMapToMarker).

    Regards