Skip to content

Commit 27c4862

Browse files
committed
Implement Ahmad's M.options.announceMovement
1 parent 82849d6 commit 27c4862

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

src/mapml-viewer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ export class MapViewer extends HTMLElement {
200200
projection: this.projection,
201201
query: true,
202202
contextMenu: true,
203-
//Will replace with M.options.announceMoves
204-
announceMovement: true,
203+
announceMovement: M.options.announceMovement,
205204
mapEl: this,
206205
crs: M[this.projection],
207206
zoom: this.zoom,

src/web-map.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ export class WebMap extends HTMLMapElement {
214214
projection: this.projection,
215215
query: true,
216216
contextMenu: true,
217-
//Will replace with M.options.announceMoves
218-
announceMovement: true,
217+
announceMovement: M.options.announceMovement,
219218
mapEl: this,
220219
crs: M[this.projection],
221220
zoom: this.zoom,

test/e2e/core/announceMovement.test.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const playwright = require("playwright");
1+
const playwright = require("playwright");
22
jest.setTimeout(50000);
33
(async () => {
44
for (const browserType of BROWSER) {
@@ -22,13 +22,6 @@ jest.setTimeout(50000);
2222
});
2323

2424
test("[" + browserType + "]" + " Output values are correct during regular movement", async ()=>{
25-
const announceMovement = await page.$eval(
26-
"body > mapml-viewer",
27-
(map) => map._map.announceMovement._enabled
28-
);
29-
if(!announceMovement){
30-
return;
31-
}
3225
await page.keyboard.press("Tab");
3326
await page.keyboard.press("ArrowUp");
3427
await page.waitForTimeout(100);
@@ -61,13 +54,6 @@ jest.setTimeout(50000);
6154
});
6255

6356
test("[" + browserType + "]" + " Output values are correct at bounds and bounces back", async ()=>{
64-
const announceMovement = await page.$eval(
65-
"body > mapml-viewer",
66-
(map) => map._map.announceMovement._enabled
67-
);
68-
if(!announceMovement){
69-
return;
70-
}
7157
//Zoom out to min layer bound
7258
await page.keyboard.press("Minus");
7359
await page.waitForTimeout(100);

test/e2e/core/debugMode.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jest.setTimeout(50000);
169169
"xpath=//html/body/mapml-viewer >> css=div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-overlay-pane > svg > g",
170170
(tile) => tile.childElementCount
171171
);
172-
expect(feature).toEqual(4);
172+
expect(feature).toEqual(3);
173173
});
174174

175175
test("[" + browserType + "]" + " Layer deselected then reselected", async () => {

test/e2e/mapml-viewer/mapml-viewer.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<head>
55
<title>Basic Mapml-Viewer</title>
66
<meta charset="UTF-8">
7+
<script>
8+
let options = document.createElement("map-options");
9+
options.innerHTML = '{"announceMovement":true}';
10+
document.head.appendChild(options);
11+
</script>
712
<script type="module" src="mapml-viewer.js"></script>
813
<style>
914
html {

0 commit comments

Comments
 (0)