mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-12-08 21:26:14 +00:00
Signed-off-by: Jon Koops <jonkoops@gmail.com> Co-authored-by: Florian Bischof <design.falke@gmail.com>
34 lines
904 B
HTML
34 lines
904 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Leaflet debug page - Popup Offset</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.js"
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
<script type="module">
|
|
import {TileLayer, Map, Marker} from 'leaflet';
|
|
|
|
const osm = new TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {maxZoom: 18});
|
|
const map = new Map('map').setView([50.5, 30.51], 15).addLayer(osm);
|
|
|
|
new Marker(map.getCenter())
|
|
.addTo(map)
|
|
.bindPopup('A pretty CSS popup. <br> Easily customizable.', {
|
|
offset: [100, 200],
|
|
})
|
|
.openPopup();
|
|
</script>
|
|
</body>
|
|
</html>
|