Skip to content
Snippets Groups Projects
Commit 798d47c6 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add icons, autofill type, restrict multi geometry choice to geojson import &...

add icons, autofill type, restrict multi geometry choice to geojson import & remove unused turf libs
parent a03bb097
No related branches found
No related tags found
1 merge request!475REDMINE_ISSUE-14383| Permettre la visualisation, l'import et l'export de géométries-multiples
src/assets/img/multiline.png

25 KiB

src/assets/img/multimarker.png

21.8 KiB

src/assets/img/multipolygon.png

24.7 KiB

...@@ -25,6 +25,24 @@ ...@@ -25,6 +25,24 @@
src="@/assets/img/polygon.png" src="@/assets/img/polygon.png"
alt="Géométrie polygone" alt="Géométrie polygone"
> >
<img
v-if="featureType.geom_type === 'multipoint'"
class="list-image-type"
src="@/assets/img/multimarker.png"
alt="Géométrie multipoint"
>
<img
v-if="featureType.geom_type === 'multilinestring'"
class="list-image-type"
src="@/assets/img/multiline.png"
alt="Géométrie multiligne"
>
<img
v-if="featureType.geom_type === 'multipolygon'"
class="list-image-type"
src="@/assets/img/multipolygon.png"
alt="Géométrie multipolygone"
>
{{ featureType.title }} {{ featureType.title }}
</router-link> </router-link>
</template> </template>
......
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
class="ui plus icon" class="ui plus icon"
aria-hidden="true" aria-hidden="true"
/> />
Créer un nouveau type de signalement à partir du catalogue {{ CATALOG_NAME|| 'IDGO' }} Créer un nouveau type de signalement à partir du catalogue {{ CATALOG_NAME || 'IDGO' }}
</router-link> </router-link>
</div> </div>
</div> </div>
......
...@@ -173,9 +173,6 @@ export default { ...@@ -173,9 +173,6 @@ export default {
{ value: 'linestring', name: 'Ligne' }, { value: 'linestring', name: 'Ligne' },
{ value: 'point', name: 'Point' }, { value: 'point', name: 'Point' },
{ value: 'polygon', name: 'Polygone' }, { value: 'polygon', name: 'Polygone' },
{ value: 'multilinestring', name: 'Multiligne' },
{ value: 'multipoint', name: 'Multipoint' },
{ value: 'multipolygon', name: 'Multipolygone' },
], ],
form: { form: {
colors_style: { colors_style: {
...@@ -362,6 +359,12 @@ export default { ...@@ -362,6 +359,12 @@ export default {
} else { //* case when the geojson comes from datasud catalog } else { //* case when the geojson comes from datasud catalog
this.form.title.value = this.geojson.name;// * use the typename as title by default this.form.title.value = this.geojson.name;// * use the typename as title by default
} }
//* add multiple geometries options available only for geojson (therefore when importing from catalog also)
this.geomTypeChoices.push(
{ value: 'multilinestring', name: 'Multiligne' },
{ value: 'multipoint', name: 'Multipoint' },
{ value: 'multipolygon', name: 'Multipolygone' },
);
} }
if (this.csv) { if (this.csv) {
this.importCSVFeatureType(); this.importCSVFeatureType();
...@@ -613,15 +616,6 @@ export default { ...@@ -613,15 +616,6 @@ export default {
}); });
}, },
translateLabel(value) {
if (value === 'LineString') {
return 'linestring';
} else if (value === 'Polygon' || value === 'MultiPolygon') {
return 'polygon';
}
return 'point';
},
buildCustomForm(properties) { buildCustomForm(properties) {
for (const [key, val] of Object.entries(properties)) { for (const [key, val] of Object.entries(properties)) {
//* check that the property is not a keyword from the backend or map style //* check that the property is not a keyword from the backend or map style
...@@ -644,7 +638,7 @@ export default { ...@@ -644,7 +638,7 @@ export default {
//* in order to get feature_type properties, the first feature is enough //* in order to get feature_type properties, the first feature is enough
const { properties, geometry } = this.geojson.features[0]; const { properties, geometry } = this.geojson.features[0];
this.form.title.value = properties.feature_type; this.form.title.value = properties.feature_type;
this.form.geom_type.value = this.translateLabel(geometry.type); this.form.geom_type.value = geometry.type.toLowerCase();
this.updateStore(); //* register title & geom_type in store this.updateStore(); //* register title & geom_type in store
this.buildCustomForm(properties); this.buildCustomForm(properties);
} }
......
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