Dynamic switching and Location Reset

Hi TMS Team,

from FNC Maps PDF file / doc

Dynamic switching
>>A feature of TTMSFNCMaps is dynamic switching. It allows switching to another service even though you have already added markers, polygons, polylines, ... The only settings that are not persisted are the default location and zoom which are re-initialized to the default values. 
--------------------------------------------------------

how to read current GPS and Zoom, before switching map providers?
we can use  SetCenterCoordinate; SetZoomLevel then.

I've configured all (6 + 1) map providers.
Map provider X may show info that is not available in Map provider Y. etc. 
Our customers may need to switch map providers depending on info that they want to analyze: 
live traffic conditions or street view, or basic OpenLayers (free).  

IMO the ideal behavior in this case would be a new option: sync location and zoom level
If it's doable of course.

Thank you

Hi,


We have investigated this here and add 2 new methods: TMSFNCMaps1.GetCenterCoordinate & TMSFNCMaps1.GetZoomLevel. They respectively trigger OnGetCenterCoordinate & OnGetZoomLevel events asynchronously. We have added the following code to persist the new values in the default values and use them upon dynamically switching to another map server.



procedure TForm1.DoGetCenterCoordinate(Sender: TObject;
  ACoordinate: TTMSFNCMapsCoordinateRec);
begin
  m.Options.DefaultLatitude := ACoordinate.Latitude;
  m.Options.DefaultLongitude := ACoordinate.Longitude;
end;


procedure TForm1.DoGetZoomLevel(Sender: TObject; AZoomLevel: Double);
begin
  m.Options.DefaultZoomLevel := Round(AZoomLevel);
end;


Please note though that the zoom level is not a global zoom level but the actual zoom level of the map itself, which might differ from other map services. The next version will have this available.

great. waiting for new version. thank you.

Hi, I've tested FNC Maps version from May 26, using all 7 map providers . 

Default Long/Lat works very good - allows to see almost the same streets for all maps providers - it's what we actually need.
Yes, zoom is different... not critical. Thank you.

Thank you for your feedback!