Tips and Frequently Asked Questions
Zooming to fit all annotations in MapView
Below is some code that zooms the map to view all annotations that have been added. Add the unit FMX.TMSNativeUICore in the uses list to have access to the MKCoordinateRegion record.
procedure TForm1.ZoomToFit; var maxCoord: TTMSFMXNativeMKMapLocation; minCoord: TTMSFMXNativeMKMapLocation; coord: TTMSFMXNativeMKMapLocation; I: Integer; rgnm: MKCoordinateRegion; begin maxCoord.Latitude := -90; maxCoord.Longitude := -180; minCoord.Latitude := 90; minCoord.Longitude := 180; for I := 0 to TMSFMXNativeMKMapView1.Annotations.Count - 1 do begin coord := TMSFMXNativeMKMapView1.Annotations[I].Location; if coord.Longitude > maxCoord.Longitude then maxCoord.Longitude := coord.Longitude; if coord.Latitude > maxCoord.Latitude then maxCoord.Latitude := coord.Latitude; if coord.Longitude < minCoord.Longitude then minCoord.Longitude := coord.Longitude; if coord.Latitude < minCoord.Latitude then minCoord.Latitude := coord.Latitude; end; rgnm.center.longitude := (minCoord.Longitude + maxCoord.Longitude) / 2; rgnm.center.latitude := (minCoord.Latitude + maxCoord.Latitude) / 2; rgnm.span.longitudeDelta := maxCoord.Longitude - minCoord.Longitude; rgnm.span.latitudeDelta := maxCoord.Latitude - minCoord.Latitude; TMSFMXNativeMKMapView1.MapView.setRegion(rgnm, True); end;
Pricing
Single Developer License
Small Team License
Site License
TMS iCL
€ 125
€
75
yearly renewal
license for 1 developer
BEST VALUE
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.