/
githubmirror
/
Leaflet
Обзор
Документация
Войти
/
githubmirror
/
Leaflet
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
debug/tests/dragging-cursors.html
53 строки
2 KB
Simon Legner
Rename `Map` to `LeafletMap` and keep `Map` as alias (#9892)
11 ноя 2025, 21:28
Не верифицирован
11 ноя 2025, 21:28
2e9b617
Код
Авторство
О чём код?
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Leaflet debug page - Dragging Cursors</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> This page tests if the cursors for dragging the map and the markers behave as expected. The left marker is draggable, the right one is not. <hr> <div>Map dragging enabled:</div> <div id="map1" style="height: 300px;width: 400px; float:left;"></div> <div style="clear:both"></div> <div>Map dragging disabled:</div> <div id="map2" style="height: 300px;width: 400px; float:left;"></div> <script type="module"> import {TileLayer, Marker, LeafletMap, LatLng} from 'leaflet'; function addLayerAndMarkers(map) { new TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map); new Marker([20, -120.3], {draggable: true}).addTo(map); new Marker([50.5, 30.5], {draggable: false}).addTo(map); } const map1 = new LeafletMap('map1', { center : new LatLng(0, -30), zoom : 0, dragging : true, }); const map2 = new LeafletMap('map2', { center : new LatLng(0, -30), zoom : 0, dragging : false, }); addLayerAndMarkers(map1); addLayerAndMarkers(map2); </script> </body> </html>