|
349 | 349 | path._path.setAttribute("aria-expanded", "false"); |
350 | 350 | /* jshint ignore:start */ |
351 | 351 | 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"){ |
353 | 353 | path.openTooltip(); |
354 | 354 | } else { |
355 | 355 | path.closeTooltip(); |
|
372 | 372 | }, |
373 | 373 |
|
374 | 374 | _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; |
380 | 389 | } |
| 390 | + path.focus(); |
| 391 | + this._map._targets[path._leaflet_id].openTooltip(); |
| 392 | + this._map.closePopup(); |
381 | 393 | }, |
382 | 394 |
|
383 | 395 | _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; |
389 | 406 | } |
| 407 | + path.focus(); |
| 408 | + this._map._targets[path._leaflet_id].openTooltip(); |
| 409 | + this._map.closePopup(); |
390 | 410 | }, |
391 | 411 |
|
392 | 412 | _getNativeVariables: function(mapml){ |
|
0 commit comments