From f1f77354a7b8640376e6f89cdb6920ff9cc83c0e Mon Sep 17 00:00:00 2001 From: florent <flavelle@neogeo.fr> Date: Fri, 7 Jan 2022 16:45:26 +0100 Subject: [PATCH] remove symbology icons --- src/assets/js/map-util.js | 46 +++---------------- .../feature_type/SymbologySelector.vue | 4 +- src/views/project/Project_detail.vue | 21 +-------- 3 files changed, 10 insertions(+), 61 deletions(-) diff --git a/src/assets/js/map-util.js b/src/assets/js/map-util.js index b6bf2e9f..9c279ef6 100644 --- a/src/assets/js/map-util.js +++ b/src/assets/js/map-util.js @@ -316,14 +316,6 @@ const mapUtil = { color.value : typeof color === 'string' && color.length ? color : '#000000'; - // Look for a custom field - let customField; - let customFieldOption; - if (featureType.customfield_set && Object.keys(properties).some(el => featureType.customfield_set.map(e => e.name).includes(el))) { - customField = Object.keys(properties).filter(el => featureType.customfield_set.map(e => e.name).includes(el)); - customFieldOption = properties[customField[0]]; - } - const hiddenStyle = ({ radius: 0, fillOpacity: 0.5, @@ -332,38 +324,14 @@ const mapUtil = { color: featureType.color, }); - let defaultStyle; - if ( - featureType.colors_style.value.icons[customFieldOption] && - featureType.colors_style.value.icons[customFieldOption] !== 'circle' - ) { - const iconHTML = ` - <i - class="fas fa-${featureType.colors_style.value.icons[customFieldOption]} fa-lg" - style="color: ${colorValue}" - ></i> - `; - const customMapIcon = L.divIcon({ - html: iconHTML, - iconSize: [20, 20], - className: 'myDivIcon', - }); - - defaultStyle = { - icon: customMapIcon - }; - - } else { - - defaultStyle = { - radius: 4, - fillOpacity: 0.5, - weight: 3, - fill: true, - color: color, - }; + const defaultStyle = { + radius: 4, + fillOpacity: 0.5, + weight: 3, + fill: true, + color: colorValue, + }; - } // Filtre sur le feature type if (form_filters && form_filters.type.selected) { diff --git a/src/components/feature_type/SymbologySelector.vue b/src/components/feature_type/SymbologySelector.vue index cd3c2409..32c201bc 100644 --- a/src/components/feature_type/SymbologySelector.vue +++ b/src/components/feature_type/SymbologySelector.vue @@ -14,7 +14,7 @@ v-model.lazy="form.color.value" /> </div> - <div class="required inline field"> + <!-- <div class="required inline field"> <label>Symbole</label> <button class="ui icon button picker-button" @@ -27,7 +27,7 @@ class="icon alt" /> </button> - </div> + </div> --> </div> <div :class="isIconPickerModalOpen ? 'active' : ''" diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index 58d661af..80652c3d 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -715,26 +715,6 @@ export default { } } }, - - features: { - deep: true, - handler(newValue, oldValue) { - if (newValue && newValue.length && newValue !== oldValue) { - mapUtil.addFeatures( - this.features, - {}, - true, - this.feature_types - ); - this.mapLoading = false; - } - } - }, - featuresLoading(newValue) { - if (!newValue && this.features && this.features.length === 0) { - this.mapLoading = false; - } - } }, created() { @@ -969,6 +949,7 @@ export default { true, this.$store.state.feature_type.feature_types ); + this.mapLoading = false; this.GET_PROJECT_FEATURES({ project_slug: this.slug, -- GitLab