window.mapLoadedCallback = function() { var latLngs = [ [54.6721142951, 25.2712972964], [54.6722600888, 25.2720053996], [54.672018133, 25.2721073236], [54.6719080115, 25.2718417849], [54.671707931, 25.2719007935], [54.6716614005, 25.2713133897], [54.672053806, 25.271098813], ]; var map = L.map('citynow_map').setView([54.6719605237, 25.2716521144], 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(); }