2021-03-29 12:05:53 +02:00
|
|
|
|
2021-03-29 12:56:03 +02:00
|
|
|
let span = document.getElementById('latlng');
|
|
|
|
let coordinates = span.innerHTML;
|
2021-03-29 12:05:53 +02:00
|
|
|
|
2021-03-29 12:56:03 +02:00
|
|
|
lat = coordinates.split(",")[0];
|
|
|
|
lng = coordinates.split(",")[1];
|
|
|
|
let latlng = L.LatLng(lat, lng);
|
|
|
|
var mymap = L.map('checkmap').setView([lat, lng], 13);
|
2021-03-29 12:05:53 +02:00
|
|
|
|
2021-03-29 12:56:03 +02:00
|
|
|
|
|
|
|
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
|
|
|
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
|
|
|
|
maxZoom: 18,
|
|
|
|
id: 'mapbox/streets-v11',
|
|
|
|
tileSize: 512,
|
|
|
|
zoomOffset: -1,
|
|
|
|
accessToken: 'pk.eyJ1IjoidW5jbGVzYW11bHVzIiwiYSI6ImNrbXVmanF1bzEwd2Mybm82Nzlobm42bHAifQ.fKY7fUnY-MpzZUcseao0zg'
|
|
|
|
}).addTo(mymap);
|
|
|
|
let marker = L.marker([lat, lng], draggable=false).addTo(mymap);
|