ol-wfst 4.2.0 → 4.3.0

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.
Files changed (79) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +20 -21
  3. package/dist/@enums.d.ts +17 -0
  4. package/dist/@enums.d.ts.map +1 -0
  5. package/dist/@types.d.ts +201 -0
  6. package/dist/@types.d.ts.map +1 -0
  7. package/dist/Geoserver.d.ts +275 -0
  8. package/dist/Geoserver.d.ts.map +1 -0
  9. package/dist/WfsLayer.d.ts +53 -0
  10. package/dist/WfsLayer.d.ts.map +1 -0
  11. package/dist/WmsLayer.d.ts +69 -0
  12. package/dist/WmsLayer.d.ts.map +1 -0
  13. package/dist/css/ol-wfst.bootstrap5.css +18 -18
  14. package/dist/css/ol-wfst.bootstrap5.min.css +1 -1
  15. package/dist/css/ol-wfst.css +24 -39
  16. package/dist/css/ol-wfst.min.css +1 -1
  17. package/dist/defaults.d.ts +4 -0
  18. package/dist/defaults.d.ts.map +1 -0
  19. package/dist/index-umd.d.ts +3 -0
  20. package/dist/index-umd.d.ts.map +1 -0
  21. package/dist/modules/EditControlChanges.d.ts +18 -0
  22. package/dist/modules/EditControlChanges.d.ts.map +1 -0
  23. package/dist/modules/EditFieldsModal.d.ts +19 -0
  24. package/dist/modules/EditFieldsModal.d.ts.map +1 -0
  25. package/dist/modules/EditOverlay.d.ts +8 -0
  26. package/dist/modules/EditOverlay.d.ts.map +1 -0
  27. package/dist/modules/LayersControl.d.ts +38 -0
  28. package/dist/modules/LayersControl.d.ts.map +1 -0
  29. package/dist/modules/Uploads.d.ts +50 -0
  30. package/dist/modules/Uploads.d.ts.map +1 -0
  31. package/dist/modules/base/BaseLayer.d.ts +62 -0
  32. package/dist/modules/base/BaseLayer.d.ts.map +1 -0
  33. package/dist/modules/base/WfsSource.d.ts +49 -0
  34. package/dist/modules/base/WfsSource.d.ts.map +1 -0
  35. package/dist/modules/base/WmsSource.d.ts +47 -0
  36. package/dist/modules/base/WmsSource.d.ts.map +1 -0
  37. package/dist/modules/editLayer.d.ts +4 -0
  38. package/dist/modules/editLayer.d.ts.map +1 -0
  39. package/dist/modules/errors.d.ts +12 -0
  40. package/dist/modules/errors.d.ts.map +1 -0
  41. package/dist/modules/helpers.d.ts +7 -0
  42. package/dist/modules/helpers.d.ts.map +1 -0
  43. package/dist/modules/i18n/en.d.ts +3 -0
  44. package/dist/modules/i18n/en.d.ts.map +1 -0
  45. package/dist/modules/i18n/es.d.ts +3 -0
  46. package/dist/modules/i18n/es.d.ts.map +1 -0
  47. package/dist/modules/i18n/index.d.ts +15 -0
  48. package/dist/modules/i18n/index.d.ts.map +1 -0
  49. package/dist/modules/i18n/zh.d.ts +3 -0
  50. package/dist/modules/i18n/zh.d.ts.map +1 -0
  51. package/dist/modules/loading.d.ts +3 -0
  52. package/dist/modules/loading.d.ts.map +1 -0
  53. package/dist/modules/state.d.ts +22 -0
  54. package/dist/modules/state.d.ts.map +1 -0
  55. package/dist/modules/styleFunction.d.ts +13 -0
  56. package/dist/modules/styleFunction.d.ts.map +1 -0
  57. package/dist/myPragma.d.ts +2 -0
  58. package/dist/myPragma.d.ts.map +1 -0
  59. package/dist/ol-wfst.d.ts +335 -0
  60. package/dist/ol-wfst.d.ts.map +1 -0
  61. package/dist/ol-wfst.js +24 -11
  62. package/dist/ol-wfst.js.map +1 -1
  63. package/dist/ol-wfst.min.js +3 -3
  64. package/dist/ol-wfst.min.js.map +1 -1
  65. package/lib/Geoserver.d.ts.map +1 -1
  66. package/lib/modules/LayersControl.d.ts +8 -4
  67. package/lib/modules/LayersControl.d.ts.map +1 -1
  68. package/lib/modules/base/WfsSource.d.ts +2 -1
  69. package/lib/modules/base/WfsSource.d.ts.map +1 -1
  70. package/lib/ol-wfst.d.ts +19 -21
  71. package/lib/ol-wfst.d.ts.map +1 -1
  72. package/lib/ol-wfst.js +24 -11
  73. package/lib/ol-wfst.js.map +1 -1
  74. package/lib/style/css/ol-gisify.css +24 -39
  75. package/lib/style/css/ol-wfst.bootstrap5.css +18 -18
  76. package/lib/style/scss/ol-wfst.scss +80 -58
  77. package/package.json +5 -5
  78. package/dist/tsconfig.tsbuildinfo +0 -1
  79. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,62 @@
