mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-12-09 15:24:31 +00:00
move slippy map
This commit is contained in:
29
map/slippy/index-leaflet.html
Normal file
29
map/slippy/index-leaflet.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<script src="/javascript/leaflet/leaflet.js"></script>
|
||||
<link href="/javascript/leaflet/leaflet.css" rel="stylesheet"/>
|
||||
<div id="osm-map"></div>
|
||||
<script>
|
||||
// this file found on an expo laptop and put into the VCS in 2019
|
||||
// Where you want to render the map.
|
||||
var element = document.getElementById('osm-map');
|
||||
|
||||
// Height has to be set. You can do this in CSS too.
|
||||
element.style = 'height:300px;';
|
||||
|
||||
// Create Leaflet map on map element.
|
||||
var map = L.map(element);
|
||||
|
||||
// Add OSM tile leayer to the Leaflet map.
|
||||
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
|
||||
// Target's GPS coordinates.
|
||||
// This is Budapest, why ?!
|
||||
var target = L.latLng('47.50737', '19.04611');
|
||||
|
||||
// Set map's center to target with zoom 14.
|
||||
map.setView(target, 14);
|
||||
|
||||
// Place a marker on the same location.
|
||||
L.marker(target).addTo(map);
|
||||
</script>
|
||||
Reference in New Issue
Block a user