ol-wfst 4.0.3 → 4.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ol-wfst.min.js","sources":["../node_modules/ol/AssertionError.js","../node_modules/ol/events/Event.js","../node_modules/ol/ObjectEventType.js","../node_modules/ol/Disposable.js","../node_modules/ol/functions.js","../node_modules/ol/obj.js","../node_modules/ol/events/Target.js","../node_modules/ol/events/EventType.js","../node_modules/ol/events.js","../node_modules/ol/Observable.js","../node_modules/ol/util.js","../node_modules/ol/Object.js","../node_modules/ol/CollectionEventType.js","../node_modules/ol/Collection.js","../node_modules/ol/Feature.js","../node_modules/ol/asserts.js","../node_modules/ol/dom.js","../node_modules/ol/TileState.js","../node_modules/ol/MapEventType.js","../node_modules/ol/Overlay.js","../node_modules/ol/extent.js","../node_modules/modal-vanilla/dist/modal.js","../src/modules/errors.ts","../src/modules/i18n/en.ts","../src/modules/i18n/index.ts","../src/modules/i18n/es.ts","../src/modules/i18n/zh.ts","../src/modules/loading.ts","../node_modules/ts-mixer/dist/esm/index.js","../src/@enums.ts","../src/modules/state.ts","../src/modules/base/BaseLayer.ts","../src/modules/base/WfsSource.ts","../src/WfsLayer.ts","../src/modules/base/WmsSource.ts","../src/WmsLayer.ts","../src/myPragma.ts","../src/modules/LayersControl.tsx","../src/assets/images/visibilityOn.svg","../src/assets/images/visibilityOff.svg","../src/assets/images/upload.svg","../src/assets/images/draw.svg","../src/modules/editLayer.ts","../src/modules/Uploads.ts","../src/modules/helpers.ts","../src/modules/EditControlChanges.tsx","../src/modules/styleFunction.ts","../src/modules/EditFieldsModal.ts","../src/Geoserver.ts","../src/modules/EditOverlay.tsx","../src/assets/images/editFields.svg","../src/assets/images/editGeom.svg","../src/ol-wfst.ts","../src/defaults.ts","../src/index-umd.js"],"sourcesContent":["/**\n * @module ol/AssertionError\n */\n\n/** @type {Object<number, string>} */\nconst messages = {\n 1: 'The view center is not defined',\n 2: 'The view resolution is not defined',\n 3: 'The view rotation is not defined',\n 4: '`image` and `src` cannot be provided at the same time',\n 5: '`imgSize` must be set when `image` is provided',\n 7: '`format` must be set when `url` is set',\n 8: 'Unknown `serverType` configured',\n 9: '`url` must be configured or set using `#setUrl()`',\n 10: 'The default `geometryFunction` can only handle `Point` geometries',\n 11: '`options.featureTypes` must be an Array',\n 12: '`options.geometryName` must also be provided when `options.bbox` is set',\n 13: 'Invalid corner',\n 14: 'Invalid color',\n 15: 'Tried to get a value for a key that does not exist in the cache',\n 16: 'Tried to set a value for a key that is used already',\n 17: '`resolutions` must be sorted in descending order',\n 18: 'Either `origin` or `origins` must be configured, never both',\n 19: 'Number of `tileSizes` and `resolutions` must be equal',\n 20: 'Number of `origins` and `resolutions` must be equal',\n 22: 'Either `tileSize` or `tileSizes` must be configured, never both',\n 24: 'Invalid extent or geometry provided as `geometry`',\n 25: 'Cannot fit empty extent provided as `geometry`',\n 26: 'Features must have an id set',\n 27: 'Features must have an id set',\n 28: '`renderMode` must be `\"hybrid\"` or `\"vector\"`',\n 30: 'The passed `feature` was already added to the source',\n 31: 'Tried to enqueue an `element` that was already added to the queue',\n 32: 'Transformation matrix cannot be inverted',\n 33: 'Invalid units',\n 34: 'Invalid geometry layout',\n 36: 'Unknown SRS type',\n 37: 'Unknown geometry type found',\n 38: '`styleMapValue` has an unknown type',\n 39: 'Unknown geometry type',\n 40: 'Expected `feature` to have a geometry',\n 41: 'Expected an `ol/style/Style` or an array of `ol/style/Style.js`',\n 42: 'Question unknown, the answer is 42',\n 43: 'Expected `layers` to be an array or a `Collection`',\n 47: 'Expected `controls` to be an array or an `ol/Collection`',\n 48: 'Expected `interactions` to be an array or an `ol/Collection`',\n 49: 'Expected `overlays` to be an array or an `ol/Collection`',\n 50: '`options.featureTypes` should be an Array',\n 51: 'Either `url` or `tileJSON` options must be provided',\n 52: 'Unknown `serverType` configured',\n 53: 'Unknown `tierSizeCalculation` configured',\n 55: 'The {-y} placeholder requires a tile grid with extent',\n 56: 'mapBrowserEvent must originate from a pointer event',\n 57: 'At least 2 conditions are required',\n 59: 'Invalid command found in the PBF',\n 60: 'Missing or invalid `size`',\n 61: 'Cannot determine IIIF Image API version from provided image information JSON',\n 62: 'A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`',\n 64: 'Layer opacity must be a number',\n 66: '`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`',\n 67: 'A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both',\n 68: 'A VectorTile source can only be rendered if it has a projection compatible with the view projection',\n};\n\n/**\n * Error object thrown when an assertion failed. This is an ECMA-262 Error,\n * extended with a `code` property.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error.\n */\nclass AssertionError extends Error {\n /**\n * @param {number} code Error code.\n */\n constructor(code) {\n const message = messages[code];\n\n super(message);\n\n /**\n * Error code. The meaning of the code can be found on\n * https://openlayers.org/en/latest/doc/errors/ (replace `latest` with\n * the version found in the OpenLayers script's header comment if a version\n * other than the latest is used).\n * @type {number}\n * @deprecated ol/AssertionError and error codes will be removed in v8.0\n * @api\n */\n this.code = code;\n\n /**\n * @type {string}\n */\n this.name = 'AssertionError';\n\n // Re-assign message, see https://github.com/Rich-Harris/buble/issues/40\n this.message = message;\n }\n}\n\nexport default AssertionError;\n","/**\n * @module ol/events/Event\n */\n\n/**\n * @classdesc\n * Stripped down implementation of the W3C DOM Level 2 Event interface.\n * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.\n *\n * This implementation only provides `type` and `target` properties, and\n * `stopPropagation` and `preventDefault` methods. It is meant as base class\n * for higher level events defined in the library, and works with\n * {@link module:ol/events/Target~Target}.\n */\nclass BaseEvent {\n /**\n * @param {string} type Type.\n */\n constructor(type) {\n /**\n * @type {boolean}\n */\n this.propagationStopped;\n\n /**\n * @type {boolean}\n */\n this.defaultPrevented;\n\n /**\n * The event type.\n * @type {string}\n * @api\n */\n this.type = type;\n\n /**\n * The event target.\n * @type {Object}\n * @api\n */\n this.target = null;\n }\n\n /**\n * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events\n * will be fired.\n * @api\n */\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n /**\n * Stop event propagation.\n * @api\n */\n stopPropagation() {\n this.propagationStopped = true;\n }\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function stopPropagation(evt) {\n evt.stopPropagation();\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function preventDefault(evt) {\n evt.preventDefault();\n}\n\nexport default BaseEvent;\n","/**\n * @module ol/ObjectEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a property is changed.\n * @event module:ol/Object.ObjectEvent#propertychange\n * @api\n */\n PROPERTYCHANGE: 'propertychange',\n};\n\n/**\n * @typedef {'propertychange'} Types\n */\n","/**\n * @module ol/Disposable\n */\n\n/**\n * @classdesc\n * Objects that need to clean up after themselves.\n */\nclass Disposable {\n constructor() {\n /**\n * The object has already been disposed.\n * @type {boolean}\n * @protected\n */\n this.disposed = false;\n }\n\n /**\n * Clean up.\n */\n dispose() {\n if (!this.disposed) {\n this.disposed = true;\n this.disposeInternal();\n }\n }\n\n /**\n * Extension point for disposable objects.\n * @protected\n */\n disposeInternal() {}\n}\n\nexport default Disposable;\n","/**\n * @module ol/functions\n */\n\nimport {equals as arrayEquals} from './array.js';\n\n/**\n * Always returns true.\n * @return {boolean} true.\n */\nexport function TRUE() {\n return true;\n}\n\n/**\n * Always returns false.\n * @return {boolean} false.\n */\nexport function FALSE() {\n return false;\n}\n\n/**\n * A reusable function, used e.g. as a default for callbacks.\n *\n * @return {void} Nothing.\n */\nexport function VOID() {}\n\n/**\n * Wrap a function in another function that remembers the last return. If the\n * returned function is called twice in a row with the same arguments and the same\n * this object, it will return the value from the first call in the second call.\n *\n * @param {function(...any): ReturnType} fn The function to memoize.\n * @return {function(...any): ReturnType} The memoized function.\n * @template ReturnType\n */\nexport function memoizeOne(fn) {\n let called = false;\n\n /** @type {ReturnType} */\n let lastResult;\n\n /** @type {Array<any>} */\n let lastArgs;\n\n let lastThis;\n\n return function () {\n const nextArgs = Array.prototype.slice.call(arguments);\n if (!called || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {\n called = true;\n lastThis = this;\n lastArgs = nextArgs;\n lastResult = fn.apply(this, arguments);\n }\n return lastResult;\n };\n}\n\n/**\n * @template T\n * @param {function(): (T | Promise<T>)} getter A function that returns a value or a promise for a value.\n * @return {Promise<T>} A promise for the value.\n */\nexport function toPromise(getter) {\n function promiseGetter() {\n let value;\n try {\n value = getter();\n } catch (err) {\n return Promise.reject(err);\n }\n if (value instanceof Promise) {\n return value;\n }\n return Promise.resolve(value);\n }\n return promiseGetter();\n}\n","/**\n * @module ol/obj\n */\n\n/**\n * Removes all properties from an object.\n * @param {Object} object The object to clear.\n */\nexport function clear(object) {\n for (const property in object) {\n delete object[property];\n }\n}\n\n/**\n * Determine if an object has any properties.\n * @param {Object} object The object to check.\n * @return {boolean} The object is empty.\n */\nexport function isEmpty(object) {\n let property;\n for (property in object) {\n return false;\n }\n return !property;\n}\n","/**\n * @module ol/events/Target\n */\nimport Disposable from '../Disposable.js';\nimport Event from './Event.js';\nimport {VOID} from '../functions.js';\nimport {clear} from '../obj.js';\n\n/**\n * @typedef {EventTarget|Target} EventTargetLike\n */\n\n/**\n * @classdesc\n * A simplified implementation of the W3C DOM Level 2 EventTarget interface.\n * See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.\n *\n * There are two important simplifications compared to the specification:\n *\n * 1. The handling of `useCapture` in `addEventListener` and\n * `removeEventListener`. There is no real capture model.\n * 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.\n * There is no event target hierarchy. When a listener calls\n * `stopPropagation` or `preventDefault` on an event object, it means that no\n * more listeners after this one will be called. Same as when the listener\n * returns false.\n */\nclass Target extends Disposable {\n /**\n * @param {*} [target] Default event target for dispatched events.\n */\n constructor(target) {\n super();\n\n /**\n * @private\n * @type {*}\n */\n this.eventTarget_ = target;\n\n /**\n * @private\n * @type {Object<string, number>}\n */\n this.pendingRemovals_ = null;\n\n /**\n * @private\n * @type {Object<string, number>}\n */\n this.dispatching_ = null;\n\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").Listener>>}\n */\n this.listeners_ = null;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n addEventListener(type, listener) {\n if (!type || !listener) {\n return;\n }\n const listeners = this.listeners_ || (this.listeners_ = {});\n const listenersForType = listeners[type] || (listeners[type] = []);\n if (!listenersForType.includes(listener)) {\n listenersForType.push(listener);\n }\n }\n\n /**\n * Dispatches an event and calls all listeners listening for events\n * of this type. The event parameter can either be a string or an\n * Object with a `type` property.\n *\n * @param {import(\"./Event.js\").default|string} event Event object.\n * @return {boolean|undefined} `false` if anyone called preventDefault on the\n * event object or if any of the listeners returned false.\n * @api\n */\n dispatchEvent(event) {\n const isString = typeof event === 'string';\n const type = isString ? event : event.type;\n const listeners = this.listeners_ && this.listeners_[type];\n if (!listeners) {\n return;\n }\n\n const evt = isString ? new Event(event) : /** @type {Event} */ (event);\n if (!evt.target) {\n evt.target = this.eventTarget_ || this;\n }\n const dispatching = this.dispatching_ || (this.dispatching_ = {});\n const pendingRemovals =\n this.pendingRemovals_ || (this.pendingRemovals_ = {});\n if (!(type in dispatching)) {\n dispatching[type] = 0;\n pendingRemovals[type] = 0;\n }\n ++dispatching[type];\n let propagate;\n for (let i = 0, ii = listeners.length; i < ii; ++i) {\n if ('handleEvent' in listeners[i]) {\n propagate = /** @type {import(\"../events.js\").ListenerObject} */ (\n listeners[i]\n ).handleEvent(evt);\n } else {\n propagate = /** @type {import(\"../events.js\").ListenerFunction} */ (\n listeners[i]\n ).call(this, evt);\n }\n if (propagate === false || evt.propagationStopped) {\n propagate = false;\n break;\n }\n }\n if (--dispatching[type] === 0) {\n let pr = pendingRemovals[type];\n delete pendingRemovals[type];\n while (pr--) {\n this.removeEventListener(type, VOID);\n }\n delete dispatching[type];\n }\n return propagate;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n this.listeners_ && clear(this.listeners_);\n }\n\n /**\n * Get the listeners for a specified event type. Listeners are returned in the\n * order that they will be called in.\n *\n * @param {string} type Type.\n * @return {Array<import(\"../events.js\").Listener>|undefined} Listeners.\n */\n getListeners(type) {\n return (this.listeners_ && this.listeners_[type]) || undefined;\n }\n\n /**\n * @param {string} [type] Type. If not provided,\n * `true` will be returned if this event target has any listeners.\n * @return {boolean} Has listeners.\n */\n hasListener(type) {\n if (!this.listeners_) {\n return false;\n }\n return type\n ? type in this.listeners_\n : Object.keys(this.listeners_).length > 0;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n removeEventListener(type, listener) {\n const listeners = this.listeners_ && this.listeners_[type];\n if (listeners) {\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n if (this.pendingRemovals_ && type in this.pendingRemovals_) {\n // make listener a no-op, and remove later in #dispatchEvent()\n listeners[index] = VOID;\n ++this.pendingRemovals_[type];\n } else {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n delete this.listeners_[type];\n }\n }\n }\n }\n }\n}\n\nexport default Target;\n","/**\n * @module ol/events/EventType\n */\n\n/**\n * @enum {string}\n * @const\n */\nexport default {\n /**\n * Generic change event. Triggered when the revision counter is increased.\n * @event module:ol/events/Event~BaseEvent#change\n * @api\n */\n CHANGE: 'change',\n\n /**\n * Generic error event. Triggered when an error occurs.\n * @event module:ol/events/Event~BaseEvent#error\n * @api\n */\n ERROR: 'error',\n\n BLUR: 'blur',\n CLEAR: 'clear',\n CONTEXTMENU: 'contextmenu',\n CLICK: 'click',\n DBLCLICK: 'dblclick',\n DRAGENTER: 'dragenter',\n DRAGOVER: 'dragover',\n DROP: 'drop',\n FOCUS: 'focus',\n KEYDOWN: 'keydown',\n KEYPRESS: 'keypress',\n LOAD: 'load',\n RESIZE: 'resize',\n TOUCHMOVE: 'touchmove',\n WHEEL: 'wheel',\n};\n","/**\n * @module ol/events\n */\nimport {clear} from './obj.js';\n\n/**\n * Key to use with {@link module:ol/Observable.unByKey}.\n * @typedef {Object} EventsKey\n * @property {ListenerFunction} listener Listener.\n * @property {import(\"./events/Target.js\").EventTargetLike} target Target.\n * @property {string} type Type.\n * @api\n */\n\n/**\n * Listener function. This function is called with an event object as argument.\n * When the function returns `false`, event propagation will stop.\n *\n * @typedef {function((Event|import(\"./events/Event.js\").default)): (void|boolean)} ListenerFunction\n * @api\n */\n\n/**\n * @typedef {Object} ListenerObject\n * @property {ListenerFunction} handleEvent HandleEvent listener function.\n */\n\n/**\n * @typedef {ListenerFunction|ListenerObject} Listener\n */\n\n/**\n * Registers an event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` to a `this` object, and returns\n * a key for use with {@link module:ol/events.unlistenByKey}.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @param {boolean} [once] If true, add the listener as one-off listener.\n * @return {EventsKey} Unique key for the listener.\n */\nexport function listen(target, type, listener, thisArg, once) {\n if (thisArg && thisArg !== target) {\n listener = listener.bind(thisArg);\n }\n if (once) {\n const originalListener = listener;\n listener = function () {\n target.removeEventListener(type, listener);\n originalListener.apply(this, arguments);\n };\n }\n const eventsKey = {\n target: target,\n type: type,\n listener: listener,\n };\n target.addEventListener(type, listener);\n return eventsKey;\n}\n\n/**\n * Registers a one-off event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` as self-unregistering listener\n * to a `this` object, and returns a key for use with\n * {@link module:ol/events.unlistenByKey} in case the listener needs to be\n * unregistered before it is called.\n *\n * When {@link module:ol/events.listen} is called with the same arguments after this\n * function, the self-unregistering listener will be turned into a permanent\n * listener.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @return {EventsKey} Key for unlistenByKey.\n */\nexport function listenOnce(target, type, listener, thisArg) {\n return listen(target, type, listener, thisArg, true);\n}\n\n/**\n * Unregisters event listeners on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * The argument passed to this function is the key returned from\n * {@link module:ol/events.listen} or {@link module:ol/events.listenOnce}.\n *\n * @param {EventsKey} key The key.\n */\nexport function unlistenByKey(key) {\n if (key && key.target) {\n key.target.removeEventListener(key.type, key.listener);\n clear(key);\n }\n}\n","/**\n * @module ol/Observable\n */\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport {listen, listenOnce, unlistenByKey} from './events.js';\n\n/***\n * @template {string} Type\n * @template {Event|import(\"./events/Event.js\").default} EventClass\n * @template Return\n * @typedef {(type: Type, listener: (event: EventClass) => ?) => Return} OnSignature\n */\n\n/***\n * @template {string} Type\n * @template Return\n * @typedef {(type: Type[], listener: (event: Event|import(\"./events/Event\").default) => ?) => Return extends void ? void : Return[]} CombinedOnSignature\n */\n\n/**\n * @typedef {'change'|'error'} EventTypes\n */\n\n/***\n * @template Return\n * @typedef {OnSignature<EventTypes, import(\"./events/Event.js\").default, Return> & CombinedOnSignature<EventTypes, Return>} ObservableOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * An event target providing convenient methods for listener registration\n * and unregistration. A generic `change` event is always available through\n * {@link module:ol/Observable~Observable#changed}.\n *\n * @fires import(\"./events/Event.js\").default\n * @api\n */\nclass Observable extends EventTarget {\n constructor() {\n super();\n\n this.on =\n /** @type {ObservableOnSignature<import(\"./events\").EventsKey>} */ (\n this.onInternal\n );\n\n this.once =\n /** @type {ObservableOnSignature<import(\"./events\").EventsKey>} */ (\n this.onceInternal\n );\n\n this.un = /** @type {ObservableOnSignature<void>} */ (this.unInternal);\n\n /**\n * @private\n * @type {number}\n */\n this.revision_ = 0;\n }\n\n /**\n * Increases the revision counter and dispatches a 'change' event.\n * @api\n */\n changed() {\n ++this.revision_;\n this.dispatchEvent(EventType.CHANGE);\n }\n\n /**\n * Get the version number for this object. Each time the object is modified,\n * its version number will be incremented.\n * @return {number} Revision.\n * @api\n */\n getRevision() {\n return this.revision_;\n }\n\n /**\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Event key.\n * @protected\n */\n onInternal(type, listener) {\n if (Array.isArray(type)) {\n const len = type.length;\n const keys = new Array(len);\n for (let i = 0; i < len; ++i) {\n keys[i] = listen(this, type[i], listener);\n }\n return keys;\n } else {\n return listen(this, /** @type {string} */ (type), listener);\n }\n }\n\n /**\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Event key.\n * @protected\n */\n onceInternal(type, listener) {\n let key;\n if (Array.isArray(type)) {\n const len = type.length;\n key = new Array(len);\n for (let i = 0; i < len; ++i) {\n key[i] = listenOnce(this, type[i], listener);\n }\n } else {\n key = listenOnce(this, /** @type {string} */ (type), listener);\n }\n /** @type {Object} */ (listener).ol_key = key;\n return key;\n }\n\n /**\n * Unlisten for a certain type of event.\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @protected\n */\n unInternal(type, listener) {\n const key = /** @type {Object} */ (listener).ol_key;\n if (key) {\n unByKey(key);\n } else if (Array.isArray(type)) {\n for (let i = 0, ii = type.length; i < ii; ++i) {\n this.removeEventListener(type[i], listener);\n }\n } else {\n this.removeEventListener(type, listener);\n }\n }\n}\n\n/**\n * Listen for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.on;\n\n/**\n * Listen once for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.once;\n\n/**\n * Unlisten for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @api\n */\nObservable.prototype.un;\n\n/**\n * Removes an event listener using the key returned by `on()` or `once()`.\n * @param {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} key The key returned by `on()`\n * or `once()` (or an array of keys).\n * @api\n */\nexport function unByKey(key) {\n if (Array.isArray(key)) {\n for (let i = 0, ii = key.length; i < ii; ++i) {\n unlistenByKey(key[i]);\n }\n } else {\n unlistenByKey(/** @type {import(\"./events.js\").EventsKey} */ (key));\n }\n}\n\nexport default Observable;\n","/**\n * @module ol/util\n */\n\n/**\n * @return {never} Any return.\n */\nexport function abstract() {\n throw new Error('Unimplemented abstract method.');\n}\n\n/**\n * Counter for getUid.\n * @type {number}\n * @private\n */\nlet uidCounter_ = 0;\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. Unique IDs are generated\n * as a strictly increasing sequence. Adapted from goog.getUid.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {string} The unique ID for the object.\n * @api\n */\nexport function getUid(obj) {\n return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));\n}\n\n/**\n * OpenLayers version.\n * @type {string}\n */\nexport const VERSION = '7.1.0';\n","/**\n * @module ol/Object\n */\nimport Event from './events/Event.js';\nimport ObjectEventType from './ObjectEventType.js';\nimport Observable from './Observable.js';\nimport {getUid} from './util.js';\nimport {isEmpty} from './obj.js';\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.\n */\nexport class ObjectEvent extends Event {\n /**\n * @param {string} type The event type.\n * @param {string} key The property name.\n * @param {*} oldValue The old value for `key`.\n */\n constructor(type, key, oldValue) {\n super(type);\n\n /**\n * The name of the property whose value is changing.\n * @type {string}\n * @api\n */\n this.key = key;\n\n /**\n * The old value. To get the new value use `e.target.get(e.key)` where\n * `e` is the event object.\n * @type {*}\n * @api\n */\n this.oldValue = oldValue;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types, ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types, Return>} ObjectOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Most non-trivial classes inherit from this.\n *\n * This extends {@link module:ol/Observable~Observable} with observable\n * properties, where each property is observable as well as the object as a\n * whole.\n *\n * Classes that inherit from this have pre-defined properties, to which you can\n * add your owns. The pre-defined properties are listed in this documentation as\n * 'Observable Properties', and have their own accessors; for example,\n * {@link module:ol/Map~Map} has a `target` property, accessed with\n * `getTarget()` and changed with `setTarget()`. Not all properties are however\n * settable. There are also general-purpose accessors `get()` and `set()`. For\n * example, `get('target')` is equivalent to `getTarget()`.\n *\n * The `set` accessors trigger a change event, and you can monitor this by\n * registering a listener. For example, {@link module:ol/View~View} has a\n * `center` property, so `view.on('change:center', function(evt) {...});` would\n * call the function whenever the value of the center property changes. Within\n * the function, `evt.target` would be the view, so `evt.target.getCenter()`\n * would return the new center.\n *\n * You can add your own observable properties with\n * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.\n * You can listen for changes on that property value with\n * `object.on('change:prop', listener)`. You can get a list of all\n * properties with {@link module:ol/Object~BaseObject#getProperties}.\n *\n * Note that the observable properties are separate from standard JS properties.\n * You can, for example, give your map object a title with\n * `map.title='New title'` and with `map.set('title', 'Another title')`. The\n * first will be a `hasOwnProperty`; the second will appear in\n * `getProperties()`. Only the second is observable.\n *\n * Properties can be deleted by using the unset method. E.g.\n * object.unset('foo').\n *\n * @fires ObjectEvent\n * @api\n */\nclass BaseObject extends Observable {\n /**\n * @param {Object<string, *>} [values] An object with key-value pairs.\n */\n constructor(values) {\n super();\n\n /***\n * @type {ObjectOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {ObjectOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {ObjectOnSignature<void>}\n */\n this.un;\n\n // Call {@link module:ol/util.getUid} to ensure that the order of objects' ids is\n // the same as the order in which they were created. This also helps to\n // ensure that object properties are always added in the same order, which\n // helps many JavaScript engines generate faster code.\n getUid(this);\n\n /**\n * @private\n * @type {Object<string, *>}\n */\n this.values_ = null;\n\n if (values !== undefined) {\n this.setProperties(values);\n }\n }\n\n /**\n * Gets a value.\n * @param {string} key Key name.\n * @return {*} Value.\n * @api\n */\n get(key) {\n let value;\n if (this.values_ && this.values_.hasOwnProperty(key)) {\n value = this.values_[key];\n }\n return value;\n }\n\n /**\n * Get a list of object property names.\n * @return {Array<string>} List of property names.\n * @api\n */\n getKeys() {\n return (this.values_ && Object.keys(this.values_)) || [];\n }\n\n /**\n * Get an object of all property names and values.\n * @return {Object<string, *>} Object.\n * @api\n */\n getProperties() {\n return (this.values_ && Object.assign({}, this.values_)) || {};\n }\n\n /**\n * @return {boolean} The object has properties.\n */\n hasProperties() {\n return !!this.values_;\n }\n\n /**\n * @param {string} key Key name.\n * @param {*} oldValue Old value.\n */\n notify(key, oldValue) {\n let eventType;\n eventType = `change:${key}`;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n eventType = ObjectEventType.PROPERTYCHANGE;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n addChangeListener(key, listener) {\n this.addEventListener(`change:${key}`, listener);\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n removeChangeListener(key, listener) {\n this.removeEventListener(`change:${key}`, listener);\n }\n\n /**\n * Sets a value.\n * @param {string} key Key name.\n * @param {*} value Value.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n set(key, value, silent) {\n const values = this.values_ || (this.values_ = {});\n if (silent) {\n values[key] = value;\n } else {\n const oldValue = values[key];\n values[key] = value;\n if (oldValue !== value) {\n this.notify(key, oldValue);\n }\n }\n }\n\n /**\n * Sets a collection of key-value pairs. Note that this changes any existing\n * properties and adds new ones (it does not remove any existing properties).\n * @param {Object<string, *>} values Values.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n setProperties(values, silent) {\n for (const key in values) {\n this.set(key, values[key], silent);\n }\n }\n\n /**\n * Apply any properties from another object without triggering events.\n * @param {BaseObject} source The source object.\n * @protected\n */\n applyProperties(source) {\n if (!source.values_) {\n return;\n }\n Object.assign(this.values_ || (this.values_ = {}), source.values_);\n }\n\n /**\n * Unsets a property.\n * @param {string} key Key name.\n * @param {boolean} [silent] Unset without triggering an event.\n * @api\n */\n unset(key, silent) {\n if (this.values_ && key in this.values_) {\n const oldValue = this.values_[key];\n delete this.values_[key];\n if (isEmpty(this.values_)) {\n this.values_ = null;\n }\n if (!silent) {\n this.notify(key, oldValue);\n }\n }\n }\n}\n\nexport default BaseObject;\n","/**\n * @module ol/CollectionEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when an item is added to the collection.\n * @event module:ol/Collection.CollectionEvent#add\n * @api\n */\n ADD: 'add',\n /**\n * Triggered when an item is removed from the collection.\n * @event module:ol/Collection.CollectionEvent#remove\n * @api\n */\n REMOVE: 'remove',\n};\n","/**\n * @module ol/Collection\n */\nimport AssertionError from './AssertionError.js';\nimport BaseObject from './Object.js';\nimport CollectionEventType from './CollectionEventType.js';\nimport Event from './events/Event.js';\n\n/**\n * @enum {string}\n * @private\n */\nconst Property = {\n LENGTH: 'length',\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Collection~Collection} instances are instances of this\n * type.\n * @template T\n */\nexport class CollectionEvent extends Event {\n /**\n * @param {import(\"./CollectionEventType.js\").default} type Type.\n * @param {T} element Element.\n * @param {number} index The index of the added or removed element.\n */\n constructor(type, element, index) {\n super(type);\n\n /**\n * The element that is added to or removed from the collection.\n * @type {T}\n * @api\n */\n this.element = element;\n\n /**\n * The index of the added or removed element.\n * @type {number}\n * @api\n */\n this.index = index;\n }\n}\n\n/***\n * @template T\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types|'change:length', import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").OnSignature<'add'|'remove', CollectionEvent<T>, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types|\n * 'change:length'|'add'|'remove',Return>} CollectionOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {boolean} [unique=false] Disallow the same item from being added to\n * the collection twice.\n */\n\n/**\n * @classdesc\n * An expanded version of standard JS Array, adding convenience methods for\n * manipulation. Add and remove changes to the Collection trigger a Collection\n * event. Note that this does not cover changes to the objects _within_ the\n * Collection; they trigger events on the appropriate object, not on the\n * Collection as a whole.\n *\n * @fires CollectionEvent\n *\n * @template T\n * @api\n */\nclass Collection extends BaseObject {\n /**\n * @param {Array<T>} [array] Array.\n * @param {Options} [options] Collection options.\n */\n constructor(array, options) {\n super();\n\n /***\n * @type {CollectionOnSignature<T, import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {CollectionOnSignature<T, import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {CollectionOnSignature<T, void>}\n */\n this.un;\n\n options = options || {};\n\n /**\n * @private\n * @type {boolean}\n */\n this.unique_ = !!options.unique;\n\n /**\n * @private\n * @type {!Array<T>}\n */\n this.array_ = array ? array : [];\n\n if (this.unique_) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n this.assertUnique_(this.array_[i], i);\n }\n }\n\n this.updateLength_();\n }\n\n /**\n * Remove all elements from the collection.\n * @api\n */\n clear() {\n while (this.getLength() > 0) {\n this.pop();\n }\n }\n\n /**\n * Add elements to the collection. This pushes each item in the provided array\n * to the end of the collection.\n * @param {!Array<T>} arr Array.\n * @return {Collection<T>} This collection.\n * @api\n */\n extend(arr) {\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n this.push(arr[i]);\n }\n return this;\n }\n\n /**\n * Iterate over each element, calling the provided callback.\n * @param {function(T, number, Array<T>): *} f The function to call\n * for every element. This function takes 3 arguments (the element, the\n * index and the array). The return value is ignored.\n * @api\n */\n forEach(f) {\n const array = this.array_;\n for (let i = 0, ii = array.length; i < ii; ++i) {\n f(array[i], i, array);\n }\n }\n\n /**\n * Get a reference to the underlying Array object. Warning: if the array\n * is mutated, no events will be dispatched by the collection, and the\n * collection's \"length\" property won't be in sync with the actual length\n * of the array.\n * @return {!Array<T>} Array.\n * @api\n */\n getArray() {\n return this.array_;\n }\n\n /**\n * Get the element at the provided index.\n * @param {number} index Index.\n * @return {T} Element.\n * @api\n */\n item(index) {\n return this.array_[index];\n }\n\n /**\n * Get the length of this collection.\n * @return {number} The length of the array.\n * @observable\n * @api\n */\n getLength() {\n return this.get(Property.LENGTH);\n }\n\n /**\n * Insert an element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n insertAt(index, elem) {\n if (index < 0 || index > this.getLength()) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n this.array_.splice(index, 0, elem);\n this.updateLength_();\n this.dispatchEvent(\n new CollectionEvent(CollectionEventType.ADD, elem, index)\n );\n }\n\n /**\n * Remove the last element of the collection and return it.\n * Return `undefined` if the collection is empty.\n * @return {T|undefined} Element.\n * @api\n */\n pop() {\n return this.removeAt(this.getLength() - 1);\n }\n\n /**\n * Insert the provided element at the end of the collection.\n * @param {T} elem Element.\n * @return {number} New length of the collection.\n * @api\n */\n push(elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n const n = this.getLength();\n this.insertAt(n, elem);\n return this.getLength();\n }\n\n /**\n * Remove the first occurrence of an element from the collection.\n * @param {T} elem Element.\n * @return {T|undefined} The removed element or undefined if none found.\n * @api\n */\n remove(elem) {\n const arr = this.array_;\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n if (arr[i] === elem) {\n return this.removeAt(i);\n }\n }\n return undefined;\n }\n\n /**\n * Remove the element at the provided index and return it.\n * Return `undefined` if the collection does not contain this index.\n * @param {number} index Index.\n * @return {T|undefined} Value.\n * @api\n */\n removeAt(index) {\n if (index < 0 || index >= this.getLength()) {\n return undefined;\n }\n const prev = this.array_[index];\n this.array_.splice(index, 1);\n this.updateLength_();\n this.dispatchEvent(\n /** @type {CollectionEvent<T>} */ (\n new CollectionEvent(CollectionEventType.REMOVE, prev, index)\n )\n );\n return prev;\n }\n\n /**\n * Set the element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n setAt(index, elem) {\n const n = this.getLength();\n if (index >= n) {\n this.insertAt(index, elem);\n return;\n }\n if (index < 0) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem, index);\n }\n const prev = this.array_[index];\n this.array_[index] = elem;\n this.dispatchEvent(\n /** @type {CollectionEvent<T>} */ (\n new CollectionEvent(CollectionEventType.REMOVE, prev, index)\n )\n );\n this.dispatchEvent(\n /** @type {CollectionEvent<T>} */ (\n new CollectionEvent(CollectionEventType.ADD, elem, index)\n )\n );\n }\n\n /**\n * @private\n */\n updateLength_() {\n this.set(Property.LENGTH, this.array_.length);\n }\n\n /**\n * @private\n * @param {T} elem Element.\n * @param {number} [except] Optional index to ignore.\n */\n assertUnique_(elem, except) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n if (this.array_[i] === elem && i !== except) {\n throw new AssertionError(58);\n }\n }\n }\n}\n\nexport default Collection;\n","/**\n * @module ol/Feature\n */\nimport BaseObject from './Object.js';\nimport EventType from './events/EventType.js';\nimport {assert} from './asserts.js';\nimport {listen, unlistenByKey} from './events.js';\n\n/**\n * @typedef {typeof Feature|typeof import(\"./render/Feature.js\").default} FeatureClass\n */\n\n/**\n * @typedef {Feature|import(\"./render/Feature.js\").default} FeatureLike\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types|'change:geometry', import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types\n * |'change:geometry', Return>} FeatureOnSignature\n */\n\n/***\n * @template Geometry\n * @typedef {Object<string, *> & { geometry?: Geometry }} ObjectWithGeometry\n */\n\n/**\n * @classdesc\n * A vector object for geographic features with a geometry and other\n * attribute properties, similar to the features in vector file formats like\n * GeoJSON.\n *\n * Features can be styled individually with `setStyle`; otherwise they use the\n * style of their vector layer.\n *\n * Note that attribute properties are set as {@link module:ol/Object~BaseObject} properties on\n * the feature object, so they are observable, and have get/set accessors.\n *\n * Typically, a feature has a single geometry property. You can set the\n * geometry using the `setGeometry` method and get it with `getGeometry`.\n * It is possible to store more than one geometry on a feature using attribute\n * properties. By default, the geometry used for rendering is identified by\n * the property name `geometry`. If you want to use another geometry property\n * for rendering, use the `setGeometryName` method to change the attribute\n * property associated with the geometry for the feature. For example:\n *\n * ```js\n *\n * import Feature from 'ol/Feature';\n * import Polygon from 'ol/geom/Polygon';\n * import Point from 'ol/geom/Point';\n *\n * const feature = new Feature({\n * geometry: new Polygon(polyCoords),\n * labelPoint: new Point(labelCoords),\n * name: 'My Polygon',\n * });\n *\n * // get the polygon geometry\n * const poly = feature.getGeometry();\n *\n * // Render the feature as a point using the coordinates from labelPoint\n * feature.setGeometryName('labelPoint');\n *\n * // get the point geometry\n * const point = feature.getGeometry();\n * ```\n *\n * @api\n * @template {import(\"./geom/Geometry.js\").default} [Geometry=import(\"./geom/Geometry.js\").default]\n */\nclass Feature extends BaseObject {\n /**\n * @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]\n * You may pass a Geometry object directly, or an object literal containing\n * properties. If you pass an object literal, you may include a Geometry\n * associated with a `geometry` key.\n */\n constructor(geometryOrProperties) {\n super();\n\n /***\n * @type {FeatureOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {FeatureOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {FeatureOnSignature<void>}\n */\n this.un;\n\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = undefined;\n\n /**\n * @type {string}\n * @private\n */\n this.geometryName_ = 'geometry';\n\n /**\n * User provided style.\n * @private\n * @type {import(\"./style/Style.js\").StyleLike}\n */\n this.style_ = null;\n\n /**\n * @private\n * @type {import(\"./style/Style.js\").StyleFunction|undefined}\n */\n this.styleFunction_ = undefined;\n\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.geometryChangeKey_ = null;\n\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n\n if (geometryOrProperties) {\n if (\n typeof (\n /** @type {?} */ (geometryOrProperties).getSimplifiedGeometry\n ) === 'function'\n ) {\n const geometry = /** @type {Geometry} */ (geometryOrProperties);\n this.setGeometry(geometry);\n } else {\n /** @type {Object<string, *>} */\n const properties = geometryOrProperties;\n this.setProperties(properties);\n }\n }\n }\n\n /**\n * Clone this feature. If the original feature has a geometry it\n * is also cloned. The feature id is not set in the clone.\n * @return {Feature<Geometry>} The clone.\n * @api\n */\n clone() {\n const clone = /** @type {Feature<Geometry>} */ (\n new Feature(this.hasProperties() ? this.getProperties() : null)\n );\n clone.setGeometryName(this.getGeometryName());\n const geometry = this.getGeometry();\n if (geometry) {\n clone.setGeometry(/** @type {Geometry} */ (geometry.clone()));\n }\n const style = this.getStyle();\n if (style) {\n clone.setStyle(style);\n }\n return clone;\n }\n\n /**\n * Get the feature's default geometry. A feature may have any number of named\n * geometries. The \"default\" geometry (the one that is rendered by default) is\n * set when calling {@link module:ol/Feature~Feature#setGeometry}.\n * @return {Geometry|undefined} The default geometry for the feature.\n * @api\n * @observable\n */\n getGeometry() {\n return /** @type {Geometry|undefined} */ (this.get(this.geometryName_));\n }\n\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is either set when reading data from a remote source or set explicitly by\n * calling {@link module:ol/Feature~Feature#setId}.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id_;\n }\n\n /**\n * Get the name of the feature's default geometry. By default, the default\n * geometry is named `geometry`.\n * @return {string} Get the property name associated with the default geometry\n * for this feature.\n * @api\n */\n getGeometryName() {\n return this.geometryName_;\n }\n\n /**\n * Get the feature's style. Will return what was provided to the\n * {@link module:ol/Feature~Feature#setStyle} method.\n * @return {import(\"./style/Style.js\").StyleLike|undefined} The feature style.\n * @api\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * Get the feature's style function.\n * @return {import(\"./style/Style.js\").StyleFunction|undefined} Return a function\n * representing the current style of this feature.\n * @api\n */\n getStyleFunction() {\n return this.styleFunction_;\n }\n\n /**\n * @private\n */\n handleGeometryChange_() {\n this.changed();\n }\n\n /**\n * @private\n */\n handleGeometryChanged_() {\n if (this.geometryChangeKey_) {\n unlistenByKey(this.geometryChangeKey_);\n this.geometryChangeKey_ = null;\n }\n const geometry = this.getGeometry();\n if (geometry) {\n this.geometryChangeKey_ = listen(\n geometry,\n EventType.CHANGE,\n this.handleGeometryChange_,\n this\n );\n }\n this.changed();\n }\n\n /**\n * Set the default geometry for the feature. This will update the property\n * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.\n * @param {Geometry|undefined} geometry The new geometry.\n * @api\n * @observable\n */\n setGeometry(geometry) {\n this.set(this.geometryName_, geometry);\n }\n\n /**\n * Set the style for the feature to override the layer style. This can be a\n * single style object, an array of styles, or a function that takes a\n * resolution and returns an array of styles. To unset the feature style, call\n * `setStyle()` without arguments or a falsey value.\n * @param {import(\"./style/Style.js\").StyleLike} [style] Style for this feature.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setStyle(style) {\n this.style_ = style;\n this.styleFunction_ = !style ? undefined : createStyleFunction(style);\n this.changed();\n }\n\n /**\n * Set the feature id. The feature id is considered stable and may be used when\n * requesting features or comparing identifiers returned from a remote source.\n * The feature id can be used with the\n * {@link module:ol/source/Vector~VectorSource#getFeatureById} method.\n * @param {number|string|undefined} id The feature id.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setId(id) {\n this.id_ = id;\n this.changed();\n }\n\n /**\n * Set the property name to be used when getting the feature's default geometry.\n * When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with\n * this name will be returned.\n * @param {string} name The property name of the default geometry.\n * @api\n */\n setGeometryName(name) {\n this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.geometryName_ = name;\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.handleGeometryChanged_();\n }\n}\n\n/**\n * Convert the provided object into a feature style function. Functions passed\n * through unchanged. Arrays of Style or single style objects wrapped\n * in a new feature style function.\n * @param {!import(\"./style/Style.js\").StyleFunction|!Array<import(\"./style/Style.js\").default>|!import(\"./style/Style.js\").default} obj\n * A feature style function, a single style, or an array of styles.\n * @return {import(\"./style/Style.js\").StyleFunction} A style function.\n */\nexport function createStyleFunction(obj) {\n if (typeof obj === 'function') {\n return obj;\n } else {\n /**\n * @type {Array<import(\"./style/Style.js\").default>}\n */\n let styles;\n if (Array.isArray(obj)) {\n styles = obj;\n } else {\n assert(typeof (/** @type {?} */ (obj).getZIndex) === 'function', 41); // Expected an `import(\"./style/Style.js\").Style` or an array of `import(\"./style/Style.js\").Style`\n const style = /** @type {import(\"./style/Style.js\").default} */ (obj);\n styles = [style];\n }\n return function () {\n return styles;\n };\n }\n}\nexport default Feature;\n","/**\n * @module ol/asserts\n */\nimport AssertionError from './AssertionError.js';\n\n/**\n * @param {*} assertion Assertion we expected to be truthy.\n * @param {number} errorCode Error code.\n */\nexport function assert(assertion, errorCode) {\n if (!assertion) {\n throw new AssertionError(errorCode);\n }\n}\n","import {WORKER_OFFSCREEN_CANVAS} from './has.js';\n\n/**\n * @module ol/dom\n */\n\n//FIXME Move this function to the canvas module\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number} [width] Canvas width.\n * @param {number} [height] Canvas height.\n * @param {Array<HTMLCanvasElement>} [canvasPool] Canvas pool to take existing canvas from.\n * @param {CanvasRenderingContext2DSettings} [settings] CanvasRenderingContext2DSettings\n * @return {CanvasRenderingContext2D} The context.\n */\nexport function createCanvasContext2D(width, height, canvasPool, settings) {\n /** @type {HTMLCanvasElement|OffscreenCanvas} */\n let canvas;\n if (canvasPool && canvasPool.length) {\n canvas = canvasPool.shift();\n } else if (WORKER_OFFSCREEN_CANVAS) {\n canvas = new OffscreenCanvas(width || 300, height || 300);\n } else {\n canvas = document.createElement('canvas');\n }\n if (width) {\n canvas.width = width;\n }\n if (height) {\n canvas.height = height;\n }\n //FIXME Allow OffscreenCanvasRenderingContext2D as return type\n return /** @type {CanvasRenderingContext2D} */ (\n canvas.getContext('2d', settings)\n );\n}\n\n/**\n * Releases canvas memory to avoid exceeding memory limits in Safari.\n * See https://pqina.nl/blog/total-canvas-memory-use-exceeds-the-maximum-limit/\n * @param {CanvasRenderingContext2D} context Context.\n */\nexport function releaseCanvas(context) {\n const canvas = context.canvas;\n canvas.width = 1;\n canvas.height = 1;\n context.clearRect(0, 0, 1, 1);\n}\n\n/**\n * Get the current computed width for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerWidth(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The width.\n */\nexport function outerWidth(element) {\n let width = element.offsetWidth;\n const style = getComputedStyle(element);\n width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);\n\n return width;\n}\n\n/**\n * Get the current computed height for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerHeight(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The height.\n */\nexport function outerHeight(element) {\n let height = element.offsetHeight;\n const style = getComputedStyle(element);\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n\n return height;\n}\n\n/**\n * @param {Node} newNode Node to replace old node\n * @param {Node} oldNode The node to be replaced\n */\nexport function replaceNode(newNode, oldNode) {\n const parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n}\n\n/**\n * @param {Node} node The node to remove.\n * @return {Node|null} The node that was removed or null.\n */\nexport function removeNode(node) {\n return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n}\n\n/**\n * @param {Node} node The node to remove the children from.\n */\nexport function removeChildren(node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n\n/**\n * Transform the children of a parent node so they match the\n * provided list of children. This function aims to efficiently\n * remove, add, and reorder child nodes while maintaining a simple\n * implementation (it is not guaranteed to minimize DOM operations).\n * @param {Node} node The parent node whose children need reworking.\n * @param {Array<Node>} children The desired children.\n */\nexport function replaceChildren(node, children) {\n const oldChildren = node.childNodes;\n\n for (let i = 0; true; ++i) {\n const oldChild = oldChildren[i];\n const newChild = children[i];\n\n // check if our work is done\n if (!oldChild && !newChild) {\n break;\n }\n\n // check if children match\n if (oldChild === newChild) {\n continue;\n }\n\n // check if a new child needs to be added\n if (!oldChild) {\n node.appendChild(newChild);\n continue;\n }\n\n // check if an old child needs to be removed\n if (!newChild) {\n node.removeChild(oldChild);\n --i;\n continue;\n }\n\n // reorder\n node.insertBefore(newChild, oldChild);\n }\n}\n","/**\n * @module ol/TileState\n */\n\n/**\n * @enum {number}\n */\nexport default {\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n /**\n * Indicates that tile loading failed\n * @type {number}\n */\n ERROR: 3,\n EMPTY: 4,\n};\n","/**\n * @module ol/MapEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered after a map frame is rendered.\n * @event module:ol/MapEvent~MapEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n\n /**\n * Triggered when the map starts moving.\n * @event module:ol/MapEvent~MapEvent#movestart\n * @api\n */\n MOVESTART: 'movestart',\n\n /**\n * Triggered after the map is moved.\n * @event module:ol/MapEvent~MapEvent#moveend\n * @api\n */\n MOVEEND: 'moveend',\n\n /**\n * Triggered when loading of additional map data (tiles, images, features) starts.\n * @event module:ol/MapEvent~MapEvent#loadstart\n * @api\n */\n LOADSTART: 'loadstart',\n\n /**\n * Triggered when loading of additional map data has completed.\n * @event module:ol/MapEvent~MapEvent#loadend\n * @api\n */\n LOADEND: 'loadend',\n};\n\n/***\n * @typedef {'postrender'|'movestart'|'moveend'|'loadstart'|'loadend'} Types\n */\n","/**\n * @module ol/Overlay\n */\nimport BaseObject from './Object.js';\nimport MapEventType from './MapEventType.js';\nimport {CLASS_SELECTABLE} from './css.js';\nimport {containsExtent} from './extent.js';\nimport {listen, unlistenByKey} from './events.js';\nimport {outerHeight, outerWidth, removeChildren, removeNode} from './dom.js';\n\n/**\n * @typedef {'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-center' | 'center-right' | 'top-left' | 'top-center' | 'top-right'} Positioning\n * The overlay position: `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, or `'top-right'`.\n */\n\n/**\n * @typedef {Object} Options\n * @property {number|string} [id] Set the overlay id. The overlay id can be used\n * with the {@link module:ol/Map~Map#getOverlayById} method.\n * @property {HTMLElement} [element] The overlay element.\n * @property {Array<number>} [offset=[0, 0]] Offsets in pixels used when positioning\n * the overlay. The first element in the\n * array is the horizontal offset. A positive value shifts the overlay right.\n * The second element in the array is the vertical offset. A positive value\n * shifts the overlay down.\n * @property {import(\"./coordinate.js\").Coordinate} [position] The overlay position\n * in map projection.\n * @property {Positioning} [positioning='top-left'] Defines how\n * the overlay is actually positioned with respect to its `position` property.\n * Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, and `'top-right'`.\n * @property {boolean} [stopEvent=true] Whether event propagation to the map\n * viewport should be stopped. If `true` the overlay is placed in the same\n * container as that of the controls (CSS class name\n * `ol-overlaycontainer-stopevent`); if `false` it is placed in the container\n * with CSS class name specified by the `className` property.\n * @property {boolean} [insertFirst=true] Whether the overlay is inserted first\n * in the overlay container, or appended. If the overlay is placed in the same\n * container as that of the controls (see the `stopEvent` option) you will\n * probably set `insertFirst` to `true` so the overlay is displayed below the\n * controls.\n * @property {PanIntoViewOptions|boolean} [autoPan=false] Pan the map when calling\n * `setPosition`, so that the overlay is entirely visible in the current viewport.\n * @property {string} [className='ol-overlay-container ol-selectable'] CSS class\n * name.\n */\n\n/**\n * @typedef {Object} PanOptions\n * @property {number} [duration=1000] The duration of the animation in\n * milliseconds.\n * @property {function(number):number} [easing] The easing function to use. Can\n * be one from {@link module:ol/easing} or a custom function.\n * Default is {@link module:ol/easing.inAndOut}.\n */\n\n/**\n * @typedef {Object} PanIntoViewOptions\n * @property {PanOptions} [animation={}] The animation parameters for the pan\n * @property {number} [margin=20] The margin (in pixels) between the\n * overlay and the borders of the map when panning into view.\n */\n\n/**\n * @enum {string}\n * @protected\n */\nconst Property = {\n ELEMENT: 'element',\n MAP: 'map',\n OFFSET: 'offset',\n POSITION: 'position',\n POSITIONING: 'positioning',\n};\n\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:element'|'change:map'|'change:offset'|'change:position'|\n * 'change:positioning'} OverlayObjectEventTypes\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<OverlayObjectEventTypes, import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|OverlayObjectEventTypes, Return>} OverlayOnSignature\n */\n\n/**\n * @classdesc\n * An element to be displayed over the map and attached to a single map\n * location. Like {@link module:ol/control/Control~Control}, Overlays are\n * visible widgets. Unlike Controls, they are not in a fixed position on the\n * screen, but are tied to a geographical coordinate, so panning the map will\n * move an Overlay but not a Control.\n *\n * Example:\n *\n * import Overlay from 'ol/Overlay';\n *\n * // ...\n * const popup = new Overlay({\n * element: document.getElementById('popup'),\n * });\n * popup.setPosition(coordinate);\n * map.addOverlay(popup);\n *\n * @api\n */\nclass Overlay extends BaseObject {\n /**\n * @param {Options} options Overlay options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {OverlayOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {OverlayOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {OverlayOnSignature<void>}\n */\n this.un;\n\n /**\n * @protected\n * @type {Options}\n */\n this.options = options;\n\n /**\n * @protected\n * @type {number|string|undefined}\n */\n this.id = options.id;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.insertFirst =\n options.insertFirst !== undefined ? options.insertFirst : true;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.stopEvent = options.stopEvent !== undefined ? options.stopEvent : true;\n\n /**\n * @protected\n * @type {HTMLElement}\n */\n this.element = document.createElement('div');\n this.element.className =\n options.className !== undefined\n ? options.className\n : 'ol-overlay-container ' + CLASS_SELECTABLE;\n this.element.style.position = 'absolute';\n this.element.style.pointerEvents = 'auto';\n\n /**\n * @protected\n * @type {PanIntoViewOptions|undefined}\n */\n this.autoPan = options.autoPan === true ? {} : options.autoPan || undefined;\n\n /**\n * @protected\n * @type {{transform_: string,\n * visible: boolean}}\n */\n this.rendered = {\n transform_: '',\n visible: true,\n };\n\n /**\n * @protected\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.mapPostrenderListenerKey = null;\n\n this.addChangeListener(Property.ELEMENT, this.handleElementChanged);\n this.addChangeListener(Property.MAP, this.handleMapChanged);\n this.addChangeListener(Property.OFFSET, this.handleOffsetChanged);\n this.addChangeListener(Property.POSITION, this.handlePositionChanged);\n this.addChangeListener(Property.POSITIONING, this.handlePositioningChanged);\n\n if (options.element !== undefined) {\n this.setElement(options.element);\n }\n\n this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);\n\n this.setPositioning(options.positioning || 'top-left');\n\n if (options.position !== undefined) {\n this.setPosition(options.position);\n }\n }\n\n /**\n * Get the DOM element of this overlay.\n * @return {HTMLElement|undefined} The Element containing the overlay.\n * @observable\n * @api\n */\n getElement() {\n return /** @type {HTMLElement|undefined} */ (this.get(Property.ELEMENT));\n }\n\n /**\n * Get the overlay identifier which is set on constructor.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id;\n }\n\n /**\n * Get the map associated with this overlay.\n * @return {import(\"./Map.js\").default|null} The map that the\n * overlay is part of.\n * @observable\n * @api\n */\n getMap() {\n return /** @type {import(\"./Map.js\").default|null} */ (\n this.get(Property.MAP) || null\n );\n }\n\n /**\n * Get the offset of this overlay.\n * @return {Array<number>} The offset.\n * @observable\n * @api\n */\n getOffset() {\n return /** @type {Array<number>} */ (this.get(Property.OFFSET));\n }\n\n /**\n * Get the current position of this overlay.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The spatial point that the overlay is\n * anchored at.\n * @observable\n * @api\n */\n getPosition() {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (\n this.get(Property.POSITION)\n );\n }\n\n /**\n * Get the current positioning of this overlay.\n * @return {Positioning} How the overlay is positioned\n * relative to its point on the map.\n * @observable\n * @api\n */\n getPositioning() {\n return /** @type {Positioning} */ (this.get(Property.POSITIONING));\n }\n\n /**\n * @protected\n */\n handleElementChanged() {\n removeChildren(this.element);\n const element = this.getElement();\n if (element) {\n this.element.appendChild(element);\n }\n }\n\n /**\n * @protected\n */\n handleMapChanged() {\n if (this.mapPostrenderListenerKey) {\n removeNode(this.element);\n unlistenByKey(this.mapPostrenderListenerKey);\n this.mapPostrenderListenerKey = null;\n }\n const map = this.getMap();\n if (map) {\n this.mapPostrenderListenerKey = listen(\n map,\n MapEventType.POSTRENDER,\n this.render,\n this\n );\n this.updatePixelPosition();\n const container = this.stopEvent\n ? map.getOverlayContainerStopEvent()\n : map.getOverlayContainer();\n if (this.insertFirst) {\n container.insertBefore(this.element, container.childNodes[0] || null);\n } else {\n container.appendChild(this.element);\n }\n this.performAutoPan();\n }\n }\n\n /**\n * @protected\n */\n render() {\n this.updatePixelPosition();\n }\n\n /**\n * @protected\n */\n handleOffsetChanged() {\n this.updatePixelPosition();\n }\n\n /**\n * @protected\n */\n handlePositionChanged() {\n this.updatePixelPosition();\n this.performAutoPan();\n }\n\n /**\n * @protected\n */\n handlePositioningChanged() {\n this.updatePixelPosition();\n }\n\n /**\n * Set the DOM element to be associated with this overlay.\n * @param {HTMLElement|undefined} element The Element containing the overlay.\n * @observable\n * @api\n */\n setElement(element) {\n this.set(Property.ELEMENT, element);\n }\n\n /**\n * Set the map to be associated with this overlay.\n * @param {import(\"./Map.js\").default|null} map The map that the\n * overlay is part of. Pass `null` to just remove the overlay from the current map.\n * @observable\n * @api\n */\n setMap(map) {\n this.set(Property.MAP, map);\n }\n\n /**\n * Set the offset for this overlay.\n * @param {Array<number>} offset Offset.\n * @observable\n * @api\n */\n setOffset(offset) {\n this.set(Property.OFFSET, offset);\n }\n\n /**\n * Set the position for this overlay. If the position is `undefined` the\n * overlay is hidden.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} position The spatial point that the overlay\n * is anchored at.\n * @observable\n * @api\n */\n setPosition(position) {\n this.set(Property.POSITION, position);\n }\n\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary) using the configured autoPan parameters\n * @protected\n */\n performAutoPan() {\n if (this.autoPan) {\n this.panIntoView(this.autoPan);\n }\n }\n\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary).\n * @param {PanIntoViewOptions} [panIntoViewOptions] Options for the pan action\n * @api\n */\n panIntoView(panIntoViewOptions) {\n const map = this.getMap();\n\n if (!map || !map.getTargetElement() || !this.get(Property.POSITION)) {\n return;\n }\n\n const mapRect = this.getRect(map.getTargetElement(), map.getSize());\n const element = this.getElement();\n const overlayRect = this.getRect(element, [\n outerWidth(element),\n outerHeight(element),\n ]);\n\n panIntoViewOptions = panIntoViewOptions || {};\n\n const myMargin =\n panIntoViewOptions.margin === undefined ? 20 : panIntoViewOptions.margin;\n if (!containsExtent(mapRect, overlayRect)) {\n // the overlay is not completely inside the viewport, so pan the map\n const offsetLeft = overlayRect[0] - mapRect[0];\n const offsetRight = mapRect[2] - overlayRect[2];\n const offsetTop = overlayRect[1] - mapRect[1];\n const offsetBottom = mapRect[3] - overlayRect[3];\n\n const delta = [0, 0];\n if (offsetLeft < 0) {\n // move map to the left\n delta[0] = offsetLeft - myMargin;\n } else if (offsetRight < 0) {\n // move map to the right\n delta[0] = Math.abs(offsetRight) + myMargin;\n }\n if (offsetTop < 0) {\n // move map up\n delta[1] = offsetTop - myMargin;\n } else if (offsetBottom < 0) {\n // move map down\n delta[1] = Math.abs(offsetBottom) + myMargin;\n }\n\n if (delta[0] !== 0 || delta[1] !== 0) {\n const center = /** @type {import(\"./coordinate.js\").Coordinate} */ (\n map.getView().getCenterInternal()\n );\n const centerPx = map.getPixelFromCoordinateInternal(center);\n if (!centerPx) {\n return;\n }\n const newCenterPx = [centerPx[0] + delta[0], centerPx[1] + delta[1]];\n\n const panOptions = panIntoViewOptions.animation || {};\n map.getView().animateInternal({\n center: map.getCoordinateFromPixelInternal(newCenterPx),\n duration: panOptions.duration,\n easing: panOptions.easing,\n });\n }\n }\n }\n\n /**\n * Get the extent of an element relative to the document\n * @param {HTMLElement} element The element.\n * @param {import(\"./size.js\").Size} size The size of the element.\n * @return {import(\"./extent.js\").Extent} The extent.\n * @protected\n */\n getRect(element, size) {\n const box = element.getBoundingClientRect();\n const offsetX = box.left + window.pageXOffset;\n const offsetY = box.top + window.pageYOffset;\n return [offsetX, offsetY, offsetX + size[0], offsetY + size[1]];\n }\n\n /**\n * Set the positioning for this overlay.\n * @param {Positioning} positioning how the overlay is\n * positioned relative to its point on the map.\n * @observable\n * @api\n */\n setPositioning(positioning) {\n this.set(Property.POSITIONING, positioning);\n }\n\n /**\n * Modify the visibility of the element.\n * @param {boolean} visible Element visibility.\n * @protected\n */\n setVisible(visible) {\n if (this.rendered.visible !== visible) {\n this.element.style.display = visible ? '' : 'none';\n this.rendered.visible = visible;\n }\n }\n\n /**\n * Update pixel position.\n * @protected\n */\n updatePixelPosition() {\n const map = this.getMap();\n const position = this.getPosition();\n if (!map || !map.isRendered() || !position) {\n this.setVisible(false);\n return;\n }\n\n const pixel = map.getPixelFromCoordinate(position);\n const mapSize = map.getSize();\n this.updateRenderedPosition(pixel, mapSize);\n }\n\n /**\n * @param {import(\"./pixel.js\").Pixel} pixel The pixel location.\n * @param {import(\"./size.js\").Size|undefined} mapSize The map size.\n * @protected\n */\n updateRenderedPosition(pixel, mapSize) {\n const style = this.element.style;\n const offset = this.getOffset();\n\n const positioning = this.getPositioning();\n\n this.setVisible(true);\n\n const x = Math.round(pixel[0] + offset[0]) + 'px';\n const y = Math.round(pixel[1] + offset[1]) + 'px';\n let posX = '0%';\n let posY = '0%';\n if (\n positioning == 'bottom-right' ||\n positioning == 'center-right' ||\n positioning == 'top-right'\n ) {\n posX = '-100%';\n } else if (\n positioning == 'bottom-center' ||\n positioning == 'center-center' ||\n positioning == 'top-center'\n ) {\n posX = '-50%';\n }\n if (\n positioning == 'bottom-left' ||\n positioning == 'bottom-center' ||\n positioning == 'bottom-right'\n ) {\n posY = '-100%';\n } else if (\n positioning == 'center-left' ||\n positioning == 'center-center' ||\n positioning == 'center-right'\n ) {\n posY = '-50%';\n }\n const transform = `translate(${posX}, ${posY}) translate(${x}, ${y})`;\n if (this.rendered.transform_ != transform) {\n this.rendered.transform_ = transform;\n style.transform = transform;\n }\n }\n\n /**\n * returns the options this Overlay has been created with\n * @return {Options} overlay options\n */\n getOptions() {\n return this.options;\n }\n}\n\nexport default Overlay;\n","/**\n * @module ol/extent\n */\nimport Relationship from './extent/Relationship.js';\nimport {assert} from './asserts.js';\n\n/**\n * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.\n * @typedef {Array<number>} Extent\n * @api\n */\n\n/**\n * Extent corner.\n * @typedef {'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'} Corner\n */\n\n/**\n * Build an extent that includes all given coordinates.\n *\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @return {Extent} Bounding extent.\n * @api\n */\nexport function boundingExtent(coordinates) {\n const extent = createEmpty();\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Array<number>} xs Xs.\n * @param {Array<number>} ys Ys.\n * @param {Extent} [dest] Destination extent.\n * @private\n * @return {Extent} Extent.\n */\nfunction _boundingExtentXYs(xs, ys, dest) {\n const minX = Math.min.apply(null, xs);\n const minY = Math.min.apply(null, ys);\n const maxX = Math.max.apply(null, xs);\n const maxY = Math.max.apply(null, ys);\n return createOrUpdate(minX, minY, maxX, maxY, dest);\n}\n\n/**\n * Return extent increased by the provided value.\n * @param {Extent} extent Extent.\n * @param {number} value The amount by which the extent should be buffered.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n * @api\n */\nexport function buffer(extent, value, dest) {\n if (dest) {\n dest[0] = extent[0] - value;\n dest[1] = extent[1] - value;\n dest[2] = extent[2] + value;\n dest[3] = extent[3] + value;\n return dest;\n } else {\n return [\n extent[0] - value,\n extent[1] - value,\n extent[2] + value,\n extent[3] + value,\n ];\n }\n}\n\n/**\n * Creates a clone of an extent.\n *\n * @param {Extent} extent Extent to clone.\n * @param {Extent} [dest] Extent.\n * @return {Extent} The clone.\n */\nexport function clone(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n } else {\n return extent.slice();\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {number} Closest squared distance.\n */\nexport function closestSquaredDistanceXY(extent, x, y) {\n let dx, dy;\n if (x < extent[0]) {\n dx = extent[0] - x;\n } else if (extent[2] < x) {\n dx = x - extent[2];\n } else {\n dx = 0;\n }\n if (y < extent[1]) {\n dy = extent[1] - y;\n } else if (extent[3] < y) {\n dy = y - extent[3];\n } else {\n dy = 0;\n }\n return dx * dx + dy * dy;\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} The coordinate is contained in the extent.\n * @api\n */\nexport function containsCoordinate(extent, coordinate) {\n return containsXY(extent, coordinate[0], coordinate[1]);\n}\n\n/**\n * Check if one extent contains another.\n *\n * An extent is deemed contained if it lies completely within the other extent,\n * including if they share one or more edges.\n *\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The second extent is contained by or on the edge of the\n * first.\n * @api\n */\nexport function containsExtent(extent1, extent2) {\n return (\n extent1[0] <= extent2[0] &&\n extent2[2] <= extent1[2] &&\n extent1[1] <= extent2[1] &&\n extent2[3] <= extent1[3]\n );\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {number} x X coordinate.\n * @param {number} y Y coordinate.\n * @return {boolean} The x, y values are contained in the extent.\n * @api\n */\nexport function containsXY(extent, x, y) {\n return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];\n}\n\n/**\n * Get the relationship between a coordinate and extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate The coordinate.\n * @return {import(\"./extent/Relationship.js\").default} The relationship (bitwise compare with\n * import(\"./extent/Relationship.js\").Relationship).\n */\nexport function coordinateRelationship(extent, coordinate) {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const x = coordinate[0];\n const y = coordinate[1];\n let relationship = Relationship.UNKNOWN;\n if (x < minX) {\n relationship = relationship | Relationship.LEFT;\n } else if (x > maxX) {\n relationship = relationship | Relationship.RIGHT;\n }\n if (y < minY) {\n relationship = relationship | Relationship.BELOW;\n } else if (y > maxY) {\n relationship = relationship | Relationship.ABOVE;\n }\n if (relationship === Relationship.UNKNOWN) {\n relationship = Relationship.INTERSECTING;\n }\n return relationship;\n}\n\n/**\n * Create an empty extent.\n * @return {Extent} Empty extent.\n * @api\n */\nexport function createEmpty() {\n return [Infinity, Infinity, -Infinity, -Infinity];\n}\n\n/**\n * Create a new extent or update the provided extent.\n * @param {number} minX Minimum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxX Maximum X.\n * @param {number} maxY Maximum Y.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdate(minX, minY, maxX, maxY, dest) {\n if (dest) {\n dest[0] = minX;\n dest[1] = minY;\n dest[2] = maxX;\n dest[3] = maxY;\n return dest;\n } else {\n return [minX, minY, maxX, maxY];\n }\n}\n\n/**\n * Create a new empty extent or make the provided one empty.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateEmpty(dest) {\n return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, dest);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinate(coordinate, dest) {\n const x = coordinate[0];\n const y = coordinate[1];\n return createOrUpdate(x, y, x, y, dest);\n}\n\n/**\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinates(coordinates, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendCoordinates(extent, coordinates);\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromFlatCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n dest\n) {\n const extent = createOrUpdateEmpty(dest);\n return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);\n}\n\n/**\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromRings(rings, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendRings(extent, rings);\n}\n\n/**\n * Determine if two extents are equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The two extents are equivalent.\n * @api\n */\nexport function equals(extent1, extent2) {\n return (\n extent1[0] == extent2[0] &&\n extent1[2] == extent2[2] &&\n extent1[1] == extent2[1] &&\n extent1[3] == extent2[3]\n );\n}\n\n/**\n * Determine if two extents are approximately equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {number} tolerance Tolerance in extent coordinate units.\n * @return {boolean} The two extents differ by less than the tolerance.\n */\nexport function approximatelyEquals(extent1, extent2, tolerance) {\n return (\n Math.abs(extent1[0] - extent2[0]) < tolerance &&\n Math.abs(extent1[2] - extent2[2]) < tolerance &&\n Math.abs(extent1[1] - extent2[1]) < tolerance &&\n Math.abs(extent1[3] - extent2[3]) < tolerance\n );\n}\n\n/**\n * Modify an extent to include another extent.\n * @param {Extent} extent1 The extent to be modified.\n * @param {Extent} extent2 The extent that will be included in the first.\n * @return {Extent} A reference to the first (extended) extent.\n * @api\n */\nexport function extend(extent1, extent2) {\n if (extent2[0] < extent1[0]) {\n extent1[0] = extent2[0];\n }\n if (extent2[2] > extent1[2]) {\n extent1[2] = extent2[2];\n }\n if (extent2[1] < extent1[1]) {\n extent1[1] = extent2[1];\n }\n if (extent2[3] > extent1[3]) {\n extent1[3] = extent2[3];\n }\n return extent1;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n */\nexport function extendCoordinate(extent, coordinate) {\n if (coordinate[0] < extent[0]) {\n extent[0] = coordinate[0];\n }\n if (coordinate[0] > extent[2]) {\n extent[2] = coordinate[0];\n }\n if (coordinate[1] < extent[1]) {\n extent[1] = coordinate[1];\n }\n if (coordinate[1] > extent[3]) {\n extent[3] = coordinate[1];\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @return {Extent} Extent.\n */\nexport function extendCoordinates(extent, coordinates) {\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Extent} Extent.\n */\nexport function extendFlatCoordinates(\n extent,\n flatCoordinates,\n offset,\n end,\n stride\n) {\n for (; offset < end; offset += stride) {\n extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @return {Extent} Extent.\n */\nexport function extendRings(extent, rings) {\n for (let i = 0, ii = rings.length; i < ii; ++i) {\n extendCoordinates(extent, rings[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n */\nexport function extendXY(extent, x, y) {\n extent[0] = Math.min(extent[0], x);\n extent[1] = Math.min(extent[1], y);\n extent[2] = Math.max(extent[2], x);\n extent[3] = Math.max(extent[3], y);\n}\n\n/**\n * This function calls `callback` for each corner of the extent. If the\n * callback returns a truthy value the function returns that value\n * immediately. Otherwise the function returns `false`.\n * @param {Extent} extent Extent.\n * @param {function(import(\"./coordinate.js\").Coordinate): S} callback Callback.\n * @return {S|boolean} Value.\n * @template S\n */\nexport function forEachCorner(extent, callback) {\n let val;\n val = callback(getBottomLeft(extent));\n if (val) {\n return val;\n }\n val = callback(getBottomRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopLeft(extent));\n if (val) {\n return val;\n }\n return false;\n}\n\n/**\n * Get the size of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Area.\n * @api\n */\nexport function getArea(extent) {\n let area = 0;\n if (!isEmpty(extent)) {\n area = getWidth(extent) * getHeight(extent);\n }\n return area;\n}\n\n/**\n * Get the bottom left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom left coordinate.\n * @api\n */\nexport function getBottomLeft(extent) {\n return [extent[0], extent[1]];\n}\n\n/**\n * Get the bottom right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom right coordinate.\n * @api\n */\nexport function getBottomRight(extent) {\n return [extent[2], extent[1]];\n}\n\n/**\n * Get the center coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Center.\n * @api\n */\nexport function getCenter(extent) {\n return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];\n}\n\n/**\n * Get a corner coordinate of an extent.\n * @param {Extent} extent Extent.\n * @param {Corner} corner Corner.\n * @return {import(\"./coordinate.js\").Coordinate} Corner coordinate.\n */\nexport function getCorner(extent, corner) {\n let coordinate;\n if (corner === 'bottom-left') {\n coordinate = getBottomLeft(extent);\n } else if (corner === 'bottom-right') {\n coordinate = getBottomRight(extent);\n } else if (corner === 'top-left') {\n coordinate = getTopLeft(extent);\n } else if (corner === 'top-right') {\n coordinate = getTopRight(extent);\n } else {\n assert(false, 13); // Invalid corner\n }\n return coordinate;\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Enlarged area.\n */\nexport function getEnlargedArea(extent1, extent2) {\n const minX = Math.min(extent1[0], extent2[0]);\n const minY = Math.min(extent1[1], extent2[1]);\n const maxX = Math.max(extent1[2], extent2[2]);\n const maxY = Math.max(extent1[3], extent2[3]);\n return (maxX - minX) * (maxY - minY);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nexport function getForViewAndSize(center, resolution, rotation, size, dest) {\n const [x0, y0, x1, y1, x2, y2, x3, y3] = getRotatedViewport(\n center,\n resolution,\n rotation,\n size\n );\n return createOrUpdate(\n Math.min(x0, x1, x2, x3),\n Math.min(y0, y1, y2, y3),\n Math.max(x0, x1, x2, x3),\n Math.max(y0, y1, y2, y3),\n dest\n );\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @return {Array<number>} Linear ring representing the viewport.\n */\nexport function getRotatedViewport(center, resolution, rotation, size) {\n const dx = (resolution * size[0]) / 2;\n const dy = (resolution * size[1]) / 2;\n const cosRotation = Math.cos(rotation);\n const sinRotation = Math.sin(rotation);\n const xCos = dx * cosRotation;\n const xSin = dx * sinRotation;\n const yCos = dy * cosRotation;\n const ySin = dy * sinRotation;\n const x = center[0];\n const y = center[1];\n return [\n x - xCos + ySin,\n y - xSin - yCos,\n x - xCos - ySin,\n y - xSin + yCos,\n x + xCos - ySin,\n y + xSin + yCos,\n x + xCos + ySin,\n y + xSin - yCos,\n x - xCos + ySin,\n y - xSin - yCos,\n ];\n}\n\n/**\n * Get the height of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Height.\n * @api\n */\nexport function getHeight(extent) {\n return extent[3] - extent[1];\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Intersection area.\n */\nexport function getIntersectionArea(extent1, extent2) {\n const intersection = getIntersection(extent1, extent2);\n return getArea(intersection);\n}\n\n/**\n * Get the intersection of two extents.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {Extent} [dest] Optional extent to populate with intersection.\n * @return {Extent} Intersecting extent.\n * @api\n */\nexport function getIntersection(extent1, extent2, dest) {\n const intersection = dest ? dest : createEmpty();\n if (intersects(extent1, extent2)) {\n if (extent1[0] > extent2[0]) {\n intersection[0] = extent1[0];\n } else {\n intersection[0] = extent2[0];\n }\n if (extent1[1] > extent2[1]) {\n intersection[1] = extent1[1];\n } else {\n intersection[1] = extent2[1];\n }\n if (extent1[2] < extent2[2]) {\n intersection[2] = extent1[2];\n } else {\n intersection[2] = extent2[2];\n }\n if (extent1[3] < extent2[3]) {\n intersection[3] = extent1[3];\n } else {\n intersection[3] = extent2[3];\n }\n } else {\n createOrUpdateEmpty(intersection);\n }\n return intersection;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @return {number} Margin.\n */\nexport function getMargin(extent) {\n return getWidth(extent) + getHeight(extent);\n}\n\n/**\n * Get the size (width, height) of an extent.\n * @param {Extent} extent The extent.\n * @return {import(\"./size.js\").Size} The extent size.\n * @api\n */\nexport function getSize(extent) {\n return [extent[2] - extent[0], extent[3] - extent[1]];\n}\n\n/**\n * Get the top left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top left coordinate.\n * @api\n */\nexport function getTopLeft(extent) {\n return [extent[0], extent[3]];\n}\n\n/**\n * Get the top right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top right coordinate.\n * @api\n */\nexport function getTopRight(extent) {\n return [extent[2], extent[3]];\n}\n\n/**\n * Get the width of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Width.\n * @api\n */\nexport function getWidth(extent) {\n return extent[2] - extent[0];\n}\n\n/**\n * Determine if one extent intersects another.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent.\n * @return {boolean} The two extents intersect.\n * @api\n */\nexport function intersects(extent1, extent2) {\n return (\n extent1[0] <= extent2[2] &&\n extent1[2] >= extent2[0] &&\n extent1[1] <= extent2[3] &&\n extent1[3] >= extent2[1]\n );\n}\n\n/**\n * Determine if an extent is empty.\n * @param {Extent} extent Extent.\n * @return {boolean} Is empty.\n * @api\n */\nexport function isEmpty(extent) {\n return extent[2] < extent[0] || extent[3] < extent[1];\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function returnOrUpdate(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n } else {\n return extent;\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} value Value.\n */\nexport function scaleFromCenter(extent, value) {\n const deltaX = ((extent[2] - extent[0]) / 2) * (value - 1);\n const deltaY = ((extent[3] - extent[1]) / 2) * (value - 1);\n extent[0] -= deltaX;\n extent[2] += deltaX;\n extent[1] -= deltaY;\n extent[3] += deltaY;\n}\n\n/**\n * Determine if the segment between two coordinates intersects (crosses,\n * touches, or is contained by) the provided extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} start Segment start coordinate.\n * @param {import(\"./coordinate.js\").Coordinate} end Segment end coordinate.\n * @return {boolean} The segment intersects the extent.\n */\nexport function intersectsSegment(extent, start, end) {\n let intersects = false;\n const startRel = coordinateRelationship(extent, start);\n const endRel = coordinateRelationship(extent, end);\n if (\n startRel === Relationship.INTERSECTING ||\n endRel === Relationship.INTERSECTING\n ) {\n intersects = true;\n } else {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const startX = start[0];\n const startY = start[1];\n const endX = end[0];\n const endY = end[1];\n const slope = (endY - startY) / (endX - startX);\n let x, y;\n if (!!(endRel & Relationship.ABOVE) && !(startRel & Relationship.ABOVE)) {\n // potentially intersects top\n x = endX - (endY - maxY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.RIGHT) &&\n !(startRel & Relationship.RIGHT)\n ) {\n // potentially intersects right\n y = endY - (endX - maxX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.BELOW) &&\n !(startRel & Relationship.BELOW)\n ) {\n // potentially intersects bottom\n x = endX - (endY - minY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.LEFT) &&\n !(startRel & Relationship.LEFT)\n ) {\n // potentially intersects left\n y = endY - (endX - minX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n }\n return intersects;\n}\n\n/**\n * Apply a transform function to the extent.\n * @param {Extent} extent Extent.\n * @param {import(\"./proj.js\").TransformFunction} transformFn Transform function.\n * Called with `[minX, minY, maxX, maxY]` extent coordinates.\n * @param {Extent} [dest] Destination extent.\n * @param {number} [stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {Extent} Extent.\n * @api\n */\nexport function applyTransform(extent, transformFn, dest, stops) {\n let coordinates = [];\n if (stops > 1) {\n const width = extent[2] - extent[0];\n const height = extent[3] - extent[1];\n for (let i = 0; i < stops; ++i) {\n coordinates.push(\n extent[0] + (width * i) / stops,\n extent[1],\n extent[2],\n extent[1] + (height * i) / stops,\n extent[2] - (width * i) / stops,\n extent[3],\n extent[0],\n extent[3] - (height * i) / stops\n );\n }\n } else {\n coordinates = [\n extent[0],\n extent[1],\n extent[2],\n extent[1],\n extent[2],\n extent[3],\n extent[0],\n extent[3],\n ];\n }\n transformFn(coordinates, coordinates, 2);\n const xs = [];\n const ys = [];\n for (let i = 0, l = coordinates.length; i < l; i += 2) {\n xs.push(coordinates[i]);\n ys.push(coordinates[i + 1]);\n }\n return _boundingExtentXYs(xs, ys, dest);\n}\n\n/**\n * Modifies the provided extent in-place to be within the real world\n * extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Extent} The extent within the real world extent.\n */\nexport function wrapX(extent, projection) {\n const projectionExtent = projection.getExtent();\n const center = getCenter(extent);\n if (\n projection.canWrapX() &&\n (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])\n ) {\n const worldWidth = getWidth(projectionExtent);\n const worldsAway = Math.floor(\n (center[0] - projectionExtent[0]) / worldWidth\n );\n const offset = worldsAway * worldWidth;\n extent[0] -= offset;\n extent[2] -= offset;\n }\n return extent;\n}\n\n/**\n * Fits the extent to the real world\n *\n * If the extent does not cross the anti meridian, this will return the extent in an array\n * If the extent crosses the anti meridian, the extent will be sliced, so each part fits within the\n * real world\n *\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Array<Extent>} The extent within the real world extent.\n */\nexport function wrapAndSliceX(extent, projection) {\n if (projection.canWrapX()) {\n const projectionExtent = projection.getExtent();\n\n if (!isFinite(extent[0]) || !isFinite(extent[2])) {\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n }\n\n wrapX(extent, projection);\n const worldWidth = getWidth(projectionExtent);\n\n if (getWidth(extent) > worldWidth) {\n // the extent wraps around on itself\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n } else if (extent[0] < projectionExtent[0]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [\n [extent[0] + worldWidth, extent[1], projectionExtent[2], extent[3]],\n [projectionExtent[0], extent[1], extent[2], extent[3]],\n ];\n } else if (extent[2] > projectionExtent[2]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [\n [extent[0], extent[1], projectionExtent[2], extent[3]],\n [projectionExtent[0], extent[1], extent[2] - worldWidth, extent[3]],\n ];\n }\n }\n\n return [extent];\n}\n","module.exports =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(1).default;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; /**\n * Vanilla JS Modal compatible with Bootstrap\n * modal-vanilla 0.12.0 <https://github.com/KaneCohen/modal-vanilla>\n * Copyright 2020 Kane Cohen <https://github.com/KaneCohen>\n * Available under BSD-3-Clause license\n */\n\n\nvar _events = __webpack_require__(2);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _factory = null;\n\nvar _defaults = Object.freeze({\n el: null, // Existing DOM element that will be 'Modal-ized'.\n animate: true, // Show Modal using animation.\n animateClass: 'fade', //\n animateInClass: 'show', //\n appendTo: 'body', // DOM element to which constructed Modal will be appended.\n backdrop: true, // Boolean or 'static', Show Modal backdrop blocking content.\n keyboard: true, // Close modal on esc key.\n title: false, // Content of the title in the constructed dialog.\n header: true, // Show header content.\n content: false, // Either string or an HTML element.\n footer: true, // Footer content. By default will use buttons.\n buttons: null, //\n headerClose: true, // Show close button in the header.\n construct: false, // Creates new HTML with a given content.\n transition: 300, //\n backdropTransition: 150 //\n});\n\nvar _buttons = deepFreeze({\n dialog: [{ text: 'Cancel',\n value: false,\n attr: {\n 'class': 'btn btn-default',\n 'data-dismiss': 'modal'\n }\n }, { text: 'OK',\n value: true,\n attr: {\n 'class': 'btn btn-primary',\n 'data-dismiss': 'modal'\n }\n }],\n alert: [{ text: 'OK',\n attr: {\n 'class': 'btn btn-primary',\n 'data-dismiss': 'modal'\n }\n }],\n confirm: [{ text: 'Cancel',\n value: false,\n attr: {\n 'class': 'btn btn-default',\n 'data-dismiss': 'modal'\n }\n }, { text: 'OK',\n value: true,\n attr: {\n 'class': 'btn btn-primary',\n 'data-dismiss': 'modal'\n }\n }]\n});\n\nvar _templates = {\n container: '<div class=\"modal\"></div>',\n dialog: '<div class=\"modal-dialog\"></div>',\n content: '<div class=\"modal-content\"></div>',\n header: '<div class=\"modal-header\"></div>',\n headerClose: '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>',\n body: '<div class=\"modal-body\"></div>',\n footer: '<div class=\"modal-footer\"></div>',\n backdrop: '<div class=\"modal-backdrop\"></div>'\n};\n\nfunction deepFreeze(obj) {\n for (var k in obj) {\n if (Array.isArray(obj[k])) {\n obj[k].forEach(function (v) {\n deepFreeze(v);\n });\n } else if (obj[k] !== null && _typeof(obj[k]) === 'object') {\n Object.freeze(obj[k]);\n }\n }\n return Object.freeze(obj);\n}\n\nfunction guid() {\n return ((1 + Math.random()) * 0x10000 | 0).toString(16) + ((1 + Math.random()) * 0x10000 | 0).toString(16);\n}\n\nfunction data(el, prop, value) {\n var prefix = 'data';\n var elData = el[prefix] || {};\n if (typeof value === 'undefined') {\n if (el[prefix] && el[prefix][prop]) {\n return el[prefix][prop];\n } else {\n var dataAttr = el.getAttribute(prefix + '-' + prop);\n if (typeof dataAttr !== 'undefined') {\n return dataAttr;\n }\n return null;\n }\n } else {\n elData[prop] = value;\n el[prefix] = elData;\n return el;\n }\n}\n\nfunction build(html, all) {\n if (html.nodeName) return html;\n html = html.replace(/(\\t|\\n$)/g, '');\n\n if (!_factory) {\n _factory = document.createElement('div');\n }\n\n _factory.innerHTML = '';\n _factory.innerHTML = html;\n if (all === true) {\n return _factory.childNodes;\n } else {\n return _factory.childNodes[0];\n }\n}\n\nfunction calcScrollbarWidth() {\n var inner = void 0;\n var width = void 0;\n var outerWidth = void 0;\n var outer = document.createElement('div');\n _extends(outer.style, {\n visibility: 'hidden',\n width: '100px'\n });\n document.body.appendChild(outer);\n\n outerWidth = outer.offsetWidth;\n outer.style.overflow = 'scroll';\n\n inner = document.createElement('div');\n inner.style.width = '100%';\n outer.appendChild(inner);\n\n width = outerWidth - inner.offsetWidth;\n document.body.removeChild(outer);\n\n return width;\n}\n\nfunction getPath(node) {\n var nodes = [node];\n while (node.parentNode) {\n node = node.parentNode;\n nodes.push(node);\n }\n return nodes;\n}\n\nvar Modal = function (_EventEmitter) {\n _inherits(Modal, _EventEmitter);\n\n _createClass(Modal, null, [{\n key: 'alert',\n value: function alert(message) {\n var _options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var options = _extends({}, _defaults, {\n title: message,\n content: false,\n construct: true,\n headerClose: false,\n buttons: Modal.buttons.alert\n }, _options);\n\n return new Modal(options);\n }\n }, {\n key: 'confirm',\n value: function confirm(question) {\n var _options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var options = _extends({}, _defaults, {\n title: question,\n content: false,\n construct: true,\n headerClose: false,\n buttons: Modal.buttons.confirm\n }, _options);\n\n return new Modal(options);\n }\n }, {\n key: 'templates',\n set: function set(templates) {\n this._baseTemplates = templates;\n },\n get: function get() {\n return _extends({}, _templates, Modal._baseTemplates || {});\n }\n }, {\n key: 'buttons',\n set: function set(buttons) {\n this._baseButtons = buttons;\n },\n get: function get() {\n return _extends({}, _buttons, Modal._baseButtons || {});\n }\n }, {\n key: 'options',\n set: function set(options) {\n this._baseOptions = options;\n },\n get: function get() {\n return _extends({}, _defaults, Modal._baseOptions || {});\n }\n }, {\n key: 'version',\n get: function get() {\n return '0.12.0';\n }\n }]);\n\n function Modal() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Modal);\n\n var _this = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this));\n\n _this.id = guid();\n _this.el = null;\n _this._html = {};\n _this._events = {};\n _this._visible = false;\n _this._pointerInContent = false;\n _this._options = _extends({}, Modal.options, options);\n _this._templates = _extends({}, Modal.templates, options.templates || {});\n _this._html.appendTo = document.querySelector(_this._options.appendTo);\n _this._scrollbarWidth = calcScrollbarWidth();\n\n if (_this._options.buttons === null) {\n _this._options.buttons = Modal.buttons.dialog;\n }\n\n if (_this._options.el) {\n var el = _this._options.el;\n if (typeof _this._options.el == 'string') {\n el = document.querySelector(_this._options.el);\n if (!el) {\n throw new Error('Selector: DOM Element ' + _this._options.el + ' not found.');\n }\n }\n data(el, 'modal', _this);\n _this.el = el;\n } else {\n _this._options.construct = true;\n }\n\n if (_this._options.construct) {\n _this._render();\n } else {\n _this._mapDom();\n }\n return _this;\n }\n\n _createClass(Modal, [{\n key: '_render',\n value: function _render() {\n var html = this._html;\n var o = this._options;\n var t = this._templates;\n var animate = o.animate ? o.animateClass : false;\n\n html.container = build(t.container);\n html.dialog = build(t.dialog);\n html.content = build(t.content);\n html.header = build(t.header);\n html.headerClose = build(t.headerClose);\n html.body = build(t.body);\n html.footer = build(t.footer);\n if (animate) html.container.classList.add(animate);\n\n this._setHeader();\n this._setContent();\n this._setFooter();\n\n this.el = html.container;\n\n html.dialog.appendChild(html.content);\n html.container.appendChild(html.dialog);\n\n return this;\n }\n }, {\n key: '_mapDom',\n value: function _mapDom() {\n var html = this._html;\n var o = this._options;\n\n if (this.el.classList.contains(o.animateClass)) {\n o.animate = true;\n }\n\n html.container = this.el;\n html.dialog = this.el.querySelector('.modal-dialog');\n html.content = this.el.querySelector('.modal-content');\n html.header = this.el.querySelector('.modal-header');\n html.headerClose = this.el.querySelector('.modal-header .close');\n html.body = this.el.querySelector('.modal-body');\n html.footer = this.el.querySelector('.modal-footer');\n\n this._setHeader();\n this._setContent();\n this._setFooter();\n\n return this;\n }\n }, {\n key: '_setHeader',\n value: function _setHeader() {\n var html = this._html;\n var o = this._options;\n\n if (o.header && html.header) {\n if (o.title.nodeName) {\n html.header.innerHTML = o.title.outerHTML;\n } else if (typeof o.title === 'string') {\n html.header.innerHTML = '<h4 class=\"modal-title\">' + o.title + '</h4>';\n }\n // Add header close button only to constructed modals.\n if (this.el === null && html.headerClose && o.headerClose) {\n html.header.appendChild(html.headerClose);\n }\n if (o.construct) {\n html.content.appendChild(html.header);\n }\n }\n }\n }, {\n key: '_setContent',\n value: function _setContent() {\n var html = this._html;\n var o = this._options;\n\n if (o.content && html.body) {\n if (typeof o.content === 'string') {\n html.body.innerHTML = o.content;\n } else {\n html.body.innerHTML = o.content.outerHTML;\n }\n if (o.construct) {\n html.content.appendChild(html.body);\n }\n }\n }\n }, {\n key: '_setFooter',\n value: function _setFooter() {\n var html = this._html;\n var o = this._options;\n\n if (o.footer && html.footer) {\n if (o.footer.nodeName) {\n html.footer.ineerHTML = o.footer.outerHTML;\n } else if (typeof o.footer === 'string') {\n html.footer.innerHTML = o.footer;\n } else if (!html.footer.children.length) {\n o.buttons.forEach(function (button) {\n var el = document.createElement('button');\n data(el, 'button', button);\n el.innerHTML = button.text;\n el.setAttribute('type', 'button');\n for (var j in button.attr) {\n el.setAttribute(j, button.attr[j]);\n }\n html.footer.appendChild(el);\n });\n }\n if (o.construct) {\n html.content.appendChild(html.footer);\n }\n }\n }\n }, {\n key: '_setEvents',\n value: function _setEvents() {\n var o = this._options;\n var html = this._html;\n\n this._events.keydownHandler = this._handleKeydownEvent.bind(this);\n document.body.addEventListener('keydown', this._events.keydownHandler);\n\n this._events.mousedownHandler = this._handleMousedownEvent.bind(this);\n html.container.addEventListener('mousedown', this._events.mousedownHandler);\n\n this._events.clickHandler = this._handleClickEvent.bind(this);\n html.container.addEventListener('click', this._events.clickHandler);\n\n this._events.resizeHandler = this._handleResizeEvent.bind(this);\n window.addEventListener('resize', this._events.resizeHandler);\n }\n }, {\n key: '_handleMousedownEvent',\n value: function _handleMousedownEvent(e) {\n var _this2 = this;\n\n this._pointerInContent = false;\n var path = getPath(e.target);\n path.every(function (node) {\n if (node.classList && node.classList.contains('modal-content')) {\n _this2._pointerInContent = true;\n return false;\n }\n return true;\n });\n }\n }, {\n key: '_handleClickEvent',\n value: function _handleClickEvent(e) {\n var _this3 = this;\n\n var path = getPath(e.target);\n path.every(function (node) {\n if (node.tagName === 'HTML') {\n return false;\n }\n if (_this3._options.backdrop !== true && node.classList.contains('modal')) {\n return false;\n }\n if (node.classList.contains('modal-content')) {\n return false;\n }\n if (node.getAttribute('data-dismiss') === 'modal') {\n _this3.emit('dismiss', _this3, e, data(e.target, 'button'));\n _this3.hide();\n return false;\n }\n\n if (!_this3._pointerInContent && node.classList.contains('modal')) {\n _this3.emit('dismiss', _this3, e, null);\n _this3.hide();\n return false;\n }\n return true;\n });\n\n this._pointerInContent = false;\n }\n }, {\n key: '_handleKeydownEvent',\n value: function _handleKeydownEvent(e) {\n if (e.which === 27 && this._options.keyboard) {\n this.emit('dismiss', this, e, null);\n this.hide();\n }\n }\n }, {\n key: '_handleResizeEvent',\n value: function _handleResizeEvent(e) {\n this._resize();\n }\n }, {\n key: 'show',\n value: function show() {\n var _this4 = this;\n\n var o = this._options;\n var html = this._html;\n this.emit('show', this);\n\n this._checkScrollbar();\n this._setScrollbar();\n document.body.classList.add('modal-open');\n\n if (o.construct) {\n html.appendTo.appendChild(html.container);\n }\n\n html.container.style.display = 'block';\n html.container.scrollTop = 0;\n\n if (o.backdrop !== false) {\n this.once('showBackdrop', function () {\n _this4._setEvents();\n\n if (o.animate) html.container.offsetWidth; // Force reflow\n\n html.container.classList.add(o.animateInClass);\n\n setTimeout(function () {\n _this4._visible = true;\n _this4.emit('shown', _this4);\n }, o.transition);\n });\n this._backdrop();\n } else {\n this._setEvents();\n\n if (o.animate) html.container.offsetWidth; // Force reflow\n\n html.container.classList.add(o.animateInClass);\n\n setTimeout(function () {\n _this4._visible = true;\n _this4.emit('shown', _this4);\n }, o.transition);\n }\n this._resize();\n\n return this;\n }\n }, {\n key: 'toggle',\n value: function toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n }, {\n key: '_resize',\n value: function _resize() {\n var modalIsOverflowing = this._html.container.scrollHeight > document.documentElement.clientHeight;\n\n this._html.container.style.paddingLeft = !this.bodyIsOverflowing && modalIsOverflowing ? this._scrollbarWidth + 'px' : '';\n\n this._html.container.style.paddingRight = this.bodyIsOverflowing && !modalIsOverflowing ? this._scrollbarWidth + 'px' : '';\n }\n }, {\n key: '_backdrop',\n value: function _backdrop() {\n var _this5 = this;\n\n var html = this._html;\n var t = this._templates;\n var o = this._options;\n var animate = o.animate ? o.animateClass : false;\n\n html.backdrop = build(t.backdrop);\n if (animate) html.backdrop.classList.add(animate);\n html.appendTo.appendChild(html.backdrop);\n\n if (animate) html.backdrop.offsetWidth;\n\n html.backdrop.classList.add(o.animateInClass);\n\n setTimeout(function () {\n _this5.emit('showBackdrop', _this5);\n }, this._options.backdropTransition);\n }\n }, {\n key: 'hide',\n value: function hide() {\n var _this6 = this;\n\n var html = this._html;\n var o = this._options;\n var contCList = html.container.classList;\n this.emit('hide', this);\n\n contCList.remove(o.animateInClass);\n\n if (o.backdrop) {\n var backCList = html.backdrop.classList;\n backCList.remove(o.animateInClass);\n }\n\n this._removeEvents();\n\n setTimeout(function () {\n document.body.classList.remove('modal-open');\n document.body.style.paddingRight = _this6.originalBodyPad;\n }, o.backdropTransition);\n\n setTimeout(function () {\n if (o.backdrop) {\n html.backdrop.parentNode.removeChild(html.backdrop);\n }\n html.container.style.display = 'none';\n\n if (o.construct) {\n html.container.parentNode.removeChild(html.container);\n }\n\n _this6._visible = false;\n _this6.emit('hidden', _this6);\n }, o.transition);\n\n return this;\n }\n }, {\n key: '_removeEvents',\n value: function _removeEvents() {\n if (this._events.keydownHandler) {\n document.body.removeEventListener('keydown', this._events.keydownHandler);\n }\n\n this._html.container.removeEventListener('mousedown', this._events.mousedownHandler);\n\n this._html.container.removeEventListener('click', this._events.clickHandler);\n\n window.removeEventListener('resize', this._events.resizeHandler);\n }\n }, {\n key: '_checkScrollbar',\n value: function _checkScrollbar() {\n this.bodyIsOverflowing = document.body.clientWidth < window.innerWidth;\n }\n }, {\n key: '_setScrollbar',\n value: function _setScrollbar() {\n this.originalBodyPad = document.body.style.paddingRight || '';\n if (this.bodyIsOverflowing) {\n var basePadding = parseInt(this.originalBodyPad || 0, 10);\n document.body.style.paddingRight = basePadding + this._scrollbarWidth + 'px';\n }\n }\n }]);\n\n return Modal;\n}(_events2.default);\n\nexports.default = Modal;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"events\");\n\n/***/ })\n/******/ ]);","// External\nimport Modal from 'modal-vanilla';\n\nimport { Options } from '../ol-wfst';\n\nlet options = {};\n\n// Store layerNames that has errors\nconst isError = new Set();\n\nexport const initModal = (opts: Options['modal']) => {\n options = opts;\n};\n\nexport const parseError = (geoserverError) => {\n if ('exceptions' in geoserverError) {\n return geoserverError.exceptions.map((e) => e.text).join(',');\n } else {\n return '';\n }\n};\n\n/**\n * Show modal with errors\n *\n * @param msg\n * @private\n */\nexport const showError = (\n msg: string,\n originalError: Error = null,\n layerName = ''\n): void => {\n // Prevent multiples modals error in the same layer\n if (isError.has(layerName)) {\n return;\n }\n\n isError.add(layerName);\n\n let err_msg = `<b>Error: ${msg}</b>`;\n if (originalError) {\n err_msg += `. ${originalError.message}`;\n }\n\n const al = Modal.alert(err_msg, options);\n\n al.show();\n\n al.on('hidden', () => {\n isError.delete(layerName);\n });\n};\n","import { I18n } from '../../ol-wfst';\n\nexport const en: I18n = {\n labels: {\n select: 'Select',\n addElement: 'Toggle Draw mode',\n editElement: 'Edit feature',\n save: 'Save',\n delete: 'Delete',\n cancel: 'Cancel',\n apply: 'Apply changes',\n upload: 'Upload',\n editMode: 'Edit Mode',\n confirmDelete: 'Are you sure to delete the feature?',\n geomTypeNotSupported: 'Geometry not supported by layer',\n editFields: 'Edit fields',\n editGeom: 'Edit geometry',\n selectDrawType: 'Geometry type to draw',\n uploadToLayer: 'Upload file to selected layer',\n uploadFeatures: 'Uploaded features to layer',\n validFeatures: 'Valid geometries',\n invalidFeatures: 'Invalid',\n loading: 'Loading...',\n toggleVisibility: 'Toggle layer visibility',\n close: 'Close'\n },\n errors: {\n capabilities: 'GeoServer Capabilities could not be downloaded.',\n wfst: 'The GeoServer does not support Transactions',\n layer: 'Could not get data from layer',\n layerNotFound: 'Layer not found',\n layerNotVisible: 'Layer is not visible',\n noValidGeometry: 'No valid geometries found to add to this layer',\n geoserver: 'Failed to get data from GeoServer',\n badFormat: 'Unsupported format',\n badFile: 'Error reading items from file',\n lockFeature: 'Could not lock items on the GeoServer.',\n transaction: 'Error when doing Transaction with GeoServer.',\n getFeatures: 'Error getting elements from GeoServer.'\n }\n};\n","import { I18n } from '../../@types';\nexport * from './es';\nexport * from './en';\nexport * from './zh';\n\nimport { es } from './es';\nimport { en } from './en';\nimport { zh } from './zh';\n\nconst langs = {\n es,\n en,\n zh\n};\n\n// Set default Language\nexport let I18N: I18n = en;\n\nexport const setLang = (lang = 'en', customI18n: I18n = null): void => {\n // Check if language exists\n if (lang in langs) {\n I18N = langs[lang];\n }\n\n // Check if customs translations are provided\n if (customI18n) {\n I18N = { ...I18N, ...customI18n };\n }\n};\n\n/**\n * /**\n * For translations thas has a variable \"{}\"\" to be replaced inside\n * @param string\n * @param args\n * @returns\n */\nexport const I18N_ = (string: string, ...args: any): string => {\n let text = I18N[string];\n\n if (!text) {\n console.error('Translation not found', string);\n text = string;\n }\n\n if (args.length) {\n args.forEach((arg) => {\n text = text.replace(/{}/, arg);\n });\n }\n\n return text;\n};\n","import { I18n } from '../../ol-wfst';\n\nexport const es: I18n = {\n labels: {\n select: 'Seleccionar',\n addElement: 'Modo dibujo',\n editElement: 'Editar elemento',\n save: 'Guardar',\n delete: 'Eliminar',\n cancel: 'Cancelar',\n apply: 'Aplicar cambios',\n upload: 'Subir',\n editMode: 'Modo Edición',\n confirmDelete: '¿Estás seguro de borrar el elemento?',\n geomTypeNotSupported: 'Geometría no compatible con la capa',\n editFields: 'Editar campos',\n editGeom: 'Editar geometría',\n selectDrawType: 'Tipo de geometría para dibujar',\n uploadToLayer: 'Subir archivo a la capa seleccionada',\n uploadFeatures: 'Subida de elementos a la capa',\n validFeatures: 'Válidas',\n invalidFeatures: 'Invalidas',\n loading: 'Cargando...',\n toggleVisibility: 'Cambiar visibilidad de la capa',\n close: 'Cerrar'\n },\n errors: {\n capabilities: 'No se pudieron obtener las Capabilidades del GeoServer',\n wfst: 'El GeoServer no tiene soporte a Transacciones',\n layer: 'No se pudieron obtener datos de la capa',\n layerNotFound: 'Capa no encontrada',\n layerNotVisible: 'La capa no está visible',\n noValidGeometry:\n 'No se encontraron geometrías válidas para agregar a esta capa',\n geoserver: 'No se pudieron obtener datos desde el GeoServer',\n badFormat: 'Formato no soportado',\n badFile: 'Error al leer elementos del archivo',\n lockFeature: 'No se pudieron bloquear elementos en el GeoServer.',\n transaction: 'Error al hacer transacción con el GeoServer.',\n getFeatures: 'Error al obtener elemento desde el GeoServer.'\n }\n};\n","import { I18n } from '../../ol-wfst';\n\nexport const zh: I18n = {\n labels: {\n select: '选择',\n addElement: '切换绘图类型',\n editElement: '编辑元素',\n save: '保存',\n delete: '删除',\n cancel: '取消',\n apply: '确认并应用改变',\n upload: '上传',\n editMode: '编辑模式',\n confirmDelete: '确认删除元素?',\n geomTypeNotSupported: '图层不支持该几何',\n editFields: '编辑区域',\n editGeom: '编辑几何',\n selectDrawType: '几何类型',\n uploadToLayer: '通过文件上传图层',\n uploadFeatures: '上传元素到图层',\n validFeatures: '合法的几何类型',\n invalidFeatures: '不合法',\n loading: '加载中...',\n toggleVisibility: '切换图层透明度',\n close: '关闭'\n },\n errors: {\n capabilities: '无法加载GeoServer服务所支持的能力.',\n wfst: 'GeoServer不支持事务',\n layer: '无法从图层获得数据',\n layerNotFound: 'Layer not found',\n layerNotVisible: 'Layer is not visible',\n noValidGeometry: '不支持的几何类型无法加载到图层',\n geoserver: '无法从GeoServer获取数据',\n badFormat: '不支持的格式',\n badFile: '读取文件数据出错',\n lockFeature: '无法锁定GeoServer上的元素.',\n transaction: 'GeoServer处理事务出错.',\n getFeatures: '从GeoServer获取元素出错.'\n }\n};\n","import { I18N } from './i18n';\n\nlet loadingDiv: HTMLDivElement;\n\nexport const initLoading = (): HTMLDivElement => {\n loadingDiv = document.createElement('div');\n loadingDiv.className = 'ol-wfst--tools-control--loading';\n loadingDiv.innerHTML = I18N.labels.loading;\n return loadingDiv;\n};\n\nexport const showLoading = (bool: boolean = true) => {\n if (bool) {\n loadingDiv.classList.add('ol-wfst--tools-control--loading-show');\n } else {\n loadingDiv.classList.remove('ol-wfst--tools-control--loading-show');\n }\n};\n","/**\n * Utility function that works like `Object.apply`, but copies getters and setters properly as well. Additionally gives\n * the option to exclude properties by name.\n */\nconst copyProps = (dest, src, exclude = []) => {\n const props = Object.getOwnPropertyDescriptors(src);\n for (let prop of exclude)\n delete props[prop];\n Object.defineProperties(dest, props);\n};\n/**\n * Returns the full chain of prototypes up until Object.prototype given a starting object. The order of prototypes will\n * be closest to farthest in the chain.\n */\nconst protoChain = (obj, currentChain = [obj]) => {\n const proto = Object.getPrototypeOf(obj);\n if (proto === null)\n return currentChain;\n return protoChain(proto, [...currentChain, proto]);\n};\n/**\n * Identifies the nearest ancestor common to all the given objects in their prototype chains. For most unrelated\n * objects, this function should return Object.prototype.\n */\nconst nearestCommonProto = (...objs) => {\n if (objs.length === 0)\n return undefined;\n let commonProto = undefined;\n const protoChains = objs.map(obj => protoChain(obj));\n while (protoChains.every(protoChain => protoChain.length > 0)) {\n const protos = protoChains.map(protoChain => protoChain.pop());\n const potentialCommonProto = protos[0];\n if (protos.every(proto => proto === potentialCommonProto))\n commonProto = potentialCommonProto;\n else\n break;\n }\n return commonProto;\n};\n/**\n * Creates a new prototype object that is a mixture of the given prototypes. The mixing is achieved by first\n * identifying the nearest common ancestor and using it as the prototype for a new object. Then all properties/methods\n * downstream of this prototype (ONLY downstream) are copied into the new object.\n *\n * The resulting prototype is more performant than softMixProtos(...), as well as ES5 compatible. However, it's not as\n * flexible as updates to the source prototypes aren't captured by the mixed result. See softMixProtos for why you may\n * want to use that instead.\n */\nconst hardMixProtos = (ingredients, constructor, exclude = []) => {\n var _a;\n const base = (_a = nearestCommonProto(...ingredients)) !== null && _a !== void 0 ? _a : Object.prototype;\n const mixedProto = Object.create(base);\n // Keeps track of prototypes we've already visited to avoid copying the same properties multiple times. We init the\n // list with the proto chain below the nearest common ancestor because we don't want any of those methods mixed in\n // when they will already be accessible via prototype access.\n const visitedProtos = protoChain(base);\n for (let prototype of ingredients) {\n let protos = protoChain(prototype);\n // Apply the prototype chain in reverse order so that old methods don't override newer ones.\n for (let i = protos.length - 1; i >= 0; i--) {\n let newProto = protos[i];\n if (visitedProtos.indexOf(newProto) === -1) {\n copyProps(mixedProto, newProto, ['constructor', ...exclude]);\n visitedProtos.push(newProto);\n }\n }\n }\n mixedProto.constructor = constructor;\n return mixedProto;\n};\nconst unique = (arr) => arr.filter((e, i) => arr.indexOf(e) == i);\n\n/**\n * Finds the ingredient with the given prop, searching in reverse order and breadth-first if searching ingredient\n * prototypes is required.\n */\nconst getIngredientWithProp = (prop, ingredients) => {\n const protoChains = ingredients.map(ingredient => protoChain(ingredient));\n // since we search breadth-first, we need to keep track of our depth in the prototype chains\n let protoDepth = 0;\n // not all prototype chains are the same depth, so this remains true as long as at least one of the ingredients'\n // prototype chains has an object at this depth\n let protosAreLeftToSearch = true;\n while (protosAreLeftToSearch) {\n // with the start of each horizontal slice, we assume this is the one that's deeper than any of the proto chains\n protosAreLeftToSearch = false;\n // scan through the ingredients right to left\n for (let i = ingredients.length - 1; i >= 0; i--) {\n const searchTarget = protoChains[i][protoDepth];\n if (searchTarget !== undefined && searchTarget !== null) {\n // if we find something, this is proof that this horizontal slice potentially more objects to search\n protosAreLeftToSearch = true;\n // eureka, we found it\n if (Object.getOwnPropertyDescriptor(searchTarget, prop) != undefined) {\n return protoChains[i][0];\n }\n }\n }\n protoDepth++;\n }\n return undefined;\n};\n/**\n * \"Mixes\" ingredients by wrapping them in a Proxy. The optional prototype argument allows the mixed object to sit\n * downstream of an existing prototype chain. Note that \"properties\" cannot be added, deleted, or modified.\n */\nconst proxyMix = (ingredients, prototype = Object.prototype) => new Proxy({}, {\n getPrototypeOf() {\n return prototype;\n },\n setPrototypeOf() {\n throw Error('Cannot set prototype of Proxies created by ts-mixer');\n },\n getOwnPropertyDescriptor(_, prop) {\n return Object.getOwnPropertyDescriptor(getIngredientWithProp(prop, ingredients) || {}, prop);\n },\n defineProperty() {\n throw new Error('Cannot define new properties on Proxies created by ts-mixer');\n },\n has(_, prop) {\n return getIngredientWithProp(prop, ingredients) !== undefined || prototype[prop] !== undefined;\n },\n get(_, prop) {\n return (getIngredientWithProp(prop, ingredients) || prototype)[prop];\n },\n set(_, prop, val) {\n const ingredientWithProp = getIngredientWithProp(prop, ingredients);\n if (ingredientWithProp === undefined)\n throw new Error('Cannot set new properties on Proxies created by ts-mixer');\n ingredientWithProp[prop] = val;\n return true;\n },\n deleteProperty() {\n throw new Error('Cannot delete properties on Proxies created by ts-mixer');\n },\n ownKeys() {\n return ingredients\n .map(Object.getOwnPropertyNames)\n .reduce((prev, curr) => curr.concat(prev.filter(key => curr.indexOf(key) < 0)));\n },\n});\n/**\n * Creates a new proxy-prototype object that is a \"soft\" mixture of the given prototypes. The mixing is achieved by\n * proxying all property access to the ingredients. This is not ES5 compatible and less performant. However, any\n * changes made to the source prototypes will be reflected in the proxy-prototype, which may be desirable.\n */\nconst softMixProtos = (ingredients, constructor) => proxyMix([...ingredients, { constructor }]);\n\nconst settings = {\n initFunction: null,\n staticsStrategy: 'copy',\n prototypeStrategy: 'copy',\n decoratorInheritance: 'deep',\n};\n\n// Keeps track of constituent classes for every mixin class created by ts-mixer.\nconst mixins = new Map();\nconst getMixinsForClass = (clazz) => mixins.get(clazz);\nconst registerMixins = (mixedClass, constituents) => mixins.set(mixedClass, constituents);\nconst hasMixin = (instance, mixin) => {\n if (instance instanceof mixin)\n return true;\n const constructor = instance.constructor;\n const visited = new Set();\n let frontier = new Set();\n frontier.add(constructor);\n while (frontier.size > 0) {\n // check if the frontier has the mixin we're looking for. if not, we can say we visited every item in the frontier\n if (frontier.has(mixin))\n return true;\n frontier.forEach(item => visited.add(item));\n // build a new frontier based on the associated mixin classes and prototype chains of each frontier item\n const newFrontier = new Set();\n frontier.forEach(item => {\n var _a;\n const itemConstituents = (_a = mixins.get(item)) !== null && _a !== void 0 ? _a : protoChain(item.prototype).map(proto => proto.constructor).filter(item => item !== null);\n if (itemConstituents)\n itemConstituents.forEach(constituent => {\n if (!visited.has(constituent) && !frontier.has(constituent))\n newFrontier.add(constituent);\n });\n });\n // we have a new frontier, now search again\n frontier = newFrontier;\n }\n // if we get here, we couldn't find the mixin anywhere in the prototype chain or associated mixin classes\n return false;\n};\n\nconst mergeObjectsOfDecorators = (o1, o2) => {\n var _a, _b;\n const allKeys = unique([...Object.getOwnPropertyNames(o1), ...Object.getOwnPropertyNames(o2)]);\n const mergedObject = {};\n for (let key of allKeys)\n mergedObject[key] = unique([...((_a = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a !== void 0 ? _a : []), ...((_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : [])]);\n return mergedObject;\n};\nconst mergePropertyAndMethodDecorators = (d1, d2) => {\n var _a, _b, _c, _d;\n return ({\n property: mergeObjectsOfDecorators((_a = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a !== void 0 ? _a : {}, (_b = d2 === null || d2 === void 0 ? void 0 : d2.property) !== null && _b !== void 0 ? _b : {}),\n method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.method) !== null && _d !== void 0 ? _d : {}),\n });\n};\nconst mergeDecorators = (d1, d2) => {\n var _a, _b, _c, _d, _e, _f;\n return ({\n class: unique([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d2 === null || d2 === void 0 ? void 0 : d2.class) !== null && _b !== void 0 ? _b : []]),\n static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.static) !== null && _d !== void 0 ? _d : {}),\n instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d2 === null || d2 === void 0 ? void 0 : d2.instance) !== null && _f !== void 0 ? _f : {}),\n });\n};\nconst decorators = new Map();\nconst findAllConstituentClasses = (...classes) => {\n var _a;\n const allClasses = new Set();\n const frontier = new Set([...classes]);\n while (frontier.size > 0) {\n for (let clazz of frontier) {\n const protoChainClasses = protoChain(clazz.prototype).map(proto => proto.constructor);\n const mixinClasses = (_a = getMixinsForClass(clazz)) !== null && _a !== void 0 ? _a : [];\n const potentiallyNewClasses = [...protoChainClasses, ...mixinClasses];\n const newClasses = potentiallyNewClasses.filter(c => !allClasses.has(c));\n for (let newClass of newClasses)\n frontier.add(newClass);\n allClasses.add(clazz);\n frontier.delete(clazz);\n }\n }\n return [...allClasses];\n};\nconst deepDecoratorSearch = (...classes) => {\n const decoratorsForClassChain = findAllConstituentClasses(...classes)\n .map(clazz => decorators.get(clazz))\n .filter(decorators => !!decorators);\n if (decoratorsForClassChain.length == 0)\n return {};\n if (decoratorsForClassChain.length == 1)\n return decoratorsForClassChain[0];\n return decoratorsForClassChain.reduce((d1, d2) => mergeDecorators(d1, d2));\n};\nconst directDecoratorSearch = (...classes) => {\n const classDecorators = classes.map(clazz => getDecoratorsForClass(clazz));\n if (classDecorators.length === 0)\n return {};\n if (classDecorators.length === 1)\n return classDecorators[0];\n return classDecorators.reduce((d1, d2) => mergeDecorators(d1, d2));\n};\nconst getDecoratorsForClass = (clazz) => {\n let decoratorsForClass = decorators.get(clazz);\n if (!decoratorsForClass) {\n decoratorsForClass = {};\n decorators.set(clazz, decoratorsForClass);\n }\n return decoratorsForClass;\n};\nconst decorateClass = (decorator) => ((clazz) => {\n const decoratorsForClass = getDecoratorsForClass(clazz);\n let classDecorators = decoratorsForClass.class;\n if (!classDecorators) {\n classDecorators = [];\n decoratorsForClass.class = classDecorators;\n }\n classDecorators.push(decorator);\n return decorator(clazz);\n});\nconst decorateMember = (decorator) => ((object, key, ...otherArgs) => {\n const decoratorTargetType = typeof object === 'function' ? 'static' : 'instance';\n const decoratorType = typeof object[key] === 'function' ? 'method' : 'property';\n const clazz = decoratorTargetType === 'static' ? object : object.constructor;\n const decoratorsForClass = getDecoratorsForClass(clazz);\n let decoratorsForTargetType = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType];\n if (!decoratorsForTargetType) {\n decoratorsForTargetType = {};\n decoratorsForClass[decoratorTargetType] = decoratorsForTargetType;\n }\n let decoratorsForType = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType];\n if (!decoratorsForType) {\n decoratorsForType = {};\n decoratorsForTargetType[decoratorType] = decoratorsForType;\n }\n let decoratorsForKey = decoratorsForType === null || decoratorsForType === void 0 ? void 0 : decoratorsForType[key];\n if (!decoratorsForKey) {\n decoratorsForKey = [];\n decoratorsForType[key] = decoratorsForKey;\n }\n decoratorsForKey.push(decorator);\n // @ts-ignore\n return decorator(object, key, ...otherArgs);\n});\nconst decorate = (decorator) => ((...args) => {\n if (args.length === 1)\n return decorateClass(decorator)(args[0]);\n return decorateMember(decorator)(...args);\n});\n\nfunction Mixin(...constructors) {\n var _a, _b, _c;\n const prototypes = constructors.map(constructor => constructor.prototype);\n // Here we gather up the init functions of the ingredient prototypes, combine them into one init function, and\n // attach it to the mixed class prototype. The reason we do this is because we want the init functions to mix\n // similarly to constructors -- not methods, which simply override each other.\n const initFunctionName = settings.initFunction;\n if (initFunctionName !== null) {\n const initFunctions = prototypes\n .map(proto => proto[initFunctionName])\n .filter(func => typeof func === 'function');\n const combinedInitFunction = function (...args) {\n for (let initFunction of initFunctions)\n initFunction.apply(this, args);\n };\n const extraProto = { [initFunctionName]: combinedInitFunction };\n prototypes.push(extraProto);\n }\n function MixedClass(...args) {\n for (const constructor of constructors)\n // @ts-ignore: potentially abstract class\n copyProps(this, new constructor(...args));\n if (initFunctionName !== null && typeof this[initFunctionName] === 'function')\n this[initFunctionName].apply(this, args);\n }\n MixedClass.prototype = settings.prototypeStrategy === 'copy'\n ? hardMixProtos(prototypes, MixedClass)\n : softMixProtos(prototypes, MixedClass);\n Object.setPrototypeOf(MixedClass, settings.staticsStrategy === 'copy'\n ? hardMixProtos(constructors, null, ['prototype'])\n : proxyMix(constructors, Function.prototype));\n let DecoratedMixedClass = MixedClass;\n if (settings.decoratorInheritance !== 'none') {\n const classDecorators = settings.decoratorInheritance === 'deep'\n ? deepDecoratorSearch(...constructors)\n : directDecoratorSearch(...constructors);\n for (let decorator of (_a = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a !== void 0 ? _a : [])\n DecoratedMixedClass = decorator(DecoratedMixedClass);\n applyPropAndMethodDecorators((_b = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.static) !== null && _b !== void 0 ? _b : {}, DecoratedMixedClass);\n applyPropAndMethodDecorators((_c = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.instance) !== null && _c !== void 0 ? _c : {}, DecoratedMixedClass.prototype);\n }\n registerMixins(DecoratedMixedClass, constructors);\n return DecoratedMixedClass;\n}\nconst applyPropAndMethodDecorators = (propAndMethodDecorators, target) => {\n const propDecorators = propAndMethodDecorators.property;\n const methodDecorators = propAndMethodDecorators.method;\n if (propDecorators)\n for (let key in propDecorators)\n for (let decorator of propDecorators[key])\n decorator(target, key);\n if (methodDecorators)\n for (let key in methodDecorators)\n for (let decorator of methodDecorators[key])\n decorator(target, key, Object.getOwnPropertyDescriptor(target, key));\n};\n/**\n * A decorator version of the `Mixin` function. You'll want to use this instead of `Mixin` for mixing generic classes.\n */\nconst mix = (...ingredients) => decoratedClass => {\n // @ts-ignore\n const mixedClass = Mixin(...ingredients.concat([decoratedClass]));\n Object.defineProperty(mixedClass, 'name', {\n value: decoratedClass.name,\n writable: false,\n });\n return mixedClass;\n};\n\nexport { Mixin, decorate, hasMixin, mix, settings };\n","export enum GeometryType {\n Point = 'Point',\n LineString = 'LineString',\n LinearRing = 'LinearRing',\n Polygon = 'Polygon',\n MultiPoint = 'MultiPoint',\n MultiLineString = 'MultiLineString',\n MultiPolygon = 'MultiPolygon',\n GeometryCollection = 'GeometryCollection',\n Circle = 'Circle'\n}\n\nexport enum TransactionType {\n Insert = 'insert',\n Delete = 'delete',\n Update = 'update'\n}\n","import Map from 'ol/Map';\nimport { FeatureLike } from 'ol/Feature';\n\nimport WfsLayer from '../WfsLayer';\nimport WmsLayer from '../WmsLayer';\nimport { IWfstLayersList } from '../@types';\n\nlet map: Map;\nlet layerToInsertElements: WfsLayer | WmsLayer = null;\nlet mode = null;\n\nexport enum Modes {\n Edit = 'EDIT',\n Draw = 'DRAW'\n}\n\nexport function activateMode(m: Modes = null) {\n mode = m;\n}\n\nexport function getMode() {\n return mode;\n}\n\nconst editedFeatures: Set<string> = new Set();\nconst mapLayers: IWfstLayersList = {};\n\nexport function setMap(m: Map) {\n map = m;\n}\n\nexport function getMap(): Map {\n return map;\n}\n\nexport function setActiveLayerToInsertEls(layer: WmsLayer | WfsLayer) {\n layerToInsertElements = layer;\n}\n\nexport function getActiveLayerToInsertEls(): WmsLayer | WfsLayer {\n return layerToInsertElements;\n}\n\nexport function setMapLayers(data) {\n Object.assign(mapLayers, data);\n}\n\nexport function getStoredMapLayers(): IWfstLayersList {\n return mapLayers;\n}\n\nexport function getStoredLayer(layerName: string): WfsLayer | WmsLayer {\n return getStoredMapLayers()[layerName];\n}\n\nexport function addFeatureToEditedList(feature: FeatureLike): void {\n editedFeatures.add(String(feature.getId()));\n}\n\nexport function removeFeatureFromEditList(feature: FeatureLike): void {\n editedFeatures.delete(String(feature.getId()));\n}\n\nexport function isFeatureEdited(feature: FeatureLike): boolean {\n return editedFeatures.has(String(feature.getId()));\n}\n","import { Feature } from 'ol';\nimport { Geometry } from 'ol/geom';\nimport { TransactionResponse } from 'ol/format/WFS';\nimport Layer from 'ol/layer/Base';\n\nimport Geoserver from '../../Geoserver';\nimport { IGeoserverDescribeFeatureType } from '../../@types';\nimport { GeometryType, TransactionType } from '../../@enums';\nimport { I18N } from '../i18n';\nimport { getMap } from '../state';\n\n/**\n * Base class from which all layer types are derived.\n */\nexport default class BaseLayer extends Layer {\n /**\n * @private\n */\n _init(): void {\n const geoserver = this.getGeoserver() as Geoserver;\n\n if (geoserver.isLoaded()) {\n this.getAndUpdateDescribeFeatureType();\n } else {\n geoserver.on('change:capabilities', () => {\n this.getAndUpdateDescribeFeatureType();\n });\n }\n }\n\n /**\n * Request and store data layers obtained by DescribeFeatureType\n *\n * @public\n */\n async getAndUpdateDescribeFeatureType(): Promise<void> {\n const layerName = this.get(BaseLayerProperty.NAME);\n const layerLabel = this.get(BaseLayerProperty.LABEL);\n\n try {\n const geoserver = this.getGeoserver() as Geoserver;\n\n const params = new URLSearchParams({\n service: 'wfs',\n version: geoserver.getAdvanced().describeFeatureTypeVersion,\n request: 'DescribeFeatureType',\n typeName: layerName,\n outputFormat: 'application/json',\n exceptions: 'application/json'\n });\n\n const url_fetch = geoserver.getUrl() + '?' + params.toString();\n\n const response = await fetch(url_fetch, {\n headers: geoserver.getHeaders(),\n credentials: geoserver.getCredentials()\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n const data: IGeoserverDescribeFeatureType = await response.json();\n\n if (!data) {\n throw new Error('');\n }\n\n const targetNamespace = data.targetNamespace;\n const properties = data.featureTypes[0].properties;\n\n // Find the geometry field\n const geom = properties.find((el) => el.type.indexOf('gml:') >= 0);\n\n data._parsed = {\n namespace: targetNamespace,\n properties: properties,\n geomType: geom.localType as GeometryType,\n geomField: geom.name\n };\n\n this.set(BaseLayerProperty.DESCRIBEFEATURETYPE, data);\n } catch (err) {\n console.error(err);\n throw new Error(`${I18N.errors.layer} \"${layerLabel}\"`);\n }\n }\n\n /**\n * @public\n * @returns\n */\n isVisibleByZoom(): boolean {\n return getMap().getView().getZoom() > this.getMinZoom();\n }\n\n /**\n *\n * @param mode\n * @param features\n * @public\n */\n async transactFeatures(\n mode: TransactionType,\n features: Array<Feature<Geometry>> | Feature<Geometry>\n ): Promise<TransactionResponse | false> {\n const geoserver = this.getGeoserver() as Geoserver;\n return geoserver.transact(\n mode,\n features,\n this.get(BaseLayerProperty.NAME)\n );\n }\n\n async insertFeatures(\n features: Array<Feature<Geometry>> | Feature<Geometry>\n ): Promise<TransactionResponse | false> {\n return this.transactFeatures(TransactionType.Insert, features);\n }\n\n /**\n * @public\n * @param featureId\n * @returns\n */\n async maybeLockFeature(featureId: string | number): Promise<string> {\n const geoserver = this.getGeoserver() as Geoserver;\n\n if (geoserver.getUseLockFeature() && geoserver.hasLockFeature()) {\n return await geoserver.lockFeature(\n featureId,\n this.get(BaseLayerProperty.NAME)\n );\n }\n return null;\n }\n\n /**\n *\n * @returns\n * @public\n */\n getGeoserver(): Geoserver {\n return this.get(BaseLayerProperty.GEOSERVER);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getDescribeFeatureType(): IGeoserverDescribeFeatureType {\n return this.get(BaseLayerProperty.DESCRIBEFEATURETYPE);\n }\n}\n\nexport enum BaseLayerProperty {\n NAME = 'name',\n LABEL = 'label',\n DESCRIBEFEATURETYPE = 'describeFeatureType',\n ISVISIBLE = 'isVisible',\n GEOSERVER = 'geoserver'\n}\n\nexport type BaseLayerEventTypes =\n | 'layerRendered'\n | `change:${BaseLayerProperty.DESCRIBEFEATURETYPE}`\n | `change:${BaseLayerProperty.ISVISIBLE}`;\n","import Feature from 'ol/Feature';\nimport GeoJSON from 'ol/format/GeoJSON';\nimport Geometry from 'ol/geom/Geometry';\nimport VectorSource, { Options as VSOptions } from 'ol/source/Vector';\nimport { transformExtent } from 'ol/proj';\nimport { bbox } from 'ol/loadingstrategy';\n\nimport { WfsGeoserverVendor } from '../../@types';\nimport { parseError, showError } from '../errors';\nimport { I18N } from '../i18n';\nimport { GeoServerAdvanced } from '../../Geoserver';\n\n/**\n * Layer source to retrieve WFS features from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n *\n * @extends {ol/source/Vector~VectorSource}\n * @param options\n */\nexport default class WfsSource extends VectorSource {\n public urlParams = new URLSearchParams({\n SERVICE: 'wfs',\n REQUEST: 'GetFeature',\n OUTPUTFORMAT: 'application/json',\n EXCEPTIONS: 'application/json'\n });\n\n constructor(options: WfsSourceOptions) {\n super({\n ...options,\n format: new GeoJSON(),\n loader: async (\n extent,\n resolution,\n projection,\n success,\n failure\n ) => {\n try {\n // If bbox, add extent to the request\n if (options.strategy == bbox) {\n const extentGeoServer = transformExtent(\n extent,\n projection.getCode(),\n options.geoServerAdvanced.projection\n );\n // https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n // request features using a bounding box with CRS maybe different from featureTypes native CRS\n this.urlParams.set(\n 'bbox',\n extentGeoServer.toString() +\n `,${options.geoServerAdvanced.projection}`\n );\n }\n\n const url_fetch =\n options.geoserverUrl + '?' + this.urlParams.toString();\n\n const response = await fetch(url_fetch, {\n headers: options.headers,\n credentials: options.credentials\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n const data = await response.json();\n\n if (data.exceptions) {\n throw new Error(parseError(data));\n }\n\n const features = this.getFormat().readFeatures(data, {\n featureProjection: projection.getCode(),\n dataProjection: options.geoServerAdvanced.projection\n });\n\n features.forEach((feature: Feature<Geometry>) => {\n feature.set(\n '_layerName_',\n options.name,\n /* silent = */ true\n );\n });\n\n this.addFeatures(features as Feature<Geometry>[]);\n\n success(features as Feature<Geometry>[]);\n } catch (err) {\n this.removeLoadedExtent(extent);\n\n showError(I18N.errors.geoserver, err, options.name);\n\n failure();\n }\n }\n });\n\n this.urlParams.set(\n 'version',\n options.geoServerAdvanced.getFeatureVersion\n );\n\n this.urlParams.set('typename', options.name);\n\n this.urlParams.set(\n 'srsName',\n options.geoServerAdvanced.projection.toString()\n );\n }\n}\n\n/**\n * **_[interface]_** - Parameters to create a WfsSource\n *\n * @public\n */\nexport interface WfsSourceOptions extends VSOptions {\n /**\n * Layer name in the GeoServer\n */\n name: string;\n\n /**\n * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests\n */\n geoserverUrl: string;\n\n /**\n * Advanced options for geoserver requests\n */\n geoServerAdvanced?: GeoServerAdvanced;\n\n /**\n *\n */\n geoserverVendor?: WfsGeoserverVendor;\n\n /**\n * Url headers for GeoServer requests. You can use it to add Authorization credentials\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers\n */\n headers?: HeadersInit;\n\n /**\n * Credentials for fetch requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n */\n credentials?: RequestCredentials;\n}\n","import { Feature } from 'ol';\nimport { Geometry } from 'ol/geom';\nimport VectorLayer from 'ol/layer/Vector';\nimport BaseEvent from 'ol/events/Event';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { EventsKey } from 'ol/events';\nimport { LayerRenderEventTypes } from 'ol/render/EventType';\nimport { BaseLayerObjectEventTypes } from 'ol/layer/Base';\nimport { ObjectEvent } from 'ol/Object';\nimport RenderEvent from 'ol/render/Event';\n\nimport { Mixin } from 'ts-mixer';\n\nimport BaseLayer, { BaseLayerEventTypes } from './modules/base/BaseLayer';\nimport WfsSource from './modules/base/WfsSource';\nimport { LayerOptions } from './ol-wfst';\nimport { showLoading } from './modules/loading';\nimport { TransactionType } from './@enums';\nimport { WfsGeoserverVendor } from './@types';\n\n/**\n * Layer to retrieve WFS features from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n *\n * @fires layerRendered\n * @extends {ol/layer/Vector~VectorLayer}\n * @param options\n */\nexport default class WfsLayer extends Mixin(BaseLayer, VectorLayer<WfsSource>) {\n private _loadingCount = 0;\n private _loadedCount = 0;\n\n public beforeTransactFeature: (\n feature: Feature<Geometry>,\n transaction: TransactionType\n ) => Feature<Geometry>;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n BaseLayerEventTypes | BaseLayerObjectEventTypes | 'change:source',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | LayerRenderEventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n BaseLayerEventTypes | BaseLayerObjectEventTypes | 'change:source',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | LayerRenderEventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<\n BaseLayerEventTypes | BaseLayerObjectEventTypes | 'change:source',\n ObjectEvent,\n void\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, void> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | LayerRenderEventTypes,\n void\n >;\n\n constructor(options: LayerOptions) {\n super({\n name: options.name,\n label: options.label || options.name,\n minZoom: options.minZoom,\n ...options\n });\n\n if (options.beforeTransactFeature) {\n this.beforeTransactFeature = options.beforeTransactFeature;\n }\n\n const geoserver = options.geoserver;\n\n const source = new WfsSource({\n name: options.name,\n geoserverUrl: geoserver.getUrl(),\n geoServerAdvanced: geoserver.getAdvanced(),\n ...(options.strategy && { strategy: options.strategy }),\n geoserverVendor: options.geoserverVendor\n });\n\n this._loadingCount = 0;\n this._loadedCount = 0;\n\n source.on('featuresloadstart', () => {\n this._loadingCount++;\n if (this._loadingCount === 1 && this.isVisibleByZoom()) {\n showLoading();\n }\n });\n\n source.on(['featuresloadend', 'featuresloaderror'], () => {\n this._loadedCount++;\n if (this._loadingCount === this._loadedCount) {\n this._loadingCount = 0;\n this._loadedCount = 0;\n setTimeout(() => {\n this.dispatchEvent('layerRendered');\n }, 300);\n }\n });\n\n this.setSource(source);\n\n const geoserverOptions = options.geoserverVendor as WfsGeoserverVendor;\n\n Object.keys(geoserverOptions).forEach((param) => {\n source.urlParams.set(param, geoserverOptions[param]);\n });\n }\n\n /**\n * @public\n */\n refresh() {\n const source = this.getSource();\n // Refrescamos el wms\n source.refresh();\n }\n\n /**\n * Use this to update Geoserver Wms Vendors (https://docs.geoserver.org/latest/en/user/services/wms/vendor.html)\n * and other arguements (https://docs.geoserver.org/stable/en/user/services/wms/reference.html#getmap)\n * in all the getMap requests.\n *\n * Example: you can use this to change the style of the WMS, add a custom sld, set a cql_filter, etc.\n *\n * @public\n * @param paramName\n * @param value Use `undefined` or `null` to remove the param\n * @param refresh\n */\n setCustomParam(\n paramName: string,\n value: string = null,\n refresh = true\n ): URLSearchParams {\n const source = this.getSource();\n\n if (value === undefined || value === null) {\n source.urlParams.delete(paramName);\n } else {\n source.urlParams.set(paramName, value);\n }\n\n if (refresh) {\n this.refresh();\n }\n\n return source.urlParams;\n }\n}\n","import TileWMS, { Options as TSOptions } from 'ol/source/TileWMS';\nimport TileState from 'ol/TileState';\nimport { ImageTile } from 'ol';\nimport { ObjectEvent } from 'ol/Object';\n\nimport { WmsGeoserverVendor } from '../../@types';\nimport { parseError, showError } from '../errors';\nimport { I18N } from '../i18n';\nimport { GeoServerAdvanced } from '../../Geoserver';\n\n/**\n * Layer source to retrieve WMS information from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wms/reference.html\n *\n * @extends {ol/source/TieWMS~TileWMS}\n * @param options\n */\nexport default class WmsSource extends TileWMS {\n constructor(options: WmsSourceOptions) {\n super({\n url: options.geoserverUrl,\n serverType: 'geoserver',\n params: {\n SERVICE: 'wms',\n TILED: true,\n LAYERS: options.name,\n EXCEPTIONS: 'application/json',\n ...(options.geoserverVendor && options.geoserverVendor)\n },\n tileLoadFunction: async (tile, src) => {\n const blobToJson = (blob: Blob): any => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onloadend = () =>\n resolve(JSON.parse(reader.result as string));\n reader.readAsText(blob);\n });\n };\n\n try {\n const response = await fetch(src, {\n headers: options.headers,\n credentials: options.credentials\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n let data = await response.blob();\n\n // Check if the response has an error\n if (data.type == 'application/json') {\n const parsedError = await blobToJson(data);\n throw new Error(parseError(parsedError));\n }\n\n ((tile as ImageTile).getImage() as HTMLImageElement).src =\n URL.createObjectURL(data);\n\n tile.setState(TileState.LOADED);\n } catch (err) {\n showError(I18N.errors.geoserver, err, options.name);\n tile.setState(TileState.ERROR);\n }\n },\n ...options\n });\n }\n}\n\n/**\n * **_[interface]_** - Parameters to create a WmsSource\n *\n * @public\n */\nexport interface WmsSourceOptions extends Omit<TSOptions, 'params'> {\n /**\n * Layer name in the GeoServer\n */\n name: string;\n\n /**\n * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests\n */\n geoserverUrl: string;\n\n /**\n * Advanced options for geoserver requests\n */\n geoServerAdvanced?: GeoServerAdvanced;\n\n /**\n *\n */\n geoserverVendor?: WmsGeoserverVendor;\n\n /**\n * Url headers for GeoServer requests. You can use it to add Authorization credentials\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers\n */\n headers?: HeadersInit;\n\n /**\n * Credentials for fetch requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n */\n credentials?: RequestCredentials;\n}\n","import TileLayer from 'ol/layer/Tile';\nimport { Geometry } from 'ol/geom';\nimport { Feature, MapBrowserEvent } from 'ol';\nimport { GeoJSON } from 'ol/format';\nimport BaseEvent from 'ol/events/Event';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { EventsKey } from 'ol/events';\nimport { LayerRenderEventTypes } from 'ol/render/EventType';\nimport { BaseLayerObjectEventTypes } from 'ol/layer/Base';\nimport { ObjectEvent } from 'ol/Object';\nimport RenderEvent from 'ol/render/Event';\n\nimport WmsSource from './modules/base/WmsSource';\nimport BaseLayer, { BaseLayerEventTypes } from './modules/base/BaseLayer';\nimport { LayerOptions } from './ol-wfst';\nimport { showLoading } from './modules/loading';\nimport { TransactionType } from './@enums';\nimport { showError } from './modules/errors';\nimport { I18N } from './modules/i18n';\nimport { getMap } from './modules/state';\nimport { Mixin } from 'ts-mixer';\nimport { WmsGeoserverVendor } from './@types';\n\n/**\n * Layer to retrieve WMS information from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wms/reference.html\n *\n * @fires layerRendered\n * @extends {ol/layer/Tile~TileLayer}\n * @param options\n */\nexport default class WmsLayer extends Mixin(BaseLayer, TileLayer<WmsSource>) {\n private _loadingCount = 0;\n private _loadedCount = 0;\n\n public beforeTransactFeature: (\n feature: Feature<Geometry>,\n transaction: TransactionType\n ) => Feature<Geometry>;\n\n // Formats\n private _formatGeoJSON: GeoJSON;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError'\n | LayerRenderEventTypes,\n EventsKey\n >;\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError'\n | LayerRenderEventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError',\n ObjectEvent,\n void\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, void> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError'\n | LayerRenderEventTypes,\n void\n >;\n\n constructor(options: LayerOptions) {\n super({\n name: options.name,\n label: options.label || options.name,\n minZoom: options.minZoom,\n ...options\n });\n\n if (options.beforeTransactFeature) {\n this.beforeTransactFeature = options.beforeTransactFeature;\n }\n\n this._formatGeoJSON = new GeoJSON();\n\n const geoserver = options.geoserver;\n\n const source = new WmsSource({\n name: options.name,\n geoserverUrl: geoserver.getUrl(),\n geoServerAdvanced: geoserver.getAdvanced(),\n geoserverVendor: options.geoserverVendor as WmsGeoserverVendor\n });\n\n this._loadingCount = 0;\n this._loadedCount = 0;\n\n source.on('tileloadstart', () => {\n this._loadingCount++;\n if (this._loadingCount === 1 && this.isVisibleByZoom()) {\n showLoading();\n }\n });\n\n source.on(['tileloadend', 'tileloaderror'], () => {\n this._loadedCount++;\n if (this._loadingCount === this._loadedCount) {\n this._loadingCount = 0;\n this._loadedCount = 0;\n setTimeout(() => {\n this.dispatchEvent('layerRendered');\n }, 300);\n }\n });\n\n this.setSource(source);\n }\n\n /**\n * Get the features on the click area\n * @param evt\n * @returns\n * @private\n */\n async _getFeaturesByClickEvent(\n evt: MapBrowserEvent<UIEvent>\n ): Promise<Feature<Geometry>[]> {\n const coordinate = evt.coordinate;\n\n const view = getMap().getView();\n\n // Si la vista es lejana, disminumos el buffer\n // Si es cercana, lo aumentamos, por ejemplo, para podeer clickear los vectores\n // y mejorar la sensibilidad en IOS\n const buffer = view.getZoom() > 10 ? 10 : 5;\n\n const source = this.getSource();\n\n // Fallback to support a bad name\n // https://openlayers.org/en/v5.3.0/apidoc/module-ol_source_ImageWMS-ImageWMS.html#getGetFeatureInfoUrl\n const fallbackOl5 =\n 'getFeatureInfoUrl' in source\n ? 'getFeatureInfoUrl'\n : 'getGetFeatureInfoUrl';\n\n const url = source[fallbackOl5](\n coordinate,\n view.getResolution(),\n view.getProjection().getCode(),\n {\n INFO_FORMAT: 'application/json',\n BUFFER: buffer, // Buffer es el \"hit tolerance\" para capas ráster\n FEATURE_COUNT: 1,\n EXCEPTIONS: 'application/json'\n }\n );\n\n const geoserver = this.getGeoserver();\n\n try {\n const response = await fetch(url, {\n headers: geoserver.getHeaders(),\n credentials: geoserver.getCredentials()\n });\n\n if (!response.ok) {\n throw new Error(\n `${I18N.errors.getFeatures} ${response.status}`\n );\n }\n\n const data = await response.json();\n const features = this._formatGeoJSON.readFeatures(data);\n\n return features;\n } catch (err) {\n showError(err.message, err);\n }\n }\n\n /**\n * @public\n */\n refresh() {\n const source = this.getSource();\n\n // Refrescamos el wms\n source.refresh();\n\n // Force refresh the tiles\n const params = source.getParams();\n params.t = new Date().getMilliseconds();\n source.updateParams(params);\n }\n\n /**\n * Use this to update Geoserver Wfs Vendors (https://docs.geoserver.org/latest/en/user/services/wfs/vendor.html)\n * and other arguements (https://docs.geoserver.org/stable/en/user/services/wfs/reference.html)\n * in all the getFeature requests.\n *\n * Example: you can use this to set a cql_filter, limit the numbers of features, etc.\n *\n * @public\n * @param paramName\n * @param value\n * @param refresh\n */\n setCustomParam(\n paramName: string,\n value: string = null,\n refresh = true\n ): URLSearchParams {\n const source = this.getSource();\n\n source.updateParams({\n [paramName]: value\n });\n\n if (refresh) {\n this.refresh();\n }\n\n return source.getParams();\n }\n}\n","export default function createElement(tagName, attrs = {}, ...children) {\n if (typeof tagName === 'function') return tagName(attrs, children);\n\n const elem =\n tagName === null\n ? new DocumentFragment()\n : document.createElement(tagName);\n\n Object.entries(attrs || {}).forEach(([name, value]) => {\n if (\n typeof value !== undefined &&\n value !== null &&\n value !== undefined\n ) {\n if (name.startsWith('on') && name.toLowerCase() in window)\n elem.addEventListener(name.toLowerCase().substr(2), value);\n else {\n if (name === 'className')\n elem.setAttribute('class', value.toString());\n else if (name === 'htmlFor')\n elem.setAttribute('for', value.toString());\n else elem.setAttribute(name, value.toString());\n }\n }\n });\n\n for (const child of children) {\n if (!child) continue;\n if (Array.isArray(child)) elem.append(...child);\n else {\n if (child.nodeType === undefined) elem.innerHTML += child;\n else elem.appendChild(child);\n }\n }\n return elem;\n}\n","import { Observable } from 'ol';\nimport { SelectEvent } from 'ol/interaction/Select';\n\nimport { Options, WfsLayer, WmsLayer } from '../ol-wfst';\nimport myPragma from '../myPragma';\n\nimport uploadSvg from '../assets/images/upload.svg';\nimport drawSvg from '../assets/images/draw.svg';\nimport visibilityOn from '../assets/images/visibilityOn.svg';\nimport visibilityOff from '../assets/images/visibilityOff.svg';\n\nimport { GeometryType } from '../@enums';\nimport {\n getActiveLayerToInsertEls,\n getStoredMapLayers,\n setActiveLayerToInsertEls\n} from './state';\nimport { I18N } from './i18n';\nimport Uploads from './Uploads';\nimport { BaseLayerProperty } from './base/BaseLayer';\n\n/**\n * Removes in the DOM the class of the tools\n * @private\n */\nexport const resetStateButtons = (): void => {\n const activeBtn = document.querySelector(\n '.ol-wfst--tools-control-btn.wfst--active'\n );\n if (activeBtn) {\n activeBtn.classList.remove('wfst--active');\n }\n};\n\nexport const activateModeButtons = () => {\n const btn = document.querySelector('.ol-wfst--tools-control-btn-edit');\n if (btn) {\n btn.classList.add('wfst--active');\n }\n};\n\nexport const activateDrawButton = () => {\n const btn = document.querySelector('.ol-wfst--tools-control-btn-draw');\n if (btn) {\n btn.classList.add('wfst--active');\n }\n};\n\nexport const visibleLayer = (bool = true) => {\n const btn = document.querySelector('.ol-wfst--tools-control-btn-draw');\n if (btn) {\n btn.classList.add('wfst--active');\n }\n};\n\nexport default class LayersControl extends Observable {\n protected _uploads: Uploads;\n protected _uploadFormats: Options['uploadFormats'];\n\n constructor(uploads: Uploads, uploadFormats: Options['uploadFormats']) {\n super();\n\n this._uploads = uploads;\n this._uploadFormats = uploadFormats;\n }\n\n /**\n *\n * @param layer\n * @public\n */\n addLayerEl(layer: WfsLayer | WmsLayer) {\n const container = document.querySelector(\n '.wfst--tools-control--select-layers'\n );\n\n const layerName = layer.get(BaseLayerProperty.NAME) as string;\n const checked =\n layer === getActiveLayerToInsertEls() ? { checked: 'checked' } : {};\n\n const input = (\n <input\n value={layerName}\n id={`wfst--${layerName}`}\n type=\"radio\"\n className=\"ol-wfst--tools-control-input\"\n name=\"wfst--select-layer\"\n {...checked}\n onchange={(evt) => this._layerChangeHandler(evt, layer)}\n />\n );\n\n const layerDom = (\n <div\n className={`wfst--layer-control \n ${layer.getVisible() ? 'ol-wfst--visible-on' : ''}\n ${\n layer === getActiveLayerToInsertEls()\n ? 'ol-wfst--selected-on'\n : ''\n }`}\n data-layer={layerName}\n >\n <div className=\"ol-wfst--tools-control-visible\">\n <span\n className=\"ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-on\"\n title={I18N.labels.toggleVisibility}\n onclick={(evt) => this._visibilityClickHandler(evt)}\n >\n <img src={visibilityOn} />\n </span>\n <span\n className=\"ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-off\"\n title={I18N.labels.toggleVisibility}\n onclick={(evt) => this._visibilityClickHandler(evt)}\n >\n <img src={visibilityOff} />\n </span>\n </div>\n <label htmlFor={`wfst--${layerName}`}>\n {input}\n <span\n title={layer.getDescribeFeatureType()._parsed.geomType}\n >\n {layer.get(BaseLayerProperty.LABEL)}\n </span>\n </label>\n </div>\n );\n\n container.appendChild(layerDom);\n\n if (layer === getActiveLayerToInsertEls()) {\n input.dispatchEvent(new Event('change'));\n }\n\n return layerDom;\n }\n\n /**\n * Update geom Types availibles to select for this layer\n *\n * @param layerName\n * @param geomDrawTypeSelected\n * @private\n */\n _changeStateSelect(\n layer: WmsLayer | WfsLayer,\n geomDrawTypeSelected: GeometryType = null\n ): GeometryType {\n /**\n * Set the geometry type in the select according to the geometry of\n * the layer in the geoserver and disable what does not correspond.\n *\n * @param value\n * @param options\n * @private\n */\n const setSelectState = (\n value: GeometryType,\n options: Array<string> | 'all'\n ): void => {\n Array.from(selectDraw.options).forEach(\n (option: HTMLOptionElement) => {\n option.selected = option.value === value ? true : false;\n option.disabled =\n options === 'all'\n ? false\n : options.includes(option.value)\n ? false\n : true;\n option.title = option.disabled\n ? I18N.labels.geomTypeNotSupported\n : '';\n }\n );\n };\n\n const selectDraw = document.querySelector(\n '.wfst--tools-control--select-draw'\n ) as HTMLSelectElement;\n\n let drawType: GeometryType;\n\n if (selectDraw) {\n const geomLayer = layer.getDescribeFeatureType()._parsed.geomType;\n\n if (geomDrawTypeSelected) {\n drawType = selectDraw.value as GeometryType;\n } else {\n if (geomLayer === GeometryType.GeometryCollection) {\n drawType = GeometryType.LineString; // Default drawing type for GeometryCollection\n setSelectState(drawType, 'all');\n } else if (geomLayer === GeometryType.LinearRing) {\n drawType = GeometryType.LineString; // Default drawing type for GeometryCollection\n setSelectState(drawType, [\n GeometryType.Circle,\n GeometryType.LinearRing,\n GeometryType.Polygon\n ]);\n selectDraw.value = drawType;\n } else {\n drawType = geomLayer;\n setSelectState(drawType, [geomLayer]);\n }\n }\n }\n\n return drawType;\n }\n\n _visibilityClickHandler(evt) {\n const btn = evt.currentTarget;\n const parentDiv = btn.closest('.wfst--layer-control') as HTMLElement;\n const layerName = parentDiv.dataset['layer'];\n parentDiv.classList.toggle('ol-wfst--visible-on');\n const layer = getStoredMapLayers()[layerName];\n if (parentDiv.classList.contains('ol-wfst--visible-on')) {\n layer.setVisible(true);\n } else {\n layer.setVisible(false);\n }\n }\n\n _layerChangeHandler(evt, layer) {\n const radioInput = evt.currentTarget;\n const parentDiv = radioInput.closest(\n '.wfst--layer-control'\n ) as HTMLElement;\n\n // Deselect DOM previous layer\n const selected = document.querySelector('.ol-wfst--selected-on');\n\n if (selected) selected.classList.remove('ol-wfst--selected-on');\n\n // Select this layer\n parentDiv.classList.add('ol-wfst--selected-on');\n setActiveLayerToInsertEls(layer);\n this._changeStateSelect(layer);\n }\n\n render(): HTMLElement {\n return (\n <>\n <div className=\"wfst--tools-control--head\">\n {this._uploads && (\n <div>\n <input\n id=\"ol-wfst--upload\"\n type=\"file\"\n accept={this._uploadFormats}\n onchange={(evt: InputEvent) =>\n this._uploads.process(evt)\n }\n />\n <label\n className=\"ol-wfst--tools-control-btn ol-wfst--tools-control-btn-upload\"\n htmlFor=\"ol-wfst--upload\"\n title={I18N.labels.uploadToLayer}\n >\n <img src={uploadSvg} />\n </label>\n </div>\n )}\n <div className=\"ol-wfst--tools-control-draw-cnt\">\n <button\n className=\"ol-wfst--tools-control-btn ol-wfst--tools-control-btn-draw\"\n type=\"button\"\n title={I18N.labels.addElement}\n onclick={() => {\n this.dispatchEvent('drawMode');\n }}\n >\n <img src={drawSvg} />\n </button>\n <select\n title={I18N.labels.selectDrawType}\n className=\"wfst--tools-control--select-draw\"\n onchange={(evt: SelectEvent) => {\n const selectedValue = evt.target\n .value as GeometryType;\n this._changeStateSelect(\n getActiveLayerToInsertEls(),\n selectedValue\n );\n this.dispatchEvent('changeGeom');\n }}\n >\n {[\n GeometryType.Point,\n GeometryType.MultiPoint,\n GeometryType.LineString,\n GeometryType.MultiLineString,\n GeometryType.Polygon,\n GeometryType.MultiPolygon,\n GeometryType.Circle\n ].map((type) => {\n // Show all options, but enable only the accepted ones\n return <option value={type}>{type}</option>;\n })}\n </select>\n </div>\n </div>\n <div className=\"wfst--tools-control--select-layers\"></div>\n </>\n );\n }\n}\n","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='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\";\n export default img;","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\";\n export default img;","var img = \"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\";\n export default img;","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\";\n export default img;","import VectorLayer from 'ol/layer/Vector';\nimport VectorSource from 'ol/source/Vector';\n\nlet editLayer = new VectorLayer({\n source: new VectorSource(),\n zIndex: 100\n});\n\nexport const getEditLayer = (): VectorLayer<VectorSource> => {\n return editLayer;\n};\n","// Ol\nimport {\n Geometry,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon\n} from 'ol/geom';\nimport { Feature, Observable } from 'ol';\nimport { GeoJSON, KML, WFS } from 'ol/format';\n\n// External\nimport Modal from 'modal-vanilla';\n\nimport { Options } from '../ol-wfst';\nimport { showError } from './errors';\nimport { resetStateButtons } from './LayersControl';\nimport { getEditLayer } from './editLayer';\nimport { getActiveLayerToInsertEls, getMap } from './state';\nimport { GeometryType } from '../@enums';\nimport { I18N } from './i18n';\nimport { VectorSourceEvent } from 'ol/source/Vector';\nimport { BaseLayerProperty } from './base/BaseLayer';\n\nexport default class Uploads extends Observable {\n protected _options: Options;\n\n // Formats\n protected _formatWFS: WFS;\n protected _formatGeoJSON: GeoJSON;\n protected _formatKml: KML;\n protected _xs: XMLSerializer;\n\n protected _processUpload: Options['processUpload'];\n\n constructor(options: Options) {\n super();\n\n this._options = options;\n\n this._processUpload = options.processUpload;\n\n // Formats\n this._formatWFS = new WFS();\n\n this._formatGeoJSON = new GeoJSON();\n this._formatKml = new KML({\n extractStyles: false,\n showPointNames: false\n });\n this._xs = new XMLSerializer();\n }\n\n /**\n * Parse and check geometry of uploaded files\n *\n * @param evt\n * @public\n */\n async process(evt: Event): Promise<void> {\n const map = getMap();\n const view = map.getView();\n\n const file = (evt.target as HTMLInputElement).files[0];\n\n let features: Array<Feature<Geometry>>;\n\n if (!file) {\n return;\n }\n\n const extension = file.name.split('.').pop().toLowerCase();\n\n try {\n // If the user uses a custom fucntion...\n if (this._processUpload) {\n features = this._processUpload(file);\n }\n\n // If the user functions return features, we dont process anything more\n if (!features) {\n const string = await this._fileReader(file);\n\n if (extension === 'geojson' || extension === 'json') {\n features = this._formatGeoJSON.readFeatures(string, {\n featureProjection: view.getProjection().getCode()\n });\n } else if (extension === 'kml') {\n features = this._formatKml.readFeatures(string, {\n featureProjection: view.getProjection().getCode()\n });\n } else {\n showError(I18N.errors.badFormat);\n }\n }\n\n let invalidFeaturesCount = 0;\n let validFeaturesCount = 0;\n\n const featuresToInsert: Array<Feature<Geometry>> = [];\n\n for (let feature of features) {\n // If the geometry doesn't correspond to the layer, try to fixit.\n // If we can't, don't use it\n if (!this._checkGeometry(feature)) {\n feature = this._fixGeometry(feature);\n }\n\n if (feature) {\n featuresToInsert.push(feature);\n validFeaturesCount++;\n } else {\n invalidFeaturesCount++;\n continue;\n }\n }\n\n if (!validFeaturesCount) {\n showError(I18N.errors.noValidGeometry);\n } else {\n resetStateButtons();\n\n this.dispatchEvent(\n new VectorSourceEvent(\n 'loadedFeatures',\n null,\n featuresToInsert\n )\n );\n\n const content = `\n ${I18N.labels.validFeatures}: ${validFeaturesCount}<br>\n ${\n invalidFeaturesCount\n ? `${I18N.labels.invalidFeatures}: ${invalidFeaturesCount}`\n : ''\n }`;\n\n this._initModal(content, featuresToInsert);\n }\n\n // Reset the input to allow another onChange trigger\n (evt.target as HTMLInputElement).value = null;\n } catch (err) {\n showError(I18N.errors.badFile, err);\n }\n }\n\n /**\n * Read data file\n * @param file\n * @public\n */\n async _fileReader(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.addEventListener('load', async (e) => {\n const fileData = e.target.result;\n resolve(fileData as string);\n });\n\n reader.addEventListener('error', (err) => {\n console.error('Error' + err);\n reject();\n });\n reader.readAsText(file);\n });\n }\n\n /**\n * Attemp to change the geometry feature to the layer\n * @param feature\n * @private\n */\n _fixGeometry(feature: Feature<Geometry>): Feature<Geometry> {\n // Geometry of the layer\n const geomTypeLayer =\n getActiveLayerToInsertEls().getDescribeFeatureType()._parsed\n .geomType;\n const geomTypeFeature = feature.getGeometry().getType();\n let geom: Geometry;\n\n switch (geomTypeFeature) {\n case GeometryType.Point: {\n if (geomTypeLayer === GeometryType.MultiPoint) {\n const coords = (\n feature.getGeometry() as Point\n ).getCoordinates();\n geom = new MultiPoint([coords]);\n }\n break;\n }\n\n case GeometryType.LineString:\n if (geomTypeLayer === GeometryType.MultiLineString) {\n const coords = (\n feature.getGeometry() as LineString\n ).getCoordinates();\n geom = new MultiLineString([coords]);\n }\n break;\n\n case GeometryType.Polygon:\n if (geomTypeLayer === GeometryType.MultiPolygon) {\n const coords = (\n feature.getGeometry() as Polygon\n ).getCoordinates();\n geom = new MultiPolygon([coords]);\n }\n break;\n default:\n geom = null;\n }\n\n if (!geom) {\n return null;\n }\n\n feature.setGeometry(geom);\n return feature;\n }\n\n /**\n * Check if the feature has the same geometry as the target layer\n * @param feature\n * @private\n */\n _checkGeometry(feature: Feature<Geometry>): boolean {\n // Geometry of the layer\n const geomTypeLayer =\n getActiveLayerToInsertEls().getDescribeFeatureType()._parsed\n .geomType;\n const geomTypeFeature = feature.getGeometry().getType();\n\n // This geom accepts every type of geometry\n if (geomTypeLayer === GeometryType.GeometryCollection) {\n return true;\n }\n\n return geomTypeFeature === geomTypeLayer;\n }\n\n /**\n * Confirm modal before transact to the GeoServer the features in the file\n *\n * @param content\n * @param featuresToInsert\n * @private\n */\n _initModal(\n content: string,\n featuresToInsert: Array<Feature<Geometry>>\n ): void {\n const footer = `\n <button type=\"button\" class=\"btn btn-sm btn-secondary\" data-dismiss=\"modal\">\n ${I18N.labels.cancel}\n </button>\n <button type=\"button\" class=\"btn btn-sm btn-primary\" data-action=\"save\" data-dismiss=\"modal\">\n ${I18N.labels.upload}\n </button>\n `;\n\n const modal = new Modal({\n ...this._options.modal,\n header: true,\n headerClose: false,\n title:\n I18N.labels.uploadFeatures +\n ' ' +\n getActiveLayerToInsertEls().get(BaseLayerProperty.NAME),\n content: content,\n backdrop: 'static', // Prevent close on click outside the modal\n footer: footer\n }).show();\n\n modal.on('dismiss', (modal, event) => {\n // On saving changes\n if (event.target.dataset.action === 'save') {\n this.dispatchEvent(\n new VectorSourceEvent(\n 'addedFeatures',\n null,\n featuresToInsert\n )\n );\n } else {\n // On cancel button\n getEditLayer().getSource().clear();\n }\n });\n }\n}\n","/**\n * @param target\n * @param sources\n * @returns\n */\nexport const deepObjectAssign = (target, ...sources) => {\n sources.forEach((source) => {\n Object.keys(source).forEach((key) => {\n const s_val = source[key];\n const t_val = target[key];\n target[key] =\n t_val &&\n s_val &&\n typeof t_val === 'object' &&\n typeof s_val === 'object' &&\n !Array.isArray(t_val) // Don't merge arrays\n ? deepObjectAssign(t_val, s_val)\n : s_val;\n });\n });\n return target;\n};\n","import { Feature } from 'ol';\nimport { Geometry } from 'ol/geom';\nimport { Control } from 'ol/control';\nimport { VectorSourceEvent } from 'ol/source/Vector';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport BaseEvent from 'ol/events/Event';\nimport { EventsKey } from 'ol/events';\nimport { ObjectEvent } from 'ol/Object';\nimport { Types as ObjectEventTypes } from 'ol/ObjectEventType';\n\nimport myPragma from '../myPragma';\nimport { I18N } from './i18n';\n\ntype ChangesEventTypes = 'cancel' | 'apply' | 'delete';\n\nexport default class EditControlChangesEl extends Control {\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<ChangesEventTypes, VectorSourceEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n ChangesEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<ChangesEventTypes, VectorSourceEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n ChangesEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<ChangesEventTypes, VectorSourceEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, void> &\n CombinedOnSignature<\n ChangesEventTypes | ObjectEventTypes | EventTypes,\n void\n >;\n\n constructor(feature: Feature<Geometry>) {\n super({\n element: (\n <div className=\"ol-wfst--changes-control\">\n <div className=\"ol-wfst--changes-control-el\">\n <div className=\"ol-wfst--changes-control-id\">\n <b>{I18N.labels.editMode}</b> -{' '}\n <i>{String(feature.getId())}</i>\n </div>\n <button\n type=\"button\"\n className=\"btn btn-sm btn-secondary\"\n onclick={() => {\n this.dispatchEvent(\n new VectorSourceEvent('cancel', feature)\n );\n }}\n >\n {I18N.labels.cancel}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-sm btn-primary\"\n onclick={() => {\n this.dispatchEvent(\n new VectorSourceEvent('apply', feature)\n );\n }}\n >\n {I18N.labels.apply}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-sm btn-danger-outline\"\n onclick={() => {\n this.dispatchEvent(\n new VectorSourceEvent('delete', feature)\n );\n }}\n >\n {I18N.labels.delete}\n </button>\n </div>\n </div>\n )\n });\n }\n}\n","// Ol\nimport {\n Geometry,\n GeometryCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Polygon\n} from 'ol/geom';\nimport { Circle as CircleStyle, Fill, Stroke, Style } from 'ol/style';\nimport { Feature } from 'ol';\nimport { FeatureLike } from 'ol/Feature';\nimport { Coordinate } from 'ol/coordinate';\n\nimport { GeometryType } from '../@enums';\nimport { getMode, Modes } from './state';\n\n/**\n * Master style that handles two modes on the Edit Layer:\n * - one is the basic, showing only the vertices\n * - and the other when modify is active, showing bigger vertices\n *\n * @param feature\n * @private\n */\nexport default function styleFunction(\n feature: Feature<Geometry>\n): Array<Style> {\n const getVertexs = (feature: FeatureLike) => {\n let geometry = feature.getGeometry();\n\n if (geometry instanceof GeometryCollection) {\n geometry = geometry.getGeometries()[0];\n }\n\n const coordinates = (geometry as LineString).getCoordinates();\n let flatCoordinates: Coordinate[] | number[] = null;\n\n if (\n geometry instanceof Polygon ||\n geometry instanceof MultiLineString\n ) {\n flatCoordinates = coordinates.flat(1);\n } else if (geometry instanceof MultiPolygon) {\n flatCoordinates = coordinates.flat(2);\n } else {\n flatCoordinates = coordinates;\n }\n\n if (!flatCoordinates || !flatCoordinates.length) {\n return;\n }\n\n return new MultiPoint(flatCoordinates as Coordinate[]);\n };\n\n let geometry = feature.getGeometry();\n let type = geometry.getType();\n\n if (geometry instanceof GeometryCollection) {\n geometry = geometry.getGeometries()[0];\n type = geometry.getType();\n }\n\n switch (type) {\n case GeometryType.Point:\n case GeometryType.MultiPoint:\n if (getMode() === Modes.Edit) {\n return [\n new Style({\n image: new CircleStyle({\n radius: 6,\n fill: new Fill({\n color: '#000000'\n })\n })\n }),\n new Style({\n image: new CircleStyle({\n radius: 4,\n fill: new Fill({\n color: '#ff0000'\n })\n })\n })\n ];\n } else {\n return [\n new Style({\n image: new CircleStyle({\n radius: 5,\n fill: new Fill({\n color: '#ff0000'\n })\n })\n }),\n new Style({\n image: new CircleStyle({\n radius: 2,\n fill: new Fill({\n color: '#000000'\n })\n })\n })\n ];\n }\n default:\n // If editing mode is active, show bigger vertex\n if (getMode() == Modes.Draw || getMode() == Modes.Edit) {\n return [\n new Style({\n stroke: new Stroke({\n color: 'rgba( 255, 0, 0, 1)',\n width: 4\n }),\n fill: new Fill({\n color: 'rgba(255, 0, 0, 0.7)'\n })\n }),\n new Style({\n image: new CircleStyle({\n radius: 4,\n fill: new Fill({\n color: '#ff0000'\n }),\n stroke: new Stroke({\n width: 2,\n color: 'rgba(5, 5, 5, 0.9)'\n })\n }),\n geometry: (feature) => getVertexs(feature)\n }),\n new Style({\n stroke: new Stroke({\n color: 'rgba(255, 255, 255, 0.7)',\n width: 2\n })\n })\n ];\n } else {\n return [\n new Style({\n image: new CircleStyle({\n radius: 2,\n fill: new Fill({\n color: '#000000'\n })\n }),\n geometry: (feature) => getVertexs(feature)\n }),\n new Style({\n stroke: new Stroke({\n color: '#ff0000',\n width: 4\n }),\n fill: new Fill({\n color: 'rgba(255, 0, 0, 0.7)'\n })\n })\n ];\n }\n }\n}\n","// Ol\nimport { Feature, Observable } from 'ol';\nimport { Geometry } from 'ol/geom';\n\n// External\nimport Modal from 'modal-vanilla';\n\nimport { addFeatureToEditedList, getStoredLayer } from './state';\nimport { Options } from '../ol-wfst';\nimport { I18N } from './i18n';\nimport { VectorSourceEvent } from 'ol/source/Vector';\n\n/**\n * Shows a fields form in a modal window to allow changes in the properties of the feature.\n *\n * @param feature\n * @private\n */\nexport class EditFieldsModal extends Observable {\n protected _options: Options['modal'];\n protected _modal: Modal;\n protected _feature: Feature;\n\n constructor(options: Options['modal']) {\n super();\n\n this._options = options;\n\n const footer = `\n <button type=\"button\" class=\"btn btn-sm btn-link btn-third\" data-action=\"delete\" data-dismiss=\"modal\">\n ${I18N.labels.delete}\n </button>\n <button type=\"button\" class=\"btn btn-sm btn-secondary\" data-dismiss=\"modal\">\n ${I18N.labels.cancel}\n </button>\n <button type=\"button\" class=\"btn btn-sm btn-primary\" data-action=\"save\" data-dismiss=\"modal\">\n ${I18N.labels.save}\n </button>\n `;\n\n this._modal = new Modal({\n ...this._options,\n header: true,\n headerClose: true,\n title: '',\n content: '<div></div>',\n footer: footer\n });\n\n this._modal.on('dismiss', (modal, event) => {\n // On saving changes\n if (event.target.dataset.action === 'save') {\n const inputs = modal.el.querySelectorAll('input');\n\n inputs.forEach((el: HTMLInputElement) => {\n const value = el.value;\n const field = el.name;\n this._feature.set(field, value, /*isSilent = */ true);\n });\n\n this._feature.changed();\n\n addFeatureToEditedList(this._feature);\n\n this.dispatchEvent(\n new VectorSourceEvent('save', this._feature)\n );\n } else if (event.target.dataset.action === 'delete') {\n this.dispatchEvent(\n new VectorSourceEvent('delete', this._feature)\n );\n }\n });\n }\n\n show(feature: Feature<Geometry>) {\n this._feature = feature;\n\n const title = `${I18N.labels.editElement} ${feature.getId()} `;\n\n const properties = feature.getProperties();\n const layerName = feature.get('_layerName_');\n\n // Data schema from the geoserver\n const layer = getStoredLayer(layerName);\n const dataSchema = layer.getDescribeFeatureType()._parsed.properties;\n\n let content = '<form autocomplete=\"false\">';\n Object.keys(properties).forEach((key) => {\n // If the feature field exists in the geoserver and is not added by openlayers\n const field = dataSchema.find((data) => data.name === key);\n\n if (field) {\n const typeXsd = field.type;\n let type;\n\n switch (typeXsd) {\n case 'xsd:string':\n type = 'text';\n break;\n case 'xsd:number':\n case 'xsd:int':\n type = 'number';\n break;\n case 'xsd:date-time':\n type = 'datetime';\n break;\n default:\n type = 'text';\n }\n\n if (type) {\n content += `\n <div class=\"ol-wfst--input-field-container\">\n <label class=\"ol-wfst--input-field-label\" for=\"${key}\">${key}</label>\n <input placeholder=\"NULL\" class=\"ol-wfst--input-field-input\" type=\"${type}\" name=\"${key}\" value=\"${\n properties[key] || ''\n }\">\n </div>`;\n }\n }\n });\n\n content += '</form>';\n\n this._modal._html.body.innerHTML = content;\n this._modal._html.header.innerHTML = title;\n this._modal.show();\n }\n}\n","// Ol\nimport BaseObject, { ObjectEvent } from 'ol/Object';\nimport { Types as ObjectEventTypes } from 'ol/ObjectEventType';\n\nimport { ProjectionLike } from 'ol/proj';\nimport { Circle, Geometry, GeometryCollection } from 'ol/geom';\nimport { Feature } from 'ol';\nimport { GeoJSON, KML, WFS } from 'ol/format';\nimport { State } from 'ol/source/Source';\nimport { fromCircle } from 'ol/geom/Polygon';\nimport BaseEvent from 'ol/events/Event';\n\nimport { showLoading } from './modules/loading';\nimport { showError } from './modules/errors';\nimport {\n getMap,\n getStoredLayer,\n removeFeatureFromEditList\n} from './modules/state';\nimport { getEditLayer } from './modules/editLayer';\nimport { deepObjectAssign } from './modules/helpers';\nimport { I18N } from './modules/i18n';\nimport { GeometryType, TransactionType } from './@enums';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { EventsKey } from 'ol/events';\nimport { TransactionResponse } from 'ol/format/WFS';\n\n// https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html\n// Axis ordering: latitude/longitude\nconst DEFAULT_GEOSERVER_SRS = 'EPSG:3857';\n\n/**\n * @fires change:capabilities\n * @extends {ol/Object~BaseObject}\n * @param options\n */\nexport default class Geoserver extends BaseObject {\n protected _options: GeoserverOptions;\n\n protected _countRequests: number;\n protected _insertFeatures: Array<Feature<Geometry>>;\n protected _updateFeatures: Array<Feature<Geometry>>;\n protected _deleteFeatures: Array<Feature<Geometry>>;\n\n // Formats\n protected _formatWFS: WFS;\n protected _formatGeoJSON: GeoJSON;\n protected _formatKml: KML;\n protected _xs: XMLSerializer;\n\n protected state_: State;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n GeoserverEventTypes | ObjectEventTypes,\n ObjectEvent,\n EventsKey\n > &\n CombinedOnSignature<\n GeoserverEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n GeoserverEventTypes | ObjectEventTypes,\n ObjectEvent,\n EventsKey\n > &\n CombinedOnSignature<\n GeoserverEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<GeoserverEventTypes | ObjectEventTypes, ObjectEvent, void> &\n CombinedOnSignature<\n GeoserverEventTypes | ObjectEventTypes | EventTypes,\n void\n >;\n\n constructor(options: GeoserverOptions) {\n super();\n\n const defaults = {\n url: null,\n advanced: {\n getCapabilitiesVersion: '1.3.0',\n getFeatureVersion: '1.0.0',\n describeFeatureTypeVersion: '1.1.0',\n lockFeatureVersion: '1.1.0',\n wfsTransactionVersion: '1.1.0',\n projection: DEFAULT_GEOSERVER_SRS,\n lockFeatureParams: {\n expiry: 5, // minutes\n lockId: 'GeoServer',\n releaseAction: 'SOME'\n }\n },\n headers: {},\n credentials: 'same-origin',\n useLockFeature: true\n };\n\n this._options = deepObjectAssign(defaults, options);\n\n this.setAdvanced(this._options.advanced);\n this.setHeaders(this._options.headers);\n this.setCredentials(this._options.credentials);\n this.setUrl(this._options.url);\n this.setUseLockFeature(this._options.useLockFeature);\n\n this._countRequests = 0;\n\n this._insertFeatures = [];\n this._updateFeatures = [];\n this._deleteFeatures = [];\n\n // Formats\n this._formatWFS = new WFS();\n\n this._formatGeoJSON = new GeoJSON();\n this._formatKml = new KML({\n extractStyles: false,\n showPointNames: false\n });\n this._xs = new XMLSerializer();\n\n this.getAndUpdateCapabilities();\n\n this.on('change:capabilities', () => {\n this._checkGeoserverCapabilities();\n });\n }\n\n /**\n *\n * @returns\n * @public\n */\n getCapabilities(): XMLDocument {\n return this.get(GeoserverProperty.CAPABILITIES);\n }\n\n /**\n *\n * @param url\n * @param opt_silent\n * @public\n */\n setUrl(url: string, opt_silent = false): void {\n this.set(GeoserverProperty.URL, url, opt_silent);\n }\n\n /**\n *\n * @returns\n */\n getUrl(): string {\n return this.get(GeoserverProperty.URL);\n }\n\n /**\n *\n * @param headers\n * @param opt_silent\n * @returns\n * @public\n */\n setHeaders(headers: HeadersInit = {}, opt_silent = false): void {\n return this.set(GeoserverProperty.HEADERS, headers, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getHeaders(): HeadersInit {\n return this.get(GeoserverProperty.HEADERS);\n }\n\n /**\n *\n * @param credentials\n * @param opt_silent\n * @public\n */\n setCredentials(\n credentials: RequestCredentials = null,\n opt_silent = false\n ): void {\n this.set(GeoserverProperty.CREDENTIALS, credentials, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getCredentials(): RequestCredentials {\n return this.get(GeoserverProperty.CREDENTIALS);\n }\n\n /**\n *\n * @returns\n * @public\n */\n setAdvanced(advanced: GeoServerAdvanced = {}, opt_silent = false): void {\n this.set(GeoserverProperty.ADVANCED, advanced, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getAdvanced(): GeoServerAdvanced {\n return this.get(GeoserverProperty.ADVANCED);\n }\n\n /**\n *\n * @returns\n * @public\n */\n hasTransaction(): boolean {\n return this.get(GeoserverProperty.HASTRASNACTION);\n }\n\n /**\n *\n * @returns\n * @public\n */\n hasLockFeature(): boolean {\n return this.get(GeoserverProperty.HASLOCKFEATURE);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getUseLockFeature(): boolean {\n return this.get(GeoserverProperty.USELOCKFEATURE);\n }\n\n /**\n *\n * @returns\n * @public\n */\n setUseLockFeature(useLockFeature: boolean, opt_silent = false): void {\n this.set(GeoserverProperty.USELOCKFEATURE, useLockFeature, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n isLoaded(): boolean {\n return this.get(GeoserverProperty.ISLOADED);\n }\n\n /**\n *\n * @returns\n */\n getState() {\n return this.state_;\n }\n\n /**\n * Get the capabilities from the GeoServer and check\n * all the available operations.\n *\n * @fires getcapabilities\n * @public\n */\n async getAndUpdateCapabilities(): Promise<XMLDocument> {\n try {\n const params = new URLSearchParams({\n service: 'wfs',\n version: this.getAdvanced().getCapabilitiesVersion,\n request: 'GetCapabilities',\n exceptions: 'application/json'\n });\n\n const url_fetch = this.getUrl() + '?' + params.toString();\n\n const response = await fetch(url_fetch, {\n headers: this.getHeaders(),\n credentials: this.getCredentials()\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n const data = await response.text();\n const capabilities = new window.DOMParser().parseFromString(\n data,\n 'text/xml'\n );\n\n this.set(GeoserverProperty.CAPABILITIES, capabilities);\n\n this.state_ = capabilities ? 'ready' : 'error';\n\n return capabilities;\n } catch (err) {\n console.error(err);\n const msg =\n typeof err === 'string' ? err : I18N.errors.capabilities;\n showError(msg, err);\n }\n }\n\n /**\n *\n * @private\n */\n _checkGeoserverCapabilities() {\n // Available operations in the geoserver\n const operations: HTMLCollectionOf<Element> =\n this.getCapabilities().getElementsByTagName('ows:Operation');\n\n Array.from(operations).forEach((operation) => {\n if (operation.getAttribute('name') === 'Transaction') {\n this.set(GeoserverProperty.HASTRASNACTION, true);\n } else if (operation.getAttribute('name') === 'LockFeature') {\n this.set(GeoserverProperty.HASLOCKFEATURE, true);\n } else if (\n operation.getAttribute('name') === 'DescribeFeatureType'\n ) {\n this.set(GeoserverProperty.HASDESCRIBEFEATURETYPE, true);\n }\n });\n\n if (!this.hasTransaction()) {\n throw I18N.errors.wfst;\n }\n }\n\n /**\n * Make the WFS Transactions\n *\n * @param transactionType\n * @param features\n * @param layerName\n * @private\n */\n async transact(\n transactionType: TransactionType,\n features: Array<Feature<Geometry>> | Feature<Geometry>,\n layerName: string\n ): Promise<TransactionResponse | false> {\n features = Array.isArray(features) ? features : [features];\n\n const clonedFeatures = [];\n const geoLayer = getStoredLayer(layerName);\n\n for (const feature of features) {\n let clone = this._cloneFeature(feature);\n const cloneGeom = clone.getGeometry();\n\n // Ugly fix to support GeometryCollection on GML\n // See https://github.com/openlayers/openlayers/issues/4220\n if (cloneGeom instanceof GeometryCollection) {\n this._transformGeoemtryCollectionToGeometries(\n clone,\n cloneGeom as GeometryCollection\n );\n } else if (cloneGeom instanceof Circle) {\n // Geoserver has no Support to Circles\n this._transformCircleToPolygon(clone, cloneGeom as Circle);\n }\n\n // Filters\n if (\n 'beforeTransactFeature' in geoLayer &&\n typeof geoLayer.beforeTransactFeature === 'function'\n ) {\n clone = geoLayer.beforeTransactFeature(clone, transactionType);\n }\n\n if (clone) {\n clonedFeatures.push(clone);\n }\n }\n\n if (!clonedFeatures.length) {\n showError(I18N.errors.noValidGeometry);\n return false;\n }\n\n switch (transactionType) {\n case TransactionType.Insert:\n this._insertFeatures = [\n ...this._insertFeatures,\n ...clonedFeatures\n ];\n break;\n case TransactionType.Update:\n this._updateFeatures = [\n ...this._updateFeatures,\n ...clonedFeatures\n ];\n break;\n case TransactionType.Delete:\n this._deleteFeatures = [\n ...this._deleteFeatures,\n ...clonedFeatures\n ];\n break;\n default:\n break;\n }\n\n this._countRequests++;\n const numberRequest = this._countRequests;\n\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n try {\n // Prevent fire multiples times\n if (numberRequest !== this._countRequests) {\n return;\n }\n\n let srs = getMap().getView().getProjection().getCode();\n\n // Force latitude/longitude order on transactions\n // EPSG:4326 is longitude/latitude (assumption) and is not managed correctly by GML3\n srs =\n srs === 'EPSG:4326'\n ? 'urn:x-ogc:def:crs:EPSG:4326'\n : srs;\n\n const describeFeatureType =\n geoLayer.getDescribeFeatureType()._parsed;\n\n if (!geoLayer) {\n throw new Error(I18N.errors.layerNotFound);\n }\n\n const options = {\n featureNS: describeFeatureType.namespace,\n featureType: layerName,\n srsName: srs,\n featurePrefix: null,\n nativeElements: null,\n version: this.getAdvanced().wfsTransactionVersion\n };\n\n const transaction = this._formatWFS.writeTransaction(\n this._insertFeatures,\n this._updateFeatures,\n this._deleteFeatures,\n options\n );\n\n let payload = this._xs.serializeToString(transaction);\n const geomType = describeFeatureType.geomType;\n const geomField = describeFeatureType.geomField;\n\n // Ugly fix to support GeometryCollection on GML\n // See https://github.com/openlayers/openlayers/issues/4220\n if (geomType === GeometryType.GeometryCollection) {\n if (transactionType === TransactionType.Insert) {\n payload = payload.replace(\n /<geometry>/g,\n `<geometry><MultiGeometry xmlns=\"http://www.opengis.net/gml\" srsName=\"${srs}\"><geometryMember>`\n );\n payload = payload.replace(\n /<\\/geometry>/g,\n `</geometryMember></MultiGeometry></geometry>`\n );\n } else if (transactionType === TransactionType.Update) {\n const gmemberIn = `<MultiGeometry xmlns=\"http://www.opengis.net/gml\" srsName=\"${srs}\"><geometryMember>`;\n const gmemberOut = `</geometryMember></MultiGeometry>`;\n\n payload = payload.replace(\n /(.*)(<Name>geometry<\\/Name><Value>)(.*?)(<\\/Value>)(.*)/g,\n `$1$2${gmemberIn}$3${gmemberOut}$4$5`\n );\n }\n }\n\n // Fixes geometry name, weird bug with GML:\n // The property for the geometry column is always named \"geometry\"\n if (transactionType === TransactionType.Insert) {\n payload = payload.replace(\n /<(\\/?)\\bgeometry\\b>/g,\n `<$1${geomField}>`\n );\n } else {\n payload = payload.replace(\n /<Name>geometry<\\/Name>/g,\n `<Name>${geomField}</Name>`\n );\n }\n\n // This has to be te same used before\n if (\n this.hasLockFeature &&\n this.getUseLockFeature() &&\n transactionType !== TransactionType.Insert\n ) {\n payload = payload.replace(\n `</Transaction>`,\n `<LockId>${this._options.advanced.lockFeatureParams.lockId}</LockId></Transaction>`\n );\n }\n\n const headers = {\n 'Content-Type': 'text/xml',\n ...this.getHeaders()\n };\n\n const response = await fetch(this.getUrl(), {\n method: 'POST',\n body: payload,\n headers: headers,\n credentials: this._options.credentials\n });\n\n if (!response.ok) {\n throw new Error(\n I18N.errors.transaction + ' ' + response.status\n );\n }\n\n const parseResponse =\n this._formatWFS.readTransactionResponse(\n await response.text()\n );\n\n if (!Object.keys(parseResponse).length) {\n const responseStr = await response.text();\n const findError = String(responseStr).match(\n /<ows:ExceptionText>([\\s\\S]*?)<\\/ows:ExceptionText>/\n );\n\n if (findError) {\n throw new Error(findError[1]);\n }\n }\n\n if (transactionType !== TransactionType.Delete) {\n for (const feature of features as Array<\n Feature<Geometry>\n >) {\n getEditLayer().getSource().removeFeature(feature);\n }\n }\n\n const wlayer = getStoredLayer(layerName);\n\n wlayer.refresh();\n\n showLoading(false);\n\n this._insertFeatures = [];\n this._updateFeatures = [];\n this._deleteFeatures = [];\n\n this._countRequests = 0;\n\n resolve(parseResponse);\n } catch (err) {\n showError(err.message, err);\n showLoading(false);\n this._countRequests = 0;\n reject();\n }\n }, 0);\n });\n }\n\n /**\n *\n * @param feature\n * @param geom\n * @private\n */\n _transformCircleToPolygon(feature: Feature<Geometry>, geom: Circle) {\n const geomConverted = fromCircle(geom);\n feature.setGeometry(geomConverted);\n }\n\n /**\n *\n * @param feature\n * @private\n * @param geom\n */\n _transformGeoemtryCollectionToGeometries(\n feature: Feature<Geometry>,\n geom: GeometryCollection\n ) {\n let geomConverted = geom.getGeometries()[0];\n\n if (geomConverted instanceof Circle) {\n geomConverted = fromCircle(geomConverted);\n }\n\n feature.setGeometry(geomConverted);\n }\n\n /**\n *\n * @param feature\n * @returns\n * @private\n */\n _cloneFeature(feature: Feature<Geometry>): Feature<Geometry> {\n removeFeatureFromEditList(feature);\n\n const featureProperties = feature.getProperties();\n\n delete featureProperties.boundedBy;\n delete featureProperties._layerName_;\n\n const clone = new Feature(featureProperties);\n clone.setId(feature.getId());\n\n return clone;\n }\n\n /**\n * Lock a feature in the geoserver. Useful before editing a geometry,\n * to avoid changes from multiples suers\n *\n * @param featureId\n * @param layerName\n * @param retry\n * @public\n */\n async lockFeature(\n featureId: string | number,\n layerName: string,\n retry = 0\n ): Promise<string> {\n const params = new URLSearchParams({\n service: 'wfs',\n version: this.getAdvanced().lockFeatureVersion,\n request: 'LockFeature',\n typeName: layerName,\n expiry: String(this._options.advanced.lockFeatureParams.expiry),\n LockId: this._options.advanced.lockFeatureParams.lockId,\n releaseAction:\n this._options.advanced.lockFeatureParams.releaseAction,\n exceptions: 'application/json',\n featureid: `${featureId}`\n });\n\n const url_fetch = this.getUrl() + '?' + params.toString();\n\n try {\n const response = await fetch(url_fetch, {\n headers: this._options.headers,\n credentials: this._options.credentials\n });\n\n if (!response.ok) {\n throw new Error(I18N.errors.lockFeature);\n }\n\n const data = await response.text();\n\n try {\n // First, check if is a JSON (with errors)\n const dataParsed = JSON.parse(data);\n\n if ('exceptions' in dataParsed) {\n const exceptions = dataParsed.exceptions;\n if (exceptions[0].code === 'CannotLockAllFeatures') {\n // Maybe the Feature is already blocked, ant thats trigger error, so, we try one locking more time again\n if (!retry) {\n this.lockFeature(featureId, layerName, 1);\n } else {\n showError(I18N.errors.lockFeature, exceptions);\n }\n } else {\n showError(exceptions[0].text, exceptions);\n }\n }\n } catch (err) {\n /*\n \n let dataDoc = (new window.DOMParser()).parseFromString(data, 'text/xml');\n \n let lockId = dataDoc.getElementsByTagName('wfs:LockId');\n \n let featuresLocked: HTMLCollectionOf<Element> = dataDoc.getElementsByTagName('ogc:FeatureId');\n \n for (let featureLocked of featuresLocked as any) {\n \n console.log(featureLocked.getAttribute('fid'));\n \n }\n \n */\n }\n\n return data;\n } catch (err) {\n showError(err.message, err);\n }\n }\n}\n\n/**\n * **_[interface]_**\n * @public\n */\nexport interface GeoserverOptions {\n /**\n * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests\n *\n */\n url: string;\n\n /**\n * Advanced options for geoserver requests\n *\n */\n advanced?: GeoServerAdvanced;\n\n /**\n * Http headers for GeoServer requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers\n *\n */\n headers?: HeadersInit;\n\n /**\n * Credentials for fetch requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n *\n * Default is 'same-origin'\n */\n credentials?: RequestCredentials;\n\n /**\n * Use LockFeatue request on GeoServer when selecting features. Prevents a feature from being edited\n * through a persistent feature lock. This is not always supportedd by the GeoServer.\n * See https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n */\n useLockFeature?: boolean;\n}\n\n/**\n * **_[interface]_**\n *\n * * Default values:\n * ```javascript\n * {\n * getCapabilitiesVersion: '1.3.0',\n * getFeatureVersion: '1.0.0',\n * describeFeatureTypeVersion: '1.1.0',\n * lockFeatureVersion: '1.1.0',\n * wfsTransactionVersion: '1.1.0',\n * projection: 'EPSG:3857',\n * lockFeatureParams: {\n * expiry: 5,\n * lockId: 'Geoserver',\n * releaseAction: 'SOME'\n * }\n * }\n * @public\n */\nexport interface GeoServerAdvanced {\n getCapabilitiesVersion?: string;\n getFeatureVersion?: string;\n lockFeatureVersion?: string;\n describeFeatureTypeVersion?: string;\n wfsTransactionVersion?: string;\n projection?: ProjectionLike;\n lockFeatureParams?: {\n // 5 (minutes) by default\n expiry?: number | string;\n\n // 'Geoserver' by default\n lockId?: string;\n\n // 'SOME' by default\n releaseAction?: string;\n };\n}\n\nexport enum GeoserverProperty {\n CAPABILITIES = 'capabilities',\n URL = 'url',\n HEADERS = 'headers',\n CREDENTIALS = 'credentials',\n ADVANCED = 'advanced',\n HASTRASNACTION = 'hasTransaction',\n HASLOCKFEATURE = 'hasLockFeature',\n HASDESCRIBEFEATURETYPE = 'hasDescribeFeatureType',\n USELOCKFEATURE = 'useLockFeature',\n ISLOADED = 'isLoaded'\n}\n\nexport type GeoserverEventTypes =\n | `change:${GeoserverProperty.CAPABILITIES}`\n | `change:${GeoserverProperty.URL}`\n | `change:${GeoserverProperty.HEADERS}`\n | `change:${GeoserverProperty.CREDENTIALS}`\n | `change:${GeoserverProperty.ADVANCED}`\n | `change:${GeoserverProperty.HASTRASNACTION}`\n | `change:${GeoserverProperty.HASLOCKFEATURE}`\n | `change:${GeoserverProperty.HASDESCRIBEFEATURETYPE}`\n | `change:${GeoserverProperty.USELOCKFEATURE}`\n | `change:${GeoserverProperty.ISLOADED}`;\n","import { getCenter } from 'ol/extent';\nimport { Geometry } from 'ol/geom';\nimport { Feature, Overlay } from 'ol';\nimport { Coordinate } from 'ol/coordinate';\n\n// Images\nimport editFieldsSvg from '../assets/images/editFields.svg';\nimport editGeomSvg from '../assets/images/editGeom.svg';\nimport { I18N } from './i18n';\n\nimport myPragma from '../myPragma';\n\nexport default class EditOverlay extends Overlay {\n constructor(feature: Feature<Geometry>, coordinate: Coordinate = null) {\n super({\n id: feature.getId(),\n position:\n coordinate || getCenter(feature.getGeometry().getExtent()),\n positioning: 'center-center',\n offset: [0, -40],\n stopEvent: true,\n element: (\n <div>\n <div\n className=\"ol-wfst--edit-button-cnt\"\n onclick={() => {\n this.dispatchEvent('editFields');\n }}\n >\n <button\n className=\"ol-wfst--edit-button\"\n type=\"button\"\n title={I18N.labels.editFields}\n >\n <img\n src={editFieldsSvg}\n alt={I18N.labels.editFields}\n />\n </button>\n </div>\n <div\n className=\"ol-wfst--edit-button-cnt\"\n onclick={() => {\n this.dispatchEvent('editGeom');\n }}\n >\n <button\n class=\"ol-wfst--edit-button\"\n type=\"button\"\n title={I18N.labels.editGeom}\n >\n <img src={editGeomSvg} alt={I18N.labels.editGeom} />\n </button>\n </div>\n </div>\n )\n });\n }\n}\n","var img = \"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\";\n export default img;","var img = \"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\";\n export default img;","// Ol\nimport { Geometry } from 'ol/geom';\nimport { Circle as CircleStyle, Fill, Stroke, Style } from 'ol/style';\nimport { Control } from 'ol/control';\nimport { Draw, Modify, Select, Snap } from 'ol/interaction';\nimport { EventsKey } from 'ol/events';\nimport { Collection, Feature, MapBrowserEvent, Overlay, View } from 'ol';\nimport Map from 'ol/Map';\nimport BaseEvent from 'ol/events/Event';\nimport { LoadingStrategy } from 'ol/source/Vector';\nimport { FeatureLike } from 'ol/Feature';\nimport { Options as VectorLayerOptions } from 'ol/layer/BaseVector';\nimport { Vector as VectorSource } from 'ol/source';\nimport { never, primaryAction } from 'ol/events/condition';\nimport { unByKey } from 'ol/Observable';\nimport { Coordinate } from 'ol/coordinate';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { ObjectEvent } from 'ol/Object';\nimport { Types as ObjectEventTypes } from 'ol/ObjectEventType';\n\nimport { initModal, showError } from './modules/errors';\nimport { initLoading, showLoading } from './modules/loading';\nimport WfsLayer from './WfsLayer';\nimport WmsLayer from './WmsLayer';\nimport LayersControl, {\n activateDrawButton,\n activateModeButtons,\n resetStateButtons\n} from './modules/LayersControl';\nimport Uploads from './modules/Uploads';\nimport {\n addFeatureToEditedList,\n getStoredMapLayers,\n isFeatureEdited,\n removeFeatureFromEditList,\n setActiveLayerToInsertEls,\n getActiveLayerToInsertEls,\n activateMode,\n getMode,\n Modes,\n setMap,\n setMapLayers,\n getStoredLayer\n} from './modules/state';\nimport { deepObjectAssign } from './modules/helpers';\nimport { getEditLayer } from './modules/editLayer';\nimport { GeometryType, TransactionType } from './@enums';\nimport {\n I18n,\n IGeoserverDescribeFeatureType,\n WfsGeoserverVendor,\n WmsGeoserverVendor\n} from './@types';\nimport * as i18n from './modules/i18n/index';\nimport { getDefaultOptions } from './defaults';\nimport EditControlChangesEl from './modules/EditControlChanges';\nimport styleFunction from './modules/styleFunction';\nimport { EditFieldsModal } from './modules/EditFieldsModal';\nimport Geoserver from './Geoserver';\nimport EditOverlay from './modules/EditOverlay';\nimport { BaseLayerProperty } from './modules/base/BaseLayer';\n\n// External\nimport Modal from 'modal-vanilla';\n\n// Style\nimport './assets/scss/-ol-wfst.bootstrap5.scss';\nimport './assets/scss/ol-wfst.scss';\n\nconst controlElement = document.createElement('div');\n\n/**\n * Tiny WFST-T client to insert (drawing/uploading), modify and delete\n * features on GeoServers using OpenLayers. Layers with these types\n * of geometries are supported: \"GeometryCollection\" (in this case, you can\n * choose the geometry type of each element to draw), \"Point\", \"MultiPoint\",\n * \"LineString\", \"MultiLineString\", \"Polygon\" and \"MultiPolygon\".\n *\n * @constructor\n * @fires modifystart\n * @fires modifyend\n * @fires drawstart\n * @fires drawend\n * @fires load\n * @fires describeFeatureType\n * @extends {ol/control/Control~Control}\n * @param options Wfst options, see [Wfst Options](#options) for more details.\n */\nexport default class Wfst extends Control {\n protected _options: Options;\n protected _i18n: I18n;\n\n // Ol\n protected _map: Map;\n protected _view: View;\n protected _viewport: HTMLElement;\n protected _initialized = false;\n protected _layersControl: LayersControl;\n protected _overlay: Overlay;\n\n // Interactions\n protected _interactionWfsSelect: Select;\n protected _interactionSelectModify: Select;\n protected _collectionModify: Collection<any>;\n protected _interactionModify: Modify;\n protected _interactionSnap: Snap;\n protected _interactionDraw: Draw;\n\n // Obserbable keys\n protected _keyClickWms: EventsKey | EventsKey[];\n protected _keyRemove: EventsKey;\n protected _keySelect: EventsKey;\n\n // Controls\n protected _controlApplyDiscardChanges: EditControlChangesEl;\n protected _controlWidgetToolsDiv: HTMLElement;\n protected _selectDraw: HTMLSelectElement;\n\n // State\n protected _currentZoom: number;\n protected _lastZoom: number;\n\n // Editing\n protected _editFeature: Feature<Geometry>;\n protected _editFeatureOriginal: Feature<Geometry>;\n\n protected _uploads: Uploads;\n protected _editFields: EditFieldsModal;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<WfstEventTypes, WfstEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n WfstEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<WfstEventTypes, WfstEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n WfstEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<WfstEventTypes, WfstEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, void> &\n CombinedOnSignature<\n WfstEventTypes | ObjectEventTypes | EventTypes,\n void\n >;\n\n constructor(options?: Options) {\n super({\n target: null,\n element: controlElement,\n render: () => {\n if (!this._map) this._init();\n }\n });\n\n i18n.setLang(options.language, options.i18n);\n\n const defaultOptions = getDefaultOptions();\n\n this._options = deepObjectAssign(defaultOptions, options);\n\n // By default, the first layer is ready to accept new draws\n setActiveLayerToInsertEls(this._options.layers[0]);\n\n this._controlWidgetToolsDiv = controlElement;\n this._controlWidgetToolsDiv.className = 'ol-wfst--tools-control';\n\n this._uploads = new Uploads(this._options);\n\n this._editFields = new EditFieldsModal(this._options.modal);\n }\n\n /**\n * Get all the layers in the ol-wfst instance\n * @public\n */\n getLayers(): Array<WfsLayer | WmsLayer> {\n return Object.values(getStoredMapLayers());\n }\n\n /**\n * Get a layer\n * @public\n */\n getLayerByName(layerName = ''): WfsLayer | WmsLayer {\n const layers = getStoredMapLayers();\n if (layerName && layerName in layers) {\n return layers[layerName];\n }\n return null;\n }\n\n /**\n * Connect to the GeoServer and retrieve metadata about the service (GetCapabilities).\n * Get each layer specs (DescribeFeatureType) and create the layers and map controls.\n * @fires describeFeatureType\n * @private\n */\n async _initMapAndLayers(): Promise<void> {\n try {\n const layers = this._options.layers;\n\n if (layers.length) {\n let layerRendered = 0;\n let layersNumber = 0; // Only count visibles\n\n layers.forEach((layer) => {\n if (layer.getVisible()) layersNumber++;\n\n layer.on('layerRendered', () => {\n layerRendered++;\n if (layerRendered >= layersNumber) {\n // run only once\n if (!this._initialized) {\n this.dispatchEvent('load');\n this._initialized = true;\n }\n showLoading(false);\n }\n });\n\n layer.on('change:describeFeatureType', () => {\n const domEl = this._layersControl.addLayerEl(layer);\n\n layer.on('change:isVisible', () => {\n const layerNotVisible =\n 'ol-wfst--layer-not-visible';\n\n const visible = layer.isVisibleByZoom();\n if (visible)\n domEl.classList.remove(layerNotVisible);\n else domEl.classList.add(layerNotVisible);\n });\n\n layer.set(\n BaseLayerProperty.ISVISIBLE,\n this._currentZoom > layer.getMinZoom()\n );\n\n this.dispatchEvent(\n new WfstEvent({\n type: 'describeFeatureType',\n layer: layer,\n data: layer.getDescribeFeatureType()\n })\n );\n });\n\n layer._init();\n\n this._map.addLayer(layer);\n\n setMapLayers({\n [layer.get(BaseLayerProperty.NAME)]: layer\n });\n });\n\n this._createMapElements(\n this._options.showControl,\n this._options.active\n );\n }\n } catch (err) {\n showLoading(false);\n showError(err.message, err);\n }\n }\n\n /**\n * @private\n */\n _init(): void {\n this._map = super.getMap();\n this._view = this._map.getView();\n this._viewport = this._map.getViewport();\n\n setMap(this._map);\n\n //@ts-expect-error\n this._uploads.on('addedFeatures', ({ features }) => {\n const layer = getActiveLayerToInsertEls();\n layer.insertFeatures(features);\n });\n\n //@ts-expect-error\n this._uploads.on('loadedFeatures', ({ features }) => {\n this.activateEditMode();\n const editLayerSource = getEditLayer().getSource();\n\n editLayerSource.addFeatures(features);\n\n this._view.fit(editLayerSource.getExtent(), {\n size: this._map.getSize(),\n maxZoom: 21,\n padding: [100, 100, 100, 100]\n });\n });\n\n // @ts-expect-error\n this._editFields.on('save', ({ feature }) => {\n // Force deselect to trigger handler\n this._collectionModify.remove(feature);\n });\n\n // @ts-expect-error\n this._editFields.dispose('delete', ({ feature }) => {\n this._deleteFeature(feature, true);\n });\n\n this._addMapEvents();\n\n initModal(this._options['modal']);\n\n this._controlWidgetToolsDiv.append(initLoading());\n\n this._initMapAndLayers();\n }\n\n /**\n * Create the edit layer to allow modify elements, add interactions,\n * map controls and keyboard handlers.\n *\n * @param showControl\n * @param active\n * @private\n */\n async _createMapElements(\n showControl: boolean,\n active: boolean\n ): Promise<void> {\n // VectorLayer to store features on editing and inserting\n this._prepareEditLayer();\n\n this._addInteractions();\n this._addInteractionHandlers();\n\n if (showControl) {\n this._addMapControl();\n }\n\n // By default, init in edit mode\n this.activateEditMode(active);\n }\n\n /**\n * @private\n */\n _addInteractions(): void {\n /**\n * Select the wfs feature already downloaded\n * @private\n */\n const prepareWfsInteraction = () => {\n this._collectionModify = new Collection();\n\n // Interaction to select wfs layer elements\n this._interactionWfsSelect = new Select({\n hitTolerance: 10,\n style: (feature: Feature<Geometry>) => styleFunction(feature),\n toggleCondition: never, // Prevent add features to the current selection using shift\n filter: (feature, layer) => {\n return (\n getMode() !== Modes.Edit &&\n layer &&\n layer instanceof WfsLayer &&\n layer === getActiveLayerToInsertEls()\n );\n }\n });\n\n this._map.addInteraction(this._interactionWfsSelect);\n\n this._interactionWfsSelect.on(\n 'select',\n ({ selected, deselected, mapBrowserEvent }) => {\n const coordinate = mapBrowserEvent.coordinate;\n\n if (selected.length) {\n selected.forEach((feature) => {\n if (!isFeatureEdited(feature)) {\n // Remove the feature from the original layer\n const layer =\n this._interactionWfsSelect.getLayer(\n feature\n );\n layer.getSource().removeFeature(feature);\n this._addFeatureToEditMode(\n feature,\n coordinate,\n layer.get(BaseLayerProperty.NAME)\n );\n }\n });\n }\n\n if (deselected.length) {\n if (getMode() !== Modes.Edit) {\n deselected.forEach((feature) => {\n // Trigger deselect\n // This is necessary for those times where two features overlap.\n this._collectionModify.remove(feature);\n });\n }\n }\n }\n );\n };\n\n /**\n * Call the geoserver to get the clicked feature\n * @private\n */\n const prepareWmsInteraction = (): void => {\n // Interaction to allow select features in the edit layer\n this._interactionSelectModify = new Select({\n style: (feature: Feature<Geometry>) => styleFunction(feature),\n layers: [getEditLayer()],\n toggleCondition: never, // Prevent add features to the current selection using shift\n removeCondition: () => (getMode() === Modes.Edit ? true : false) // Prevent deselect on clicking outside the feature\n });\n\n this._map.addInteraction(this._interactionSelectModify);\n\n this._collectionModify =\n this._interactionSelectModify.getFeatures();\n\n this._keyClickWms = this._map.on(\n this._options.evtType,\n async (evt: MapBrowserEvent<MouseEvent>) => {\n if (this._map.hasFeatureAtPixel(evt.pixel)) {\n return;\n }\n\n // Only get other features if editmode is disabled\n if (getMode() !== Modes.Edit) {\n const layer = getActiveLayerToInsertEls();\n\n // If layer is hidden or is a wfs, skip\n if (\n !layer.getVisible() ||\n !layer.isVisibleByZoom() ||\n layer instanceof WfsLayer\n ) {\n return;\n }\n\n const features = await layer._getFeaturesByClickEvent(\n evt\n );\n\n if (!features.length) {\n return;\n }\n\n // For now, support is only for one feature at time\n this._addFeatureToEditMode(\n features[0],\n evt.coordinate,\n layer.get(BaseLayerProperty.NAME)\n );\n }\n }\n );\n };\n\n if (this._options.layers.find((layer) => layer instanceof WfsLayer)) {\n prepareWfsInteraction();\n }\n\n if (this._options.layers.find((layer) => layer instanceof WmsLayer)) {\n prepareWmsInteraction();\n }\n\n this._interactionModify = new Modify({\n style: () => {\n if (getMode() === Modes.Edit) {\n return new Style({\n image: new CircleStyle({\n radius: 6,\n fill: new Fill({\n color: '#ff0000'\n }),\n stroke: new Stroke({\n width: 2,\n color: 'rgba(5, 5, 5, 0.9)'\n })\n })\n });\n } else {\n return;\n }\n },\n features: this._collectionModify,\n condition: (evt) => {\n return primaryAction(evt) && getMode() === Modes.Edit;\n }\n });\n\n this._map.addInteraction(this._interactionModify);\n\n this._interactionSnap = new Snap({\n source: getEditLayer().getSource()\n });\n this._map.addInteraction(this._interactionSnap);\n }\n\n /**\n * Layer to store temporary the elements to be edited\n * @private\n */\n _prepareEditLayer(): void {\n this._map.addLayer(getEditLayer());\n }\n\n /**\n * @private\n */\n _addMapEvents(): void {\n /**\n * @private\n */\n const keyboardEvents = (): void => {\n document.addEventListener('keydown', ({ key }) => {\n const inputFocus = document.querySelector('input:focus');\n if (inputFocus) {\n return;\n }\n if (key === 'Delete') {\n const selectedFeatures = this._collectionModify;\n if (selectedFeatures) {\n selectedFeatures.forEach((feature) => {\n this._deleteFeature(feature, true);\n });\n }\n }\n });\n };\n\n keyboardEvents();\n\n this._map.on('moveend', (): void => {\n this._currentZoom = this._view.getZoom();\n\n if (this._currentZoom !== this._lastZoom) {\n const layers = getStoredMapLayers();\n\n Object.keys(layers).forEach((key) => {\n const layer = layers[key];\n if (this._currentZoom > layer.getMinZoom()) {\n // Show the layers\n if (!layer.get(BaseLayerProperty.ISVISIBLE)) {\n layer.set(BaseLayerProperty.ISVISIBLE, true);\n }\n } else {\n // Hide the layer\n if (layer.get(BaseLayerProperty.ISVISIBLE)) {\n layer.set(BaseLayerProperty.ISVISIBLE, false);\n }\n }\n });\n\n this._lastZoom = this._currentZoom;\n }\n });\n }\n\n /**\n * Add map handlers\n * @private\n */\n _addInteractionHandlers(): void {\n // When a feature is modified, add this to a list.\n // This prevent events fired on select and deselect features that has no changes and should\n // not be updated in the geoserver\n this._interactionModify.on('modifyend', (evt) => {\n const feature = evt.features.item(0);\n addFeatureToEditedList(feature);\n super.dispatchEvent(evt);\n });\n\n this._interactionModify.on('modifystart', (evt) => {\n super.dispatchEvent(evt);\n });\n\n this._onDeselectFeatureEvent();\n this._onRemoveFeatureEvent();\n }\n\n /**\n * Add the widget on the map to allow change the tools and select active layers\n * @private\n */\n _addMapControl(): void {\n this._layersControl = new LayersControl(\n this._options.showUpload ? this._uploads : null,\n this._options.uploadFormats\n );\n\n // @ts-expect-error\n this._layersControl.on('drawMode', () => {\n if (getMode() === Modes.Draw) {\n resetStateButtons();\n this.activateEditMode();\n } else {\n const activeLayer = getActiveLayerToInsertEls();\n\n if (!activeLayer.isVisibleByZoom()) {\n showError(i18n.I18N.errors.layerNotVisible);\n } else {\n this.activateDrawMode(getActiveLayerToInsertEls());\n }\n }\n });\n\n // @ts-expect-error\n this._layersControl.on('changeGeom', () => {\n if (getMode() === Modes.Draw) {\n this.activateDrawMode(getActiveLayerToInsertEls());\n }\n });\n\n const controlEl = this._layersControl.render();\n\n this._selectDraw = controlEl.querySelector(\n '.wfst--tools-control--select-draw'\n );\n\n this._controlWidgetToolsDiv.append(controlEl);\n }\n\n /**\n *\n * @param feature\n * @private\n */\n _deselectEditFeature(feature: FeatureLike): void {\n this._removeOverlayHelper(feature);\n }\n\n /**\n *\n * @param feature\n * @param layerName\n * @private\n */\n _restoreFeatureToLayer(\n feature: Feature<Geometry>,\n layerName?: string\n ): void {\n layerName = layerName || feature.get('_layerName_');\n const layer = getStoredMapLayers()[layerName];\n (layer.getSource() as VectorSource<Geometry>).addFeature(feature);\n }\n\n /**\n * @param feature\n * @private\n */\n _removeFeatureFromTmpLayer(feature: Feature<Geometry>): void {\n // Remove element from the Layer\n getEditLayer().getSource().removeFeature(feature);\n }\n\n /**\n * Trigger on deselecting a feature from in the Edit layer\n *\n * @private\n */\n _onDeselectFeatureEvent(): void {\n const checkIfFeatureIsChanged = (feature: Feature<Geometry>): void => {\n const layerName = feature.get('_layerName_');\n\n const layer = this._options.layers.find(\n (layer) => layer.get(BaseLayerProperty.NAME) === layerName\n );\n\n if (layer instanceof WfsLayer) {\n this._interactionWfsSelect.getFeatures().remove(feature);\n }\n\n if (isFeatureEdited(feature)) {\n layer.transactFeatures(TransactionType.Update, feature);\n } else {\n // Si es wfs y el elemento no tuvo cambios, lo devolvemos a la layer original\n if (layer instanceof WfsLayer) {\n this._restoreFeatureToLayer(feature, layerName);\n }\n this._removeFeatureFromTmpLayer(feature);\n }\n };\n\n // This is fired when a feature is deselected and fires the transaction process\n this._keySelect = this._collectionModify.on('remove', (evt) => {\n const feature = evt.element;\n\n this._deselectEditFeature(feature);\n\n checkIfFeatureIsChanged(feature);\n\n this._editModeOff();\n });\n }\n\n /**\n * Trigger on removing a feature from the Edit layer\n *\n * @private\n */\n _onRemoveFeatureEvent(): void {\n // If a feature is removed from the edit layer\n this._keyRemove = getEditLayer()\n .getSource()\n .on('removefeature', (evt) => {\n const feature = evt.feature;\n\n if (!feature.get('_delete_')) {\n return;\n }\n\n if (this._keySelect) {\n unByKey(this._keySelect);\n }\n\n const layerName = feature.get('_layerName_');\n\n const ll = this.getLayerByName(layerName);\n\n ll.transactFeatures(TransactionType.Delete, feature);\n\n this._deselectEditFeature(feature);\n this._editModeOff();\n\n if (this._keySelect) {\n setTimeout(() => {\n this._onDeselectFeatureEvent();\n }, 150);\n }\n });\n }\n\n /**\n *\n * @param feature\n * @private\n */\n _editModeOn(feature: Feature<Geometry>): void {\n this._editFeatureOriginal = feature.clone();\n\n activateMode(Modes.Edit);\n\n // To refresh the style\n getEditLayer().getSource().changed();\n\n this._removeOverlayHelper(feature);\n\n this._controlApplyDiscardChanges = new EditControlChangesEl(feature);\n\n this._controlApplyDiscardChanges.on('cancel', ({ feature }) => {\n feature.setGeometry(this._editFeatureOriginal.getGeometry());\n removeFeatureFromEditList(feature);\n this._collectionModify.remove(feature);\n });\n\n this._controlApplyDiscardChanges.on('apply', ({ feature }) => {\n showLoading();\n this._collectionModify.remove(feature);\n });\n\n this._controlApplyDiscardChanges.on('delete', ({ feature }) => {\n this._deleteFeature(feature, true);\n });\n\n this._map.addControl(this._controlApplyDiscardChanges);\n }\n\n /**\n * @private\n */\n _editModeOff(): void {\n activateMode(null);\n this._map.removeControl(this._controlApplyDiscardChanges);\n }\n\n /**\n * Remove a feature from the edit Layer and from the Geoserver\n *\n * @param feature\n * @private\n */\n _deleteFeature(feature: Feature<Geometry>, confirm: boolean): void {\n const deleteEl = () => {\n const features = Array.isArray(feature) ? feature : [feature];\n features.forEach((feature) => {\n feature.set('_delete_', true, true);\n getEditLayer().getSource().removeFeature(feature);\n });\n this._collectionModify.clear();\n\n const layerName = feature.get('_layerName_');\n const layer = this._options.layers.find(\n (layer) => layer.get(BaseLayerProperty.NAME) === layerName\n );\n\n if (layer instanceof WfsLayer) {\n this._interactionWfsSelect.getFeatures().remove(feature);\n }\n };\n\n if (confirm) {\n const confirmModal = Modal.confirm(i18n.I18N.labels.confirmDelete, {\n ...this._options.modal\n });\n\n confirmModal.show().once('dismiss', function (modal, ev, button) {\n if (button && button.value) {\n deleteEl();\n }\n });\n } else {\n deleteEl();\n }\n }\n\n /**\n * Add a feature to the Edit Layer to allow editing, and creates an Overlay Helper to show options\n *\n * @param feature\n * @param coordinate\n * @param layerName\n * @private\n */\n _addFeatureToEditMode(\n feature: Feature<Geometry>,\n coordinate: Coordinate = null,\n layerName = null\n ): void {\n // For now, only allow one element at time\n // @TODO: allow edit multiples elements\n if (this._collectionModify.getLength()) return;\n\n if (layerName) {\n // Store the layer information inside the feature\n feature.set('_layerName_', layerName);\n }\n\n const props = feature ? feature.getProperties() : '';\n\n if (props) {\n if (feature.getGeometry()) {\n getEditLayer().getSource().addFeature(feature);\n this._collectionModify.push(feature);\n\n const overlay = new EditOverlay(feature, coordinate);\n\n // @ts-expect-error\n overlay.on('editFields', () => {\n this._editFields.show(feature);\n });\n\n // @ts-expect-error\n overlay.on('editGeom', () => {\n this._editModeOn(feature);\n });\n\n this._map.addOverlay(overlay);\n\n const layer = getStoredLayer(layerName);\n if (layer) {\n layer.maybeLockFeature(feature.getId());\n }\n }\n }\n }\n\n /**\n * Activate/deactivate the draw mode\n *\n * @param layer\n * @public\n */\n activateDrawMode(layer: WfsLayer | WmsLayer | false): void {\n /**\n *\n * @param layer\n * @private\n */\n const addDrawInteraction = (layer: WfsLayer | WmsLayer): void => {\n this.activateEditMode(false);\n\n // If already exists, remove\n if (this._interactionDraw) {\n this._map.removeInteraction(this._interactionDraw);\n }\n\n const geomDrawType = this._selectDraw.value;\n\n this._interactionDraw = new Draw({\n source: getEditLayer().getSource(),\n type: geomDrawType as GeometryType,\n style: (feature: Feature<Geometry>) => styleFunction(feature),\n stopClick: true // To prevent firing a map/wms click\n });\n\n this._map.addInteraction(this._interactionDraw);\n\n this._interactionDraw.on('drawstart', (evt) => {\n super.dispatchEvent(evt);\n });\n\n this._interactionDraw.on('drawend', (evt) => {\n const feature: Feature<Geometry> = evt.feature;\n layer.transactFeatures(TransactionType.Insert, feature);\n super.dispatchEvent(evt);\n });\n };\n\n if (!this._interactionDraw && !layer) {\n return;\n }\n\n if (layer) {\n // If layer is set to invisible, show warning\n if (!layer.getVisible()) {\n return;\n }\n\n activateDrawButton();\n\n this._viewport.classList.add('draw-mode');\n\n addDrawInteraction(layer);\n } else {\n this._map.removeInteraction(this._interactionDraw);\n this._viewport.classList.remove('draw-mode');\n }\n\n activateMode(layer ? Modes.Draw : null);\n }\n\n /**\n * Activate/desactivate the edit mode\n *\n * @param bool\n * @public\n */\n activateEditMode(bool = true): void {\n if (bool) {\n activateModeButtons();\n this.activateDrawMode(false);\n } else {\n // Deselct features\n this._collectionModify.clear();\n }\n\n if (this._interactionSelectModify) {\n this._interactionSelectModify.setActive(bool);\n }\n\n this._interactionModify.setActive(bool);\n\n if (this._interactionWfsSelect)\n this._interactionWfsSelect.setActive(bool);\n }\n\n /**\n * Remove the overlay helper atttached to a specify feature\n * @param feature\n * @private\n */\n _removeOverlayHelper(feature: FeatureLike): void {\n const featureId = feature.getId();\n\n if (!featureId) {\n return;\n }\n\n const overlay = this._map.getOverlayById(featureId);\n\n if (!overlay) {\n return;\n }\n\n this._map.removeOverlay(overlay);\n }\n}\n\n/**\n * **_[interface]_** - Wfst Options specified when creating a Wfst instance\n *\n * Default values:\n * ```javascript\n * {\n * layers: null,\n * evtType: 'singleclick',\n * active: true,\n * showControl: true,\n * language: 'en',\n * i18n: {...}, // according to language selection\n * uploadFormats: '.geojson,.json,.kml',\n * processUpload: null,\n * }\n * ```\n */\ninterface Options {\n /**\n * Layers to be loaded from the geoserver\n */\n layers?: Array<WfsLayer | WmsLayer>;\n\n /**\n * Init active\n */\n active?: boolean;\n\n /**\n * The click event to allow selection of Features to be edited\n */\n evtType?: 'singleclick' | 'dblclick';\n\n /**\n * Show/hide the control map\n */\n showControl?: boolean;\n\n /**\n * Modal configuration\n */\n modal?: {\n animateClass?: string;\n animateInClass?: string;\n transition?: number;\n backdropTransition?: number;\n templates?: {\n dialog?: string | HTMLElement;\n headerClose?: string | HTMLElement;\n };\n };\n\n /**\n * Language to be used\n */\n language?: 'es' | 'en' | 'zh';\n\n /**\n * Custom translations\n */\n i18n?: I18n;\n\n /**\n * Show/hide the upload button\n */\n showUpload?: boolean;\n\n /**\n * Accepted extension formats on upload\n * Example: \".json,.geojson\"\n */\n uploadFormats?: string;\n\n /**\n * Triggered to allow implement custom functions or to parse other formats than default\n * by filtering the extension. If this doesn't return features, the default function\n * will be used to extract them.\n */\n processUpload?(file: File): Array<Feature<Geometry>>;\n}\n\n/**\n * **_[interface]_** - Parameters to create the layers and connect to the GeoServer\n *\n * You can use all the parameters supported by OpenLayers\n *\n * Default values:\n * ```javascript\n * {\n * name: null,\n * geoserver: null,\n * label: null, // `name` if not provided\n * strategy: all,\n * geoserverVendor: null\n * }\n * ```\n */\ninterface LayerOptions extends Omit<VectorLayerOptions<any>, 'source'> {\n /**\n * Layer name in the GeoServer\n */\n name: string;\n\n /**\n * Geoserver Object\n */\n geoserver: Geoserver;\n\n /**\n * Label to be displayed in the widget control\n */\n label?: string;\n\n /**\n * Available geoserver options\n */\n geoserverVendor?: WfsGeoserverVendor | WmsGeoserverVendor;\n\n /**\n * Strategy function for loading features.\n * Only for WFS\n * By default `all` strategy is used\n */\n strategy?: LoadingStrategy;\n\n /**\n * Triggered before inserting new features to the Geoserver.\n * Use this to insert custom properties, modify the feature, etc.\n */\n beforeTransactFeature?(\n feature: Feature<Geometry>,\n transaction: TransactionType\n ): Feature<Geometry>;\n}\nclass WfstEvent extends BaseEvent {\n public data: IGeoserverDescribeFeatureType;\n public layer: WfsLayer | WmsLayer;\n\n constructor(options: {\n type: WfstEventTypes;\n layer: WfsLayer | WmsLayer;\n data: IGeoserverDescribeFeatureType;\n }) {\n super(options.type);\n this.layer = options.layer;\n this.data = options.data;\n }\n}\n\ntype WfstEventTypes = 'describeFeatureType';\n\nexport {\n Options,\n WfstEventTypes,\n WfstEvent,\n I18n,\n LayerOptions,\n Geoserver,\n WmsLayer,\n WfsLayer\n};\n","import { I18N } from './modules/i18n';\nimport { Options } from './ol-wfst';\n\nexport const DEFAULT_LANGUAGE = 'en';\n\nexport const getDefaultOptions = (): Options => {\n return {\n layers: null,\n evtType: 'singleclick',\n active: true,\n showControl: true,\n language: DEFAULT_LANGUAGE,\n uploadFormats: '.geojson,.json,.kml',\n processUpload: null,\n modal: {\n animateClass: 'fade',\n animateInClass: 'show',\n transition: 300,\n backdropTransition: 150,\n templates: {\n dialog: '<div class=\"modal-dialog modal-dialog-centered\"></div>',\n headerClose: `<button type=\"button\" class=\"btn-close\" data-dismiss=\"modal\" aria-label=\"${I18N.labels.close}\"><span aria-hidden=\"true\">×</span></button>`\n }\n }\n };\n};\n","import Wfst from '../src/ol-wfst';\nimport WfsLayer from '../src/WfsLayer';\nimport WmsLayer from '../src/WmsLayer';\nimport Geoserver from '../src/Geoserver';\n\nconst utils = {\n WfsLayer,\n WmsLayer,\n Geoserver\n};\n\nObject.assign(Wfst, utils);\nexport default Wfst;\n"],"names":["messages","AssertionError","Error","constructor","code","message","super","this","name","AssertionError$1","Event$1","type","propagationStopped","defaultPrevented","target","preventDefault","stopPropagation","ObjectEventType","Disposable$1","disposed","dispose","disposeInternal","VOID","clear","object","property","Target$1","Disposable","eventTarget_","pendingRemovals_","dispatching_","listeners_","addEventListener","listener","listeners","listenersForType","includes","push","dispatchEvent","event","isString","evt","Event","dispatching","pendingRemovals","propagate","i","ii","length","handleEvent","call","pr","removeEventListener","getListeners","undefined","hasListener","Object","keys","index","indexOf","splice","EventType","listen","thisArg","once","bind","originalListener","apply","arguments","eventsKey","listenOnce","unlistenByKey","key","Observable","EventTarget","on","un","revision_","changed","getRevision","onInternal","Array","isArray","len","onceInternal","ol_key","unInternal","unByKey","prototype","Observable$1","uidCounter_","ObjectEvent","oldValue","BaseObject$1","values","obj","ol_uid","String","values_","setProperties","get","value","hasOwnProperty","getKeys","getProperties","assign","hasProperties","notify","eventType","addChangeListener","removeChangeListener","set","silent","applyProperties","source","unset","isEmpty","CollectionEventType","Property","CollectionEvent","element","Collection$1","BaseObject","array","options","unique_","unique","array_","assertUnique_","updateLength_","getLength","pop","extend","arr","forEach","f","getArray","item","insertAt","elem","removeAt","n","remove","prev","setAt","except","Feature","geometryOrProperties","id_","geometryName_","style_","styleFunction_","geometryChangeKey_","handleGeometryChanged_","geometry","setGeometry","properties","clone","setGeometryName","getGeometryName","getGeometry","style","getStyle","setStyle","getId","getStyleFunction","handleGeometryChange_","styles","assertion","errorCode","assert","createStyleFunction","setId","id","Feature$1","outerWidth","width","offsetWidth","getComputedStyle","parseInt","marginLeft","marginRight","outerHeight","height","offsetHeight","marginTop","marginBottom","TileState","MapEventType","Overlay$1","insertFirst","stopEvent","document","createElement","className","position","pointerEvents","autoPan","rendered","transform_","visible","mapPostrenderListenerKey","handleElementChanged","handleMapChanged","handleOffsetChanged","handlePositionChanged","handlePositioningChanged","setElement","setOffset","offset","setPositioning","positioning","setPosition","getElement","getMap","getOffset","getPosition","getPositioning","node","lastChild","removeChild","removeChildren","appendChild","parentNode","map","render","updatePixelPosition","container","getOverlayContainerStopEvent","getOverlayContainer","insertBefore","childNodes","performAutoPan","setMap","panIntoView","panIntoViewOptions","getTargetElement","mapRect","getRect","getSize","overlayRect","myMargin","margin","extent2","extent1","offsetLeft","offsetRight","offsetTop","offsetBottom","delta","Math","abs","center","getView","getCenterInternal","centerPx","getPixelFromCoordinateInternal","newCenterPx","panOptions","animation","animateInternal","getCoordinateFromPixelInternal","duration","easing","size","box","getBoundingClientRect","offsetX","left","window","pageXOffset","offsetY","top","pageYOffset","setVisible","display","isRendered","pixel","getPixelFromCoordinate","mapSize","updateRenderedPosition","posX","posY","transform","round","getOptions","module","exports","modules","installedModules","__webpack_require__","moduleId","l","m","c","d","getter","o","defineProperty","configurable","enumerable","__esModule","p","s","default","_createClass","defineProperties","props","descriptor","writable","Constructor","protoProps","staticProps","_extends","_typeof","Symbol","iterator","_events","_events2","_classCallCheck","instance","TypeError","_possibleConstructorReturn","self","ReferenceError","_factory","_defaults","freeze","el","animate","animateClass","animateInClass","appendTo","backdrop","keyboard","title","header","content","footer","buttons","headerClose","construct","transition","backdropTransition","_buttons","deepFreeze","k","v","dialog","text","attr","class","alert","confirm","_templates","body","guid","random","toString","data","prop","elData","dataAttr","getAttribute","prefix","build","html","all","nodeName","replace","innerHTML","calcScrollbarWidth","inner","outer","visibility","overflow","getPath","nodes","Modal","_EventEmitter","_this","__proto__","getPrototypeOf","_html","_visible","_pointerInContent","_options","templates","querySelector","_scrollbarWidth","_render","_mapDom","subClass","superClass","create","setPrototypeOf","_inherits","question","_baseTemplates","_baseButtons","_baseOptions","t","classList","add","_setHeader","_setContent","_setFooter","contains","outerHTML","ineerHTML","children","button","j","setAttribute","keydownHandler","_handleKeydownEvent","mousedownHandler","_handleMousedownEvent","clickHandler","_handleClickEvent","resizeHandler","_handleResizeEvent","e","_this2","every","_this3","tagName","emit","hide","which","_resize","_this4","_checkScrollbar","_setScrollbar","scrollTop","_setEvents","setTimeout","_backdrop","show","modalIsOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","bodyIsOverflowing","paddingRight","_this5","_this6","contCList","_removeEvents","originalBodyPad","clientWidth","innerWidth","basePadding","require$$0","isError","Set","parseError","geoserverError","exceptions","join","showError","msg","originalError","layerName","has","err_msg","al","delete","en","labels","select","addElement","editElement","save","cancel","upload","editMode","confirmDelete","geomTypeNotSupported","editFields","editGeom","selectDrawType","uploadToLayer","uploadFeatures","validFeatures","invalidFeatures","loading","toggleVisibility","close","errors","capabilities","wfst","layer","layerNotFound","layerNotVisible","noValidGeometry","geoserver","badFormat","badFile","lockFeature","transaction","getFeatures","langs","es","zh","I18N","loadingDiv","showLoading","bool","copyProps","dest","src","exclude","getOwnPropertyDescriptors","protoChain","currentChain","proto","hardMixProtos","ingredients","_a","base","objs","commonProto","protoChains","protos","potentialCommonProto","nearestCommonProto","mixedProto","visitedProtos","newProto","filter","mixins","Map","getMixinsForClass","clazz","mergeObjectsOfDecorators","o1","o2","_b","allKeys","getOwnPropertyNames","mergedObject","mergePropertyAndMethodDecorators","d1","d2","_c","_d","method","decorators","deepDecoratorSearch","classes","decoratorsForClassChain","allClasses","frontier","newClasses","newClass","findAllConstituentClasses","reduce","_e","_f","static","mergeDecorators","Mixin","constructors","prototypes","MixedClass","args","DecoratedMixedClass","classDecorators","decorator","applyPropAndMethodDecorators","mixedClass","constituents","propAndMethodDecorators","propDecorators","methodDecorators","getOwnPropertyDescriptor","GeometryType","TransactionType","layerToInsertElements","mode","Modes","activateMode","getMode","editedFeatures","mapLayers","setActiveLayerToInsertEls","getActiveLayerToInsertEls","getStoredMapLayers","getStoredLayer","addFeatureToEditedList","feature","removeFeatureFromEditList","isFeatureEdited","BaseLayer","Layer","_init","getGeoserver","isLoaded","getAndUpdateDescribeFeatureType","async","BaseLayerProperty","NAME","layerLabel","LABEL","params","URLSearchParams","service","version","getAdvanced","describeFeatureTypeVersion","request","typeName","outputFormat","url_fetch","getUrl","response","fetch","headers","getHeaders","credentials","getCredentials","ok","json","targetNamespace","featureTypes","geom","find","_parsed","namespace","geomType","localType","geomField","DESCRIBEFEATURETYPE","err","console","error","isVisibleByZoom","getZoom","getMinZoom","features","transact","transactFeatures","Insert","featureId","getUseLockFeature","hasLockFeature","GEOSERVER","getDescribeFeatureType","WfsSource","VectorSource","urlParams","SERVICE","REQUEST","OUTPUTFORMAT","EXCEPTIONS","format","GeoJSON","loader","extent","resolution","projection","success","failure","strategy","bbox","extentGeoServer","transformExtent","getCode","geoServerAdvanced","geoserverUrl","getFormat","readFeatures","featureProjection","dataProjection","addFeatures","removeLoadedExtent","getFeatureVersion","WfsLayer","VectorLayer","_loadingCount","_loadedCount","beforeTransactFeature","label","minZoom","geoserverVendor","setSource","geoserverOptions","param","refresh","getSource","setCustomParam","paramName","WmsSource","TileWMS","url","serverType","TILED","LAYERS","tileLoadFunction","tile","blob","parsedError","Promise","resolve","reader","FileReader","onloadend","JSON","parse","result","readAsText","getImage","URL","createObjectURL","setState","WmsLayer","TileLayer","_formatGeoJSON","coordinate","view","buffer","getResolution","getProjection","INFO_FORMAT","BUFFER","FEATURE_COUNT","status","getParams","Date","getMilliseconds","updateParams","attrs","DocumentFragment","entries","startsWith","toLowerCase","substr","child","append","nodeType","resetStateButtons","activeBtn","LayersControl","_uploads","_uploadFormats","uploads","uploadFormats","addLayerEl","input","myPragma","checked","onchange","_layerChangeHandler","layerDom","getVisible","onclick","_visibilityClickHandler","htmlFor","_changeStateSelect","geomDrawTypeSelected","setSelectState","from","selectDraw","option","selected","disabled","drawType","geomLayer","GeometryCollection","LineString","LinearRing","Circle","Polygon","parentDiv","currentTarget","closest","dataset","toggle","accept","process","selectedValue","Point","MultiPoint","MultiLineString","MultiPolygon","editLayer","zIndex","getEditLayer","Uploads","_formatWFS","_formatKml","_xs","_processUpload","processUpload","WFS","KML","extractStyles","showPointNames","XMLSerializer","file","files","extension","split","string","_fileReader","invalidFeaturesCount","validFeaturesCount","featuresToInsert","_checkGeometry","_fixGeometry","VectorSourceEvent","_initModal","reject","fileData","geomTypeLayer","getType","coords","getCoordinates","geomTypeFeature","modal","action","deepObjectAssign","sources","s_val","t_val","EditControlChangesEl","Control","styleFunction","getVertexs","getGeometries","coordinates","flatCoordinates","flat","Edit","Style","image","CircleStyle","radius","fill","Fill","color","Draw","stroke","Stroke","EditFieldsModal","_modal","_feature","querySelectorAll","field","dataSchema","Geoserver","_countRequests","_insertFeatures","_updateFeatures","_deleteFeatures","state_","defaults","advanced","getCapabilitiesVersion","lockFeatureVersion","wfsTransactionVersion","lockFeatureParams","expiry","lockId","releaseAction","useLockFeature","setAdvanced","setHeaders","setCredentials","setUrl","setUseLockFeature","getAndUpdateCapabilities","_checkGeoserverCapabilities","getCapabilities","GeoserverProperty","CAPABILITIES","opt_silent","HEADERS","CREDENTIALS","ADVANCED","hasTransaction","HASTRASNACTION","HASLOCKFEATURE","USELOCKFEATURE","ISLOADED","getState","DOMParser","parseFromString","operations","getElementsByTagName","operation","HASDESCRIBEFEATURETYPE","transactionType","clonedFeatures","geoLayer","_cloneFeature","cloneGeom","_transformGeoemtryCollectionToGeometries","_transformCircleToPolygon","Update","Delete","numberRequest","srs","describeFeatureType","featureNS","featureType","srsName","featurePrefix","nativeElements","writeTransaction","payload","serializeToString","gmemberIn","gmemberOut","parseResponse","readTransactionResponse","responseStr","findError","match","removeFeature","geomConverted","fromCircle","featureProperties","boundedBy","_layerName_","retry","LockId","featureid","dataParsed","EditOverlay","Overlay","getCenter","getExtent","alt","controlElement","Wfst","_i18n","_map","_view","_viewport","_initialized","_layersControl","_overlay","_interactionWfsSelect","_interactionSelectModify","_collectionModify","_interactionModify","_interactionSnap","_interactionDraw","_keyClickWms","_keyRemove","_keySelect","_controlApplyDiscardChanges","_controlWidgetToolsDiv","_selectDraw","_currentZoom","_lastZoom","_editFeature","_editFeatureOriginal","_editFields","lang","customI18n","i18n.setLang","language","i18n","defaultOptions","layers","evtType","active","showControl","getLayers","getLayerByName","layerRendered","layersNumber","domEl","ISVISIBLE","WfstEvent","addLayer","_createMapElements","opts","getViewport","insertFeatures","activateEditMode","editLayerSource","fit","maxZoom","padding","_deleteFeature","_addMapEvents","_initMapAndLayers","_prepareEditLayer","_addInteractions","_addInteractionHandlers","_addMapControl","prepareWfsInteraction","Collection","Select","hitTolerance","toggleCondition","never","addInteraction","deselected","mapBrowserEvent","getLayer","_addFeatureToEditMode","prepareWmsInteraction","removeCondition","hasFeatureAtPixel","_getFeaturesByClickEvent","Modify","condition","primaryAction","Snap","selectedFeatures","keyboardEvents","_onDeselectFeatureEvent","_onRemoveFeatureEvent","showUpload","activateDrawMode","i18n.I18N","controlEl","_deselectEditFeature","_removeOverlayHelper","_restoreFeatureToLayer","addFeature","_removeFeatureFromTmpLayer","checkIfFeatureIsChanged","_editModeOff","_editModeOn","addControl","removeControl","deleteEl","ev","overlay","addOverlay","maybeLockFeature","addDrawInteraction","removeInteraction","geomDrawType","stopClick","btn","activateDrawButton","activateModeButtons","setActive","getOverlayById","removeOverlay","BaseEvent","utils"],"mappings":"g8CAKA,MAAMA,EAAW,CACf,EAAG,iCACH,EAAG,qCACH,EAAG,mCACH,EAAG,wDACH,EAAG,iDACH,EAAG,yCACH,EAAG,kCACH,EAAG,oDACH,GAAI,oEACJ,GAAI,0CACJ,GAAI,0EACJ,GAAI,iBACJ,GAAI,gBACJ,GAAI,kEACJ,GAAI,sDACJ,GAAI,mDACJ,GAAI,8DACJ,GAAI,wDACJ,GAAI,sDACJ,GAAI,kEACJ,GAAI,oDACJ,GAAI,iDACJ,GAAI,+BACJ,GAAI,+BACJ,GAAI,gDACJ,GAAI,uDACJ,GAAI,oEACJ,GAAI,2CACJ,GAAI,gBACJ,GAAI,0BACJ,GAAI,mBACJ,GAAI,8BACJ,GAAI,sCACJ,GAAI,wBACJ,GAAI,wCACJ,GAAI,kEACJ,GAAI,qCACJ,GAAI,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C/6B,KAAKs6B,UAAU3hB,UAAUpQ,OAAO,aAGpCyb,GAAa1F,EAAQyF,GAAMqQ,KAAO,KAlBjC,CAmBJ,CAQD6I,iBAAiB3d,GAAO,GAChBA,Gfv5BuB,MAC/B,MAAMqhB,EAAMl1B,SAASoM,cAAc,oCAC/B8oB,GACAA,EAAIhoB,UAAUC,IAAI,eACrB,Eeo5BOioB,GACA7gC,KAAKq/B,kBAAiB,IAGtBr/B,KAAK46B,kBAAkB55B,QAGvBhB,KAAK26B,0BACL36B,KAAK26B,yBAAyBmG,UAAUxhB,GAG5Ctf,KAAK66B,mBAAmBiG,UAAUxhB,GAE9Btf,KAAK06B,uBACL16B,KAAK06B,sBAAsBoG,UAAUxhB,EAC5C,CAODmgB,qBAAqBhb,GACjB,MAAMqD,EAAYrD,EAAQ5a,QAE1B,IAAKie,EACD,OAGJ,MAAMsY,EAAUpgC,KAAKo6B,KAAK2G,eAAejZ,GAEpCsY,GAILpgC,KAAKo6B,KAAK4G,cAAcZ,EAC3B,EAyIL,MAAMzD,WAAkBsE,EAAAA,QACbjrB,KACAsI,MAEP1e,YAAYyH,GAKRtH,MAAMsH,EAAQjH,MACdJ,KAAKse,MAAQjX,EAAQiX,MACrBte,KAAKgW,KAAO3O,EAAQ2O,IACvB,EE9mCL,IAAMkrB,GAAQ,CACVlX,SAAAA,GACAsC,SAAAA,GACAuI,UAAAA,WAGJ5xB,OAAOiD,OAAOg0B,GAAMgH"}
1
+ {"version":3,"file":"ol-wfst.min.js","sources":["../node_modules/ol/AssertionError.js","../node_modules/ol/events/Event.js","../node_modules/ol/ObjectEventType.js","../node_modules/ol/Disposable.js","../node_modules/ol/functions.js","../node_modules/ol/obj.js","../node_modules/ol/events/Target.js","../node_modules/ol/events/EventType.js","../node_modules/ol/events.js","../node_modules/ol/Observable.js","../node_modules/ol/util.js","../node_modules/ol/Object.js","../node_modules/ol/CollectionEventType.js","../node_modules/ol/Collection.js","../node_modules/ol/Feature.js","../node_modules/ol/asserts.js","../node_modules/ol/dom.js","../node_modules/ol/TileState.js","../node_modules/ol/MapEventType.js","../node_modules/ol/Overlay.js","../node_modules/ol/extent.js","../node_modules/modal-vanilla/lib/modal.js","../src/modules/errors.ts","../src/modules/i18n/en.ts","../src/modules/i18n/index.ts","../src/modules/i18n/es.ts","../src/modules/i18n/zh.ts","../src/modules/loading.ts","../node_modules/ts-mixer/dist/esm/index.js","../src/@enums.ts","../src/modules/state.ts","../src/modules/base/BaseLayer.ts","../src/modules/base/WfsSource.ts","../src/WfsLayer.ts","../src/modules/base/WmsSource.ts","../src/WmsLayer.ts","../src/myPragma.ts","../src/modules/LayersControl.tsx","../src/assets/images/visibilityOn.svg","../src/assets/images/visibilityOff.svg","../src/assets/images/upload.svg","../src/assets/images/draw.svg","../src/modules/editLayer.ts","../src/modules/Uploads.ts","../src/modules/helpers.ts","../src/modules/EditControlChanges.tsx","../src/modules/styleFunction.ts","../src/modules/EditFieldsModal.ts","../src/Geoserver.ts","../src/modules/EditOverlay.tsx","../src/assets/images/editFields.svg","../src/assets/images/editGeom.svg","../src/ol-wfst.ts","../src/defaults.ts","../src/index-umd.js"],"sourcesContent":["/**\n * @module ol/AssertionError\n */\n\n/** @type {Object<number, string>} */\nconst messages = {\n 1: 'The view center is not defined',\n 2: 'The view resolution is not defined',\n 3: 'The view rotation is not defined',\n 4: '`image` and `src` cannot be provided at the same time',\n 5: '`imgSize` must be set when `image` is provided',\n 7: '`format` must be set when `url` is set',\n 8: 'Unknown `serverType` configured',\n 9: '`url` must be configured or set using `#setUrl()`',\n 10: 'The default `geometryFunction` can only handle `Point` geometries',\n 11: '`options.featureTypes` must be an Array',\n 12: '`options.geometryName` must also be provided when `options.bbox` is set',\n 13: 'Invalid corner',\n 14: 'Invalid color',\n 15: 'Tried to get a value for a key that does not exist in the cache',\n 16: 'Tried to set a value for a key that is used already',\n 17: '`resolutions` must be sorted in descending order',\n 18: 'Either `origin` or `origins` must be configured, never both',\n 19: 'Number of `tileSizes` and `resolutions` must be equal',\n 20: 'Number of `origins` and `resolutions` must be equal',\n 22: 'Either `tileSize` or `tileSizes` must be configured, never both',\n 24: 'Invalid extent or geometry provided as `geometry`',\n 25: 'Cannot fit empty extent provided as `geometry`',\n 26: 'Features must have an id set',\n 27: 'Features must have an id set',\n 28: '`renderMode` must be `\"hybrid\"` or `\"vector\"`',\n 30: 'The passed `feature` was already added to the source',\n 31: 'Tried to enqueue an `element` that was already added to the queue',\n 32: 'Transformation matrix cannot be inverted',\n 33: 'Invalid units',\n 34: 'Invalid geometry layout',\n 36: 'Unknown SRS type',\n 37: 'Unknown geometry type found',\n 38: '`styleMapValue` has an unknown type',\n 39: 'Unknown geometry type',\n 40: 'Expected `feature` to have a geometry',\n 41: 'Expected an `ol/style/Style` or an array of `ol/style/Style.js`',\n 42: 'Question unknown, the answer is 42',\n 43: 'Expected `layers` to be an array or a `Collection`',\n 47: 'Expected `controls` to be an array or an `ol/Collection`',\n 48: 'Expected `interactions` to be an array or an `ol/Collection`',\n 49: 'Expected `overlays` to be an array or an `ol/Collection`',\n 50: '`options.featureTypes` should be an Array',\n 51: 'Either `url` or `tileJSON` options must be provided',\n 52: 'Unknown `serverType` configured',\n 53: 'Unknown `tierSizeCalculation` configured',\n 55: 'The {-y} placeholder requires a tile grid with extent',\n 56: 'mapBrowserEvent must originate from a pointer event',\n 57: 'At least 2 conditions are required',\n 59: 'Invalid command found in the PBF',\n 60: 'Missing or invalid `size`',\n 61: 'Cannot determine IIIF Image API version from provided image information JSON',\n 62: 'A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`',\n 64: 'Layer opacity must be a number',\n 66: '`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`',\n 67: 'A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both',\n 68: 'A VectorTile source can only be rendered if it has a projection compatible with the view projection',\n};\n\n/**\n * Error object thrown when an assertion failed. This is an ECMA-262 Error,\n * extended with a `code` property.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error.\n */\nclass AssertionError extends Error {\n /**\n * @param {number} code Error code.\n */\n constructor(code) {\n const message = messages[code];\n\n super(message);\n\n /**\n * Error code. The meaning of the code can be found on\n * https://openlayers.org/en/latest/doc/errors/ (replace `latest` with\n * the version found in the OpenLayers script's header comment if a version\n * other than the latest is used).\n * @type {number}\n * @deprecated ol/AssertionError and error codes will be removed in v8.0\n * @api\n */\n this.code = code;\n\n /**\n * @type {string}\n */\n this.name = 'AssertionError';\n\n // Re-assign message, see https://github.com/Rich-Harris/buble/issues/40\n this.message = message;\n }\n}\n\nexport default AssertionError;\n","/**\n * @module ol/events/Event\n */\n\n/**\n * @classdesc\n * Stripped down implementation of the W3C DOM Level 2 Event interface.\n * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.\n *\n * This implementation only provides `type` and `target` properties, and\n * `stopPropagation` and `preventDefault` methods. It is meant as base class\n * for higher level events defined in the library, and works with\n * {@link module:ol/events/Target~Target}.\n */\nclass BaseEvent {\n /**\n * @param {string} type Type.\n */\n constructor(type) {\n /**\n * @type {boolean}\n */\n this.propagationStopped;\n\n /**\n * @type {boolean}\n */\n this.defaultPrevented;\n\n /**\n * The event type.\n * @type {string}\n * @api\n */\n this.type = type;\n\n /**\n * The event target.\n * @type {Object}\n * @api\n */\n this.target = null;\n }\n\n /**\n * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events\n * will be fired.\n * @api\n */\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n /**\n * Stop event propagation.\n * @api\n */\n stopPropagation() {\n this.propagationStopped = true;\n }\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function stopPropagation(evt) {\n evt.stopPropagation();\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function preventDefault(evt) {\n evt.preventDefault();\n}\n\nexport default BaseEvent;\n","/**\n * @module ol/ObjectEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a property is changed.\n * @event module:ol/Object.ObjectEvent#propertychange\n * @api\n */\n PROPERTYCHANGE: 'propertychange',\n};\n\n/**\n * @typedef {'propertychange'} Types\n */\n","/**\n * @module ol/Disposable\n */\n\n/**\n * @classdesc\n * Objects that need to clean up after themselves.\n */\nclass Disposable {\n constructor() {\n /**\n * The object has already been disposed.\n * @type {boolean}\n * @protected\n */\n this.disposed = false;\n }\n\n /**\n * Clean up.\n */\n dispose() {\n if (!this.disposed) {\n this.disposed = true;\n this.disposeInternal();\n }\n }\n\n /**\n * Extension point for disposable objects.\n * @protected\n */\n disposeInternal() {}\n}\n\nexport default Disposable;\n","/**\n * @module ol/functions\n */\n\nimport {equals as arrayEquals} from './array.js';\n\n/**\n * Always returns true.\n * @return {boolean} true.\n */\nexport function TRUE() {\n return true;\n}\n\n/**\n * Always returns false.\n * @return {boolean} false.\n */\nexport function FALSE() {\n return false;\n}\n\n/**\n * A reusable function, used e.g. as a default for callbacks.\n *\n * @return {void} Nothing.\n */\nexport function VOID() {}\n\n/**\n * Wrap a function in another function that remembers the last return. If the\n * returned function is called twice in a row with the same arguments and the same\n * this object, it will return the value from the first call in the second call.\n *\n * @param {function(...any): ReturnType} fn The function to memoize.\n * @return {function(...any): ReturnType} The memoized function.\n * @template ReturnType\n */\nexport function memoizeOne(fn) {\n let called = false;\n\n /** @type {ReturnType} */\n let lastResult;\n\n /** @type {Array<any>} */\n let lastArgs;\n\n let lastThis;\n\n return function () {\n const nextArgs = Array.prototype.slice.call(arguments);\n if (!called || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {\n called = true;\n lastThis = this;\n lastArgs = nextArgs;\n lastResult = fn.apply(this, arguments);\n }\n return lastResult;\n };\n}\n\n/**\n * @template T\n * @param {function(): (T | Promise<T>)} getter A function that returns a value or a promise for a value.\n * @return {Promise<T>} A promise for the value.\n */\nexport function toPromise(getter) {\n function promiseGetter() {\n let value;\n try {\n value = getter();\n } catch (err) {\n return Promise.reject(err);\n }\n if (value instanceof Promise) {\n return value;\n }\n return Promise.resolve(value);\n }\n return promiseGetter();\n}\n","/**\n * @module ol/obj\n */\n\n/**\n * Removes all properties from an object.\n * @param {Object} object The object to clear.\n */\nexport function clear(object) {\n for (const property in object) {\n delete object[property];\n }\n}\n\n/**\n * Determine if an object has any properties.\n * @param {Object} object The object to check.\n * @return {boolean} The object is empty.\n */\nexport function isEmpty(object) {\n let property;\n for (property in object) {\n return false;\n }\n return !property;\n}\n","/**\n * @module ol/events/Target\n */\nimport Disposable from '../Disposable.js';\nimport Event from './Event.js';\nimport {VOID} from '../functions.js';\nimport {clear} from '../obj.js';\n\n/**\n * @typedef {EventTarget|Target} EventTargetLike\n */\n\n/**\n * @classdesc\n * A simplified implementation of the W3C DOM Level 2 EventTarget interface.\n * See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.\n *\n * There are two important simplifications compared to the specification:\n *\n * 1. The handling of `useCapture` in `addEventListener` and\n * `removeEventListener`. There is no real capture model.\n * 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.\n * There is no event target hierarchy. When a listener calls\n * `stopPropagation` or `preventDefault` on an event object, it means that no\n * more listeners after this one will be called. Same as when the listener\n * returns false.\n */\nclass Target extends Disposable {\n /**\n * @param {*} [target] Default event target for dispatched events.\n */\n constructor(target) {\n super();\n\n /**\n * @private\n * @type {*}\n */\n this.eventTarget_ = target;\n\n /**\n * @private\n * @type {Object<string, number>}\n */\n this.pendingRemovals_ = null;\n\n /**\n * @private\n * @type {Object<string, number>}\n */\n this.dispatching_ = null;\n\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").Listener>>}\n */\n this.listeners_ = null;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n addEventListener(type, listener) {\n if (!type || !listener) {\n return;\n }\n const listeners = this.listeners_ || (this.listeners_ = {});\n const listenersForType = listeners[type] || (listeners[type] = []);\n if (!listenersForType.includes(listener)) {\n listenersForType.push(listener);\n }\n }\n\n /**\n * Dispatches an event and calls all listeners listening for events\n * of this type. The event parameter can either be a string or an\n * Object with a `type` property.\n *\n * @param {import(\"./Event.js\").default|string} event Event object.\n * @return {boolean|undefined} `false` if anyone called preventDefault on the\n * event object or if any of the listeners returned false.\n * @api\n */\n dispatchEvent(event) {\n const isString = typeof event === 'string';\n const type = isString ? event : event.type;\n const listeners = this.listeners_ && this.listeners_[type];\n if (!listeners) {\n return;\n }\n\n const evt = isString ? new Event(event) : /** @type {Event} */ (event);\n if (!evt.target) {\n evt.target = this.eventTarget_ || this;\n }\n const dispatching = this.dispatching_ || (this.dispatching_ = {});\n const pendingRemovals =\n this.pendingRemovals_ || (this.pendingRemovals_ = {});\n if (!(type in dispatching)) {\n dispatching[type] = 0;\n pendingRemovals[type] = 0;\n }\n ++dispatching[type];\n let propagate;\n for (let i = 0, ii = listeners.length; i < ii; ++i) {\n if ('handleEvent' in listeners[i]) {\n propagate = /** @type {import(\"../events.js\").ListenerObject} */ (\n listeners[i]\n ).handleEvent(evt);\n } else {\n propagate = /** @type {import(\"../events.js\").ListenerFunction} */ (\n listeners[i]\n ).call(this, evt);\n }\n if (propagate === false || evt.propagationStopped) {\n propagate = false;\n break;\n }\n }\n if (--dispatching[type] === 0) {\n let pr = pendingRemovals[type];\n delete pendingRemovals[type];\n while (pr--) {\n this.removeEventListener(type, VOID);\n }\n delete dispatching[type];\n }\n return propagate;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n this.listeners_ && clear(this.listeners_);\n }\n\n /**\n * Get the listeners for a specified event type. Listeners are returned in the\n * order that they will be called in.\n *\n * @param {string} type Type.\n * @return {Array<import(\"../events.js\").Listener>|undefined} Listeners.\n */\n getListeners(type) {\n return (this.listeners_ && this.listeners_[type]) || undefined;\n }\n\n /**\n * @param {string} [type] Type. If not provided,\n * `true` will be returned if this event target has any listeners.\n * @return {boolean} Has listeners.\n */\n hasListener(type) {\n if (!this.listeners_) {\n return false;\n }\n return type\n ? type in this.listeners_\n : Object.keys(this.listeners_).length > 0;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n removeEventListener(type, listener) {\n const listeners = this.listeners_ && this.listeners_[type];\n if (listeners) {\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n if (this.pendingRemovals_ && type in this.pendingRemovals_) {\n // make listener a no-op, and remove later in #dispatchEvent()\n listeners[index] = VOID;\n ++this.pendingRemovals_[type];\n } else {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n delete this.listeners_[type];\n }\n }\n }\n }\n }\n}\n\nexport default Target;\n","/**\n * @module ol/events/EventType\n */\n\n/**\n * @enum {string}\n * @const\n */\nexport default {\n /**\n * Generic change event. Triggered when the revision counter is increased.\n * @event module:ol/events/Event~BaseEvent#change\n * @api\n */\n CHANGE: 'change',\n\n /**\n * Generic error event. Triggered when an error occurs.\n * @event module:ol/events/Event~BaseEvent#error\n * @api\n */\n ERROR: 'error',\n\n BLUR: 'blur',\n CLEAR: 'clear',\n CONTEXTMENU: 'contextmenu',\n CLICK: 'click',\n DBLCLICK: 'dblclick',\n DRAGENTER: 'dragenter',\n DRAGOVER: 'dragover',\n DROP: 'drop',\n FOCUS: 'focus',\n KEYDOWN: 'keydown',\n KEYPRESS: 'keypress',\n LOAD: 'load',\n RESIZE: 'resize',\n TOUCHMOVE: 'touchmove',\n WHEEL: 'wheel',\n};\n","/**\n * @module ol/events\n */\nimport {clear} from './obj.js';\n\n/**\n * Key to use with {@link module:ol/Observable.unByKey}.\n * @typedef {Object} EventsKey\n * @property {ListenerFunction} listener Listener.\n * @property {import(\"./events/Target.js\").EventTargetLike} target Target.\n * @property {string} type Type.\n * @api\n */\n\n/**\n * Listener function. This function is called with an event object as argument.\n * When the function returns `false`, event propagation will stop.\n *\n * @typedef {function((Event|import(\"./events/Event.js\").default)): (void|boolean)} ListenerFunction\n * @api\n */\n\n/**\n * @typedef {Object} ListenerObject\n * @property {ListenerFunction} handleEvent HandleEvent listener function.\n */\n\n/**\n * @typedef {ListenerFunction|ListenerObject} Listener\n */\n\n/**\n * Registers an event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` to a `this` object, and returns\n * a key for use with {@link module:ol/events.unlistenByKey}.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @param {boolean} [once] If true, add the listener as one-off listener.\n * @return {EventsKey} Unique key for the listener.\n */\nexport function listen(target, type, listener, thisArg, once) {\n if (thisArg && thisArg !== target) {\n listener = listener.bind(thisArg);\n }\n if (once) {\n const originalListener = listener;\n listener = function () {\n target.removeEventListener(type, listener);\n originalListener.apply(this, arguments);\n };\n }\n const eventsKey = {\n target: target,\n type: type,\n listener: listener,\n };\n target.addEventListener(type, listener);\n return eventsKey;\n}\n\n/**\n * Registers a one-off event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` as self-unregistering listener\n * to a `this` object, and returns a key for use with\n * {@link module:ol/events.unlistenByKey} in case the listener needs to be\n * unregistered before it is called.\n *\n * When {@link module:ol/events.listen} is called with the same arguments after this\n * function, the self-unregistering listener will be turned into a permanent\n * listener.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @return {EventsKey} Key for unlistenByKey.\n */\nexport function listenOnce(target, type, listener, thisArg) {\n return listen(target, type, listener, thisArg, true);\n}\n\n/**\n * Unregisters event listeners on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * The argument passed to this function is the key returned from\n * {@link module:ol/events.listen} or {@link module:ol/events.listenOnce}.\n *\n * @param {EventsKey} key The key.\n */\nexport function unlistenByKey(key) {\n if (key && key.target) {\n key.target.removeEventListener(key.type, key.listener);\n clear(key);\n }\n}\n","/**\n * @module ol/Observable\n */\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport {listen, listenOnce, unlistenByKey} from './events.js';\n\n/***\n * @template {string} Type\n * @template {Event|import(\"./events/Event.js\").default} EventClass\n * @template Return\n * @typedef {(type: Type, listener: (event: EventClass) => ?) => Return} OnSignature\n */\n\n/***\n * @template {string} Type\n * @template Return\n * @typedef {(type: Type[], listener: (event: Event|import(\"./events/Event\").default) => ?) => Return extends void ? void : Return[]} CombinedOnSignature\n */\n\n/**\n * @typedef {'change'|'error'} EventTypes\n */\n\n/***\n * @template Return\n * @typedef {OnSignature<EventTypes, import(\"./events/Event.js\").default, Return> & CombinedOnSignature<EventTypes, Return>} ObservableOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * An event target providing convenient methods for listener registration\n * and unregistration. A generic `change` event is always available through\n * {@link module:ol/Observable~Observable#changed}.\n *\n * @fires import(\"./events/Event.js\").default\n * @api\n */\nclass Observable extends EventTarget {\n constructor() {\n super();\n\n this.on =\n /** @type {ObservableOnSignature<import(\"./events\").EventsKey>} */ (\n this.onInternal\n );\n\n this.once =\n /** @type {ObservableOnSignature<import(\"./events\").EventsKey>} */ (\n this.onceInternal\n );\n\n this.un = /** @type {ObservableOnSignature<void>} */ (this.unInternal);\n\n /**\n * @private\n * @type {number}\n */\n this.revision_ = 0;\n }\n\n /**\n * Increases the revision counter and dispatches a 'change' event.\n * @api\n */\n changed() {\n ++this.revision_;\n this.dispatchEvent(EventType.CHANGE);\n }\n\n /**\n * Get the version number for this object. Each time the object is modified,\n * its version number will be incremented.\n * @return {number} Revision.\n * @api\n */\n getRevision() {\n return this.revision_;\n }\n\n /**\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Event key.\n * @protected\n */\n onInternal(type, listener) {\n if (Array.isArray(type)) {\n const len = type.length;\n const keys = new Array(len);\n for (let i = 0; i < len; ++i) {\n keys[i] = listen(this, type[i], listener);\n }\n return keys;\n } else {\n return listen(this, /** @type {string} */ (type), listener);\n }\n }\n\n /**\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Event key.\n * @protected\n */\n onceInternal(type, listener) {\n let key;\n if (Array.isArray(type)) {\n const len = type.length;\n key = new Array(len);\n for (let i = 0; i < len; ++i) {\n key[i] = listenOnce(this, type[i], listener);\n }\n } else {\n key = listenOnce(this, /** @type {string} */ (type), listener);\n }\n /** @type {Object} */ (listener).ol_key = key;\n return key;\n }\n\n /**\n * Unlisten for a certain type of event.\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @protected\n */\n unInternal(type, listener) {\n const key = /** @type {Object} */ (listener).ol_key;\n if (key) {\n unByKey(key);\n } else if (Array.isArray(type)) {\n for (let i = 0, ii = type.length; i < ii; ++i) {\n this.removeEventListener(type[i], listener);\n }\n } else {\n this.removeEventListener(type, listener);\n }\n }\n}\n\n/**\n * Listen for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.on;\n\n/**\n * Listen once for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.once;\n\n/**\n * Unlisten for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @api\n */\nObservable.prototype.un;\n\n/**\n * Removes an event listener using the key returned by `on()` or `once()`.\n * @param {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} key The key returned by `on()`\n * or `once()` (or an array of keys).\n * @api\n */\nexport function unByKey(key) {\n if (Array.isArray(key)) {\n for (let i = 0, ii = key.length; i < ii; ++i) {\n unlistenByKey(key[i]);\n }\n } else {\n unlistenByKey(/** @type {import(\"./events.js\").EventsKey} */ (key));\n }\n}\n\nexport default Observable;\n","/**\n * @module ol/util\n */\n\n/**\n * @return {never} Any return.\n */\nexport function abstract() {\n throw new Error('Unimplemented abstract method.');\n}\n\n/**\n * Counter for getUid.\n * @type {number}\n * @private\n */\nlet uidCounter_ = 0;\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. Unique IDs are generated\n * as a strictly increasing sequence. Adapted from goog.getUid.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {string} The unique ID for the object.\n * @api\n */\nexport function getUid(obj) {\n return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));\n}\n\n/**\n * OpenLayers version.\n * @type {string}\n */\nexport const VERSION = '7.1.0';\n","/**\n * @module ol/Object\n */\nimport Event from './events/Event.js';\nimport ObjectEventType from './ObjectEventType.js';\nimport Observable from './Observable.js';\nimport {getUid} from './util.js';\nimport {isEmpty} from './obj.js';\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.\n */\nexport class ObjectEvent extends Event {\n /**\n * @param {string} type The event type.\n * @param {string} key The property name.\n * @param {*} oldValue The old value for `key`.\n */\n constructor(type, key, oldValue) {\n super(type);\n\n /**\n * The name of the property whose value is changing.\n * @type {string}\n * @api\n */\n this.key = key;\n\n /**\n * The old value. To get the new value use `e.target.get(e.key)` where\n * `e` is the event object.\n * @type {*}\n * @api\n */\n this.oldValue = oldValue;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types, ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types, Return>} ObjectOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Most non-trivial classes inherit from this.\n *\n * This extends {@link module:ol/Observable~Observable} with observable\n * properties, where each property is observable as well as the object as a\n * whole.\n *\n * Classes that inherit from this have pre-defined properties, to which you can\n * add your owns. The pre-defined properties are listed in this documentation as\n * 'Observable Properties', and have their own accessors; for example,\n * {@link module:ol/Map~Map} has a `target` property, accessed with\n * `getTarget()` and changed with `setTarget()`. Not all properties are however\n * settable. There are also general-purpose accessors `get()` and `set()`. For\n * example, `get('target')` is equivalent to `getTarget()`.\n *\n * The `set` accessors trigger a change event, and you can monitor this by\n * registering a listener. For example, {@link module:ol/View~View} has a\n * `center` property, so `view.on('change:center', function(evt) {...});` would\n * call the function whenever the value of the center property changes. Within\n * the function, `evt.target` would be the view, so `evt.target.getCenter()`\n * would return the new center.\n *\n * You can add your own observable properties with\n * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.\n * You can listen for changes on that property value with\n * `object.on('change:prop', listener)`. You can get a list of all\n * properties with {@link module:ol/Object~BaseObject#getProperties}.\n *\n * Note that the observable properties are separate from standard JS properties.\n * You can, for example, give your map object a title with\n * `map.title='New title'` and with `map.set('title', 'Another title')`. The\n * first will be a `hasOwnProperty`; the second will appear in\n * `getProperties()`. Only the second is observable.\n *\n * Properties can be deleted by using the unset method. E.g.\n * object.unset('foo').\n *\n * @fires ObjectEvent\n * @api\n */\nclass BaseObject extends Observable {\n /**\n * @param {Object<string, *>} [values] An object with key-value pairs.\n */\n constructor(values) {\n super();\n\n /***\n * @type {ObjectOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {ObjectOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {ObjectOnSignature<void>}\n */\n this.un;\n\n // Call {@link module:ol/util.getUid} to ensure that the order of objects' ids is\n // the same as the order in which they were created. This also helps to\n // ensure that object properties are always added in the same order, which\n // helps many JavaScript engines generate faster code.\n getUid(this);\n\n /**\n * @private\n * @type {Object<string, *>}\n */\n this.values_ = null;\n\n if (values !== undefined) {\n this.setProperties(values);\n }\n }\n\n /**\n * Gets a value.\n * @param {string} key Key name.\n * @return {*} Value.\n * @api\n */\n get(key) {\n let value;\n if (this.values_ && this.values_.hasOwnProperty(key)) {\n value = this.values_[key];\n }\n return value;\n }\n\n /**\n * Get a list of object property names.\n * @return {Array<string>} List of property names.\n * @api\n */\n getKeys() {\n return (this.values_ && Object.keys(this.values_)) || [];\n }\n\n /**\n * Get an object of all property names and values.\n * @return {Object<string, *>} Object.\n * @api\n */\n getProperties() {\n return (this.values_ && Object.assign({}, this.values_)) || {};\n }\n\n /**\n * @return {boolean} The object has properties.\n */\n hasProperties() {\n return !!this.values_;\n }\n\n /**\n * @param {string} key Key name.\n * @param {*} oldValue Old value.\n */\n notify(key, oldValue) {\n let eventType;\n eventType = `change:${key}`;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n eventType = ObjectEventType.PROPERTYCHANGE;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n addChangeListener(key, listener) {\n this.addEventListener(`change:${key}`, listener);\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n removeChangeListener(key, listener) {\n this.removeEventListener(`change:${key}`, listener);\n }\n\n /**\n * Sets a value.\n * @param {string} key Key name.\n * @param {*} value Value.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n set(key, value, silent) {\n const values = this.values_ || (this.values_ = {});\n if (silent) {\n values[key] = value;\n } else {\n const oldValue = values[key];\n values[key] = value;\n if (oldValue !== value) {\n this.notify(key, oldValue);\n }\n }\n }\n\n /**\n * Sets a collection of key-value pairs. Note that this changes any existing\n * properties and adds new ones (it does not remove any existing properties).\n * @param {Object<string, *>} values Values.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n setProperties(values, silent) {\n for (const key in values) {\n this.set(key, values[key], silent);\n }\n }\n\n /**\n * Apply any properties from another object without triggering events.\n * @param {BaseObject} source The source object.\n * @protected\n */\n applyProperties(source) {\n if (!source.values_) {\n return;\n }\n Object.assign(this.values_ || (this.values_ = {}), source.values_);\n }\n\n /**\n * Unsets a property.\n * @param {string} key Key name.\n * @param {boolean} [silent] Unset without triggering an event.\n * @api\n */\n unset(key, silent) {\n if (this.values_ && key in this.values_) {\n const oldValue = this.values_[key];\n delete this.values_[key];\n if (isEmpty(this.values_)) {\n this.values_ = null;\n }\n if (!silent) {\n this.notify(key, oldValue);\n }\n }\n }\n}\n\nexport default BaseObject;\n","/**\n * @module ol/CollectionEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when an item is added to the collection.\n * @event module:ol/Collection.CollectionEvent#add\n * @api\n */\n ADD: 'add',\n /**\n * Triggered when an item is removed from the collection.\n * @event module:ol/Collection.CollectionEvent#remove\n * @api\n */\n REMOVE: 'remove',\n};\n","/**\n * @module ol/Collection\n */\nimport AssertionError from './AssertionError.js';\nimport BaseObject from './Object.js';\nimport CollectionEventType from './CollectionEventType.js';\nimport Event from './events/Event.js';\n\n/**\n * @enum {string}\n * @private\n */\nconst Property = {\n LENGTH: 'length',\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Collection~Collection} instances are instances of this\n * type.\n * @template T\n */\nexport class CollectionEvent extends Event {\n /**\n * @param {import(\"./CollectionEventType.js\").default} type Type.\n * @param {T} element Element.\n * @param {number} index The index of the added or removed element.\n */\n constructor(type, element, index) {\n super(type);\n\n /**\n * The element that is added to or removed from the collection.\n * @type {T}\n * @api\n */\n this.element = element;\n\n /**\n * The index of the added or removed element.\n * @type {number}\n * @api\n */\n this.index = index;\n }\n}\n\n/***\n * @template T\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types|'change:length', import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").OnSignature<'add'|'remove', CollectionEvent<T>, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types|\n * 'change:length'|'add'|'remove',Return>} CollectionOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {boolean} [unique=false] Disallow the same item from being added to\n * the collection twice.\n */\n\n/**\n * @classdesc\n * An expanded version of standard JS Array, adding convenience methods for\n * manipulation. Add and remove changes to the Collection trigger a Collection\n * event. Note that this does not cover changes to the objects _within_ the\n * Collection; they trigger events on the appropriate object, not on the\n * Collection as a whole.\n *\n * @fires CollectionEvent\n *\n * @template T\n * @api\n */\nclass Collection extends BaseObject {\n /**\n * @param {Array<T>} [array] Array.\n * @param {Options} [options] Collection options.\n */\n constructor(array, options) {\n super();\n\n /***\n * @type {CollectionOnSignature<T, import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {CollectionOnSignature<T, import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {CollectionOnSignature<T, void>}\n */\n this.un;\n\n options = options || {};\n\n /**\n * @private\n * @type {boolean}\n */\n this.unique_ = !!options.unique;\n\n /**\n * @private\n * @type {!Array<T>}\n */\n this.array_ = array ? array : [];\n\n if (this.unique_) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n this.assertUnique_(this.array_[i], i);\n }\n }\n\n this.updateLength_();\n }\n\n /**\n * Remove all elements from the collection.\n * @api\n */\n clear() {\n while (this.getLength() > 0) {\n this.pop();\n }\n }\n\n /**\n * Add elements to the collection. This pushes each item in the provided array\n * to the end of the collection.\n * @param {!Array<T>} arr Array.\n * @return {Collection<T>} This collection.\n * @api\n */\n extend(arr) {\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n this.push(arr[i]);\n }\n return this;\n }\n\n /**\n * Iterate over each element, calling the provided callback.\n * @param {function(T, number, Array<T>): *} f The function to call\n * for every element. This function takes 3 arguments (the element, the\n * index and the array). The return value is ignored.\n * @api\n */\n forEach(f) {\n const array = this.array_;\n for (let i = 0, ii = array.length; i < ii; ++i) {\n f(array[i], i, array);\n }\n }\n\n /**\n * Get a reference to the underlying Array object. Warning: if the array\n * is mutated, no events will be dispatched by the collection, and the\n * collection's \"length\" property won't be in sync with the actual length\n * of the array.\n * @return {!Array<T>} Array.\n * @api\n */\n getArray() {\n return this.array_;\n }\n\n /**\n * Get the element at the provided index.\n * @param {number} index Index.\n * @return {T} Element.\n * @api\n */\n item(index) {\n return this.array_[index];\n }\n\n /**\n * Get the length of this collection.\n * @return {number} The length of the array.\n * @observable\n * @api\n */\n getLength() {\n return this.get(Property.LENGTH);\n }\n\n /**\n * Insert an element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n insertAt(index, elem) {\n if (index < 0 || index > this.getLength()) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n this.array_.splice(index, 0, elem);\n this.updateLength_();\n this.dispatchEvent(\n new CollectionEvent(CollectionEventType.ADD, elem, index)\n );\n }\n\n /**\n * Remove the last element of the collection and return it.\n * Return `undefined` if the collection is empty.\n * @return {T|undefined} Element.\n * @api\n */\n pop() {\n return this.removeAt(this.getLength() - 1);\n }\n\n /**\n * Insert the provided element at the end of the collection.\n * @param {T} elem Element.\n * @return {number} New length of the collection.\n * @api\n */\n push(elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n const n = this.getLength();\n this.insertAt(n, elem);\n return this.getLength();\n }\n\n /**\n * Remove the first occurrence of an element from the collection.\n * @param {T} elem Element.\n * @return {T|undefined} The removed element or undefined if none found.\n * @api\n */\n remove(elem) {\n const arr = this.array_;\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n if (arr[i] === elem) {\n return this.removeAt(i);\n }\n }\n return undefined;\n }\n\n /**\n * Remove the element at the provided index and return it.\n * Return `undefined` if the collection does not contain this index.\n * @param {number} index Index.\n * @return {T|undefined} Value.\n * @api\n */\n removeAt(index) {\n if (index < 0 || index >= this.getLength()) {\n return undefined;\n }\n const prev = this.array_[index];\n this.array_.splice(index, 1);\n this.updateLength_();\n this.dispatchEvent(\n /** @type {CollectionEvent<T>} */ (\n new CollectionEvent(CollectionEventType.REMOVE, prev, index)\n )\n );\n return prev;\n }\n\n /**\n * Set the element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n setAt(index, elem) {\n const n = this.getLength();\n if (index >= n) {\n this.insertAt(index, elem);\n return;\n }\n if (index < 0) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem, index);\n }\n const prev = this.array_[index];\n this.array_[index] = elem;\n this.dispatchEvent(\n /** @type {CollectionEvent<T>} */ (\n new CollectionEvent(CollectionEventType.REMOVE, prev, index)\n )\n );\n this.dispatchEvent(\n /** @type {CollectionEvent<T>} */ (\n new CollectionEvent(CollectionEventType.ADD, elem, index)\n )\n );\n }\n\n /**\n * @private\n */\n updateLength_() {\n this.set(Property.LENGTH, this.array_.length);\n }\n\n /**\n * @private\n * @param {T} elem Element.\n * @param {number} [except] Optional index to ignore.\n */\n assertUnique_(elem, except) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n if (this.array_[i] === elem && i !== except) {\n throw new AssertionError(58);\n }\n }\n }\n}\n\nexport default Collection;\n","/**\n * @module ol/Feature\n */\nimport BaseObject from './Object.js';\nimport EventType from './events/EventType.js';\nimport {assert} from './asserts.js';\nimport {listen, unlistenByKey} from './events.js';\n\n/**\n * @typedef {typeof Feature|typeof import(\"./render/Feature.js\").default} FeatureClass\n */\n\n/**\n * @typedef {Feature|import(\"./render/Feature.js\").default} FeatureLike\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types|'change:geometry', import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types\n * |'change:geometry', Return>} FeatureOnSignature\n */\n\n/***\n * @template Geometry\n * @typedef {Object<string, *> & { geometry?: Geometry }} ObjectWithGeometry\n */\n\n/**\n * @classdesc\n * A vector object for geographic features with a geometry and other\n * attribute properties, similar to the features in vector file formats like\n * GeoJSON.\n *\n * Features can be styled individually with `setStyle`; otherwise they use the\n * style of their vector layer.\n *\n * Note that attribute properties are set as {@link module:ol/Object~BaseObject} properties on\n * the feature object, so they are observable, and have get/set accessors.\n *\n * Typically, a feature has a single geometry property. You can set the\n * geometry using the `setGeometry` method and get it with `getGeometry`.\n * It is possible to store more than one geometry on a feature using attribute\n * properties. By default, the geometry used for rendering is identified by\n * the property name `geometry`. If you want to use another geometry property\n * for rendering, use the `setGeometryName` method to change the attribute\n * property associated with the geometry for the feature. For example:\n *\n * ```js\n *\n * import Feature from 'ol/Feature';\n * import Polygon from 'ol/geom/Polygon';\n * import Point from 'ol/geom/Point';\n *\n * const feature = new Feature({\n * geometry: new Polygon(polyCoords),\n * labelPoint: new Point(labelCoords),\n * name: 'My Polygon',\n * });\n *\n * // get the polygon geometry\n * const poly = feature.getGeometry();\n *\n * // Render the feature as a point using the coordinates from labelPoint\n * feature.setGeometryName('labelPoint');\n *\n * // get the point geometry\n * const point = feature.getGeometry();\n * ```\n *\n * @api\n * @template {import(\"./geom/Geometry.js\").default} [Geometry=import(\"./geom/Geometry.js\").default]\n */\nclass Feature extends BaseObject {\n /**\n * @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]\n * You may pass a Geometry object directly, or an object literal containing\n * properties. If you pass an object literal, you may include a Geometry\n * associated with a `geometry` key.\n */\n constructor(geometryOrProperties) {\n super();\n\n /***\n * @type {FeatureOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {FeatureOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {FeatureOnSignature<void>}\n */\n this.un;\n\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = undefined;\n\n /**\n * @type {string}\n * @private\n */\n this.geometryName_ = 'geometry';\n\n /**\n * User provided style.\n * @private\n * @type {import(\"./style/Style.js\").StyleLike}\n */\n this.style_ = null;\n\n /**\n * @private\n * @type {import(\"./style/Style.js\").StyleFunction|undefined}\n */\n this.styleFunction_ = undefined;\n\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.geometryChangeKey_ = null;\n\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n\n if (geometryOrProperties) {\n if (\n typeof (\n /** @type {?} */ (geometryOrProperties).getSimplifiedGeometry\n ) === 'function'\n ) {\n const geometry = /** @type {Geometry} */ (geometryOrProperties);\n this.setGeometry(geometry);\n } else {\n /** @type {Object<string, *>} */\n const properties = geometryOrProperties;\n this.setProperties(properties);\n }\n }\n }\n\n /**\n * Clone this feature. If the original feature has a geometry it\n * is also cloned. The feature id is not set in the clone.\n * @return {Feature<Geometry>} The clone.\n * @api\n */\n clone() {\n const clone = /** @type {Feature<Geometry>} */ (\n new Feature(this.hasProperties() ? this.getProperties() : null)\n );\n clone.setGeometryName(this.getGeometryName());\n const geometry = this.getGeometry();\n if (geometry) {\n clone.setGeometry(/** @type {Geometry} */ (geometry.clone()));\n }\n const style = this.getStyle();\n if (style) {\n clone.setStyle(style);\n }\n return clone;\n }\n\n /**\n * Get the feature's default geometry. A feature may have any number of named\n * geometries. The \"default\" geometry (the one that is rendered by default) is\n * set when calling {@link module:ol/Feature~Feature#setGeometry}.\n * @return {Geometry|undefined} The default geometry for the feature.\n * @api\n * @observable\n */\n getGeometry() {\n return /** @type {Geometry|undefined} */ (this.get(this.geometryName_));\n }\n\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is either set when reading data from a remote source or set explicitly by\n * calling {@link module:ol/Feature~Feature#setId}.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id_;\n }\n\n /**\n * Get the name of the feature's default geometry. By default, the default\n * geometry is named `geometry`.\n * @return {string} Get the property name associated with the default geometry\n * for this feature.\n * @api\n */\n getGeometryName() {\n return this.geometryName_;\n }\n\n /**\n * Get the feature's style. Will return what was provided to the\n * {@link module:ol/Feature~Feature#setStyle} method.\n * @return {import(\"./style/Style.js\").StyleLike|undefined} The feature style.\n * @api\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * Get the feature's style function.\n * @return {import(\"./style/Style.js\").StyleFunction|undefined} Return a function\n * representing the current style of this feature.\n * @api\n */\n getStyleFunction() {\n return this.styleFunction_;\n }\n\n /**\n * @private\n */\n handleGeometryChange_() {\n this.changed();\n }\n\n /**\n * @private\n */\n handleGeometryChanged_() {\n if (this.geometryChangeKey_) {\n unlistenByKey(this.geometryChangeKey_);\n this.geometryChangeKey_ = null;\n }\n const geometry = this.getGeometry();\n if (geometry) {\n this.geometryChangeKey_ = listen(\n geometry,\n EventType.CHANGE,\n this.handleGeometryChange_,\n this\n );\n }\n this.changed();\n }\n\n /**\n * Set the default geometry for the feature. This will update the property\n * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.\n * @param {Geometry|undefined} geometry The new geometry.\n * @api\n * @observable\n */\n setGeometry(geometry) {\n this.set(this.geometryName_, geometry);\n }\n\n /**\n * Set the style for the feature to override the layer style. This can be a\n * single style object, an array of styles, or a function that takes a\n * resolution and returns an array of styles. To unset the feature style, call\n * `setStyle()` without arguments or a falsey value.\n * @param {import(\"./style/Style.js\").StyleLike} [style] Style for this feature.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setStyle(style) {\n this.style_ = style;\n this.styleFunction_ = !style ? undefined : createStyleFunction(style);\n this.changed();\n }\n\n /**\n * Set the feature id. The feature id is considered stable and may be used when\n * requesting features or comparing identifiers returned from a remote source.\n * The feature id can be used with the\n * {@link module:ol/source/Vector~VectorSource#getFeatureById} method.\n * @param {number|string|undefined} id The feature id.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setId(id) {\n this.id_ = id;\n this.changed();\n }\n\n /**\n * Set the property name to be used when getting the feature's default geometry.\n * When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with\n * this name will be returned.\n * @param {string} name The property name of the default geometry.\n * @api\n */\n setGeometryName(name) {\n this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.geometryName_ = name;\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.handleGeometryChanged_();\n }\n}\n\n/**\n * Convert the provided object into a feature style function. Functions passed\n * through unchanged. Arrays of Style or single style objects wrapped\n * in a new feature style function.\n * @param {!import(\"./style/Style.js\").StyleFunction|!Array<import(\"./style/Style.js\").default>|!import(\"./style/Style.js\").default} obj\n * A feature style function, a single style, or an array of styles.\n * @return {import(\"./style/Style.js\").StyleFunction} A style function.\n */\nexport function createStyleFunction(obj) {\n if (typeof obj === 'function') {\n return obj;\n } else {\n /**\n * @type {Array<import(\"./style/Style.js\").default>}\n */\n let styles;\n if (Array.isArray(obj)) {\n styles = obj;\n } else {\n assert(typeof (/** @type {?} */ (obj).getZIndex) === 'function', 41); // Expected an `import(\"./style/Style.js\").Style` or an array of `import(\"./style/Style.js\").Style`\n const style = /** @type {import(\"./style/Style.js\").default} */ (obj);\n styles = [style];\n }\n return function () {\n return styles;\n };\n }\n}\nexport default Feature;\n","/**\n * @module ol/asserts\n */\nimport AssertionError from './AssertionError.js';\n\n/**\n * @param {*} assertion Assertion we expected to be truthy.\n * @param {number} errorCode Error code.\n */\nexport function assert(assertion, errorCode) {\n if (!assertion) {\n throw new AssertionError(errorCode);\n }\n}\n","import {WORKER_OFFSCREEN_CANVAS} from './has.js';\n\n/**\n * @module ol/dom\n */\n\n//FIXME Move this function to the canvas module\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number} [width] Canvas width.\n * @param {number} [height] Canvas height.\n * @param {Array<HTMLCanvasElement>} [canvasPool] Canvas pool to take existing canvas from.\n * @param {CanvasRenderingContext2DSettings} [settings] CanvasRenderingContext2DSettings\n * @return {CanvasRenderingContext2D} The context.\n */\nexport function createCanvasContext2D(width, height, canvasPool, settings) {\n /** @type {HTMLCanvasElement|OffscreenCanvas} */\n let canvas;\n if (canvasPool && canvasPool.length) {\n canvas = canvasPool.shift();\n } else if (WORKER_OFFSCREEN_CANVAS) {\n canvas = new OffscreenCanvas(width || 300, height || 300);\n } else {\n canvas = document.createElement('canvas');\n }\n if (width) {\n canvas.width = width;\n }\n if (height) {\n canvas.height = height;\n }\n //FIXME Allow OffscreenCanvasRenderingContext2D as return type\n return /** @type {CanvasRenderingContext2D} */ (\n canvas.getContext('2d', settings)\n );\n}\n\n/**\n * Releases canvas memory to avoid exceeding memory limits in Safari.\n * See https://pqina.nl/blog/total-canvas-memory-use-exceeds-the-maximum-limit/\n * @param {CanvasRenderingContext2D} context Context.\n */\nexport function releaseCanvas(context) {\n const canvas = context.canvas;\n canvas.width = 1;\n canvas.height = 1;\n context.clearRect(0, 0, 1, 1);\n}\n\n/**\n * Get the current computed width for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerWidth(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The width.\n */\nexport function outerWidth(element) {\n let width = element.offsetWidth;\n const style = getComputedStyle(element);\n width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);\n\n return width;\n}\n\n/**\n * Get the current computed height for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerHeight(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The height.\n */\nexport function outerHeight(element) {\n let height = element.offsetHeight;\n const style = getComputedStyle(element);\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n\n return height;\n}\n\n/**\n * @param {Node} newNode Node to replace old node\n * @param {Node} oldNode The node to be replaced\n */\nexport function replaceNode(newNode, oldNode) {\n const parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n}\n\n/**\n * @param {Node} node The node to remove.\n * @return {Node|null} The node that was removed or null.\n */\nexport function removeNode(node) {\n return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n}\n\n/**\n * @param {Node} node The node to remove the children from.\n */\nexport function removeChildren(node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n\n/**\n * Transform the children of a parent node so they match the\n * provided list of children. This function aims to efficiently\n * remove, add, and reorder child nodes while maintaining a simple\n * implementation (it is not guaranteed to minimize DOM operations).\n * @param {Node} node The parent node whose children need reworking.\n * @param {Array<Node>} children The desired children.\n */\nexport function replaceChildren(node, children) {\n const oldChildren = node.childNodes;\n\n for (let i = 0; true; ++i) {\n const oldChild = oldChildren[i];\n const newChild = children[i];\n\n // check if our work is done\n if (!oldChild && !newChild) {\n break;\n }\n\n // check if children match\n if (oldChild === newChild) {\n continue;\n }\n\n // check if a new child needs to be added\n if (!oldChild) {\n node.appendChild(newChild);\n continue;\n }\n\n // check if an old child needs to be removed\n if (!newChild) {\n node.removeChild(oldChild);\n --i;\n continue;\n }\n\n // reorder\n node.insertBefore(newChild, oldChild);\n }\n}\n","/**\n * @module ol/TileState\n */\n\n/**\n * @enum {number}\n */\nexport default {\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n /**\n * Indicates that tile loading failed\n * @type {number}\n */\n ERROR: 3,\n EMPTY: 4,\n};\n","/**\n * @module ol/MapEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered after a map frame is rendered.\n * @event module:ol/MapEvent~MapEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n\n /**\n * Triggered when the map starts moving.\n * @event module:ol/MapEvent~MapEvent#movestart\n * @api\n */\n MOVESTART: 'movestart',\n\n /**\n * Triggered after the map is moved.\n * @event module:ol/MapEvent~MapEvent#moveend\n * @api\n */\n MOVEEND: 'moveend',\n\n /**\n * Triggered when loading of additional map data (tiles, images, features) starts.\n * @event module:ol/MapEvent~MapEvent#loadstart\n * @api\n */\n LOADSTART: 'loadstart',\n\n /**\n * Triggered when loading of additional map data has completed.\n * @event module:ol/MapEvent~MapEvent#loadend\n * @api\n */\n LOADEND: 'loadend',\n};\n\n/***\n * @typedef {'postrender'|'movestart'|'moveend'|'loadstart'|'loadend'} Types\n */\n","/**\n * @module ol/Overlay\n */\nimport BaseObject from './Object.js';\nimport MapEventType from './MapEventType.js';\nimport {CLASS_SELECTABLE} from './css.js';\nimport {containsExtent} from './extent.js';\nimport {listen, unlistenByKey} from './events.js';\nimport {outerHeight, outerWidth, removeChildren, removeNode} from './dom.js';\n\n/**\n * @typedef {'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-center' | 'center-right' | 'top-left' | 'top-center' | 'top-right'} Positioning\n * The overlay position: `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, or `'top-right'`.\n */\n\n/**\n * @typedef {Object} Options\n * @property {number|string} [id] Set the overlay id. The overlay id can be used\n * with the {@link module:ol/Map~Map#getOverlayById} method.\n * @property {HTMLElement} [element] The overlay element.\n * @property {Array<number>} [offset=[0, 0]] Offsets in pixels used when positioning\n * the overlay. The first element in the\n * array is the horizontal offset. A positive value shifts the overlay right.\n * The second element in the array is the vertical offset. A positive value\n * shifts the overlay down.\n * @property {import(\"./coordinate.js\").Coordinate} [position] The overlay position\n * in map projection.\n * @property {Positioning} [positioning='top-left'] Defines how\n * the overlay is actually positioned with respect to its `position` property.\n * Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, and `'top-right'`.\n * @property {boolean} [stopEvent=true] Whether event propagation to the map\n * viewport should be stopped. If `true` the overlay is placed in the same\n * container as that of the controls (CSS class name\n * `ol-overlaycontainer-stopevent`); if `false` it is placed in the container\n * with CSS class name specified by the `className` property.\n * @property {boolean} [insertFirst=true] Whether the overlay is inserted first\n * in the overlay container, or appended. If the overlay is placed in the same\n * container as that of the controls (see the `stopEvent` option) you will\n * probably set `insertFirst` to `true` so the overlay is displayed below the\n * controls.\n * @property {PanIntoViewOptions|boolean} [autoPan=false] Pan the map when calling\n * `setPosition`, so that the overlay is entirely visible in the current viewport.\n * @property {string} [className='ol-overlay-container ol-selectable'] CSS class\n * name.\n */\n\n/**\n * @typedef {Object} PanOptions\n * @property {number} [duration=1000] The duration of the animation in\n * milliseconds.\n * @property {function(number):number} [easing] The easing function to use. Can\n * be one from {@link module:ol/easing} or a custom function.\n * Default is {@link module:ol/easing.inAndOut}.\n */\n\n/**\n * @typedef {Object} PanIntoViewOptions\n * @property {PanOptions} [animation={}] The animation parameters for the pan\n * @property {number} [margin=20] The margin (in pixels) between the\n * overlay and the borders of the map when panning into view.\n */\n\n/**\n * @enum {string}\n * @protected\n */\nconst Property = {\n ELEMENT: 'element',\n MAP: 'map',\n OFFSET: 'offset',\n POSITION: 'position',\n POSITIONING: 'positioning',\n};\n\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:element'|'change:map'|'change:offset'|'change:position'|\n * 'change:positioning'} OverlayObjectEventTypes\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<OverlayObjectEventTypes, import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|OverlayObjectEventTypes, Return>} OverlayOnSignature\n */\n\n/**\n * @classdesc\n * An element to be displayed over the map and attached to a single map\n * location. Like {@link module:ol/control/Control~Control}, Overlays are\n * visible widgets. Unlike Controls, they are not in a fixed position on the\n * screen, but are tied to a geographical coordinate, so panning the map will\n * move an Overlay but not a Control.\n *\n * Example:\n *\n * import Overlay from 'ol/Overlay';\n *\n * // ...\n * const popup = new Overlay({\n * element: document.getElementById('popup'),\n * });\n * popup.setPosition(coordinate);\n * map.addOverlay(popup);\n *\n * @api\n */\nclass Overlay extends BaseObject {\n /**\n * @param {Options} options Overlay options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {OverlayOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {OverlayOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {OverlayOnSignature<void>}\n */\n this.un;\n\n /**\n * @protected\n * @type {Options}\n */\n this.options = options;\n\n /**\n * @protected\n * @type {number|string|undefined}\n */\n this.id = options.id;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.insertFirst =\n options.insertFirst !== undefined ? options.insertFirst : true;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.stopEvent = options.stopEvent !== undefined ? options.stopEvent : true;\n\n /**\n * @protected\n * @type {HTMLElement}\n */\n this.element = document.createElement('div');\n this.element.className =\n options.className !== undefined\n ? options.className\n : 'ol-overlay-container ' + CLASS_SELECTABLE;\n this.element.style.position = 'absolute';\n this.element.style.pointerEvents = 'auto';\n\n /**\n * @protected\n * @type {PanIntoViewOptions|undefined}\n */\n this.autoPan = options.autoPan === true ? {} : options.autoPan || undefined;\n\n /**\n * @protected\n * @type {{transform_: string,\n * visible: boolean}}\n */\n this.rendered = {\n transform_: '',\n visible: true,\n };\n\n /**\n * @protected\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.mapPostrenderListenerKey = null;\n\n this.addChangeListener(Property.ELEMENT, this.handleElementChanged);\n this.addChangeListener(Property.MAP, this.handleMapChanged);\n this.addChangeListener(Property.OFFSET, this.handleOffsetChanged);\n this.addChangeListener(Property.POSITION, this.handlePositionChanged);\n this.addChangeListener(Property.POSITIONING, this.handlePositioningChanged);\n\n if (options.element !== undefined) {\n this.setElement(options.element);\n }\n\n this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);\n\n this.setPositioning(options.positioning || 'top-left');\n\n if (options.position !== undefined) {\n this.setPosition(options.position);\n }\n }\n\n /**\n * Get the DOM element of this overlay.\n * @return {HTMLElement|undefined} The Element containing the overlay.\n * @observable\n * @api\n */\n getElement() {\n return /** @type {HTMLElement|undefined} */ (this.get(Property.ELEMENT));\n }\n\n /**\n * Get the overlay identifier which is set on constructor.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id;\n }\n\n /**\n * Get the map associated with this overlay.\n * @return {import(\"./Map.js\").default|null} The map that the\n * overlay is part of.\n * @observable\n * @api\n */\n getMap() {\n return /** @type {import(\"./Map.js\").default|null} */ (\n this.get(Property.MAP) || null\n );\n }\n\n /**\n * Get the offset of this overlay.\n * @return {Array<number>} The offset.\n * @observable\n * @api\n */\n getOffset() {\n return /** @type {Array<number>} */ (this.get(Property.OFFSET));\n }\n\n /**\n * Get the current position of this overlay.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The spatial point that the overlay is\n * anchored at.\n * @observable\n * @api\n */\n getPosition() {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (\n this.get(Property.POSITION)\n );\n }\n\n /**\n * Get the current positioning of this overlay.\n * @return {Positioning} How the overlay is positioned\n * relative to its point on the map.\n * @observable\n * @api\n */\n getPositioning() {\n return /** @type {Positioning} */ (this.get(Property.POSITIONING));\n }\n\n /**\n * @protected\n */\n handleElementChanged() {\n removeChildren(this.element);\n const element = this.getElement();\n if (element) {\n this.element.appendChild(element);\n }\n }\n\n /**\n * @protected\n */\n handleMapChanged() {\n if (this.mapPostrenderListenerKey) {\n removeNode(this.element);\n unlistenByKey(this.mapPostrenderListenerKey);\n this.mapPostrenderListenerKey = null;\n }\n const map = this.getMap();\n if (map) {\n this.mapPostrenderListenerKey = listen(\n map,\n MapEventType.POSTRENDER,\n this.render,\n this\n );\n this.updatePixelPosition();\n const container = this.stopEvent\n ? map.getOverlayContainerStopEvent()\n : map.getOverlayContainer();\n if (this.insertFirst) {\n container.insertBefore(this.element, container.childNodes[0] || null);\n } else {\n container.appendChild(this.element);\n }\n this.performAutoPan();\n }\n }\n\n /**\n * @protected\n */\n render() {\n this.updatePixelPosition();\n }\n\n /**\n * @protected\n */\n handleOffsetChanged() {\n this.updatePixelPosition();\n }\n\n /**\n * @protected\n */\n handlePositionChanged() {\n this.updatePixelPosition();\n this.performAutoPan();\n }\n\n /**\n * @protected\n */\n handlePositioningChanged() {\n this.updatePixelPosition();\n }\n\n /**\n * Set the DOM element to be associated with this overlay.\n * @param {HTMLElement|undefined} element The Element containing the overlay.\n * @observable\n * @api\n */\n setElement(element) {\n this.set(Property.ELEMENT, element);\n }\n\n /**\n * Set the map to be associated with this overlay.\n * @param {import(\"./Map.js\").default|null} map The map that the\n * overlay is part of. Pass `null` to just remove the overlay from the current map.\n * @observable\n * @api\n */\n setMap(map) {\n this.set(Property.MAP, map);\n }\n\n /**\n * Set the offset for this overlay.\n * @param {Array<number>} offset Offset.\n * @observable\n * @api\n */\n setOffset(offset) {\n this.set(Property.OFFSET, offset);\n }\n\n /**\n * Set the position for this overlay. If the position is `undefined` the\n * overlay is hidden.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} position The spatial point that the overlay\n * is anchored at.\n * @observable\n * @api\n */\n setPosition(position) {\n this.set(Property.POSITION, position);\n }\n\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary) using the configured autoPan parameters\n * @protected\n */\n performAutoPan() {\n if (this.autoPan) {\n this.panIntoView(this.autoPan);\n }\n }\n\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary).\n * @param {PanIntoViewOptions} [panIntoViewOptions] Options for the pan action\n * @api\n */\n panIntoView(panIntoViewOptions) {\n const map = this.getMap();\n\n if (!map || !map.getTargetElement() || !this.get(Property.POSITION)) {\n return;\n }\n\n const mapRect = this.getRect(map.getTargetElement(), map.getSize());\n const element = this.getElement();\n const overlayRect = this.getRect(element, [\n outerWidth(element),\n outerHeight(element),\n ]);\n\n panIntoViewOptions = panIntoViewOptions || {};\n\n const myMargin =\n panIntoViewOptions.margin === undefined ? 20 : panIntoViewOptions.margin;\n if (!containsExtent(mapRect, overlayRect)) {\n // the overlay is not completely inside the viewport, so pan the map\n const offsetLeft = overlayRect[0] - mapRect[0];\n const offsetRight = mapRect[2] - overlayRect[2];\n const offsetTop = overlayRect[1] - mapRect[1];\n const offsetBottom = mapRect[3] - overlayRect[3];\n\n const delta = [0, 0];\n if (offsetLeft < 0) {\n // move map to the left\n delta[0] = offsetLeft - myMargin;\n } else if (offsetRight < 0) {\n // move map to the right\n delta[0] = Math.abs(offsetRight) + myMargin;\n }\n if (offsetTop < 0) {\n // move map up\n delta[1] = offsetTop - myMargin;\n } else if (offsetBottom < 0) {\n // move map down\n delta[1] = Math.abs(offsetBottom) + myMargin;\n }\n\n if (delta[0] !== 0 || delta[1] !== 0) {\n const center = /** @type {import(\"./coordinate.js\").Coordinate} */ (\n map.getView().getCenterInternal()\n );\n const centerPx = map.getPixelFromCoordinateInternal(center);\n if (!centerPx) {\n return;\n }\n const newCenterPx = [centerPx[0] + delta[0], centerPx[1] + delta[1]];\n\n const panOptions = panIntoViewOptions.animation || {};\n map.getView().animateInternal({\n center: map.getCoordinateFromPixelInternal(newCenterPx),\n duration: panOptions.duration,\n easing: panOptions.easing,\n });\n }\n }\n }\n\n /**\n * Get the extent of an element relative to the document\n * @param {HTMLElement} element The element.\n * @param {import(\"./size.js\").Size} size The size of the element.\n * @return {import(\"./extent.js\").Extent} The extent.\n * @protected\n */\n getRect(element, size) {\n const box = element.getBoundingClientRect();\n const offsetX = box.left + window.pageXOffset;\n const offsetY = box.top + window.pageYOffset;\n return [offsetX, offsetY, offsetX + size[0], offsetY + size[1]];\n }\n\n /**\n * Set the positioning for this overlay.\n * @param {Positioning} positioning how the overlay is\n * positioned relative to its point on the map.\n * @observable\n * @api\n */\n setPositioning(positioning) {\n this.set(Property.POSITIONING, positioning);\n }\n\n /**\n * Modify the visibility of the element.\n * @param {boolean} visible Element visibility.\n * @protected\n */\n setVisible(visible) {\n if (this.rendered.visible !== visible) {\n this.element.style.display = visible ? '' : 'none';\n this.rendered.visible = visible;\n }\n }\n\n /**\n * Update pixel position.\n * @protected\n */\n updatePixelPosition() {\n const map = this.getMap();\n const position = this.getPosition();\n if (!map || !map.isRendered() || !position) {\n this.setVisible(false);\n return;\n }\n\n const pixel = map.getPixelFromCoordinate(position);\n const mapSize = map.getSize();\n this.updateRenderedPosition(pixel, mapSize);\n }\n\n /**\n * @param {import(\"./pixel.js\").Pixel} pixel The pixel location.\n * @param {import(\"./size.js\").Size|undefined} mapSize The map size.\n * @protected\n */\n updateRenderedPosition(pixel, mapSize) {\n const style = this.element.style;\n const offset = this.getOffset();\n\n const positioning = this.getPositioning();\n\n this.setVisible(true);\n\n const x = Math.round(pixel[0] + offset[0]) + 'px';\n const y = Math.round(pixel[1] + offset[1]) + 'px';\n let posX = '0%';\n let posY = '0%';\n if (\n positioning == 'bottom-right' ||\n positioning == 'center-right' ||\n positioning == 'top-right'\n ) {\n posX = '-100%';\n } else if (\n positioning == 'bottom-center' ||\n positioning == 'center-center' ||\n positioning == 'top-center'\n ) {\n posX = '-50%';\n }\n if (\n positioning == 'bottom-left' ||\n positioning == 'bottom-center' ||\n positioning == 'bottom-right'\n ) {\n posY = '-100%';\n } else if (\n positioning == 'center-left' ||\n positioning == 'center-center' ||\n positioning == 'center-right'\n ) {\n posY = '-50%';\n }\n const transform = `translate(${posX}, ${posY}) translate(${x}, ${y})`;\n if (this.rendered.transform_ != transform) {\n this.rendered.transform_ = transform;\n style.transform = transform;\n }\n }\n\n /**\n * returns the options this Overlay has been created with\n * @return {Options} overlay options\n */\n getOptions() {\n return this.options;\n }\n}\n\nexport default Overlay;\n","/**\n * @module ol/extent\n */\nimport Relationship from './extent/Relationship.js';\nimport {assert} from './asserts.js';\n\n/**\n * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.\n * @typedef {Array<number>} Extent\n * @api\n */\n\n/**\n * Extent corner.\n * @typedef {'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'} Corner\n */\n\n/**\n * Build an extent that includes all given coordinates.\n *\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @return {Extent} Bounding extent.\n * @api\n */\nexport function boundingExtent(coordinates) {\n const extent = createEmpty();\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Array<number>} xs Xs.\n * @param {Array<number>} ys Ys.\n * @param {Extent} [dest] Destination extent.\n * @private\n * @return {Extent} Extent.\n */\nfunction _boundingExtentXYs(xs, ys, dest) {\n const minX = Math.min.apply(null, xs);\n const minY = Math.min.apply(null, ys);\n const maxX = Math.max.apply(null, xs);\n const maxY = Math.max.apply(null, ys);\n return createOrUpdate(minX, minY, maxX, maxY, dest);\n}\n\n/**\n * Return extent increased by the provided value.\n * @param {Extent} extent Extent.\n * @param {number} value The amount by which the extent should be buffered.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n * @api\n */\nexport function buffer(extent, value, dest) {\n if (dest) {\n dest[0] = extent[0] - value;\n dest[1] = extent[1] - value;\n dest[2] = extent[2] + value;\n dest[3] = extent[3] + value;\n return dest;\n } else {\n return [\n extent[0] - value,\n extent[1] - value,\n extent[2] + value,\n extent[3] + value,\n ];\n }\n}\n\n/**\n * Creates a clone of an extent.\n *\n * @param {Extent} extent Extent to clone.\n * @param {Extent} [dest] Extent.\n * @return {Extent} The clone.\n */\nexport function clone(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n } else {\n return extent.slice();\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {number} Closest squared distance.\n */\nexport function closestSquaredDistanceXY(extent, x, y) {\n let dx, dy;\n if (x < extent[0]) {\n dx = extent[0] - x;\n } else if (extent[2] < x) {\n dx = x - extent[2];\n } else {\n dx = 0;\n }\n if (y < extent[1]) {\n dy = extent[1] - y;\n } else if (extent[3] < y) {\n dy = y - extent[3];\n } else {\n dy = 0;\n }\n return dx * dx + dy * dy;\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} The coordinate is contained in the extent.\n * @api\n */\nexport function containsCoordinate(extent, coordinate) {\n return containsXY(extent, coordinate[0], coordinate[1]);\n}\n\n/**\n * Check if one extent contains another.\n *\n * An extent is deemed contained if it lies completely within the other extent,\n * including if they share one or more edges.\n *\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The second extent is contained by or on the edge of the\n * first.\n * @api\n */\nexport function containsExtent(extent1, extent2) {\n return (\n extent1[0] <= extent2[0] &&\n extent2[2] <= extent1[2] &&\n extent1[1] <= extent2[1] &&\n extent2[3] <= extent1[3]\n );\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {number} x X coordinate.\n * @param {number} y Y coordinate.\n * @return {boolean} The x, y values are contained in the extent.\n * @api\n */\nexport function containsXY(extent, x, y) {\n return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];\n}\n\n/**\n * Get the relationship between a coordinate and extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate The coordinate.\n * @return {import(\"./extent/Relationship.js\").default} The relationship (bitwise compare with\n * import(\"./extent/Relationship.js\").Relationship).\n */\nexport function coordinateRelationship(extent, coordinate) {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const x = coordinate[0];\n const y = coordinate[1];\n let relationship = Relationship.UNKNOWN;\n if (x < minX) {\n relationship = relationship | Relationship.LEFT;\n } else if (x > maxX) {\n relationship = relationship | Relationship.RIGHT;\n }\n if (y < minY) {\n relationship = relationship | Relationship.BELOW;\n } else if (y > maxY) {\n relationship = relationship | Relationship.ABOVE;\n }\n if (relationship === Relationship.UNKNOWN) {\n relationship = Relationship.INTERSECTING;\n }\n return relationship;\n}\n\n/**\n * Create an empty extent.\n * @return {Extent} Empty extent.\n * @api\n */\nexport function createEmpty() {\n return [Infinity, Infinity, -Infinity, -Infinity];\n}\n\n/**\n * Create a new extent or update the provided extent.\n * @param {number} minX Minimum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxX Maximum X.\n * @param {number} maxY Maximum Y.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdate(minX, minY, maxX, maxY, dest) {\n if (dest) {\n dest[0] = minX;\n dest[1] = minY;\n dest[2] = maxX;\n dest[3] = maxY;\n return dest;\n } else {\n return [minX, minY, maxX, maxY];\n }\n}\n\n/**\n * Create a new empty extent or make the provided one empty.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateEmpty(dest) {\n return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, dest);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinate(coordinate, dest) {\n const x = coordinate[0];\n const y = coordinate[1];\n return createOrUpdate(x, y, x, y, dest);\n}\n\n/**\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinates(coordinates, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendCoordinates(extent, coordinates);\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromFlatCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n dest\n) {\n const extent = createOrUpdateEmpty(dest);\n return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);\n}\n\n/**\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromRings(rings, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendRings(extent, rings);\n}\n\n/**\n * Determine if two extents are equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The two extents are equivalent.\n * @api\n */\nexport function equals(extent1, extent2) {\n return (\n extent1[0] == extent2[0] &&\n extent1[2] == extent2[2] &&\n extent1[1] == extent2[1] &&\n extent1[3] == extent2[3]\n );\n}\n\n/**\n * Determine if two extents are approximately equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {number} tolerance Tolerance in extent coordinate units.\n * @return {boolean} The two extents differ by less than the tolerance.\n */\nexport function approximatelyEquals(extent1, extent2, tolerance) {\n return (\n Math.abs(extent1[0] - extent2[0]) < tolerance &&\n Math.abs(extent1[2] - extent2[2]) < tolerance &&\n Math.abs(extent1[1] - extent2[1]) < tolerance &&\n Math.abs(extent1[3] - extent2[3]) < tolerance\n );\n}\n\n/**\n * Modify an extent to include another extent.\n * @param {Extent} extent1 The extent to be modified.\n * @param {Extent} extent2 The extent that will be included in the first.\n * @return {Extent} A reference to the first (extended) extent.\n * @api\n */\nexport function extend(extent1, extent2) {\n if (extent2[0] < extent1[0]) {\n extent1[0] = extent2[0];\n }\n if (extent2[2] > extent1[2]) {\n extent1[2] = extent2[2];\n }\n if (extent2[1] < extent1[1]) {\n extent1[1] = extent2[1];\n }\n if (extent2[3] > extent1[3]) {\n extent1[3] = extent2[3];\n }\n return extent1;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n */\nexport function extendCoordinate(extent, coordinate) {\n if (coordinate[0] < extent[0]) {\n extent[0] = coordinate[0];\n }\n if (coordinate[0] > extent[2]) {\n extent[2] = coordinate[0];\n }\n if (coordinate[1] < extent[1]) {\n extent[1] = coordinate[1];\n }\n if (coordinate[1] > extent[3]) {\n extent[3] = coordinate[1];\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @return {Extent} Extent.\n */\nexport function extendCoordinates(extent, coordinates) {\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Extent} Extent.\n */\nexport function extendFlatCoordinates(\n extent,\n flatCoordinates,\n offset,\n end,\n stride\n) {\n for (; offset < end; offset += stride) {\n extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @return {Extent} Extent.\n */\nexport function extendRings(extent, rings) {\n for (let i = 0, ii = rings.length; i < ii; ++i) {\n extendCoordinates(extent, rings[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n */\nexport function extendXY(extent, x, y) {\n extent[0] = Math.min(extent[0], x);\n extent[1] = Math.min(extent[1], y);\n extent[2] = Math.max(extent[2], x);\n extent[3] = Math.max(extent[3], y);\n}\n\n/**\n * This function calls `callback` for each corner of the extent. If the\n * callback returns a truthy value the function returns that value\n * immediately. Otherwise the function returns `false`.\n * @param {Extent} extent Extent.\n * @param {function(import(\"./coordinate.js\").Coordinate): S} callback Callback.\n * @return {S|boolean} Value.\n * @template S\n */\nexport function forEachCorner(extent, callback) {\n let val;\n val = callback(getBottomLeft(extent));\n if (val) {\n return val;\n }\n val = callback(getBottomRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopLeft(extent));\n if (val) {\n return val;\n }\n return false;\n}\n\n/**\n * Get the size of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Area.\n * @api\n */\nexport function getArea(extent) {\n let area = 0;\n if (!isEmpty(extent)) {\n area = getWidth(extent) * getHeight(extent);\n }\n return area;\n}\n\n/**\n * Get the bottom left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom left coordinate.\n * @api\n */\nexport function getBottomLeft(extent) {\n return [extent[0], extent[1]];\n}\n\n/**\n * Get the bottom right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom right coordinate.\n * @api\n */\nexport function getBottomRight(extent) {\n return [extent[2], extent[1]];\n}\n\n/**\n * Get the center coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Center.\n * @api\n */\nexport function getCenter(extent) {\n return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];\n}\n\n/**\n * Get a corner coordinate of an extent.\n * @param {Extent} extent Extent.\n * @param {Corner} corner Corner.\n * @return {import(\"./coordinate.js\").Coordinate} Corner coordinate.\n */\nexport function getCorner(extent, corner) {\n let coordinate;\n if (corner === 'bottom-left') {\n coordinate = getBottomLeft(extent);\n } else if (corner === 'bottom-right') {\n coordinate = getBottomRight(extent);\n } else if (corner === 'top-left') {\n coordinate = getTopLeft(extent);\n } else if (corner === 'top-right') {\n coordinate = getTopRight(extent);\n } else {\n assert(false, 13); // Invalid corner\n }\n return coordinate;\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Enlarged area.\n */\nexport function getEnlargedArea(extent1, extent2) {\n const minX = Math.min(extent1[0], extent2[0]);\n const minY = Math.min(extent1[1], extent2[1]);\n const maxX = Math.max(extent1[2], extent2[2]);\n const maxY = Math.max(extent1[3], extent2[3]);\n return (maxX - minX) * (maxY - minY);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nexport function getForViewAndSize(center, resolution, rotation, size, dest) {\n const [x0, y0, x1, y1, x2, y2, x3, y3] = getRotatedViewport(\n center,\n resolution,\n rotation,\n size\n );\n return createOrUpdate(\n Math.min(x0, x1, x2, x3),\n Math.min(y0, y1, y2, y3),\n Math.max(x0, x1, x2, x3),\n Math.max(y0, y1, y2, y3),\n dest\n );\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @return {Array<number>} Linear ring representing the viewport.\n */\nexport function getRotatedViewport(center, resolution, rotation, size) {\n const dx = (resolution * size[0]) / 2;\n const dy = (resolution * size[1]) / 2;\n const cosRotation = Math.cos(rotation);\n const sinRotation = Math.sin(rotation);\n const xCos = dx * cosRotation;\n const xSin = dx * sinRotation;\n const yCos = dy * cosRotation;\n const ySin = dy * sinRotation;\n const x = center[0];\n const y = center[1];\n return [\n x - xCos + ySin,\n y - xSin - yCos,\n x - xCos - ySin,\n y - xSin + yCos,\n x + xCos - ySin,\n y + xSin + yCos,\n x + xCos + ySin,\n y + xSin - yCos,\n x - xCos + ySin,\n y - xSin - yCos,\n ];\n}\n\n/**\n * Get the height of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Height.\n * @api\n */\nexport function getHeight(extent) {\n return extent[3] - extent[1];\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Intersection area.\n */\nexport function getIntersectionArea(extent1, extent2) {\n const intersection = getIntersection(extent1, extent2);\n return getArea(intersection);\n}\n\n/**\n * Get the intersection of two extents.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {Extent} [dest] Optional extent to populate with intersection.\n * @return {Extent} Intersecting extent.\n * @api\n */\nexport function getIntersection(extent1, extent2, dest) {\n const intersection = dest ? dest : createEmpty();\n if (intersects(extent1, extent2)) {\n if (extent1[0] > extent2[0]) {\n intersection[0] = extent1[0];\n } else {\n intersection[0] = extent2[0];\n }\n if (extent1[1] > extent2[1]) {\n intersection[1] = extent1[1];\n } else {\n intersection[1] = extent2[1];\n }\n if (extent1[2] < extent2[2]) {\n intersection[2] = extent1[2];\n } else {\n intersection[2] = extent2[2];\n }\n if (extent1[3] < extent2[3]) {\n intersection[3] = extent1[3];\n } else {\n intersection[3] = extent2[3];\n }\n } else {\n createOrUpdateEmpty(intersection);\n }\n return intersection;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @return {number} Margin.\n */\nexport function getMargin(extent) {\n return getWidth(extent) + getHeight(extent);\n}\n\n/**\n * Get the size (width, height) of an extent.\n * @param {Extent} extent The extent.\n * @return {import(\"./size.js\").Size} The extent size.\n * @api\n */\nexport function getSize(extent) {\n return [extent[2] - extent[0], extent[3] - extent[1]];\n}\n\n/**\n * Get the top left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top left coordinate.\n * @api\n */\nexport function getTopLeft(extent) {\n return [extent[0], extent[3]];\n}\n\n/**\n * Get the top right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top right coordinate.\n * @api\n */\nexport function getTopRight(extent) {\n return [extent[2], extent[3]];\n}\n\n/**\n * Get the width of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Width.\n * @api\n */\nexport function getWidth(extent) {\n return extent[2] - extent[0];\n}\n\n/**\n * Determine if one extent intersects another.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent.\n * @return {boolean} The two extents intersect.\n * @api\n */\nexport function intersects(extent1, extent2) {\n return (\n extent1[0] <= extent2[2] &&\n extent1[2] >= extent2[0] &&\n extent1[1] <= extent2[3] &&\n extent1[3] >= extent2[1]\n );\n}\n\n/**\n * Determine if an extent is empty.\n * @param {Extent} extent Extent.\n * @return {boolean} Is empty.\n * @api\n */\nexport function isEmpty(extent) {\n return extent[2] < extent[0] || extent[3] < extent[1];\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function returnOrUpdate(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n } else {\n return extent;\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} value Value.\n */\nexport function scaleFromCenter(extent, value) {\n const deltaX = ((extent[2] - extent[0]) / 2) * (value - 1);\n const deltaY = ((extent[3] - extent[1]) / 2) * (value - 1);\n extent[0] -= deltaX;\n extent[2] += deltaX;\n extent[1] -= deltaY;\n extent[3] += deltaY;\n}\n\n/**\n * Determine if the segment between two coordinates intersects (crosses,\n * touches, or is contained by) the provided extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} start Segment start coordinate.\n * @param {import(\"./coordinate.js\").Coordinate} end Segment end coordinate.\n * @return {boolean} The segment intersects the extent.\n */\nexport function intersectsSegment(extent, start, end) {\n let intersects = false;\n const startRel = coordinateRelationship(extent, start);\n const endRel = coordinateRelationship(extent, end);\n if (\n startRel === Relationship.INTERSECTING ||\n endRel === Relationship.INTERSECTING\n ) {\n intersects = true;\n } else {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const startX = start[0];\n const startY = start[1];\n const endX = end[0];\n const endY = end[1];\n const slope = (endY - startY) / (endX - startX);\n let x, y;\n if (!!(endRel & Relationship.ABOVE) && !(startRel & Relationship.ABOVE)) {\n // potentially intersects top\n x = endX - (endY - maxY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.RIGHT) &&\n !(startRel & Relationship.RIGHT)\n ) {\n // potentially intersects right\n y = endY - (endX - maxX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.BELOW) &&\n !(startRel & Relationship.BELOW)\n ) {\n // potentially intersects bottom\n x = endX - (endY - minY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.LEFT) &&\n !(startRel & Relationship.LEFT)\n ) {\n // potentially intersects left\n y = endY - (endX - minX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n }\n return intersects;\n}\n\n/**\n * Apply a transform function to the extent.\n * @param {Extent} extent Extent.\n * @param {import(\"./proj.js\").TransformFunction} transformFn Transform function.\n * Called with `[minX, minY, maxX, maxY]` extent coordinates.\n * @param {Extent} [dest] Destination extent.\n * @param {number} [stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {Extent} Extent.\n * @api\n */\nexport function applyTransform(extent, transformFn, dest, stops) {\n let coordinates = [];\n if (stops > 1) {\n const width = extent[2] - extent[0];\n const height = extent[3] - extent[1];\n for (let i = 0; i < stops; ++i) {\n coordinates.push(\n extent[0] + (width * i) / stops,\n extent[1],\n extent[2],\n extent[1] + (height * i) / stops,\n extent[2] - (width * i) / stops,\n extent[3],\n extent[0],\n extent[3] - (height * i) / stops\n );\n }\n } else {\n coordinates = [\n extent[0],\n extent[1],\n extent[2],\n extent[1],\n extent[2],\n extent[3],\n extent[0],\n extent[3],\n ];\n }\n transformFn(coordinates, coordinates, 2);\n const xs = [];\n const ys = [];\n for (let i = 0, l = coordinates.length; i < l; i += 2) {\n xs.push(coordinates[i]);\n ys.push(coordinates[i + 1]);\n }\n return _boundingExtentXYs(xs, ys, dest);\n}\n\n/**\n * Modifies the provided extent in-place to be within the real world\n * extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Extent} The extent within the real world extent.\n */\nexport function wrapX(extent, projection) {\n const projectionExtent = projection.getExtent();\n const center = getCenter(extent);\n if (\n projection.canWrapX() &&\n (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])\n ) {\n const worldWidth = getWidth(projectionExtent);\n const worldsAway = Math.floor(\n (center[0] - projectionExtent[0]) / worldWidth\n );\n const offset = worldsAway * worldWidth;\n extent[0] -= offset;\n extent[2] -= offset;\n }\n return extent;\n}\n\n/**\n * Fits the extent to the real world\n *\n * If the extent does not cross the anti meridian, this will return the extent in an array\n * If the extent crosses the anti meridian, the extent will be sliced, so each part fits within the\n * real world\n *\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Array<Extent>} The extent within the real world extent.\n */\nexport function wrapAndSliceX(extent, projection) {\n if (projection.canWrapX()) {\n const projectionExtent = projection.getExtent();\n\n if (!isFinite(extent[0]) || !isFinite(extent[2])) {\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n }\n\n wrapX(extent, projection);\n const worldWidth = getWidth(projectionExtent);\n\n if (getWidth(extent) > worldWidth) {\n // the extent wraps around on itself\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n } else if (extent[0] < projectionExtent[0]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [\n [extent[0] + worldWidth, extent[1], projectionExtent[2], extent[3]],\n [projectionExtent[0], extent[1], extent[2], extent[3]],\n ];\n } else if (extent[2] > projectionExtent[2]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [\n [extent[0], extent[1], projectionExtent[2], extent[3]],\n [projectionExtent[0], extent[1], extent[2] - worldWidth, extent[3]],\n ];\n }\n }\n\n return [extent];\n}\n","/**\n * Vanilla JS Modal compatible with Bootstrap\n * modal-vanilla 0.12.0 <https://github.com/KaneCohen/modal-vanilla>\n * Copyright 2020 Kane Cohen <https://github.com/KaneCohen>\n * Available under BSD-3-Clause license\n */\nimport EventEmitter from 'events';\n\nlet _factory = null;\n\nconst _defaults = Object.freeze({\n el: null, // Existing DOM element that will be 'Modal-ized'.\n animate: true, // Show Modal using animation.\n animateClass: 'fade', //\n animateInClass: 'show', //\n appendTo: 'body', // DOM element to which constructed Modal will be appended.\n backdrop: true, // Boolean or 'static', Show Modal backdrop blocking content.\n keyboard: true, // Close modal on esc key.\n title: false, // Content of the title in the constructed dialog.\n header: true, // Show header content.\n content: false, // Either string or an HTML element.\n footer: true, // Footer content. By default will use buttons.\n buttons: null, //\n headerClose: true, // Show close button in the header.\n construct: false, // Creates new HTML with a given content.\n transition: 300, //\n backdropTransition: 150 //\n});\n\nconst _buttons = deepFreeze({\n dialog: [\n {text: 'Cancel',\n value: false,\n attr: {\n 'class': 'btn btn-default',\n 'data-dismiss': 'modal'\n }\n },\n {text: 'OK',\n value: true,\n attr: {\n 'class': 'btn btn-primary',\n 'data-dismiss': 'modal'\n }\n }\n ],\n alert: [\n {text: 'OK',\n attr: {\n 'class': 'btn btn-primary',\n 'data-dismiss': 'modal'\n }\n }\n ],\n confirm: [\n {text: 'Cancel',\n value: false,\n attr: {\n 'class': 'btn btn-default',\n 'data-dismiss': 'modal'\n }\n },\n {text: 'OK',\n value: true,\n attr: {\n 'class': 'btn btn-primary',\n 'data-dismiss': 'modal'\n }\n }\n ]\n});\n\nconst _templates = {\n container: '<div class=\"modal\"></div>',\n dialog: '<div class=\"modal-dialog\"></div>',\n content: '<div class=\"modal-content\"></div>',\n header: '<div class=\"modal-header\"></div>',\n headerClose: '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>',\n body: '<div class=\"modal-body\"></div>',\n footer: '<div class=\"modal-footer\"></div>',\n backdrop: '<div class=\"modal-backdrop\"></div>'\n};\n\nfunction deepFreeze(obj) {\n for (let k in obj) {\n if (Array.isArray(obj[k])) {\n obj[k].forEach(v => {\n deepFreeze(v);\n });\n } else if (obj[k] !== null && typeof obj[k] === 'object') {\n Object.freeze(obj[k]);\n }\n }\n return Object.freeze(obj);\n}\n\nfunction guid() {\n return (((1 + Math.random()) * 0x10000) | 0).toString(16) +\n (((1 + Math.random()) * 0x10000) | 0).toString(16);\n}\n\nfunction data(el, prop, value) {\n let prefix = 'data';\n let elData = el[prefix] || {};\n if (typeof value === 'undefined') {\n if (el[prefix] && el[prefix][prop]) {\n return el[prefix][prop];\n } else {\n var dataAttr = el.getAttribute(`${prefix}-${prop}`);\n if (typeof dataAttr !== 'undefined') {\n return dataAttr;\n }\n return null;\n }\n } else {\n elData[prop] = value;\n el[prefix] = elData;\n return el;\n }\n}\n\nfunction build(html, all) {\n if (html.nodeName) return html;\n html = html.replace(/(\\t|\\n$)/g, '');\n\n if (!_factory) {\n _factory = document.createElement('div');\n }\n\n _factory.innerHTML = '';\n _factory.innerHTML = html;\n if (all === true) {\n return _factory.childNodes;\n } else {\n return _factory.childNodes[0];\n }\n}\n\nfunction calcScrollbarWidth() {\n let inner;\n let width;\n let outerWidth;\n let outer = document.createElement('div');\n Object.assign(outer.style, {\n visibility: 'hidden',\n width: '100px'\n });\n document.body.appendChild(outer);\n\n outerWidth = outer.offsetWidth;\n outer.style.overflow = 'scroll';\n\n inner = document.createElement('div');\n inner.style.width = '100%';\n outer.appendChild(inner);\n\n width = outerWidth - inner.offsetWidth;\n document.body.removeChild(outer);\n\n return width;\n}\n\nfunction getPath(node) {\n let nodes = [node];\n while (node.parentNode) {\n node = node.parentNode;\n nodes.push(node);\n }\n return nodes;\n}\n\nclass Modal extends EventEmitter {\n static set templates(templates) {\n this._baseTemplates = templates;\n }\n\n static get templates() {\n return Object.assign({}, _templates, Modal._baseTemplates || {});\n }\n\n static set buttons(buttons) {\n this._baseButtons = buttons;\n }\n\n static get buttons() {\n return Object.assign({}, _buttons, Modal._baseButtons || {});\n }\n\n static set options(options) {\n this._baseOptions = options;\n }\n\n static get options() {\n return Object.assign({}, _defaults, Modal._baseOptions || {});\n }\n\n static get version() {\n return '0.12.0';\n }\n\n static alert(message, _options = {}) {\n let options = Object.assign({},\n _defaults,\n {\n title: message,\n content: false,\n construct: true,\n headerClose: false,\n buttons: Modal.buttons.alert\n },\n _options\n );\n\n return new Modal(options);\n }\n\n static confirm(question, _options = {}) {\n let options = Object.assign({},\n _defaults,\n {\n title: question,\n content: false,\n construct: true,\n headerClose: false,\n buttons: Modal.buttons.confirm\n },\n _options\n );\n\n return new Modal(options);\n }\n\n constructor(options = {}) {\n super();\n\n this.id = guid();\n this.el = null;\n this._html = {};\n this._events = {};\n this._visible = false;\n this._pointerInContent = false;\n this._options = Object.assign({}, Modal.options, options);\n this._templates = Object.assign({}, Modal.templates, options.templates || {});\n this._html.appendTo = document.querySelector(this._options.appendTo);\n this._scrollbarWidth = calcScrollbarWidth();\n\n if (this._options.buttons === null) {\n this._options.buttons = Modal.buttons.dialog;\n }\n\n if (this._options.el) {\n let el = this._options.el;\n if (typeof this._options.el == 'string') {\n el = document.querySelector(this._options.el);\n if (! el) {\n throw new Error(`Selector: DOM Element ${this._options.el} not found.`);\n }\n }\n data(el, 'modal', this);\n this.el = el;\n } else {\n this._options.construct = true;\n }\n\n if (this._options.construct) {\n this._render();\n } else {\n this._mapDom();\n }\n }\n\n _render() {\n let html = this._html;\n let o = this._options;\n let t = this._templates;\n let animate = o.animate ? o.animateClass : false;\n\n html.container = build(t.container);\n html.dialog = build(t.dialog);\n html.content = build(t.content);\n html.header = build(t.header);\n html.headerClose = build(t.headerClose);\n html.body = build(t.body);\n html.footer = build(t.footer);\n if (animate) html.container.classList.add(animate);\n\n this._setHeader();\n this._setContent();\n this._setFooter();\n\n this.el = html.container;\n\n html.dialog.appendChild(html.content);\n html.container.appendChild(html.dialog);\n\n return this;\n }\n\n _mapDom() {\n let html = this._html;\n let o = this._options;\n\n if (this.el.classList.contains(o.animateClass)) {\n o.animate = true;\n }\n\n html.container = this.el;\n html.dialog = this.el.querySelector('.modal-dialog');\n html.content = this.el.querySelector('.modal-content');\n html.header = this.el.querySelector('.modal-header');\n html.headerClose = this.el.querySelector('.modal-header .close');\n html.body = this.el.querySelector('.modal-body');\n html.footer = this.el.querySelector('.modal-footer');\n\n this._setHeader();\n this._setContent();\n this._setFooter();\n\n return this;\n }\n\n _setHeader() {\n let html = this._html;\n let o = this._options;\n\n if (o.header && html.header) {\n if (o.title.nodeName) {\n html.header.innerHTML = o.title.outerHTML;\n } else if (typeof o.title === 'string') {\n html.header.innerHTML = `<h4 class=\"modal-title\">${o.title}</h4>`;\n }\n // Add header close button only to constructed modals.\n if (this.el === null && html.headerClose && o.headerClose) {\n html.header.appendChild(html.headerClose);\n }\n if (o.construct) {\n html.content.appendChild(html.header);\n }\n }\n }\n\n _setContent() {\n let html = this._html;\n let o = this._options;\n\n if (o.content && html.body) {\n if (typeof o.content === 'string') {\n html.body.innerHTML = o.content;\n } else {\n html.body.innerHTML = o.content.outerHTML;\n }\n if (o.construct) {\n html.content.appendChild(html.body);\n }\n }\n }\n\n _setFooter() {\n let html = this._html;\n let o = this._options;\n\n if (o.footer && html.footer) {\n if (o.footer.nodeName) {\n html.footer.ineerHTML = o.footer.outerHTML;\n } else if (typeof o.footer === 'string') {\n html.footer.innerHTML = o.footer;\n } else if (! html.footer.children.length) {\n o.buttons.forEach((button) => {\n let el = document.createElement('button');\n data(el, 'button', button);\n el.innerHTML = button.text;\n el.setAttribute('type', 'button');\n for (let j in button.attr) {\n el.setAttribute(j, button.attr[j]);\n }\n html.footer.appendChild(el);\n });\n }\n if (o.construct) {\n html.content.appendChild(html.footer);\n }\n }\n\n }\n\n _setEvents() {\n let o = this._options;\n let html = this._html;\n\n this._events.keydownHandler = this._handleKeydownEvent.bind(this);\n document.body.addEventListener('keydown',\n this._events.keydownHandler\n );\n\n this._events.mousedownHandler = this._handleMousedownEvent.bind(this);\n html.container.addEventListener('mousedown',\n this._events.mousedownHandler\n );\n\n this._events.clickHandler = this._handleClickEvent.bind(this);\n html.container.addEventListener('click',\n this._events.clickHandler\n );\n\n this._events.resizeHandler = this._handleResizeEvent.bind(this);\n window.addEventListener('resize',\n this._events.resizeHandler\n );\n }\n\n _handleMousedownEvent(e) {\n this._pointerInContent = false;\n let path = getPath(e.target);\n path.every(node => {\n if (node.classList && node.classList.contains('modal-content')) {\n this._pointerInContent = true;\n return false;\n }\n return true;\n });\n }\n\n _handleClickEvent(e) {\n let path = getPath(e.target);\n path.every(node => {\n if (node.tagName === 'HTML') {\n return false;\n }\n if (this._options.backdrop !== true && node.classList.contains('modal')) {\n return false;\n }\n if (node.classList.contains('modal-content')) {\n return false;\n }\n if (node.getAttribute('data-dismiss') === 'modal') {\n this.emit('dismiss', this, e, data(e.target, 'button'));\n this.hide();\n return false;\n }\n\n if (!this._pointerInContent && node.classList.contains('modal')) {\n this.emit('dismiss', this, e, null);\n this.hide();\n return false;\n }\n return true;\n });\n\n this._pointerInContent = false;\n }\n\n _handleKeydownEvent(e) {\n if (e.which === 27 && this._options.keyboard) {\n this.emit('dismiss', this, e, null);\n this.hide();\n }\n }\n\n _handleResizeEvent(e) {\n this._resize();\n }\n\n show() {\n let o = this._options;\n let html = this._html;\n this.emit('show', this);\n\n this._checkScrollbar();\n this._setScrollbar();\n document.body.classList.add('modal-open');\n\n if (o.construct) {\n html.appendTo.appendChild(html.container);\n }\n\n html.container.style.display = 'block';\n html.container.scrollTop = 0;\n\n if (o.backdrop !== false) {\n this.once('showBackdrop', () => {\n this._setEvents();\n\n if (o.animate) html.container.offsetWidth; // Force reflow\n\n html.container.classList.add(o.animateInClass);\n\n setTimeout(() => {\n this._visible = true;\n this.emit('shown', this);\n }, o.transition);\n });\n this._backdrop();\n } else {\n this._setEvents();\n\n if (o.animate) html.container.offsetWidth; // Force reflow\n\n html.container.classList.add(o.animateInClass);\n\n setTimeout(() => {\n this._visible = true;\n this.emit('shown', this);\n }, o.transition);\n }\n this._resize();\n\n return this;\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _resize() {\n var modalIsOverflowing =\n this._html.container.scrollHeight > document.documentElement.clientHeight;\n\n this._html.container.style.paddingLeft =\n ! this.bodyIsOverflowing && modalIsOverflowing ? this._scrollbarWidth + 'px' : '';\n\n this._html.container.style.paddingRight =\n this.bodyIsOverflowing && ! modalIsOverflowing ? this._scrollbarWidth + 'px' : '';\n }\n\n _backdrop() {\n let html = this._html;\n let t = this._templates;\n let o = this._options;\n let animate = o.animate ? o.animateClass : false;\n\n html.backdrop = build(t.backdrop);\n if (animate) html.backdrop.classList.add(animate);\n html.appendTo.appendChild(html.backdrop);\n\n if (animate) html.backdrop.offsetWidth;\n\n html.backdrop.classList.add(o.animateInClass);\n\n setTimeout(() => {\n this.emit('showBackdrop', this);\n }, this._options.backdropTransition);\n }\n\n hide() {\n let html = this._html;\n let o = this._options;\n let contCList = html.container.classList;\n this.emit('hide', this);\n\n contCList.remove(o.animateInClass);\n\n if (o.backdrop) {\n let backCList = html.backdrop.classList;\n backCList.remove(o.animateInClass);\n }\n\n this._removeEvents();\n\n setTimeout(() => {\n document.body.classList.remove('modal-open');\n document.body.style.paddingRight = this.originalBodyPad;\n }, o.backdropTransition);\n\n setTimeout(() => {\n if (o.backdrop) {\n html.backdrop.parentNode.removeChild(html.backdrop);\n }\n html.container.style.display = 'none';\n\n if (o.construct) {\n html.container.parentNode.removeChild(html.container);\n }\n\n this._visible = false;\n this.emit('hidden', this);\n }, o.transition);\n\n return this;\n }\n\n _removeEvents() {\n if (this._events.keydownHandler) {\n document.body.removeEventListener('keydown',\n this._events.keydownHandler\n );\n }\n\n this._html.container.removeEventListener('mousedown',\n this._events.mousedownHandler\n );\n\n this._html.container.removeEventListener('click',\n this._events.clickHandler\n );\n\n window.removeEventListener('resize',\n this._events.resizeHandler\n );\n }\n\n _checkScrollbar() {\n this.bodyIsOverflowing = document.body.clientWidth < window.innerWidth;\n }\n\n _setScrollbar() {\n this.originalBodyPad = document.body.style.paddingRight || '';\n if (this.bodyIsOverflowing) {\n let basePadding = parseInt(this.originalBodyPad || 0, 10);\n document.body.style.paddingRight = basePadding + this._scrollbarWidth + 'px';\n }\n }\n}\n\nexport default Modal;\n","// External\nimport Modal from 'modal-vanilla';\n\nimport { Options } from '../ol-wfst';\n\nlet options = {};\n\n// Store layerNames that has errors\nconst isError = new Set();\n\nexport const initModal = (opts: Options['modal']) => {\n options = opts;\n};\n\nexport const parseError = (geoserverError) => {\n if ('exceptions' in geoserverError) {\n return geoserverError.exceptions.map((e) => e.text).join(',');\n } else {\n return '';\n }\n};\n\n/**\n * Show modal with errors\n *\n * @param msg\n * @private\n */\nexport const showError = (\n msg: string,\n originalError: Error = null,\n layerName = ''\n): void => {\n // Prevent multiples modals error in the same layer\n if (isError.has(layerName)) {\n return;\n }\n\n isError.add(layerName);\n\n let err_msg = `<b>Error: ${msg}</b>`;\n if (originalError) {\n err_msg += `. ${originalError.message}`;\n }\n\n const al = Modal.alert(err_msg, options);\n\n al.show();\n\n al.on('hidden', () => {\n isError.delete(layerName);\n });\n};\n","import { I18n } from '../../ol-wfst';\n\nexport const en: I18n = {\n labels: {\n select: 'Select',\n addElement: 'Toggle Draw mode',\n editElement: 'Edit feature',\n save: 'Save',\n delete: 'Delete',\n cancel: 'Cancel',\n apply: 'Apply changes',\n upload: 'Upload',\n editMode: 'Edit Mode',\n confirmDelete: 'Are you sure to delete the feature?',\n geomTypeNotSupported: 'Geometry not supported by layer',\n editFields: 'Edit fields',\n editGeom: 'Edit geometry',\n selectDrawType: 'Geometry type to draw',\n uploadToLayer: 'Upload file to selected layer',\n uploadFeatures: 'Uploaded features to layer',\n validFeatures: 'Valid geometries',\n invalidFeatures: 'Invalid',\n loading: 'Loading...',\n toggleVisibility: 'Toggle layer visibility',\n close: 'Close'\n },\n errors: {\n capabilities: 'GeoServer Capabilities could not be downloaded.',\n wfst: 'The GeoServer does not support Transactions',\n layer: 'Could not get data from layer',\n layerNotFound: 'Layer not found',\n layerNotVisible: 'Layer is not visible',\n noValidGeometry: 'No valid geometries found to add to this layer',\n geoserver: 'Failed to get data from GeoServer',\n badFormat: 'Unsupported format',\n badFile: 'Error reading items from file',\n lockFeature: 'Could not lock items on the GeoServer.',\n transaction: 'Error when doing Transaction with GeoServer.',\n getFeatures: 'Error getting elements from GeoServer.'\n }\n};\n","import { I18n } from '../../@types';\nexport * from './es';\nexport * from './en';\nexport * from './zh';\n\nimport { es } from './es';\nimport { en } from './en';\nimport { zh } from './zh';\n\nconst langs = {\n es,\n en,\n zh\n};\n\n// Set default Language\nexport let I18N: I18n = en;\n\nexport const setLang = (lang = 'en', customI18n: I18n = null): void => {\n // Check if language exists\n if (lang in langs) {\n I18N = langs[lang];\n }\n\n // Check if customs translations are provided\n if (customI18n) {\n I18N = { ...I18N, ...customI18n };\n }\n};\n\n/**\n * /**\n * For translations thas has a variable \"{}\"\" to be replaced inside\n * @param string\n * @param args\n * @returns\n */\nexport const I18N_ = (string: string, ...args: any): string => {\n let text = I18N[string];\n\n if (!text) {\n console.error('Translation not found', string);\n text = string;\n }\n\n if (args.length) {\n args.forEach((arg) => {\n text = text.replace(/{}/, arg);\n });\n }\n\n return text;\n};\n","import { I18n } from '../../ol-wfst';\n\nexport const es: I18n = {\n labels: {\n select: 'Seleccionar',\n addElement: 'Modo dibujo',\n editElement: 'Editar elemento',\n save: 'Guardar',\n delete: 'Eliminar',\n cancel: 'Cancelar',\n apply: 'Aplicar cambios',\n upload: 'Subir',\n editMode: 'Modo Edición',\n confirmDelete: '¿Estás seguro de borrar el elemento?',\n geomTypeNotSupported: 'Geometría no compatible con la capa',\n editFields: 'Editar campos',\n editGeom: 'Editar geometría',\n selectDrawType: 'Tipo de geometría para dibujar',\n uploadToLayer: 'Subir archivo a la capa seleccionada',\n uploadFeatures: 'Subida de elementos a la capa',\n validFeatures: 'Válidas',\n invalidFeatures: 'Invalidas',\n loading: 'Cargando...',\n toggleVisibility: 'Cambiar visibilidad de la capa',\n close: 'Cerrar'\n },\n errors: {\n capabilities: 'No se pudieron obtener las Capabilidades del GeoServer',\n wfst: 'El GeoServer no tiene soporte a Transacciones',\n layer: 'No se pudieron obtener datos de la capa',\n layerNotFound: 'Capa no encontrada',\n layerNotVisible: 'La capa no está visible',\n noValidGeometry:\n 'No se encontraron geometrías válidas para agregar a esta capa',\n geoserver: 'No se pudieron obtener datos desde el GeoServer',\n badFormat: 'Formato no soportado',\n badFile: 'Error al leer elementos del archivo',\n lockFeature: 'No se pudieron bloquear elementos en el GeoServer.',\n transaction: 'Error al hacer transacción con el GeoServer.',\n getFeatures: 'Error al obtener elemento desde el GeoServer.'\n }\n};\n","import { I18n } from '../../ol-wfst';\n\nexport const zh: I18n = {\n labels: {\n select: '选择',\n addElement: '切换绘图类型',\n editElement: '编辑元素',\n save: '保存',\n delete: '删除',\n cancel: '取消',\n apply: '确认并应用改变',\n upload: '上传',\n editMode: '编辑模式',\n confirmDelete: '确认删除元素?',\n geomTypeNotSupported: '图层不支持该几何',\n editFields: '编辑区域',\n editGeom: '编辑几何',\n selectDrawType: '几何类型',\n uploadToLayer: '通过文件上传图层',\n uploadFeatures: '上传元素到图层',\n validFeatures: '合法的几何类型',\n invalidFeatures: '不合法',\n loading: '加载中...',\n toggleVisibility: '切换图层透明度',\n close: '关闭'\n },\n errors: {\n capabilities: '无法加载GeoServer服务所支持的能力.',\n wfst: 'GeoServer不支持事务',\n layer: '无法从图层获得数据',\n layerNotFound: 'Layer not found',\n layerNotVisible: 'Layer is not visible',\n noValidGeometry: '不支持的几何类型无法加载到图层',\n geoserver: '无法从GeoServer获取数据',\n badFormat: '不支持的格式',\n badFile: '读取文件数据出错',\n lockFeature: '无法锁定GeoServer上的元素.',\n transaction: 'GeoServer处理事务出错.',\n getFeatures: '从GeoServer获取元素出错.'\n }\n};\n","import { I18N } from './i18n';\n\nlet loadingDiv: HTMLDivElement;\n\nexport const initLoading = (): HTMLDivElement => {\n loadingDiv = document.createElement('div');\n loadingDiv.className = 'ol-wfst--tools-control--loading';\n loadingDiv.innerHTML = I18N.labels.loading;\n return loadingDiv;\n};\n\nexport const showLoading = (bool: boolean = true) => {\n if (bool) {\n loadingDiv.classList.add('ol-wfst--tools-control--loading-show');\n } else {\n loadingDiv.classList.remove('ol-wfst--tools-control--loading-show');\n }\n};\n","/**\n * Utility function that works like `Object.apply`, but copies getters and setters properly as well. Additionally gives\n * the option to exclude properties by name.\n */\nconst copyProps = (dest, src, exclude = []) => {\n const props = Object.getOwnPropertyDescriptors(src);\n for (let prop of exclude)\n delete props[prop];\n Object.defineProperties(dest, props);\n};\n/**\n * Returns the full chain of prototypes up until Object.prototype given a starting object. The order of prototypes will\n * be closest to farthest in the chain.\n */\nconst protoChain = (obj, currentChain = [obj]) => {\n const proto = Object.getPrototypeOf(obj);\n if (proto === null)\n return currentChain;\n return protoChain(proto, [...currentChain, proto]);\n};\n/**\n * Identifies the nearest ancestor common to all the given objects in their prototype chains. For most unrelated\n * objects, this function should return Object.prototype.\n */\nconst nearestCommonProto = (...objs) => {\n if (objs.length === 0)\n return undefined;\n let commonProto = undefined;\n const protoChains = objs.map(obj => protoChain(obj));\n while (protoChains.every(protoChain => protoChain.length > 0)) {\n const protos = protoChains.map(protoChain => protoChain.pop());\n const potentialCommonProto = protos[0];\n if (protos.every(proto => proto === potentialCommonProto))\n commonProto = potentialCommonProto;\n else\n break;\n }\n return commonProto;\n};\n/**\n * Creates a new prototype object that is a mixture of the given prototypes. The mixing is achieved by first\n * identifying the nearest common ancestor and using it as the prototype for a new object. Then all properties/methods\n * downstream of this prototype (ONLY downstream) are copied into the new object.\n *\n * The resulting prototype is more performant than softMixProtos(...), as well as ES5 compatible. However, it's not as\n * flexible as updates to the source prototypes aren't captured by the mixed result. See softMixProtos for why you may\n * want to use that instead.\n */\nconst hardMixProtos = (ingredients, constructor, exclude = []) => {\n var _a;\n const base = (_a = nearestCommonProto(...ingredients)) !== null && _a !== void 0 ? _a : Object.prototype;\n const mixedProto = Object.create(base);\n // Keeps track of prototypes we've already visited to avoid copying the same properties multiple times. We init the\n // list with the proto chain below the nearest common ancestor because we don't want any of those methods mixed in\n // when they will already be accessible via prototype access.\n const visitedProtos = protoChain(base);\n for (let prototype of ingredients) {\n let protos = protoChain(prototype);\n // Apply the prototype chain in reverse order so that old methods don't override newer ones.\n for (let i = protos.length - 1; i >= 0; i--) {\n let newProto = protos[i];\n if (visitedProtos.indexOf(newProto) === -1) {\n copyProps(mixedProto, newProto, ['constructor', ...exclude]);\n visitedProtos.push(newProto);\n }\n }\n }\n mixedProto.constructor = constructor;\n return mixedProto;\n};\nconst unique = (arr) => arr.filter((e, i) => arr.indexOf(e) == i);\n\n/**\n * Finds the ingredient with the given prop, searching in reverse order and breadth-first if searching ingredient\n * prototypes is required.\n */\nconst getIngredientWithProp = (prop, ingredients) => {\n const protoChains = ingredients.map(ingredient => protoChain(ingredient));\n // since we search breadth-first, we need to keep track of our depth in the prototype chains\n let protoDepth = 0;\n // not all prototype chains are the same depth, so this remains true as long as at least one of the ingredients'\n // prototype chains has an object at this depth\n let protosAreLeftToSearch = true;\n while (protosAreLeftToSearch) {\n // with the start of each horizontal slice, we assume this is the one that's deeper than any of the proto chains\n protosAreLeftToSearch = false;\n // scan through the ingredients right to left\n for (let i = ingredients.length - 1; i >= 0; i--) {\n const searchTarget = protoChains[i][protoDepth];\n if (searchTarget !== undefined && searchTarget !== null) {\n // if we find something, this is proof that this horizontal slice potentially more objects to search\n protosAreLeftToSearch = true;\n // eureka, we found it\n if (Object.getOwnPropertyDescriptor(searchTarget, prop) != undefined) {\n return protoChains[i][0];\n }\n }\n }\n protoDepth++;\n }\n return undefined;\n};\n/**\n * \"Mixes\" ingredients by wrapping them in a Proxy. The optional prototype argument allows the mixed object to sit\n * downstream of an existing prototype chain. Note that \"properties\" cannot be added, deleted, or modified.\n */\nconst proxyMix = (ingredients, prototype = Object.prototype) => new Proxy({}, {\n getPrototypeOf() {\n return prototype;\n },\n setPrototypeOf() {\n throw Error('Cannot set prototype of Proxies created by ts-mixer');\n },\n getOwnPropertyDescriptor(_, prop) {\n return Object.getOwnPropertyDescriptor(getIngredientWithProp(prop, ingredients) || {}, prop);\n },\n defineProperty() {\n throw new Error('Cannot define new properties on Proxies created by ts-mixer');\n },\n has(_, prop) {\n return getIngredientWithProp(prop, ingredients) !== undefined || prototype[prop] !== undefined;\n },\n get(_, prop) {\n return (getIngredientWithProp(prop, ingredients) || prototype)[prop];\n },\n set(_, prop, val) {\n const ingredientWithProp = getIngredientWithProp(prop, ingredients);\n if (ingredientWithProp === undefined)\n throw new Error('Cannot set new properties on Proxies created by ts-mixer');\n ingredientWithProp[prop] = val;\n return true;\n },\n deleteProperty() {\n throw new Error('Cannot delete properties on Proxies created by ts-mixer');\n },\n ownKeys() {\n return ingredients\n .map(Object.getOwnPropertyNames)\n .reduce((prev, curr) => curr.concat(prev.filter(key => curr.indexOf(key) < 0)));\n },\n});\n/**\n * Creates a new proxy-prototype object that is a \"soft\" mixture of the given prototypes. The mixing is achieved by\n * proxying all property access to the ingredients. This is not ES5 compatible and less performant. However, any\n * changes made to the source prototypes will be reflected in the proxy-prototype, which may be desirable.\n */\nconst softMixProtos = (ingredients, constructor) => proxyMix([...ingredients, { constructor }]);\n\nconst settings = {\n initFunction: null,\n staticsStrategy: 'copy',\n prototypeStrategy: 'copy',\n decoratorInheritance: 'deep',\n};\n\n// Keeps track of constituent classes for every mixin class created by ts-mixer.\nconst mixins = new Map();\nconst getMixinsForClass = (clazz) => mixins.get(clazz);\nconst registerMixins = (mixedClass, constituents) => mixins.set(mixedClass, constituents);\nconst hasMixin = (instance, mixin) => {\n if (instance instanceof mixin)\n return true;\n const constructor = instance.constructor;\n const visited = new Set();\n let frontier = new Set();\n frontier.add(constructor);\n while (frontier.size > 0) {\n // check if the frontier has the mixin we're looking for. if not, we can say we visited every item in the frontier\n if (frontier.has(mixin))\n return true;\n frontier.forEach(item => visited.add(item));\n // build a new frontier based on the associated mixin classes and prototype chains of each frontier item\n const newFrontier = new Set();\n frontier.forEach(item => {\n var _a;\n const itemConstituents = (_a = mixins.get(item)) !== null && _a !== void 0 ? _a : protoChain(item.prototype).map(proto => proto.constructor).filter(item => item !== null);\n if (itemConstituents)\n itemConstituents.forEach(constituent => {\n if (!visited.has(constituent) && !frontier.has(constituent))\n newFrontier.add(constituent);\n });\n });\n // we have a new frontier, now search again\n frontier = newFrontier;\n }\n // if we get here, we couldn't find the mixin anywhere in the prototype chain or associated mixin classes\n return false;\n};\n\nconst mergeObjectsOfDecorators = (o1, o2) => {\n var _a, _b;\n const allKeys = unique([...Object.getOwnPropertyNames(o1), ...Object.getOwnPropertyNames(o2)]);\n const mergedObject = {};\n for (let key of allKeys)\n mergedObject[key] = unique([...((_a = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a !== void 0 ? _a : []), ...((_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : [])]);\n return mergedObject;\n};\nconst mergePropertyAndMethodDecorators = (d1, d2) => {\n var _a, _b, _c, _d;\n return ({\n property: mergeObjectsOfDecorators((_a = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a !== void 0 ? _a : {}, (_b = d2 === null || d2 === void 0 ? void 0 : d2.property) !== null && _b !== void 0 ? _b : {}),\n method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.method) !== null && _d !== void 0 ? _d : {}),\n });\n};\nconst mergeDecorators = (d1, d2) => {\n var _a, _b, _c, _d, _e, _f;\n return ({\n class: unique([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d2 === null || d2 === void 0 ? void 0 : d2.class) !== null && _b !== void 0 ? _b : []]),\n static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.static) !== null && _d !== void 0 ? _d : {}),\n instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d2 === null || d2 === void 0 ? void 0 : d2.instance) !== null && _f !== void 0 ? _f : {}),\n });\n};\nconst decorators = new Map();\nconst findAllConstituentClasses = (...classes) => {\n var _a;\n const allClasses = new Set();\n const frontier = new Set([...classes]);\n while (frontier.size > 0) {\n for (let clazz of frontier) {\n const protoChainClasses = protoChain(clazz.prototype).map(proto => proto.constructor);\n const mixinClasses = (_a = getMixinsForClass(clazz)) !== null && _a !== void 0 ? _a : [];\n const potentiallyNewClasses = [...protoChainClasses, ...mixinClasses];\n const newClasses = potentiallyNewClasses.filter(c => !allClasses.has(c));\n for (let newClass of newClasses)\n frontier.add(newClass);\n allClasses.add(clazz);\n frontier.delete(clazz);\n }\n }\n return [...allClasses];\n};\nconst deepDecoratorSearch = (...classes) => {\n const decoratorsForClassChain = findAllConstituentClasses(...classes)\n .map(clazz => decorators.get(clazz))\n .filter(decorators => !!decorators);\n if (decoratorsForClassChain.length == 0)\n return {};\n if (decoratorsForClassChain.length == 1)\n return decoratorsForClassChain[0];\n return decoratorsForClassChain.reduce((d1, d2) => mergeDecorators(d1, d2));\n};\nconst directDecoratorSearch = (...classes) => {\n const classDecorators = classes.map(clazz => getDecoratorsForClass(clazz));\n if (classDecorators.length === 0)\n return {};\n if (classDecorators.length === 1)\n return classDecorators[0];\n return classDecorators.reduce((d1, d2) => mergeDecorators(d1, d2));\n};\nconst getDecoratorsForClass = (clazz) => {\n let decoratorsForClass = decorators.get(clazz);\n if (!decoratorsForClass) {\n decoratorsForClass = {};\n decorators.set(clazz, decoratorsForClass);\n }\n return decoratorsForClass;\n};\nconst decorateClass = (decorator) => ((clazz) => {\n const decoratorsForClass = getDecoratorsForClass(clazz);\n let classDecorators = decoratorsForClass.class;\n if (!classDecorators) {\n classDecorators = [];\n decoratorsForClass.class = classDecorators;\n }\n classDecorators.push(decorator);\n return decorator(clazz);\n});\nconst decorateMember = (decorator) => ((object, key, ...otherArgs) => {\n const decoratorTargetType = typeof object === 'function' ? 'static' : 'instance';\n const decoratorType = typeof object[key] === 'function' ? 'method' : 'property';\n const clazz = decoratorTargetType === 'static' ? object : object.constructor;\n const decoratorsForClass = getDecoratorsForClass(clazz);\n let decoratorsForTargetType = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType];\n if (!decoratorsForTargetType) {\n decoratorsForTargetType = {};\n decoratorsForClass[decoratorTargetType] = decoratorsForTargetType;\n }\n let decoratorsForType = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType];\n if (!decoratorsForType) {\n decoratorsForType = {};\n decoratorsForTargetType[decoratorType] = decoratorsForType;\n }\n let decoratorsForKey = decoratorsForType === null || decoratorsForType === void 0 ? void 0 : decoratorsForType[key];\n if (!decoratorsForKey) {\n decoratorsForKey = [];\n decoratorsForType[key] = decoratorsForKey;\n }\n decoratorsForKey.push(decorator);\n // @ts-ignore\n return decorator(object, key, ...otherArgs);\n});\nconst decorate = (decorator) => ((...args) => {\n if (args.length === 1)\n return decorateClass(decorator)(args[0]);\n return decorateMember(decorator)(...args);\n});\n\nfunction Mixin(...constructors) {\n var _a, _b, _c;\n const prototypes = constructors.map(constructor => constructor.prototype);\n // Here we gather up the init functions of the ingredient prototypes, combine them into one init function, and\n // attach it to the mixed class prototype. The reason we do this is because we want the init functions to mix\n // similarly to constructors -- not methods, which simply override each other.\n const initFunctionName = settings.initFunction;\n if (initFunctionName !== null) {\n const initFunctions = prototypes\n .map(proto => proto[initFunctionName])\n .filter(func => typeof func === 'function');\n const combinedInitFunction = function (...args) {\n for (let initFunction of initFunctions)\n initFunction.apply(this, args);\n };\n const extraProto = { [initFunctionName]: combinedInitFunction };\n prototypes.push(extraProto);\n }\n function MixedClass(...args) {\n for (const constructor of constructors)\n // @ts-ignore: potentially abstract class\n copyProps(this, new constructor(...args));\n if (initFunctionName !== null && typeof this[initFunctionName] === 'function')\n this[initFunctionName].apply(this, args);\n }\n MixedClass.prototype = settings.prototypeStrategy === 'copy'\n ? hardMixProtos(prototypes, MixedClass)\n : softMixProtos(prototypes, MixedClass);\n Object.setPrototypeOf(MixedClass, settings.staticsStrategy === 'copy'\n ? hardMixProtos(constructors, null, ['prototype'])\n : proxyMix(constructors, Function.prototype));\n let DecoratedMixedClass = MixedClass;\n if (settings.decoratorInheritance !== 'none') {\n const classDecorators = settings.decoratorInheritance === 'deep'\n ? deepDecoratorSearch(...constructors)\n : directDecoratorSearch(...constructors);\n for (let decorator of (_a = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a !== void 0 ? _a : [])\n DecoratedMixedClass = decorator(DecoratedMixedClass);\n applyPropAndMethodDecorators((_b = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.static) !== null && _b !== void 0 ? _b : {}, DecoratedMixedClass);\n applyPropAndMethodDecorators((_c = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.instance) !== null && _c !== void 0 ? _c : {}, DecoratedMixedClass.prototype);\n }\n registerMixins(DecoratedMixedClass, constructors);\n return DecoratedMixedClass;\n}\nconst applyPropAndMethodDecorators = (propAndMethodDecorators, target) => {\n const propDecorators = propAndMethodDecorators.property;\n const methodDecorators = propAndMethodDecorators.method;\n if (propDecorators)\n for (let key in propDecorators)\n for (let decorator of propDecorators[key])\n decorator(target, key);\n if (methodDecorators)\n for (let key in methodDecorators)\n for (let decorator of methodDecorators[key])\n decorator(target, key, Object.getOwnPropertyDescriptor(target, key));\n};\n/**\n * A decorator version of the `Mixin` function. You'll want to use this instead of `Mixin` for mixing generic classes.\n */\nconst mix = (...ingredients) => decoratedClass => {\n // @ts-ignore\n const mixedClass = Mixin(...ingredients.concat([decoratedClass]));\n Object.defineProperty(mixedClass, 'name', {\n value: decoratedClass.name,\n writable: false,\n });\n return mixedClass;\n};\n\nexport { Mixin, decorate, hasMixin, mix, settings };\n","export enum GeometryType {\n Point = 'Point',\n LineString = 'LineString',\n LinearRing = 'LinearRing',\n Polygon = 'Polygon',\n MultiPoint = 'MultiPoint',\n MultiLineString = 'MultiLineString',\n MultiPolygon = 'MultiPolygon',\n GeometryCollection = 'GeometryCollection',\n Circle = 'Circle'\n}\n\nexport enum TransactionType {\n Insert = 'insert',\n Delete = 'delete',\n Update = 'update'\n}\n","import Map from 'ol/Map';\nimport { FeatureLike } from 'ol/Feature';\n\nimport WfsLayer from '../WfsLayer';\nimport WmsLayer from '../WmsLayer';\nimport { IWfstLayersList } from '../@types';\n\nlet map: Map;\nlet layerToInsertElements: WfsLayer | WmsLayer = null;\nlet mode = null;\n\nexport enum Modes {\n Edit = 'EDIT',\n Draw = 'DRAW'\n}\n\nexport function activateMode(m: Modes = null) {\n mode = m;\n}\n\nexport function getMode() {\n return mode;\n}\n\nconst editedFeatures: Set<string> = new Set();\nconst mapLayers: IWfstLayersList = {};\n\nexport function setMap(m: Map) {\n map = m;\n}\n\nexport function getMap(): Map {\n return map;\n}\n\nexport function setActiveLayerToInsertEls(layer: WmsLayer | WfsLayer) {\n layerToInsertElements = layer;\n}\n\nexport function getActiveLayerToInsertEls(): WmsLayer | WfsLayer {\n return layerToInsertElements;\n}\n\nexport function setMapLayers(data) {\n Object.assign(mapLayers, data);\n}\n\nexport function getStoredMapLayers(): IWfstLayersList {\n return mapLayers;\n}\n\nexport function getStoredLayer(layerName: string): WfsLayer | WmsLayer {\n return getStoredMapLayers()[layerName];\n}\n\nexport function addFeatureToEditedList(feature: FeatureLike): void {\n editedFeatures.add(String(feature.getId()));\n}\n\nexport function removeFeatureFromEditList(feature: FeatureLike): void {\n editedFeatures.delete(String(feature.getId()));\n}\n\nexport function isFeatureEdited(feature: FeatureLike): boolean {\n return editedFeatures.has(String(feature.getId()));\n}\n","import { Feature } from 'ol';\nimport { Geometry } from 'ol/geom';\nimport { TransactionResponse } from 'ol/format/WFS';\nimport Layer from 'ol/layer/Base';\n\nimport Geoserver from '../../Geoserver';\nimport { IGeoserverDescribeFeatureType } from '../../@types';\nimport { GeometryType, TransactionType } from '../../@enums';\nimport { I18N } from '../i18n';\nimport { getMap } from '../state';\n\n/**\n * Base class from which all layer types are derived.\n */\nexport default class BaseLayer extends Layer {\n /**\n * @private\n */\n _init(): void {\n const geoserver = this.getGeoserver() as Geoserver;\n\n if (geoserver.isLoaded()) {\n this.getAndUpdateDescribeFeatureType();\n } else {\n geoserver.on('change:capabilities', () => {\n this.getAndUpdateDescribeFeatureType();\n });\n }\n }\n\n /**\n * Request and store data layers obtained by DescribeFeatureType\n *\n * @public\n */\n async getAndUpdateDescribeFeatureType(): Promise<void> {\n const layerName = this.get(BaseLayerProperty.NAME);\n const layerLabel = this.get(BaseLayerProperty.LABEL);\n\n try {\n const geoserver = this.getGeoserver() as Geoserver;\n\n const params = new URLSearchParams({\n service: 'wfs',\n version: geoserver.getAdvanced().describeFeatureTypeVersion,\n request: 'DescribeFeatureType',\n typeName: layerName,\n outputFormat: 'application/json',\n exceptions: 'application/json'\n });\n\n const url_fetch = geoserver.getUrl() + '?' + params.toString();\n\n const response = await fetch(url_fetch, {\n headers: geoserver.getHeaders(),\n credentials: geoserver.getCredentials()\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n const data: IGeoserverDescribeFeatureType = await response.json();\n\n if (!data) {\n throw new Error('');\n }\n\n const targetNamespace = data.targetNamespace;\n const properties = data.featureTypes[0].properties;\n\n // Find the geometry field\n const geom = properties.find((el) => el.type.indexOf('gml:') >= 0);\n\n data._parsed = {\n namespace: targetNamespace,\n properties: properties,\n geomType: geom.localType as GeometryType,\n geomField: geom.name\n };\n\n this.set(BaseLayerProperty.DESCRIBEFEATURETYPE, data);\n } catch (err) {\n console.error(err);\n throw new Error(`${I18N.errors.layer} \"${layerLabel}\"`);\n }\n }\n\n /**\n * @public\n * @returns\n */\n isVisibleByZoom(): boolean {\n return getMap().getView().getZoom() > this.getMinZoom();\n }\n\n /**\n *\n * @param mode\n * @param features\n * @public\n */\n async transactFeatures(\n mode: TransactionType,\n features: Array<Feature<Geometry>> | Feature<Geometry>\n ): Promise<TransactionResponse | false> {\n const geoserver = this.getGeoserver() as Geoserver;\n return geoserver.transact(\n mode,\n features,\n this.get(BaseLayerProperty.NAME)\n );\n }\n\n async insertFeatures(\n features: Array<Feature<Geometry>> | Feature<Geometry>\n ): Promise<TransactionResponse | false> {\n return this.transactFeatures(TransactionType.Insert, features);\n }\n\n /**\n * @public\n * @param featureId\n * @returns\n */\n async maybeLockFeature(featureId: string | number): Promise<string> {\n const geoserver = this.getGeoserver() as Geoserver;\n\n if (geoserver.getUseLockFeature() && geoserver.hasLockFeature()) {\n return await geoserver.lockFeature(\n featureId,\n this.get(BaseLayerProperty.NAME)\n );\n }\n return null;\n }\n\n /**\n *\n * @returns\n * @public\n */\n getGeoserver(): Geoserver {\n return this.get(BaseLayerProperty.GEOSERVER);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getDescribeFeatureType(): IGeoserverDescribeFeatureType {\n return this.get(BaseLayerProperty.DESCRIBEFEATURETYPE);\n }\n}\n\nexport enum BaseLayerProperty {\n NAME = 'name',\n LABEL = 'label',\n DESCRIBEFEATURETYPE = 'describeFeatureType',\n ISVISIBLE = 'isVisible',\n GEOSERVER = 'geoserver'\n}\n\nexport type BaseLayerEventTypes =\n | 'layerRendered'\n | `change:${BaseLayerProperty.DESCRIBEFEATURETYPE}`\n | `change:${BaseLayerProperty.ISVISIBLE}`;\n","import Feature from 'ol/Feature';\nimport GeoJSON from 'ol/format/GeoJSON';\nimport Geometry from 'ol/geom/Geometry';\nimport VectorSource, { Options as VSOptions } from 'ol/source/Vector';\nimport { transformExtent } from 'ol/proj';\nimport { bbox } from 'ol/loadingstrategy';\n\nimport { WfsGeoserverVendor } from '../../@types';\nimport { parseError, showError } from '../errors';\nimport { I18N } from '../i18n';\nimport { GeoServerAdvanced } from '../../Geoserver';\n\n/**\n * Layer source to retrieve WFS features from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n *\n * @extends {ol/source/Vector~VectorSource}\n * @param options\n */\nexport default class WfsSource extends VectorSource {\n public urlParams = new URLSearchParams({\n SERVICE: 'wfs',\n REQUEST: 'GetFeature',\n OUTPUTFORMAT: 'application/json',\n EXCEPTIONS: 'application/json'\n });\n\n constructor(options: WfsSourceOptions) {\n super({\n ...options,\n format: new GeoJSON(),\n loader: async (\n extent,\n resolution,\n projection,\n success,\n failure\n ) => {\n try {\n // If bbox, add extent to the request\n if (options.strategy == bbox) {\n const extentGeoServer = transformExtent(\n extent,\n projection.getCode(),\n options.geoServerAdvanced.projection\n );\n // https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n // request features using a bounding box with CRS maybe different from featureTypes native CRS\n this.urlParams.set(\n 'bbox',\n extentGeoServer.toString() +\n `,${options.geoServerAdvanced.projection}`\n );\n }\n\n const url_fetch =\n options.geoserverUrl + '?' + this.urlParams.toString();\n\n const response = await fetch(url_fetch, {\n headers: options.headers,\n credentials: options.credentials\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n const data = await response.json();\n\n if (data.exceptions) {\n throw new Error(parseError(data));\n }\n\n const features = this.getFormat().readFeatures(data, {\n featureProjection: projection.getCode(),\n dataProjection: options.geoServerAdvanced.projection\n });\n\n features.forEach((feature: Feature<Geometry>) => {\n feature.set(\n '_layerName_',\n options.name,\n /* silent = */ true\n );\n });\n\n this.addFeatures(features as Feature<Geometry>[]);\n\n success(features as Feature<Geometry>[]);\n } catch (err) {\n this.removeLoadedExtent(extent);\n\n showError(I18N.errors.geoserver, err, options.name);\n\n failure();\n }\n }\n });\n\n this.urlParams.set(\n 'version',\n options.geoServerAdvanced.getFeatureVersion\n );\n\n this.urlParams.set('typename', options.name);\n\n this.urlParams.set(\n 'srsName',\n options.geoServerAdvanced.projection.toString()\n );\n }\n}\n\n/**\n * **_[interface]_** - Parameters to create a WfsSource\n *\n * @public\n */\nexport interface WfsSourceOptions extends VSOptions {\n /**\n * Layer name in the GeoServer\n */\n name: string;\n\n /**\n * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests\n */\n geoserverUrl: string;\n\n /**\n * Advanced options for geoserver requests\n */\n geoServerAdvanced?: GeoServerAdvanced;\n\n /**\n *\n */\n geoserverVendor?: WfsGeoserverVendor;\n\n /**\n * Url headers for GeoServer requests. You can use it to add Authorization credentials\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers\n */\n headers?: HeadersInit;\n\n /**\n * Credentials for fetch requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n */\n credentials?: RequestCredentials;\n}\n","import { Feature } from 'ol';\nimport { Geometry } from 'ol/geom';\nimport VectorLayer from 'ol/layer/Vector';\nimport BaseEvent from 'ol/events/Event';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { EventsKey } from 'ol/events';\nimport { LayerRenderEventTypes } from 'ol/render/EventType';\nimport { BaseLayerObjectEventTypes } from 'ol/layer/Base';\nimport { ObjectEvent } from 'ol/Object';\nimport RenderEvent from 'ol/render/Event';\n\nimport { Mixin } from 'ts-mixer';\n\nimport BaseLayer, { BaseLayerEventTypes } from './modules/base/BaseLayer';\nimport WfsSource from './modules/base/WfsSource';\nimport { LayerOptions } from './ol-wfst';\nimport { showLoading } from './modules/loading';\nimport { TransactionType } from './@enums';\nimport { WfsGeoserverVendor } from './@types';\n\n/**\n * Layer to retrieve WFS features from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n *\n * @fires layerRendered\n * @extends {ol/layer/Vector~VectorLayer}\n * @param options\n */\nexport default class WfsLayer extends Mixin(BaseLayer, VectorLayer<WfsSource>) {\n private _loadingCount = 0;\n private _loadedCount = 0;\n\n public beforeTransactFeature: (\n feature: Feature<Geometry>,\n transaction: TransactionType\n ) => Feature<Geometry>;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n BaseLayerEventTypes | BaseLayerObjectEventTypes | 'change:source',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | LayerRenderEventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n BaseLayerEventTypes | BaseLayerObjectEventTypes | 'change:source',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | LayerRenderEventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<\n BaseLayerEventTypes | BaseLayerObjectEventTypes | 'change:source',\n ObjectEvent,\n void\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, void> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | LayerRenderEventTypes,\n void\n >;\n\n constructor(options: LayerOptions) {\n super({\n name: options.name,\n label: options.label || options.name,\n minZoom: options.minZoom,\n ...options\n });\n\n if (options.beforeTransactFeature) {\n this.beforeTransactFeature = options.beforeTransactFeature;\n }\n\n const geoserver = options.geoserver;\n\n const source = new WfsSource({\n name: options.name,\n geoserverUrl: geoserver.getUrl(),\n geoServerAdvanced: geoserver.getAdvanced(),\n ...(options.strategy && { strategy: options.strategy }),\n geoserverVendor: options.geoserverVendor\n });\n\n this._loadingCount = 0;\n this._loadedCount = 0;\n\n source.on('featuresloadstart', () => {\n this._loadingCount++;\n if (this._loadingCount === 1 && this.isVisibleByZoom()) {\n showLoading();\n }\n });\n\n source.on(['featuresloadend', 'featuresloaderror'], () => {\n this._loadedCount++;\n if (this._loadingCount === this._loadedCount) {\n this._loadingCount = 0;\n this._loadedCount = 0;\n setTimeout(() => {\n this.dispatchEvent('layerRendered');\n }, 300);\n }\n });\n\n this.setSource(source);\n\n const geoserverOptions = options.geoserverVendor as WfsGeoserverVendor;\n\n Object.keys(geoserverOptions).forEach((param) => {\n source.urlParams.set(param, geoserverOptions[param]);\n });\n }\n\n /**\n * @public\n */\n refresh() {\n const source = this.getSource();\n // Refrescamos el wms\n source.refresh();\n }\n\n /**\n * Use this to update Geoserver Wms Vendors (https://docs.geoserver.org/latest/en/user/services/wms/vendor.html)\n * and other arguements (https://docs.geoserver.org/stable/en/user/services/wms/reference.html#getmap)\n * in all the getMap requests.\n *\n * Example: you can use this to change the style of the WMS, add a custom sld, set a cql_filter, etc.\n *\n * @public\n * @param paramName\n * @param value Use `undefined` or `null` to remove the param\n * @param refresh\n */\n setCustomParam(\n paramName: string,\n value: string = null,\n refresh = true\n ): URLSearchParams {\n const source = this.getSource();\n\n if (value === undefined || value === null) {\n source.urlParams.delete(paramName);\n } else {\n source.urlParams.set(paramName, value);\n }\n\n if (refresh) {\n this.refresh();\n }\n\n return source.urlParams;\n }\n}\n","import TileWMS, { Options as TSOptions } from 'ol/source/TileWMS';\nimport TileState from 'ol/TileState';\nimport { ImageTile } from 'ol';\nimport { ObjectEvent } from 'ol/Object';\n\nimport { WmsGeoserverVendor } from '../../@types';\nimport { parseError, showError } from '../errors';\nimport { I18N } from '../i18n';\nimport { GeoServerAdvanced } from '../../Geoserver';\n\n/**\n * Layer source to retrieve WMS information from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wms/reference.html\n *\n * @extends {ol/source/TieWMS~TileWMS}\n * @param options\n */\nexport default class WmsSource extends TileWMS {\n constructor(options: WmsSourceOptions) {\n super({\n url: options.geoserverUrl,\n serverType: 'geoserver',\n params: {\n SERVICE: 'wms',\n TILED: true,\n LAYERS: options.name,\n EXCEPTIONS: 'application/json',\n ...(options.geoserverVendor && options.geoserverVendor)\n },\n tileLoadFunction: async (tile, src) => {\n const blobToJson = (blob: Blob): any => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onloadend = () =>\n resolve(JSON.parse(reader.result as string));\n reader.readAsText(blob);\n });\n };\n\n try {\n const response = await fetch(src, {\n headers: options.headers,\n credentials: options.credentials\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n let data = await response.blob();\n\n // Check if the response has an error\n if (data.type == 'application/json') {\n const parsedError = await blobToJson(data);\n throw new Error(parseError(parsedError));\n }\n\n ((tile as ImageTile).getImage() as HTMLImageElement).src =\n URL.createObjectURL(data);\n\n tile.setState(TileState.LOADED);\n } catch (err) {\n showError(I18N.errors.geoserver, err, options.name);\n tile.setState(TileState.ERROR);\n }\n },\n ...options\n });\n }\n}\n\n/**\n * **_[interface]_** - Parameters to create a WmsSource\n *\n * @public\n */\nexport interface WmsSourceOptions extends Omit<TSOptions, 'params'> {\n /**\n * Layer name in the GeoServer\n */\n name: string;\n\n /**\n * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests\n */\n geoserverUrl: string;\n\n /**\n * Advanced options for geoserver requests\n */\n geoServerAdvanced?: GeoServerAdvanced;\n\n /**\n *\n */\n geoserverVendor?: WmsGeoserverVendor;\n\n /**\n * Url headers for GeoServer requests. You can use it to add Authorization credentials\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers\n */\n headers?: HeadersInit;\n\n /**\n * Credentials for fetch requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n */\n credentials?: RequestCredentials;\n}\n","import TileLayer from 'ol/layer/Tile';\nimport { Geometry } from 'ol/geom';\nimport { Feature, MapBrowserEvent } from 'ol';\nimport { GeoJSON } from 'ol/format';\nimport BaseEvent from 'ol/events/Event';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { EventsKey } from 'ol/events';\nimport { LayerRenderEventTypes } from 'ol/render/EventType';\nimport { BaseLayerObjectEventTypes } from 'ol/layer/Base';\nimport { ObjectEvent } from 'ol/Object';\nimport RenderEvent from 'ol/render/Event';\n\nimport WmsSource from './modules/base/WmsSource';\nimport BaseLayer, { BaseLayerEventTypes } from './modules/base/BaseLayer';\nimport { LayerOptions } from './ol-wfst';\nimport { showLoading } from './modules/loading';\nimport { TransactionType } from './@enums';\nimport { showError } from './modules/errors';\nimport { I18N } from './modules/i18n';\nimport { getMap } from './modules/state';\nimport { Mixin } from 'ts-mixer';\nimport { WmsGeoserverVendor } from './@types';\n\n/**\n * Layer to retrieve WMS information from geoservers\n * https://docs.geoserver.org/stable/en/user/services/wms/reference.html\n *\n * @fires layerRendered\n * @extends {ol/layer/Tile~TileLayer}\n * @param options\n */\nexport default class WmsLayer extends Mixin(BaseLayer, TileLayer<WmsSource>) {\n private _loadingCount = 0;\n private _loadedCount = 0;\n\n public beforeTransactFeature: (\n feature: Feature<Geometry>,\n transaction: TransactionType\n ) => Feature<Geometry>;\n\n // Formats\n private _formatGeoJSON: GeoJSON;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError'\n | LayerRenderEventTypes,\n EventsKey\n >;\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError',\n ObjectEvent,\n EventsKey\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, EventsKey> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError'\n | LayerRenderEventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError',\n ObjectEvent,\n void\n > &\n OnSignature<LayerRenderEventTypes, RenderEvent, void> &\n CombinedOnSignature<\n | EventTypes\n | BaseLayerEventTypes\n | BaseLayerObjectEventTypes\n | 'change:source'\n | 'change:preload'\n | 'change:useInterimTilesOnError'\n | LayerRenderEventTypes,\n void\n >;\n\n constructor(options: LayerOptions) {\n super({\n name: options.name,\n label: options.label || options.name,\n minZoom: options.minZoom,\n ...options\n });\n\n if (options.beforeTransactFeature) {\n this.beforeTransactFeature = options.beforeTransactFeature;\n }\n\n this._formatGeoJSON = new GeoJSON();\n\n const geoserver = options.geoserver;\n\n const source = new WmsSource({\n name: options.name,\n geoserverUrl: geoserver.getUrl(),\n geoServerAdvanced: geoserver.getAdvanced(),\n geoserverVendor: options.geoserverVendor as WmsGeoserverVendor\n });\n\n this._loadingCount = 0;\n this._loadedCount = 0;\n\n source.on('tileloadstart', () => {\n this._loadingCount++;\n if (this._loadingCount === 1 && this.isVisibleByZoom()) {\n showLoading();\n }\n });\n\n source.on(['tileloadend', 'tileloaderror'], () => {\n this._loadedCount++;\n if (this._loadingCount === this._loadedCount) {\n this._loadingCount = 0;\n this._loadedCount = 0;\n setTimeout(() => {\n this.dispatchEvent('layerRendered');\n }, 300);\n }\n });\n\n this.setSource(source);\n }\n\n /**\n * Get the features on the click area\n * @param evt\n * @returns\n * @private\n */\n async _getFeaturesByClickEvent(\n evt: MapBrowserEvent<UIEvent>\n ): Promise<Feature<Geometry>[]> {\n const coordinate = evt.coordinate;\n\n const view = getMap().getView();\n\n // Si la vista es lejana, disminumos el buffer\n // Si es cercana, lo aumentamos, por ejemplo, para podeer clickear los vectores\n // y mejorar la sensibilidad en IOS\n const buffer = view.getZoom() > 10 ? 10 : 5;\n\n const source = this.getSource();\n\n // Fallback to support a bad name\n // https://openlayers.org/en/v5.3.0/apidoc/module-ol_source_ImageWMS-ImageWMS.html#getGetFeatureInfoUrl\n const fallbackOl5 =\n 'getFeatureInfoUrl' in source\n ? 'getFeatureInfoUrl'\n : 'getGetFeatureInfoUrl';\n\n const url = source[fallbackOl5](\n coordinate,\n view.getResolution(),\n view.getProjection().getCode(),\n {\n INFO_FORMAT: 'application/json',\n BUFFER: buffer, // Buffer es el \"hit tolerance\" para capas ráster\n FEATURE_COUNT: 1,\n EXCEPTIONS: 'application/json'\n }\n );\n\n const geoserver = this.getGeoserver();\n\n try {\n const response = await fetch(url, {\n headers: geoserver.getHeaders(),\n credentials: geoserver.getCredentials()\n });\n\n if (!response.ok) {\n throw new Error(\n `${I18N.errors.getFeatures} ${response.status}`\n );\n }\n\n const data = await response.json();\n const features = this._formatGeoJSON.readFeatures(data);\n\n return features;\n } catch (err) {\n showError(err.message, err);\n }\n }\n\n /**\n * @public\n */\n refresh() {\n const source = this.getSource();\n\n // Refrescamos el wms\n source.refresh();\n\n // Force refresh the tiles\n const params = source.getParams();\n params.t = new Date().getMilliseconds();\n source.updateParams(params);\n }\n\n /**\n * Use this to update Geoserver Wfs Vendors (https://docs.geoserver.org/latest/en/user/services/wfs/vendor.html)\n * and other arguements (https://docs.geoserver.org/stable/en/user/services/wfs/reference.html)\n * in all the getFeature requests.\n *\n * Example: you can use this to set a cql_filter, limit the numbers of features, etc.\n *\n * @public\n * @param paramName\n * @param value\n * @param refresh\n */\n setCustomParam(\n paramName: string,\n value: string = null,\n refresh = true\n ): URLSearchParams {\n const source = this.getSource();\n\n source.updateParams({\n [paramName]: value\n });\n\n if (refresh) {\n this.refresh();\n }\n\n return source.getParams();\n }\n}\n","export default function createElement(tagName, attrs = {}, ...children) {\n if (typeof tagName === 'function') return tagName(attrs, children);\n\n const elem =\n tagName === null\n ? new DocumentFragment()\n : document.createElement(tagName);\n\n Object.entries(attrs || {}).forEach(([name, value]) => {\n if (\n typeof value !== undefined &&\n value !== null &&\n value !== undefined\n ) {\n if (name.startsWith('on') && name.toLowerCase() in window)\n elem.addEventListener(name.toLowerCase().substr(2), value);\n else {\n if (name === 'className')\n elem.setAttribute('class', value.toString());\n else if (name === 'htmlFor')\n elem.setAttribute('for', value.toString());\n else elem.setAttribute(name, value.toString());\n }\n }\n });\n\n for (const child of children) {\n if (!child) continue;\n if (Array.isArray(child)) elem.append(...child);\n else {\n if (child.nodeType === undefined) elem.innerHTML += child;\n else elem.appendChild(child);\n }\n }\n return elem;\n}\n","import { Observable } from 'ol';\nimport { SelectEvent } from 'ol/interaction/Select';\n\nimport { Options, WfsLayer, WmsLayer } from '../ol-wfst';\nimport myPragma from '../myPragma';\n\nimport uploadSvg from '../assets/images/upload.svg';\nimport drawSvg from '../assets/images/draw.svg';\nimport visibilityOn from '../assets/images/visibilityOn.svg';\nimport visibilityOff from '../assets/images/visibilityOff.svg';\n\nimport { GeometryType } from '../@enums';\nimport {\n getActiveLayerToInsertEls,\n getStoredMapLayers,\n setActiveLayerToInsertEls\n} from './state';\nimport { I18N } from './i18n';\nimport Uploads from './Uploads';\nimport { BaseLayerProperty } from './base/BaseLayer';\n\n/**\n * Removes in the DOM the class of the tools\n * @private\n */\nexport const resetStateButtons = (): void => {\n const activeBtn = document.querySelector(\n '.ol-wfst--tools-control-btn.wfst--active'\n );\n if (activeBtn) {\n activeBtn.classList.remove('wfst--active');\n }\n};\n\nexport const activateModeButtons = () => {\n const btn = document.querySelector('.ol-wfst--tools-control-btn-edit');\n if (btn) {\n btn.classList.add('wfst--active');\n }\n};\n\nexport const activateDrawButton = () => {\n const btn = document.querySelector('.ol-wfst--tools-control-btn-draw');\n if (btn) {\n btn.classList.add('wfst--active');\n }\n};\n\nexport const visibleLayer = (bool = true) => {\n const btn = document.querySelector('.ol-wfst--tools-control-btn-draw');\n if (btn) {\n btn.classList.add('wfst--active');\n }\n};\n\nexport default class LayersControl extends Observable {\n protected _uploads: Uploads;\n protected _uploadFormats: Options['uploadFormats'];\n\n constructor(uploads: Uploads, uploadFormats: Options['uploadFormats']) {\n super();\n\n this._uploads = uploads;\n this._uploadFormats = uploadFormats;\n }\n\n /**\n *\n * @param layer\n * @public\n */\n addLayerEl(layer: WfsLayer | WmsLayer) {\n const container = document.querySelector(\n '.wfst--tools-control--select-layers'\n );\n\n const layerName = layer.get(BaseLayerProperty.NAME) as string;\n const checked =\n layer === getActiveLayerToInsertEls() ? { checked: 'checked' } : {};\n\n const input = (\n <input\n value={layerName}\n id={`wfst--${layerName}`}\n type=\"radio\"\n className=\"ol-wfst--tools-control-input\"\n name=\"wfst--select-layer\"\n {...checked}\n onchange={(evt) => this._layerChangeHandler(evt, layer)}\n />\n );\n\n const layerDom = (\n <div\n className={`wfst--layer-control \n ${layer.getVisible() ? 'ol-wfst--visible-on' : ''}\n ${\n layer === getActiveLayerToInsertEls()\n ? 'ol-wfst--selected-on'\n : ''\n }`}\n data-layer={layerName}\n >\n <div className=\"ol-wfst--tools-control-visible\">\n <span\n className=\"ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-on\"\n title={I18N.labels.toggleVisibility}\n onclick={(evt) => this._visibilityClickHandler(evt)}\n >\n <img src={visibilityOn} />\n </span>\n <span\n className=\"ol-wfst--tools-control-visible-btn ol-wfst--visible-btn-off\"\n title={I18N.labels.toggleVisibility}\n onclick={(evt) => this._visibilityClickHandler(evt)}\n >\n <img src={visibilityOff} />\n </span>\n </div>\n <label htmlFor={`wfst--${layerName}`}>\n {input}\n <span\n title={layer.getDescribeFeatureType()._parsed.geomType}\n >\n {layer.get(BaseLayerProperty.LABEL)}\n </span>\n </label>\n </div>\n );\n\n container.appendChild(layerDom);\n\n if (layer === getActiveLayerToInsertEls()) {\n input.dispatchEvent(new Event('change'));\n }\n\n return layerDom;\n }\n\n /**\n * Update geom Types availibles to select for this layer\n *\n * @param layerName\n * @param geomDrawTypeSelected\n * @private\n */\n _changeStateSelect(\n layer: WmsLayer | WfsLayer,\n geomDrawTypeSelected: GeometryType = null\n ): GeometryType {\n /**\n * Set the geometry type in the select according to the geometry of\n * the layer in the geoserver and disable what does not correspond.\n *\n * @param value\n * @param options\n * @private\n */\n const setSelectState = (\n value: GeometryType,\n options: Array<string> | 'all'\n ): void => {\n Array.from(selectDraw.options).forEach(\n (option: HTMLOptionElement) => {\n option.selected = option.value === value ? true : false;\n option.disabled =\n options === 'all'\n ? false\n : options.includes(option.value)\n ? false\n : true;\n option.title = option.disabled\n ? I18N.labels.geomTypeNotSupported\n : '';\n }\n );\n };\n\n const selectDraw = document.querySelector(\n '.wfst--tools-control--select-draw'\n ) as HTMLSelectElement;\n\n let drawType: GeometryType;\n\n if (selectDraw) {\n const geomLayer = layer.getDescribeFeatureType()._parsed.geomType;\n\n if (geomDrawTypeSelected) {\n drawType = selectDraw.value as GeometryType;\n } else {\n if (geomLayer === GeometryType.GeometryCollection) {\n drawType = GeometryType.LineString; // Default drawing type for GeometryCollection\n setSelectState(drawType, 'all');\n } else if (geomLayer === GeometryType.LinearRing) {\n drawType = GeometryType.LineString; // Default drawing type for GeometryCollection\n setSelectState(drawType, [\n GeometryType.Circle,\n GeometryType.LinearRing,\n GeometryType.Polygon\n ]);\n selectDraw.value = drawType;\n } else {\n drawType = geomLayer;\n setSelectState(drawType, [geomLayer]);\n }\n }\n }\n\n return drawType;\n }\n\n _visibilityClickHandler(evt) {\n const btn = evt.currentTarget;\n const parentDiv = btn.closest('.wfst--layer-control') as HTMLElement;\n const layerName = parentDiv.dataset['layer'];\n parentDiv.classList.toggle('ol-wfst--visible-on');\n const layer = getStoredMapLayers()[layerName];\n if (parentDiv.classList.contains('ol-wfst--visible-on')) {\n layer.setVisible(true);\n } else {\n layer.setVisible(false);\n }\n }\n\n _layerChangeHandler(evt, layer) {\n const radioInput = evt.currentTarget;\n const parentDiv = radioInput.closest(\n '.wfst--layer-control'\n ) as HTMLElement;\n\n // Deselect DOM previous layer\n const selected = document.querySelector('.ol-wfst--selected-on');\n\n if (selected) selected.classList.remove('ol-wfst--selected-on');\n\n // Select this layer\n parentDiv.classList.add('ol-wfst--selected-on');\n setActiveLayerToInsertEls(layer);\n this._changeStateSelect(layer);\n }\n\n render(): HTMLElement {\n return (\n <>\n <div className=\"wfst--tools-control--head\">\n {this._uploads && (\n <div>\n <input\n id=\"ol-wfst--upload\"\n type=\"file\"\n accept={this._uploadFormats}\n onchange={(evt: InputEvent) =>\n this._uploads.process(evt)\n }\n />\n <label\n className=\"ol-wfst--tools-control-btn ol-wfst--tools-control-btn-upload\"\n htmlFor=\"ol-wfst--upload\"\n title={I18N.labels.uploadToLayer}\n >\n <img src={uploadSvg} />\n </label>\n </div>\n )}\n <div className=\"ol-wfst--tools-control-draw-cnt\">\n <button\n className=\"ol-wfst--tools-control-btn ol-wfst--tools-control-btn-draw\"\n type=\"button\"\n title={I18N.labels.addElement}\n onclick={() => {\n this.dispatchEvent('drawMode');\n }}\n >\n <img src={drawSvg} />\n </button>\n <select\n title={I18N.labels.selectDrawType}\n className=\"wfst--tools-control--select-draw\"\n onchange={(evt: SelectEvent) => {\n const selectedValue = evt.target\n .value as GeometryType;\n this._changeStateSelect(\n getActiveLayerToInsertEls(),\n selectedValue\n );\n this.dispatchEvent('changeGeom');\n }}\n >\n {[\n GeometryType.Point,\n GeometryType.MultiPoint,\n GeometryType.LineString,\n GeometryType.MultiLineString,\n GeometryType.Polygon,\n GeometryType.MultiPolygon,\n GeometryType.Circle\n ].map((type) => {\n // Show all options, but enable only the accepted ones\n return <option value={type}>{type}</option>;\n })}\n </select>\n </div>\n </div>\n <div className=\"wfst--tools-control--select-layers\"></div>\n </>\n );\n }\n}\n","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='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\";\n export default img;","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\";\n export default img;","var img = \"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\";\n export default img;","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\";\n export default img;","import VectorLayer from 'ol/layer/Vector';\nimport VectorSource from 'ol/source/Vector';\n\nlet editLayer = new VectorLayer({\n source: new VectorSource(),\n zIndex: 100\n});\n\nexport const getEditLayer = (): VectorLayer<VectorSource> => {\n return editLayer;\n};\n","// Ol\nimport {\n Geometry,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon\n} from 'ol/geom';\nimport { Feature, Observable } from 'ol';\nimport { GeoJSON, KML, WFS } from 'ol/format';\n\n// External\nimport Modal from 'modal-vanilla';\n\nimport { Options } from '../ol-wfst';\nimport { showError } from './errors';\nimport { resetStateButtons } from './LayersControl';\nimport { getEditLayer } from './editLayer';\nimport { getActiveLayerToInsertEls, getMap } from './state';\nimport { GeometryType } from '../@enums';\nimport { I18N } from './i18n';\nimport { VectorSourceEvent } from 'ol/source/Vector';\nimport { BaseLayerProperty } from './base/BaseLayer';\n\nexport default class Uploads extends Observable {\n protected _options: Options;\n\n // Formats\n protected _formatWFS: WFS;\n protected _formatGeoJSON: GeoJSON;\n protected _formatKml: KML;\n protected _xs: XMLSerializer;\n\n protected _processUpload: Options['processUpload'];\n\n constructor(options: Options) {\n super();\n\n this._options = options;\n\n this._processUpload = options.processUpload;\n\n // Formats\n this._formatWFS = new WFS();\n\n this._formatGeoJSON = new GeoJSON();\n this._formatKml = new KML({\n extractStyles: false,\n showPointNames: false\n });\n this._xs = new XMLSerializer();\n }\n\n /**\n * Parse and check geometry of uploaded files\n *\n * @param evt\n * @public\n */\n async process(evt: Event): Promise<void> {\n const map = getMap();\n const view = map.getView();\n\n const file = (evt.target as HTMLInputElement).files[0];\n\n let features: Array<Feature<Geometry>>;\n\n if (!file) {\n return;\n }\n\n const extension = file.name.split('.').pop().toLowerCase();\n\n try {\n // If the user uses a custom fucntion...\n if (this._processUpload) {\n features = this._processUpload(file);\n }\n\n // If the user functions return features, we dont process anything more\n if (!features) {\n const string = await this._fileReader(file);\n\n if (extension === 'geojson' || extension === 'json') {\n features = this._formatGeoJSON.readFeatures(string, {\n featureProjection: view.getProjection().getCode()\n });\n } else if (extension === 'kml') {\n features = this._formatKml.readFeatures(string, {\n featureProjection: view.getProjection().getCode()\n });\n } else {\n showError(I18N.errors.badFormat);\n }\n }\n\n let invalidFeaturesCount = 0;\n let validFeaturesCount = 0;\n\n const featuresToInsert: Array<Feature<Geometry>> = [];\n\n for (let feature of features) {\n // If the geometry doesn't correspond to the layer, try to fixit.\n // If we can't, don't use it\n if (!this._checkGeometry(feature)) {\n feature = this._fixGeometry(feature);\n }\n\n if (feature) {\n featuresToInsert.push(feature);\n validFeaturesCount++;\n } else {\n invalidFeaturesCount++;\n continue;\n }\n }\n\n if (!validFeaturesCount) {\n showError(I18N.errors.noValidGeometry);\n } else {\n resetStateButtons();\n\n this.dispatchEvent(\n new VectorSourceEvent(\n 'loadedFeatures',\n null,\n featuresToInsert\n )\n );\n\n const content = `\n ${I18N.labels.validFeatures}: ${validFeaturesCount}<br>\n ${\n invalidFeaturesCount\n ? `${I18N.labels.invalidFeatures}: ${invalidFeaturesCount}`\n : ''\n }`;\n\n this._initModal(content, featuresToInsert);\n }\n\n // Reset the input to allow another onChange trigger\n (evt.target as HTMLInputElement).value = null;\n } catch (err) {\n showError(I18N.errors.badFile, err);\n }\n }\n\n /**\n * Read data file\n * @param file\n * @public\n */\n async _fileReader(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.addEventListener('load', async (e) => {\n const fileData = e.target.result;\n resolve(fileData as string);\n });\n\n reader.addEventListener('error', (err) => {\n console.error('Error' + err);\n reject();\n });\n reader.readAsText(file);\n });\n }\n\n /**\n * Attemp to change the geometry feature to the layer\n * @param feature\n * @private\n */\n _fixGeometry(feature: Feature<Geometry>): Feature<Geometry> {\n // Geometry of the layer\n const geomTypeLayer =\n getActiveLayerToInsertEls().getDescribeFeatureType()._parsed\n .geomType;\n const geomTypeFeature = feature.getGeometry().getType();\n let geom: Geometry;\n\n switch (geomTypeFeature) {\n case GeometryType.Point: {\n if (geomTypeLayer === GeometryType.MultiPoint) {\n const coords = (\n feature.getGeometry() as Point\n ).getCoordinates();\n geom = new MultiPoint([coords]);\n }\n break;\n }\n\n case GeometryType.LineString:\n if (geomTypeLayer === GeometryType.MultiLineString) {\n const coords = (\n feature.getGeometry() as LineString\n ).getCoordinates();\n geom = new MultiLineString([coords]);\n }\n break;\n\n case GeometryType.Polygon:\n if (geomTypeLayer === GeometryType.MultiPolygon) {\n const coords = (\n feature.getGeometry() as Polygon\n ).getCoordinates();\n geom = new MultiPolygon([coords]);\n }\n break;\n default:\n geom = null;\n }\n\n if (!geom) {\n return null;\n }\n\n feature.setGeometry(geom);\n return feature;\n }\n\n /**\n * Check if the feature has the same geometry as the target layer\n * @param feature\n * @private\n */\n _checkGeometry(feature: Feature<Geometry>): boolean {\n // Geometry of the layer\n const geomTypeLayer =\n getActiveLayerToInsertEls().getDescribeFeatureType()._parsed\n .geomType;\n const geomTypeFeature = feature.getGeometry().getType();\n\n // This geom accepts every type of geometry\n if (geomTypeLayer === GeometryType.GeometryCollection) {\n return true;\n }\n\n return geomTypeFeature === geomTypeLayer;\n }\n\n /**\n * Confirm modal before transact to the GeoServer the features in the file\n *\n * @param content\n * @param featuresToInsert\n * @private\n */\n _initModal(\n content: string,\n featuresToInsert: Array<Feature<Geometry>>\n ): void {\n const footer = `\n <button type=\"button\" class=\"btn btn-sm btn-secondary\" data-dismiss=\"modal\">\n ${I18N.labels.cancel}\n </button>\n <button type=\"button\" class=\"btn btn-sm btn-primary\" data-action=\"save\" data-dismiss=\"modal\">\n ${I18N.labels.upload}\n </button>\n `;\n\n const modal = new Modal({\n ...this._options.modal,\n header: true,\n headerClose: false,\n title:\n I18N.labels.uploadFeatures +\n ' ' +\n getActiveLayerToInsertEls().get(BaseLayerProperty.NAME),\n content: content,\n backdrop: 'static', // Prevent close on click outside the modal\n footer: footer\n }).show();\n\n modal.on('dismiss', (modal, event) => {\n // On saving changes\n if (event.target.dataset.action === 'save') {\n this.dispatchEvent(\n new VectorSourceEvent(\n 'addedFeatures',\n null,\n featuresToInsert\n )\n );\n } else {\n // On cancel button\n getEditLayer().getSource().clear();\n }\n });\n }\n}\n","/**\n * @param target\n * @param sources\n * @returns\n */\nexport const deepObjectAssign = (target, ...sources) => {\n sources.forEach((source) => {\n Object.keys(source).forEach((key) => {\n const s_val = source[key];\n const t_val = target[key];\n target[key] =\n t_val &&\n s_val &&\n typeof t_val === 'object' &&\n typeof s_val === 'object' &&\n !Array.isArray(t_val) // Don't merge arrays\n ? deepObjectAssign(t_val, s_val)\n : s_val;\n });\n });\n return target;\n};\n","import { Feature } from 'ol';\nimport { Geometry } from 'ol/geom';\nimport { Control } from 'ol/control';\nimport { VectorSourceEvent } from 'ol/source/Vector';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport BaseEvent from 'ol/events/Event';\nimport { EventsKey } from 'ol/events';\nimport { ObjectEvent } from 'ol/Object';\nimport { Types as ObjectEventTypes } from 'ol/ObjectEventType';\n\nimport myPragma from '../myPragma';\nimport { I18N } from './i18n';\n\ntype ChangesEventTypes = 'cancel' | 'apply' | 'delete';\n\nexport default class EditControlChangesEl extends Control {\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<ChangesEventTypes, VectorSourceEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n ChangesEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<ChangesEventTypes, VectorSourceEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n ChangesEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<ChangesEventTypes, VectorSourceEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, void> &\n CombinedOnSignature<\n ChangesEventTypes | ObjectEventTypes | EventTypes,\n void\n >;\n\n constructor(feature: Feature<Geometry>) {\n super({\n element: (\n <div className=\"ol-wfst--changes-control\">\n <div className=\"ol-wfst--changes-control-el\">\n <div className=\"ol-wfst--changes-control-id\">\n <b>{I18N.labels.editMode}</b> -{' '}\n <i>{String(feature.getId())}</i>\n </div>\n <button\n type=\"button\"\n className=\"btn btn-sm btn-secondary\"\n onclick={() => {\n this.dispatchEvent(\n new VectorSourceEvent('cancel', feature)\n );\n }}\n >\n {I18N.labels.cancel}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-sm btn-primary\"\n onclick={() => {\n this.dispatchEvent(\n new VectorSourceEvent('apply', feature)\n );\n }}\n >\n {I18N.labels.apply}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-sm btn-danger-outline\"\n onclick={() => {\n this.dispatchEvent(\n new VectorSourceEvent('delete', feature)\n );\n }}\n >\n {I18N.labels.delete}\n </button>\n </div>\n </div>\n )\n });\n }\n}\n","// Ol\nimport {\n Geometry,\n GeometryCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Polygon\n} from 'ol/geom';\nimport { Circle as CircleStyle, Fill, Stroke, Style } from 'ol/style';\nimport { Feature } from 'ol';\nimport { FeatureLike } from 'ol/Feature';\nimport { Coordinate } from 'ol/coordinate';\n\nimport { GeometryType } from '../@enums';\nimport { getMode, Modes } from './state';\n\n/**\n * Master style that handles two modes on the Edit Layer:\n * - one is the basic, showing only the vertices\n * - and the other when modify is active, showing bigger vertices\n *\n * @param feature\n * @private\n */\nexport default function styleFunction(\n feature: Feature<Geometry>\n): Array<Style> {\n const getVertexs = (feature: FeatureLike) => {\n let geometry = feature.getGeometry();\n\n if (geometry instanceof GeometryCollection) {\n geometry = geometry.getGeometries()[0];\n }\n\n const coordinates = (geometry as LineString).getCoordinates();\n let flatCoordinates: Coordinate[] | number[] = null;\n\n if (\n geometry instanceof Polygon ||\n geometry instanceof MultiLineString\n ) {\n flatCoordinates = coordinates.flat(1);\n } else if (geometry instanceof MultiPolygon) {\n flatCoordinates = coordinates.flat(2);\n } else {\n flatCoordinates = coordinates;\n }\n\n if (!flatCoordinates || !flatCoordinates.length) {\n return;\n }\n\n return new MultiPoint(flatCoordinates as Coordinate[]);\n };\n\n let geometry = feature.getGeometry();\n let type = geometry.getType();\n\n if (geometry instanceof GeometryCollection) {\n geometry = geometry.getGeometries()[0];\n type = geometry.getType();\n }\n\n switch (type) {\n case GeometryType.Point:\n case GeometryType.MultiPoint:\n if (getMode() === Modes.Edit) {\n return [\n new Style({\n image: new CircleStyle({\n radius: 6,\n fill: new Fill({\n color: '#000000'\n })\n })\n }),\n new Style({\n image: new CircleStyle({\n radius: 4,\n fill: new Fill({\n color: '#ff0000'\n })\n })\n })\n ];\n } else {\n return [\n new Style({\n image: new CircleStyle({\n radius: 5,\n fill: new Fill({\n color: '#ff0000'\n })\n })\n }),\n new Style({\n image: new CircleStyle({\n radius: 2,\n fill: new Fill({\n color: '#000000'\n })\n })\n })\n ];\n }\n default:\n // If editing mode is active, show bigger vertex\n if (getMode() == Modes.Draw || getMode() == Modes.Edit) {\n return [\n new Style({\n stroke: new Stroke({\n color: 'rgba( 255, 0, 0, 1)',\n width: 4\n }),\n fill: new Fill({\n color: 'rgba(255, 0, 0, 0.7)'\n })\n }),\n new Style({\n image: new CircleStyle({\n radius: 4,\n fill: new Fill({\n color: '#ff0000'\n }),\n stroke: new Stroke({\n width: 2,\n color: 'rgba(5, 5, 5, 0.9)'\n })\n }),\n geometry: (feature) => getVertexs(feature)\n }),\n new Style({\n stroke: new Stroke({\n color: 'rgba(255, 255, 255, 0.7)',\n width: 2\n })\n })\n ];\n } else {\n return [\n new Style({\n image: new CircleStyle({\n radius: 2,\n fill: new Fill({\n color: '#000000'\n })\n }),\n geometry: (feature) => getVertexs(feature)\n }),\n new Style({\n stroke: new Stroke({\n color: '#ff0000',\n width: 4\n }),\n fill: new Fill({\n color: 'rgba(255, 0, 0, 0.7)'\n })\n })\n ];\n }\n }\n}\n","// Ol\nimport { Feature, Observable } from 'ol';\nimport { Geometry } from 'ol/geom';\n\n// External\nimport Modal from 'modal-vanilla';\n\nimport { addFeatureToEditedList, getStoredLayer } from './state';\nimport { Options } from '../ol-wfst';\nimport { I18N } from './i18n';\nimport { VectorSourceEvent } from 'ol/source/Vector';\n\n/**\n * Shows a fields form in a modal window to allow changes in the properties of the feature.\n *\n * @param feature\n * @private\n */\nexport class EditFieldsModal extends Observable {\n protected _options: Options['modal'];\n protected _modal: Modal;\n protected _feature: Feature;\n\n constructor(options: Options['modal']) {\n super();\n\n this._options = options;\n\n const footer = `\n <button type=\"button\" class=\"btn btn-sm btn-link btn-third\" data-action=\"delete\" data-dismiss=\"modal\">\n ${I18N.labels.delete}\n </button>\n <button type=\"button\" class=\"btn btn-sm btn-secondary\" data-dismiss=\"modal\">\n ${I18N.labels.cancel}\n </button>\n <button type=\"button\" class=\"btn btn-sm btn-primary\" data-action=\"save\" data-dismiss=\"modal\">\n ${I18N.labels.save}\n </button>\n `;\n\n this._modal = new Modal({\n ...this._options,\n header: true,\n headerClose: true,\n title: '',\n content: '<div></div>',\n footer: footer\n });\n\n this._modal.on('dismiss', (modal, event) => {\n // On saving changes\n if (event.target.dataset.action === 'save') {\n const inputs = modal.el.querySelectorAll('input');\n\n inputs.forEach((el: HTMLInputElement) => {\n const value = el.value;\n const field = el.name;\n this._feature.set(field, value, /*isSilent = */ true);\n });\n\n this._feature.changed();\n\n addFeatureToEditedList(this._feature);\n\n this.dispatchEvent(\n new VectorSourceEvent('save', this._feature)\n );\n } else if (event.target.dataset.action === 'delete') {\n this.dispatchEvent(\n new VectorSourceEvent('delete', this._feature)\n );\n }\n });\n }\n\n show(feature: Feature<Geometry>) {\n this._feature = feature;\n\n const title = `${I18N.labels.editElement} ${feature.getId()} `;\n\n const properties = feature.getProperties();\n const layerName = feature.get('_layerName_');\n\n // Data schema from the geoserver\n const layer = getStoredLayer(layerName);\n const dataSchema = layer.getDescribeFeatureType()._parsed.properties;\n\n let content = '<form autocomplete=\"false\">';\n Object.keys(properties).forEach((key) => {\n // If the feature field exists in the geoserver and is not added by openlayers\n const field = dataSchema.find((data) => data.name === key);\n\n if (field) {\n const typeXsd = field.type;\n let type;\n\n switch (typeXsd) {\n case 'xsd:string':\n type = 'text';\n break;\n case 'xsd:number':\n case 'xsd:int':\n type = 'number';\n break;\n case 'xsd:date-time':\n type = 'datetime';\n break;\n default:\n type = 'text';\n }\n\n if (type) {\n content += `\n <div class=\"ol-wfst--input-field-container\">\n <label class=\"ol-wfst--input-field-label\" for=\"${key}\">${key}</label>\n <input placeholder=\"NULL\" class=\"ol-wfst--input-field-input\" type=\"${type}\" name=\"${key}\" value=\"${\n properties[key] || ''\n }\">\n </div>`;\n }\n }\n });\n\n content += '</form>';\n\n this._modal._html.body.innerHTML = content;\n this._modal._html.header.innerHTML = title;\n this._modal.show();\n }\n}\n","// Ol\nimport BaseObject, { ObjectEvent } from 'ol/Object';\nimport { Types as ObjectEventTypes } from 'ol/ObjectEventType';\n\nimport { ProjectionLike } from 'ol/proj';\nimport { Circle, Geometry, GeometryCollection } from 'ol/geom';\nimport { Feature } from 'ol';\nimport { GeoJSON, KML, WFS } from 'ol/format';\nimport { State } from 'ol/source/Source';\nimport { fromCircle } from 'ol/geom/Polygon';\nimport BaseEvent from 'ol/events/Event';\n\nimport { showLoading } from './modules/loading';\nimport { showError } from './modules/errors';\nimport {\n getMap,\n getStoredLayer,\n removeFeatureFromEditList\n} from './modules/state';\nimport { getEditLayer } from './modules/editLayer';\nimport { deepObjectAssign } from './modules/helpers';\nimport { I18N } from './modules/i18n';\nimport { GeometryType, TransactionType } from './@enums';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { EventsKey } from 'ol/events';\nimport { TransactionResponse } from 'ol/format/WFS';\n\n// https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html\n// Axis ordering: latitude/longitude\nconst DEFAULT_GEOSERVER_SRS = 'EPSG:3857';\n\n/**\n * @fires change:capabilities\n * @extends {ol/Object~BaseObject}\n * @param options\n */\nexport default class Geoserver extends BaseObject {\n protected _options: GeoserverOptions;\n\n protected _countRequests: number;\n protected _insertFeatures: Array<Feature<Geometry>>;\n protected _updateFeatures: Array<Feature<Geometry>>;\n protected _deleteFeatures: Array<Feature<Geometry>>;\n\n // Formats\n protected _formatWFS: WFS;\n protected _formatGeoJSON: GeoJSON;\n protected _formatKml: KML;\n protected _xs: XMLSerializer;\n\n protected state_: State;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n GeoserverEventTypes | ObjectEventTypes,\n ObjectEvent,\n EventsKey\n > &\n CombinedOnSignature<\n GeoserverEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<\n GeoserverEventTypes | ObjectEventTypes,\n ObjectEvent,\n EventsKey\n > &\n CombinedOnSignature<\n GeoserverEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<GeoserverEventTypes | ObjectEventTypes, ObjectEvent, void> &\n CombinedOnSignature<\n GeoserverEventTypes | ObjectEventTypes | EventTypes,\n void\n >;\n\n constructor(options: GeoserverOptions) {\n super();\n\n const defaults = {\n url: null,\n advanced: {\n getCapabilitiesVersion: '1.3.0',\n getFeatureVersion: '1.0.0',\n describeFeatureTypeVersion: '1.1.0',\n lockFeatureVersion: '1.1.0',\n wfsTransactionVersion: '1.1.0',\n projection: DEFAULT_GEOSERVER_SRS,\n lockFeatureParams: {\n expiry: 5, // minutes\n lockId: 'GeoServer',\n releaseAction: 'SOME'\n }\n },\n headers: {},\n credentials: 'same-origin',\n useLockFeature: true\n };\n\n this._options = deepObjectAssign(defaults, options);\n\n this.setAdvanced(this._options.advanced);\n this.setHeaders(this._options.headers);\n this.setCredentials(this._options.credentials);\n this.setUrl(this._options.url);\n this.setUseLockFeature(this._options.useLockFeature);\n\n this._countRequests = 0;\n\n this._insertFeatures = [];\n this._updateFeatures = [];\n this._deleteFeatures = [];\n\n // Formats\n this._formatWFS = new WFS();\n\n this._formatGeoJSON = new GeoJSON();\n this._formatKml = new KML({\n extractStyles: false,\n showPointNames: false\n });\n this._xs = new XMLSerializer();\n\n this.getAndUpdateCapabilities();\n\n this.on('change:capabilities', () => {\n this._checkGeoserverCapabilities();\n });\n }\n\n /**\n *\n * @returns\n * @public\n */\n getCapabilities(): XMLDocument {\n return this.get(GeoserverProperty.CAPABILITIES);\n }\n\n /**\n *\n * @param url\n * @param opt_silent\n * @public\n */\n setUrl(url: string, opt_silent = false): void {\n this.set(GeoserverProperty.URL, url, opt_silent);\n }\n\n /**\n *\n * @returns\n */\n getUrl(): string {\n return this.get(GeoserverProperty.URL);\n }\n\n /**\n *\n * @param headers\n * @param opt_silent\n * @returns\n * @public\n */\n setHeaders(headers: HeadersInit = {}, opt_silent = false): void {\n return this.set(GeoserverProperty.HEADERS, headers, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getHeaders(): HeadersInit {\n return this.get(GeoserverProperty.HEADERS);\n }\n\n /**\n *\n * @param credentials\n * @param opt_silent\n * @public\n */\n setCredentials(\n credentials: RequestCredentials = null,\n opt_silent = false\n ): void {\n this.set(GeoserverProperty.CREDENTIALS, credentials, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getCredentials(): RequestCredentials {\n return this.get(GeoserverProperty.CREDENTIALS);\n }\n\n /**\n *\n * @returns\n * @public\n */\n setAdvanced(advanced: GeoServerAdvanced = {}, opt_silent = false): void {\n this.set(GeoserverProperty.ADVANCED, advanced, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getAdvanced(): GeoServerAdvanced {\n return this.get(GeoserverProperty.ADVANCED);\n }\n\n /**\n *\n * @returns\n * @public\n */\n hasTransaction(): boolean {\n return this.get(GeoserverProperty.HASTRASNACTION);\n }\n\n /**\n *\n * @returns\n * @public\n */\n hasLockFeature(): boolean {\n return this.get(GeoserverProperty.HASLOCKFEATURE);\n }\n\n /**\n *\n * @returns\n * @public\n */\n getUseLockFeature(): boolean {\n return this.get(GeoserverProperty.USELOCKFEATURE);\n }\n\n /**\n *\n * @returns\n * @public\n */\n setUseLockFeature(useLockFeature: boolean, opt_silent = false): void {\n this.set(GeoserverProperty.USELOCKFEATURE, useLockFeature, opt_silent);\n }\n\n /**\n *\n * @returns\n * @public\n */\n isLoaded(): boolean {\n return this.get(GeoserverProperty.ISLOADED);\n }\n\n /**\n *\n * @returns\n */\n getState() {\n return this.state_;\n }\n\n /**\n * Get the capabilities from the GeoServer and check\n * all the available operations.\n *\n * @fires getcapabilities\n * @public\n */\n async getAndUpdateCapabilities(): Promise<XMLDocument> {\n try {\n const params = new URLSearchParams({\n service: 'wfs',\n version: this.getAdvanced().getCapabilitiesVersion,\n request: 'GetCapabilities',\n exceptions: 'application/json'\n });\n\n const url_fetch = this.getUrl() + '?' + params.toString();\n\n const response = await fetch(url_fetch, {\n headers: this.getHeaders(),\n credentials: this.getCredentials()\n });\n\n if (!response.ok) {\n throw new Error('');\n }\n\n const data = await response.text();\n const capabilities = new window.DOMParser().parseFromString(\n data,\n 'text/xml'\n );\n\n this.set(GeoserverProperty.CAPABILITIES, capabilities);\n\n this.state_ = capabilities ? 'ready' : 'error';\n\n return capabilities;\n } catch (err) {\n console.error(err);\n const msg =\n typeof err === 'string' ? err : I18N.errors.capabilities;\n showError(msg, err);\n }\n }\n\n /**\n *\n * @private\n */\n _checkGeoserverCapabilities() {\n // Available operations in the geoserver\n const operations: HTMLCollectionOf<Element> =\n this.getCapabilities().getElementsByTagName('ows:Operation');\n\n Array.from(operations).forEach((operation) => {\n if (operation.getAttribute('name') === 'Transaction') {\n this.set(GeoserverProperty.HASTRASNACTION, true);\n } else if (operation.getAttribute('name') === 'LockFeature') {\n this.set(GeoserverProperty.HASLOCKFEATURE, true);\n } else if (\n operation.getAttribute('name') === 'DescribeFeatureType'\n ) {\n this.set(GeoserverProperty.HASDESCRIBEFEATURETYPE, true);\n }\n });\n\n if (!this.hasTransaction()) {\n throw I18N.errors.wfst;\n }\n }\n\n /**\n * Make the WFS Transactions\n *\n * @param transactionType\n * @param features\n * @param layerName\n * @private\n */\n async transact(\n transactionType: TransactionType,\n features: Array<Feature<Geometry>> | Feature<Geometry>,\n layerName: string\n ): Promise<TransactionResponse | false> {\n features = Array.isArray(features) ? features : [features];\n\n const clonedFeatures = [];\n const geoLayer = getStoredLayer(layerName);\n\n for (const feature of features) {\n let clone = this._cloneFeature(feature);\n const cloneGeom = clone.getGeometry();\n\n // Ugly fix to support GeometryCollection on GML\n // See https://github.com/openlayers/openlayers/issues/4220\n if (cloneGeom instanceof GeometryCollection) {\n this._transformGeoemtryCollectionToGeometries(\n clone,\n cloneGeom as GeometryCollection\n );\n } else if (cloneGeom instanceof Circle) {\n // Geoserver has no Support to Circles\n this._transformCircleToPolygon(clone, cloneGeom as Circle);\n }\n\n // Filters\n if (\n 'beforeTransactFeature' in geoLayer &&\n typeof geoLayer.beforeTransactFeature === 'function'\n ) {\n clone = geoLayer.beforeTransactFeature(clone, transactionType);\n }\n\n if (clone) {\n clonedFeatures.push(clone);\n }\n }\n\n if (!clonedFeatures.length) {\n showError(I18N.errors.noValidGeometry);\n return false;\n }\n\n switch (transactionType) {\n case TransactionType.Insert:\n this._insertFeatures = [\n ...this._insertFeatures,\n ...clonedFeatures\n ];\n break;\n case TransactionType.Update:\n this._updateFeatures = [\n ...this._updateFeatures,\n ...clonedFeatures\n ];\n break;\n case TransactionType.Delete:\n this._deleteFeatures = [\n ...this._deleteFeatures,\n ...clonedFeatures\n ];\n break;\n default:\n break;\n }\n\n this._countRequests++;\n const numberRequest = this._countRequests;\n\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n try {\n // Prevent fire multiples times\n if (numberRequest !== this._countRequests) {\n return;\n }\n\n let srs = getMap().getView().getProjection().getCode();\n\n // Force latitude/longitude order on transactions\n // EPSG:4326 is longitude/latitude (assumption) and is not managed correctly by GML3\n srs =\n srs === 'EPSG:4326'\n ? 'urn:x-ogc:def:crs:EPSG:4326'\n : srs;\n\n const describeFeatureType =\n geoLayer.getDescribeFeatureType()._parsed;\n\n if (!geoLayer) {\n throw new Error(I18N.errors.layerNotFound);\n }\n\n const options = {\n featureNS: describeFeatureType.namespace,\n featureType: layerName,\n srsName: srs,\n featurePrefix: null,\n nativeElements: null,\n version: this.getAdvanced().wfsTransactionVersion\n };\n\n const transaction = this._formatWFS.writeTransaction(\n this._insertFeatures,\n this._updateFeatures,\n this._deleteFeatures,\n options\n );\n\n let payload = this._xs.serializeToString(transaction);\n const geomType = describeFeatureType.geomType;\n const geomField = describeFeatureType.geomField;\n\n // Ugly fix to support GeometryCollection on GML\n // See https://github.com/openlayers/openlayers/issues/4220\n if (geomType === GeometryType.GeometryCollection) {\n if (transactionType === TransactionType.Insert) {\n payload = payload.replace(\n /<geometry>/g,\n `<geometry><MultiGeometry xmlns=\"http://www.opengis.net/gml\" srsName=\"${srs}\"><geometryMember>`\n );\n payload = payload.replace(\n /<\\/geometry>/g,\n `</geometryMember></MultiGeometry></geometry>`\n );\n } else if (transactionType === TransactionType.Update) {\n const gmemberIn = `<MultiGeometry xmlns=\"http://www.opengis.net/gml\" srsName=\"${srs}\"><geometryMember>`;\n const gmemberOut = `</geometryMember></MultiGeometry>`;\n\n payload = payload.replace(\n /(.*)(<Name>geometry<\\/Name><Value>)(.*?)(<\\/Value>)(.*)/g,\n `$1$2${gmemberIn}$3${gmemberOut}$4$5`\n );\n }\n }\n\n // Fixes geometry name, weird bug with GML:\n // The property for the geometry column is always named \"geometry\"\n if (transactionType === TransactionType.Insert) {\n payload = payload.replace(\n /<(\\/?)\\bgeometry\\b>/g,\n `<$1${geomField}>`\n );\n } else {\n payload = payload.replace(\n /<Name>geometry<\\/Name>/g,\n `<Name>${geomField}</Name>`\n );\n }\n\n // This has to be te same used before\n if (\n this.hasLockFeature &&\n this.getUseLockFeature() &&\n transactionType !== TransactionType.Insert\n ) {\n payload = payload.replace(\n `</Transaction>`,\n `<LockId>${this._options.advanced.lockFeatureParams.lockId}</LockId></Transaction>`\n );\n }\n\n const headers = {\n 'Content-Type': 'text/xml',\n ...this.getHeaders()\n };\n\n const response = await fetch(this.getUrl(), {\n method: 'POST',\n body: payload,\n headers: headers,\n credentials: this._options.credentials\n });\n\n if (!response.ok) {\n throw new Error(\n I18N.errors.transaction + ' ' + response.status\n );\n }\n\n const parseResponse =\n this._formatWFS.readTransactionResponse(\n await response.text()\n );\n\n if (!Object.keys(parseResponse).length) {\n const responseStr = await response.text();\n const findError = String(responseStr).match(\n /<ows:ExceptionText>([\\s\\S]*?)<\\/ows:ExceptionText>/\n );\n\n if (findError) {\n throw new Error(findError[1]);\n }\n }\n\n if (transactionType !== TransactionType.Delete) {\n for (const feature of features as Array<\n Feature<Geometry>\n >) {\n getEditLayer().getSource().removeFeature(feature);\n }\n }\n\n const wlayer = getStoredLayer(layerName);\n\n wlayer.refresh();\n\n showLoading(false);\n\n this._insertFeatures = [];\n this._updateFeatures = [];\n this._deleteFeatures = [];\n\n this._countRequests = 0;\n\n resolve(parseResponse);\n } catch (err) {\n showError(err.message, err);\n showLoading(false);\n this._countRequests = 0;\n reject();\n }\n }, 0);\n });\n }\n\n /**\n *\n * @param feature\n * @param geom\n * @private\n */\n _transformCircleToPolygon(feature: Feature<Geometry>, geom: Circle) {\n const geomConverted = fromCircle(geom);\n feature.setGeometry(geomConverted);\n }\n\n /**\n *\n * @param feature\n * @private\n * @param geom\n */\n _transformGeoemtryCollectionToGeometries(\n feature: Feature<Geometry>,\n geom: GeometryCollection\n ) {\n let geomConverted = geom.getGeometries()[0];\n\n if (geomConverted instanceof Circle) {\n geomConverted = fromCircle(geomConverted);\n }\n\n feature.setGeometry(geomConverted);\n }\n\n /**\n *\n * @param feature\n * @returns\n * @private\n */\n _cloneFeature(feature: Feature<Geometry>): Feature<Geometry> {\n removeFeatureFromEditList(feature);\n\n const featureProperties = feature.getProperties();\n\n delete featureProperties.boundedBy;\n delete featureProperties._layerName_;\n\n const clone = new Feature(featureProperties);\n clone.setId(feature.getId());\n\n return clone;\n }\n\n /**\n * Lock a feature in the geoserver. Useful before editing a geometry,\n * to avoid changes from multiples suers\n *\n * @param featureId\n * @param layerName\n * @param retry\n * @public\n */\n async lockFeature(\n featureId: string | number,\n layerName: string,\n retry = 0\n ): Promise<string> {\n const params = new URLSearchParams({\n service: 'wfs',\n version: this.getAdvanced().lockFeatureVersion,\n request: 'LockFeature',\n typeName: layerName,\n expiry: String(this._options.advanced.lockFeatureParams.expiry),\n LockId: this._options.advanced.lockFeatureParams.lockId,\n releaseAction:\n this._options.advanced.lockFeatureParams.releaseAction,\n exceptions: 'application/json',\n featureid: `${featureId}`\n });\n\n const url_fetch = this.getUrl() + '?' + params.toString();\n\n try {\n const response = await fetch(url_fetch, {\n headers: this._options.headers,\n credentials: this._options.credentials\n });\n\n if (!response.ok) {\n throw new Error(I18N.errors.lockFeature);\n }\n\n const data = await response.text();\n\n try {\n // First, check if is a JSON (with errors)\n const dataParsed = JSON.parse(data);\n\n if ('exceptions' in dataParsed) {\n const exceptions = dataParsed.exceptions;\n if (exceptions[0].code === 'CannotLockAllFeatures') {\n // Maybe the Feature is already blocked, ant thats trigger error, so, we try one locking more time again\n if (!retry) {\n this.lockFeature(featureId, layerName, 1);\n } else {\n showError(I18N.errors.lockFeature, exceptions);\n }\n } else {\n showError(exceptions[0].text, exceptions);\n }\n }\n } catch (err) {\n /*\n \n let dataDoc = (new window.DOMParser()).parseFromString(data, 'text/xml');\n \n let lockId = dataDoc.getElementsByTagName('wfs:LockId');\n \n let featuresLocked: HTMLCollectionOf<Element> = dataDoc.getElementsByTagName('ogc:FeatureId');\n \n for (let featureLocked of featuresLocked as any) {\n \n console.log(featureLocked.getAttribute('fid'));\n \n }\n \n */\n }\n\n return data;\n } catch (err) {\n showError(err.message, err);\n }\n }\n}\n\n/**\n * **_[interface]_**\n * @public\n */\nexport interface GeoserverOptions {\n /**\n * Url for OWS services. This endpoint will recive the WFS, WFST and WMS requests\n *\n */\n url: string;\n\n /**\n * Advanced options for geoserver requests\n *\n */\n advanced?: GeoServerAdvanced;\n\n /**\n * Http headers for GeoServer requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/headers\n *\n */\n headers?: HeadersInit;\n\n /**\n * Credentials for fetch requests\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n *\n * Default is 'same-origin'\n */\n credentials?: RequestCredentials;\n\n /**\n * Use LockFeatue request on GeoServer when selecting features. Prevents a feature from being edited\n * through a persistent feature lock. This is not always supportedd by the GeoServer.\n * See https://docs.geoserver.org/stable/en/user/services/wfs/reference.html\n */\n useLockFeature?: boolean;\n}\n\n/**\n * **_[interface]_**\n *\n * * Default values:\n * ```javascript\n * {\n * getCapabilitiesVersion: '1.3.0',\n * getFeatureVersion: '1.0.0',\n * describeFeatureTypeVersion: '1.1.0',\n * lockFeatureVersion: '1.1.0',\n * wfsTransactionVersion: '1.1.0',\n * projection: 'EPSG:3857',\n * lockFeatureParams: {\n * expiry: 5,\n * lockId: 'Geoserver',\n * releaseAction: 'SOME'\n * }\n * }\n * @public\n */\nexport interface GeoServerAdvanced {\n getCapabilitiesVersion?: string;\n getFeatureVersion?: string;\n lockFeatureVersion?: string;\n describeFeatureTypeVersion?: string;\n wfsTransactionVersion?: string;\n projection?: ProjectionLike;\n lockFeatureParams?: {\n // 5 (minutes) by default\n expiry?: number | string;\n\n // 'Geoserver' by default\n lockId?: string;\n\n // 'SOME' by default\n releaseAction?: string;\n };\n}\n\nexport enum GeoserverProperty {\n CAPABILITIES = 'capabilities',\n URL = 'url',\n HEADERS = 'headers',\n CREDENTIALS = 'credentials',\n ADVANCED = 'advanced',\n HASTRASNACTION = 'hasTransaction',\n HASLOCKFEATURE = 'hasLockFeature',\n HASDESCRIBEFEATURETYPE = 'hasDescribeFeatureType',\n USELOCKFEATURE = 'useLockFeature',\n ISLOADED = 'isLoaded'\n}\n\nexport type GeoserverEventTypes =\n | `change:${GeoserverProperty.CAPABILITIES}`\n | `change:${GeoserverProperty.URL}`\n | `change:${GeoserverProperty.HEADERS}`\n | `change:${GeoserverProperty.CREDENTIALS}`\n | `change:${GeoserverProperty.ADVANCED}`\n | `change:${GeoserverProperty.HASTRASNACTION}`\n | `change:${GeoserverProperty.HASLOCKFEATURE}`\n | `change:${GeoserverProperty.HASDESCRIBEFEATURETYPE}`\n | `change:${GeoserverProperty.USELOCKFEATURE}`\n | `change:${GeoserverProperty.ISLOADED}`;\n","import { getCenter } from 'ol/extent';\nimport { Geometry } from 'ol/geom';\nimport { Feature, Overlay } from 'ol';\nimport { Coordinate } from 'ol/coordinate';\n\n// Images\nimport editFieldsSvg from '../assets/images/editFields.svg';\nimport editGeomSvg from '../assets/images/editGeom.svg';\nimport { I18N } from './i18n';\n\nimport myPragma from '../myPragma';\n\nexport default class EditOverlay extends Overlay {\n constructor(feature: Feature<Geometry>, coordinate: Coordinate = null) {\n super({\n id: feature.getId(),\n position:\n coordinate || getCenter(feature.getGeometry().getExtent()),\n positioning: 'center-center',\n offset: [0, -40],\n stopEvent: true,\n element: (\n <div>\n <div\n className=\"ol-wfst--edit-button-cnt\"\n onclick={() => {\n this.dispatchEvent('editFields');\n }}\n >\n <button\n className=\"ol-wfst--edit-button\"\n type=\"button\"\n title={I18N.labels.editFields}\n >\n <img\n src={editFieldsSvg}\n alt={I18N.labels.editFields}\n />\n </button>\n </div>\n <div\n className=\"ol-wfst--edit-button-cnt\"\n onclick={() => {\n this.dispatchEvent('editGeom');\n }}\n >\n <button\n class=\"ol-wfst--edit-button\"\n type=\"button\"\n title={I18N.labels.editGeom}\n >\n <img src={editGeomSvg} alt={I18N.labels.editGeom} />\n </button>\n </div>\n </div>\n )\n });\n }\n}\n","var img = \"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\";\n export default img;","var img = \"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\";\n export default img;","// Ol\nimport { Geometry } from 'ol/geom';\nimport { Circle as CircleStyle, Fill, Stroke, Style } from 'ol/style';\nimport { Control } from 'ol/control';\nimport { Draw, Modify, Select, Snap } from 'ol/interaction';\nimport { EventsKey } from 'ol/events';\nimport { Collection, Feature, MapBrowserEvent, Overlay, View } from 'ol';\nimport Map from 'ol/Map';\nimport BaseEvent from 'ol/events/Event';\nimport { LoadingStrategy } from 'ol/source/Vector';\nimport { FeatureLike } from 'ol/Feature';\nimport { Options as VectorLayerOptions } from 'ol/layer/BaseVector';\nimport { Vector as VectorSource } from 'ol/source';\nimport { never, primaryAction } from 'ol/events/condition';\nimport { unByKey } from 'ol/Observable';\nimport { Coordinate } from 'ol/coordinate';\nimport { CombinedOnSignature, EventTypes, OnSignature } from 'ol/Observable';\nimport { ObjectEvent } from 'ol/Object';\nimport { Types as ObjectEventTypes } from 'ol/ObjectEventType';\n\nimport { initModal, showError } from './modules/errors';\nimport { initLoading, showLoading } from './modules/loading';\nimport WfsLayer from './WfsLayer';\nimport WmsLayer from './WmsLayer';\nimport LayersControl, {\n activateDrawButton,\n activateModeButtons,\n resetStateButtons\n} from './modules/LayersControl';\nimport Uploads from './modules/Uploads';\nimport {\n addFeatureToEditedList,\n getStoredMapLayers,\n isFeatureEdited,\n removeFeatureFromEditList,\n setActiveLayerToInsertEls,\n getActiveLayerToInsertEls,\n activateMode,\n getMode,\n Modes,\n setMap,\n setMapLayers,\n getStoredLayer\n} from './modules/state';\nimport { deepObjectAssign } from './modules/helpers';\nimport { getEditLayer } from './modules/editLayer';\nimport { GeometryType, TransactionType } from './@enums';\nimport {\n I18n,\n IGeoserverDescribeFeatureType,\n WfsGeoserverVendor,\n WmsGeoserverVendor\n} from './@types';\nimport * as i18n from './modules/i18n/index';\nimport { getDefaultOptions } from './defaults';\nimport EditControlChangesEl from './modules/EditControlChanges';\nimport styleFunction from './modules/styleFunction';\nimport { EditFieldsModal } from './modules/EditFieldsModal';\nimport Geoserver from './Geoserver';\nimport EditOverlay from './modules/EditOverlay';\nimport { BaseLayerProperty } from './modules/base/BaseLayer';\n\n// External\nimport Modal from 'modal-vanilla';\n\n// Style\nimport './assets/scss/-ol-wfst.bootstrap5.scss';\nimport './assets/scss/ol-wfst.scss';\n\nconst controlElement = document.createElement('div');\n\n/**\n * Tiny WFST-T client to insert (drawing/uploading), modify and delete\n * features on GeoServers using OpenLayers. Layers with these types\n * of geometries are supported: \"GeometryCollection\" (in this case, you can\n * choose the geometry type of each element to draw), \"Point\", \"MultiPoint\",\n * \"LineString\", \"MultiLineString\", \"Polygon\" and \"MultiPolygon\".\n *\n * @constructor\n * @fires modifystart\n * @fires modifyend\n * @fires drawstart\n * @fires drawend\n * @fires load\n * @fires describeFeatureType\n * @extends {ol/control/Control~Control}\n * @param options Wfst options, see [Wfst Options](#options) for more details.\n */\nexport default class Wfst extends Control {\n protected _options: Options;\n protected _i18n: I18n;\n\n // Ol\n protected _map: Map;\n protected _view: View;\n protected _viewport: HTMLElement;\n protected _initialized = false;\n protected _layersControl: LayersControl;\n protected _overlay: Overlay;\n\n // Interactions\n protected _interactionWfsSelect: Select;\n protected _interactionSelectModify: Select;\n protected _collectionModify: Collection<any>;\n protected _interactionModify: Modify;\n protected _interactionSnap: Snap;\n protected _interactionDraw: Draw;\n\n // Obserbable keys\n protected _keyClickWms: EventsKey | EventsKey[];\n protected _keyRemove: EventsKey;\n protected _keySelect: EventsKey;\n\n // Controls\n protected _controlApplyDiscardChanges: EditControlChangesEl;\n protected _controlWidgetToolsDiv: HTMLElement;\n protected _selectDraw: HTMLSelectElement;\n\n // State\n protected _currentZoom: number;\n protected _lastZoom: number;\n\n // Editing\n protected _editFeature: Feature<Geometry>;\n protected _editFeatureOriginal: Feature<Geometry>;\n\n protected _uploads: Uploads;\n protected _editFields: EditFieldsModal;\n\n declare on: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<WfstEventTypes, WfstEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n WfstEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare once: OnSignature<EventTypes, BaseEvent, EventsKey> &\n OnSignature<WfstEventTypes, WfstEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, EventsKey> &\n CombinedOnSignature<\n WfstEventTypes | ObjectEventTypes | EventTypes,\n EventsKey\n >;\n\n declare un: OnSignature<EventTypes, BaseEvent, void> &\n OnSignature<WfstEventTypes, WfstEvent, EventsKey> &\n OnSignature<ObjectEventTypes, ObjectEvent, void> &\n CombinedOnSignature<\n WfstEventTypes | ObjectEventTypes | EventTypes,\n void\n >;\n\n constructor(options?: Options) {\n super({\n target: null,\n element: controlElement,\n render: () => {\n if (!this._map) this._init();\n }\n });\n\n i18n.setLang(options.language, options.i18n);\n\n const defaultOptions = getDefaultOptions();\n\n this._options = deepObjectAssign(defaultOptions, options);\n\n // By default, the first layer is ready to accept new draws\n setActiveLayerToInsertEls(this._options.layers[0]);\n\n this._controlWidgetToolsDiv = controlElement;\n this._controlWidgetToolsDiv.className = 'ol-wfst--tools-control';\n\n this._uploads = new Uploads(this._options);\n\n this._editFields = new EditFieldsModal(this._options.modal);\n }\n\n /**\n * Get all the layers in the ol-wfst instance\n * @public\n */\n getLayers(): Array<WfsLayer | WmsLayer> {\n return Object.values(getStoredMapLayers());\n }\n\n /**\n * Get a layer\n * @public\n */\n getLayerByName(layerName = ''): WfsLayer | WmsLayer {\n const layers = getStoredMapLayers();\n if (layerName && layerName in layers) {\n return layers[layerName];\n }\n return null;\n }\n\n /**\n * Connect to the GeoServer and retrieve metadata about the service (GetCapabilities).\n * Get each layer specs (DescribeFeatureType) and create the layers and map controls.\n * @fires describeFeatureType\n * @private\n */\n async _initMapAndLayers(): Promise<void> {\n try {\n const layers = this._options.layers;\n\n if (layers.length) {\n let layerRendered = 0;\n let layersNumber = 0; // Only count visibles\n\n layers.forEach((layer) => {\n if (layer.getVisible()) layersNumber++;\n\n layer.on('layerRendered', () => {\n layerRendered++;\n if (layerRendered >= layersNumber) {\n // run only once\n if (!this._initialized) {\n this.dispatchEvent('load');\n this._initialized = true;\n }\n showLoading(false);\n }\n });\n\n layer.on('change:describeFeatureType', () => {\n const domEl = this._layersControl.addLayerEl(layer);\n\n layer.on('change:isVisible', () => {\n const layerNotVisible =\n 'ol-wfst--layer-not-visible';\n\n const visible = layer.isVisibleByZoom();\n if (visible)\n domEl.classList.remove(layerNotVisible);\n else domEl.classList.add(layerNotVisible);\n });\n\n layer.set(\n BaseLayerProperty.ISVISIBLE,\n this._currentZoom > layer.getMinZoom()\n );\n\n this.dispatchEvent(\n new WfstEvent({\n type: 'describeFeatureType',\n layer: layer,\n data: layer.getDescribeFeatureType()\n })\n );\n });\n\n layer._init();\n\n this._map.addLayer(layer);\n\n setMapLayers({\n [layer.get(BaseLayerProperty.NAME)]: layer\n });\n });\n\n this._createMapElements(\n this._options.showControl,\n this._options.active\n );\n }\n } catch (err) {\n showLoading(false);\n showError(err.message, err);\n }\n }\n\n /**\n * @private\n */\n _init(): void {\n this._map = super.getMap();\n this._view = this._map.getView();\n this._viewport = this._map.getViewport();\n\n setMap(this._map);\n\n //@ts-expect-error\n this._uploads.on('addedFeatures', ({ features }) => {\n const layer = getActiveLayerToInsertEls();\n layer.insertFeatures(features);\n });\n\n //@ts-expect-error\n this._uploads.on('loadedFeatures', ({ features }) => {\n this.activateEditMode();\n const editLayerSource = getEditLayer().getSource();\n\n editLayerSource.addFeatures(features);\n\n this._view.fit(editLayerSource.getExtent(), {\n size: this._map.getSize(),\n maxZoom: 21,\n padding: [100, 100, 100, 100]\n });\n });\n\n // @ts-expect-error\n this._editFields.on('save', ({ feature }) => {\n // Force deselect to trigger handler\n this._collectionModify.remove(feature);\n });\n\n // @ts-expect-error\n this._editFields.dispose('delete', ({ feature }) => {\n this._deleteFeature(feature, true);\n });\n\n this._addMapEvents();\n\n initModal(this._options['modal']);\n\n this._controlWidgetToolsDiv.append(initLoading());\n\n this._initMapAndLayers();\n }\n\n /**\n * Create the edit layer to allow modify elements, add interactions,\n * map controls and keyboard handlers.\n *\n * @param showControl\n * @param active\n * @private\n */\n async _createMapElements(\n showControl: boolean,\n active: boolean\n ): Promise<void> {\n // VectorLayer to store features on editing and inserting\n this._prepareEditLayer();\n\n this._addInteractions();\n this._addInteractionHandlers();\n\n if (showControl) {\n this._addMapControl();\n }\n\n // By default, init in edit mode\n this.activateEditMode(active);\n }\n\n /**\n * @private\n */\n _addInteractions(): void {\n /**\n * Select the wfs feature already downloaded\n * @private\n */\n const prepareWfsInteraction = () => {\n this._collectionModify = new Collection();\n\n // Interaction to select wfs layer elements\n this._interactionWfsSelect = new Select({\n hitTolerance: 10,\n style: (feature: Feature<Geometry>) => styleFunction(feature),\n toggleCondition: never, // Prevent add features to the current selection using shift\n filter: (feature, layer) => {\n return (\n getMode() !== Modes.Edit &&\n layer &&\n layer instanceof WfsLayer &&\n layer === getActiveLayerToInsertEls()\n );\n }\n });\n\n this._map.addInteraction(this._interactionWfsSelect);\n\n this._interactionWfsSelect.on(\n 'select',\n ({ selected, deselected, mapBrowserEvent }) => {\n const coordinate = mapBrowserEvent.coordinate;\n\n if (selected.length) {\n selected.forEach((feature) => {\n if (!isFeatureEdited(feature)) {\n // Remove the feature from the original layer\n const layer =\n this._interactionWfsSelect.getLayer(\n feature\n );\n layer.getSource().removeFeature(feature);\n this._addFeatureToEditMode(\n feature,\n coordinate,\n layer.get(BaseLayerProperty.NAME)\n );\n }\n });\n }\n\n if (deselected.length) {\n if (getMode() !== Modes.Edit) {\n deselected.forEach((feature) => {\n // Trigger deselect\n // This is necessary for those times where two features overlap.\n this._collectionModify.remove(feature);\n });\n }\n }\n }\n );\n };\n\n /**\n * Call the geoserver to get the clicked feature\n * @private\n */\n const prepareWmsInteraction = (): void => {\n // Interaction to allow select features in the edit layer\n this._interactionSelectModify = new Select({\n style: (feature: Feature<Geometry>) => styleFunction(feature),\n layers: [getEditLayer()],\n toggleCondition: never, // Prevent add features to the current selection using shift\n removeCondition: () => (getMode() === Modes.Edit ? true : false) // Prevent deselect on clicking outside the feature\n });\n\n this._map.addInteraction(this._interactionSelectModify);\n\n this._collectionModify =\n this._interactionSelectModify.getFeatures();\n\n this._keyClickWms = this._map.on(\n this._options.evtType,\n async (evt: MapBrowserEvent<MouseEvent>) => {\n if (this._map.hasFeatureAtPixel(evt.pixel)) {\n return;\n }\n\n // Only get other features if editmode is disabled\n if (getMode() !== Modes.Edit) {\n const layer = getActiveLayerToInsertEls();\n\n // If layer is hidden or is a wfs, skip\n if (\n !layer.getVisible() ||\n !layer.isVisibleByZoom() ||\n layer instanceof WfsLayer\n ) {\n return;\n }\n\n const features = await layer._getFeaturesByClickEvent(\n evt\n );\n\n if (!features.length) {\n return;\n }\n\n // For now, support is only for one feature at time\n this._addFeatureToEditMode(\n features[0],\n evt.coordinate,\n layer.get(BaseLayerProperty.NAME)\n );\n }\n }\n );\n };\n\n if (this._options.layers.find((layer) => layer instanceof WfsLayer)) {\n prepareWfsInteraction();\n }\n\n if (this._options.layers.find((layer) => layer instanceof WmsLayer)) {\n prepareWmsInteraction();\n }\n\n this._interactionModify = new Modify({\n style: () => {\n if (getMode() === Modes.Edit) {\n return new Style({\n image: new CircleStyle({\n radius: 6,\n fill: new Fill({\n color: '#ff0000'\n }),\n stroke: new Stroke({\n width: 2,\n color: 'rgba(5, 5, 5, 0.9)'\n })\n })\n });\n } else {\n return;\n }\n },\n features: this._collectionModify,\n condition: (evt) => {\n return primaryAction(evt) && getMode() === Modes.Edit;\n }\n });\n\n this._map.addInteraction(this._interactionModify);\n\n this._interactionSnap = new Snap({\n source: getEditLayer().getSource()\n });\n this._map.addInteraction(this._interactionSnap);\n }\n\n /**\n * Layer to store temporary the elements to be edited\n * @private\n */\n _prepareEditLayer(): void {\n this._map.addLayer(getEditLayer());\n }\n\n /**\n * @private\n */\n _addMapEvents(): void {\n /**\n * @private\n */\n const keyboardEvents = (): void => {\n document.addEventListener('keydown', ({ key }) => {\n const inputFocus = document.querySelector('input:focus');\n if (inputFocus) {\n return;\n }\n if (key === 'Delete') {\n const selectedFeatures = this._collectionModify;\n if (selectedFeatures) {\n selectedFeatures.forEach((feature) => {\n this._deleteFeature(feature, true);\n });\n }\n }\n });\n };\n\n keyboardEvents();\n\n this._map.on('moveend', (): void => {\n this._currentZoom = this._view.getZoom();\n\n if (this._currentZoom !== this._lastZoom) {\n const layers = getStoredMapLayers();\n\n Object.keys(layers).forEach((key) => {\n const layer = layers[key];\n if (this._currentZoom > layer.getMinZoom()) {\n // Show the layers\n if (!layer.get(BaseLayerProperty.ISVISIBLE)) {\n layer.set(BaseLayerProperty.ISVISIBLE, true);\n }\n } else {\n // Hide the layer\n if (layer.get(BaseLayerProperty.ISVISIBLE)) {\n layer.set(BaseLayerProperty.ISVISIBLE, false);\n }\n }\n });\n\n this._lastZoom = this._currentZoom;\n }\n });\n }\n\n /**\n * Add map handlers\n * @private\n */\n _addInteractionHandlers(): void {\n // When a feature is modified, add this to a list.\n // This prevent events fired on select and deselect features that has no changes and should\n // not be updated in the geoserver\n this._interactionModify.on('modifyend', (evt) => {\n const feature = evt.features.item(0);\n addFeatureToEditedList(feature);\n super.dispatchEvent(evt);\n });\n\n this._interactionModify.on('modifystart', (evt) => {\n super.dispatchEvent(evt);\n });\n\n this._onDeselectFeatureEvent();\n this._onRemoveFeatureEvent();\n }\n\n /**\n * Add the widget on the map to allow change the tools and select active layers\n * @private\n */\n _addMapControl(): void {\n this._layersControl = new LayersControl(\n this._options.showUpload ? this._uploads : null,\n this._options.uploadFormats\n );\n\n // @ts-expect-error\n this._layersControl.on('drawMode', () => {\n if (getMode() === Modes.Draw) {\n resetStateButtons();\n this.activateEditMode();\n } else {\n const activeLayer = getActiveLayerToInsertEls();\n\n if (!activeLayer.isVisibleByZoom()) {\n showError(i18n.I18N.errors.layerNotVisible);\n } else {\n this.activateDrawMode(getActiveLayerToInsertEls());\n }\n }\n });\n\n // @ts-expect-error\n this._layersControl.on('changeGeom', () => {\n if (getMode() === Modes.Draw) {\n this.activateDrawMode(getActiveLayerToInsertEls());\n }\n });\n\n const controlEl = this._layersControl.render();\n\n this._selectDraw = controlEl.querySelector(\n '.wfst--tools-control--select-draw'\n );\n\n this._controlWidgetToolsDiv.append(controlEl);\n }\n\n /**\n *\n * @param feature\n * @private\n */\n _deselectEditFeature(feature: FeatureLike): void {\n this._removeOverlayHelper(feature);\n }\n\n /**\n *\n * @param feature\n * @param layerName\n * @private\n */\n _restoreFeatureToLayer(\n feature: Feature<Geometry>,\n layerName?: string\n ): void {\n layerName = layerName || feature.get('_layerName_');\n const layer = getStoredMapLayers()[layerName];\n (layer.getSource() as VectorSource<Geometry>).addFeature(feature);\n }\n\n /**\n * @param feature\n * @private\n */\n _removeFeatureFromTmpLayer(feature: Feature<Geometry>): void {\n // Remove element from the Layer\n getEditLayer().getSource().removeFeature(feature);\n }\n\n /**\n * Trigger on deselecting a feature from in the Edit layer\n *\n * @private\n */\n _onDeselectFeatureEvent(): void {\n const checkIfFeatureIsChanged = (feature: Feature<Geometry>): void => {\n const layerName = feature.get('_layerName_');\n\n const layer = this._options.layers.find(\n (layer) => layer.get(BaseLayerProperty.NAME) === layerName\n );\n\n if (layer instanceof WfsLayer) {\n this._interactionWfsSelect.getFeatures().remove(feature);\n }\n\n if (isFeatureEdited(feature)) {\n layer.transactFeatures(TransactionType.Update, feature);\n } else {\n // Si es wfs y el elemento no tuvo cambios, lo devolvemos a la layer original\n if (layer instanceof WfsLayer) {\n this._restoreFeatureToLayer(feature, layerName);\n }\n this._removeFeatureFromTmpLayer(feature);\n }\n };\n\n // This is fired when a feature is deselected and fires the transaction process\n this._keySelect = this._collectionModify.on('remove', (evt) => {\n const feature = evt.element;\n\n this._deselectEditFeature(feature);\n\n checkIfFeatureIsChanged(feature);\n\n this._editModeOff();\n });\n }\n\n /**\n * Trigger on removing a feature from the Edit layer\n *\n * @private\n */\n _onRemoveFeatureEvent(): void {\n // If a feature is removed from the edit layer\n this._keyRemove = getEditLayer()\n .getSource()\n .on('removefeature', (evt) => {\n const feature = evt.feature;\n\n if (!feature.get('_delete_')) {\n return;\n }\n\n if (this._keySelect) {\n unByKey(this._keySelect);\n }\n\n const layerName = feature.get('_layerName_');\n\n const ll = this.getLayerByName(layerName);\n\n ll.transactFeatures(TransactionType.Delete, feature);\n\n this._deselectEditFeature(feature);\n this._editModeOff();\n\n if (this._keySelect) {\n setTimeout(() => {\n this._onDeselectFeatureEvent();\n }, 150);\n }\n });\n }\n\n /**\n *\n * @param feature\n * @private\n */\n _editModeOn(feature: Feature<Geometry>): void {\n this._editFeatureOriginal = feature.clone();\n\n activateMode(Modes.Edit);\n\n // To refresh the style\n getEditLayer().getSource().changed();\n\n this._removeOverlayHelper(feature);\n\n this._controlApplyDiscardChanges = new EditControlChangesEl(feature);\n\n this._controlApplyDiscardChanges.on('cancel', ({ feature }) => {\n feature.setGeometry(this._editFeatureOriginal.getGeometry());\n removeFeatureFromEditList(feature);\n this._collectionModify.remove(feature);\n });\n\n this._controlApplyDiscardChanges.on('apply', ({ feature }) => {\n showLoading();\n this._collectionModify.remove(feature);\n });\n\n this._controlApplyDiscardChanges.on('delete', ({ feature }) => {\n this._deleteFeature(feature, true);\n });\n\n this._map.addControl(this._controlApplyDiscardChanges);\n }\n\n /**\n * @private\n */\n _editModeOff(): void {\n activateMode(null);\n this._map.removeControl(this._controlApplyDiscardChanges);\n }\n\n /**\n * Remove a feature from the edit Layer and from the Geoserver\n *\n * @param feature\n * @private\n */\n _deleteFeature(feature: Feature<Geometry>, confirm: boolean): void {\n const deleteEl = () => {\n const features = Array.isArray(feature) ? feature : [feature];\n features.forEach((feature) => {\n feature.set('_delete_', true, true);\n getEditLayer().getSource().removeFeature(feature);\n });\n this._collectionModify.clear();\n\n const layerName = feature.get('_layerName_');\n const layer = this._options.layers.find(\n (layer) => layer.get(BaseLayerProperty.NAME) === layerName\n );\n\n if (layer instanceof WfsLayer) {\n this._interactionWfsSelect.getFeatures().remove(feature);\n }\n };\n\n if (confirm) {\n const confirmModal = Modal.confirm(i18n.I18N.labels.confirmDelete, {\n ...this._options.modal\n });\n\n confirmModal.show().once('dismiss', function (modal, ev, button) {\n if (button && button.value) {\n deleteEl();\n }\n });\n } else {\n deleteEl();\n }\n }\n\n /**\n * Add a feature to the Edit Layer to allow editing, and creates an Overlay Helper to show options\n *\n * @param feature\n * @param coordinate\n * @param layerName\n * @private\n */\n _addFeatureToEditMode(\n feature: Feature<Geometry>,\n coordinate: Coordinate = null,\n layerName = null\n ): void {\n // For now, only allow one element at time\n // @TODO: allow edit multiples elements\n if (this._collectionModify.getLength()) return;\n\n if (layerName) {\n // Store the layer information inside the feature\n feature.set('_layerName_', layerName);\n }\n\n const props = feature ? feature.getProperties() : '';\n\n if (props) {\n if (feature.getGeometry()) {\n getEditLayer().getSource().addFeature(feature);\n this._collectionModify.push(feature);\n\n const overlay = new EditOverlay(feature, coordinate);\n\n // @ts-expect-error\n overlay.on('editFields', () => {\n this._editFields.show(feature);\n });\n\n // @ts-expect-error\n overlay.on('editGeom', () => {\n this._editModeOn(feature);\n });\n\n this._map.addOverlay(overlay);\n\n const layer = getStoredLayer(layerName);\n if (layer) {\n layer.maybeLockFeature(feature.getId());\n }\n }\n }\n }\n\n /**\n * Activate/deactivate the draw mode\n *\n * @param layer\n * @public\n */\n activateDrawMode(layer: WfsLayer | WmsLayer | false): void {\n /**\n *\n * @param layer\n * @private\n */\n const addDrawInteraction = (layer: WfsLayer | WmsLayer): void => {\n this.activateEditMode(false);\n\n // If already exists, remove\n if (this._interactionDraw) {\n this._map.removeInteraction(this._interactionDraw);\n }\n\n const geomDrawType = this._selectDraw.value;\n\n this._interactionDraw = new Draw({\n source: getEditLayer().getSource(),\n type: geomDrawType as GeometryType,\n style: (feature: Feature<Geometry>) => styleFunction(feature),\n stopClick: true // To prevent firing a map/wms click\n });\n\n this._map.addInteraction(this._interactionDraw);\n\n this._interactionDraw.on('drawstart', (evt) => {\n super.dispatchEvent(evt);\n });\n\n this._interactionDraw.on('drawend', (evt) => {\n const feature: Feature<Geometry> = evt.feature;\n layer.transactFeatures(TransactionType.Insert, feature);\n super.dispatchEvent(evt);\n });\n };\n\n if (!this._interactionDraw && !layer) {\n return;\n }\n\n if (layer) {\n // If layer is set to invisible, show warning\n if (!layer.getVisible()) {\n return;\n }\n\n activateDrawButton();\n\n this._viewport.classList.add('draw-mode');\n\n addDrawInteraction(layer);\n } else {\n this._map.removeInteraction(this._interactionDraw);\n this._viewport.classList.remove('draw-mode');\n }\n\n activateMode(layer ? Modes.Draw : null);\n }\n\n /**\n * Activate/desactivate the edit mode\n *\n * @param bool\n * @public\n */\n activateEditMode(bool = true): void {\n if (bool) {\n activateModeButtons();\n this.activateDrawMode(false);\n } else {\n // Deselct features\n this._collectionModify.clear();\n }\n\n if (this._interactionSelectModify) {\n this._interactionSelectModify.setActive(bool);\n }\n\n this._interactionModify.setActive(bool);\n\n if (this._interactionWfsSelect)\n this._interactionWfsSelect.setActive(bool);\n }\n\n /**\n * Remove the overlay helper atttached to a specify feature\n * @param feature\n * @private\n */\n _removeOverlayHelper(feature: FeatureLike): void {\n const featureId = feature.getId();\n\n if (!featureId) {\n return;\n }\n\n const overlay = this._map.getOverlayById(featureId);\n\n if (!overlay) {\n return;\n }\n\n this._map.removeOverlay(overlay);\n }\n}\n\n/**\n * **_[interface]_** - Wfst Options specified when creating a Wfst instance\n *\n * Default values:\n * ```javascript\n * {\n * layers: null,\n * evtType: 'singleclick',\n * active: true,\n * showControl: true,\n * language: 'en',\n * i18n: {...}, // according to language selection\n * uploadFormats: '.geojson,.json,.kml',\n * processUpload: null,\n * }\n * ```\n */\ninterface Options {\n /**\n * Layers to be loaded from the geoserver\n */\n layers?: Array<WfsLayer | WmsLayer>;\n\n /**\n * Init active\n */\n active?: boolean;\n\n /**\n * The click event to allow selection of Features to be edited\n */\n evtType?: 'singleclick' | 'dblclick';\n\n /**\n * Show/hide the control map\n */\n showControl?: boolean;\n\n /**\n * Modal configuration\n */\n modal?: {\n animateClass?: string;\n animateInClass?: string;\n transition?: number;\n backdropTransition?: number;\n templates?: {\n dialog?: string | HTMLElement;\n headerClose?: string | HTMLElement;\n };\n };\n\n /**\n * Language to be used\n */\n language?: 'es' | 'en' | 'zh';\n\n /**\n * Custom translations\n */\n i18n?: I18n;\n\n /**\n * Show/hide the upload button\n */\n showUpload?: boolean;\n\n /**\n * Accepted extension formats on upload\n * Example: \".json,.geojson\"\n */\n uploadFormats?: string;\n\n /**\n * Triggered to allow implement custom functions or to parse other formats than default\n * by filtering the extension. If this doesn't return features, the default function\n * will be used to extract them.\n */\n processUpload?(file: File): Array<Feature<Geometry>>;\n}\n\n/**\n * **_[interface]_** - Parameters to create the layers and connect to the GeoServer\n *\n * You can use all the parameters supported by OpenLayers\n *\n * Default values:\n * ```javascript\n * {\n * name: null,\n * geoserver: null,\n * label: null, // `name` if not provided\n * strategy: all,\n * geoserverVendor: null\n * }\n * ```\n */\ninterface LayerOptions extends Omit<VectorLayerOptions<any>, 'source'> {\n /**\n * Layer name in the GeoServer\n */\n name: string;\n\n /**\n * Geoserver Object\n */\n geoserver: Geoserver;\n\n /**\n * Label to be displayed in the widget control\n */\n label?: string;\n\n /**\n * Available geoserver options\n */\n geoserverVendor?: WfsGeoserverVendor | WmsGeoserverVendor;\n\n /**\n * Strategy function for loading features.\n * Only for WFS\n * By default `all` strategy is used\n */\n strategy?: LoadingStrategy;\n\n /**\n * Triggered before inserting new features to the Geoserver.\n * Use this to insert custom properties, modify the feature, etc.\n */\n beforeTransactFeature?(\n feature: Feature<Geometry>,\n transaction: TransactionType\n ): Feature<Geometry>;\n}\nclass WfstEvent extends BaseEvent {\n public data: IGeoserverDescribeFeatureType;\n public layer: WfsLayer | WmsLayer;\n\n constructor(options: {\n type: WfstEventTypes;\n layer: WfsLayer | WmsLayer;\n data: IGeoserverDescribeFeatureType;\n }) {\n super(options.type);\n this.layer = options.layer;\n this.data = options.data;\n }\n}\n\ntype WfstEventTypes = 'describeFeatureType';\n\nexport {\n Options,\n WfstEventTypes,\n WfstEvent,\n I18n,\n LayerOptions,\n Geoserver,\n WmsLayer,\n WfsLayer\n};\n","import { I18N } from './modules/i18n';\nimport { Options } from './ol-wfst';\n\nexport const DEFAULT_LANGUAGE = 'en';\n\nexport const getDefaultOptions = (): Options => {\n return {\n layers: null,\n evtType: 'singleclick',\n active: true,\n showControl: true,\n language: DEFAULT_LANGUAGE,\n uploadFormats: '.geojson,.json,.kml',\n processUpload: null,\n modal: {\n animateClass: 'fade',\n animateInClass: 'show',\n transition: 300,\n backdropTransition: 150,\n templates: {\n dialog: '<div class=\"modal-dialog modal-dialog-centered\"></div>',\n headerClose: `<button type=\"button\" class=\"btn-close\" data-dismiss=\"modal\" aria-label=\"${I18N.labels.close}\"><span aria-hidden=\"true\">×</span></button>`\n }\n }\n };\n};\n","import Wfst from '../src/ol-wfst';\nimport WfsLayer from '../src/WfsLayer';\nimport WmsLayer from '../src/WmsLayer';\nimport Geoserver from '../src/Geoserver';\n\nconst utils = {\n WfsLayer,\n WmsLayer,\n Geoserver\n};\n\nObject.assign(Wfst, utils);\nexport default Wfst;\n"],"names":["messages","AssertionError","Error","constructor","code","message","super","this","name","AssertionError$1","Event$1","type","propagationStopped","defaultPrevented","target","preventDefault","stopPropagation","ObjectEventType","Disposable$1","disposed","dispose","disposeInternal","VOID","clear","object","property","Target$1","Disposable","eventTarget_","pendingRemovals_","dispatching_","listeners_","addEventListener","listener","listeners","listenersForType","includes","push","dispatchEvent","event","isString","evt","Event","dispatching","pendingRemovals","propagate","i","ii","length","handleEvent","call","pr","removeEventListener","getListeners","undefined","hasListener","Object","keys","index","indexOf","splice","EventType","listen","thisArg","once","bind","originalListener","apply","arguments","eventsKey","listenOnce","unlistenByKey","key","Observable","EventTarget","on","un","revision_","changed","getRevision","onInternal","Array","isArray","len","onceInternal","ol_key","unInternal","unByKey","prototype","Observable$1","uidCounter_","ObjectEvent","oldValue","BaseObject$1","values","obj","ol_uid","String","values_","setProperties","get","value","hasOwnProperty","getKeys","getProperties","assign","hasProperties","notify","eventType","addChangeListener","removeChangeListener","set","silent","applyProperties","source","unset","isEmpty","CollectionEventType","Property","CollectionEvent","element","Collection$1","BaseObject","array","options","unique_","unique","array_","assertUnique_","updateLength_","getLength","pop","extend","arr","forEach","f","getArray","item","insertAt","elem","removeAt","n","remove","prev","setAt","except","Feature","geometryOrProperties","id_","geometryName_","style_","styleFunction_","geometryChangeKey_","handleGeometryChanged_","geometry","setGeometry","properties","clone","setGeometryName","getGeometryName","getGeometry","style","getStyle","setStyle","getId","getStyleFunction","handleGeometryChange_","styles","assertion","errorCode","assert","createStyleFunction","setId","id","Feature$1","outerWidth","width","offsetWidth","getComputedStyle","parseInt","marginLeft","marginRight","outerHeight","height","offsetHeight","marginTop","marginBottom","TileState","MapEventType","Overlay$1","insertFirst","stopEvent","document","createElement","className","position","pointerEvents","autoPan","rendered","transform_","visible","mapPostrenderListenerKey","handleElementChanged","handleMapChanged","handleOffsetChanged","handlePositionChanged","handlePositioningChanged","setElement","setOffset","offset","setPositioning","positioning","setPosition","getElement","getMap","getOffset","getPosition","getPositioning","node","lastChild","removeChild","removeChildren","appendChild","parentNode","map","render","updatePixelPosition","container","getOverlayContainerStopEvent","getOverlayContainer","insertBefore","childNodes","performAutoPan","setMap","panIntoView","panIntoViewOptions","getTargetElement","mapRect","getRect","getSize","overlayRect","myMargin","margin","extent2","extent1","offsetLeft","offsetRight","offsetTop","offsetBottom","delta","Math","abs","center","getView","getCenterInternal","centerPx","getPixelFromCoordinateInternal","newCenterPx","panOptions","animation","animateInternal","getCoordinateFromPixelInternal","duration","easing","size","box","getBoundingClientRect","offsetX","left","window","pageXOffset","offsetY","top","pageYOffset","setVisible","display","isRendered","pixel","getPixelFromCoordinate","mapSize","updateRenderedPosition","posX","posY","transform","round","getOptions","_factory","_defaults","freeze","el","animate","animateClass","animateInClass","appendTo","backdrop","keyboard","title","header","content","footer","buttons","headerClose","construct","transition","backdropTransition","_buttons","deepFreeze","k","v","dialog","text","attr","class","alert","confirm","_templates","body","data","prop","prefix","elData","dataAttr","getAttribute","build","html","all","nodeName","replace","innerHTML","getPath","nodes","Modal","EventEmitter","templates","_baseTemplates","_baseButtons","_baseOptions","version","static","_options","question","random","toString","_html","_events","_visible","_pointerInContent","querySelector","_scrollbarWidth","inner","outer","visibility","overflow","calcScrollbarWidth","_render","_mapDom","o","t","classList","add","_setHeader","_setContent","_setFooter","contains","outerHTML","ineerHTML","children","button","setAttribute","j","_setEvents","keydownHandler","_handleKeydownEvent","mousedownHandler","_handleMousedownEvent","clickHandler","_handleClickEvent","resizeHandler","_handleResizeEvent","e","every","tagName","emit","hide","which","_resize","show","_checkScrollbar","_setScrollbar","scrollTop","setTimeout","_backdrop","toggle","modalIsOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","bodyIsOverflowing","paddingRight","contCList","_removeEvents","originalBodyPad","clientWidth","innerWidth","basePadding","isError","Set","parseError","geoserverError","exceptions","join","showError","msg","originalError","layerName","has","err_msg","al","delete","en","labels","select","addElement","editElement","save","cancel","upload","editMode","confirmDelete","geomTypeNotSupported","editFields","editGeom","selectDrawType","uploadToLayer","uploadFeatures","validFeatures","invalidFeatures","loading","toggleVisibility","close","errors","capabilities","wfst","layer","layerNotFound","layerNotVisible","noValidGeometry","geoserver","badFormat","badFile","lockFeature","transaction","getFeatures","langs","es","zh","I18N","loadingDiv","showLoading","bool","copyProps","dest","src","exclude","props","getOwnPropertyDescriptors","defineProperties","protoChain","currentChain","proto","getPrototypeOf","hardMixProtos","ingredients","_a","base","objs","commonProto","protoChains","protos","potentialCommonProto","nearestCommonProto","mixedProto","create","visitedProtos","newProto","filter","mixins","Map","getMixinsForClass","clazz","mergeObjectsOfDecorators","o1","o2","_b","allKeys","getOwnPropertyNames","mergedObject","mergePropertyAndMethodDecorators","d1","d2","_c","_d","method","decorators","deepDecoratorSearch","classes","decoratorsForClassChain","allClasses","frontier","newClasses","c","newClass","findAllConstituentClasses","reduce","_e","_f","instance","mergeDecorators","Mixin","constructors","prototypes","MixedClass","args","setPrototypeOf","DecoratedMixedClass","classDecorators","decorator","applyPropAndMethodDecorators","mixedClass","constituents","propAndMethodDecorators","propDecorators","methodDecorators","getOwnPropertyDescriptor","GeometryType","TransactionType","layerToInsertElements","mode","Modes","activateMode","m","getMode","editedFeatures","mapLayers","setActiveLayerToInsertEls","getActiveLayerToInsertEls","getStoredMapLayers","getStoredLayer","addFeatureToEditedList","feature","removeFeatureFromEditList","isFeatureEdited","BaseLayer","Layer","_init","getGeoserver","isLoaded","getAndUpdateDescribeFeatureType","async","BaseLayerProperty","NAME","layerLabel","LABEL","params","URLSearchParams","service","getAdvanced","describeFeatureTypeVersion","request","typeName","outputFormat","url_fetch","getUrl","response","fetch","headers","getHeaders","credentials","getCredentials","ok","json","targetNamespace","featureTypes","geom","find","_parsed","namespace","geomType","localType","geomField","DESCRIBEFEATURETYPE","err","console","error","isVisibleByZoom","getZoom","getMinZoom","features","transact","transactFeatures","Insert","featureId","getUseLockFeature","hasLockFeature","GEOSERVER","getDescribeFeatureType","WfsSource","VectorSource","urlParams","SERVICE","REQUEST","OUTPUTFORMAT","EXCEPTIONS","format","GeoJSON","loader","extent","resolution","projection","success","failure","strategy","bbox","extentGeoServer","transformExtent","getCode","geoServerAdvanced","geoserverUrl","getFormat","readFeatures","featureProjection","dataProjection","addFeatures","removeLoadedExtent","getFeatureVersion","WfsLayer","_loadingCount","_loadedCount","beforeTransactFeature","label","minZoom","geoserverVendor","setSource","geoserverOptions","param","refresh","getSource","setCustomParam","paramName","WmsSource","TileWMS","url","serverType","TILED","LAYERS","tileLoadFunction","tile","blob","parsedError","Promise","resolve","reader","FileReader","onloadend","JSON","parse","result","readAsText","getImage","URL","createObjectURL","setState","WmsLayer","_formatGeoJSON","coordinate","view","buffer","getResolution","getProjection","INFO_FORMAT","BUFFER","FEATURE_COUNT","status","getParams","Date","getMilliseconds","updateParams","attrs","DocumentFragment","entries","startsWith","toLowerCase","substr","child","append","nodeType","resetStateButtons","activeBtn","LayersControl","_uploads","_uploadFormats","uploads","uploadFormats","addLayerEl","input","myPragma","checked","onchange","_layerChangeHandler","layerDom","getVisible","onclick","_visibilityClickHandler","htmlFor","_changeStateSelect","geomDrawTypeSelected","setSelectState","from","selectDraw","option","selected","disabled","drawType","geomLayer","GeometryCollection","LineString","LinearRing","Circle","Polygon","parentDiv","currentTarget","closest","dataset","accept","process","selectedValue","Point","MultiPoint","MultiLineString","MultiPolygon","editLayer","VectorLayer","zIndex","getEditLayer","Uploads","_formatWFS","_formatKml","_xs","_processUpload","processUpload","WFS","KML","extractStyles","showPointNames","XMLSerializer","file","files","extension","split","string","_fileReader","invalidFeaturesCount","validFeaturesCount","featuresToInsert","_checkGeometry","_fixGeometry","VectorSourceEvent","_initModal","reject","fileData","geomTypeLayer","getType","coords","getCoordinates","geomTypeFeature","modal","action","deepObjectAssign","sources","s_val","t_val","EditControlChangesEl","Control","styleFunction","getVertexs","getGeometries","coordinates","flatCoordinates","flat","Edit","Style","image","CircleStyle","radius","fill","Fill","color","Draw","stroke","Stroke","EditFieldsModal","_modal","_feature","querySelectorAll","field","dataSchema","GeoserverProperty","EditOverlay","Overlay","getCenter","getExtent","alt","controlElement","Wfst","_i18n","_map","_view","_viewport","_initialized","_layersControl","_overlay","_interactionWfsSelect","_interactionSelectModify","_collectionModify","_interactionModify","_interactionSnap","_interactionDraw","_keyClickWms","_keyRemove","_keySelect","_controlApplyDiscardChanges","_controlWidgetToolsDiv","_selectDraw","_currentZoom","_lastZoom","_editFeature","_editFeatureOriginal","_editFields","lang","customI18n","i18n.setLang","language","i18n","defaultOptions","layers","evtType","active","showControl","getLayers","getLayerByName","layerRendered","layersNumber","domEl","ISVISIBLE","WfstEvent","addLayer","setMapLayers","_createMapElements","opts","getViewport","insertFeatures","activateEditMode","editLayerSource","fit","maxZoom","padding","_deleteFeature","_addMapEvents","_initMapAndLayers","_prepareEditLayer","_addInteractions","_addInteractionHandlers","_addMapControl","prepareWfsInteraction","Collection","Select","hitTolerance","toggleCondition","never","addInteraction","deselected","mapBrowserEvent","getLayer","removeFeature","_addFeatureToEditMode","prepareWmsInteraction","removeCondition","hasFeatureAtPixel","_getFeaturesByClickEvent","Modify","condition","primaryAction","Snap","selectedFeatures","keyboardEvents","_onDeselectFeatureEvent","_onRemoveFeatureEvent","showUpload","activateDrawMode","i18n.I18N","controlEl","_deselectEditFeature","_removeOverlayHelper","_restoreFeatureToLayer","addFeature","_removeFeatureFromTmpLayer","checkIfFeatureIsChanged","Update","_editModeOff","Delete","_editModeOn","addControl","removeControl","deleteEl","ev","overlay","addOverlay","maybeLockFeature","addDrawInteraction","removeInteraction","geomDrawType","stopClick","btn","activateDrawButton","activateModeButtons","setActive","getOverlayById","removeOverlay","BaseEvent","utils","Geoserver","_countRequests","_insertFeatures","_updateFeatures","_deleteFeatures","state_","defaults","advanced","getCapabilitiesVersion","lockFeatureVersion","wfsTransactionVersion","lockFeatureParams","expiry","lockId","releaseAction","useLockFeature","setAdvanced","setHeaders","setCredentials","setUrl","setUseLockFeature","getAndUpdateCapabilities","_checkGeoserverCapabilities","getCapabilities","CAPABILITIES","opt_silent","HEADERS","CREDENTIALS","ADVANCED","hasTransaction","HASTRASNACTION","HASLOCKFEATURE","USELOCKFEATURE","ISLOADED","getState","DOMParser","parseFromString","operations","getElementsByTagName","operation","HASDESCRIBEFEATURETYPE","transactionType","clonedFeatures","geoLayer","_cloneFeature","cloneGeom","_transformGeoemtryCollectionToGeometries","_transformCircleToPolygon","numberRequest","srs","describeFeatureType","featureNS","featureType","srsName","featurePrefix","nativeElements","writeTransaction","payload","serializeToString","gmemberIn","gmemberOut","parseResponse","readTransactionResponse","responseStr","findError","match","geomConverted","fromCircle","featureProperties","boundedBy","_layerName_","retry","LockId","featureid","dataParsed"],"mappings":"4zCAKA,MAAMA,EAAW,CACf,EAAG,iCACH,EAAG,qCACH,EAAG,mCACH,EAAG,wDACH,EAAG,iDACH,EAAG,yCACH,EAAG,kCACH,EAAG,oDACH,GAAI,oEACJ,GAAI,0CACJ,GAAI,0EACJ,GAAI,iBACJ,GAAI,gBACJ,GAAI,kEACJ,GAAI,sDACJ,GAAI,mDACJ,GAAI,8DACJ,GAAI,wDACJ,GAAI,sDACJ,GAAI,kEACJ,GAAI,oDACJ,GAAI,iDACJ,GAAI,+BACJ,GAAI,+BACJ,GAAI,gDACJ,GAAI,uDACJ,GAAI,oEACJ,GAAI,2CACJ,GAAI,gBACJ,GAAI,0BACJ,GAAI,mBACJ,GAAI,8BACJ,GAAI,sCACJ,GAAI,wBACJ,GAAI,wCACJ,GAAI,kEACJ,GAAI,qCACJ,GAAI,qDACJ,GAAI,2DACJ,GAAI,+DACJ,GAAI,2DACJ,GAAI,4CACJ,GAAI,sDACJ,GAAI,kCACJ,GAAI,2CACJ,GAAI,wDACJ,GAAI,sDACJ,GAAI,qCACJ,GAAI,mCACJ,GAAI,4BACJ,GAAI,+EACJ,GAAI,uFACJ,GAAI,iCACJ,GAAI,wPACJ,GAAI,uGACJ,GAAI,uGAQN,MAAMC,UAAuBC,MAI3BC,YAAYC,GACV,MAAMC,EAAUL,EAASI,GAEzBE,MAAMD,GAWNE,KAAKH,KAAOA,EAKZG,KAAKC,KAAO,iBAGZD,KAAKF,QAAUA,CAChB,EAGH,IAAAI,EAAeR,ECvBf,IAAAS,EA9DA,MAIEP,YAAYQ,GAIVJ,KAAKK,mBAKLL,KAAKM,iBAOLN,KAAKI,KAAOA,EAOZJ,KAAKO,OAAS,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