|
13 | 13 | <link rel="stylesheet" href="/css/lineicons.css"> |
14 | 14 | <script src="/js/HumanizeDuration.js"></script> |
15 | 15 | <script src="/js/horizontal-date-picker.js"></script> |
16 | | - <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap" |
17 | | - rel="stylesheet"> |
| 16 | + <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap" rel="stylesheet"> |
18 | 17 | <script src="https://unpkg.com/htmx.org@1.9.12"></script> |
19 | | - |
20 | | - <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" |
21 | | - integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script> |
| 18 | + <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script> |
| 19 | + <script src="/js/TileLayer.Grayscale.js"></script> |
22 | 20 | </head> |
23 | 21 | <body> |
24 | 22 | <div id="map"></div> |
|
55 | 53 | <script> |
56 | 54 | // Function to initialize maps for place cards |
57 | 55 | function initPlaceMaps() { |
58 | | - const placeMap = L.map(mapElement, { |
59 | | - zoomControl: false, |
60 | | - attributionControl: false, |
61 | | - dragging: false, |
62 | | - scrollWheelZoom: false |
63 | | - }) |
64 | | - |
65 | | - L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', { |
66 | | - maxZoom: 19, |
67 | | - attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>' |
68 | | - }).addTo(placeMap); |
69 | 56 |
|
70 | 57 | document.querySelectorAll('.place-map').forEach(mapElement => { |
71 | 58 | const lat = parseFloat(mapElement.dataset.lat); |
72 | 59 | const lng = parseFloat(mapElement.dataset.lng); |
| 60 | + const placeMap = L.map(mapElement, { |
| 61 | + zoomControl: false, |
| 62 | + attributionControl: false, |
| 63 | + dragging: false, |
| 64 | + scrollWheelZoom: false |
| 65 | + }) |
| 66 | + |
| 67 | + L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', { |
| 68 | + maxZoom: 19, |
| 69 | + attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>' |
| 70 | + }).addTo(placeMap); |
73 | 71 |
|
74 | 72 | if (!isNaN(lat) && !isNaN(lng)) { |
75 | 73 | placeMap.setView([lat, lng], 14); |
|
239 | 237 |
|
240 | 238 | // Initialize the map |
241 | 239 | const map = L.map('map').setView([60.1699, 24.9384], 12); // Helsinki coordinates as default |
242 | | - |
243 | | - L.tileLayer('https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png', { |
244 | | - maxZoom: 20, |
245 | | - attribution: '© <a href="https://stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', |
| 240 | + L.tileLayer.grayscale('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', { |
| 241 | + maxZoom: 19, |
| 242 | + attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>' |
246 | 243 | }).addTo(map); |
247 | 244 |
|
248 | 245 | // Add scale control |
|
0 commit comments