1

I am using ol-cesium and I want to receive an event when the map is rotated. So my approach is to use the change:rotation event of the ol.Map, but it is never called.

this.map = new ol.Map({
        layers: [
            tileLayer
        ],
        controls: [],
        target: 'map',
        view: new ol.View({
            center: ol.proj.fromLonLat([12.372542, 47.426919]),
            zoom: 12,
            minZoom: 12
        }),
    });

    this.map.getView().on('change:rotation', () => {
        console.log("fired");
    });

I am also using typescript but this shouldn't be the problem. My development browser is Google Chrome.

  • which version of OL do you use? if it's latest one, it seems the error is caused with ol-cesium. – Chase Choi Sep 6 '17 at 7:21
  • I am using OL 4.3.2. Ok so there would be no better solution to just poll the rotation on this.mapView.map.on('movestart', () => {})? – Oliver Adam Sep 6 '17 at 18:03

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.