Last active
December 12, 2018 21:33
-
-
Save codeofsumit/190e2229b4737b2e10145d8347c77c47 to your computer and use it in GitHub Desktop.
index.js inside cypress/support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './commands'; | |
beforeEach(() => { | |
// create the map | |
cy.visit('/index.html', { | |
onLoad: (contentWindow) => { | |
const { L } = contentWindow; | |
// OSM tiles | |
const tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
}) | |
// create the map | |
const map = L.map('map') | |
.setView([51.505, -0.09], 13) | |
.addLayer(tiles); | |
contentWindow.map = map; | |
// add leaflet.pm toolbar | |
map.pm.addControls(); | |
}, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment