0

I'm currently working on a project to use openlayers 5's observable to observe some items in the map and respond accordingly.

http://openlayers.org/en/latest/apidoc/module-ol_Observable-Observable.html

What I want to do is every time the view's center changes, I want to call a function. I'm doing this currently (but its not working).

view.on('center', function(event){
    // do something with the center
});

Any tips?

twoLeftFeet
  • 693
  • 1
  • 5
  • 25

1 Answers1

2

Got it. I was missing the text "change".

view.on('change:center', function(){});
twoLeftFeet
  • 693
  • 1
  • 5
  • 25