Jens Wölpert
2 years ago
4 changed files with 77 additions and 43 deletions
-
13execution.js
-
44functions.js
-
20index.html
-
43map.js
@ -1,11 +1,4 @@ |
|||||
(async () =>{ |
(async () =>{ |
||||
console.log( getAllCoordinates('route2')) |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
//var polyline = L.polyline(newArray, {color: 'red'}).addTo(map);
|
|
||||
//map.fitBounds(polyline.getBounds());
|
|
||||
//connectDB('route2')
|
|
||||
|
|
||||
})(); |
|
||||
|
//displayRoute();
|
||||
|
//showBike()
|
||||
|
})(); |
@ -1,19 +1,32 @@ |
|||||
|
|
||||
|
|
||||
|
|
||||
var map = L.map('map').setView([49.416075235, 8.6722049], 13); |
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
|
||||
zoom: 44, |
|
||||
attribution: '© OpenStreetMap' |
|
||||
|
|
||||
}).addTo(map) |
|
||||
|
|
||||
|
|
||||
//L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
|
|
||||
//var marker = L.marker([49.41607523,8.67220049]).addTo(map);
|
|
||||
//var polyline = L.polyline(newArray, {color: 'red'}).addTo(map);
|
|
||||
//map.fitBounds(polyline.getBounds());
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
var map = L.map('map').setView([49.41607523, 8.672200499], 19); |
||||
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
||||
|
maxZoom: 44, |
||||
|
attribution: '© OpenStreetMap' |
||||
|
}).addTo(map); |
||||
|
|
||||
|
// helper function for displayRoute()
|
||||
|
async function prepare(){ |
||||
|
var allcoordinates = getAllCoordinates('coordinates'); |
||||
|
return allcoordinates; |
||||
|
} |
||||
|
|
||||
|
async function displayRoute() { |
||||
|
var allcoordinates = await prepare(); |
||||
|
console.log(allcoordinates); |
||||
|
//var marker = L.marker([49.41607523,8.67220049]).addTo(map);
|
||||
|
var polyline = L.polyline(allcoordinates, {color: 'red'}).addTo(map); |
||||
|
map.fitBounds(polyline.getBounds()); |
||||
|
map.fitBounds(polyline.getBounds()); |
||||
|
} |
||||
|
|
||||
|
async function showBike(){ |
||||
|
var current_cord = await getCurrentCoordinate() |
||||
|
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); |
||||
|
L.marker(current_cord).addTo(map) |
||||
|
.bindPopup(' Your BIKE!') |
||||
|
.openPopup(); |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue