Hello
After I zoom, or move the TTMSFMXWebGMaps how can I get the new [latitude,longitude] center position of the map?
Also, how can I show a marker on the center of the map even when I'm moving it, scrolling or zooming?
Thanks
The idea of the marker at center of the TTMSFMXWebGMaps is to have a reference in the entire screen.
Thanks
You can use
You can add a marker at the latitude & longitude positions of your choice.
Thanks Bruno
But the NEW center values of latitudeand longitude AFTER move the map, zooming or resize where do I find them?
I mean the new position values of the center where is saved?
The center is the middle of the TBounds you can retrieve via calling WebGMaps.GetMapBounds and that are returned via the event OnBoundsRetrieved.
Bruno
It is longitude / latitude.
TBounds is defined in UWebGMapsCommonFunctions:
Bruno
Once again, I'm looking just a simple two values as I wrote you before, one single value for latitude and one single value for longitude.
Seems you return cardinals values. When I add a marker or specify the DefaulLatitude and DefaultLongitude for start the Map your component require me just two floating point values correct?
Not NorthEast and SouthWest longitude and latitude values, seems you need to unify your own source code and make it pratical to us right?
I'm offering help on what's available and you can use right-now.
I will assume a formula like:
- Formula looks correct2) One call to GetMapBounds results in BoundsRetrieved triggered one time
Bruno
Is there possible to remove all the links of the map?
I already adjust the properties in order to hide: map type, zoom level and so on.... But on the botton appears the google and the source info weblinks, so if for some reason I click on them my map will be forwarded to that weblink address.
The Google info/links at the right-bottom of the page is a restriction of Google and cannot be removed.
Alright
Is there possible to draw over the map some shape, or put some picture in that position, so that restriction be hidden?
Or maybe catch the event before redirect to the info/links?
I have not tried that. You could try to put a polygon rectangle in that position but I doubt Google wouldn't be smart enough to put their copyright always on top.
Let me try it, polygon must be draw on some canvas property?
This is some sample code to add a polygon:
- pol: TPolygonItem;
- pt: TPath;
- pi: TPathItem;
- pt := TPath.Create();
- pi := pt.Add();
- pi.Latitude := 50;
- pi.Longitude := 2;
- pi := pt.Add();
- pi.Latitude := 50;
- pi.Longitude := 3;
- pi := pt.Add();
- pi.Latitude := 55;
- pi.Longitude := 2.5;
- pol := WebGMaps1.Polygons.Add(false, false, false, pt, clRed, clYellow, 255, 255, 2, true, 255);
- WebGMaps1.CreateMapPolygon(pol.Polygon);