【问题标题】:Show the whole world on iOS google maps App在 iOS 谷歌地图 App 上展示整个世界
【发布时间】:2013-03-16 18:02:53
【问题描述】:

在使用新的 Google Maps sdk 创建的 iOS 应用程序上,是否有一个选项可以以某种方式进一步缩小?比如展示整个世界?

【问题讨论】:

    标签: google-maps-sdk-ios


    【解决方案1】:

    GMSCameraPosition.h 包含两个常量

    /**
     * The maximum zoom (closest to the Earth's surface) permitted by the map
     * camera.
     */
    FOUNDATION_EXTERN const CGFloat kGMSMaxZoomLevel;
    
    /**
     * The minimum zoom (farthest from the Earth's surface) permitted by the map
     * camera.
     */
    FOUNDATION_EXTERN const CGFloat kGMSMinZoomLevel;
    

    您可以说:

    self.googleMap.camera = [GMSCameraPosition    
    cameraWithLatitude:self.googleMap.camera.target.latitude
    longitude:self.googleMap.camera.target.longitude
    zoom:kGMSMinZoomLevel
    bearing:self.googleMap.camera.bearing
    viewingAngle:self.googleMap.camera.viewingAngle];
    

    如果 self.googleMap 是您的 GMSMapView。 (可能有更简单的方法,但这可行)

    无法进一步缩小以查看 3D 地球仪或 smtg。 为此,您将需要 Google 地球。

    【讨论】:

    • 谢谢,工作。迅速:让相机= GMSCameraPosition.cameraWithLatitude(self.mapView.camera.target.latitude,经度:self.mapView.camera.target.longitude,缩放:kGMSMinZoomLevel,方位:self.mapView.camera.bearing,viewingAngle:self. mapView.camera.viewingAngle)
    猜你喜欢
    • 2020-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-20
    相关资源
    最近更新 更多