Skip to content
Snippets Groups Projects
Commit b64ca055 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA :bicyclist:
Browse files

Merge branch 'redmine-issues/12846' into 'develop'

REDMINE_ISSUE-12846

See merge request !281
parents bd227313 9c152408
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ NODE_ENV=development ...@@ -34,6 +34,7 @@ NODE_ENV=development
"VUE_APP_DISABLE_LOGIN_BUTTON":false, "VUE_APP_DISABLE_LOGIN_BUTTON":false,
"VUE_APP_LOGIN_URL":"", "VUE_APP_LOGIN_URL":"",
"DEFAULT_BASE_MAP_SCHEMA_TYPE": "tms",
"DEFAULT_BASE_MAP_SERVICE": "https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", "DEFAULT_BASE_MAP_SERVICE": "https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png",
"DEFAULT_BASE_MAP_OPTIONS": { "DEFAULT_BASE_MAP_OPTIONS": {
"attribution": "&copy; contributeurs d'<a href='https://osm.org/copyright'>OpenStreetMap</a>", "attribution": "&copy; contributeurs d'<a href='https://osm.org/copyright'>OpenStreetMap</a>",
......
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
"VUE_APP_APPLICATION_FAVICO":"/geocontrib/img/geo2f.ico", "VUE_APP_APPLICATION_FAVICO":"/geocontrib/img/geo2f.ico",
"VUE_APP_APPLICATION_ABSTRACT":"Application de saisie d'informations géographiques contributive", "VUE_APP_APPLICATION_ABSTRACT":"Application de saisie d'informations géographiques contributive",
"VUE_APP_LOGO_PATH":"/geocontrib/img/logo-neogeo-circle.png", "VUE_APP_LOGO_PATH":"/geocontrib/img/logo-neogeo-circle.png",
"VUE_APP_DJANGO_BASE":"http://localhost", "VUE_APP_DJANGO_BASE":"http://localhost:8010",
"VUE_APP_DJANGO_API_BASE":"http://localhost/api/", "VUE_APP_DJANGO_API_BASE":"http://localhost:8010/api/",
"VUE_APP_CATALOG_NAME": "Datasud", "VUE_APP_CATALOG_NAME": "Datasud",
"VUE_APP_IDGO": true, "VUE_APP_IDGO": true,
"VUE_APP_RELOAD_INTERVAL": 15000, "VUE_APP_RELOAD_INTERVAL": 15000,
"VUE_APP_DISABLE_LOGIN_BUTTON":false, "VUE_APP_DISABLE_LOGIN_BUTTON":false,
"VUE_APP_LOGIN_URL":"", "VUE_APP_LOGIN_URL":"",
"DEFAULT_BASE_MAP_SCHEMA_TYPE": "tms",
"DEFAULT_BASE_MAP_SERVICE": "https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", "DEFAULT_BASE_MAP_SERVICE": "https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png",
"DEFAULT_BASE_MAP_OPTIONS": { "DEFAULT_BASE_MAP_OPTIONS": {
"attribution": "&copy; contributeurs d'<a href='https://osm.org/copyright'>OpenStreetMap</a>", "attribution": "&copy; contributeurs d'<a href='https://osm.org/copyright'>OpenStreetMap</a>",
......
...@@ -208,13 +208,13 @@ const mapUtil = { ...@@ -208,13 +208,13 @@ const mapUtil = {
}).addTo(map); }).addTo(map);
} }
}, },
addLayers: function (layers, serviceMap, optionsMap) { addLayers: function (layers, serviceMap, optionsMap, schemaType) {
if (layers) { if (layers) { //* if admin has defined basemaps for this project
layers.forEach((layer) => { layers.forEach((layer) => {
if (layer) { if (layer) {
const options = layer.options; let options = layer.options;
options.noWrap=true;
if (options) { if (options) {
options.noWrap = true;
options.opacity = layer.opacity; options.opacity = layer.opacity;
if (layer.schema_type === 'wms') { if (layer.schema_type === 'wms') {
...@@ -237,9 +237,15 @@ const mapUtil = { ...@@ -237,9 +237,15 @@ const mapUtil = {
} }
} }
}); });
} else { } else { //* else when no basemaps defined
optionsMap.noWrap=true; optionsMap.noWrap = true;
L.tileLayer(serviceMap, optionsMap).addTo(map); if (schemaType === 'wms') {
L.tileLayer
.wms(serviceMap, optionsMap)
.addTo(map);
} else {
L.tileLayer(serviceMap, optionsMap).addTo(map);
}
} }
}, },
......
...@@ -172,7 +172,8 @@ export default { ...@@ -172,7 +172,8 @@ export default {
mapUtil.addLayers( mapUtil.addLayers(
null, null,
this.$store.state.configuration.DEFAULT_BASE_MAP_SERVICE, this.$store.state.configuration.DEFAULT_BASE_MAP_SERVICE,
this.$store.state.configuration.DEFAULT_BASE_MAP_OPTIONS this.$store.state.configuration.DEFAULT_BASE_MAP_OPTIONS,
this.$store.state.configuration.DEFAULT_BASE_MAP_SCHEMA_TYPE
); );
} }
setTimeout(this.initSortable.bind(this), 1000); setTimeout(this.initSortable.bind(this), 1000);
...@@ -357,7 +358,7 @@ export default { ...@@ -357,7 +358,7 @@ export default {
mapUtil.removeLayers(mapUtil.getMap()); mapUtil.removeLayers(mapUtil.getMap());
// Reverse is done because the first layer in order has to be added in the map in last. // Reverse is done because the first layer in order has to be added in the map in last.
// Slice is done because reverse() changes the original array, so we make a copy first // Slice is done because reverse() changes the original array, so we make a copy first
mapUtil.addLayers(baseMap.layers.slice().reverse(), null, null); mapUtil.addLayers(baseMap.layers.slice().reverse(), null, null, null,);
}, },
}, },
}; };
......
...@@ -142,7 +142,8 @@ const map = { ...@@ -142,7 +142,8 @@ const map = {
mapUtil.addLayers( mapUtil.addLayers(
layersToLoad, layersToLoad,
this.state.configuration.DEFAULT_BASE_MAP_SERVICE, this.state.configuration.DEFAULT_BASE_MAP_SERVICE,
this.state.configuration.DEFAULT_BASE_MAP_OPTIONS this.state.configuration.DEFAULT_BASE_MAP_OPTIONS,
this.state.configuration.DEFAULT_BASE_MAP_SCHEMA_TYPE,
); );
// Remove multiple interactions with the map // Remove multiple interactions with the map
......
...@@ -712,7 +712,8 @@ export default { ...@@ -712,7 +712,8 @@ export default {
mapUtil.addLayers( mapUtil.addLayers(
layersToLoad, layersToLoad,
this.$store.state.configuration.DEFAULT_BASE_MAP_SERVICE, this.$store.state.configuration.DEFAULT_BASE_MAP_SERVICE,
this.$store.state.configuration.DEFAULT_BASE_MAP_OPTIONS this.$store.state.configuration.DEFAULT_BASE_MAP_OPTIONS,
this.$store.state.configuration.DEFAULT_BASE_MAP_SCHEMA_TYPE,
); );
mapUtil.getMap().dragging.disable(); mapUtil.getMap().dragging.disable();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment