ol-wfst 3.0.2 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +71 -64
- package/README.md +530 -478
- package/dist/assets/i18n/en.d.ts.map +1 -1
- package/dist/assets/i18n/es.d.ts.map +1 -1
- package/dist/assets/i18n/zh.d.ts.map +1 -1
- package/dist/css/ol-wfst.bootstrap5.css +364 -481
- package/dist/css/ol-wfst.bootstrap5.min.css +1 -1
- package/dist/css/ol-wfst.css +3 -0
- package/dist/ol-wfst.d.ts +38 -11
- package/dist/ol-wfst.d.ts.map +1 -1
- package/dist/ol-wfst.js +3673 -3617
- package/dist/ol-wfst.js.map +1 -1
- package/dist/ol-wfst.min.js +16 -16
- package/dist/ol-wfst.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/assets/i18n/en.d.ts.map +1 -1
- package/lib/assets/i18n/es.d.ts.map +1 -1
- package/lib/assets/i18n/zh.d.ts.map +1 -1
- package/lib/ol-wfst.d.ts +38 -11
- package/lib/ol-wfst.d.ts.map +1 -1
- package/lib/ol-wfst.js +245 -197
- package/lib/ol-wfst.js.map +1 -1
- package/lib/style/css/ol-gisify.css +3 -0
- package/lib/style/css/ol-wfst.bootstrap5.css +364 -481
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +70 -70
package/lib/ol-wfst.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import TileState from 'ol/TileState';
|
|
2
|
-
import { GeometryCollection, Circle as Circle$1, Polygon, MultiLineString, MultiPolygon, MultiPoint } from 'ol/geom';
|
|
3
|
-
import { Style, Circle, Fill, Stroke } from 'ol/style';
|
|
4
|
-
import { Control } from 'ol/control';
|
|
5
|
-
import { Modify, Snap, Select, Draw } from 'ol/interaction';
|
|
6
|
-
import { Collection,
|
|
7
|
-
import { WFS, GeoJSON, KML } from 'ol/format';
|
|
8
|
-
import { Vector, Tile } from 'ol/layer';
|
|
9
|
-
import { Vector as Vector$1, TileWMS } from 'ol/source';
|
|
10
|
-
import { bbox, all } from 'ol/loadingstrategy';
|
|
11
|
-
import { fromCircle } from 'ol/geom/Polygon';
|
|
12
|
-
import { getCenter } from 'ol/extent';
|
|
13
|
-
import { primaryAction, never } from 'ol/events/condition';
|
|
14
|
-
import { transformExtent } from 'ol/proj';
|
|
15
|
-
import { unByKey } from 'ol/Observable';
|
|
16
|
-
import Modal from 'modal-vanilla';
|
|
17
|
-
|
|
1
|
+
import TileState from 'ol/TileState';
|
|
2
|
+
import { GeometryCollection, Circle as Circle$1, Polygon, MultiLineString, MultiPolygon, MultiPoint } from 'ol/geom';
|
|
3
|
+
import { Style, Circle, Fill, Stroke } from 'ol/style';
|
|
4
|
+
import { Control } from 'ol/control';
|
|
5
|
+
import { Modify, Snap, Select, Draw } from 'ol/interaction';
|
|
6
|
+
import { Collection, Overlay, Feature } from 'ol';
|
|
7
|
+
import { WFS, GeoJSON, KML } from 'ol/format';
|
|
8
|
+
import { Vector, Tile } from 'ol/layer';
|
|
9
|
+
import { Vector as Vector$1, TileWMS } from 'ol/source';
|
|
10
|
+
import { bbox, all } from 'ol/loadingstrategy';
|
|
11
|
+
import { fromCircle } from 'ol/geom/Polygon';
|
|
12
|
+
import { getCenter } from 'ol/extent';
|
|
13
|
+
import { primaryAction, never } from 'ol/events/condition';
|
|
14
|
+
import { transformExtent } from 'ol/proj';
|
|
15
|
+
import { unByKey } from 'ol/Observable';
|
|
16
|
+
import Modal from 'modal-vanilla';
|
|
17
|
+
|
|
18
18
|
/*! *****************************************************************************
|
|
19
19
|
Copyright (c) Microsoft Corporation.
|
|
20
20
|
|
|
@@ -38,20 +38,20 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
38
38
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
39
39
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
40
40
|
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var img = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='768' height='768' viewBox='0 0 768 768'%3e %3cpath d='M663 225l-58.5 58.5-120-120 58.5-58.5q9-9 22.5-9t22.5 9l75 75q9 9 9 22.5t-9 22.5zM96 552l354-354 120 120-354 354h-120v-120z'%3e%3c/path%3e%3c/svg%3e";
|
|
44
|
-
|
|
45
|
-
var img$
|
|
46
|
-
|
|
47
|
-
var img$
|
|
48
|
-
|
|
49
|
-
var img$
|
|
50
|
-
|
|
51
|
-
var img$
|
|
52
|
-
|
|
53
|
-
var img
|
|
54
|
-
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var img$5 = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='768' height='768' viewBox='0 0 768 768'%3e %3cpath d='M663 225l-58.5 58.5-120-120 58.5-58.5q9-9 22.5-9t22.5 9l75 75q9 9 9 22.5t-9 22.5zM96 552l354-354 120 120-354 354h-120v-120z'%3e%3c/path%3e%3c/svg%3e";
|
|
44
|
+
|
|
45
|
+
var img$4 = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='448' height='448' viewBox='0 0 448 448'%3e %3cpath d='M222 296l29-29-38-38-29 29v14h24v24h14zM332 116c-2.25-2.25-6-2-8.25 0.25l-87.5 87.5c-2.25 2.25-2.5 6-0.25 8.25s6 2 8.25-0.25l87.5-87.5c2.25-2.25 2.5-6 0.25-8.25zM352 264.5v47.5c0 39.75-32.25 72-72 72h-208c-39.75 0-72-32.25-72-72v-208c0-39.75 32.25-72 72-72h208c10 0 20 2 29.25 6.25 2.25 1 4 3.25 4.5 5.75 0.5 2.75-0.25 5.25-2.25 7.25l-12.25 12.25c-2.25 2.25-5.25 3-8 2-3.75-1-7.5-1.5-11.25-1.5h-208c-22 0-40 18-40 40v208c0 22 18 40 40 40h208c22 0 40-18 40-40v-31.5c0-2 0.75-4 2.25-5.5l16-16c2.5-2.5 5.75-3 8.75-1.75s5 4 5 7.25zM328 80l72 72-168 168h-72v-72zM439 113l-23 23-72-72 23-23c9.25-9.25 24.75-9.25 34 0l38 38c9.25 9.25 9.25 24.75 0 34z'%3e%3c/path%3e%3c/svg%3e";
|
|
46
|
+
|
|
47
|
+
var img$3 = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='541' height='512' viewBox='0 0 541 512'%3e %3cpath fill='black' d='M103.306 228.483l129.493-125.249c-17.662-4.272-31.226-18.148-34.98-35.663l-0.055-0.307-129.852 125.248c17.812 4.15 31.53 18.061 35.339 35.662l0.056 0.308z'%3e%3c/path%3e %3cpath fill='black' d='M459.052 393.010c-13.486-8.329-22.346-23.018-22.373-39.779v-0.004c-0.053-0.817-0.082-1.772-0.082-2.733s0.030-1.916 0.089-2.863l-0.007 0.13-149.852 71.94c9.598 8.565 15.611 20.969 15.611 34.779 0 0.014 0 0.029 0 0.043v-0.002c-0.048 5.164-0.94 10.104-2.544 14.711l0.098-0.322z'%3e%3c/path%3e %3cpath fill='black' d='M290.207 57.553c-0.009 15.55-7.606 29.324-19.289 37.819l-0.135 0.093 118.054 46.69c-0.216-1.608-0.346-3.48-0.36-5.379v-0.017c0.033-16.948 9.077-31.778 22.596-39.953l0.209-0.118-122.298-48.056c0.659 2.633 1.098 5.693 1.221 8.834l0.002 0.087z'%3e%3c/path%3e %3cpath fill='black' d='M241.36 410.132l-138.629-160.067c-4.734 17.421-18.861 30.61-36.472 33.911l-0.29 0.045 143.881 166.255c1.668-18.735 14.197-34.162 31.183-40.044l0.327-0.099z'%3e%3c/path%3e %3cpath fill='black' d='M243.446 115.105c-31.785 0-57.553-25.767-57.553-57.553s25.767-57.553 57.553-57.553c31.785 0 57.552 25.767 57.552 57.553v0c0 31.786-25.767 57.553-57.553 57.553v0zM243.446 21.582c-19.866 0-35.97 16.105-35.97 35.97s16.105 35.97 35.97 35.97c19.866 0 35.97-16.105 35.97-35.97v0c0-19.866-16.104-35.97-35.97-35.97v0z'%3e%3c/path%3e %3cpath fill='black' d='M483.224 410.78c-31.786 0-57.553-25.767-57.553-57.553s25.767-57.553 57.553-57.553c31.786 0 57.552 25.767 57.552 57.553v0c0 31.786-25.767 57.553-57.553 57.553v0zM483.224 317.257c-19.866 0-35.97 16.104-35.97 35.97s16.105 35.97 35.97 35.97c19.866 0 35.97-16.105 35.97-35.97v0c0-19.866-16.105-35.97-35.97-35.97v0z'%3e%3c/path%3e %3cpath fill='black' d='M57.553 295.531c-31.785 0-57.553-25.767-57.553-57.553s25.767-57.553 57.553-57.553c31.785 0 57.553 25.767 57.553 57.553v0c0 31.786-25.767 57.553-57.553 57.553v0zM57.553 202.008c-19.866 0-35.97 16.105-35.97 35.97s16.105 35.97 35.97 35.97c19.866 0 35.97-16.105 35.97-35.97v0c-0.041-19.835-16.13-35.898-35.97-35.898 0 0 0 0 0 0v0z'%3e%3c/path%3e %3cpath fill='black' d='M256.036 512.072c-31.786 0-57.553-25.767-57.553-57.553s25.767-57.553 57.553-57.553c31.786 0 57.553 25.767 57.553 57.553v0c0 31.786-25.767 57.553-57.553 57.553v0zM256.036 418.55c-19.866 0-35.97 16.104-35.97 35.97s16.105 35.97 35.97 35.97c19.866 0 35.97-16.105 35.97-35.97v0c0-19.866-16.105-35.97-35.97-35.97v0z'%3e%3c/path%3e %3cpath fill='black' d='M435.24 194.239c-31.786 0-57.553-25.767-57.553-57.553s25.767-57.553 57.553-57.553c31.786 0 57.553 25.767 57.553 57.553v0c0 31.785-25.767 57.553-57.553 57.553v0zM435.24 100.716c-19.866 0-35.97 16.105-35.97 35.97s16.105 35.97 35.97 35.97c19.866 0 35.97-16.105 35.97-35.97v0c0-19.866-16.105-35.97-35.97-35.97v0z'%3e%3c/path%3e%3c/svg%3e";
|
|
48
|
+
|
|
49
|
+
var img$2 = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'%3e%3cpath d='M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z'%3e%3c/path%3e%3c/svg%3e";
|
|
50
|
+
|
|
51
|
+
var img$1 = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='768' height='768' viewBox='0 0 768 768'%3e%3cpath d='M384 288q39 0 67.5 28.5t28.5 67.5-28.5 67.5-67.5 28.5-67.5-28.5-28.5-67.5 28.5-67.5 67.5-28.5zM384 544.5q66 0 113.25-47.25t47.25-113.25-47.25-113.25-113.25-47.25-113.25 47.25-47.25 113.25 47.25 113.25 113.25 47.25zM384 144q118.5 0 214.5 66t138 174q-42 108-138 174t-214.5 66-214.5-66-138-174q42-108 138-174t214.5-66z'%3e%3c/path%3e%3c/svg%3e";
|
|
52
|
+
|
|
53
|
+
var img = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='768' height='768' viewBox='0 0 768 768'%3e%3cpath d='M379.5 288h4.5q39 0 67.5 28.5t28.5 67.5v6zM241.5 313.5q-18 36-18 70.5 0 66 47.25 113.25t113.25 47.25q34.5 0 70.5-18l-49.5-49.5q-12 3-21 3-39 0-67.5-28.5t-28.5-67.5q0-9 3-21zM64.5 136.5l40.5-40.5 567 567-40.5 40.5q-7.5-7.5-47.25-46.5t-60.75-60q-64.5 27-139.5 27-118.5 0-214.5-66t-138-174q16.5-39 51.75-86.25t68.25-72.75q-18-18-50.25-51t-36.75-37.5zM384 223.5q-30 0-58.5 12l-69-69q58.5-22.5 127.5-22.5 118.5 0 213.75 66t137.25 174q-36 88.5-109.5 151.5l-93-93q12-28.5 12-58.5 0-66-47.25-113.25t-113.25-47.25z'%3e%3c/path%3e%3c/svg%3e";
|
|
54
|
+
|
|
55
55
|
var GeometryType;
|
|
56
56
|
(function (GeometryType) {
|
|
57
57
|
GeometryType["Point"] = "Point";
|
|
@@ -63,8 +63,8 @@ var GeometryType;
|
|
|
63
63
|
GeometryType["MultiPolygon"] = "MultiPolygon";
|
|
64
64
|
GeometryType["GeometryCollection"] = "GeometryCollection";
|
|
65
65
|
GeometryType["Circle"] = "Circle";
|
|
66
|
-
})(GeometryType || (GeometryType = {}));
|
|
67
|
-
|
|
66
|
+
})(GeometryType || (GeometryType = {}));
|
|
67
|
+
|
|
68
68
|
const es = {
|
|
69
69
|
labels: {
|
|
70
70
|
select: 'Seleccionar',
|
|
@@ -93,6 +93,7 @@ const es = {
|
|
|
93
93
|
capabilities: 'No se pudieron obtener las Capabilidades del GeoServer',
|
|
94
94
|
wfst: 'El GeoServer no tiene soporte a Transacciones',
|
|
95
95
|
layer: 'No se pudieron obtener datos de la capa',
|
|
96
|
+
layerNotFound: 'CApa no encontrada',
|
|
96
97
|
noValidGeometry: 'No se encontraron geometrías válidas para agregar a esta capa',
|
|
97
98
|
geoserver: 'No se pudieron obtener datos desde el GeoServer',
|
|
98
99
|
badFormat: 'Formato no soportado',
|
|
@@ -101,8 +102,8 @@ const es = {
|
|
|
101
102
|
transaction: 'Error al hacer transacción con el GeoServer. HTTP status:',
|
|
102
103
|
getFeatures: 'Error al obtener elemento desde el GeoServer. HTTP status:'
|
|
103
104
|
}
|
|
104
|
-
};
|
|
105
|
-
|
|
105
|
+
};
|
|
106
|
+
|
|
106
107
|
const en = {
|
|
107
108
|
labels: {
|
|
108
109
|
select: 'Select',
|
|
@@ -131,6 +132,7 @@ const en = {
|
|
|
131
132
|
capabilities: 'GeoServer Capabilities could not be downloaded.',
|
|
132
133
|
wfst: 'The GeoServer does not support Transactions',
|
|
133
134
|
layer: 'Could not get data from layer',
|
|
135
|
+
layerNotFound: 'Layer not found',
|
|
134
136
|
noValidGeometry: 'No valid geometries found to add to this layer',
|
|
135
137
|
geoserver: 'Could not get data from the GeoServer',
|
|
136
138
|
badFormat: 'Unsupported format',
|
|
@@ -139,8 +141,8 @@ const en = {
|
|
|
139
141
|
transaction: 'Error when doing Transaction with GeoServer. HTTP status:',
|
|
140
142
|
getFeatures: 'Error getting elements from GeoServer. HTTP status:'
|
|
141
143
|
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
+
};
|
|
145
|
+
|
|
144
146
|
const zh = {
|
|
145
147
|
labels: {
|
|
146
148
|
select: '选择',
|
|
@@ -169,6 +171,7 @@ const zh = {
|
|
|
169
171
|
capabilities: '无法加载GeoServer服务所支持的能力.',
|
|
170
172
|
wfst: 'GeoServer不支持事务',
|
|
171
173
|
layer: '无法从图层获得数据',
|
|
174
|
+
layerNotFound: 'Layer not found',
|
|
172
175
|
noValidGeometry: '不支持的几何类型无法加载到图层',
|
|
173
176
|
geoserver: '无法从GeoServer获取数据',
|
|
174
177
|
badFormat: '不支持的格式',
|
|
@@ -177,15 +180,15 @@ const zh = {
|
|
|
177
180
|
transaction: 'GeoServer处理事务出错. HTTP状态码:',
|
|
178
181
|
getFeatures: '从GeoServer获取元素出错. HTTP状态码:'
|
|
179
182
|
}
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
var i18n = /*#__PURE__*/Object.freeze({
|
|
183
|
-
__proto__: null,
|
|
184
|
-
es: es,
|
|
185
|
-
en: en,
|
|
186
|
-
zh: zh
|
|
187
|
-
});
|
|
188
|
-
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
var i18n = /*#__PURE__*/Object.freeze({
|
|
186
|
+
__proto__: null,
|
|
187
|
+
es: es,
|
|
188
|
+
en: en,
|
|
189
|
+
zh: zh
|
|
190
|
+
});
|
|
191
|
+
|
|
189
192
|
// https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html
|
|
190
193
|
// Axis ordering: latitude/longitude
|
|
191
194
|
const DEFAULT_GEOSERVER_SRS = 'EPSG:3857';
|
|
@@ -207,6 +210,7 @@ const controlElement = document.createElement('div');
|
|
|
207
210
|
* @fires modifyend
|
|
208
211
|
* @fires drawstart
|
|
209
212
|
* @fires drawend
|
|
213
|
+
* @fires load
|
|
210
214
|
* @extends {ol/control/Control~Control}
|
|
211
215
|
* @param opt_options Wfst options, see [Wfst Options](#options) for more details.
|
|
212
216
|
*/
|
|
@@ -216,6 +220,7 @@ class Wfst extends Control {
|
|
|
216
220
|
target: null,
|
|
217
221
|
element: controlElement
|
|
218
222
|
});
|
|
223
|
+
this._initialized = false;
|
|
219
224
|
// Check if the selected language exists
|
|
220
225
|
this._i18n =
|
|
221
226
|
opt_options.language && opt_options.language in i18n
|
|
@@ -237,6 +242,7 @@ class Wfst extends Control {
|
|
|
237
242
|
projection: DEFAULT_GEOSERVER_SRS
|
|
238
243
|
},
|
|
239
244
|
headers: {},
|
|
245
|
+
credentials: 'same-origin',
|
|
240
246
|
layers: null,
|
|
241
247
|
evtType: 'singleclick',
|
|
242
248
|
active: true,
|
|
@@ -259,7 +265,7 @@ class Wfst extends Control {
|
|
|
259
265
|
}
|
|
260
266
|
};
|
|
261
267
|
this._options = deepObjectAssign(defaultOptions, opt_options);
|
|
262
|
-
this._mapLayers =
|
|
268
|
+
this._mapLayers = {};
|
|
263
269
|
this._countRequests = 0;
|
|
264
270
|
this._isEditModeOn = false;
|
|
265
271
|
// GeoServer
|
|
@@ -285,6 +291,17 @@ class Wfst extends Control {
|
|
|
285
291
|
this._controlWidgetToolsDiv.className = 'ol-wfst--tools-control';
|
|
286
292
|
this._initAsyncOperations();
|
|
287
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Gat all the layers in the ol-wfst instance
|
|
296
|
+
* If a name is provided, only returns that layer
|
|
297
|
+
* @public
|
|
298
|
+
*/
|
|
299
|
+
getLayers(layerName = '') {
|
|
300
|
+
if (layerName && layerName in this._mapLayers) {
|
|
301
|
+
return this._mapLayers[layerName];
|
|
302
|
+
}
|
|
303
|
+
return Object.values(this._mapLayers);
|
|
304
|
+
}
|
|
288
305
|
/**
|
|
289
306
|
* @private
|
|
290
307
|
*/
|
|
@@ -300,10 +317,6 @@ class Wfst extends Control {
|
|
|
300
317
|
/**
|
|
301
318
|
* Connect to the GeoServer and retrieve metadata about the service (GetCapabilities).
|
|
302
319
|
* Get each layer specs (DescribeFeatureType) and create the layers and map controls.
|
|
303
|
-
*
|
|
304
|
-
* @param layers
|
|
305
|
-
* @param showControl
|
|
306
|
-
* @param active
|
|
307
320
|
* @private
|
|
308
321
|
*/
|
|
309
322
|
_initAsyncOperations() {
|
|
@@ -311,7 +324,9 @@ class Wfst extends Control {
|
|
|
311
324
|
try {
|
|
312
325
|
// @ts-expect-error
|
|
313
326
|
this.on('allDescribeFeatureTypeLoaded', this._onLoad);
|
|
314
|
-
this.
|
|
327
|
+
if (this._isVisible) {
|
|
328
|
+
this._showLoading();
|
|
329
|
+
}
|
|
315
330
|
yield this._connectToGeoServerAndGetCapabilities();
|
|
316
331
|
if (this._options.layers) {
|
|
317
332
|
yield this._getGeoserverLayersData(this._options.layers, this._options.geoServerUrl);
|
|
@@ -348,7 +363,8 @@ class Wfst extends Control {
|
|
|
348
363
|
const url_fetch = this._options.geoServerUrl + '?' + params.toString();
|
|
349
364
|
try {
|
|
350
365
|
const response = yield fetch(url_fetch, {
|
|
351
|
-
headers: this._options.headers
|
|
366
|
+
headers: this._options.headers,
|
|
367
|
+
credentials: this._options.credentials
|
|
352
368
|
});
|
|
353
369
|
if (!response.ok) {
|
|
354
370
|
throw new Error('');
|
|
@@ -405,8 +421,7 @@ class Wfst extends Control {
|
|
|
405
421
|
const getLayerData = (layerName) => __awaiter(this, void 0, void 0, function* () {
|
|
406
422
|
const params = new URLSearchParams({
|
|
407
423
|
service: 'wfs',
|
|
408
|
-
version: this._options.geoServerAdvanced
|
|
409
|
-
.describeFeatureTypeVersion,
|
|
424
|
+
version: this._options.geoServerAdvanced.describeFeatureTypeVersion,
|
|
410
425
|
request: 'DescribeFeatureType',
|
|
411
426
|
typeName: layerName,
|
|
412
427
|
outputFormat: 'application/json',
|
|
@@ -414,7 +429,8 @@ class Wfst extends Control {
|
|
|
414
429
|
});
|
|
415
430
|
const url_fetch = geoServerUrl + '?' + params.toString();
|
|
416
431
|
const response = yield fetch(url_fetch, {
|
|
417
|
-
headers: this._options.headers
|
|
432
|
+
headers: this._options.headers,
|
|
433
|
+
credentials: this._options.credentials
|
|
418
434
|
});
|
|
419
435
|
if (!response.ok) {
|
|
420
436
|
throw new Error('');
|
|
@@ -503,7 +519,8 @@ class Wfst extends Control {
|
|
|
503
519
|
tileLoadFunction: (tile, src) => __awaiter(this, void 0, void 0, function* () {
|
|
504
520
|
try {
|
|
505
521
|
const response = yield fetch(src, {
|
|
506
|
-
headers: this._options.headers
|
|
522
|
+
headers: this._options.headers,
|
|
523
|
+
credentials: this._options.credentials
|
|
507
524
|
});
|
|
508
525
|
if (!response.ok) {
|
|
509
526
|
throw new Error('');
|
|
@@ -578,7 +595,8 @@ class Wfst extends Control {
|
|
|
578
595
|
'?' +
|
|
579
596
|
params.toString();
|
|
580
597
|
const response = yield fetch(url_fetch, {
|
|
581
|
-
headers: this._options.headers
|
|
598
|
+
headers: this._options.headers,
|
|
599
|
+
credentials: this._options.credentials
|
|
582
600
|
});
|
|
583
601
|
if (!response.ok) {
|
|
584
602
|
throw new Error('');
|
|
@@ -594,8 +612,7 @@ class Wfst extends Control {
|
|
|
594
612
|
featureProjection: this._view
|
|
595
613
|
.getProjection()
|
|
596
614
|
.getCode(),
|
|
597
|
-
dataProjection: this._options.geoServerAdvanced
|
|
598
|
-
.projection
|
|
615
|
+
dataProjection: this._options.geoServerAdvanced.projection
|
|
599
616
|
});
|
|
600
617
|
features.forEach((feature) => {
|
|
601
618
|
feature.set('_layerName_', layerName,
|
|
@@ -759,7 +776,8 @@ class Wfst extends Control {
|
|
|
759
776
|
});
|
|
760
777
|
try {
|
|
761
778
|
const response = yield fetch(url, {
|
|
762
|
-
headers: this._options.headers
|
|
779
|
+
headers: this._options.headers,
|
|
780
|
+
credentials: this._options.credentials
|
|
763
781
|
});
|
|
764
782
|
if (!response.ok) {
|
|
765
783
|
throw new Error(this._i18n.errors.getFeatures +
|
|
@@ -922,27 +940,27 @@ class Wfst extends Control {
|
|
|
922
940
|
const layerName = layerParams.name;
|
|
923
941
|
const layerLabel = `<span title="${this._geoServerData[layerName].geomType}">${layerParams.label || layerName}</span>`;
|
|
924
942
|
const visible = 'visible' in layerParams ? layerParams.visible : true;
|
|
925
|
-
return `
|
|
926
|
-
<div class="wfst--layer-control
|
|
927
|
-
${visible ? 'ol-wfst--visible-on' : ''}
|
|
943
|
+
return `
|
|
944
|
+
<div class="wfst--layer-control
|
|
945
|
+
${visible ? 'ol-wfst--visible-on' : ''}
|
|
928
946
|
${layerName === this._layerToInsertElements
|
|
929
947
|
? 'ol-wfst--selected-on'
|
|
930
|
-
: ''}
|
|
931
|
-
" data-layer="${layerName}">
|
|
932
|
-
<div class="ol-wfst--tools-control-visible">
|
|
933
|
-
<span class="ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-on" title="${this._i18n.labels.toggleVisibility}">
|
|
934
|
-
<img src="${img$
|
|
935
|
-
</span>
|
|
936
|
-
<span class="ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-off" title="${this._i18n.labels.toggleVisibility}">
|
|
937
|
-
<img src="${img
|
|
938
|
-
</span>
|
|
939
|
-
</div>
|
|
940
|
-
<label for="wfst--${layerName}">
|
|
948
|
+
: ''}
|
|
949
|
+
" data-layer="${layerName}">
|
|
950
|
+
<div class="ol-wfst--tools-control-visible">
|
|
951
|
+
<span class="ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-on" title="${this._i18n.labels.toggleVisibility}">
|
|
952
|
+
<img src="${img$1}"/>
|
|
953
|
+
</span>
|
|
954
|
+
<span class="ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-off" title="${this._i18n.labels.toggleVisibility}">
|
|
955
|
+
<img src="${img}"/>
|
|
956
|
+
</span>
|
|
957
|
+
</div>
|
|
958
|
+
<label for="wfst--${layerName}">
|
|
941
959
|
<input value="${layerName}" id="wfst--${layerName}" type="radio" class="ol-wfst--tools-control-input" name="wfst--select-layer" ${layerName === this._layerToInsertElements
|
|
942
960
|
? 'checked="checked"'
|
|
943
|
-
: ''}>
|
|
944
|
-
${layerLabel}
|
|
945
|
-
</label>
|
|
961
|
+
: ''}>
|
|
962
|
+
${layerLabel}
|
|
963
|
+
</label>
|
|
946
964
|
</div>`;
|
|
947
965
|
};
|
|
948
966
|
let htmlLayers = '';
|
|
@@ -998,7 +1016,7 @@ class Wfst extends Control {
|
|
|
998
1016
|
uploadButton.className =
|
|
999
1017
|
'ol-wfst--tools-control-btn ol-wfst--tools-control-btn-upload';
|
|
1000
1018
|
uploadButton.htmlFor = 'ol-wfst--upload';
|
|
1001
|
-
uploadButton.innerHTML = `<img src="${img$
|
|
1019
|
+
uploadButton.innerHTML = `<img src="${img$2}"/> `;
|
|
1002
1020
|
uploadButton.title = this._i18n.labels.uploadToLayer;
|
|
1003
1021
|
// Hidden Input form
|
|
1004
1022
|
const uploadInput = document.createElement('input');
|
|
@@ -1022,7 +1040,7 @@ class Wfst extends Control {
|
|
|
1022
1040
|
drawButton.className =
|
|
1023
1041
|
'ol-wfst--tools-control-btn ol-wfst--tools-control-btn-draw';
|
|
1024
1042
|
drawButton.type = 'button';
|
|
1025
|
-
drawButton.innerHTML = `<img src="${img}"/>`;
|
|
1043
|
+
drawButton.innerHTML = `<img src="${img$5}"/>`;
|
|
1026
1044
|
drawButton.title = this._i18n.labels.addElement;
|
|
1027
1045
|
drawButton.onclick = () => {
|
|
1028
1046
|
if (this._isDrawModeOn) {
|
|
@@ -1098,10 +1116,18 @@ class Wfst extends Control {
|
|
|
1098
1116
|
}
|
|
1099
1117
|
/**
|
|
1100
1118
|
* Hide loading
|
|
1119
|
+
* @fires load
|
|
1101
1120
|
* @private
|
|
1102
1121
|
*/
|
|
1103
1122
|
_hideLoading() {
|
|
1104
|
-
|
|
1123
|
+
// run only once
|
|
1124
|
+
if (!this._initialized) {
|
|
1125
|
+
this.dispatchEvent('load');
|
|
1126
|
+
this._initialized = true;
|
|
1127
|
+
}
|
|
1128
|
+
if (this._modalLoading) {
|
|
1129
|
+
this._modalLoading.classList.remove('ol-wfst--tools-control--loading-show');
|
|
1130
|
+
}
|
|
1105
1131
|
}
|
|
1106
1132
|
/**
|
|
1107
1133
|
* Lock a feature in the geoserver before edit
|
|
@@ -1127,7 +1153,8 @@ class Wfst extends Control {
|
|
|
1127
1153
|
const url_fetch = this._options.geoServerUrl + '?' + params.toString();
|
|
1128
1154
|
try {
|
|
1129
1155
|
const response = yield fetch(url_fetch, {
|
|
1130
|
-
headers: this._options.headers
|
|
1156
|
+
headers: this._options.headers,
|
|
1157
|
+
credentials: this._options.credentials
|
|
1131
1158
|
});
|
|
1132
1159
|
if (!response.ok) {
|
|
1133
1160
|
throw new Error(this._i18n.errors.lockFeature);
|
|
@@ -1256,7 +1283,8 @@ class Wfst extends Control {
|
|
|
1256
1283
|
}
|
|
1257
1284
|
}
|
|
1258
1285
|
if (!clonedFeatures.length) {
|
|
1259
|
-
|
|
1286
|
+
this._showError(this._i18n.errors.noValidGeometry);
|
|
1287
|
+
return false;
|
|
1260
1288
|
}
|
|
1261
1289
|
switch (action) {
|
|
1262
1290
|
case 'insert':
|
|
@@ -1280,95 +1308,111 @@ class Wfst extends Control {
|
|
|
1280
1308
|
}
|
|
1281
1309
|
this._countRequests++;
|
|
1282
1310
|
const numberRequest = this._countRequests;
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1311
|
+
return new Promise((resolve, reject) => {
|
|
1312
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
1313
|
+
try {
|
|
1314
|
+
// Prevent fire multiples times
|
|
1315
|
+
if (numberRequest !== this._countRequests) {
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
let srs = this._view.getProjection().getCode();
|
|
1319
|
+
// Force latitude/longitude order on transactions
|
|
1320
|
+
// EPSG:4326 is longitude/latitude (assumption) and is not managed correctly by GML3
|
|
1321
|
+
srs =
|
|
1322
|
+
srs === 'EPSG:4326'
|
|
1323
|
+
? 'urn:x-ogc:def:crs:EPSG:4326'
|
|
1324
|
+
: srs;
|
|
1325
|
+
const geoLayer = this._geoServerData[layerName];
|
|
1326
|
+
if (!geoLayer) {
|
|
1327
|
+
throw new Error(this._i18n.errors.layerNotFound);
|
|
1328
|
+
}
|
|
1329
|
+
const options = {
|
|
1330
|
+
featureNS: geoLayer.namespace,
|
|
1331
|
+
featureType: layerName,
|
|
1332
|
+
srsName: srs,
|
|
1333
|
+
featurePrefix: null,
|
|
1334
|
+
nativeElements: null,
|
|
1335
|
+
version: this._options.geoServerAdvanced
|
|
1336
|
+
.wfsTransactionVersion
|
|
1337
|
+
};
|
|
1338
|
+
const transaction = this._formatWFS.writeTransaction(this._insertFeatures, this._updateFeatures, this._deleteFeatures, options);
|
|
1339
|
+
let payload = this._xs.serializeToString(transaction);
|
|
1340
|
+
const geomType = geoLayer.geomType;
|
|
1341
|
+
const geomField = geoLayer.geomField;
|
|
1342
|
+
// Ugly fix to support GeometryCollection on GML
|
|
1343
|
+
// See https://github.com/openlayers/openlayers/issues/4220
|
|
1344
|
+
if (geomType === GeometryType.GeometryCollection) {
|
|
1345
|
+
if (action === 'insert') {
|
|
1346
|
+
payload = payload.replace(/<geometry>/g, `<geometry><MultiGeometry xmlns="http://www.opengis.net/gml" srsName="${srs}"><geometryMember>`);
|
|
1347
|
+
payload = payload.replace(/<\/geometry>/g, `</geometryMember></MultiGeometry></geometry>`);
|
|
1348
|
+
}
|
|
1349
|
+
else if (action === 'update') {
|
|
1350
|
+
const gmemberIn = `<MultiGeometry xmlns="http://www.opengis.net/gml" srsName="${srs}"><geometryMember>`;
|
|
1351
|
+
const gmemberOut = `</geometryMember></MultiGeometry>`;
|
|
1352
|
+
payload = payload.replace(/(.*)(<Name>geometry<\/Name><Value>)(.*?)(<\/Value>)(.*)/g, `$1$2${gmemberIn}$3${gmemberOut}$4$5`);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
// Fixes geometry name, weird bug with GML:
|
|
1356
|
+
// The property for the geometry column is always named "geometry"
|
|
1309
1357
|
if (action === 'insert') {
|
|
1310
|
-
payload = payload.replace(/<
|
|
1311
|
-
payload = payload.replace(/<\/geometry>/g, `</geometryMember></MultiGeometry></geometry>`);
|
|
1358
|
+
payload = payload.replace(/<(\/?)\bgeometry\b>/g, `<$1${geomField}>`);
|
|
1312
1359
|
}
|
|
1313
|
-
else
|
|
1314
|
-
|
|
1315
|
-
const gmemberOut = `</geometryMember></MultiGeometry>`;
|
|
1316
|
-
payload = payload.replace(/(.*)(<Name>geometry<\/Name><Value>)(.*?)(<\/Value>)(.*)/g, `$1$2${gmemberIn}$3${gmemberOut}$4$5`);
|
|
1360
|
+
else {
|
|
1361
|
+
payload = payload.replace(/<Name>geometry<\/Name>/g, `<Name>${geomField}</Name>`);
|
|
1317
1362
|
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
}
|
|
1324
|
-
else {
|
|
1325
|
-
payload = payload.replace(/<Name>geometry<\/Name>/g, `<Name>${geomField}</Name>`);
|
|
1326
|
-
}
|
|
1327
|
-
// Add default LockId value
|
|
1328
|
-
if (this._hasLockFeature &&
|
|
1329
|
-
this._useLockFeature &&
|
|
1330
|
-
action !== 'insert') {
|
|
1331
|
-
payload = payload.replace(`</Transaction>`, `<LockId>GeoServer</LockId></Transaction>`);
|
|
1332
|
-
}
|
|
1333
|
-
const headers = Object.assign({ 'Content-Type': 'text/xml' }, this._options.headers);
|
|
1334
|
-
const response = yield fetch(this._options.geoServerUrl, {
|
|
1335
|
-
method: 'POST',
|
|
1336
|
-
body: payload,
|
|
1337
|
-
headers: headers
|
|
1338
|
-
});
|
|
1339
|
-
if (!response.ok) {
|
|
1340
|
-
throw new Error(this._i18n.errors.transaction + ' ' + response.status);
|
|
1341
|
-
}
|
|
1342
|
-
const parseResponse = this._formatWFS.readTransactionResponse(response);
|
|
1343
|
-
if (!Object.keys(parseResponse).length) {
|
|
1344
|
-
const responseStr = yield response.text();
|
|
1345
|
-
const findError = String(responseStr).match(/<ows:ExceptionText>([\s\S]*?)<\/ows:ExceptionText>/);
|
|
1346
|
-
if (findError) {
|
|
1347
|
-
this._showError(findError[1]);
|
|
1363
|
+
// Add default LockId value
|
|
1364
|
+
if (this._hasLockFeature &&
|
|
1365
|
+
this._useLockFeature &&
|
|
1366
|
+
action !== 'insert') {
|
|
1367
|
+
payload = payload.replace(`</Transaction>`, `<LockId>GeoServer</LockId></Transaction>`);
|
|
1348
1368
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1369
|
+
const headers = Object.assign({ 'Content-Type': 'text/xml' }, this._options.headers);
|
|
1370
|
+
const response = yield fetch(this._options.geoServerUrl, {
|
|
1371
|
+
method: 'POST',
|
|
1372
|
+
body: payload,
|
|
1373
|
+
headers: headers,
|
|
1374
|
+
credentials: this._options.credentials
|
|
1375
|
+
});
|
|
1376
|
+
if (!response.ok) {
|
|
1377
|
+
throw new Error(this._i18n.errors.transaction +
|
|
1378
|
+
' ' +
|
|
1379
|
+
response.status);
|
|
1353
1380
|
}
|
|
1381
|
+
const parseResponse = this._formatWFS.readTransactionResponse(response);
|
|
1382
|
+
if (!Object.keys(parseResponse).length) {
|
|
1383
|
+
const responseStr = yield response.text();
|
|
1384
|
+
const findError = String(responseStr).match(/<ows:ExceptionText>([\s\S]*?)<\/ows:ExceptionText>/);
|
|
1385
|
+
if (findError) {
|
|
1386
|
+
throw new Error(findError[1]);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
if (action !== 'delete') {
|
|
1390
|
+
for (const feature of features) {
|
|
1391
|
+
this._editLayer.getSource().removeFeature(feature);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
const wlayer = this._mapLayers[layerName];
|
|
1395
|
+
if (wlayer instanceof Vector) {
|
|
1396
|
+
refreshWfsLayer(wlayer);
|
|
1397
|
+
}
|
|
1398
|
+
else if (wlayer instanceof Tile) {
|
|
1399
|
+
refreshWmsLayer(wlayer);
|
|
1400
|
+
}
|
|
1401
|
+
this._hideLoading();
|
|
1402
|
+
this._insertFeatures = [];
|
|
1403
|
+
this._updateFeatures = [];
|
|
1404
|
+
this._deleteFeatures = [];
|
|
1405
|
+
this._countRequests = 0;
|
|
1406
|
+
resolve(true);
|
|
1354
1407
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
refreshWmsLayer(this._mapLayers[layerName]);
|
|
1408
|
+
catch (err) {
|
|
1409
|
+
this._showError(err.message, err);
|
|
1410
|
+
this._hideLoading();
|
|
1411
|
+
this._countRequests = 0;
|
|
1412
|
+
reject();
|
|
1361
1413
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
catch (err) {
|
|
1365
|
-
this._showError(err.message, err);
|
|
1366
|
-
}
|
|
1367
|
-
this._insertFeatures = [];
|
|
1368
|
-
this._updateFeatures = [];
|
|
1369
|
-
this._deleteFeatures = [];
|
|
1370
|
-
this._countRequests = 0;
|
|
1371
|
-
}), 0);
|
|
1414
|
+
}), 0);
|
|
1415
|
+
});
|
|
1372
1416
|
});
|
|
1373
1417
|
}
|
|
1374
1418
|
/**
|
|
@@ -1720,7 +1764,7 @@ class Wfst extends Control {
|
|
|
1720
1764
|
*/
|
|
1721
1765
|
_addFeatureToEdit(feature, coordinate = null, layerName = null) {
|
|
1722
1766
|
const prepareOverlay = () => {
|
|
1723
|
-
const svgFields = `<img src="${img$
|
|
1767
|
+
const svgFields = `<img src="${img$4}"/>`;
|
|
1724
1768
|
const editFieldsEl = document.createElement('div');
|
|
1725
1769
|
editFieldsEl.className = 'ol-wfst--edit-button-cnt';
|
|
1726
1770
|
editFieldsEl.innerHTML = `<button class="ol-wfst--edit-button" type="button" title="${this._i18n.labels.editFields}">${svgFields}</button>`;
|
|
@@ -1729,7 +1773,7 @@ class Wfst extends Control {
|
|
|
1729
1773
|
};
|
|
1730
1774
|
const buttons = document.createElement('div');
|
|
1731
1775
|
buttons.append(editFieldsEl);
|
|
1732
|
-
const svgGeom = `<img src="${img$
|
|
1776
|
+
const svgGeom = `<img src="${img$3}"/>`;
|
|
1733
1777
|
const editGeomEl = document.createElement('div');
|
|
1734
1778
|
editGeomEl.className = 'ol-wfst--edit-button-cnt';
|
|
1735
1779
|
editGeomEl.innerHTML = `<button class="ol-wfst--edit-button" type="button" title="${this._i18n.labels.editGeom}">${svgGeom}</button>`;
|
|
@@ -1782,13 +1826,13 @@ class Wfst extends Control {
|
|
|
1782
1826
|
* @private
|
|
1783
1827
|
*/
|
|
1784
1828
|
_initUploadFileModal(content, featuresToInsert) {
|
|
1785
|
-
const footer = `
|
|
1786
|
-
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
|
1787
|
-
${this._i18n.labels.cancel}
|
|
1788
|
-
</button>
|
|
1789
|
-
<button type="button" class="btn btn-sm btn-primary" data-action="save" data-dismiss="modal">
|
|
1790
|
-
${this._i18n.labels.upload}
|
|
1791
|
-
</button>
|
|
1829
|
+
const footer = `
|
|
1830
|
+
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
|
1831
|
+
${this._i18n.labels.cancel}
|
|
1832
|
+
</button>
|
|
1833
|
+
<button type="button" class="btn btn-sm btn-primary" data-action="save" data-dismiss="modal">
|
|
1834
|
+
${this._i18n.labels.upload}
|
|
1835
|
+
</button>
|
|
1792
1836
|
`;
|
|
1793
1837
|
const modal = new Modal(Object.assign(Object.assign({}, this._options.modal), { header: true, headerClose: false, title: this._i18n.labels.uploadFeatures +
|
|
1794
1838
|
' ' +
|
|
@@ -1941,11 +1985,11 @@ class Wfst extends Control {
|
|
|
1941
1985
|
else {
|
|
1942
1986
|
this._resetStateButtons();
|
|
1943
1987
|
this.activateEditMode();
|
|
1944
|
-
const content = `
|
|
1945
|
-
${this._i18n.labels.validFeatures}: ${validFeaturesCount}<br>
|
|
1988
|
+
const content = `
|
|
1989
|
+
${this._i18n.labels.validFeatures}: ${validFeaturesCount}<br>
|
|
1946
1990
|
${invalidFeaturesCount
|
|
1947
1991
|
? `${this._i18n.labels.invalidFeatures}: ${invalidFeaturesCount}`
|
|
1948
|
-
: ''}
|
|
1992
|
+
: ''}
|
|
1949
1993
|
`;
|
|
1950
1994
|
this._editLayer.getSource().addFeatures(featuresToInsert);
|
|
1951
1995
|
this._initUploadFileModal(content, featuresToInsert);
|
|
@@ -2098,15 +2142,19 @@ class Wfst extends Control {
|
|
|
2098
2142
|
this.interactionWfsSelect.setActive(bool);
|
|
2099
2143
|
}
|
|
2100
2144
|
/**
|
|
2145
|
+
*
|
|
2101
2146
|
* Add features directly to the geoserver, in a custom layer
|
|
2102
2147
|
* without checking geometry or showing modal to confirm.
|
|
2148
|
+
* Returns `true` if features are inserted correctly
|
|
2103
2149
|
*
|
|
2104
2150
|
* @param layerName
|
|
2105
2151
|
* @param features
|
|
2106
|
-
* @
|
|
2152
|
+
* @returns
|
|
2107
2153
|
*/
|
|
2108
2154
|
insertFeaturesTo(layerName, features) {
|
|
2109
|
-
this
|
|
2155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2156
|
+
return yield this._transactWFS('insert', features, layerName);
|
|
2157
|
+
});
|
|
2110
2158
|
}
|
|
2111
2159
|
/**
|
|
2112
2160
|
* Shows a fields form in a modal window to allow changes in the properties of the feature.
|
|
@@ -2142,25 +2190,25 @@ class Wfst extends Control {
|
|
|
2142
2190
|
type = 'text';
|
|
2143
2191
|
}
|
|
2144
2192
|
if (type) {
|
|
2145
|
-
content += `
|
|
2146
|
-
<div class="ol-wfst--input-field-container">
|
|
2147
|
-
<label class="ol-wfst--input-field-label" for="${key}">${key}</label>
|
|
2148
|
-
<input placeholder="NULL" class="ol-wfst--input-field-input" type="${type}" name="${key}" value="${properties[key] || ''}">
|
|
2193
|
+
content += `
|
|
2194
|
+
<div class="ol-wfst--input-field-container">
|
|
2195
|
+
<label class="ol-wfst--input-field-label" for="${key}">${key}</label>
|
|
2196
|
+
<input placeholder="NULL" class="ol-wfst--input-field-input" type="${type}" name="${key}" value="${properties[key] || ''}">
|
|
2149
2197
|
</div>`;
|
|
2150
2198
|
}
|
|
2151
2199
|
}
|
|
2152
2200
|
});
|
|
2153
2201
|
content += '</form>';
|
|
2154
|
-
const footer = `
|
|
2155
|
-
<button type="button" class="btn btn-sm btn-link btn-third" data-action="delete" data-dismiss="modal">
|
|
2156
|
-
${this._i18n.labels.delete}
|
|
2157
|
-
</button>
|
|
2158
|
-
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
|
2159
|
-
${this._i18n.labels.cancel}
|
|
2160
|
-
</button>
|
|
2161
|
-
<button type="button" class="btn btn-sm btn-primary" data-action="save" data-dismiss="modal">
|
|
2162
|
-
${this._i18n.labels.save}
|
|
2163
|
-
</button>
|
|
2202
|
+
const footer = `
|
|
2203
|
+
<button type="button" class="btn btn-sm btn-link btn-third" data-action="delete" data-dismiss="modal">
|
|
2204
|
+
${this._i18n.labels.delete}
|
|
2205
|
+
</button>
|
|
2206
|
+
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
|
2207
|
+
${this._i18n.labels.cancel}
|
|
2208
|
+
</button>
|
|
2209
|
+
<button type="button" class="btn btn-sm btn-primary" data-action="save" data-dismiss="modal">
|
|
2210
|
+
${this._i18n.labels.save}
|
|
2211
|
+
</button>
|
|
2164
2212
|
`;
|
|
2165
2213
|
const modal = new Modal(Object.assign(Object.assign({}, this._options.modal), { header: true, headerClose: true, title: `${this._i18n.labels.editElement} ${this._editFeature.getId()} `, content: content, footer: footer })).show();
|
|
2166
2214
|
modal.on('dismiss', (modal, event) => {
|
|
@@ -2222,7 +2270,7 @@ const deepObjectAssign = (target, ...sources) => {
|
|
|
2222
2270
|
});
|
|
2223
2271
|
});
|
|
2224
2272
|
return target;
|
|
2225
|
-
};
|
|
2226
|
-
|
|
2227
|
-
export default
|
|
2228
|
-
//# sourceMappingURL=ol-wfst.js.map
|
|
2273
|
+
};
|
|
2274
|
+
|
|
2275
|
+
export { Wfst as default };
|
|
2276
|
+
//# sourceMappingURL=ol-wfst.js.map
|