Skip to content

Commit

Permalink
refactor(draw-select): init together with draw in map-container
Browse files Browse the repository at this point in the history
  • Loading branch information
tkohr committed Dec 9, 2024
1 parent 44bedce commit 04a7516
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/map/map-container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import FullscreenControl from '../map-controls/fullscreen-control.vue'
import ZoomControl from '../map-controls/zoom-control.vue'
import ZoomToExtentControl from '../map-controls/zoom-to-extent-control.vue'
import useDraw from '@/composables/draw/draw.composable'
import useDrawSelect from '@/composables/draw/draw-select.composable'
const appStore = useAppStore()
const { embedded } = storeToRefs(appStore)
Expand All @@ -36,6 +37,8 @@ const props = withDefaults(
if (props.v4_standalone) {
const draw = useDraw()
draw.addDrawLayer(olMap)
// initialise map listeners for feature selection
useDrawSelect()
}
const DEFAULT_EXTENT = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { storageHelper } from './storage/storage.helper'
import { storageFeaturesMapper } from './state-persistor-features.mapper'
import { useDrawStore } from '@/stores/draw.store'
import { DrawnFeature } from '@/services/draw/drawn-feature'
import useDrawSelect from '@/composables/draw/draw-select.composable'

class StatePersistorFeaturesService implements StatePersistorService {
bootstrap() {
Expand Down Expand Up @@ -36,8 +35,6 @@ class StatePersistorFeaturesService implements StatePersistorService {

restore() {
const { drawnFeatures } = storeToRefs(useDrawStore())
// initialise map listeners for feature selection
useDrawSelect()

const features = storageHelper.getValue(
SP_KEY_FEATURES,
Expand Down

0 comments on commit 04a7516

Please sign in to comment.