@@ -27,13 +27,13 @@ const getModify = (source: VectorSource) =>
2727const getSelect = (
2828 drawLayer : VectorLayer < Feature > ,
2929 selectedFeature : Feature | null ,
30- specialStyle : StyleLike
30+ currentModeStyle : StyleLike
3131) =>
3232 new Select ( {
3333 layers : [ drawLayer ] ,
3434 // presets select if feature is selected
3535 features : selectedFeature ? new Collection ( [ selectedFeature ] ) : undefined ,
36- style : specialStyle ,
36+ style : currentModeStyle ,
3737 } )
3838
3939export default async function (
@@ -45,11 +45,11 @@ export default async function (
4545) : Promise < Interaction [ ] > {
4646 let interactions : Interaction [ ] = [ ]
4747 let styleFunc = await dispatch ( 'createStyleFunc' )
48- const specialStyle : StyleLike = await dispatch ( 'createStyleFunc' , mode )
48+ const currentModeStyle : StyleLike = await dispatch ( 'createStyleFunc' , mode )
4949 const drawSource = drawLayer . getSource ( ) as VectorSource
5050
5151 if ( mode === 'draw' ) {
52- const draw = getDraw ( drawSource , measureMode , specialStyle )
52+ const draw = getDraw ( drawSource , measureMode , currentModeStyle )
5353 draw . on ( 'drawend' , ( { feature } ) => dispatch ( 'setSelectedFeature' , feature ) )
5454 interactions . push ( draw )
5555 } else if ( drawSource . getFeatures ( ) . length > 0 ) {
@@ -59,12 +59,12 @@ export default async function (
5959 dispatch ( 'setSelectedFeature' , features . item ( 0 ) )
6060 )
6161 interactions . push ( modify )
62- styleFunc = specialStyle
62+ styleFunc = currentModeStyle
6363 } else if ( mode === 'delete' ) {
6464 interactions = await dispatch ( 'createDeleteInteraction' , drawSource )
65- styleFunc = specialStyle
65+ styleFunc = currentModeStyle
6666 } else if ( mode === 'select' ) {
67- const select = getSelect ( drawLayer , selectedFeature , specialStyle )
67+ const select = getSelect ( drawLayer , selectedFeature , currentModeStyle )
6868 // selects and deselects
6969 select
7070 . getFeatures ( )
0 commit comments