3

如何通过这种方法获得纬度经度?

- (void)mapView:(GMSMapView )mapView didEndDraggingMarker:(GMSMarker )marker;

我想在调用 didEndDraggingMarker 时获取地址..

4

2 回答 2

4

您可以latitudelongitude. marker.position使用反向地理编码来获取位置的地址

于 2015-04-28T11:19:43.423 回答
0
- (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate {
    NSLog(@"You tapped at %f,%f", coordinate.latitude, coordinate.longitude);
}
- (void) mapView:(GMSMapView *)mapView didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate{
    NSLog(@"tapped");
}

- (void) mapView:(GMSMapView *)mapView didBeginDraggingMarker:(GMSMarker *)marker{
     isDragging = YES;
    NSLog(@"didBeginDraggingMarker:");
}

- (void)mapView:(GMSMapView *)mapView didEndDraggingMarker:(GMSMarker *)marker{
    isDragging = NO;
    NSLog(@"marker dragged to location: %f,%f", marker.position.latitude, marker.position.longitude);

    NSLog(@"didEndDraggingMarker");

}
于 2015-12-08T07:59:20.360 回答