angular-openlayers-directive
angular-openlayers-directive copied to clipboard
Moveend Event on a layer
Hi! I would like to know how to listen to a zoom in-out and mouse move (center change) event on a layer, just to make a WMS request each time that happends. I tried the following code but it doesn't work:
$scope.$on('openlayers.layers.ccaa.moveend', function(event, feature){ .... });
Thanks
Hey, something like this may work.
<!-- map.html -->
<openlayers ol-center="vm.center" ...>
</openlayers>
and in the controller
var component = {
templateUrl: 'map.html',
controller: MapController,
controllerAs: 'vm'
};
function MapController($scope) {
var vm = this;
...
$scope.$watch('vm.center', function(newVal, oldVal) {
var zoomLevel = newVal.zoom;
var lat = newVal.lat;
var lng = newVal.lon
});
}
Is there any solution with out using $watch
?.