Mapview - Zoom to streetlevel

Hi !

Can someone please help me with this ?

I can't figure out how to zoom 1 annotation which is places in the center,
to street level. This is the only annotation on my Mapview.

Does anyone have an example for this ?

All i get is "the whole world".

Cheers !

Paul

Hi, 


You can set the region of the map with optional animation with 

TMSFMXNativeMKMapView1.SetRegion(rgn, True);

The rgn variable can be filled with the annotation location and a span:

var
  rgn: TTMSFMXNativeMKMapRegion;
  ann: TTMSFMXNativeMKAnnotation;
begin
  ann := TMSFMXNativeMKMapView1.AddAnnotation(50.44321, 3.12345, 'Hi', 'Hello World');

  rgn.Center.Latitude := ann.Location.Latitude;
  rgn.Center.Longitude := ann.Location.Longitude;

  rgn.Span.latitudeDelta := 0.5;
  rgn.Span.longitudeDelta := 0.5;
  TMSFMXNativeMKMapView1.SetRegion(rgn, True);

The amount of zooming is determined with the delta properties which are both 0.5. 

Kind Regards, 
Pieter

Pieter Scheldeman2013-07-02 09:59:01

Hi Pieter,

Works !

Thanks alot,

Cheers