Skip to content

Commit

Permalink
L.Yandex: fix panning lags
Browse files Browse the repository at this point in the history
It's that simple. Just wrong function was used)

Fix shramov#253, and part of shramov#111.

Note: zoom animation still fails
(shramov#129)
  • Loading branch information
johndoe committed May 24, 2019
1 parent 3d35176 commit c5619d2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions layer/tile/Yandex.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,9 @@ L.Yandex = L.Layer.extend({
this._resize(force);

var center = this._map.getCenter();
var _center = [center.lat, center.lng];
var zoom = this._map.getZoom();

if (force === true || this._yandex.getZoom() !== zoom) {
this._yandex.setCenter(_center,zoom);
} else {
this._yandex.panTo(_center, {duration: 0, delay: 0});
}
var setZoom = (force === true || this._yandex.getZoom() !== zoom) && zoom;
this._yandex.setCenter([center.lat, center.lng], setZoom);
},

_resize: function (force) {
Expand Down

0 comments on commit c5619d2

Please sign in to comment.