mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-12-08 21:26:14 +00:00
46 lines
1.0 KiB
HTML
46 lines
1.0 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Leaflet debug page - Inherit Dash Array</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0" />
|
|
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
|
<link rel="stylesheet" href="../css/screen.css" />
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"leaflet": "../../dist/leaflet-src.esm.js"
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
<script type="module">
|
|
import {Map, TileLayer, Polygon, CircleMarker} from 'leaflet';
|
|
|
|
const map = new Map('map', {
|
|
center: [20, 20],
|
|
zoom: 3,
|
|
preferCanvas: true,
|
|
});
|
|
|
|
new TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
minZoom: 1,
|
|
maxZoom: 17,
|
|
label: 'open street map',
|
|
}).addTo(map);
|
|
|
|
const points = [
|
|
[0, 0],
|
|
[0, 42],
|
|
[42, 42],
|
|
[0, 0],
|
|
];
|
|
|
|
new Polygon([points, []], {dashArray: '5, 5'}).addTo(map);
|
|
new CircleMarker([42, 0], {color: 'red'}).addTo(map);
|
|
</script>
|
|
</body>
|
|
</html>
|