20 lines
796 B
JavaScript
20 lines
796 B
JavaScript
|
|
let span = document.getElementById('latlng');
|
|
let coordinates = span.innerHTML;
|
|
|
|
lat = coordinates.split(",")[0];
|
|
lng = coordinates.split(",")[1];
|
|
let latlng = L.LatLng(lat, lng);
|
|
var mymap = L.map('checkmap').setView([lat, lng], 13);
|
|
|
|
|
|
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);
|