Files
leaflet/docs/examples/zoom-levels/example-scale.md
chcederquist 9b89ab4eb5 Updated title and descriptions of docs (#9692)
Co-authored-by: Florian Bischof <design.falke@gmail.com>
2025-05-09 18:47:17 +02:00

997 B

layout, title
layout title
tutorial_frame Zoom Scale Example
<script type="module"> import L, {Map, TileLayer, Control} from 'leaflet'; const map = new Map('map', { minZoom: 1, maxZoom: 1, dragging: false }); const cartodbAttribution = '© OpenStreetMap contributors, © CARTO'; const positron = new TileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { attribution: cartodbAttribution }).addTo(map); const scaleControl = new Control.Scale({maxWidth: 150}).addTo(map); setInterval(() => { map.setView([0, 0], 0, {duration: 1, animate: true}); setTimeout(() => { map.setView([60, 0], 0, {duration: 1, animate: true}); }, 2000); }, 4000); map.setView([0, 0], 0); globalThis.L = L; // only for debugging in the developer console globalThis.map = map; // only for debugging in the developer console </script>