簡體   English   中英

OpenLayers 4.5.0:moveend事件

[英]OpenLayers 4.5.0: moveend event

我使用moveend事件從服務器獲取GeoJson功能。

map.on('moveend', function () {
    reloadVectors({
       'extent': extent,
       'resolution': resolution
    });
});

function reloadVectors(extent, resolution) {...ajax request here...}

特別是在密集縮放,平移或調整屏幕大小時,發生了太多請求。 是否可以以某種方式將地圖移動推遲到繪制先前數據的那一刻?

將異步指示為false可以正常工作

$.ajax({    
   url: url,
   type: 'POST',
   async: false,
   dataType: 'json',
   data: data
}).done(function (result) {
...
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM