aboutsummaryrefslogtreecommitdiffhomepage
path: root/addon/index.mjs
blob: 2494ec4bb82c8454155089f278e33f020d2f4980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const { Leaflet } = window.mapclay.renderers
const simpleRender = window.mapclay.renderWith(config => ({
  use: 'Leaflet',
  width: '100%',
  height: '200px',
  XYZ: 'https://tile.openstreetmap.jp/styles/osm-bright/512/{z}/{x}/{y}.png',
  ...config,
  aliases: {
    use: { Leaflet },
    ...(config.aliases ?? {}),
  },
}))

window.generateMaps(document.querySelector('main') ?? document.body, {
  crs: url.searchParams.get('crs') ?? 'EPSG:4326',
  initialLayout: '',
  render: simpleRender,
})