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://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); let marker = L.marker([lat, lng], draggable = false).addTo(mymap);