MKMapview place pin at location (long/lat)

后端 未结 6 1692
说谎
说谎 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

    -(MKPointAnnotation *)showClusterPoint:(CLLocationCoordinate2D)coords withPos:(NSString *)place
    {
        float  zoomLevel = 0.5;
        region = MKCoordinateRegionMake (coords, MKCoordinateSpanMake (zoomLevel, zoomLevel));
        [mapView setRegion: [mapView regionThatFits: region] animated: YES];
    
        point = [[MKPointAnnotation alloc]init];
        point.coordinate = coords;
        point.title=place;
    
        [mapView addAnnotation:point];
    
        return point;
    }
    

提交回复
热议问题