@@ -44,32 +44,18 @@ function gatherItems (item, dimension, type) {
4444
4545 // multi polygon
4646 if ( dimension === CONST . POLYGON_TYPE_DIMENSION && type === CONST . MULTIPOLYGON ) {
47- let multipolygon = [ ]
48-
49- let polygonLayout = {
50- type : "array" ,
51- [ CONST . DIMENSION ] : dimension ,
52- items : [ {
53- title : item ,
54- type : "array" ,
55- items : helper . POINT_TYPE_LAYOUT
56- } ] ,
57- additionalItems : {
58- title : item ,
47+ return {
48+ type : "array" ,
49+ title : "Polygon" ,
50+ description : "Add a polygon" ,
51+ items : {
5952 type : "array" ,
60- items : helper . POINT_TYPE_LAYOUT
53+ title : "coordinates" ,
54+ description : "Add coordinates" ,
55+ items : [ { type : CONST . STRING_TYPE } , { type : CONST . STRING_TYPE } ]
6156 }
6257 }
63-
64- let multiPolygonLayout = {
65- type : "array" ,
66- title : "polygon" ,
67- [ CONST . DIMENSION ] : dimension ,
68- items : [ polygonLayout ] ,
69- additionalItems : polygonLayout
70- }
71- multipolygon . push ( multiPolygonLayout )
72- return multipolygon
58+
7359 }
7460
7561 // mostly b_box
@@ -110,40 +96,48 @@ function gatherUIItems (frame, item, documentation, dimension, type) {
11096 }
11197 }
11298 else if ( dimension === CONST . POLYGON_TYPE_DIMENSION && type === CONST . MULTIPOLYGON ) {
113- let uiPolygon = {
114- "items" : helper . POINT_TYPE_UI_LAYOUT
115- }
116-
117- let ui = {
118- //"ui:title": "test",
119- "ui:description" : "Add a new Polygon ..." ,
120- "classNames" : "tdb__input tdb__multipolygon__input" ,
121- "items" : {
99+ let uiMultiPolygionLayout = {
100+ "ui:title" : "MultiPolygon" ,
101+ "ui:description" : "MultiPolygon" ,
102+ "classNames" : "card border border-secondary p-2" ,
103+ items : {
104+ "ui:title" : "Polygon" ,
105+ "ui:description" : "Add Polygon ..." ,
122106 "ui:ArrayFieldTemplate" : ArrayFieldTemplate ,
123107 "ui:options" : {
124108 addable : true ,
125109 orderable : true ,
126110 removable : true
127111 } ,
128- "items" : helper . POINT_TYPE_UI_LAYOUT ,
129- "additionalItems" : helper . POINT_TYPE_UI_LAYOUT
130- }
131- }
132-
133- return {
134- "ui:title" : "polygon" ,
135- "items" : {
136-
137- "ui:ArrayFieldTemplate" : ArrayFieldTemplate ,
138- "ui:options" : {
139- addable : true ,
140- orderable : true ,
141- removable : true
142- } ,
143- "items" : ui ,
144- "additionalItems" : ui
112+ items : {
113+ "ui:title" : "Coordinates" ,
114+ "ui:description" : "Add Coordinates ..." ,
115+ "ui:ArrayFieldTemplate" : ArrayFieldTemplate ,
116+ "ui:options" : {
117+ addable : true ,
118+ orderable : true ,
119+ removable : true
120+ } ,
121+ items : [
122+ {
123+ "ui:placeholder" : `Enter latitude ...` ,
124+ classNames : "tdb__input mb-3"
125+ } ,
126+ {
127+ "ui:placeholder" : `Enter longitude ...` ,
128+ classNames : "tdb__input mb-3"
129+ }
130+ ]
131+ }
132+ } ,
133+ "ui:ArrayFieldTemplate" : ArrayFieldTemplate ,
134+ "ui:options" : {
135+ addable : true ,
136+ orderable : true ,
137+ removable : true
145138 }
146139 }
140+ return uiMultiPolygionLayout
147141 }
148142 else {
149143 // for points and line strings
0 commit comments