需要为HERE地图添加区域边界.例如:我想在flutter平台上添加特定城市的地图视图边界



如何在flutter平台上显示特定城市的HERE地图上的视图边界?

首先,您需要为您的城市获取属性中可用的边界框"boundingBox";of Place对象https://developer.here.com/documentation/flutter-sdk-explore/4.6.2.0/api_reference/search/Place/boundingBox.html

要搜索您的城市并查看其视图边界,请使用以下代码示例(未测试(:

await (new SearchEngine()).searchByText("DEU Berlin", SearchOptions.withDefaults(),
(SearchError searchError, List<here.Place> placeList) async {
if (SearchError == null) {
here.Place place = placeList.first;
_hereMapController.camera.lookAtAreaWithOrientation(place.boundingBox, MapCameraOrientationUpdate.withDefaults());
} else {
var error = searchError.toString();
}
});

其他帮助链接:

https://github.com/heremaps/here-sdk-examples/blob/master/examples/latest/explore/flutter/camera_app/lib/CameraExample.darthttps://github.com/heremaps/here-sdk-examples/blob/master/examples/latest/explore/flutter/routing_app/lib/RoutingExample.darthttps://developer.here.com/documentation/flutter-sdk-explore/4.6.2.0/api_reference/mapview/MapCamera/lookAtAreaWithOrientation.htmlhttps://developer.here.com/documentation/flutter-sdk-explore/4.6.2.0/api_reference/search/SearchEngine/searchByText.html

最新更新