首页 > 解决方案 > 如何在 iOS 中通过 HereMap SDK 使用 `extrudedBuildingsVisible` 属性

问题描述

我正在使用适用于 iOS 的 here-SDK 实现 3d 地图(建筑物视图),但我找不到实现此目的的方法。我已经看到了适用于 Android 的 HERE Maps 3D 建筑物的工作,但它不适用于 iOS

我跟着这个链接

这是我的示例代码

func mapSetup() {
    
    // Setup map viewx
    self.mapView.positionIndicator.isAccuracyIndicatorVisible = true
    self.mapView.positionIndicator.type = .current
    self.mapView.positionIndicator.isVisible = true
    self.mapView.extrudedBuildingsVisible = true
    self.mapView.landmarksVisible = true
    self.mapView.alpha = 1
    self.mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    self.mapView.translatesAutoresizingMaskIntoConstraints = false
    self.mapView.padding = UIEdgeInsets.init(top: 15, left: 15, bottom: 15, right: 15)
    self.mapView.zoomLevel = 0
    
    self.navigationManager.delegate = self
    self.mapView.gestureDelegate = self
}

问题:

如何在 iOS 中实现 3d 地图(建筑物视图)?

谢谢

标签: iosswifthere-apiheremaps-ios-sdk

解决方案


如果没有指定倾斜,地图必须看起来平坦。

这就是我通过以下代码得到的

let geoCoordCenter = NMAGeoCoordinates(latitude: 49.260327, longitude: -123.115025)
self.mapView.set(geoCenter: geoCoordCenter, animation: .none)

self.mapView.positionIndicator.isAccuracyIndicatorVisible = true
self.mapView.positionIndicator.type = .current
self.mapView.positionIndicator.isVisible = true
self.mapView.extrudedBuildingsVisible = true
self.mapView.landmarksVisible = true
self.mapView.alpha = 1
self.mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
self.mapView.translatesAutoresizingMaskIntoConstraints = false
self.mapView.padding = UIEdgeInsets.init(top: 15, left: 15, bottom: 15, right: 15)

self.mapView.zoomLevel = 19
self.mapView.tilt = self.mapView.maximumTilt(atZoomLevel: 19)

在此处输入图像描述

罗马:

罗马

巴黎:

巴黎


推荐阅读