Skip to content

Commit 062f4de

Browse files
committed
[AUTO] Sync MapML Build
1 parent 8f27b2c commit 062f4de

1 file changed

Lines changed: 31 additions & 11 deletions

File tree

dist/mapml.js

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@
349349
path._path.setAttribute("aria-expanded", "false");
350350
/* jshint ignore:start */
351351
L.DomEvent.on(path._path, "keyup keydown", (e)=>{
352-
if((e.keyCode === 9 || e.keyCode === 16) && e.type === "keyup"){
352+
if((e.keyCode === 9 || e.keyCode === 16 || e.keyCode === 13) && e.type === "keyup"){
353353
path.openTooltip();
354354
} else {
355355
path.closeTooltip();
@@ -372,21 +372,41 @@
372372
},
373373

374374
_previousFeature: function(e){
375-
this._map.closePopup();
376-
if(this._source._path.previousSibling){
377-
this._source._path.previousSibling.focus();
378-
} else {
379-
this._source._path.focus();
375+
let path = this._source._path.previousSibling;
376+
if(!path){
377+
let currentIndex = this._source._path.closest("div.mapml-layer").style.zIndex;
378+
let overlays = this._map.getPane("overlayPane").children;
379+
for(let i = overlays.length - 1; i >= 0; i--){
380+
let layer = overlays[i];
381+
if(layer.style.zIndex >= currentIndex) continue;
382+
path = layer.querySelector("path");
383+
if(path){
384+
path = path.parentNode.lastChild;
385+
break;
386+
}
387+
}
388+
if (!path) path = this._source._path;
380389
}
390+
path.focus();
391+
this._map._targets[path._leaflet_id].openTooltip();
392+
this._map.closePopup();
381393
},
382394

383395
_nextFeature: function(e){
384-
this._map.closePopup();
385-
if(this._source._path.nextSibling){
386-
this._source._path.nextSibling.focus();
387-
} else {
388-
this._source._path.focus();
396+
let path = this._source._path.nextSibling;
397+
if(!path){
398+
let currentIndex = this._source._path.closest("div.mapml-layer").style.zIndex;
399+
400+
for(let layer of this._map.getPane("overlayPane").children){
401+
if(layer.style.zIndex <= currentIndex) continue;
402+
path = layer.querySelector("path");
403+
if(path)break;
404+
}
405+
if (!path) path = this._source._path;
389406
}
407+
path.focus();
408+
this._map._targets[path._leaflet_id].openTooltip();
409+
this._map.closePopup();
390410
},
391411

392412
_getNativeVariables: function(mapml){

0 commit comments

Comments
 (0)