Skip to content

Commit 2eb4b57

Browse files
committed
Don't pan when it's the same location
1 parent 8bf53e8 commit 2eb4b57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mapml/features/feature.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export var Feature = L.Path.extend({
5353

5454
_focusOnTab: function (e){
5555
if(e.originalEvent.keyCode === 9){
56-
this._map.panTo(e.target.getCenter());
56+
let layerCenter = this.getCenter();
57+
if (layerCenter.equals(this._map.getCenter())) return;
58+
this._map.panTo(layerCenter);
5759
}
5860
},
5961

0 commit comments

Comments
 (0)