简体   繁体   中英

OpenLayers 4.5.0: moveend event

I use moveend event to obtain GeoJson features from server.

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

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

Too many requests occur while intensive zoom, pan or resize of screen especially. Is it possible somehow to defer map movement until the moment when previous data will be drawn?

Stetting async to false does all work

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM