Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
38 righe
1.1 KiB
38 righe
1.1 KiB
2 anni fa
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
|
||
|
<head>
|
||
|
<title>Center Position Control - Simple</title>
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||
|
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
|
||
|
<link rel="stylesheet" href="http://xguaita.github.io/Leaflet.MapCenterCoord/dist/L.Control.MapCenterCoord.min.css" />
|
||
|
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
|
||
|
<script src="http://xguaita.github.io/Leaflet.MapCenterCoord/dist/L.Control.MapCenterCoord.min.js"></script>
|
||
|
<style>
|
||
|
body {
|
||
|
padding: 0;
|
||
|
margin: 0;
|
||
|
}
|
||
|
html, body, #map {
|
||
|
height: 100%;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<div id="map" class="map"></div>
|
||
|
|
||
|
<script>
|
||
|
var map = L.map('map').setView([39.588, 2.935], 9);
|
||
|
|
||
|
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||
|
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
||
|
}).addTo(map);
|
||
|
|
||
|
L.control.mapCenterCoord().addTo(map);
|
||
|
</script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|