Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mapml/control/AttributionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export var AttributionButton = Control.Attribution.extend({
}
let locale = this._getLocale();
this._container.innerHTML =
`<summary><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 0 24 24" width="30px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"></path></svg></summary>` +
`<summary title="${locale.btnAttribution}" aria-label="${locale.btnAttribution}"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 0 24 24" width="30px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"></path></svg></summary>` +
'<div class="mapml-attribution-container">' +
`<button onclick="this.closest(\'.leaflet-container\').querySelector(\'.shortcuts-dialog\').showModal()" class="shortcuts-button mapml-button">${locale.kbdShortcuts}</button> | ` +
prefixAndAttribs.join(' <span aria-hidden="true">|</span> ') +
Expand Down
11 changes: 11 additions & 0 deletions test/e2e/mapml-viewer/mapml-viewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ test.describe('Playwright mapml-viewer Element Tests', () => {
expect(arialabel).toEqual('Map data attribution');
});

test('Ensure attribution summary has a localized title tooltip', async () => {
let title = await page.evaluate(
`document.querySelector('mapml-viewer')._map.attributionControl._container.querySelector('summary').getAttribute('title')`
);
expect(title).toEqual('Map data attribution');
let arialabel = await page.evaluate(
`document.querySelector('mapml-viewer')._map.attributionControl._container.querySelector('summary').getAttribute('aria-label')`
);
expect(arialabel).toEqual('Map data attribution');
});

test('Initial map element extent', async () => {
await page.waitForTimeout(500);
const extent = await page.$eval('body > mapml-viewer', (map) => map.extent);
Expand Down
Loading