mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-23 10:04:18 -08:00
* switching to MapLibre (see more at https://github.com/usds/justice40-tool/issues/299) * Removing traces of OpenLayers * Review comments - removing unused properties, component This is a pre-requisite for addressing issue #280 and other similar control-related tickets
23 lines
551 B
JavaScript
23 lines
551 B
JavaScript
/* MAP */
|
|
|
|
// For some interactions, we need access to the underlying map
|
|
// Below adapted from https://github.com/codeforcologne/edelgard-map
|
|
Cypress.Commands.add('getMap', () => {
|
|
return cy.window().its('underlyingMap');
|
|
});
|
|
|
|
Cypress.Commands.add('waitForMove', (map) => {
|
|
return new Cypress.Promise((resolve) => {
|
|
map.on('moveend', resolve);
|
|
});
|
|
});
|
|
|
|
Cypress.Commands.add('panTo', (map, lngLat) => {
|
|
map.panTo(lngLat);
|
|
cy.waitForMove(map);
|
|
});
|
|
|
|
Cypress.Commands.add('getMapCanvas', () => {
|
|
return cy.get('.maplibregl-canvas');
|
|
});
|
|
|