File tree Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ var GEOComp = (function () {
146
146
scale : true ,
147
147
largeButtons : true ,
148
148
scaleToBottom : false ,
149
- "modify:select " : true ,
149
+ "modify:move " : true ,
150
150
"modify:point" : true ,
151
151
"modify:line" : true ,
152
152
"modify:polygon" : true ,
Original file line number Diff line number Diff line change
1
+ import { ReactNode } from 'react'
2
+ import {
3
+ MultiCompBuilder ,
4
+ BoolPureControl ,
5
+ withDefault ,
6
+ } from 'lowcoder-sdk'
7
+ import { trans } from "./i18n/comps" ;
8
+
9
+
10
+ export function layersControl ( config ?: any ) {
11
+ const childrenMap : any = new Object ( ) ;
12
+ const initConfig = Object . assign ( { } , config )
13
+ Object . keys ( initConfig ) . forEach ( ( k : string , index : any ) => {
14
+ childrenMap [ k ] = withDefault ( BoolPureControl , initConfig [ k ] )
15
+ } )
16
+ //Class is rebuiled not retuning same class
17
+ class LayersControlTemp extends new MultiCompBuilder ( childrenMap , ( props : any ) => props )
18
+ . setPropertyViewFn ( ( children : any ) => ( < > </ > ) )
19
+ . build ( ) {
20
+
21
+ getView ( ) : any {
22
+ const p = super . getView ( )
23
+ var changed = false
24
+ Object . keys ( p ) . forEach ( ( k ) => {
25
+ if ( initConfig [ k ] != p [ k ] ) {
26
+ initConfig [ k ] = p [ k ]
27
+ changed = true
28
+ }
29
+ } )
30
+ if ( changed ) {
31
+ return super . getView ( )
32
+ }
33
+ return initConfig
34
+ }
35
+ propertyView ( params : {
36
+ title : string
37
+ } ) : ReactNode {
38
+ var list : any = [ ]
39
+ Object . keys ( this . children ) . forEach ( ( k , index ) => {
40
+ list . push ( this . children [ k ] . propertyView ( { label : trans ( `features.${ k } ` ) } ) )
41
+ } )
42
+
43
+ return (
44
+ < >
45
+ { params . title }
46
+ { list }
47
+ </ >
48
+ ) ;
49
+ }
50
+ }
51
+ return LayersControlTemp ;
52
+ }
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export const en = {
61
61
scale : "Show scale of map" ,
62
62
largeButtons : "Use large buttons" ,
63
63
scaleToBottom : "Resize map to bottom (AutoHeigth)" ,
64
- "modify:select " : "Select feature (Modify)" ,
64
+ "modify:move " : "Select feature (Modify)" ,
65
65
"modify:point" : "Add point (Modify)" ,
66
66
"modify:line" : "Add line (Modify)" ,
67
67
"modify:polygon" : "Add polygon (Modify)" ,
You can’t perform that action at this time.
0 commit comments