diff --git a/.travis.yml b/.travis.yml index 53c93858..ead6a30c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ branches: notifications: email: false node_js: - - '4.1' + - '6.1' before_install: - npm i -g npm@^2.0.0 - npm install -g grunt-cli diff --git a/bower.json b/bower.json index a9005096..564b4c8a 100644 --- a/bower.json +++ b/bower.json @@ -13,7 +13,7 @@ "dependencies": { "angular": "1.4.9", "angular-sanitize": "1.4.9", - "openlayers": "https://github.com/openlayers/ol3/releases/download/v3.16.0/v3.16.0-dist.zip" + "openlayers": "https://github.com/openlayers/ol3/releases/download/v4.3.4/v4.3.4-dist.zip" }, "devDependencies": { "jquery": "*", diff --git a/package.json b/package.json index 0f7aa16f..4a05f14a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dependencies": { "angular": "~1.4.8", "angular-sanitize": "~1.4.8", - "openlayers": "~3.18.1" + "openlayers": "~4.3.4" }, "devDependencies": { "grunt": "~0.4.5", @@ -52,7 +52,7 @@ "karma-script-launcher": "~0.1.0", "load-grunt-config": "^0.17.1", "matchdep": "~0.3.0", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.0", "protractor": "~2.5.0", "publish-latest": "^1.1.2", "semantic-release": "^4.3.5" diff --git a/src/directives/center.js b/src/directives/center.js index cb1964df..914281f6 100644 --- a/src/directives/center.js +++ b/src/directives/center.js @@ -179,7 +179,7 @@ angular.module('openlayers-directive').directive('olCenter', function($log, $loc }); olScope.$on('$destroy', function() { - map.unByKey(moveEndEventKey); + ol.Observable.unByKey(moveEndEventKey); }); }); } diff --git a/src/directives/view.js b/src/directives/view.js index c1aa08a2..ed8ab315 100644 --- a/src/directives/view.js +++ b/src/directives/view.js @@ -46,7 +46,7 @@ angular.module('openlayers-directive').directive('olView', function($log, $q, ol }); olScope.$on('$destroy', function() { - map.unByKey(rotationEventKey); + ol.Observable.unByKey(rotationEventKey); }); }); diff --git a/src/services/olHelpers.js b/src/services/olHelpers.js index 00020d29..7e7413f7 100644 --- a/src/services/olHelpers.js +++ b/src/services/olHelpers.js @@ -866,11 +866,10 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $ setCenter: function(view, projection, newCenter, map) { if (map && view.getCenter()) { - var pan = ol.animation.pan({ + view.animate({ duration: 150, - source: (view.getCenter()) + center: view.getCenter() }); - map.beforeRender(pan); } if (newCenter.projection === projection) { @@ -882,11 +881,11 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $ }, setZoom: function(view, zoom, map) { - var z = ol.animation.zoom({ + view.animate({ duration: 150, - resolution: map.getView().getResolution() + resolution: map.getView().getResolution(), + zoom: zoom }); - map.beforeRender(z); view.setZoom(zoom); },