From d12704b10efb4a198f0e01570c0f8e00e49733eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poussard?= <tpoussard@neogeo.fr> Date: Tue, 7 Sep 2021 17:41:39 +0200 Subject: [PATCH] remove flip coordinates --- package.json | 1 - src/store/modules/map.js | 52 ++++------------------------------------ 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/package.json b/package.json index 4e6724b5..186a5d02 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@turf/flip": "^6.5.0", "axios": "^0.21.1", "core-js": "^3.6.5", "leaflet": "^1.7.1", diff --git a/src/store/modules/map.js b/src/store/modules/map.js index a1721b49..edda029e 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -1,51 +1,10 @@ -import flip from "@turf/flip"; import { mapUtil } from "@/assets/js/map-util.js"; const map = { namespaced: true, state: { - basemaps: [ - /* { - "id": 1, - "title": "Fond mock", - "layers": [ - { - "id": 1, - "title": "Open street map mock", - "opacity": "1.50", - "order": 2, - "queryable": true - } - ] - }, */ - /* { - "id": 10, - "title": "Fond mock", - "layers": [ - { - "id": 1, - "title": "Open street map mock", - "opacity": "1.50", - "order": 2, - "queryable": true - } - ] - }, - { - "id": 5, - "title": "Fond mock", - "layers": [ - { - "id": 1, - "title": "Open street map mock", - "opacity": "1.50", - "order": 2, - "queryable": true - } - ] - }, */ - ], + basemaps: [], features: [], layers: [ { @@ -64,7 +23,6 @@ const map = { "attribution": "© contributeurs d'<a href=\"https://osm.org/copyright\">OpenStreetMap</a>", "maxZoom": 20 }, - //availableLayers: ["https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"] }, mutations: { SET_BASEMAPS(state, basemaps) { @@ -168,7 +126,7 @@ const map = { ADD_FEATURES({ rootState }, features) { const featuresToAdd = features || rootState.feature.features const featureGroup = mapUtil.addFeatures(featuresToAdd.map(el => { - const geometry = flip(el.geom); // * map features as geoJSON format and flip coordinates for leaflet + const geometry = el.geom; // * map features as geoJSON format const properties = { ...el } return { geometry, properties } })); @@ -178,9 +136,9 @@ const map = { }, //SAVE_BASEMAPS({ state }) { - // const data = JSON.stringify(state.basemaps); - // console.log("SAVE_BASEMAPS", data); - // todo : call axios POST + // const data = JSON.stringify(state.basemaps); + // console.log("SAVE_BASEMAPS", data); + // todo : call axios POST //} } } -- GitLab