Files
leaflet/docs/examples/overlays/example-image.md
Florian Bischof 20654cd159 Replace Mapbox with OpenStreetMap (#7818)
* Replace Mapbox with OpenStreetMap

Replace Mapbox with OpenStreetMap

* Revert Gemfile

* Replace blanks with tabs

* Fix lint

* Replace Mapbox with OSM

* Add OSM Tile Usage Policy link

* typo: productive→production

Co-authored-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2022-05-27 11:33:15 +03:00

943 B

layout, title
layout title
tutorial_frame Image Overlay Tutorial
<script> var map = L.map('map').setView([37.8, -96], 4); var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© OpenStreetMap' }).addTo(map); var imageUrl = 'https://maps.lib.utexas.edu/maps/historical/newark_nj_1922.jpg'; var errorOverlayUrl = 'https://cdn-icons-png.flaticon.com/512/110/110686.png'; var altText = 'Image of Newark, N.J. in 1922. Source: The University of Texas at Austin, UT Libraries Map Collection.'; var latLngBounds = L.latLngBounds(40.799311, -74.118464], [40.68202047785919, -74.33); var imageOverlay = L.imageOverlay(imageUrl, latLngBounds, { opacity: 0.8, errorOverlayUrl: errorOverlayUrl, alt: altText, interactive: true }).addTo(map); L.rectangle(latLngBounds).addTo(map); map.fitBounds(latLngBounds); </script>