jda_m06/uf02/exercici_nasa/leafletMap.html
2022-02-16 16:13:08 +01:00

41 lines
1.4 KiB
HTML
Executable file

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
<script src="https://unpkg.com/esri-leaflet@2.5.3/dist/esri-leaflet.js"
integrity="sha512-K0Vddb4QdnVOAuPJBHkgrua+/A9Moyv8AQEWi0xndQ+fqbRfAFd47z4A9u1AW/spLO0gEaiE1z98PK1gl5mC5Q==" crossorigin=""></script>
<style>
#map {
width: 600px;
height: 400px;
}
</style>
</head>
<body>
<div id="map">
</div>
<script>
var map = L.map('map').setView([41.388, 2.159], 12);
L.esri.basemapLayer('Topographic').addTo(map);
var marker = L.marker([41.41727206818063, 2.1993105855207733]).addTo(map);
marker.bindPopup("<b>Hello world!</b><br>I am a popup.");
marker.on('click', () => {
marker.openPopup();
});
</script>
</body>
</html>