Guest User

Untitled

a guest
Apr 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. const source = this.map.getSource('my-source');
  2.  
  3. function loop() {
  4. source.on('data', requestFrame);
  5. source.setData(updatedGeoJson);
  6. }
  7.  
  8. function requestFrame(event) {
  9. if (event.dataType !== 'source') {
  10. return;
  11. }
  12.  
  13. source.off('data', this.requestFrame);
  14. requestAnimationFrame(loop);
  15. }
Add Comment
Please, Sign In to add comment