【问题标题】:How to get CGPoint of location with google maps sdk for iOS?如何使用适用于 iOS 的 google maps sdk 获取位置的 CGPoint?
【发布时间】:2013-02-25 12:05:03
【问题描述】:

如何使用适用于 iOS 的 google maps sdk 获取 CGPoint 位置? 我需要在用户位置上添加 pinview。

【问题讨论】:

    标签: google-maps-sdk-ios


    【解决方案1】:

    this question基本相反,例如:

    GMSMapView* mapView = ...;
    CLLocationCoordinate2D coordinate = ...;
    ...
    CGPoint point = [mapView.projection pointForCoordinate: coordinate];
    

    【讨论】:

      【解决方案2】:

      好的,根据您的问题,您是否要将用户位置转换为 cgpoint,是吗? 尝试使用这个。

      CGPoint newCenter = [self.map convertCoordinate:coord toPointToView:self.map];
      

      问候。

      【讨论】:

      • 我需要从地图上的用户位置获取窗口的CGPoint。
      • 对不起,我第一次没有得到你的问题,如果你要求从用户位置坐标转换为cgpoint,那么有一个方法,我已经编辑了我的代码。希望对您有所帮助。
      猜你喜欢
      • 2020-07-08
      • 1970-01-01
      • 2014-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多