MKMapview place pin at location (long/lat)

后端 未结 6 1815
说谎
说谎 2021-02-01 06:31

I have latitude and long values and I need to be able to drop a pin at this location.

Can anybody provide some advice on how to go about this?

6条回答
  •  我在风中等你
    2021-02-01 07:23

    Find the below very simple solution to drop the pin at given location define by CLLocationCoordinate2D

    Drop Pin on MKMapView

    Edited:

    CLLocationCoordinate2D  ctrpoint;
    ctrpoint.latitude = 53.58448;
    ctrpoint.longitude =-8.93772;
    AddressAnnotation *addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:ctrpoint]; 
    [mapview addAnnotation:addAnnotation];
    [addAnnotation release];
    

提交回复
热议问题