diff --git a/resources/js/Components/Map/MapContainer.vue b/resources/js/Components/Map/MapContainer.vue index 91c42c1..7c25f9d 100644 --- a/resources/js/Components/Map/MapContainer.vue +++ b/resources/js/Components/Map/MapContainer.vue @@ -11,6 +11,7 @@ import VectorLayer from "ol/layer/Vector"; import VectorSource from "ol/source/Vector"; import {Coordinate} from "ol/coordinate"; import {Collection, Feature} from "ol"; +import {defaults as defaultControls} from 'ol/control.js'; import {Geometry} from "ol/geom"; import {MapBrowserEvent} from "openlayers"; import {newsStyle} from "@/Components/Map/Styles/news.style"; @@ -47,6 +48,10 @@ onMounted(() => { })) map.value = new Map({ + controls: defaultControls({ + zoom: false, + attribution: false + }), target: mapRoot.value, layers: [ new TileLayer({ @@ -58,7 +63,8 @@ onMounted(() => { view: new View({ zoom: 0, center: props.center ?? [0, 0], - constrainResolution: true + constrainResolution: true, + enableRotation: false }), }) diff --git a/resources/js/Pages/News/Index.vue b/resources/js/Pages/News/Index.vue index 12f7606..3634080 100644 --- a/resources/js/Pages/News/Index.vue +++ b/resources/js/Pages/News/Index.vue @@ -5,7 +5,7 @@ import MapContainer from "@/Components/Map/MapContainer.vue"; import {Feature} from "ol"; import {Point} from "ol/geom"; import {fromLonLat} from "ol/proj"; -import {onMounted, ref} from "vue"; +import {ref} from "vue"; import {useElementSize, useParentElement} from "@vueuse/core"; import NewsData = App.Data.NewsData; @@ -17,10 +17,6 @@ const map = ref(); const parentElement = useParentElement(map); const parentElementSize = useElementSize(parentElement); -onMounted(() => { - console.log(parentElementSize) -}) - const features = props.news.map(news => new Feature({ geometry: new Point(fromLonLat([news.lng, news.lat])), data: {