【问题标题】:how to get address from gms marker from google map?如何从谷歌地图的gms标记获取地址?
【发布时间】:2016-05-13 17:42:34
【问题描述】:

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

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

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

【问题讨论】:

    标签: ios google-maps gmsmapview


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:
      - (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");
      
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-01-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-28
        相关资源
        最近更新 更多