Skip to content

Commit d148f2d

Browse files
prushforprushforth
authored andcommitted
Get rid of unused location variable in AnnounceMovement.js
Comment out / remove call to private leaflet map function in map-feature In AnnounceMovement.announceBounds function Change: visible = mapZoom <= this._map._layersMaxZoom && mapZoom >= this._map._layersMinZoom && this._map.totalLayerBounds.overlaps(mapBounds); To: visible = mapZoom <= this._map.getMaxZoom() && mapZoom >= this._map.getMinZoom() && this._map.totalLayerBounds.overlaps(mapBounds); Change: _map._layersMaxZoom usage to _map.getMaxZoom() everywhere Get rid of unused location variable in AnnounceMovement.focusAnnouncement function.
1 parent 13b2b41 commit d148f2d

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/map-feature.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class MapFeature extends HTMLElement {
229229
// todo: dynamically update layer bounds of vector layer
230230
mapmlvectors.layerBounds = M.getBounds(this._layer._content);
231231
// update map's zoom limit
232-
this._map._addZoomLimit(mapmlvectors);
232+
// this._map._addZoomLimit(mapmlvectors);
233233
// TODO: can be set as a handler of featureLayer
234234
mapmlvectors._resetFeatures();
235235
L.extend(mapmlvectors.options, mapmlvectors.zoomBounds);

src/mapml/handlers/AnnounceMovement.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ export var AnnounceMovement = L.Handler.extend({
4545
: mapEl.shadowRoot.querySelector('.leaflet-container');
4646

4747
let mapZoom = mapEl._map.getZoom();
48-
let location = M._gcrsToTileMatrix(mapEl);
4948
let standard = M.options.locale.amZoom + ' ' + mapZoom;
5049

51-
if (mapZoom === mapEl._map._layersMaxZoom) {
50+
if (mapZoom === mapEl._map.getMaxZoom()) {
5251
standard = M.options.locale.amMaxZoom + ' ' + standard;
5352
} else if (mapZoom === mapEl._map._layersMinZoom) {
5453
standard = M.options.locale.amMinZoom + ' ' + standard;
@@ -75,8 +74,8 @@ export var AnnounceMovement = L.Handler.extend({
7574
let visible = true;
7675
if (this._map.totalLayerBounds) {
7776
visible =
78-
mapZoom <= this._map._layersMaxZoom &&
79-
mapZoom >= this._map._layersMinZoom &&
77+
mapZoom <= this._map.getMaxZoom() &&
78+
mapZoom >= this._map.getMinZoom() &&
8079
this._map.totalLayerBounds.overlaps(mapBounds);
8180
}
8281

@@ -86,8 +85,6 @@ export var AnnounceMovement = L.Handler.extend({
8685
)
8786
: this.shadowRoot.querySelector('.mapml-screen-reader-output');
8887

89-
//GCRS to TileMatrix
90-
let location = M._gcrsToTileMatrix(this);
9188
let standard = M.options.locale.amZoom + ' ' + mapZoom;
9289

9390
if (!visible) {
@@ -113,7 +110,7 @@ export var AnnounceMovement = L.Handler.extend({
113110
let prevZoom = this._history[this._historyIndex - 1]
114111
? this._history[this._historyIndex - 1].zoom
115112
: this._history[this._historyIndex].zoom;
116-
if (mapZoom === this._map._layersMaxZoom && mapZoom !== prevZoom) {
113+
if (mapZoom === this._map.getMaxZoom() && mapZoom !== prevZoom) {
117114
output.innerText = M.options.locale.amMaxZoom + ' ' + standard;
118115
} else if (mapZoom === this._map._layersMinZoom && mapZoom !== prevZoom) {
119116
output.innerText = M.options.locale.amMinZoom + ' ' + standard;

src/mapml/keyboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ L.Map.Keyboard.include({
4040
}
4141
} else if (key in this._zoomKeys) {
4242
if (
43-
(key in zoomIn && map._layersMaxZoom !== map.getZoom()) ||
43+
(key in zoomIn && map.getMaxZoom() !== map.getZoom()) ||
4444
(key in zoomOut && map._layersMinZoom !== map.getZoom())
4545
)
4646
map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);

0 commit comments

Comments
 (0)