diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 04520842..e4a5fe1f 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -117,6 +117,7 @@ class PageController extends Controller // Allow OSM $policy->addAllowedFrameDomain('www.openstreetmap.org'); $policy->addAllowedImageDomain('https://*.tile.openstreetmap.org'); + $policy->addAllowedImageDomain('https://*.a.ssl.fastly.net'); return $policy; } diff --git a/src/components/top-matter/MapSplitMatter.vue b/src/components/top-matter/MapSplitMatter.vue index 2fca1bb7..7b422cd3 100644 --- a/src/components/top-matter/MapSplitMatter.vue +++ b/src/components/top-matter/MapSplitMatter.vue @@ -8,7 +8,7 @@ @moveend="refresh" @zoomend="refresh" > - + Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.`; type IMarkerCluster = { id?: number; @@ -66,8 +68,6 @@ export default defineComponent({ }, data: () => ({ - url: TILE_URL, - attribution: ATTRIBUTION, zoom: 2, clusters: [] as IMarkerCluster[], }), @@ -82,6 +82,16 @@ export default defineComponent({ this.refresh(); }, + computed: { + tileurl() { + return this.zoom >= 5 ? OSM_TILE_URL : STAMEN_URL; + }, + + attribution() { + return this.zoom >= 5 ? OSM_ATTRIBUTION : STAMEN_ATTRIBUTION; + }, + }, + methods: { async refresh() { const map = this.$refs.map as LMap; @@ -96,7 +106,8 @@ export default defineComponent({ // Set query parameters to route if required const s = (x: number) => x.toFixed(6); const bounds = `${s(minLat)},${s(maxLat)},${s(minLon)},${s(maxLon)}`; - const zoom = map.mapObject.getZoom().toString(); + this.zoom = map.mapObject.getZoom(); + const zoom = this.zoom.toString(); if (this.$route.query.b === bounds && this.$route.query.z === zoom) { return; }