2

I am building an API on top of OpenLayers 3. I can't display here the whole code for professional reasons. This is a bit how my classes look like.

// external file xgis.js

xgis = {};


// xgis.map
xgis.map = function(options) {
    // map definitions ...
};
// Inherits from ol.Map
goog.inherits(xgis.map, ol.Map);

The goal is to build an SDK, which I named here "xgis". We want to implement some callbacks. For example, when I perform a zoomIn, I have a callback named onZoomIn that executes some code. I know that it is done with the event "moveend", like in this fiddle.

Now, I want to implement some callback functions:

  • onZoomIn --> fires after a zoom in
  • onZoomOut --> fires after a zoom out
  • onMapReady --> fires when the map is ready (has loaded all the layers)
  • onPanEnd --> fires when the drag/pan has ended

Are there other events in OpenLayers 3, like "zoomend" or something?

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.