Skip to content

Commit

Permalink
fix(olHelpers): changed to view.animate instead of ol.animation and m…
Browse files Browse the repository at this point in the history
…ap.beforeRender
  • Loading branch information
mfdev1 authored and juristr committed Feb 14, 2018
1 parent e7a0708 commit ca6b0d1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/services/olHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
},

Expand Down

0 comments on commit ca6b0d1

Please sign in to comment.