![](/img/trans.png)
[英]How to get all visible points in the map view bounds in Azure Maps
[英]how to get the map bounds?
我正在從傳單遷移回來,然后如果需要地圖綁定,則使用以下代碼:
var b = map.getBounds();
$scope.filtromapa.lat1 = b.getSouth();
$scope.filtromapa.lat2 = b.getNorth();
$scope.filtromapa.lng1 = b.getWest();
$scope.filtromapa.lng2 = b.getEast();
有效緯度/經度位置的那些值,因此我可以將其發送到后端,並查詢該區域內的任何位置。
我如何使用openlayers做到這一點?
現在我所擁有的是:
var b = map.getView().calculateExtent(map.getSize());
但是這些位置不是有效的緯度/經度位置。
我正在使用openlayers 3.19.1
遵循https://gis.stackexchange.com/questions/122250/how-to-get-the-feature-location-in-openlayers-v3中的答案( 及其假設 )
var currentExtent = map.getView().calculateExtent(map.getSize()),
TLpoint = ol.extent.getTopLeft( currentExtent ),
BRpoint = ol.extent.getBottomRight( currentExtent ),
TLcoords = ol.proj.transform( TLpoint, 'EPSG:3857', 'EPSG:4326' ),
BRcoords = ol.proj.transform( BRpoint, 'EPSG:3857', 'EPSG:4326' );
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.