Main Map: Difference between revisions

From The Lands Of Liberos Project

Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
<syntaxhighlight lang="javascript" line="1">
<syntaxhighlight lang="javascript">
var map = L.map('map', {
var map = L.map('map').setView([51.505, -0.09], 13);

crs: L.CRS.Simple, // CRS.Simple, which represents a square grid:
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
minZoom: -2,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
maxZoom: 1
}).addTo(map);
})

var bounds = [xy(0, 0), xy(1920, 1067)]
L.marker([51.5, -0.09]).addTo(map)
var image = L.imageOverlay('data/Front Page 150.png', bounds)
.bindPopup('A pretty CSS popup.<br> Easily customizable.')
image.addTo(map)
.openPopup();
</syntaxhighlight>
</syntaxhighlight>

Revision as of 18:59, 25 January 2024

var map = L.map('map').setView([51.505, -0.09], 13);

L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

L.marker([51.5, -0.09]).addTo(map)
    .bindPopup('A pretty CSS popup.<br> Easily customizable.')
    .openPopup();
Cookies help us deliver our services. By using our services, you agree to our use of cookies.