HERE SDK Flutter:平滑相机 + 移除 3D 建筑

HERE SDK Flutter : Smooth Camera + remove 3D building

我们使用heresdk-4.5.3.0-release进行Flutter版导航

“导航”时,地图摄像头移动不平稳,不像“Here WeGo”商店中的官方应用那样流畅。

如您的文档所述,我们使用“LocationEngine”检索 phone 的位置,并在“addLocationListener”函数中注入一个“VisualNavigator”。

那么,我们就有了更新地图的这种功能(在你的例子中找到的功能):

  // Update location and rotation of map. Update location of arrow.
  void _updateMapView(HERE.GeoCoordinates currentGeoCoordinates, double bearingInDegrees) {
    HERE.MapCameraOrientationUpdate orientation = HERE.MapCameraOrientationUpdate.withDefaults();
    orientation.bearing = bearingInDegrees;
    orientation.tilt = 180.0;
    _hereMapController.camera.lookAtPointWithOrientationAndDistance(
      currentGeoCoordinates,
      orientation,
      100,
    );
    _navigationArrow.coordinates = currentGeoCoordinates;
  }

怎样才能让镜头移动流畅?

我们无法删除默认地图上的3D建筑物,我们如何才能获得2D地图。谢谢

更新

关于我对相机流动性的担忧,我测试直接在class“VisualNavigator”中使用“startRendering”这个方法:

https://developer.here.com/documentation/flutter-sdk-navigate/4.5.1.0/api_reference/navigation/VisualNavigator/startRendering.html

通过此实现,我可以获得流畅的导航体验,但是,我无法更改“位置标记”的图像:(

如果您 运行 flutter build [apk/ios] --release 然后安装该应用程序,它通常 运行 比调试版本更流畅。

要禁用挤压建筑物,请使用 setLayerState (https://developer.here.com/documentation/flutter-sdk-explore/4.5.1.0/api_reference/mapview/MapScene/setLayerState.html) from your MapView instance and set LayerState "hidded" for value MapScenLayers.extrudedBuildings (https://developer.here.com/documentation/flutter-sdk-explore/4.5.1.0/api_reference/mapview/MapSceneLayers/extrudedBuildings.html)