Skip to content

Commit

Permalink
Merge branch 'feature/remove-rotate-map' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arthaud-proust committed Oct 21, 2023
2 parents 6538b85 + bc7b4f3 commit 5bdb9f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 7 additions & 1 deletion resources/js/Components/Map/MapContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -47,6 +48,10 @@ onMounted(() => {
}))
map.value = new Map({
controls: defaultControls({
zoom: false,
attribution: false
}),
target: mapRoot.value,
layers: [
new TileLayer({
Expand All @@ -58,7 +63,8 @@ onMounted(() => {
view: new View({
zoom: 0,
center: props.center ?? [0, 0],
constrainResolution: true
constrainResolution: true,
enableRotation: false
}),
})
Expand Down
6 changes: 1 addition & 5 deletions resources/js/Pages/News/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,10 +17,6 @@ const map = ref<HTMLElement>();
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: {
Expand Down

0 comments on commit 5bdb9f0

Please sign in to comment.