1
+ import Feature from 'ol/Feature.js';
2
+ import Geometry from 'ol/geom/Geometry.js';
3
+ import { TransactionResponse } from 'ol/format/WFS.js';
4
+ import Layer from 'ol/layer/Base.js';
5
+ import Geoserver from '../../Geoserver';
6
+ import { IGeoserverDescribeFeatureType } from '../../@types';
7
+ import { TransactionType } from '../../@enums';
8
+ /**
9
+ * Base class from which all layer types are derived.
10
+ */
11
+ export default class BaseLayer extends Layer {
12
+ /**
13
+ * @private
14
+ */
15
+ _init(): void;
16
+ /**
17
+ * Request and store data layers obtained by DescribeFeatureType
18
+ *
19
+ * @public
20
+ */
21
+ getAndUpdateDescribeFeatureType(): Promise<void>;
22
+ /**
23
+ * @public
24
+ * @returns
25
+ */
26
+ isVisibleByZoom(): boolean;
27
+ /**
28
+ *
29
+ * @param mode
30
+ * @param features
31
+ * @public
32
+ */
33
+ transactFeatures(mode: TransactionType, features: Array<Feature<Geometry>> | Feature<Geometry>): Promise<TransactionResponse | false>;
34
+ insertFeatures(features: Array<Feature<Geometry>> | Feature<Geometry>): Promise<TransactionResponse | false>;
35
+ /**
36
+ * @public
37
+ * @param featureId
38
+ * @returns
39
+ */
40
+ maybeLockFeature(featureId: string | number): Promise<string>;
41
+ /**
42
+ *
43
+ * @returns
44
+ * @public
45
+ */
46
+ getGeoserver(): Geoserver;
47
+ /**
48
+ *
49
+ * @returns
50
+ * @public
51
+ */
52
+ getDescribeFeatureType(): IGeoserverDescribeFeatureType;
53
+ }
54
+ export declare enum BaseLayerProperty {
55
+ NAME = "name",
56
+ LABEL = "label",
57
+ DESCRIBEFEATURETYPE = "describeFeatureType",
58
+ ISVISIBLE = "isVisible",
59
+ GEOSERVER = "geoserver"
60
+ }
61
+ export type BaseLayerEventTypes = 'layerRendered' | `change:${BaseLayerProperty.DESCRIBEFEATURETYPE}` | `change:${BaseLayerProperty.ISVISIBLE}`;
62
+ //# sourceMappingURL=BaseLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseLayer.d.ts","sourceRoot":"","sources":["../../../src/modules/base/BaseLayer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAgB,eAAe,EAAE,MAAM,cAAc,CAAC;AAM7D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,KAAK;IACxC;;OAEG;IACH,KAAK,IAAI,IAAI;IAYb;;;;OAIG;IACG,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC;IAyDtD;;;OAGG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;OAKG;IACG,gBAAgB,CAClB,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,GACvD,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC;IASjC,cAAc,CAChB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,GACvD,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC;IAIvC;;;;OAIG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYnE;;;;OAIG;IACH,YAAY,IAAI,SAAS;IAIzB;;;;OAIG;IACH,sBAAsB,IAAI,6BAA6B;CAG1D;AAED,oBAAY,iBAAiB;IACzB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,mBAAmB,wBAAwB;IAC3C,SAAS,cAAc;IACvB,SAAS,cAAc;CAC1B;AAED,MAAM,MAAM,mBAAmB,GACzB,eAAe,GACf,UAAU,iBAAiB,CAAC,mBAAmB,EAAE,GACjD,UAAU,iBAAiB,CAAC,SAAS,EAAE,CAAC"}
@@ -0,0 +1,49 @@
1
+ import Feature from 'ol/Feature.js';
2
+ import VectorSource, { Options as VSOptions } from 'ol/source/Vector.js';
3
+ import { WfsGeoserverVendor } from '../../@types';
4
+ import { GeoServerAdvanced } from '../../Geoserver';
5
+ /**
6
+ * Layer source to retrieve WFS features from geoservers
7
+ * https://docs.geoserver.org/stable/en/user/services/wfs/reference.html
8
+ *
9
+ * @extends {ol/source/Vector~VectorSource}
10
+ * @param options
11
+ */
12
+ export default class WfsSource extends VectorSource {
13
+ urlParams: URLSearchParams;
14
+ constructor(options: WfsSourceOptions);
15
+ }
16
+ /**
17
+ * **_[interface]_** - Parameters to create a WfsSource
18
+ *
19
+ * @public
20
+ */
21
+ export interface WfsSourceOptions extends VSOptions<Feature> {
22
+ /**
23
+ * Layer name in the GeoServer
24
+ */
25
+ name: string;
26
+ /**
27
+ * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests
28
+ */
29
+ geoserverUrl: string;
30
+ /**
31
+ * Advanced options for geoserver requests
32
+ */
33
+ geoServerAdvanced?: GeoServerAdvanced;
34
+ /**
35
+ *
36
+ */
37
+ geoserverVendor?: WfsGeoserverVendor;
38
+ /**
39
+ * Url headers for GeoServer requests. You can use it to add Authorization credentials
40
+ * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers
41
+ */
42
+ headers?: HeadersInit;
43
+ /**
44
+ * Credentials for fetch requests
45
+ * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
46
+ */
47
+ credentials?: RequestCredentials;
48
+ }
49
+ //# sourceMappingURL=WfsSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WfsSource.d.ts","sourceRoot":"","sources":["../../../src/modules/base/WfsSource.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AAGpC,OAAO,YAAY,EAAE,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,YAAY;IACxC,SAAS,kBAKb;gBAES,OAAO,EAAE,gBAAgB;CAoFxC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,OAAO,CAAC;IACxD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;CACpC"}
@@ -0,0 +1,47 @@
1
+ import TileWMS, { Options as TSOptions } from 'ol/source/TileWMS.js';
2
+ import { WmsGeoserverVendor } from '../../@types';
3
+ import { GeoServerAdvanced } from '../../Geoserver';
4
+ /**
5
+ * Layer source to retrieve WMS information from geoservers
6
+ * https://docs.geoserver.org/stable/en/user/services/wms/reference.html
7
+ *
8
+ * @extends {ol/source/TieWMS~TileWMS}
9
+ * @param options
10
+ */
11
+ export default class WmsSource extends TileWMS {
12
+ constructor(options: WmsSourceOptions);
13
+ }
14
+ /**
15
+ * **_[interface]_** - Parameters to create a WmsSource
16
+ *
17
+ * @public
18
+ */
19
+ export interface WmsSourceOptions extends Omit<TSOptions, 'params'> {
20
+ /**
21
+ * Layer name in the GeoServer
22
+ */
23
+ name: string;
24
+ /**
25
+ * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests
26
+ */
27
+ geoserverUrl: string;
28
+ /**
29
+ * Advanced options for geoserver requests
30
+ */
31
+ geoServerAdvanced?: GeoServerAdvanced;
32
+ /**
33
+ *
34
+ */
35
+ geoserverVendor?: WmsGeoserverVendor;
36
+ /**
37
+ * Url headers for GeoServer requests. You can use it to add Authorization credentials
38
+ * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers
39
+ */
40
+ headers?: HeadersInit;
41
+ /**
42
+ * Credentials for fetch requests
43
+ * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
44
+ */
45
+ credentials?: RequestCredentials;
46
+ }
47
+ //# sourceMappingURL=WmsSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WmsSource.d.ts","sourceRoot":"","sources":["../../../src/modules/base/WmsSource.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;gBAC9B,OAAO,EAAE,gBAAgB;CAmDxC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC/D;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;CACpC"}
@@ -0,0 +1,4 @@
1
+ import VectorLayer from 'ol/layer/Vector.js';
2
+ import VectorSource from 'ol/source/Vector.js';
3
+ export declare const getEditLayer: () => VectorLayer<VectorSource>;
4
+ //# sourceMappingURL=editLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editLayer.d.ts","sourceRoot":"","sources":["../../src/modules/editLayer.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAO/C,eAAO,MAAM,YAAY,QAAO,YAAY,YAAY,CAEvD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Options } from '../ol-wfst';
2
+ import { IGeoserverDescribeFeatureType } from '../@types';
3
+ export declare const initModal: (opts: Options['modal']) => void;
4
+ export declare const parseError: (geoserverResponse: IGeoserverDescribeFeatureType) => string;
5
+ /**
6
+ * Show modal with errors
7
+ *
8
+ * @param msg
9
+ * @private
10
+ */
11
+ export declare const showError: (msg: string, originalError?: Error, layerName?: string) => void;
12
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/modules/errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAsB,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAM9E,eAAO,MAAM,SAAS,SAAU,OAAO,CAAC,OAAO,CAAC,SAE/C,CAAC;AAEF,eAAO,MAAM,UAAU,sBACA,6BAA6B,WASnD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,QACb,MAAM,kBACI,KAAK,yBAErB,IAoBF,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @param target
3
+ * @param sources
4
+ * @returns
5
+ */
6
+ export declare const deepObjectAssign: (target: any, ...sources: any[]) => any;
7
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/modules/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,yCAgB5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { I18n } from '../../ol-wfst';
2
+ export declare const en: I18n;
3
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/modules/i18n/en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,eAAO,MAAM,EAAE,EAAE,IAsChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { I18n } from '../../ol-wfst';
2
+ export declare const es: I18n;
3
+ //# sourceMappingURL=es.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../src/modules/i18n/es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,eAAO,MAAM,EAAE,EAAE,IAuChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { I18n } from '../../@types';
2
+ export * from './es';
3
+ export * from './en';
4
+ export * from './zh';
5
+ export declare let I18N: I18n;
6
+ export declare const setLang: (lang?: string, customI18n?: I18n) => void;
7
+ /**
8
+ * /**
9
+ * For translations thas has a variable "{}"" to be replaced inside
10
+ * @param string
11
+ * @param args
12
+ * @returns
13
+ */
14
+ export declare const I18N_: (string: string, ...args: any) => string;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AAarB,eAAO,IAAI,IAAI,EAAE,IAAS,CAAC;AAE3B,eAAO,MAAM,OAAO,+BAA6B,IAAI,KAAU,IAU9D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,WAAY,MAAM,WAAW,GAAG,KAAG,MAepD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { I18n } from '../../ol-wfst';
2
+ export declare const zh: I18n;
3
+ //# sourceMappingURL=zh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../src/modules/i18n/zh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,eAAO,MAAM,EAAE,EAAE,IAsChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const initLoading: () => HTMLDivElement;
2
+ export declare const showLoading: (bool?: boolean) => void;
3
+ //# sourceMappingURL=loading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/modules/loading.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,QAAO,cAK9B,CAAC;AAEF,eAAO,MAAM,WAAW,UAAU,OAAO,SAMxC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import Map from 'ol/Map.js';
2
+ import { FeatureLike } from 'ol/Feature.js';
3
+ import WfsLayer from '../WfsLayer';
4
+ import WmsLayer from '../WmsLayer';
5
+ import { IWfstLayersList } from '../@types';
6
+ export declare enum Modes {
7
+ Edit = "EDIT",
8
+ Draw = "DRAW"
9
+ }
10
+ export declare function activateMode(m?: Modes): void;
11
+ export declare function getMode(): any;
12
+ export declare function setMap(m: Map): void;
13
+ export declare function getMap(): Map;
14
+ export declare function setActiveLayerToInsertEls(layer: WmsLayer | WfsLayer): void;
15
+ export declare function getActiveLayerToInsertEls(): WmsLayer | WfsLayer;
16
+ export declare function setMapLayers(data: any): void;
17
+ export declare function getStoredMapLayers(): IWfstLayersList;
18
+ export declare function getStoredLayer(layerName: string): WfsLayer | WmsLayer;
19
+ export declare function addFeatureToEditedList(feature: FeatureLike): void;
20
+ export declare function removeFeatureFromEditList(feature: FeatureLike): void;
21
+ export declare function isFeatureEdited(feature: FeatureLike): boolean;
22
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/modules/state.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,oBAAY,KAAK;IACb,IAAI,SAAS;IACb,IAAI,SAAS;CAChB;AAED,wBAAgB,YAAY,CAAC,CAAC,GAAE,KAAY,QAE3C;AAED,wBAAgB,OAAO,QAEtB;AAKD,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,QAE5B;AAED,wBAAgB,MAAM,IAAI,GAAG,CAE5B;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,QAEnE;AAED,wBAAgB,yBAAyB,IAAI,QAAQ,GAAG,QAAQ,CAE/D;AAED,wBAAgB,YAAY,CAAC,IAAI,KAAA,QAEhC;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAErE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAEjE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAEpE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAE7D"}
@@ -0,0 +1,13 @@
1
+ import { Geometry } from 'ol/geom.js';
2
+ import { Style } from 'ol/style.js';
3
+ import Feature from 'ol/Feature.js';
4
+ /**
5
+ * Master style that handles two modes on the Edit Layer:
6
+ * - one is the basic, showing only the vertices
7
+ * - and the other when modify is active, showing bigger vertices
8
+ *
9
+ * @param feature
10
+ * @private
11
+ */
12
+ export default function styleFunction(feature: Feature<Geometry>): Array<Style>;
13
+ //# sourceMappingURL=styleFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleFunction.d.ts","sourceRoot":"","sources":["../../src/modules/styleFunction.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EAOX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAuC,KAAK,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,OAAwB,MAAM,eAAe,CAAC;AAMrD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACjC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAC3B,KAAK,CAAC,KAAK,CAAC,CAuId"}
@@ -0,0 +1,2 @@
1
+ export default function createElement(tagName: any, attrs?: {}, ...children: any[]): any;
2
+ //# sourceMappingURL=myPragma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"myPragma.d.ts","sourceRoot":"","sources":["../src/myPragma.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAO,KAAA,EAAE,KAAK,KAAK,EAAE,GAAG,QAAQ,OAAA,OAmCrE"}
@@ -0,0 +1,335 @@
1
+ import Geometry from 'ol/geom/Geometry.js';
2
+ import Control from 'ol/control/Control.js';
3
+ import Draw from 'ol/interaction/Draw.js';
4
+ import Modify from 'ol/interaction/Modify.js';
5
+ import Select from 'ol/interaction/Select.js';
6
+ import Snap from 'ol/interaction/Snap.js';
7
+ import { EventsKey } from 'ol/events.js';
8
+ import Collection from 'ol/Collection.js';
9
+ import Feature from 'ol/Feature.js';
10
+ import Overlay from 'ol/Overlay.js';
11
+ import View from 'ol/View.js';
12
+ import Map from 'ol/Map.js';
13
+ import BaseEvent from 'ol/events/Event.js';
14
+ import { LoadingStrategy } from 'ol/source/Vector.js';
15
+ import { Options as VectorLayerOptions } from 'ol/layer/BaseVector.js';
16
+ import { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable.js';
17
+ import { ObjectEvent } from 'ol/Object.js';
18
+ import { Types as ObjectEventTypes } from 'ol/ObjectEventType.js';
19
+ import WfsLayer from './WfsLayer';
20
+ import WmsLayer from './WmsLayer';
21
+ import LayersControl from './modules/LayersControl';
22
+ import Uploads from './modules/Uploads';
23
+ import { TransactionType } from './@enums';
24
+ import { I18n, IGeoserverDescribeFeatureType, WfsGeoserverVendor, WmsGeoserverVendor } from './@types';
25
+ import EditControlChangesEl from './modules/EditControlChanges';
26
+ import { EditFieldsModal } from './modules/EditFieldsModal';
27
+ import Geoserver from './Geoserver';
28
+ import './assets/scss/-ol-wfst.bootstrap5.scss';
29
+ import './assets/scss/ol-wfst.scss';
30
+ /**
31
+ * Tiny WFS-T client to insert (drawing/uploading), modify and delete
32
+ * features on GeoServers using OpenLayers. Layers with these types
33
+ * of geometries are supported: "GeometryCollection" (in this case, you can
34
+ * choose the geometry type of each element to draw), "Point", "MultiPoint",
35
+ * "LineString", "MultiLineString", "Polygon" and "MultiPolygon".
36
+ *
37
+ * @constructor
38
+ * @fires modifystart
39
+ * @fires modifyend
40
+ * @fires drawstart
41
+ * @fires drawend
42
+ * @fires load
43
+ * @fires describeFeatureType
44
+ * @extends {ol/control/Control~Control}
45
+ * @param options Wfst options, see [Wfst Options](#options) for more details.
46
+ */
47
+ export default class Wfst extends Control {
48
+ protected _options: Options;
49
+ protected _i18n: I18n;
50
+ protected _map: Map;
51
+ protected _view: View;
52
+ protected _viewport: HTMLElement;
53
+ protected _initialized: boolean;
54
+ protected _layersControl: LayersControl;
55
+ protected _overlay: Overlay;
56
+ protected _interactionWfsSelect: Select;
57
+ protected _interactionSelectModify: Select;
58
+ protected _collectionModify: Collection<any>;
59
+ protected _interactionModify: Modify;
60
+ protected _interactionSnap: Snap;
61
+ protected _interactionDraw: Draw;
62
+ protected _keyClickWms: EventsKey | EventsKey[];
63
+ protected _keyRemove: EventsKey;
64
+ protected _keySelect: EventsKey;
65
+ protected _controlApplyDiscardChanges: EditControlChangesEl;
66
+ protected _controlWidgetToolsDiv: HTMLElement;
67
+ protected _selectDraw: HTMLSelectElement;
68
+ protected _currentZoom: number;
69
+ protected _lastZoom: number;
70
+ protected _editFeature: Feature<Geometry>;
71
+ protected _editFeatureOriginal: Feature<Geometry>;
72
+ protected _uploads: Uploads;
73
+ protected _editFields: EditFieldsModal;
74
+ on: OnSignature<EventTypes, BaseEvent, EventsKey> & OnSignature<WfstEventTypes, WfstEvent, EventsKey> & OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> & CombinedOnSignature<WfstEventTypes | ObjectEventTypes | EventTypes, EventsKey>;
75
+ once: OnSignature<EventTypes, BaseEvent, EventsKey> & OnSignature<WfstEventTypes, WfstEvent, EventsKey> & OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> & CombinedOnSignature<WfstEventTypes | ObjectEventTypes | EventTypes, EventsKey>;
76
+ un: OnSignature<EventTypes, BaseEvent, void> & OnSignature<WfstEventTypes, WfstEvent, EventsKey> & OnSignature<ObjectEventTypes, ObjectEvent, void> & CombinedOnSignature<WfstEventTypes | ObjectEventTypes | EventTypes, void>;
77
+ constructor(options?: Options);
78
+ /**
79
+ * Get all the layers in the ol-wfst instance
80
+ * @public
81
+ */
82
+ getLayers(): Array<WfsLayer | WmsLayer>;
83
+ /**
84
+ * Get a layer
85
+ * @public
86
+ */
87
+ getLayerByName(layerName?: string): WfsLayer | WmsLayer;
88
+ /**
89
+ * Connect to the GeoServer and retrieve metadata about the service (GetCapabilities).
90
+ * Get each layer specs (DescribeFeatureType) and create the layers and map controls.
91
+ * @fires describeFeatureType
92
+ * @private
93
+ */
94
+ private _initMapAndLayers;
95
+ /**
96
+ * @private
97
+ */
98
+ private _init;
99
+ /**
100
+ * Create the edit layer to allow modify elements, add interactions,
101
+ * map controls and keyboard handlers.
102
+ *
103
+ * @param showControl
104
+ * @param active
105
+ * @private
106
+ */
107
+ private _createMapElements;
108
+ /**
109
+ * @private
110
+ */
111
+ private _addInteractions;
112
+ /**
113
+ * Layer to store temporary the elements to be edited
114
+ * @private
115
+ */
116
+ private _prepareEditLayer;
117
+ /**
118
+ * @private
119
+ */
120
+ private _addMapEvents;
121
+ /**
122
+ * Add map handlers
123
+ * @private
124
+ */
125
+ private _addInteractionHandlers;
126
+ /**
127
+ * Add the widget on the map to allow change the tools and select active layers
128
+ * @private
129
+ */
130
+ private _addMapControl;
131
+ /**
132
+ *
133
+ * @param feature
134
+ * @private
135
+ */
136
+ private _deselectEditFeature;
137
+ /**
138
+ *
139
+ * @param feature
140
+ * @param layerName
141
+ * @private
142
+ */
143
+ private _restoreFeatureToLayer;
144
+ /**
145
+ * @param feature
146
+ * @private
147
+ */
148
+ private _removeFeatureFromTmpLayer;
149
+ /**
150
+ * Trigger on deselecting a feature from in the Edit layer
151
+ *
152
+ * @private
153
+ */
154
+ private _onDeselectFeatureEvent;
155
+ /**
156
+ * Trigger on removing a feature from the Edit layer
157
+ *
158
+ * @private
159
+ */
160
+ private _onRemoveFeatureEvent;
161
+ /**
162
+ *
163
+ * @param feature
164
+ * @private
165
+ */
166
+ private _editModeOn;
167
+ /**
168
+ * @private
169
+ */
170
+ private _editModeOff;
171
+ /**
172
+ * Remove a feature from the edit Layer and from the Geoserver
173
+ *
174
+ * @param feature
175
+ * @private
176
+ */
177
+ private _deleteFeature;
178
+ /**
179
+ * Add a feature to the Edit Layer to allow editing, and creates an Overlay Helper to show options
180
+ *
181
+ * @param feature
182
+ * @param coordinate
183
+ * @param layerName
184
+ * @private
185
+ */
186
+ private _addFeatureToEditMode;
187
+ /**
188
+ * Activate/deactivate the draw mode
189
+ *
190
+ * @param layer
191
+ * @public
192
+ */
193
+ activateDrawMode(layer: WfsLayer | WmsLayer | false): void;
194
+ /**
195
+ * Activate/desactivate the edit mode
196
+ *
197
+ * @param bool
198
+ * @public
199
+ */
200
+ activateEditMode(bool?: boolean): void;
201
+ /**
202
+ * Remove the overlay helper atttached to a specify feature
203
+ * @param feature
204
+ * @private
205
+ */
206
+ private _removeOverlayHelper;
207
+ }
208
+ /**
209
+ * **_[interface]_** - Wfst Options specified when creating a Wfst instance
210
+ *
211
+ * Default values:
212
+ * ```javascript
213
+ * {
214
+ * layers: null,
215
+ * evtType: 'singleclick',
216
+ * active: true,
217
+ * showControl: true,
218
+ * language: 'en',
219
+ * i18n: {...}, // according to language selection
220
+ * uploadFormats: '.geojson,.json,.kml',
221
+ * processUpload: null,
222
+ * }
223
+ * ```
224
+ */
225
+ interface Options {
226
+ /**
227
+ * Layers to be loaded from the geoserver
228
+ */
229
+ layers?: Array<WfsLayer | WmsLayer>;
230
+ /**
231
+ * Init active
232
+ */
233
+ active?: boolean;
234
+ /**
235
+ * The click event to allow selection of Features to be edited
236
+ */
237
+ evtType?: 'singleclick' | 'dblclick';
238
+ /**
239
+ * Show/hide the control map
240
+ */
241
+ showControl?: boolean;
242
+ /**
243
+ * Modal configuration
244
+ */
245
+ modal?: {
246
+ animateClass?: string;
247
+ animateInClass?: string;
248
+ transition?: number;
249
+ backdropTransition?: number;
250
+ templates?: {
251
+ dialog?: string | HTMLElement;
252
+ headerClose?: string | HTMLElement;
253
+ };
254
+ };
255
+ /**
256
+ * Language to be used
257
+ */
258
+ language?: 'es' | 'en' | 'zh';
259
+ /**
260
+ * Custom translations
261
+ */
262
+ i18n?: I18n;
263
+ /**
264
+ * Show/hide the upload button
265
+ */
266
+ showUpload?: boolean;
267
+ /**
268
+ * Accepted extension formats on upload
269
+ * Example: ".json,.geojson"
270
+ */
271
+ uploadFormats?: string;
272
+ /**
273
+ * Triggered to allow implement custom functions or to parse other formats than default
274
+ * by filtering the extension. If this doesn't return features, the default function
275
+ * will be used to extract them.
276
+ */
277
+ processUpload?(file: File): Array<Feature<Geometry>>;
278
+ }
279
+ /**
280
+ * **_[interface]_** - Parameters to create the layers and connect to the GeoServer
281
+ *
282
+ * You can use all the parameters supported by OpenLayers
283
+ *
284
+ * Default values:
285
+ * ```javascript
286
+ * {
287
+ * name: null,
288
+ * geoserver: null,
289
+ * label: null, // `name` if not provided
290
+ * strategy: all,
291
+ * geoserverVendor: null
292
+ * }
293
+ * ```
294
+ */
295
+ interface LayerOptions extends Omit<VectorLayerOptions<any>, 'source'> {
296
+ /**
297
+ * Layer name in the GeoServer
298
+ */
299
+ name: string;
300
+ /**
301
+ * Geoserver Object
302
+ */
303
+ geoserver: Geoserver;
304
+ /**
305
+ * Label to be displayed in the widget control
306
+ */
307
+ label?: string;
308
+ /**
309
+ * Available geoserver options
310
+ */
311
+ geoserverVendor?: WfsGeoserverVendor | WmsGeoserverVendor;
312
+ /**
313
+ * Strategy function for loading features.
314
+ * Only for WFS
315
+ * By default `all` strategy is used
316
+ */
317
+ strategy?: LoadingStrategy;
318
+ /**
319
+ * Triggered before inserting new features to the Geoserver.
320
+ * Use this to insert custom properties, modify the feature, etc.
321
+ */
322
+ beforeTransactFeature?(feature: Feature<Geometry>, transaction: TransactionType): Feature<Geometry>;
323
+ }
324
+ declare class WfstEvent extends BaseEvent {
325
+ data: IGeoserverDescribeFeatureType;
326
+ layer: WfsLayer | WmsLayer;
327
+ constructor(options: {
328
+ type: WfstEventTypes;
329
+ layer: WfsLayer | WmsLayer;
330
+ data: IGeoserverDescribeFeatureType;
331
+ });
332
+ }
333
+ type WfstEventTypes = 'describeFeatureType';
334
+ export { Options, WfstEventTypes, WfstEvent, I18n, LayerOptions, Geoserver, WmsLayer, WfsLayer };
335
+ //# sourceMappingURL=ol-wfst.d.ts.map