diff --git a/packages/clients/diplan/src/store/module.ts b/packages/clients/diplan/src/store/module.ts index 0e797d04..18e4443a 100644 --- a/packages/clients/diplan/src/store/module.ts +++ b/packages/clients/diplan/src/store/module.ts @@ -4,7 +4,7 @@ import { generateSimpleMutations, } from '@repositoryname/vuex-generators' import { FeatureCollection } from 'geojson' -import { DiplanGetters, DiplanState } from '../types' +import { DiplanGetters, DiplanState, GeometryType } from '../types' import { mergeMultiGeometries } from './utils/mergeMultiGeometries' import { validateGeoJson } from './utils/validateGeoJson' import { enrichWithMetaServices } from './utils/enrichWithMetaServices' @@ -42,7 +42,7 @@ const diplanModule: PolarModule = { // clone to prevent accidentally messing with the draw tool's data let revisedFeatureCollection = cloneFeatureCollection( rootGetters[drawFeatureCollection] - ) + ) as FeatureCollection // No GeometryCollection from Draw // merge first; relevant for both follow-up steps if (getters.configuration.mergeMultiGeometries) { diff --git a/packages/clients/diplan/src/store/utils/mergeMultiGeometries.ts b/packages/clients/diplan/src/store/utils/mergeMultiGeometries.ts index a36b951b..dc93dc96 100644 --- a/packages/clients/diplan/src/store/utils/mergeMultiGeometries.ts +++ b/packages/clients/diplan/src/store/utils/mergeMultiGeometries.ts @@ -1,13 +1,5 @@ -import { - Feature, - FeatureCollection, - GeoJsonTypes, - Geometry, - GeometryCollection, - Position, -} from 'geojson' - -type GeometryType = Exclude +import { Feature, FeatureCollection, GeoJsonTypes, Position } from 'geojson' +import { GeometryType } from '../../types' const isMulti = (type: GeometryType['type']) => type.startsWith('Multi') const multi = (type: GeometryType['type']) => diff --git a/packages/clients/diplan/src/types.ts b/packages/clients/diplan/src/types.ts index 7d09c8a7..7493d3ba 100644 --- a/packages/clients/diplan/src/types.ts +++ b/packages/clients/diplan/src/types.ts @@ -1,4 +1,4 @@ -import { FeatureCollection } from 'geojson' +import { FeatureCollection, Geometry, GeometryCollection } from 'geojson' export interface MetaService { id: string @@ -21,3 +21,5 @@ export interface DiplanState { export interface DiplanGetters extends DiplanState { configuration: Required } + +export type GeometryType = Exclude