在拖尾事件之后,我面临着获取此处地图中的地图边界的问题。我需要新的经纬度来在新更改的视口中获取一些项目/点。 我只想在拖动结束时获得谷歌地图 map.getBounds().getNorthEast().lat() 的替代方案。
我已经尝试过这些方法,但没有一个返回东北和西南坐标的经纬度位置。
Heremap.addEventListener('dragend', (ev) => {
const target = ev.target;
// console.log(map.getViewModel().getLookAtData().bounds);
// console.log(map.getBounds());
// console.log(target.getViewPort());
// console.log(target.getBoundingBox());
}, false);
Run Code Online (Sandbox Code Playgroud)
小智 4
请看这个文档:
H.map.ViewModel: https://developer.here.com/documentation/maps/topics_api/h-map-viewmodel.html#h-map-viewmodel__getlookatdata
H.map.ViewModel.ILookAtData: https://developer.here.com/documentation/maps/topics_api/h-map-viewmodel-ilookatdata.html#h-map-viewmodel-ilookatdata__bounds
H.geo.Rect https://developer.here.com/documentation/maps/topics_api/h-geo-rect.html#h-geo-rect
这是一些代码片段:
map.addEventListener('dragend', (ev) => {
var bounds = map.getViewModel().getLookAtData().bounds;
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2072 次 |
| 最近记录: |