window.mapLoadedCallback = function() { var latLngs = [ [54.7376427358, 25.2567461917], [54.7378146185, 25.2558744738], [54.7382249663, 25.2561158726], [54.7382915506, 25.2564109156], [54.7386399552, 25.2566335389], [54.7385129814, 25.2572611758], [54.7376365418, 25.256775696], ]; var map = L.map('citynow_map').setView([54.7381090499, 25.2565454092], 13); L.tileLayer('https://api.maptiler.com/maps/pastel/{z}/{x}/{y}.png?key=YwXY4ZdPMyu7tgIGUuPk',{ tileSize: 512, zoomOffset: -1, minZoom: 10, zoom: 15, attribution: '© MapTiler © OpenStreetMap contributors', crossOrigin: true }).addTo(map); var polygon = L.polygon(latLngs, {color: '#6200ff'}); polygon.addTo(map); map.setZoom(15); } window.loadCityNowMap = function(){ var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src","https://www.citynow.org/static/leaflet.js"); script_tag.onload = function() { mapLoadedCallback(); }; (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); } window.onload = function(){ loadCityNowMap(); }