Skip to content

Commit 78ab1f4

Browse files
committed
fix: move not visible
1 parent 0dc8dcf commit 78ab1f4

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

src/GEOComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ var GEOComp = (function () {
146146
scale: true,
147147
largeButtons: true,
148148
scaleToBottom: false,
149-
"modify:select": true,
149+
"modify:move": true,
150150
"modify:point": true,
151151
"modify:line": true,
152152
"modify:polygon": true,

src/LayersControl.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
}

src/i18n/comps/locales/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const en = {
6161
scale: "Show scale of map",
6262
largeButtons: "Use large buttons",
6363
scaleToBottom: "Resize map to bottom (AutoHeigth)",
64-
"modify:select": "Select feature (Modify)",
64+
"modify:move": "Select feature (Modify)",
6565
"modify:point": "Add point (Modify)",
6666
"modify:line": "Add line (Modify)",
6767
"modify:polygon": "Add polygon (Modify)",

0 commit comments

Comments
 (0)