【问题标题】:Zoom HERE maps to show all markers Flutter缩放 HERE 地图以显示所有标记 Flutter
【发布时间】:2021-01-13 13:45:09
【问题描述】:

我在 Flutter 应用的 HERE 地图上显示了多个位置。总共有 4 个标记,其中 3 个标记在一个城市,1 个在另一个城市。目前,我的地图缩放到一个城市中只有 3 个标记可见,而第 4 个不可见的级别。为了看到那个标记,我必须缩小相当大的水平。

有没有办法,我可以显示地图范围内的所有标记?

我有 android 的答案,但 Flutter 没有。

Zoom HERE maps to show all markers Android

【问题讨论】:

  • 您好,请发布您已有的代码,以便人们可以帮助您解决问题

标签: flutter here-api heremaps


【解决方案1】:

基于此answer on android。我已经尝试过颤振,它奏效了。

 GeoBox target = GeoBox.containingGeoCoordinates(geoCoordinateList);
_hereMapController.camera
      .lookAtAreaWithOrientation(target, MapCameraOrientationUpdate(20, 0));

geoCoordinateListMapMarkerGeoCoordinates 的列表,在 HERE map 上可见

如果您在按钮单击时使用它,则直接使用它。如果您在将地理坐标添加到 geoCoordinateList 后直接使用它,则延迟使用它

Future.delayed(Duration(milliseconds: 10)).then((value) {
  GeoBox target = GeoBox.containingGeoCoordinates(geoCooList);
  _hereMapController.camera
      .lookAtAreaWithOrientation(target, MapCameraOrientationUpdate(20, 0));
});

【讨论】:

    猜你喜欢
    • 2020-01-23
    • 2013-01-27
    • 1970-01-01
    • 2011-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多