1 line
No EOL
3.6 MiB
1 line
No EOL
3.6 MiB
{"version":3,"sources":["webpack://ol/webpack/universalModuleDefinition","webpack://ol/webpack/bootstrap","webpack://ol/./node_modules/rbush/rbush.min.js","webpack://ol/./node_modules/@openlayers/pepjs/dist/pep.js","webpack://ol/./node_modules/pbf/index.js","webpack://ol/./node_modules/pixelworks/lib/index.js","webpack://ol/./node_modules/ieee754/index.js","webpack://ol/./node_modules/pixelworks/lib/processor.js","webpack://ol/./node_modules/pixelworks/lib/util.js","webpack://ol/./build/ol/util.js","webpack://ol/./build/ol/AssertionError.js","webpack://ol/./build/ol/CollectionEventType.js","webpack://ol/./build/ol/ObjectEventType.js","webpack://ol/./build/ol/obj.js","webpack://ol/./build/ol/events.js","webpack://ol/./build/ol/Disposable.js","webpack://ol/./build/ol/array.js","webpack://ol/./build/ol/functions.js","webpack://ol/./build/ol/events/Event.js","webpack://ol/./build/ol/events/Target.js","webpack://ol/./build/ol/events/EventType.js","webpack://ol/./build/ol/Observable.js","webpack://ol/./build/ol/Object.js","webpack://ol/./build/ol/Collection.js","webpack://ol/./build/ol/asserts.js","webpack://ol/./build/ol/Feature.js","webpack://ol/./build/ol/extent/Corner.js","webpack://ol/./build/ol/extent/Relationship.js","webpack://ol/./build/ol/extent.js","webpack://ol/./build/ol/geom/GeometryLayout.js","webpack://ol/./build/ol/geom/GeometryType.js","webpack://ol/./build/ol/geom/flat/transform.js","webpack://ol/./build/ol/math.js","webpack://ol/./build/ol/sphere.js","webpack://ol/./build/ol/proj/Units.js","webpack://ol/./build/ol/proj/Projection.js","webpack://ol/./build/ol/proj/epsg3857.js","webpack://ol/./build/ol/proj/epsg4326.js","webpack://ol/./build/ol/proj/transforms.js","webpack://ol/./build/ol/proj/projections.js","webpack://ol/./build/ol/proj.js","webpack://ol/./build/ol/transform.js","webpack://ol/./build/ol/geom/Geometry.js","webpack://ol/./build/ol/geom/SimpleGeometry.js","webpack://ol/./build/ol/geom/flat/area.js","webpack://ol/./build/ol/geom/flat/closest.js","webpack://ol/./build/ol/geom/flat/deflate.js","webpack://ol/./build/ol/geom/flat/inflate.js","webpack://ol/./build/ol/geom/flat/simplify.js","webpack://ol/./build/ol/geom/LinearRing.js","webpack://ol/./build/ol/geom/Point.js","webpack://ol/./build/ol/geom/flat/contains.js","webpack://ol/./build/ol/geom/flat/interiorpoint.js","webpack://ol/./build/ol/geom/flat/segments.js","webpack://ol/./build/ol/geom/flat/intersectsextent.js","webpack://ol/./build/ol/geom/flat/reverse.js","webpack://ol/./build/ol/geom/flat/orient.js","webpack://ol/./build/ol/geom/Polygon.js","webpack://ol/./build/ol/Geolocation.js","webpack://ol/./build/ol/Kinetic.js","webpack://ol/./build/ol/MapEvent.js","webpack://ol/./build/ol/MapBrowserEvent.js","webpack://ol/./build/ol/has.js","webpack://ol/./build/ol/MapBrowserEventType.js","webpack://ol/./build/ol/MapBrowserPointerEvent.js","webpack://ol/./build/ol/pointer/EventType.js","webpack://ol/./build/ol/MapBrowserEventHandler.js","webpack://ol/./build/ol/MapEventType.js","webpack://ol/./build/ol/MapProperty.js","webpack://ol/./build/ol/render/EventType.js","webpack://ol/./build/ol/TileState.js","webpack://ol/./build/ol/structs/PriorityQueue.js","webpack://ol/./build/ol/TileQueue.js","webpack://ol/./build/ol/tilegrid/common.js","webpack://ol/./build/ol/centerconstraint.js","webpack://ol/./build/ol/resolutionconstraint.js","webpack://ol/./build/ol/rotationconstraint.js","webpack://ol/./build/ol/ViewHint.js","webpack://ol/./build/ol/ViewProperty.js","webpack://ol/./build/ol/string.js","webpack://ol/./build/ol/coordinate.js","webpack://ol/./build/ol/easing.js","webpack://ol/./build/ol/View.js","webpack://ol/./build/ol/dom.js","webpack://ol/./build/ol/layer/Property.js","webpack://ol/./build/ol/layer/Base.js","webpack://ol/./build/ol/source/State.js","webpack://ol/./build/ol/layer/Group.js","webpack://ol/./build/ol/size.js","webpack://ol/./build/ol/PluggableMap.js","webpack://ol/./build/ol/css.js","webpack://ol/./build/ol/control/Control.js","webpack://ol/./build/ol/layer/Layer.js","webpack://ol/./build/ol/control/Attribution.js","webpack://ol/./build/ol/control/Rotate.js","webpack://ol/./build/ol/control/Zoom.js","webpack://ol/./build/ol/control.js","webpack://ol/./build/ol/interaction/Property.js","webpack://ol/./build/ol/interaction/Interaction.js","webpack://ol/./build/ol/interaction/DoubleClickZoom.js","webpack://ol/./build/ol/events/condition.js","webpack://ol/./build/ol/interaction/Pointer.js","webpack://ol/./build/ol/interaction/DragPan.js","webpack://ol/./build/ol/interaction/DragRotate.js","webpack://ol/./build/ol/render/Box.js","webpack://ol/./build/ol/interaction/DragBox.js","webpack://ol/./build/ol/interaction/DragZoom.js","webpack://ol/./build/ol/events/KeyCode.js","webpack://ol/./build/ol/interaction/KeyboardPan.js","webpack://ol/./build/ol/interaction/KeyboardZoom.js","webpack://ol/./build/ol/interaction/MouseWheelZoom.js","webpack://ol/./build/ol/interaction/PinchRotate.js","webpack://ol/./build/ol/interaction/PinchZoom.js","webpack://ol/./build/ol/interaction.js","webpack://ol/./build/ol/render/Event.js","webpack://ol/./build/ol/color.js","webpack://ol/./build/ol/style/IconImageCache.js","webpack://ol/./build/ol/colorlike.js","webpack://ol/./build/ol/render/VectorContext.js","webpack://ol/./build/ol/render/canvas.js","webpack://ol/./build/ol/structs/LRUCache.js","webpack://ol/./build/ol/render/canvas/LabelCache.js","webpack://ol/./build/ol/render/canvas/Immediate.js","webpack://ol/./build/ol/ImageState.js","webpack://ol/./build/ol/render/canvas/BuilderType.js","webpack://ol/./build/ol/renderer/vector.js","webpack://ol/./build/ol/render.js","webpack://ol/./build/ol/renderer/Map.js","webpack://ol/./build/ol/renderer/Composite.js","webpack://ol/./build/ol/Map.js","webpack://ol/./build/ol/OverlayPositioning.js","webpack://ol/./build/ol/Overlay.js","webpack://ol/./build/ol/format/FormatType.js","webpack://ol/./build/ol/featureloader.js","webpack://ol/./build/ol/loadingstrategy.js","webpack://ol/./build/ol/TileRange.js","webpack://ol/./build/ol/tilecoord.js","webpack://ol/./build/ol/tilegrid/TileGrid.js","webpack://ol/./build/ol/tilegrid.js","webpack://ol/./build/ol/webgl.js","webpack://ol/./build/ol/xml.js","webpack://ol/./build/ol/webgl/Buffer.js","webpack://ol/./build/ol/webgl/ContextEventType.js","webpack://ol/./build/ol/vec/mat4.js","webpack://ol/./build/ol/webgl/PostProcessingPass.js","webpack://ol/./build/ol/webgl/Helper.js","webpack://ol/./build/ol/webgl/RenderTarget.js","webpack://ol/./build/ol/tilegrid/WMTS.js","webpack://ol/./build/ol/style/Image.js","webpack://ol/./build/ol/style/RegularShape.js","webpack://ol/./build/ol/style/Circle.js","webpack://ol/./build/ol/style/Fill.js","webpack://ol/./build/ol/style/IconAnchorUnits.js","webpack://ol/./build/ol/ImageBase.js","webpack://ol/./build/ol/Image.js","webpack://ol/./build/ol/style/IconImage.js","webpack://ol/./build/ol/style/IconOrigin.js","webpack://ol/./build/ol/style/Icon.js","webpack://ol/./build/ol/style/Stroke.js","webpack://ol/./build/ol/style/Style.js","webpack://ol/./build/ol/style/TextPlacement.js","webpack://ol/./build/ol/style/Text.js","webpack://ol/./build/ol/tileurlfunction.js","webpack://ol/./build/ol/net.js","webpack://ol/./build/ol/reproj/common.js","webpack://ol/./build/ol/Tile.js","webpack://ol/./build/ol/ImageTile.js","webpack://ol/./build/ol/TileCache.js","webpack://ol/./build/ol/reproj.js","webpack://ol/./build/ol/reproj/Triangulation.js","webpack://ol/./build/ol/reproj/Tile.js","webpack://ol/./build/ol/source/Source.js","webpack://ol/./build/ol/source/Tile.js","webpack://ol/./build/ol/source/TileEventType.js","webpack://ol/./build/ol/source/UrlTile.js","webpack://ol/./build/ol/source/TileImage.js","webpack://ol/./build/ol/source/BingMaps.js","webpack://ol/./build/ol/source/XYZ.js","webpack://ol/./build/ol/source/CartoDB.js","webpack://ol/./build/ol/source/VectorEventType.js","webpack://ol/./build/ol/structs/RBush.js","webpack://ol/./build/ol/source/Vector.js","webpack://ol/./build/ol/source/Cluster.js","webpack://ol/./build/ol/source/Zoomify.js","webpack://ol/./build/ol/format/IIIFInfo.js","webpack://ol/./build/ol/source/IIIF.js","webpack://ol/./build/ol/reproj/Image.js","webpack://ol/./build/ol/source/Image.js","webpack://ol/./build/ol/uri.js","webpack://ol/./build/ol/source/ImageArcGISRest.js","webpack://ol/./build/ol/ImageCanvas.js","webpack://ol/./build/ol/source/ImageCanvas.js","webpack://ol/./build/ol/source/ImageMapGuide.js","webpack://ol/./build/ol/source/ImageStatic.js","webpack://ol/./build/ol/source/common.js","webpack://ol/./build/ol/source/WMSServerType.js","webpack://ol/./build/ol/source/ImageWMS.js","webpack://ol/./build/ol/source/OSM.js","webpack://ol/./build/ol/layer/BaseImage.js","webpack://ol/./build/ol/renderer/Layer.js","webpack://ol/./build/ol/renderer/canvas/Layer.js","webpack://ol/./build/ol/renderer/canvas/ImageLayer.js","webpack://ol/./build/ol/layer/Image.js","webpack://ol/./build/ol/layer/TileProperty.js","webpack://ol/./build/ol/layer/BaseTile.js","webpack://ol/./build/ol/renderer/canvas/TileLayer.js","webpack://ol/./build/ol/layer/Tile.js","webpack://ol/./build/ol/source/Raster.js","webpack://ol/./build/ol/source/Stamen.js","webpack://ol/./build/ol/source/TileArcGISRest.js","webpack://ol/./build/ol/source/TileDebug.js","webpack://ol/./build/ol/source/TileJSON.js","webpack://ol/./build/ol/source/TileWMS.js","webpack://ol/./build/ol/source/UTFGrid.js","webpack://ol/./build/ol/VectorRenderTile.js","webpack://ol/./build/ol/VectorTile.js","webpack://ol/./build/ol/source/VectorTile.js","webpack://ol/./build/ol/source/WMTSRequestEncoding.js","webpack://ol/./build/ol/source/WMTS.js","webpack://ol/./build/ol/renderer/webgl/Layer.js","webpack://ol/./build/ol/worker/webgl.js","webpack://ol/./build/ol/layer/BaseVector.js","webpack://ol/./build/ol/renderer/webgl/PointsLayer.js","webpack://ol/./build/ol/render/canvas/Instruction.js","webpack://ol/./build/ol/render/canvas/Builder.js","webpack://ol/./build/ol/render/canvas/ImageBuilder.js","webpack://ol/./build/ol/render/canvas/LineStringBuilder.js","webpack://ol/./build/ol/render/canvas/PolygonBuilder.js","webpack://ol/./build/ol/geom/flat/straightchunk.js","webpack://ol/./build/ol/render/canvas/TextBuilder.js","webpack://ol/./build/ol/render/canvas/BuilderGroup.js","webpack://ol/./build/ol/geom/flat/length.js","webpack://ol/./build/ol/geom/flat/textpath.js","webpack://ol/./build/ol/render/canvas/Executor.js","webpack://ol/./build/ol/render/canvas/ExecutorGroup.js","webpack://ol/./build/ol/render/canvas/hitdetect.js","webpack://ol/./build/ol/renderer/canvas/VectorLayer.js","webpack://ol/./build/ol/renderer/canvas/VectorImageLayer.js","webpack://ol/./build/ol/layer/VectorTileRenderType.js","webpack://ol/./build/ol/renderer/canvas/VectorTileLayer.js","webpack://ol/./build/ol/layer/Vector.js","webpack://ol/./build/ol/geom/flat/interpolate.js","webpack://ol/./build/ol/geom/LineString.js","webpack://ol/./build/ol/geom/flat/geodesic.js","webpack://ol/./build/ol/layer/Graticule.js","webpack://ol/./build/ol/layer/Heatmap.js","webpack://ol/./build/ol/layer/VectorImage.js","webpack://ol/./build/ol/layer/VectorTile.js","webpack://ol/./build/ol/interaction/DragAndDrop.js","webpack://ol/./build/ol/interaction/DragRotateAndZoom.js","webpack://ol/./build/ol/geom/Circle.js","webpack://ol/./build/ol/geom/MultiLineString.js","webpack://ol/./build/ol/geom/MultiPoint.js","webpack://ol/./build/ol/geom/flat/center.js","webpack://ol/./build/ol/geom/MultiPolygon.js","webpack://ol/./build/ol/interaction/Draw.js","webpack://ol/./build/ol/interaction/Extent.js","webpack://ol/./build/ol/interaction/Modify.js","webpack://ol/./build/ol/interaction/Select.js","webpack://ol/./build/ol/interaction/Snap.js","webpack://ol/./build/ol/interaction/Translate.js","webpack://ol/./build/ol/geom/GeometryCollection.js","webpack://ol/./build/ol/format/Feature.js","webpack://ol/./build/ol/format/JSONFeature.js","webpack://ol/./build/ol/format/EsriJSON.js","webpack://ol/./build/ol/format/XMLFeature.js","webpack://ol/./build/ol/format/GMLBase.js","webpack://ol/./build/ol/format/xsd.js","webpack://ol/./build/ol/format/GML3.js","webpack://ol/./build/ol/format/GML.js","webpack://ol/./build/ol/format/GML2.js","webpack://ol/./build/ol/format/GML32.js","webpack://ol/./build/ol/format/GPX.js","webpack://ol/./build/ol/format/GeoJSON.js","webpack://ol/./build/ol/format/TextFeature.js","webpack://ol/./build/ol/format/KML.js","webpack://ol/./build/ol/format/IGC.js","webpack://ol/./build/ol/render/Feature.js","webpack://ol/./build/ol/format/MVT.js","webpack://ol/./build/ol/format/OSMXML.js","webpack://ol/./build/ol/geom/flat/flip.js","webpack://ol/./build/ol/format/Polyline.js","webpack://ol/./build/ol/format/TopoJSON.js","webpack://ol/./build/ol/format/filter/Filter.js","webpack://ol/./build/ol/format/filter/LogicalNary.js","webpack://ol/./build/ol/format/filter/And.js","webpack://ol/./build/ol/format/filter/Bbox.js","webpack://ol/./build/ol/format/filter/Spatial.js","webpack://ol/./build/ol/format/filter/Contains.js","webpack://ol/./build/ol/format/filter/Comparison.js","webpack://ol/./build/ol/format/filter/During.js","webpack://ol/./build/ol/format/filter/ComparisonBinary.js","webpack://ol/./build/ol/format/filter/EqualTo.js","webpack://ol/./build/ol/format/filter/GreaterThan.js","webpack://ol/./build/ol/format/filter/GreaterThanOrEqualTo.js","webpack://ol/./build/ol/format/filter/Intersects.js","webpack://ol/./build/ol/format/filter/IsBetween.js","webpack://ol/./build/ol/format/filter/IsLike.js","webpack://ol/./build/ol/format/filter/IsNull.js","webpack://ol/./build/ol/format/filter/LessThan.js","webpack://ol/./build/ol/format/filter/LessThanOrEqualTo.js","webpack://ol/./build/ol/format/filter/Not.js","webpack://ol/./build/ol/format/filter/NotEqualTo.js","webpack://ol/./build/ol/format/filter/Or.js","webpack://ol/./build/ol/format/filter/Within.js","webpack://ol/./build/ol/format/filter.js","webpack://ol/./build/ol/format/WFS.js","webpack://ol/./build/ol/format/WKT.js","webpack://ol/./build/ol/format/XLink.js","webpack://ol/./build/ol/format/XML.js","webpack://ol/./build/ol/format/WMSCapabilities.js","webpack://ol/./build/ol/format/WMSGetFeatureInfo.js","webpack://ol/./build/ol/format/OWS.js","webpack://ol/./build/ol/format/WMTSCapabilities.js","webpack://ol/./build/ol/control/FullScreen.js","webpack://ol/./build/ol/control/MousePosition.js","webpack://ol/./build/ol/control/OverviewMap.js","webpack://ol/./build/ol/control/ScaleLine.js","webpack://ol/./build/ol/control/ZoomSlider.js","webpack://ol/./build/ol/control/ZoomToExtent.js","webpack://ol/./build/index.js","webpack://ol/./build/ol/proj/proj4.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","e","a","h","Math","log","f","exp","u","sqrt","max","floor","min","x","length","this","_maxEntries","_minEntries","ceil","clear","indexOf","children","minX","minY","maxX","maxY","leaf","height","pop","push","all","_all","data","search","toBBox","collides","load","insert","_build","slice","_splitRoot","_insert","remove","splice","_condense","compareMinX","compareMinY","toJSON","fromJSON","apply","pow","_chooseSubtree","_split","_adjustParentBBoxes","_chooseSplitAxis","_chooseSplitIndex","v","M","_allDistMargin","sort","MOUSE_PROPS","MOUSE_DEFAULTS","PointerEvent","inType","inDict","document","createEvent","initEvent","bubbles","cancelable","buttons","pressure","undefined","clientX","y","clientY","pointerId","width","tiltX","tiltY","twist","tangentialPressure","pointerType","hwTimestamp","isPrimary","detail","PointerMap","Map","forEach","SparseArrayMap","array","size","set","k","delete","has","callback","thisArg","CLONE_PROPS","CLONE_DEFAULTS","BOUNDARY_EVENTS","HAS_SVG_INSTANCE","SVGElementInstance","dispatcher","pointermap","eventMap","captureInfo","eventSources","eventSourceList","registerSource","source","newEvents","events","register","element","es","unregister","contains","container","contained","ex","down","inEvent","fireEvent","move","up","enter","leave","over","out","cancel","leaveOut","event","propagate","enterOver","eventHandler","_handledByPE","type","fn","listen","target","addEvent","unlisten","removeEvent","eventName","addEventListener","boundHandler","removeEventListener","makeEvent","relatedTarget","preventDefault","_target","dispatchEvent","cloneEvent","eventCopy","correspondingUseElement","getTarget","capture","propagateDown","targets","parentNode","reverse","setCapture","inPointerId","inTarget","skipDispatch","releaseCapture","implicitRelease","asyncDispatchEvent","requestAnimationFrame","targeting","shadow","inEl","shadowRoot","webkitShadowRoot","canTarget","Boolean","elementFromPoint","targetingShadow","olderShadow","os","olderShadowRoot","se","querySelector","allShadows","shadows","searchRoot","inRoot","st","sr","ssr","owner","nodeType","Node","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","findTarget","Array","map","toArray","filter","MO","MutationObserver","WebKitMutationObserver","OBSERVER_INIT","subtree","childList","attributes","attributeOldValue","attributeFilter","Installer","add","changed","binder","addCallback","removeCallback","changedCallback","observer","mutationWatcher","rule","watchSubtree","observe","enableOnSubtree","readyState","installOnLoad","installNewSubtree","findElements","addElement","querySelectorAll","removeElement","el","elementChanged","oldValue","concatLists","accum","list","concat","isElement","ELEMENT_NODE","flattenMutationTree","inNodes","tree","reduce","mutations","mutationHandler","addedNodes","removedNodes","attrib2css","selector","styles","hasNativePE","MSPointerEvent","hasShadowRoot","ShadowDOMPolyfill","head","createShadowRoot","BUTTON_TO_BUTTONS","HAS_BUTTONS","MouseEvent","INSTALLER","mouseEvents","POINTER_ID","POINTER_TYPE","lastTouches","isEventSimulatedFromTouch","lts","dx","abs","dy","prepareEvent","pd","webkitForce","WEBKIT_FORCE_AT_MOUSE_DOWN","prepareButtonsForMove","which","mousedown","button","webkitmouseforcechanged","mousemove","mouseup","mouseover","mouseout","deactivateMouse","pointermap$1","touchEvents","elementAdded","getAttribute","touchActionToScrollType","_scrollType","elementRemoved","evts","oldSt","scrollTypes","UP","includes","DOWN","LEFT","RIGHT","touchAction","split","firstTouch","isPrimaryTouch","inTouch","identifier","setPrimaryTouch","firstXY","X","Y","scrolling","removePrimaryPointer","inPointer","typeToButtons","ret","touchToPointer","cte","currentTouchEvent","id","radiusX","webkitRadiusX","radiusY","webkitRadiusY","force","altitudeAngle","tan","radToDeg","PI","atan","cos","azimuthAngle","sin","touchType","altKey","ctrlKey","metaKey","shiftKey","self","processTouches","inFunction","tl","changedTouches","shouldScroll","currentTarget","dya","dxa","left","right","findTouch","inTL","inId","vacuumTouches","touches","cancelOut","touchstart","dedupSynthMouse","overDown","outTarget","touchforcechange","touchmove","touchcancel","moveOverOut","pointer","outEvent","touchend","upOut","cleanUpPointer","lt","setTimeout","pointermap$2","HAS_BITMAP_TYPE","MSPOINTER_TYPE_MOUSE","msEvents","POINTER_TYPES","cleanup","MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSLostPointerCapture","MSGotPointerCapture","assertActive","error","Error","assertConnected","elem","parent","ownerDocument","inActiveButtonState","navigator","msPointerEnabled","msSetPointerCapture","msReleasePointerCapture","shadowSelector","createElement","textContent","appendChild","applyAttributeStyles","tp","msMaxTouchPoints","ontouchstart","applyPolyfill","Element","setPointerCapture","defineProperties","targetFinding","Pbf","ieee754","buf","ArrayBuffer","isView","Uint8Array","pos","Varint","Fixed64","Bytes","Fixed32","utf8TextDecoder","TextDecoder","readPackedEnd","pbf","readVarint","toNum","low","high","isSigned","makeRoomForExtraLength","startPos","len","extraLen","LN2","realloc","writePackedVarint","arr","writeVarint","writePackedSVarint","writeSVarint","writePackedFloat","writeFloat","writePackedDouble","writeDouble","writePackedBoolean","writeBoolean","writePackedFixed32","writeFixed32","writePackedSFixed32","writeSFixed32","writePackedFixed64","writeFixed64","writePackedSFixed64","writeSFixed64","readUInt32","writeInt32","val","readInt32","destroy","readFields","readField","result","end","tag","skip","readMessage","readFixed32","readSFixed32","readFixed64","readSFixed64","readFloat","read","readDouble","b","readVarintRemainder","readVarint64","readSVarint","num","readBoolean","readString","decode","subarray","readUtf8TextDecoder","str","b1","b2","b3","b0","bytesPerSequence","String","fromCharCode","readUtf8","readBytes","buffer","readPackedVarint","readPackedSVarint","readPackedBoolean","readPackedFloat","readPackedDouble","readPackedFixed32","readPackedSFixed32","readPackedFixed64","readPackedSFixed64","writeTag","finish","writeBigVarintLow","lsb","writeBigVarintHigh","writeBigVarint","writeString","lead","charCodeAt","writeUtf8","write","writeBytes","writeRawMessage","obj","writeMessage","writeBytesField","writeFixed32Field","writeSFixed32Field","writeFixed64Field","writeSFixed64Field","writeVarintField","writeSVarintField","writeStringField","writeFloatField","writeDoubleField","writeBooleanField","Processor","offset","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","Infinity","rt","isNaN","newImageData","createMinion","operation","workerHasImageData","ImageData","_","newWorkerImageData","output","buffers","meta","imageOps","numBuffers","numBytes","byteLength","images","Uint8ClampedArray","arrays","pixels","j","pixel","createWorker","config","onMessage","lines","keys","lib","toString","blob","Blob","URL","createObjectURL","worker","Worker","threads","_imageOps","workers","_onWorkerMessage","minion","postMessage","createFauxWorker","_workers","_queue","_maxQueueLength","queue","_running","_dataLookup","_job","process","inputs","_enqueue","_dispatch","_destroyed","job","shift","input","segmentLength","slices","jj","index","_resolveJob","hasImageData","context","getContext","imageData","createImageData","uidCounter_","getUid","ol_uid","extendStatics","VERSION","__extends","setPrototypeOf","__proto__","__","constructor","_super","AssertionError","code","_this","message","ADD","REMOVE","assign","var_sources","TypeError","ii","arguments","getValues","values","isEmpty","listener","opt_this","opt_once","originalListener_1","eventsKey","listenOnce","unlistenByKey","Disposable","disposed_","dispose","disposeInternal","numberSafeCompareFunction","linearFindNearest","direction","reverseSubArray","begin","tmp","extend","extension","isArray","find","func","equals","arr1","arr2","len1","findIndex","every","idx","TRUE","FALSE","VOID","stopPropagation","evt","BaseEvent","propagationStopped","Target","opt_target","eventTarget_","pendingRemovals_","dispatching_","listeners_","listeners","Event","pendingRemovals","getListeners","hasListener","opt_type","CHANGE","ERROR","BLUR","CLEAR","CONTEXTMENU","CLICK","DBLCLICK","DRAGENTER","DRAGOVER","DROP","FOCUS","KEYDOWN","KEYPRESS","LOAD","RESIZE","WHEEL","Observable","revision_","EventType","getRevision","on","once","un","ObjectEvent","BaseObject","opt_values","values_","setProperties","getKeys","getProperties","notify","eventType","getChangeEventType","ObjectEventType","opt_silent","unset","changeEventTypeCache","Property","CollectionEvent","opt_element","opt_index","Collection","opt_array","opt_options","options","unique_","unique","array_","assertUnique_","updateLength_","getLength","getArray","item","insertAt","CollectionEventType","removeAt","prev","setAt","opt_except","assert","assertion","errorCode","Feature","opt_geometryOrProperties","id_","geometryName_","style_","styleFunction_","geometryChangeKey_","handleGeometryChanged_","getSimplifiedGeometry","geometry","setGeometry","properties","clone","setGeometryName","getGeometryName","getGeometry","style","getStyle","setStyle","getId","getStyleFunction","handleGeometryChange_","styles_1","getZIndex","createStyleFunction","setId","BOTTOM_LEFT","BOTTOM_RIGHT","TOP_LEFT","TOP_RIGHT","UNKNOWN","INTERSECTING","ABOVE","BELOW","boundingExtent","coordinates","extent","createEmpty","extendCoordinate","opt_extent","closestSquaredDistanceXY","containsCoordinate","coordinate","containsXY","containsExtent","extent1","extent2","coordinateRelationship","relationship","Relationship","createOrUpdate","createOrUpdateEmpty","createOrUpdateFromCoordinate","createOrUpdateFromFlatCoordinates","flatCoordinates","stride","extendFlatCoordinates","extendCoordinates","extendXY","forEachCorner","getBottomLeft","getBottomRight","getTopRight","getTopLeft","getArea","area","getWidth","getHeight","getCenter","getCorner","corner","Corner","getForViewAndSize","center","resolution","rotation","cosRotation","sinRotation","xCos","xSin","yCos","ySin","x0","x1","x2","x3","y0","y1","y2","y3","getIntersection","intersection","scaleFromCenter","deltaX","deltaY","applyTransform","transformFn","xs","ys","_boundingExtentXYs","XY","XYZ","XYM","XYZM","POINT","LINE_STRING","LINEAR_RING","POLYGON","MULTI_POINT","MULTI_LINE_STRING","MULTI_POLYGON","GEOMETRY_COLLECTION","CIRCLE","transform2D","transform","opt_dest","dest","rotate","angle","anchor","anchorX","anchorY","clamp","cosh","squaredSegmentDistance","toDegrees","angleInRadians","toRadians","angleInDegrees","modulo","lerp","DEFAULT_RADIUS","getDistance","c1","c2","opt_radius","radius","lat1","lat2","deltaLatBy2","deltaLonBy2","atan2","getLengthInternal","getAreaInternal","distance","bearing","lon1","dByR","lat","asin","Units","DEGREES","FEET","METERS","PIXELS","TILE_PIXELS","USFEET","METERS_PER_UNIT","Projection","code_","units_","extent_","worldExtent_","worldExtent","axisOrientation_","axisOrientation","global_","global","canWrapX_","getPointResolutionFunc_","getPointResolution","defaultTileGrid_","metersPerUnit_","metersPerUnit","canWrapX","getCode","getExtent","getUnits","getMetersPerUnit","getWorldExtent","getAxisOrientation","isGlobal","setGlobal","getDefaultTileGrid","setDefaultTileGrid","tileGrid","setExtent","setWorldExtent","setGetPointResolution","getPointResolutionFunc","RADIUS","HALF_SIZE","EXTENT","WORLD_EXTENT","EPSG3857Projection","units","point","PROJECTIONS","fromEPSG4326","opt_output","opt_dimension","dimension","halfSize","toEPSG4326","EPSG4326Projection","opt_axisOrientation","destination","sourceCode","destinationCode","cloneTransform","identityTransform","addProjection","projection","projectionLike","opt_units","pointResolution","toEPSG4326_1","getTransformFromProjections","vertices","addEquivalentProjections","projections","addProjections","createProjection","defaultCode","createTransformFromCoordinateTransform","coordTransform","addCoordinateTransforms","forward","inverse","sourceProj","destProj","equivalent","projection1","projection2","equalUnits","sourceProjection","destinationProjection","transformFunc","getTransform","transformExtent","projections2","forwardTransform","inverseTransform","getUserProjection","toUserCoordinate","fromUserCoordinate","destProjection","toUserExtent","fromUserExtent","tmp_","multiply","transform1","transform2","a1","d1","e1","f1","a2","d2","e2","f2","compose","dx1","dy1","sx","sy","dx2","dy2","makeInverse","mat","det","join","tmpTransform","Geometry","lastResult","lastArgs","lastThis","called","extentRevision_","simplifiedGeometryMaxMinSquaredTolerance","simplifiedGeometryRevision","simplifyTransformedInternal","revision","squaredTolerance","opt_transform","nextArgs","simplifyTransformed","closestPointXY","closestPoint","minSquaredDistance","coord","getClosestPoint","opt_closestPoint","intersectsCoordinate","computeExtent","returnOrUpdate","scale","opt_sy","opt_anchor","simplify","tolerance","getType","intersectsExtent","translate","inCoordinates","outCoordinates","pixelExtent","projectedExtent","getStrideForLayout","layout","GeometryLayout","SimpleGeometry","getCoordinates","getFirstCoordinate","getFlatCoordinates","getLastCoordinate","getLayout","simplifiedGeometry","getSimplifiedGeometryInternal","getStride","setFlatCoordinates","setCoordinates","opt_layout","setLayout","nesting","getLayoutForStride","twiceArea","ends","assignClosest","offset1","offset2","maxSquaredDelta","squaredDelta","arrayMaxSquaredDelta","assignClosestPoint","maxDelta","isRing","opt_tmpPoint","squaredDistance","tmpPoint","assignClosestArrayPoint","deflateCoordinate","deflateCoordinates","deflateCoordinatesArray","coordinatess","opt_ends","inflateCoordinates","opt_coordinates","inflateCoordinatesArray","opt_coordinatess","inflateMultiCoordinatesArray","endss","opt_coordinatesss","coordinatesss","douglasPeucker","simplifiedFlatCoordinates","simplifiedOffset","markers","stack","last","first","maxSquaredDistance","squaredDistance_1","douglasPeuckerArray","simplifiedEnds","snap","round","quantize","quantizeArray","LinearRing","maxDelta_","maxDeltaRevision_","GeometryType","Point","linearRingContainsExtent","linearRingContainsXY","wn","linearRingsContainsXY","getInteriorPointOfArray","flatCenters","flatCentersOffset","intersections","rr","pointX","maxSegmentLength","getInteriorPointsOfMultiArray","interiorPoints","point1","point2","intersectsLineString","coordinatesExtent","start","intersects","startRel","endRel","startX","startY","endX","endY","slope","intersectsSegment","intersectsLinearRingArray","intersectsLinearRing","linearRingIsClockwise","edge","linearRingsAreOriented","opt_right","isClockwise","orientLinearRings","orientLinearRingsArray","Polygon","ends_","flatInteriorPointRevision_","flatInteriorPoint_","orientedRevision_","orientedFlatCoordinates_","appendLinearRing","linearRing","getOrientedFlatCoordinates","getEnds","getFlatInteriorPoint","flatCenter","getInteriorPoint","getLinearRingCount","getLinearRing","getLinearRings","linearRings","circular","opt_n","opt_sphereRadius","fromExtent","fromCircle","circle","opt_sides","opt_angle","sides","arrayLength","polygon","makeRegular","getRadius","startAngle","ACCURACY","ACCURACY_GEOMETRY","ALTITUDE","ALTITUDE_ACCURACY","HEADING","POSITION","PROJECTION","SPEED","TRACKING","TRACKING_OPTIONS","GeolocationError","Geolocation","position_","transform_","watchId_","handleProjectionChanged_","handleTrackingChanged_","setProjection","trackingOptions","setTrackingOptions","setTracking","tracking","getProjection","getTracking","geolocation","watchPosition","positionChange_","positionError_","getTrackingOptions","clearWatch","position","coords","accuracy","altitude","altitudeAccuracy","heading","longitude","latitude","projectedPosition","speed","getAccuracy","getAccuracyGeometry","getAltitude","getAltitudeAccuracy","getHeading","getPosition","getSpeed","Kinetic","decay","minVelocity","delay","decay_","minVelocity_","delay_","points_","angle_","initialVelocity_","update","Date","now","lastIndex","firstIndex","duration","getAngle","MapEvent","opt_frameState","frameState","MapBrowserEvent","browserEvent","opt_dragging","originalEvent","pixel_","coordinate_","dragging","getEventPixel","configurable","getCoordinateFromPixel","ua","userAgent","toLowerCase","FIREFOX","WEBKIT","MAC","DEVICE_PIXEL_RATIO","devicePixelRatio","IMAGE_DECODE","Image","SINGLECLICK","POINTERDRAG","POINTERMOVE","POINTERDOWN","POINTERUP","POINTEROVER","POINTEROUT","POINTERENTER","POINTERLEAVE","POINTERCANCEL","MapBrowserPointerEvent","pointerEvent","MapBrowserEventHandler","moveTolerance","map_","clickTimeoutId_","dragging_","dragListenerKeys_","moveTolerance_","down_","getViewport","activePointers_","trackedTouches_","element_","pointerdownListenerKey_","handlePointerDown_","relayedListenerKey_","relayEvent_","emulateClick_","newEvent","MapBrowserEventType","clearTimeout","updateActivePointers_","handlePointerUp_","isMouseActionButton_","handlePointerMove_","isMoving_","LAYERGROUP","SIZE","TARGET","VIEW","IDLE","LOADING","LOADED","EMPTY","ABORT","PriorityQueue","priorityFunction","keyFunction","priorityFunction_","keyFunction_","elements_","priorities_","queuedElements_","dequeue","elements","priorities","siftUp_","elementKey","enqueue","priority","siftDown_","getCount","getLeftChildIndex_","getRightChildIndex_","getParentIndex_","heapify_","isKeyQueued","isQueued","count","startIndex","lIndex","rIndex","smallerChildIndex","parentIndex","reprioritize","TileQueue","tilePriorityFunction","tileChangeCallback","getKey","boundHandleTileChange_","handleTileChange","tileChangeCallback_","tilesLoading_","tilesLoadingKeys_","added","getTilesLoading","tile","state","getState","hifi","TileState","tileKey","loadMoreTiles","maxTotalLoading","maxNewLoads","newLoads","abortedTiles","DEFAULT_MAX_ZOOM","DEFAULT_TILE_SIZE","createExtent","onlyCenter","smooth","opt_isMoving","viewWidth","viewHeight","ratio","none","getViewportClampedResolution","maxExtent","viewportSize","xResolution","yResolution","getSmoothClampedResolution","maxResolution","minResolution","createMinMaxResolution","opt_smooth","opt_maxExtent","cappedMaxRes","disable","padNumber","number","opt_precision","numberString","toFixed","decimal","compareVersions","v1","v2","s1","s2","n1","parseInt","n2","delta","closestOnSegment","segment","along","degreesToStringHDMS","hemispheres","degrees","opt_fractionDigits","normalizedDegrees","dflPrecision","precision","deg","sec","charAt","template","replace","coordinate1","coordinate2","cosAngle","sinAngle","coord1","coord2","squaredDistanceToSegment","toStringXY","easeIn","easeOut","inAndOut","linear","DEFAULT_MIN_ZOOM","animationCallback","returnValue","isNoopAnimation","animation","sourceCenter","targetCenter","sourceResolution","targetResolution","sourceRotation","targetRotation","View","hints_","animations_","updateAnimationKey_","projection_","targetCenter_","targetResolution_","targetRotation_","applyOptions_","resolutionConstraintInfo","resolutionConstraint","minZoom","maxZoom","zoomFactor","multiWorld","smoothResolutionConstraint","projExtent","constrainOnlyCenter","resolutions","constrainResolution","capped","z","createSnapToResolutions","defaultMaxResolution","defaultMinResolution","power","opt_minResolution","minZoomLevel","cappedZoomLevel","zoomLevel","createSnapToPower","constraint","createResolutionConstraint","maxResolution_","minResolution_","zoomFactor_","resolutions_","minZoom_","centerConstraint","smoothExtentConstraint","createCenterConstraint","rotationConstraint","enableRotation","constrainRotation","opt_tolerance","theta","createRotationConstraint","constraints_","setRotation","setCenterInternal","setResolution","zoom","setZoom","resolveConstraints","options_","getUpdatedOptions_","newOptions","getResolution","getZoom","getCenterInternal","getRotation","animate","var_args","isDef","getAnimating","args","animateInternal","animationCount","series","complete","easing","getResolutionForZoom","setHint","ViewHint","updateAnimations_","getInteracting","cancelAnimations","cancelAnimationFrame","more","seriesComplete","elapsed","fraction","progress","getSizeFromViewport_","constrainedResolution","calculateCenterZoom","applyTargetState_","constrainedRotation","calculateCenterRotate","currentCenter","currentResolution","opt_rotation","metrics","getComputedStyle","w","ViewProperty","getConstraints","getHints","opt_hints","calculateExtent","opt_size","calculateExtentInternal","getMaxResolution","getMinResolution","getMaxZoom","getZoomForResolution","setMaxZoom","getMinZoom","setMinZoom","setConstrainResolution","enabled","getResolutions","getResolutionForExtent","getResolutionForExtentInternal","getResolutionForValueFunction","opt_power","getValueForResolutionFunction","nearest","baseLevel","fit","geometryOrExtent","userProjection","fitInternal","padding","minRotX","minRotY","maxRotX","maxRotY","rotX","rotY","getConstrainedResolution","centerRotX","centerRotY","getConstrainedCenter","centerOn","centerOnInternal","centerX","centerY","adjustCenter","deltaCoordinates","setCenter","adjustCenterInternal","adjustResolution","adjustResolutionInternal","isMoving","newResolution","adjustZoom","adjustRotation","adjustRotationInternal","newRotation","hint","opt_doNotCancelAnims","opt_forceMoving","newCenter","opt_duration","opt_resolutionDirection","beginInteraction","endInteraction","endInteractionInternal","opt_targetResolution","getConstrainedZoom","targetZoom","opt_direction","targetRes","createCanvasContext2D","opt_width","opt_height","canvas","offsetWidth","marginLeft","marginRight","offsetHeight","marginTop","marginBottom","replaceNode","newNode","oldNode","replaceChild","removeNode","node","removeChild","removeChildren","lastChild","OPACITY","VISIBLE","Z_INDEX","MAX_RESOLUTION","MIN_RESOLUTION","MAX_ZOOM","MIN_ZOOM","SOURCE","Base","BaseLayer","opacity","visible","zIndex","className_","className","state_","getClassName","getLayerState","opt_managed","layer","managed","getOpacity","sourceState","getSourceState","getVisible","getLayersArray","getLayerStatesArray","opt_states","setMaxResolution","setMinResolution","setOpacity","setVisible","setZIndex","zindex","UNDEFINED","READY","LAYERS","LayerGroup","baseOptions","layers","layersListenerKeys_","listenerKeys_","handleLayersChanged_","setLayers","handleLayerChange_","getLayers","handleLayersAdd_","handleLayersRemove_","layersArray","collectionEvent","states","ownLayerState","layerState","toSize","setTouchAction","msTouchAction","setAttribute","cache","PluggableMap","optionsInternal","keyboardEventTarget","getElementById","controls","interactions","overlays","layerGroup","MapProperty","view","createOptionsInternal","boundHandleBrowserEvent_","handleBrowserEvent","maxTilesLoading_","maxTilesLoading","pixelRatio_","pixelRatio","postRenderTimeoutHandle_","animationDelayKey_","animationDelay_","renderFrame_","coordinateToPixelTransform_","pixelToCoordinateTransform_","frameIndex_","frameState_","previousExtent_","viewPropertyListenerKey_","viewChangeListenerKey_","layerGroupPropertyListenerKeys_","viewport_","overflow","overlayContainer_","overlayContainerStopEvent_","mapBrowserEventHandler_","handleMapBrowserEvent","keyboardEventTarget_","keyHandlerKeys_","focusHandlerKeys_","overlays_","overlayIdIndex_","renderer_","handleResize_","postRenderFunctions_","tileQueue_","getTilePriority","handleTileChange_","handleLayerGroupChanged_","handleViewChanged_","handleSizeChanged_","handleTargetChanged_","control","setMap","interaction","addOverlayInternal_","createRenderer","addControl","getControls","addInteraction","getInteractions","addLayer","getLayerGroup","addOverlay","overlay","getOverlays","setTarget","forEachFeatureAtPixel","getCoordinateFromPixelInternal","hitTolerance","layerFilter","checkWrapped","forEachFeatureAtCoordinate","getFeaturesAtPixel","features","feature","forEachLayerAtPixel","hasFeatureAtPixel","hasFeatureAtCoordinate","getEventCoordinate","getEventCoordinateInternal","viewportPosition","getBoundingClientRect","eventPosition","top","getTargetElement","getView","pixelToCoordinateTransform","getOverlayById","getLoading","layerStatesArray","getSource","loading","getPixelFromCoordinate","viewCoordinate","getPixelFromCoordinateInternal","coordinateToPixelTransform","getRenderer","getSize","getOverlayContainer","getOverlayContainerStopEvent","tileSourceKey","tileCenter","tileResolution","wantedTiles","viewState","mapBrowserEvent","HTMLElement","parentElement","interactionsArray","getActive","handleEvent","handlePostRender","tileQueue","hints","viewHints","lowOnFrameBudget","time","dispatchRenderEvent","postRenderFunctions","render","targetElement","hasFocus","hasAttribute","activeElement","updateSize","handleViewPropertyChanged_","isRendered","renderSync","redrawText","layerStates","hasRenderer","handleFontsChanged","removeControl","removeInteraction","removeLayer","removeOverlay","previousFrameState","hasArea","declutterItems","layerIndex","usedTiles","renderFrame","MapEventType","setLayerGroup","setSize","setView","computedStyle","parseFloat","Control","target_","listenerKeys","getMap","CLASS_HIDDEN","CLASS_SELECTABLE","CLASS_UNSELECTABLE","CLASS_UNSUPPORTED","CLASS_CONTROL","CLASS_COLLAPSED","getFontParameters","font","family","fontFamily","fontWeight","fontStyle","families","weight","inView","Layer","mapPrecomposeKey_","mapRenderKey_","sourceChangeKey_","handleSourcePropertyChange_","setSource","handleSourceChange_","getFeatures","layerRenderer","prepareFrame","mapEvent","updateElement_","Attribution","ulElement_","collapsed_","collapsed","overrideCollapsible_","collapsible","collapsible_","tipLabel","collapseLabel","collapseLabel_","label","label_","activeLabel","title","handleClick_","cssClasses","renderedAttributions_","renderedVisible_","collectSourceAttributions_","lookup","visibleAttributions","attributionGetter","getAttributions","attributions","getAttributionsCollapsible","setCollapsible","display","innerHTML","handleToggle_","classList","toggle","getCollapsible","setCollapsed","getCollapsed","rotation_","autoHide_","Rotate","callResetNorth_","resetNorth","duration_","autoHide","resetNorth_","Zoom","zoomInLabel","zoomOutLabel","zoomInTipLabel","zoomOutTipLabel","inElement","createTextNode","outElement","zoomByDelta_","currentZoom","newZoom","defaults","zoomOptions","rotateOptions","attribution","attributionOptions","ACTIVE","zoomByDelta","Interaction","setActive","active","stopEvent","delta_","DoubleClickZoom","altKeyOnly","altShiftKeysOnly","always","mouseActionButton","never","singleClick","noModifierKeys","shiftKeyOnly","targetNotEditable","tagName","mouseOnly","primaryAction","pointerEvents","Pointer","PointerInteraction","handleDownEvent","handleDragEvent","handleMoveEvent","handleUpEvent","stopDown","handlingDownUpSequence","trackedPointers_","targetPointers","updateTrackedPointers_","handledUp","handled","isPointerDraggingEvent","event_1","defaultCondition","DragPan","kinetic_","kinetic","lastCentroid","lastPointersCount_","panning_","condition_","condition","noKinetic_","centroid","centerpx","DragRotate","lastAngle_","RenderBox","geometry_","startPixel_","endPixel_","render_","startPixel","endPixel","setPixels","createOrUpdateGeometry","DragBoxEventType","DragBoxEvent","DragBox","box_","minArea_","minArea","onBoxEnd_","onBoxEnd","boxEndCondition_","boxEndCondition","defaultBoxEndCondition","out_","mapExtent","boxPixelExtent","DragZoom","keyCode","KeyCode","mapUnitsDelta","pixelDelta_","pan","KeyboardPan","defaultCondition_","pixelDelta","charCode","KeyboardZoom","Mode","MouseWheelZoom","totalDelta_","lastDelta_","timeout_","timeout","useAnchor_","useAnchor","lastAnchor_","startTime_","timeoutId_","mode_","trackpadEventGap_","trackpadTimeoutId_","trackpadDeltaPerZoom_","endInteraction_","sign","wheelEvent","deltaMode","WheelEvent","DOM_DELTA_PIXEL","DOM_DELTA_LINE","timeLeft","handleWheelZoom_","setMouseAnchor","PinchRotate","pointerOptions","anchor_","rotating_","rotationDelta_","threshold_","threshold","rotationDelta","touch0","touch1","PinchZoom","lastDistance_","lastScaleDelta_","scaleDelta","altShiftDragRotate","doubleClickZoom","zoomDelta","zoomDuration","dragPan","onFocusOnly","pinchRotate","pinchZoom","keyboard","mouseWheelZoom","shiftDragZoom","RenderEvent","opt_inversePixelTransform","opt_context","inversePixelTransform","HEX_COLOR_RE_","NAMED_COLOR_RE_","asString","color","fromNamed","body","rgb","fromString","cacheSize","g","exec","hasAlpha","substr","normalize","Number","fromStringInternal_","asArray","IconImageCache","cache_","cacheSize_","maxCacheSize_","canExpireCache","expire","iconImage","src","crossOrigin","maxCacheSize","shared","asColorLike","measureFont","VectorContext","drawCustom","renderer","drawGeometry","drawCircle","circleGeometry","drawFeature","drawGeometryCollection","geometryCollectionGeometry","drawLineString","lineStringGeometry","drawMultiLineString","multiLineStringGeometry","drawMultiPoint","multiPointGeometry","drawMultiPolygon","multiPolygonGeometry","drawPoint","pointGeometry","drawPolygon","polygonGeometry","drawText","setFillStrokeStyle","fillStyle","strokeStyle","setImageStyle","imageStyle","opt_declutterGroup","setTextStyle","textStyle","opt_declutterGroups","LRUCache","opt_highWaterMark","highWaterMark","count_","entries_","oldest_","newest_","containsKey","entry","value_","key_","newer","older","peekLast","peekLastKey","peekFirstKey","LabelCache","consumers","consumer","consumerId","prune","outer","release","defaultLineDash","defaultPadding","labelCache","checkedFonts","measureContext","textHeights","checkFont","interval","referenceWidth","retries","checked","referenceFonts","text","isAvailable","getMeasureContext","available","referenceFont","measureText","check","done","clearInterval","fontSpec","setInterval","div","heights","measureTextHeight","margin","measureTextWidth","rotateAtOffset","offsetX","offsetY","resetTransform","drawImage","image","originX","originY","alpha","globalAlpha","setTransform","CanvasImmediateRenderer","viewRotation","opt_squaredTolerance","opt_userTransform","context_","viewRotation_","squaredTolerance_","userTransform_","contextFillState_","contextStrokeState_","contextTextState_","fillState_","strokeState_","image_","imageAnchorX_","imageAnchorY_","imageHeight_","imageOpacity_","imageOriginX_","imageOriginY_","imageRotateWithView_","imageRotation_","imageScale_","imageWidth_","text_","textOffsetX_","textOffsetY_","textRotateWithView_","textRotation_","textScale_","textFillState_","textStrokeState_","textState_","pixelCoordinates_","tmpLocalTransform_","drawImages_","pixelCoordinates","localTransform","drawText_","setContextFillState_","setContextStrokeState_","setContextTextState_","strokeText","fillText","moveToLineTo_","close","moveTo","lineTo","closePath","drawRings_","simpleGeometry","transformGeom2D","beginPath","arc","fill","stroke","getFill","getStroke","getImage","getText","getGeometryFunction","geometries","getGeometriesArray","flatMidpoint","getFlatMidpoint","geometryExtent","flatMidpoints","getFlatMidpoints","flatInteriorPoint","getEndss","flatInteriorPoints","getFlatInteriorPoints","fillState","contextFillState","strokeState","contextStrokeState","lineCap","setLineDash","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","textState","contextTextState","textAlign","textBaseline","fillStyleColor","getColor","strokeStyleColor","strokeStyleLineCap","getLineCap","strokeStyleLineDash","getLineDash","strokeStyleLineDashOffset","getLineDashOffset","strokeStyleLineJoin","getLineJoin","strokeStyleWidth","strokeStyleMiterLimit","getMiterLimit","imageAnchor","getAnchor","imageImage","imageOrigin","getOrigin","imageSize","getRotateWithView","getScale","textFillStyle","textFillStyleColor","textStrokeStyle","textStrokeStyleColor","textStrokeStyleLineCap","textStrokeStyleLineDash","textStrokeStyleLineDashOffset","textStrokeStyleLineJoin","textStrokeStyleWidth","textStrokeStyleMiterLimit","textFont","getFont","textOffsetX","getOffsetX","textOffsetY","getOffsetY","textRotateWithView","textRotation","textScale","textText","textTextAlign","getTextAlign","textTextBaseline","getTextBaseline","DEFAULT","IMAGE","TEXT","SIMPLIFY_TOLERANCE","GEOMETRY_RENDERERS","builderGroup","getImageState","ImageState","imageReplay","getBuilder","BuilderType","addDeclutter","textReplay","lineStringReplay","polygonReplay","replayGroup","geometryRenderer","circleReplay","defaultOrder","feature1","feature2","getSquaredTolerance","getTolerance","renderFeature","imageState","unlistenImageChange","listenImageChange","renderGeometry","getGeometries","replay","renderFeatureInternal","renderDeclutterItems","declutterTree","items","zIndexItems","renderDeclutter","expireIconCache","MapRenderer","declutterTree_","calculateMatrices2D","thisArg2","translatedCoordinate","offsets","projectionExtent","worldWidth","declutteredFeatures","numLayers","tmpCoord","getWrapX","callback_1","scheduleExpireIconCache","Composite","CompositeMapRenderer","labelCacheKey_","insertBefore","firstChild","children_","previousElement","oldChildren","childNodes","oldChild","newChild","replaceChildren","getDataAtPixel","BOTTOM_CENTER","CENTER_LEFT","CENTER_CENTER","CENTER_RIGHT","TOP_CENTER","ELEMENT","MAP","OFFSET","POSITIONING","Overlay","insertFirst","autoPan","autoPanAnimation","autoPanMargin","rendered","bottom_","left_","right_","top_","mapPostrenderListenerKey","handleElementChanged","handleMapChanged","handleOffsetChanged","handlePositionChanged","handlePositioningChanged","setElement","setOffset","setPositioning","positioning","OverlayPositioning","setPosition","getElement","getOffset","getPositioning","updatePixelPosition","panIntoView","mapRect","getRect","overlayRect","offsetLeft","offsetRight","offsetTop","offsetBottom","centerPx","newCenterPx","box","pageXOffset","pageYOffset","mapSize","updateRenderedPosition","bottom","top_1","getOptions","ARRAY_BUFFER","JSON","XML","withCredentials","loadFeaturesXhr","url","format","success","failure","xhr","XMLHttpRequest","open","FormatType","responseType","onload","status","responseText","responseXML","DOMParser","parseFromString","readFeatures","featureProjection","readProjection","onerror","send","dataProjection","addFeatures","TileRange","tileCoord","containsTileRange","tileRange","opt_tileCoord","getKeyZXY","hash","tmpTileCoord","TileGrid","opt_strict","compare","currentVal","res","origins","origin_","origin","origins_","tileSizes_","tileSizes","tileSize_","tileSize","fullTileRanges_","tmpSize_","sizes","calculateTileRanges_","forEachTileCoord","getTileRangeForExtentAndZ","forEachTileCoordParentTileRange","opt_tileRange","tileCoordExtent","getTileCoordExtent","getTileCoordChildTileRange","getTileRangeExtent","getTileSize","getTileCoordForXYAndZ_","getTileCoordCenter","getTileCoordForCoordAndResolution","getTileCoordForXYAndResolution_","reverseIntersectionPolicy","getZForResolution","adjustX","adjustY","xFromOrigin","yFromOrigin","tileCoordX","tileCoordY","getTileCoordForCoordAndZ","getTileCoordResolution","getFullTileRange","fullTileRanges","getForProjection","createForProjection","createXYZ","xyzOptions","gridOptions","resolutionsFromExtent","opt_maxZoom","opt_tileSize","opt_corner","createForExtent","extentFromProjection","half","supportedExtensions","ELEMENT_ARRAY_BUFFER","DYNAMIC_DRAW","CONTEXT_IDS","opt_attributes","DOCUMENT","implementation","createDocument","XML_SCHEMA_INSTANCE_URI","createElementNS","namespaceURI","qualifiedName","getAllTextContent","normalizeWhitespace","getAllTextContent_","accumulator","CDATA_SECTION_NODE","TEXT_NODE","nodeValue","nextSibling","isDocument","parse","xml","makeArrayExtender","valueReader","objectStack","makeArrayPusher","makeReplacer","makeObjectPropertyPusher","opt_property","localName","makeObjectPropertySetter","makeChildAppender","nodeWriter","makeArraySerializer","serializersNS","nodeFactory","serializers","makeSimpleNodeFactory","serialize","opt_nodeName","opt_namespaceURI","fixedNodeName","nodeName","OBJECT_PROPERTY_NODE_FACTORY","makeSequence","orderedKeys","sequence","makeStructureNS","namespaceURIs","structure","opt_structureNS","structureNS","parseNode","parsersNS","firstElementChild","nextElementSibling","parsers","parser","pushParseAndPop","opt_keys","pushSerializeAndPop","BufferUsage","STATIC_DRAW","STREAM_DRAW","getArrayClassForType","Float32Array","Uint32Array","WebGLArrayBuffer","opt_usage","usage","ofSize","fromArray","from","fromArrayBuffer","getUsage","LOST","RESTORED","fromTransform","mat4","DEFAULT_VERTEX_SHADER","DEFAULT_FRAGMENT_SHADER","WebGLPostProcessingPass","gl_","webGlContext","gl","scaleRatio_","scaleRatio","renderTargetTexture_","createTexture","renderTargetTextureSize_","frameBuffer_","createFramebuffer","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","fragmentShader","FRAGMENT_SHADER","renderTargetProgram_","createProgram","attachShader","linkProgram","renderTargetVerticesBuffer_","createBuffer","bindBuffer","bufferData","renderTargetAttribLocation_","getAttribLocation","renderTargetUniformLocation_","getUniformLocation","renderTargetTextureLocation_","uniforms_","uniforms","location","getGL","init","bindFramebuffer","FRAMEBUFFER","getFrameBuffer","viewport","internalFormat","RGBA","UNSIGNED_BYTE","bindTexture","TEXTURE_2D","texImage2D","texParameteri","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","framebufferTexture2D","COLOR_ATTACHMENT0","nextPass","activeTexture","TEXTURE0","clearColor","COLOR_BUFFER_BIT","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","useProgram","enableVertexAttribArray","vertexAttribPointer","FLOAT","uniform2f","uniform1i","applyUniforms","drawArrays","TRIANGLES","textureSlot","uniform","HTMLCanvasElement","texture","uniform3f","uniform4f","uniform1f","DefaultUniform","PROJECTION_MATRIX","OFFSET_SCALE_MATRIX","OFFSET_ROTATION_MATRIX","TIME","ZOOM","RESOLUTION","AttributeType","UNSIGNED_SHORT","UNSIGNED_INT","computeAttributesStride","attr","getByteSizeFromType","BYTES_PER_ELEMENT","Uint16Array","WebGLHelper","boundHandleWebGLContextLost_","handleWebGLContextLost","boundHandleWebGLContextRestored_","handleWebGLContextRestored","canvas_","bufferCache_","currentProgram_","getSupportedExtensions","getExtension","ContextEventType","offsetRotateMatrix_","offsetScaleMatrix_","tmpMat4_","uniformLocations_","attribLocations_","name_1","postProcessPasses_","postProcesses","shaderCompileErrors_","bufferKey","bufferCache","webGlBuffer","flushBufferData","deleteBuffer","bufferCacheEntry","isContextLost","prepareDraw","getCanvas","applyFrameState","prepareDrawToRenderTarget","renderTarget","opt_disableAlphaBlend","getFramebuffer","getTexture","ZERO","drawElements","elementType","numItems","offsetInBytes","finalizeDraw","offsetScaleMatrix","offsetRotateMatrix","setUniformMatrixValue","setUniformFloatValue","HTMLImageElement","program","shader","getProgram","fragmentShaderSource","vertexShaderSource","getShaderInfoLog","getShaderCompileErrors","getAttributeLocation","makeProjectionTransform","uniformMatrix4fv","enableAttributeArray_","attribName","enableAttributes","opt_data","opt_texture","tmpArray4","WebGLRenderTarget","helper","helper_","texture_","framebuffer_","size_","data_","dataCacheDirty_","updateSize_","clearCachedData","readAll","readPixels","readPixel","WMTSTileGrid","matrixIds_","matrixIds","getMatrixId","getMatrixIds","createFromCapabilitiesMatrixSet","matrixSet","opt_matrixLimits","matrixLimits","switchOriginXY","elt","elt_ml","tileWidth","tileHeight","ImageStyle","opacity_","rotateWithView_","rotateWithView","scale_","getHitDetectionImage","getImageSize","getHitDetectionImageSize","setRotateWithView","setScale","RegularShape","hitDetectionCanvas_","fill_","points","radius_","radius1","radius2_","radius2","stroke_","imageSize_","hitDetectionImageSize_","getPoints","getRadius2","strokeWidth","renderOptions","draw_","createHitDetectionCanvas_","angle0","radiusC","drawHitDetectionCanvas_","CircleStyle","setRadius","Fill","color_","setColor","FRACTION","ImageBase","getPixelRatio","listenImage","loadHandler","errorHandler","img","promise","listening_1","then","catch","ImageWrapper","imageLoadFunction","src_","unlisten_","imageLoadFunction_","handleImageError_","unlistenImage_","handleImageLoad_","setImage","IconImage","hitDetectionImage_","imageState_","tainted_","isTainted_","getImageData","dispatchChangeEvent_","replaceColor_","fillRect","getSrc","ctx","imgData","putImageData","Icon","normalizedAnchor_","anchorOrigin_","anchorOrigin","IconOrigin","anchorXUnits_","anchorXUnits","IconAnchorUnits","anchorYUnits_","anchorYUnits","crossOrigin_","imgSize","iconImage_","offset_","offsetOrigin_","offsetOrigin","setAnchor","iconImageSize","Stroke","lineCap_","lineDash_","lineDashOffset_","lineJoin_","miterLimit_","width_","setLineCap","setLineDashOffset","setLineJoin","setMiterLimit","setWidth","Style","geometryFunction_","defaultGeometryFunction","zIndex_","setRenderer","setFill","setStroke","setText","defaultStyles","createDefaultStyle","createEditingStyle","white","blue","LINE","DEFAULT_FILL_COLOR","Text","font_","textAlign_","textBaseline_","maxAngle_","maxAngle","placement_","placement","TextPlacement","overflow_","offsetX_","offsetY_","backgroundFill_","backgroundFill","backgroundStroke_","backgroundStroke","padding_","getPlacement","getMaxAngle","getOverflow","getBackgroundFill","getBackgroundStroke","getPadding","setOverflow","setFont","setMaxAngle","setOffsetX","setOffsetY","setPlacement","setTextAlign","setTextBaseline","setBackgroundFill","setBackgroundStroke","setPadding","zRegEx","xRegEx","yRegEx","dashYRegEx","range","createFromTemplates","templates","tileUrlFunctions","createFromTileUrlFunctions","nullTileUrlFunction","expandUrl","urls","match","startCharCode","stopCharCode","stop_1","jsonp","opt_errback","opt_callbackParam","script","async","timer","getElementsByTagName","ERROR_THRESHOLD","Tile","interimTile","transition_","transition","transitionStarts_","setState","getInterimTile","refreshInterimChain","getTileCoord","getAlpha","inTransition","endTransition","getBlankImage","ImageTile","tileLoadFunction","tileLoadFunction_","naturalWidth","naturalHeight","TileCache","expireCache","pruneExceptNewestZ","fromKey","calculateSourceResolution","targetProj","targetMetersPerUnit","sourceMetersPerUnit","sourceExtent","compensationFactor","isFinite","enlargeClipPoint","centroidX","centroidY","dX","dY","targetExtent","triangulation","sources","gutter","opt_renderEdges","sourceDataExtent","canvasWidthInUnits","canvasHeightInUnits","stitchContext","stitchScale","xPos","yPos","srcWidth","srcHeight","targetTopLeft","getTriangles","triangle","u0","v0","u1","u2","sourceNumericalShiftX","sourceNumericalShiftY","affineCoefs","maxRow","maxEl","absValue","coef","solveLinearSystem","save","p0","p1","p2","clip","restore","MAX_SUBDIVISION","Triangulation","maxSourceExtent","errorThreshold","sourceProj_","targetProj_","transformInvCache","transformInv","transformInv_","maxSourceExtent_","errorThresholdSquared_","triangles_","wrapsXInSource_","canWrapXInSource_","sourceWorldWidth_","targetWorldWidth_","destinationTopLeft","destinationTopRight","destinationBottomRight","destinationBottomLeft","sourceTopLeft","sourceTopRight","sourceBottomRight","sourceBottomLeft","addQuad_","leftBound_1","newTriangle","addTriangle_","aSrc","bSrc","cSrc","dSrc","maxSubdivision","sourceQuadExtent","sourceCoverageX","sourceWorldWidth","wrapsX","needsSubdivision","centerSrc","bc","bcSrc","da","daSrc","ab","abSrc","cd","cdSrc","calculateSourceExtent","ReprojTile","sourceTileGrid","targetTileGrid","wrappedTileCoord","getTileFunction","opt_errorThreshold","renderEdges_","gutter_","sourceTileGrid_","targetTileGrid_","wrappedTileCoord_","sourceTiles_","sourcesListenerKeys_","sourceZ_","maxTargetExtent","limitedTargetExtent","sourceProjExtent","errorThresholdInPixels","triangulation_","sourceRange","srcX","srcY","unlistenSources_","reproject_","leftToLoad_1","sourceListenKey_1","adaptAttributions","attributionLike","Source","attributions_","attributionsCollapsible_","attributionsCollapsible","wrapX_","wrapX","refresh","setAttributions","TileSource","opaque_","opaque","tilePixelRatio_","tilePixelRatio","canUseScreen","screen","availWidth","availHeight","tileCache","tmpSize","tileOptions","zDirection","getTileCacheForProjection","forEachLoadedTile","tileCoordKey","loaded","covered","getGutterForProjection","setKey","getOpaque","getTile","getTileGrid","getTileGridForProjection","thisProj","getTilePixelRatio","getTilePixelSize","getTileCoordForTileUrlFunction","opt_projection","worldsAway","withinExtentAndZ","useTile","TileSourceEvent","UrlTile","generateTileUrlFunction_","tileUrlFunction","setUrls","setUrl","tileLoadingKeys_","getTileLoadFunction","getTileUrlFunction","getUrls","uid","tileState","TileEventType","setTileLoadFunction","setTileUrlFunction","defaultTileLoadFunction","imageTile","TileImage","tileClass","tileCacheForProjection","tileGridForProjection","reprojectionErrorThreshold_","reprojectionErrorThreshold","renderReprojectionEdges_","usedTileCache","getGutter","projKey","createTile_","urlTileCoord","tileUrl","newTile","getTileInternal","setRenderReprojectionEdges","setTileGridForProjection","tilegrid","proj","BingMaps","hidpi","hidpi_","culture_","culture","maxZoom_","apiKey_","imagerySet_","imagerySet","handleImageryMetadataResponse","getApiKey","getImagerySet","response","statusCode","statusDescription","authenticationResultCode","resourceSets","resources","resource","zoomMax","imageWidth","imageHeight","zoomMin","imageUrlSubdomains","subdomain","quadKeyTileCoord","imageUrl","digits","mask","quadKey","imageryProviders","transform_1","imageryProvider","intersecting","coverageAreas","coverageArea","bbox","CartoDB","account_","account","mapId_","config_","templateCache_","initializeMap_","getConfig","updateConfig","setConfig","paramHash","stringify","applyTemplate_","mapUrl","client","handleInitResponse_","handleInitError_","setRequestHeader","err","tilesUrl","cdn_url","https","layergroupid","ADDFEATURE","CHANGEFEATURE","REMOVEFEATURE","RBush","opt_maxEntries","rbush_","items_","extents","getAll","getInExtent","forEach_","forEachInExtent","rbush","VectorSourceEvent","opt_feature","Vector","VectorSource","loader_","format_","overlaps_","overlaps","url_","loader","strategy_","strategy","collection","useSpatialIndex","featuresRtree_","loadedExtentsRtree_","nullGeometryFeatures_","idIndex_","uidIndex_","featureChangeKeys_","featuresCollection_","addFeaturesInternal","bindFeaturesCollection_","addFeature","addFeatureInternal","featureKey","addToIndex_","setupChangeEvents_","VectorEventType","handleFeatureChange_","valid","newFeatures","geometryFeatures","length_1","length_2","length_3","modifyingCollection","removeFeature","opt_fast","featureId","removeFeatureInternal","clearEvent","forEachFeature","forEachFeatureAtCoordinateDirect","forEachFeatureInExtent","forEachFeatureIntersectingExtent","getFeaturesCollection","getFeaturesAtCoordinate","getFeaturesInExtent","getClosestFeatureToCoordinate","opt_filter","closestFeature","previousMinSquaredDistance","minDistance","getFeatureById","getFeatureByUid","getFormat","getOverlaps","getUrl","sid","removeFromIdIndex_","hasFeature","loadFeatures","loadedExtentsRtree","extentsToLoad","_loop_1","extentToLoad","this_1","removeLoadedExtent","removed","setLoader","Cluster","geometryFunction","cluster","setDistance","mapDistance","clustered","neighbors","neighbor","createCluster","TierSizeCalculation","TRUNCATED","CustomTile","zoomifyImage_","Zoomify","tierSizeCalculation","tierSizeInTiles","tileSizeForTierSizeCalculation","tileCountUpToTier","tileCoordZ","tileIndex","tileSize_1","localContext_1","ZoomifyTileClass","Versions","VERSION1","VERSION2","VERSION3","IIIF_PROFILE_VALUES","supports","formats","qualities","COMPLIANCE_VERSION1","RegExp","COMPLIANCE_VERSION2","COMPLIANCE_VERSION3","versionFunctions","iiifInfo","levelProfile","getComplianceLevelSupportedFeatures","imageInfo","scale_factors","tile_width","tile_height","additionalProfile","profile","profileSupports","profileFormats","profileQualities","tiles","scaleFactors","extraFormats","preferredFormat","preferredFormats","acc","extraFeatures","extraQualities","IIIFInfo","setImageInfo","getImageApiVersion","getComplianceLevelEntryFromProfile","version","test","getComplianceLevelFromProfile","complianceLevel","level","getTileSourceOptions","opt_preferredOptions","imageOptions","quality","formatPercentage","percentage","toLocaleString","maximumFractionDigits","IIIF","baseUrl","lastIndexOf","supportsListedSizes","supportsListedTiles","isInteger","supportsArbitraryTiling","maxScaleFactor","ignoredSizesIndex","IiifTileClass","regionParam","sizeParam","tileX","tileY","regionX","regionY","regionW","regionH","sizeW","sizeH","regionWidth","regionHeight","ReprojImage","getImageFunction","sourceImage","sourcePixelRatio","targetExtent_","sourceImage_","sourcePixelRatio_","sourceListenerKey_","unlistenSource_","ImageSourceEventType","ImageSourceEvent","defaultImageLoadFunction","ImageSource","reprojectedImage_","reprojectedRevision_","findNearestResolution","getImageInternal","handleImageChange","appendParams","uri","params","keyParams","encodeURIComponent","qs","ImageArcGISRest","params_","renderedRevision_","ratio_","getParams","halfWidth","halfHeight","imageResolution","getRequestUrl_","getImageLoadFunction","srid","modifiedUrl","setImageLoadFunction","updateParams","ImageCanvas","opt_loader","error_","getError","handleLoad_","ImageCanvasSource","canvasFunction_","canvasFunction","canvasElement","ImageMapGuide","displayDpi_","displayDpi","useOverlay_","useOverlay","dpi","mcsW","mcsH","devW","devH","mpp","baseParams","Static","imageExtent_","imageExtent","getImageExtent","targetWidth","DEFAULT_WMS_VERSION","GETFEATUREINFO_IMAGE_SIZE","ImageWMS","v13_","updateV13_","serverType_","getFeatureInfoUrl","projectionObj","sourceProjectionObj","getLegendUrl","mpu","viewExtent","requestExtent","WMSServerType","ATTRIBUTION","OSM","BaseImage","BaseImageLayer","LayerRenderer","boundHandleImageChange_","handleImageChange_","layer_","loadedTileCallback","createLoadedTileFinder","getLayer","renderIfReadyAndVisible","loadImage","CanvasLayerRenderer","renderedResolution","tempTransform_","pixelTransform","containerReused","createTransformStringCanvas_","useContainer","layerClassName","transformOrigin","topLeft","topRight","bottomRight","bottomLeft","clipUnrotated","inverted","dispatchRenderEvent_","preRender","postRender","getRenderTransform","renderPixel","createTransformString","CanvasImageLayerRenderer","imageLayer","viewResolution","imageSource","renderedExtent","imagePixelRatio","viewCenter","size_1","canvasTransform","clearRect","clipped","layerExtent","dw","dh","previousAlpha","ImageLayer","BaseTile","BaseTileLayer","preload","useInterimTilesOnError","setPreload","setUseInterimTilesOnError","getPreload","TileProperty","getUseInterimTilesOnError","CanvasTileLayerRenderer","tileLayer","extentChanged","renderedExtent_","renderedPixelRatio","renderedProjection","renderedRevision","renderedTiles","newTiles_","tmpExtent","tmpTileRange_","isDrawableTile","tileSource","sourceRevision","canvasExtent","tilesToDrawByZ","findLoadedTiles","tmpTileRange","childTileRange","canvasScale","clips","clipZs","currentClip","zs","currentZ","currentTilePixelSize","currentScale","dx_1","dy_1","originTileCoord","originTileExtent","origin_1","tileGutter","tilesToDraw","floatX","nextX","floatY","nextY","i_1","drawTileImage","updateUsedTiles","manageTilePyramid","updateCacheSize_","scheduleExpireCache","getTileImage","tileAlpha","alphaChanged","postRenderFunction","opt_tileCallback","TileLayer","RasterEventType","RasterOperationType","PIXEL","RasterSourceEvent","RasterSource","worker_","operationType_","operationType","threads_","layers_","createLayer","createLayers","requestedFrameState_","renderedImageCanvas_","iMax","sourceOrLayer","sourceAttribution","setOperation","opt_lib","updateFrameState_","allSourcesReady_","ready","processSources_","imageDatas","onWorkerComplete_","sharedContext","layerOrSource","Raster","ATTRIBUTIONS","LayerConfig","ProviderConfig","Stamen","provider","providerConfig","layerConfig","tileExtent","tmpExtent_","TileArcGISRest","getKeyForParams_","LabeledTile","strokeRect","TileDebug","textTileCoord","TileJSON","tileJSON_","handleTileJSONResponse","handleTileJSONError","onXHRLoad_","onXHRError_","tileJSON","getTileJSON","epsg4326Projection","attributionExtent_1","TileWMS","transparent","preemptive","preemptive_","grid_","keys_","jsonp_","getData","xRelative","yRelative","row","forDataAtCoordinate","opt_request","loadInternal_","handleError_","json","UTFGrid","tileUrlFunction_","template_","getTemplate","forDataAtCoordinateAndResolution","grids","VectorRenderTile","getSourceTiles","removeSourceTiles","executorGroups","loadingSourceTiles","errorSourceTileKeys","hitDetectionImageData","replayState_","wantedResolution","removeSourceTiles_","sourceTileListenerKeys","sourceZ","hasContext","getReplayState","dirty","renderedRenderOrder","renderedTileResolution","renderedTileRevision","renderedZ","renderedTileZ","VectorTile","features_","onLoad","setFeatures","onError","defaultLoadFunction","loadingTiles_","sourceTileByCoordKey_","sourceTilesByTileKey_","tileGrids_","sourceTiles","loadedZ","previousSourceTiles","sourceTileCoord","sourceTile","coordKey","key_1","sourceTileKey","errorTileCount","addSourceTiles","empty","KVP","REST","WMTS","requestEncoding","WMTSRequestEncoding","version_","dimensions_","dimensions","matrixSet_","requestEncoding_","getKeyForDimensions_","createFromWMTSTemplate","getDimensions","getMatrixSet","getRequestEncoding","getVersion","updateDimensions","WebGLWorkerMessageType","GENERATE_BUFFERS","WebGLLayerRenderer","BaseVector","BaseVectorLayer","renderBuffer","updateWhileAnimating","updateWhileInteracting","declutter_","declutter","renderBuffer_","updateWhileAnimating_","updateWhileInteracting_","getDeclutter","getRenderBuffer","getRenderOrder","getUpdateWhileAnimating","getUpdateWhileInteracting","setRenderOrder","renderOrder","styleFunction","WebGLPointsLayerRenderer","projectionMatrixTransform","sourceRevision_","verticesBuffer_","hitVerticesBuffer_","indicesBuffer_","program_","hitDetectionEnabled_","hitFragmentShader","hitVertexShader","hitProgram_","customAttributes","attribute","hitDetectionAttributes","currentTransform_","renderTransform_","invertRenderTransform_","renderInstructions_","hitRenderInstructions_","hitRenderTarget_","received","projectionTransform","hitDetection","vertexBuffer","indexBuffer","renderInstructions","featureCache_","featureCount_","sourceListenKeys_","handleSourceFeatureAdded_","handleSourceFeatureChanged_","handleSourceFeatureDelete_","renderCount","renderHitDetection","vectorSource","viewNotMoving","sourceChanged","rebuildBuffers_","featureCache","totalInstructionsCount","totalHitInstructionsCount","hitColor","tmpCoords","tmpColor","renderIndex","hitIndex","featureUid","radix","customAttributesCount","hitMessage","colorDecodeId","terminate","Instruction","BEGIN_GEOMETRY","BEGIN_PATH","CLOSE_PATH","CUSTOM","DRAW_CHARS","DRAW_IMAGE","END_GEOMETRY","FILL","MOVE_TO_LINE_TO","SET_FILL_STYLE","SET_STROKE_STYLE","STROKE","beginPathInstruction","closePathInstruction","CanvasBuilder","maxLineWidth","beginGeometryInstruction1_","beginGeometryInstruction2_","bufferedMaxExtent_","instructions","tmpCoordinate_","hitDetectionInstructions","applyPixelRatio","dashArray","dash","appendFlatCoordinates","closed","skipFirst","myEnd","getBufferedMaxExtent","lastRel","nextRel","lastXCoord","lastYCoord","nextCoord","skipped","drawCustomCoordinates_","builderEnds","builderEnd","beginGeometry","builderEndss","builderBegin","myEnds","endGeometry","reverseHitDetectionInstructions","instruction","createFill","fillInstruction","applyStroke","createStroke","updateFillStyle","currentFillStyle","updateStrokeStyle","currentStrokeStyle","currentLineCap","currentLineDash","currentLineDashOffset","currentLineJoin","currentLineWidth","currentMiterLimit","endGeometryInstruction","CanvasImageBuilder","declutterGroups_","anchorX_","anchorY_","height_","originX_","originY_","drawCoordinates_","myBegin","declutterGroups","hitDetectionImage","CanvasLineStringBuilder","drawFlatCoordinates_","moveToLineToInstruction","lastStroke","CanvasPolygonBuilder","drawFlatCoordinatess_","numEnds","setFillStrokeStyles_","circleInstruction","matchingChunk","m12","m23","x12","y12","x23","y23","chunkStart","chunkEnd","chunkM","acos","TEXT_ALIGN","BATCH_CONSTRUCTORS","PolygonBuilder","Builder","ImageBuilder","LineStringBuilder","CanvasTextBuilder","labels_","fillStates","strokeStates","textStates","textKey_","fillKey_","strokeKey_","geometryType","flatOffset","flatEnd","oo","declutterGroup","drawChars_","geometryWidths","saveTextStates_","pixelRatio_1","strokeKey","textKey","fillKey","baseline","BuilderGroup","tolerance_","maxExtent_","resolution_","buildersByZIndex_","group","builderInstructions","zKey","builders","builderKey","builderInstruction","builderType","zIndexKey","replays","Constructor","lineStringLength","drawTextOnPath","startM","measureAndCacheTextWidth","previousAngle","numChars","segmentM","angleChanged","char","charLength","charM","segmentPos","interpolate","p3","p4","Executor","alignFill_","coordinateCache_","renderedTransform_","widths_","getTextImage","align","numLines","widths","currentWidth","measureTextWidths","lineHeight","renderWidth","leftRight","replayTextBackground_","strokeInstruction","setStrokeStyle_","replayImage_","snapToPixel","fillStroke","boxW","boxH","boxX","boxY","strokePadding","declutterArgs","repeatSize","groupCount","declutterData","currentAlpha","drawTextImageWithPointPlacement_","execute_","featureCallback","opt_hitExtent","dd","prevX","prevY","roundX","roundY","pendingFill","pendingStroke","lastFillInstruction","lastStrokeInstruction","coordinateCache","viewRotationFromTransform","batchSize","labelWithAnchor","widthIndex","declutterGroupIndex","measurePixelRatio","pixelRatioScale","cachedWidths","pathLength","textLength","parts","cc","chars","part","execute","executeHitDetection","opt_featureCallback","ORDER","ExecutorGroup","allInstructions","opt_renderBuffer","executorsByZIndex_","hitDetectionContext_","hitDetectionTransform_","createExecutors_","flatClipCoords","getClipCoords","executors","instructionByZindex","hasExecutors","candidates","contextSize","hitExtent","circleArrayCache","arraySize","fillCircleArrayRowToMiddle","getCircleArray","j_1","result_1","executor","opt_builderTypes","opt_declutterReplays","builderTypes","0","replayDeclutter","declutterReplays","zz","executorData","currentExecutor","createHitDetectionImageData","transforms","imageSmoothingEnabled","featureCount","indexFactor","featuresByZIndex","featureStyleFunction","originalStyle","canvas_1","imgContext","byGeometryType","zIndexKeys","geomAndStyle","kk","hitDetect","resultFeatures","CanvasVectorLayerRenderer","vectorLayer","boundHandleStyleImageChange_","handleStyleImageChange_","animatingOrInteracting_","dirty_","hitDetectionImageData_","renderedFeatures_","renderedResolution_","renderedRotation_","renderedCenter_","renderedProjection_","renderedRenderOrder_","replayGroup_","replayGroupChanged","makeScale","world","transform_2","viewHints_1","Promise","resolve","reject","layer_1","features_1","animating","interacting","frameStateExtent","vectorLayerRevision","vectorLayerRenderBuffer","vectorLayerRenderOrder","userTransform","userExtent","replayGroupInstructions","executorGroup","CanvasVectorImageLayerRenderer","vectorRenderer_","layerImageRatio_","getImageRatio","coordinateToVectorPixelTransform_","renderedPixelToCoordinateTransform_","vectorPixel","vectorRenderer","imageFrameState_1","image_1","HYBRID","IMAGE_REPLAYS","VECTOR_REPLAYS","CanvasVectorTileLayerRenderer","renderedLayerRevision_","renderTileImageQueue_","tileListenerKeys_","tmpTransform_","prepareTile","tileUid","updateExecutorGroup_","tileImageNeedsRender_","listenerKey","renderTileImage_","layerRevision","builderState","layerUid","tt","sourceTileExtent","sharedExtent","bufferedExtent","executorGroupInstructions","replayExtent","renderingReplayGroup","found","_loop_2","tileContainsCoordinate","extent_1","tilePixel","rotation_1","transforms_1","renderQueuedTileImages_","renderMode","getRenderMode","VectorTileRenderType","replayTypes","worldOffset","replayState","renderPixelRatio","renderScale","pixelScale","VectorLayer","interpolatePoint","pointY","cumulativeLengths","haystack","needle","opt_comparator","mid","cmp","comparator","binarySearch","lineStringCoordinateAtM","extrapolate","lo","hi","m0","LineString","flatMidpoint_","flatMidpointRevision_","appendCoordinate","forEachSegment","getCoordinateAtM","opt_extrapolate","getCoordinateAt","geoM","fracA","fracB","fracM","geoA","geoB","geoStack","fractionStack","fractions","maxIterations","DEFAULT_STROKE_STYLE","INTERVALS","Graticule","maxLines","targetSize","showLabels","lonLabelFormatter","latLabelFormatter","lonLabelPosition","latLabelPosition","lonLabelStyle","latLabelStyle","intervals","maxLat_","maxLon_","minLat_","minLon_","maxLatP_","maxLonP_","minLatP_","minLonP_","targetSize_","maxLines_","meridians_","parallels_","strokeStyle_","fromLonLatTransform_","toLonLatTransform_","projectionCenterLonLat_","meridiansLabels_","parallelsLabels_","lonLabelFormatter_","latLabelFormatter_","lonLabelPosition_","latLabelPosition_","lonLabelStyleBase_","lonLabelStyle_","latLabelStyleBase_","latLabelStyle_","intervals_","loaderFunction","featurePool_","lineStyle_","renderExtent","updateProjectionInfo_","createGraticule_","featuresColl","labelData","poolIndex","geom","addMeridian_","lon","minLat","maxLat","lineString","getMeridian_","textPoint","getMeridianPoint_","addParallel_","minLon","maxLon","getParallel_","getParallelPoint_","getInterval_","cnt","centerLonLat","centerLon","centerLat","validExtent","frac","meridian","clampedBottom","clampedTop","getMeridians","lon2","parallel","clampedLeft","clampedRight","getParallels","worldExtentP","GRADIENT","DEFAULT_GRADIENT","Heatmap","gradient","blur","gradient_","handleGradientChanged_","setGradient","setBlur","weightFunction_","getBlur","getGradient","colors","createLinearGradient","step","addColorStop","createGradient","u_size","u_blurSlope","u_gradientTexture","VectorImage","VectorImageLayer","imageRatio","imageRatio_","VectorTileLayer","renderMode_","DragAndDropEventType","DragAndDropEvent","file","opt_features","handleDrop","files","dataTransfer","reader","FileReader","handleResult_","readAsText","handleStop","dropEffect","DragAndDrop","formatConstructors_","formatConstructors","dropListenKeys_","source_","tryReadFeatures_","registerListeners_","dropArea","unregisterListeners_","DragRotateAndZoom","lastMagnitude_","magnitude","angleDelta","Circle","setCenterAndRadius","getRadiusSquared_","MultiLineString","lineStrings","appendLineString","opt_interpolate","lineStringsCoordinateAtM","getLineString","getLineStrings","midpoints","intersectsLineStringArray","MultiPoint","appendPoint","getPoint","MultiPolygon","opt_endss","endss_","flatInteriorPointsRevision_","flatInteriorPoints_","polygons","appendPolygon","newEndss","multiArrayMaxSquaredDelta","assignClosestMultiArrayPoint","linearRingssContainsXY","linearRingss","getInteriorPoints","linearRingssAreOriented","simplifiedEndss","quantizeMultiArray","getPolygon","prevEnds","getPolygons","intersectsLinearRingMultiArray","deflateMultiCoordinatesArray","lastEnds","DrawEventType","DrawEvent","Draw","shouldHandle_","downPx_","downTimeout_","lastDragTime_","freehand_","snapTolerance_","snapTolerance","type_","getMode","stopClick_","stopClick","minPoints_","minPoints","maxPoints_","maxPoints","finishCondition_","finishCondition","opt_geometry","squaredLength","Constructor_1","mode_1","dragVertexDelay_","dragVertexDelay","finishCoordinate_","sketchFeature_","sketchPoint_","sketchCoords_","sketchLine_","sketchLineCoords_","squaredClickTolerance_","clickTolerance","overlay_","geometryName","freehandCondition_","freehand","freehandCondition","updateState_","getOverlay","pass","addToDrawing_","startDrawing_","circleMode","finishDrawing","atFinish_","abortDrawing_","downPx","clickPx","modifyDrawing_","createOrUpdateSketchPoint_","at","potentiallyDone","potentiallyFinishCoordinates","sketchCoords","finishCoordinate","finishPixel","updateSketchFeatures_","sketchLineGeom","ring","removeLastPoint","sketchFeature","sketchFeatures","overlaySource","ExtentEventType","EXTENTCHANGED","ExtentEvent","getDefaultExtentStyleFunction","getDefaultPointerStyleFunction","getPointHandler","fixedPoint","getEdgeHandler","fixedP1","fixedP2","Extent","pointerHandler_","pixelTolerance_","pixelTolerance","snappedToVertex_","extentFeature_","vertexFeature_","extentOverlay_","boxStyle","vertexOverlay_","pointerStyle","snapToVertex_","pixelCoordinate","getExtentInternal","segments","getSegments","closestSegment","vertex","vertexPixel","pixel1","pixel2","squaredDist1","squaredDist2","dist","createOrUpdatePointerFeature_","createOrUpdateExtentFeature_","extentFeature","vertexFeature","getOpposingPoint","x_","y_","CIRCLE_CIRCUMFERENCE_INDEX","tempExtent","tempSegment","ModifyEventType","ModifyEvent","mapBrowserPointerEvent","compareIndexes","projectedDistanceToSegmentDataSquared","pointCoordinates","segmentData","distanceToCenterSquared","distanceToCircumference","closestOnSegmentData","Modify","boundHandleFeatureChange_","defaultDeleteCondition_","deleteCondition_","deleteCondition","insertVertexCondition_","insertVertexCondition","vertexSegments_","lastPixel_","ignoreNextSingleClick_","modified_","rBush_","changingFeature_","dragSegments_","SEGMENT_WRITERS_","writePointGeometry_","writeLineStringGeometry_","writePolygonGeometry_","writeMultiPointGeometry_","writeMultiLineStringGeometry_","writeMultiPolygonGeometry_","writeCircleGeometry_","writeGeometryCollectionGeometry_","handleSourceAdd_","handleSourceRemove_","addFeature_","handleFeatureAdd_","handleFeatureRemove_","lastPointerEvent_","writer","handlePointerAtPixel_","willModifyFeatures_","removeFeature_","removeFeatureSegmentData_","rBush","nodesToRemove","nodeToRemove","depth","rings","centerSegmentData","circumferenceSegmentData","featureSegments","geometry_1","createOrUpdateVertexFeature_","removePoint","dragSegment","setGeometryCoordinates_","insertVertices","vertexExtent","segmentDataMatches","componentSegments","segmentDataMatch","insertVertex_","nodes","vertexSegments","rTree","updateSegmentIndices_","newSegmentData","newSegmentData2","removeVertex_","component","newIndex","dragSegments","segmentsByFeature","deleted","SelectEventType","SELECT","SelectEvent","selected","deselected","addCondition_","removeCondition_","toggleCondition_","featureLayerAssociation_","filter_","addFeatureLayerAssociation_","multi_","layerFilter_","hitTolerance_","removeFeatureLayerAssociation_","Select","addCondition","removeCondition","toggleCondition","multi","featureStyleAssociation_","layers_1","getHitTolerance","setHitTolerance","removeSelectedStyle_","giveSelectedStyle_","getFeatureFromEvent","Snap","vertex_","edge_","featuresListenerKeys_","featureChangeListenerKeys_","indexedFeaturesExtents_","pendingFeatures_","opt_listen","feature_uid","segmentWriter","forEachFeatureAdd_","forEachFeatureRemove_","getFeatures_","snapTo","snapped","updateFeature_","featuresToUpdate","opt_unlisten","nodesToRemove_1","currentMap","closestSegmentData","projectedCoordinate","isCircle","closestOnCircle","TranslateEventType","TranslateEvent","startCoordinate","Translate","lastCoordinate_","startCoordinate_","lastFeature_","handleActiveChanged_","featuresAtPixel_","newCoordinate","deltaX_1","deltaY_1","oldMap","cloneGeometries","clonedGeometries","GeometryCollection","opt_geometries","geometries_","changeEventsKeys_","listenGeometriesChange_","unlistenGeometriesChange_","geometryCollection","setGeometries","simplifiedGeometries","simplified","simplifiedGeometryCollection","setGeometriesArray","FeatureFormat","defaultFeatureProjection","getReadOptions","adaptOptions","readFeature","readGeometry","writeFeature","writeFeatures","writeGeometry","transformGeometryWithOptions","transformed","decimals","power_1","transformExtentWithOptions","getObject","JSONFeature","readFeatureFromObject","readFeaturesFromObject","readGeometryFromObject","readProjectionFromObject","writeFeatureObject","writeFeaturesObject","writeGeometryObject","GEOMETRY_READERS","getGeometryLayout","paths","GEOMETRY_WRITERS","_a","_b","esriJSONPolygon","flatRing","outerRings","holes","hole","matched","outerRing","convertRings","geometryReader","hasZ","hasM","getHasZM","geometryWriter","esriJSON","hasZM","multiPoint","multiLineString","EsriJSON","esriJSONFeature","idField","esriJSONFeatures","objectIdFieldName","wkid","objects","XMLFeature","xmlSerializer_","XMLSerializer","doc","readFeatureFromDocument","readFeatureFromNode","readFeaturesFromDocument","readFeaturesFromNode","readGeometryFromDocument","readGeometryFromNode","readProjectionFromDocument","readProjectionFromNode","writeFeatureNode","serializeToString","writeFeaturesNode","writeGeometryNode","GMLNS","ONLY_WHITESPACE_RE","GMLBase","featureType","featureNS","srsName","schemaLocation","FEATURE_COLLECTION_PARSERS","namespace","readFeaturesInternal","child","ft","candidate","featureTypes","readFeatureElement","readGeometryElement","GEOMETRY_PARSERS","readFeatureElementInternal","asFeature","_content_","attName","fid","getAttributeNS","readPoint","readFlatCoordinatesFromNode_","readMultiPoint","MULTIPOINT_PARSERS_","readMultiLineString","MULTILINESTRING_PARSERS_","readMultiPolygon","MULTIPOLYGON_PARSERS_","pointMemberParser_","POINTMEMBER_PARSERS_","lineStringMemberParser_","LINESTRINGMEMBER_PARSERS_","polygonMemberParser_","POLYGONMEMBER_PARSERS_","readLineString","readFlatLinearRing_","GEOMETRY_FLAT_COORDINATES_PARSERS","readLinearRing","readPolygon","flatLinearRings","FLAT_LINEAR_RINGS_PARSERS","RING_PARSERS","readBooleanString","string","readDateTime","dateTime","readDecimal","readDecimalString","readNonNegativeInteger","readNonNegativeIntegerString","trim","writeBooleanTextNode","bool","writeStringTextNode","writeDecimalTextNode","toPrecision","writeNonNegativeIntegerTextNode","nonNegativeInteger","MULTIGEOMETRY_TO_MEMBER_NODENAME","GML3","surface_","surface","curve_","curve","multiCurve_","multiCurve","multiSurface_","multiSurface","readMultiCurve_","MULTICURVE_PARSERS_","readMultiSurface_","MULTISURFACE_PARSERS_","curveMemberParser_","CURVEMEMBER_PARSERS_","surfaceMemberParser_","SURFACEMEMBER_PARSERS_","readPatch_","PATCHES_PARSERS_","readSegment_","SEGMENTS_PARSERS_","readPolygonPatch_","readLineStringSegment_","interiorParser_","flatLinearRing","exteriorParser_","readSurface_","SURFACE_PARSERS_","readCurve_","CURVE_PARSERS_","readEnvelope_","ENVELOPE_PARSERS_","readFlatPos_","re","containerSrs","readFlatPosList_","contextDimension","dim","writePos_","srsDimension","getCoords_","opt_srsName","opt_hasZ","writePosList_","writePoint_","writeEnvelope","ENVELOPE_SERIALIZERS_","writeLinearRing_","posList","RING_NODE_FACTORY_","exteriorWritten","writeSurfaceOrPolygon_","RING_SERIALIZERS_","patches","writeSurfacePatches_","writeCurveOrLineString_","writeCurveSegments_","writeMultiSurfaceOrPolygon_","SURFACEORPOLYGONMEMBER_SERIALIZERS_","MULTIGEOMETRY_MEMBER_NODE_FACTORY_","writeMultiPoint_","POINTMEMBER_SERIALIZERS_","writeMultiCurveOrLineString_","LINESTRINGORCURVEMEMBER_SERIALIZERS_","writeRing_","writeSurfaceOrPolygonMember_","GEOMETRY_NODE_FACTORY_","writePointMember_","writeLineStringOrCurveMember_","line","writeGeometryElement","GEOMETRY_SERIALIZERS_","writeFeatureElement","writeFeatureMembers_","setAttributeNS","GML","GML2","readFlatCoordinates_","coordsGroups","readBox_","BOX_PARSERS_","innerBoundaryIsParser_","outerBoundaryIsParser_","createCoordinatesNode_","writeCoordinates_","GML32","NAMESPACE_URIS","FEATURE_READER","readRte","readTrk","readWpt","GPX_PARSERS","LINK_PARSERS","GPX_SERIALIZERS","RTE_SEQUENCE","RTE_SERIALIZERS","TRK_SEQUENCE","TRK_SERIALIZERS","writeWptType","GPX","readExtensions_","readExtensions","handleReadExtensions_","extensionsNode","featureReader","gpx","GPX_NODE_FACTORY","RTE_PARSERS","parseLink","parseExtensions","RTEPT_PARSERS","rteValues","layoutOptions","TRK_PARSERS","TRKSEG_PARSERS","TRKPT_PARSERS","trkValues","WPT_PARSERS","LINK_SEQUENCE","LINK_SERIALIZERS","writeLink","RTEPT_TYPE_SEQUENCE","TRKSEG_SERIALIZERS","TRKSEG_NODE_FACTORY","WPT_TYPE_SEQUENCE","WPT_TYPE_SERIALIZERS","date","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","GEOMETRY_TYPE_TO_NODENAME","applyLayoutOptions","href","link","readGeometryCollectionGeometry","geoJSON","rightHanded","writeGeometryCollectionGeometry","GeoJSON","extractGeometryName_","extractGeometryName","geoJSONFeature","geoJSONFeatures","crs","DEFAULT_COLOR","DEFAULT_IMAGE_STYLE_ANCHOR","DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS","DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS","DEFAULT_IMAGE_STYLE_SIZE","DEFAULT_IMAGE_STYLE_SRC","DEFAULT_IMAGE_SCALE_MULTIPLIER","TextFeature","readFeatureFromText","readFeaturesFromText","readGeometryFromText","readProjectionFromText","writeFeatureText","writeFeaturesText","writeGeometryText","IGCZ","BAROMETRIC","GPS","NONE","B_RECORD_RE","H_RECORD_RE","HFDTE_RECORD_RE","NEWLINE_RE","IGC","altitudeMode_","altitudeMode","year","month","day","lastDateTime","hour","minute","second","UTC","GX_NAMESPACE_URIS","ICON_ANCHOR_UNITS_MAP","PLACEMARK_PARSERS","extendedDataParser","regionParser","readMultiGeometry","readStyle","styleMapValue","readStyleMapValue","placemarkObject","readURI","GX_MULTITRACK_GEOMETRY_PARSERS","readGxTrack","NETWORK_LINK_PARSERS","REGION_PARSERS","LAT_LON_ALT_BOX_PARSERS","regionObject","LOD_PARSERS","lodObject","KML_SEQUENCE","KML_SERIALIZERS","DOCUMENT_SERIALIZERS","DOCUMENT_NODE_FACTORY","writePlacemark","DEFAULT_FILL_STYLE","DEFAULT_NO_IMAGE_STYLE","DEFAULT_IMAGE_STYLE","DEFAULT_TEXT_STROKE_STYLE","DEFAULT_TEXT_STYLE","DEFAULT_STYLE","DEFAULT_STYLE_ARRAY","KML","defaultStyle_","defaultStyle","extractStyles_","extractStyles","writeStyles_","writeStyles","sharedStyles_","showPointNames_","showPointNames","readDocumentOrFolder_","readPlacemark_","readSharedStyle_","readSharedStyleMap_","styleUrl","sharedStyles","nameStyle","drawName","createNameStyleFunction","foundStyle","findStyle","styleValue","createFeatureStyleFunction","styleUri","baseURI","fs","readName","readNameFromDocument","readNameFromNode","name_2","readNetworkLinks","networkLinks","readNetworkLinksFromDocument","readNetworkLinksFromNode","readRegion","regions","readRegionFromDocument","readRegionFromNode","kml","xmlnsUri","textOffset","imageScale","foundText","readColor","hexColor","readFlatCoordinates","readScale","STYLE_MAP_PARSERS","pairObject","PAIR_PARSERS","ICON_STYLE_PARSERS","iconObject","ICON_PARSERS","xunits","yunits","LABEL_STYLE_PARSERS","LINE_STYLE_PARSERS","POLY_STYLE_PARSERS","FLAT_LINEAR_RING_PARSERS","readFlatLinearRing","GX_TRACK_PARSERS","whens","when","gxTrackObject","readFlatCoordinatesFromNode","EXTRUDE_AND_ALTITUDE_MODE_PARSERS","MULTI_GEOMETRY_PARSERS","multiGeometry","homogeneous","setCommonGeometryProperties","INNER_BOUNDARY_IS_PARSERS","OUTER_BOUNDARY_IS_PARSERS","STYLE_PARSERS","styleObject","IconObject","drawIcon","hotSpot","outline","hasExtrude","hasTessellate","hasAltitudeMode","extrudes","tessellates","altitudeModes","DATA_PARSERS","EXTENDED_DATA_PARSERS","featureObject","displayName","SCHEMA_DATA_PARSERS","writeColorTextNode","rgba","abgr","hex","EXTENDEDDATA_NODE_SERIALIZERS","pair","createCDATASection","writeCDATASection","DATA_NODE_FACTORY","ICON_SEQUENCE","ICON_SERIALIZERS","GX_NODE_FACTORY","ICON_STYLE_SEQUENCE","ICON_STYLE_SERIALIZERS","icon","vec2","writeScaleTextNode","LABEL_STYLE_SEQUENCE","LABEL_STYLE_SERIALIZERS","LINE_STYLE_SEQUENCE","LINE_STYLE_SERIALIZERS","GEOMETRY_NODE_FACTORY","POINT_NODE_FACTORY","LINE_STRING_NODE_FACTORY","LINEAR_RING_NODE_FACTORY","POLYGON_NODE_FACTORY","MULTI_GEOMETRY_SERIALIZERS","writePrimitiveGeometry","writePolygon","writeMultiGeometry","BOUNDARY_IS_SERIALIZERS","writeBoundaryIs","PLACEMARK_SERIALIZERS","namesAndValues","names","STYLE_SEQUENCE","STYLE_SERIALIZERS","PLACEMARK_SEQUENCE","EXTENDEDDATA_NODE_FACTORY","PRIMITIVE_GEOMETRY_SEQUENCE","PRIMITIVE_GEOMETRY_SERIALIZERS","POLYGON_SERIALIZERS","INNER_BOUNDARY_NODE_FACTORY","OUTER_BOUNDARY_NODE_FACTORY","POLY_STYLE_SERIALIZERS","COLOR_NODE_FACTORY","iconProperties","RenderFeature","flatCoordinates_","flatMidpoints_","properties_","midpoint","layersPBFReader","layerPBFReader","featurePBFReader","readRawFeature","MVT","featureClass_","featureClass","layerName_","layerName","idProperty_","idProperty","readRawGeometry_","cmd","coordsLen","currentEnd","cmdLen","createFeature_","rawFeature","getGeometryType","prevEndIndex","ctor","pbfLayers","pbfLayer","WAY_PARSERS","ndrefs","readTag","PARSERS","tags","NODE_PARSERS","ways","OSMXML","flipXY","opt_destOffset","destOffset","encodeDeltas","numbers","opt_factor","factor","lastNumbers","encodeFloats","decodeDeltas","encoded","decodeFloats","encodeUnsignedInteger","encodeUnsignedIntegers","encodeSignedIntegers","current","decodeUnsignedIntegers","decodeSignedIntegers","Polyline","factor_","geometryLayout_","geometryLayout","TopoJSON","topoJSONTopology","arcs","transformArc","transformArcs","topoJSONFeatures","objectName","readFeaturesFromGeometryCollection","readFeatureFromGeometry","transformVertex","concatenateArcs","polyArray","ringCoords","indices","Filter","tagName_","getTagName","LogicalNary","conditions","And","Bbox","Spatial","Contains","Comparison","propertyName","During","ComparisonBinary","expression","opt_matchCase","matchCase","EqualTo","GreaterThan","GreaterThanOrEqualTo","Intersects","IsBetween","lowerBoundary","upperBoundary","IsLike","pattern","opt_wildCard","opt_singleChar","opt_escapeChar","wildCard","singleChar","escapeChar","IsNull","LessThan","LessThanOrEqualTo","Not","NotEqualTo","Or","Within","and","Function","TRANSACTION_SUMMARY_PARSERS","TRANSACTION_RESPONSE_PARSERS","INSERT_RESULTS_PARSERS","QUERY_SERIALIZERS","TRANSACTION_SERIALIZERS","gmlVersion","featurePrefix","typeName","getTypeName","XMLNS","writeOgcFidFilter","WFSNS","nativeElement","vendorId","safeToIgnore","FEATURE_PREFIX","OGCNS","FESNS","SCHEMA_LOCATIONS","DEFAULT_VERSION","WFS","featureType_","featureNS_","gmlFormat_","gmlFormat","schemaLocation_","getFeatureType","setFeatureType","readTransactionResponse","readTransactionResponseFromDocument","readTransactionResponseFromNode","readFeatureCollectionMetadata","readFeatureCollectionMetadataFromDocument","readFeatureCollectionMetadataFromNode","writeGetFeature","handle","outputFormat","maxFeatures","resultType","viewParams","propertyNames","GETFEATURE_SERIALIZERS","writeTransaction","inserts","updates","deletes","baseObj","gmlOptions","nativeElements","OGC_FID_PARSERS","prefix","writeFilterCondition","valueReference","timePeriod","writeTimeInstant","writeLogicalFilter","writeOgcPropertyName","writeComparisonFilter","writeOgcLiteral","writeOgcExpression","timeInstant","timePosition","GeometryConstructor","Z","TokenType","WKTGeometryType","toUpperCase","Lexer","wkt","index_","isAlpha_","isNumeric_","opt_decimal","isWhiteSpace_","nextChar_","nextToken","readNumber_","readText_","scientificNotation","substring","Parser","lexer","lexer_","token_","layout_","consume_","isTokenType","isMatch","parseGeometry_","parseGeometryLayout_","dimToken","dimInfo","parseGeometryCollectionText_","isEmptyGeometry_","formatErrorMessage_","parsePointText_","parsePoint_","parseLineStringText_","parsePointList_","parsePolygonText_","parseLineStringTextList_","parseMultiPointText_","parsePointTextList_","parseMultiLineStringText_","parseMultiPolygonText_","parsePolygonTextList_","token","geomType","WKT","splitCollection_","splitCollection","parse_","encode","encodePointGeometry","encodeLineStringGeometry","encodePolygonGeometry","GeometryEncoder","components","geoms","enc","geometryEncoder","encodeGeometryLayout","NAMESPACE_URI","readHref","readFromDocument","readFromNode","SERVICE_PARSERS","CAPABILITY_PARSERS","REQUEST_PARSERS","EXCEPTION_PARSERS","LAYER_PARSERS","WMSCapabilities","wmsCapabilityObject","readKeywordList","CONTACT_INFORMATION_PARSERS","CONTACT_PERSON_PARSERS","CONTACT_ADDRESS_PARSERS","geographicBoundingBox","EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS","westBoundLongitude","southBoundLatitude","eastBoundLongitude","northBoundLatitude","ATTRIBUTION_PARSERS","authorityObject","readFormatOnlineresource","metadataObject","parentLayerObject","layerObject","queryable","cascaded","noSubsets","fixedWidth","fixedHeight","childValue","parentValue","readSizedFormatOnlineresource","readOperationType","OPERATIONTYPE_PARSERS","DCPTYPE_PARSERS","HTTP_PARSERS","FORMAT_ONLINERESOURCE_PARSERS","KEYWORDLIST_PARSERS","formatOnlineresource","WMSGetFeatureInfo","readFeatures_","layerElement","layerFeatures","gmlFeatures","SERVICE_IDENTIFICATION_PARSERS","SERVICE_PROVIDER_PARSERS","OPERATIONS_METADATA_PARSERS","OWS","owsObject","ADDRESS_PARSERS","ALLOWED_VALUES_PARSERS","CONSTRAINT_PARSERS","CONTACT_INFO_PARSERS","PHONE_PARSERS","DCP_PARSERS","REQUEST_METHOD_PARSERS","OPERATION_PARSERS","SERVICE_CONTACT_PARSERS","CONTENTS_PARSERS","WMTSCapabilities","owsParser_","WMTSCapabilityObject","TMS_PARSERS","isDefault","TMS_LINKS_PARSERS","DIMENSION_PARSERS","resourceType","WGS84_BBOX_READERS","legend","TMS_LIMITS_LIST_PARSERS","TMS_LIMITS_PARSERS","readCoordinates","TM_PARSERS","isFullScreenSupported","webkitRequestFullscreen","msRequestFullscreen","msFullscreenEnabled","requestFullscreen","fullscreenEnabled","isFullScreen","webkitIsFullScreen","msFullscreenElement","fullscreenElement","requestFullScreen","FullScreen","cssClassName_","labelNode_","labelActive","labelActiveNode_","button_","setClassName_","handleFullScreen_","exitFullscreen","msExitFullscreen","webkitExitFullscreen","requestFullScreenWithKeys","handleFullScreenChange_","fullscreen","activeClassName","inactiveClassName","nextClassName","mapProjection_","MousePosition","coordinateFormat","setCoordinateFormat","undefinedHTML_","undefinedHTML","renderOnMouseOut_","renderedHTML_","getCoordinateFormat","handleMouseMove","updateHTML_","handleMouseOut","html","ControlledMap","validateExtent_","updateBox_","OverviewMap","boundHandleRotationChanged_","handleRotationChanged_","viewExtent_","ovmapDiv_","ovmap_","ovmap","boxSizing","boxOverlay_","scope","overlayBox","mousePosition","endMoving","oldView","unbindView_","handleMapPropertyChange_","bindView_","resetExtent_","newView","ovmapSize","ovextent","topLeftPixel","bottomRightPixel","boxWidth","boxHeight","ovmapWidth","ovmapHeight","recenter_","ovview","steps","MAX_RATIO","ovresolution","getOverviewMap","UNITS_PROP","IMPERIAL","NAUTICAL","METRIC","US","LEADING_DIGITS","viewState_","ScaleLine","bar","innerElement_","minWidth_","minWidth","renderedWidth_","handleUnitsChanged_","setUnits","scaleBar_","scaleBarSteps_","scaleBarText_","pointResolutionUnits","nominalCount","suffix","metersPerDegree","decimalCount","createScaleBar","mapScale","getScaleForResolution","scaleSteps","stepWidth","backgroundColor","createMarker","createStepText","isLast","lengthString","Direction","VERTICAL","HORIZONTAL","sliderInitialized_","initSlider_","currentResolution_","setThumbPosition_","ZoomSlider","direction_","heightLimit_","widthLimit_","startX_","startY_","thumbSize_","thumbElement","containerElement","handleDraggerStart_","handleDraggerDrag_","handleDraggerEnd_","handleContainerClick_","containerSize","thumb","thumbWidth","thumbHeight","relativePosition","getRelativePosition_","getResolutionForPosition_","drag","getPositionForResolution_","ZoomToExtent","handleZoomToExtent","ol","featureloader","loadingstrategy","proj4","webgl","sphere","util","unByKey","stableSort","compareFnc","colorlike","createStringXY","toStringHDMS","upAndDown","click","doubleClick","focus","penOnly","pointerEvt","platformModifierKeyOnly","pointerMove","touchOnly","setWithCredentials","xhrWithCredentials","writeFilter","between","during","equalTo","greaterThan","greaterThanOrEqualTo","isNull","lessThan","lessThanOrEqualTo","like","not","notEqualTo","or","within","createBox","boxCoordinates","createRegularPolygon","Group","fromLonLat","projCodes","defs","def","axis","to_meter","code1","proj1","code2","proj2","toLonLat","lonLat","getRenderPixel","getVectorContext","toContext","PointsLayer","ImageStatic","optionsFromCapabilities","wmtsCap","tileMatrixSets","supportedCRS","matrixSetObj","projConfig","wgs84BoundingBox","wgs84ProjectionExtent","gets","encodings","Buffer","Helper","PostProcessingPass","RenderTarget"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAY,GAAID,IAEhBD,EAAS,GAAIC,IARf,CASGK,OAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC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,OAAO/2F,wBAA0B,GAC1CyyF,GAAGI,MAAMmE,mBAAqB,GAC9BvE,GAAGI,MAAMoE,aAAe,GACxBxE,GAAGI,MAAM15F,YrL1iBgB,MqL2iBzBs5F,GAAGI,MAAMz5F,YrLljBgB,MqLmjBzBq5F,GAAG/7F,IAAIV,kBAAoB,GAC3By8F,GAAG/7F,IAAID,MAAQ,GAEA,gB","file":"ol.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ol\"] = factory();\n\telse\n\t\troot[\"ol\"] = factory();\n})(window, function() {\nreturn "," \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(t=t||self).RBush=i()}(this,function(){\"use strict\";function t(t,r,e,a,h){!function t(n,r,e,a,h){for(;a>e;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d<x;){for(i(n,d,x),d++,x--;h(n[d],p)<0;)d++;for(;h(n[x],p)>0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return t<i?-1:t>i?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r<i.length;r++)if(n(t,i[r]))return r;return-1}function a(t,i){h(t,0,t.children.length,i,t)}function h(t,i,n,r,e){e||(e=p(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var a=i;a<n;a++){var h=t.children[a];o(e,t.leaf?r(h):h)}return e}function o(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function l(t,i){return t.minY-i.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function m(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function c(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a<i.children.length;a++){var h=i.children[a],o=i.leaf?r(h):h;c(t,o)&&(i.leaf?n.push(h):m(t,o)?this._all(h,n):e.push(h))}i=e.pop()}return n},r.prototype.collides=function(t){var i=this.data;if(!c(t,i))return!1;for(var n=[];i;){for(var r=0;r<i.children.length;r++){var e=i.children[r],a=i.leaf?this.toBBox(e):e;if(c(t,a)){if(i.leaf||m(t,a))return!0;n.push(e)}}i=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0;i<t.length;i++)this.insert(t[i]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(t,i){if(!t)return this;for(var n,r,a,h=this.data,o=this.toBBox(t),s=[],l=[];h||s.length;){if(h||(h=s.pop(),r=s[s.length-1],n=l.pop(),a=!0),h.leaf){var f=e(t,h.children,i);if(-1!==f)return h.children.splice(f,1),s.push(h),this._condense(s),this}a||h.leaf||!m(h,o)?r?(n++,h=r.children[n],a=!1):h=null:(s.push(h),l.push(n),n=0,r=h,h=h.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,i){return t.minX-i.minX},r.prototype.compareMinY=function(t,i){return t.minY-i.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,i){for(var n=[];t;)t.leaf?i.push.apply(i,t.children):n.push.apply(n,t.children),t=n.pop();return i},r.prototype._build=function(t,i,n,r){var e,h=n-i+1,o=this._maxEntries;if(h<=o)return a(e=p(t.slice(i,n+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(h)/Math.log(o)),o=Math.ceil(h/Math.pow(o,r-1))),(e=p([])).leaf=!1,e.height=r;var s=Math.ceil(h/o),l=s*Math.ceil(Math.sqrt(o));d(t,i,n,l,this.compareMinX);for(var f=i;f<=n;f+=l){var u=Math.min(f+l-1,n);d(t,f,u,s,this.compareMinY);for(var m=f;m<=u;m+=s){var c=Math.min(m+s-1,u);e.children.push(this._build(t,m,c,r-1))}}return a(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,i,n,r){for(;r.push(i),!i.leaf&&r.length-1!==n;){for(var e=1/0,a=1/0,h=void 0,o=0;o<i.children.length;o++){var s=i.children[o],l=f(s),u=(m=t,c=s,(Math.max(c.maxX,m.maxX)-Math.min(c.minX,m.minX))*(Math.max(c.maxY,m.maxY)-Math.min(c.minY,m.minY))-l);u<a?(a=u,e=l<e?l:e,h=s):u===a&&l<e&&(e=l,h=s)}i=h||i.children[0]}var m,c;return i},r.prototype._insert=function(t,i,n){var r=n?t:this.toBBox(t),e=[],a=this._chooseSubtree(r,this.data,i,e);for(a.children.push(t),o(a,r);i>=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v<m?(m=v,r=p,c=M<c?M:c):v===m&&M<c&&(c=M,r=p)}return r||n-i},r.prototype._chooseSplitAxis=function(t,i,n){var r=t.leaf?this.compareMinX:s,e=t.leaf?this.compareMinY:l;this._allDistMargin(t,i,n,r)<this._allDistMargin(t,i,n,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,i,n,r){t.children.sort(r);for(var e=this.toBBox,a=h(t,0,i,e),s=h(t,n-i,n,e),l=u(a)+u(s),f=i;f<n-i;f++){var m=t.children[f];o(a,t.leaf?e(m):m),l+=u(a)}for(var c=n-i-1;c>=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});\n","/*!\n * PEP v0.5.3 | https://github.com/jquery/PEP\n * Copyright jQuery Foundation and other contributors | http://jquery.org/license\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.PointerEventsPolyfill = factory());\n}(this, function () { 'use strict';\n\n /**\n * This is the constructor for new PointerEvents.\n *\n * New Pointer Events must be given a type, and an optional dictionary of\n * initialization properties.\n *\n * Due to certain platform requirements, events returned from the constructor\n * identify as MouseEvents.\n *\n * @constructor\n * @param {String} inType The type of the event to create.\n * @param {Object} [inDict] An optional dictionary of initial event properties.\n * @return {Event} A new PointerEvent of type `inType`, initialized with properties from `inDict`.\n */\n var MOUSE_PROPS = [\n 'bubbles',\n 'cancelable',\n 'view',\n 'screenX',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n 'pageX',\n 'pageY'\n ];\n\n var MOUSE_DEFAULTS = [\n false,\n false,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n 0,\n 0\n ];\n\n function PointerEvent(inType, inDict) {\n inDict = inDict || Object.create(null);\n\n var e = document.createEvent('Event');\n e.initEvent(inType, inDict.bubbles || false, inDict.cancelable || false);\n\n // define inherited MouseEvent properties\n // skip bubbles and cancelable since they're set above in initEvent()\n for (var i = 2, p; i < MOUSE_PROPS.length; i++) {\n p = MOUSE_PROPS[i];\n e[p] = inDict[p] || MOUSE_DEFAULTS[i];\n }\n e.buttons = inDict.buttons || 0;\n\n // Spec requires that pointers without pressure specified use 0.5 for down\n // state and 0 for up state.\n var pressure = 0;\n\n if (inDict.pressure !== undefined && e.buttons) {\n pressure = inDict.pressure;\n } else {\n pressure = e.buttons ? 0.5 : 0;\n }\n\n // add x/y properties aliased to clientX/Y\n e.x = e.clientX;\n e.y = e.clientY;\n\n // define the properties of the PointerEvent interface\n e.pointerId = inDict.pointerId || 0;\n e.width = inDict.width || 1;\n e.height = inDict.height || 1;\n e.pressure = pressure;\n e.tiltX = inDict.tiltX || 0;\n e.tiltY = inDict.tiltY || 0;\n e.twist = inDict.twist || 0;\n e.tangentialPressure = inDict.tangentialPressure || 0;\n e.pointerType = inDict.pointerType || '';\n e.hwTimestamp = inDict.hwTimestamp || 0;\n e.isPrimary = inDict.isPrimary || false;\n e.detail = 0;\n return e;\n }\n\n /**\n * This module implements a map of pointer states\n */\n var USE_MAP = window.Map && window.Map.prototype.forEach;\n var PointerMap = USE_MAP ? Map : SparseArrayMap;\n\n function SparseArrayMap() {\n this.array = [];\n this.size = 0;\n }\n\n SparseArrayMap.prototype = {\n set: function(k, v) {\n if (v === undefined) {\n return this.delete(k);\n }\n if (!this.has(k)) {\n this.size++;\n }\n this.array[k] = v;\n },\n has: function(k) {\n return this.array[k] !== undefined;\n },\n delete: function(k) {\n if (this.has(k)) {\n delete this.array[k];\n this.size--;\n }\n },\n get: function(k) {\n return this.array[k];\n },\n clear: function() {\n this.array.length = 0;\n this.size = 0;\n },\n\n // return value, key, map\n forEach: function(callback, thisArg) {\n return this.array.forEach(function(v, k) {\n callback.call(thisArg, v, k, this);\n }, this);\n }\n };\n\n var CLONE_PROPS = [\n\n // MouseEvent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n\n // DOM Level 3\n 'buttons',\n\n // PointerEvent\n 'pointerId',\n 'width',\n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType',\n 'hwTimestamp',\n 'isPrimary',\n\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'which',\n 'pageX',\n 'pageY',\n 'timeStamp'\n ];\n\n var CLONE_DEFAULTS = [\n\n // MouseEvent\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n\n // DOM Level 3\n 0,\n\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n\n // event instance\n '',\n null,\n null,\n 0,\n 0,\n 0,\n 0\n ];\n\n var BOUNDARY_EVENTS = {\n 'pointerover': 1,\n 'pointerout': 1,\n 'pointerenter': 1,\n 'pointerleave': 1\n };\n\n var HAS_SVG_INSTANCE = (typeof SVGElementInstance !== 'undefined');\n\n /**\n * This module is for normalizing events. Mouse and Touch events will be\n * collected here, and fire PointerEvents that have the same semantics, no\n * matter the source.\n * Events fired:\n * - pointerdown: a pointing is added\n * - pointerup: a pointer is removed\n * - pointermove: a pointer is moved\n * - pointerover: a pointer crosses into an element\n * - pointerout: a pointer leaves an element\n * - pointercancel: a pointer will no longer generate events\n */\n var dispatcher = {\n pointermap: new PointerMap(),\n eventMap: Object.create(null),\n captureInfo: Object.create(null),\n\n // Scope objects for native events.\n // This exists for ease of testing.\n eventSources: Object.create(null),\n eventSourceList: [],\n /**\n * Add a new event source that will generate pointer events.\n *\n * `inSource` must contain an array of event names named `events`, and\n * functions with the names specified in the `events` array.\n * @param {string} name A name for the event source\n * @param {Object} source A new source of platform events.\n */\n registerSource: function(name, source) {\n var s = source;\n var newEvents = s.events;\n if (newEvents) {\n newEvents.forEach(function(e) {\n if (s[e]) {\n this.eventMap[e] = s[e].bind(s);\n }\n }, this);\n this.eventSources[name] = s;\n this.eventSourceList.push(s);\n }\n },\n register: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceList[i]); i++) {\n\n // call eventsource register\n es.register.call(es, element);\n }\n },\n unregister: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceList[i]); i++) {\n\n // call eventsource register\n es.unregister.call(es, element);\n }\n },\n contains: /*scope.external.contains || */function(container, contained) {\n try {\n return container.contains(contained);\n } catch (ex) {\n\n // most likely: https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return false;\n }\n },\n\n // EVENTS\n down: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerdown', inEvent);\n },\n move: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointermove', inEvent);\n },\n up: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerup', inEvent);\n },\n enter: function(inEvent) {\n inEvent.bubbles = false;\n this.fireEvent('pointerenter', inEvent);\n },\n leave: function(inEvent) {\n inEvent.bubbles = false;\n this.fireEvent('pointerleave', inEvent);\n },\n over: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerover', inEvent);\n },\n out: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerout', inEvent);\n },\n cancel: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointercancel', inEvent);\n },\n leaveOut: function(event) {\n this.out(event);\n this.propagate(event, this.leave, false);\n },\n enterOver: function(event) {\n this.over(event);\n this.propagate(event, this.enter, true);\n },\n\n // LISTENER LOGIC\n eventHandler: function(inEvent) {\n\n // This is used to prevent multiple dispatch of pointerevents from\n // platform events. This can happen when two elements in different scopes\n // are set up to create pointer events, which is relevant to Shadow DOM.\n if (inEvent._handledByPE) {\n return;\n }\n var type = inEvent.type;\n var fn = this.eventMap && this.eventMap[type];\n if (fn) {\n fn(inEvent);\n }\n inEvent._handledByPE = true;\n },\n\n // set up event listeners\n listen: function(target, events) {\n events.forEach(function(e) {\n this.addEvent(target, e);\n }, this);\n },\n\n // remove event listeners\n unlisten: function(target, events) {\n events.forEach(function(e) {\n this.removeEvent(target, e);\n }, this);\n },\n addEvent: /*scope.external.addEvent || */function(target, eventName) {\n target.addEventListener(eventName, this.boundHandler);\n },\n removeEvent: /*scope.external.removeEvent || */function(target, eventName) {\n target.removeEventListener(eventName, this.boundHandler);\n },\n\n // EVENT CREATION AND TRACKING\n /**\n * Creates a new Event of type `inType`, based on the information in\n * `inEvent`.\n *\n * @param {string} inType A string representing the type of event to create\n * @param {Event} inEvent A platform event with a target\n * @return {Event} A PointerEvent of type `inType`\n */\n makeEvent: function(inType, inEvent) {\n\n // relatedTarget must be null if pointer is captured\n if (this.captureInfo[inEvent.pointerId]) {\n inEvent.relatedTarget = null;\n }\n var e = new PointerEvent(inType, inEvent);\n if (inEvent.preventDefault) {\n e.preventDefault = inEvent.preventDefault;\n }\n e._target = e._target || inEvent.target;\n return e;\n },\n\n // make and dispatch an event in one call\n fireEvent: function(inType, inEvent) {\n var e = this.makeEvent(inType, inEvent);\n return this.dispatchEvent(e);\n },\n /**\n * Returns a snapshot of inEvent, with writable properties.\n *\n * @param {Event} inEvent An event that contains properties to copy.\n * @return {Object} An object containing shallow copies of `inEvent`'s\n * properties.\n */\n cloneEvent: function(inEvent) {\n var eventCopy = Object.create(null);\n var p;\n for (var i = 0; i < CLONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = inEvent[p] || CLONE_DEFAULTS[i];\n\n // Work around SVGInstanceElement shadow tree\n // Return the <use> element that is represented by the instance for Safari, Chrome, IE.\n // This is the behavior implemented by Firefox.\n if (HAS_SVG_INSTANCE && (p === 'target' || p === 'relatedTarget')) {\n if (eventCopy[p] instanceof SVGElementInstance) {\n eventCopy[p] = eventCopy[p].correspondingUseElement;\n }\n }\n }\n\n // keep the semantics of preventDefault\n if (inEvent.preventDefault) {\n eventCopy.preventDefault = function() {\n inEvent.preventDefault();\n };\n }\n return eventCopy;\n },\n getTarget: function(inEvent) {\n var capture = this.captureInfo[inEvent.pointerId];\n if (!capture) {\n return inEvent._target;\n }\n if (inEvent._target === capture || !(inEvent.type in BOUNDARY_EVENTS)) {\n return capture;\n }\n },\n propagate: function(event, fn, propagateDown) {\n var target = event.target;\n var targets = [];\n\n // Order of conditions due to document.contains() missing in IE.\n while (target != null && target !== document && !target.contains(event.relatedTarget)) {\n targets.push(target);\n target = target.parentNode;\n\n // Touch: Do not propagate if node is detached.\n if (!target) {\n return;\n }\n }\n if (propagateDown) {\n targets.reverse();\n }\n targets.forEach(function(target) {\n event.target = target;\n fn.call(this, event);\n }, this);\n },\n setCapture: function(inPointerId, inTarget, skipDispatch) {\n if (this.captureInfo[inPointerId]) {\n this.releaseCapture(inPointerId, skipDispatch);\n }\n\n this.captureInfo[inPointerId] = inTarget;\n this.implicitRelease = this.releaseCapture.bind(this, inPointerId, skipDispatch);\n document.addEventListener('pointerup', this.implicitRelease);\n document.addEventListener('pointercancel', this.implicitRelease);\n\n var e = new PointerEvent('gotpointercapture', { bubbles: true });\n e.pointerId = inPointerId;\n e._target = inTarget;\n\n if (!skipDispatch) {\n this.asyncDispatchEvent(e);\n }\n },\n releaseCapture: function(inPointerId, skipDispatch) {\n var t = this.captureInfo[inPointerId];\n if (!t) {\n return;\n }\n\n this.captureInfo[inPointerId] = undefined;\n document.removeEventListener('pointerup', this.implicitRelease);\n document.removeEventListener('pointercancel', this.implicitRelease);\n\n var e = new PointerEvent('lostpointercapture', { bubbles: true });\n e.pointerId = inPointerId;\n e._target = t;\n\n if (!skipDispatch) {\n this.asyncDispatchEvent(e);\n }\n },\n /**\n * Dispatches the event to its target.\n *\n * @param {Event} inEvent The event to be dispatched.\n * @return {Boolean} True if an event handler returns true, false otherwise.\n */\n dispatchEvent: /*scope.external.dispatchEvent || */function(inEvent) {\n var t = this.getTarget(inEvent);\n if (t) {\n return t.dispatchEvent(inEvent);\n }\n },\n asyncDispatchEvent: function(inEvent) {\n requestAnimationFrame(this.dispatchEvent.bind(this, inEvent));\n }\n };\n dispatcher.boundHandler = dispatcher.eventHandler.bind(dispatcher);\n\n var targeting = {\n shadow: function(inEl) {\n if (inEl) {\n return inEl.shadowRoot || inEl.webkitShadowRoot;\n }\n },\n canTarget: function(shadow) {\n return shadow && Boolean(shadow.elementFromPoint);\n },\n targetingShadow: function(inEl) {\n var s = this.shadow(inEl);\n if (this.canTarget(s)) {\n return s;\n }\n },\n olderShadow: function(shadow) {\n var os = shadow.olderShadowRoot;\n if (!os) {\n var se = shadow.querySelector('shadow');\n if (se) {\n os = se.olderShadowRoot;\n }\n }\n return os;\n },\n allShadows: function(element) {\n var shadows = [];\n var s = this.shadow(element);\n while (s) {\n shadows.push(s);\n s = this.olderShadow(s);\n }\n return shadows;\n },\n searchRoot: function(inRoot, x, y) {\n if (inRoot) {\n var t = inRoot.elementFromPoint(x, y);\n var st, sr;\n\n // is element a shadow host?\n sr = this.targetingShadow(t);\n while (sr) {\n\n // find the the element inside the shadow root\n st = sr.elementFromPoint(x, y);\n if (!st) {\n\n // check for older shadows\n sr = this.olderShadow(sr);\n } else {\n\n // shadowed element may contain a shadow root\n var ssr = this.targetingShadow(st);\n return this.searchRoot(ssr, x, y) || st;\n }\n }\n\n // light dom element is the target\n return t;\n }\n },\n owner: function(element) {\n var s = element;\n\n // walk up until you hit the shadow root or document\n while (s.parentNode) {\n s = s.parentNode;\n }\n\n // the owner element is expected to be a Document or ShadowRoot\n if (s.nodeType !== Node.DOCUMENT_NODE && s.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {\n s = document;\n }\n return s;\n },\n findTarget: function(inEvent) {\n var x = inEvent.clientX;\n var y = inEvent.clientY;\n\n // if the listener is in the shadow root, it is much faster to start there\n var s = this.owner(inEvent.target);\n\n // if x, y is not in this root, fall back to document search\n if (!s.elementFromPoint(x, y)) {\n s = document;\n }\n return this.searchRoot(s, x, y);\n }\n };\n\n var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);\n var map = Array.prototype.map.call.bind(Array.prototype.map);\n var toArray = Array.prototype.slice.call.bind(Array.prototype.slice);\n var filter = Array.prototype.filter.call.bind(Array.prototype.filter);\n var MO = window.MutationObserver || window.WebKitMutationObserver;\n var SELECTOR = '[touch-action]';\n var OBSERVER_INIT = {\n subtree: true,\n childList: true,\n attributes: true,\n attributeOldValue: true,\n attributeFilter: ['touch-action']\n };\n\n function Installer(add, remove, changed, binder) {\n this.addCallback = add.bind(binder);\n this.removeCallback = remove.bind(binder);\n this.changedCallback = changed.bind(binder);\n if (MO) {\n this.observer = new MO(this.mutationWatcher.bind(this));\n }\n }\n\n Installer.prototype = {\n watchSubtree: function(target) {\n\n // Only watch scopes that can target find, as these are top-level.\n // Otherwise we can see duplicate additions and removals that add noise.\n //\n // TODO(dfreedman): For some instances with ShadowDOMPolyfill, we can see\n // a removal without an insertion when a node is redistributed among\n // shadows. Since it all ends up correct in the document, watching only\n // the document will yield the correct mutations to watch.\n if (this.observer && targeting.canTarget(target)) {\n this.observer.observe(target, OBSERVER_INIT);\n }\n },\n enableOnSubtree: function(target) {\n this.watchSubtree(target);\n if (target === document && document.readyState !== 'complete') {\n this.installOnLoad();\n } else {\n this.installNewSubtree(target);\n }\n },\n installNewSubtree: function(target) {\n forEach(this.findElements(target), this.addElement, this);\n },\n findElements: function(target) {\n if (target.querySelectorAll) {\n return target.querySelectorAll(SELECTOR);\n }\n return [];\n },\n removeElement: function(el) {\n this.removeCallback(el);\n },\n addElement: function(el) {\n this.addCallback(el);\n },\n elementChanged: function(el, oldValue) {\n this.changedCallback(el, oldValue);\n },\n concatLists: function(accum, list) {\n return accum.concat(toArray(list));\n },\n\n // register all touch-action = none nodes on document load\n installOnLoad: function() {\n document.addEventListener('readystatechange', function() {\n if (document.readyState === 'complete') {\n this.installNewSubtree(document);\n }\n }.bind(this));\n },\n isElement: function(n) {\n return n.nodeType === Node.ELEMENT_NODE;\n },\n flattenMutationTree: function(inNodes) {\n\n // find children with touch-action\n var tree = map(inNodes, this.findElements, this);\n\n // make sure the added nodes are accounted for\n tree.push(filter(inNodes, this.isElement));\n\n // flatten the list\n return tree.reduce(this.concatLists, []);\n },\n mutationWatcher: function(mutations) {\n mutations.forEach(this.mutationHandler, this);\n },\n mutationHandler: function(m) {\n if (m.type === 'childList') {\n var added = this.flattenMutationTree(m.addedNodes);\n added.forEach(this.addElement, this);\n var removed = this.flattenMutationTree(m.removedNodes);\n removed.forEach(this.removeElement, this);\n } else if (m.type === 'attributes') {\n this.elementChanged(m.target, m.oldValue);\n }\n }\n };\n\n function shadowSelector(s) {\n return 'body /shadow-deep/ ' + s;\n }\n function rule(v) {\n return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; }';\n }\n var attrib2css = [\n { selector: '[touch-action=\"none\"]', value: 'none' },\n { selector: '[touch-action=\"auto\"]', value: 'auto' },\n { selector: '[touch-action~=\"pan-x\"]', value: 'pan-x' },\n { selector: '[touch-action~=\"pan-y\"]', value: 'pan-y' },\n { selector: '[touch-action~=\"pan-up\"]', value: 'pan-up' },\n { selector: '[touch-action~=\"pan-down\"]', value: 'pan-down' },\n { selector: '[touch-action~=\"pan-left\"]', value: 'pan-left' },\n { selector: '[touch-action~=\"pan-right\"]', value: 'pan-right' }\n ];\n var styles = '';\n\n // only install stylesheet if the browser has touch action support\n var hasNativePE = window.PointerEvent || window.MSPointerEvent;\n\n // only add shadow selectors if shadowdom is supported\n var hasShadowRoot = !window.ShadowDOMPolyfill && document.head.createShadowRoot;\n\n function applyAttributeStyles() {\n if (hasNativePE) {\n attrib2css.forEach(function(r) {\n styles += r.selector + rule(r.value) + '\\n';\n if (hasShadowRoot) {\n styles += shadowSelector(r.selector) + rule(r.value) + '\\n';\n }\n });\n\n var el = document.createElement('style');\n el.textContent = styles;\n document.head.appendChild(el);\n }\n }\n\n var pointermap = dispatcher.pointermap;\n\n // radius around touchend that swallows mouse events\n var DEDUP_DIST = 25;\n\n // left, middle, right, back, forward\n var BUTTON_TO_BUTTONS = [1, 4, 2, 8, 16];\n\n var HAS_BUTTONS = false;\n try {\n HAS_BUTTONS = new MouseEvent('test', { buttons: 1 }).buttons === 1;\n } catch (e) {}\n\n // handler block for native mouse events\n var mouseEvents = {\n POINTER_ID: 1,\n POINTER_TYPE: 'mouse',\n events: [\n 'mousedown',\n 'webkitmouseforcechanged',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout'\n ],\n register: function(target) {\n dispatcher.listen(target, this.events);\n },\n unregister: function(target) {\n dispatcher.unlisten(target, this.events);\n },\n lastTouches: [],\n\n // collide with the global mouse listener\n isEventSimulatedFromTouch: function(inEvent) {\n var lts = this.lastTouches;\n var x = inEvent.clientX;\n var y = inEvent.clientY;\n for (var i = 0, l = lts.length, t; i < l && (t = lts[i]); i++) {\n\n // simulated mouse events will be swallowed near a primary touchend\n var dx = Math.abs(x - t.x);\n var dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DIST && dy <= DEDUP_DIST) {\n return true;\n }\n }\n },\n prepareEvent: function(inEvent) {\n var e = dispatcher.cloneEvent(inEvent);\n\n // forward mouse preventDefault\n var pd = e.preventDefault;\n e.preventDefault = function() {\n inEvent.preventDefault();\n pd();\n };\n e.pointerId = this.POINTER_ID;\n e.isPrimary = true;\n e.pointerType = this.POINTER_TYPE;\n if ('webkitForce' in inEvent) {\n e.pressure = inEvent.webkitForce - MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN;\n }\n return e;\n },\n prepareButtonsForMove: function(e, inEvent) {\n var p = pointermap.get(this.POINTER_ID);\n\n // Update buttons state after possible out-of-document mouseup.\n if (inEvent.which === 0 || !p) {\n e.buttons = 0;\n } else {\n e.buttons = p.buttons;\n }\n inEvent.buttons = e.buttons;\n },\n mousedown: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var p = pointermap.get(this.POINTER_ID);\n var e = this.prepareEvent(inEvent);\n if (!HAS_BUTTONS) {\n e.buttons = BUTTON_TO_BUTTONS[e.button];\n if (p) { e.buttons |= p.buttons; }\n inEvent.buttons = e.buttons;\n }\n pointermap.set(this.POINTER_ID, inEvent);\n if (!p || p.buttons === 0) {\n dispatcher.down(e);\n } else {\n dispatcher.move(e);\n }\n }\n },\n\n // This is called when the user force presses without moving x/y\n webkitmouseforcechanged: function(inEvent) {\n this.mousemove(inEvent);\n },\n mousemove: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var e = this.prepareEvent(inEvent);\n if (!HAS_BUTTONS) { this.prepareButtonsForMove(e, inEvent); }\n e.button = -1;\n pointermap.set(this.POINTER_ID, inEvent);\n dispatcher.move(e);\n }\n },\n mouseup: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var p = pointermap.get(this.POINTER_ID);\n var e = this.prepareEvent(inEvent);\n if (!HAS_BUTTONS) {\n var up = BUTTON_TO_BUTTONS[e.button];\n\n // Produces wrong state of buttons in Browsers without `buttons` support\n // when a mouse button that was pressed outside the document is released\n // inside and other buttons are still pressed down.\n e.buttons = p ? p.buttons & ~up : 0;\n inEvent.buttons = e.buttons;\n }\n pointermap.set(this.POINTER_ID, inEvent);\n\n // Support: Firefox <=44 only\n // FF Ubuntu includes the lifted button in the `buttons` property on\n // mouseup.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1223366\n e.buttons &= ~BUTTON_TO_BUTTONS[e.button];\n if (e.buttons === 0) {\n dispatcher.up(e);\n } else {\n dispatcher.move(e);\n }\n }\n },\n mouseover: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var e = this.prepareEvent(inEvent);\n if (!HAS_BUTTONS) { this.prepareButtonsForMove(e, inEvent); }\n e.button = -1;\n pointermap.set(this.POINTER_ID, inEvent);\n dispatcher.enterOver(e);\n }\n },\n mouseout: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var e = this.prepareEvent(inEvent);\n if (!HAS_BUTTONS) { this.prepareButtonsForMove(e, inEvent); }\n e.button = -1;\n dispatcher.leaveOut(e);\n }\n },\n cancel: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.cancel(e);\n this.deactivateMouse();\n },\n deactivateMouse: function() {\n pointermap.delete(this.POINTER_ID);\n }\n };\n\n var captureInfo = dispatcher.captureInfo;\n var findTarget = targeting.findTarget.bind(targeting);\n var allShadows = targeting.allShadows.bind(targeting);\n var pointermap$1 = dispatcher.pointermap;\n\n // this should be long enough to ignore compat mouse events made by touch\n var DEDUP_TIMEOUT = 2500;\n var ATTRIB = 'touch-action';\n var INSTALLER;\n\n // bitmask for _scrollType\n var UP = 1;\n var DOWN = 2;\n var LEFT = 4;\n var RIGHT = 8;\n var AUTO = UP | DOWN | LEFT | RIGHT;\n\n // handler block for native touch events\n var touchEvents = {\n events: [\n 'touchstart',\n 'touchmove',\n 'touchforcechange',\n 'touchend',\n 'touchcancel'\n ],\n register: function(target) {\n INSTALLER.enableOnSubtree(target);\n },\n unregister: function() {\n\n // TODO(dfreedman): is it worth it to disconnect the MO?\n },\n elementAdded: function(el) {\n var a = el.getAttribute(ATTRIB);\n var st = this.touchActionToScrollType(a);\n if (typeof st === \"number\") {\n el._scrollType = st;\n dispatcher.listen(el, this.events);\n\n // set touch-action on shadows as well\n allShadows(el).forEach(function(s) {\n s._scrollType = st;\n dispatcher.listen(s, this.events);\n }, this);\n }\n },\n elementRemoved: function(el) {\n\n // In some cases, an element is removed before a touchend.\n // When this is the case, we should wait for the touchend before unlistening,\n // because we still want pointer events to bubble up after removing from DOM.\n if (pointermap$1.size > 0) {\n var evts = this.events;\n el.addEventListener('touchend', function() {\n el._scrollType = undefined;\n dispatcher.unlisten(el, evts);\n });\n } else {\n el._scrollType = undefined;\n dispatcher.unlisten(el, this.events);\n }\n\n // remove touch-action from shadow\n allShadows(el).forEach(function(s) {\n s._scrollType = undefined;\n dispatcher.unlisten(s, this.events);\n }, this);\n },\n elementChanged: function(el, oldValue) {\n var a = el.getAttribute(ATTRIB);\n var st = this.touchActionToScrollType(a);\n var oldSt = this.touchActionToScrollType(oldValue);\n\n // simply update scrollType if listeners are already established\n if (typeof st === \"number\" && typeof oldSt === \"number\") {\n el._scrollType = st;\n allShadows(el).forEach(function(s) {\n s._scrollType = st;\n }, this);\n } else if (typeof oldSt === \"number\") {\n this.elementRemoved(el);\n } else if (typeof st === \"number\") {\n this.elementAdded(el);\n }\n },\n scrollTypes: {\n UP: function(s) {\n return s.includes('pan-y') || s.includes('pan-up') ? UP : 0;\n },\n DOWN: function(s) {\n return s.includes('pan-y') || s.includes('pan-down') ? DOWN : 0;\n },\n LEFT: function(s) {\n return s.includes('pan-x') || s.includes('pan-left') ? LEFT : 0;\n },\n RIGHT: function(s) {\n return s.includes('pan-x') || s.includes('pan-right') ? RIGHT : 0;\n }\n },\n touchActionToScrollType: function(touchAction) {\n if (!touchAction) {\n return;\n }\n\n if (touchAction === \"auto\") {\n return AUTO;\n }\n\n if (touchAction === \"none\") {\n return 0;\n }\n\n var s = touchAction.split(' ');\n var st = this.scrollTypes;\n\n // construct a bitmask of allowed scroll directions\n return st.UP(s) | st.DOWN(s) | st.LEFT(s) | st.RIGHT(s);\n },\n POINTER_TYPE: 'touch',\n firstTouch: null,\n isPrimaryTouch: function(inTouch) {\n return this.firstTouch === inTouch.identifier;\n },\n setPrimaryTouch: function(inTouch) {\n\n // set primary touch if there no pointers, or the only pointer is the mouse\n if (pointermap$1.size === 0 || (pointermap$1.size === 1 && pointermap$1.has(1))) {\n this.firstTouch = inTouch.identifier;\n this.firstXY = { X: inTouch.clientX, Y: inTouch.clientY };\n this.scrolling = false;\n }\n },\n removePrimaryPointer: function(inPointer) {\n if (inPointer.isPrimary) {\n this.firstTouch = null;\n this.firstXY = null;\n }\n },\n typeToButtons: function(type) {\n var ret = 0;\n if (type === 'touchstart' || type === 'touchmove' || type === 'touchforcechange') {\n ret = 1;\n }\n return ret;\n },\n touchToPointer: function(inTouch) {\n var cte = this.currentTouchEvent;\n var e = dispatcher.cloneEvent(inTouch);\n\n // We reserve pointerId 1 for Mouse.\n // Touch identifiers can start at 0.\n // Add 2 to the touch identifier for compatibility.\n var id = e.pointerId = inTouch.identifier + 2;\n e.target = captureInfo[id] || findTarget(e);\n e.bubbles = true;\n e.cancelable = true;\n e.button = 0;\n e.buttons = this.typeToButtons(cte.type);\n e.width = (inTouch.radiusX || inTouch.webkitRadiusX || 0) * 2;\n e.height = (inTouch.radiusY || inTouch.webkitRadiusY || 0) * 2;\n e.pressure = inTouch.force !== undefined ?\n inTouch.force :\n inTouch.webkitForce !== undefined ?\n inTouch.webkitForce : undefined;\n e.isPrimary = this.isPrimaryTouch(inTouch);\n if (inTouch.altitudeAngle) {\n var tan = Math.tan(inTouch.altitudeAngle);\n var radToDeg = 180 / Math.PI;\n e.tiltX = Math.atan(Math.cos(inTouch.azimuthAngle) / tan) * radToDeg;\n e.tiltY = Math.atan(Math.sin(inTouch.azimuthAngle) / tan) * radToDeg;\n } else {\n e.tiltX = 0;\n e.tiltY = 0;\n }\n if (inTouch.touchType === 'stylus') {\n e.pointerType = 'pen';\n } else {\n e.pointerType = this.POINTER_TYPE;\n }\n\n // forward modifier keys\n e.altKey = cte.altKey;\n e.ctrlKey = cte.ctrlKey;\n e.metaKey = cte.metaKey;\n e.shiftKey = cte.shiftKey;\n\n // forward touch preventDefaults\n var self = this;\n e.preventDefault = function() {\n self.scrolling = false;\n self.firstXY = null;\n cte.preventDefault();\n };\n return e;\n },\n processTouches: function(inEvent, inFunction) {\n var tl = inEvent.changedTouches;\n this.currentTouchEvent = inEvent;\n for (var i = 0, t; i < tl.length; i++) {\n t = tl[i];\n inFunction.call(this, this.touchToPointer(t));\n }\n },\n\n // For single axis scrollers, determines whether the element should emit\n // pointer events or behave as a scroller\n shouldScroll: function(inEvent) {\n if (this.firstXY) {\n var ret;\n var st = inEvent.currentTarget._scrollType;\n if (st === 0) {\n\n // this element is a `touch-action: none`, should never scroll\n ret = false;\n } else if (st === AUTO) {\n\n // this element is a `touch-action: auto`, should always scroll\n ret = true;\n } else {\n var t = inEvent.changedTouches[0];\n\n var dy = t.clientY - this.firstXY.Y;\n var dya = Math.abs(dy);\n var dx = t.clientX - this.firstXY.X;\n var dxa = Math.abs(dx);\n\n var up = st & UP;\n var down = st & DOWN;\n var left = st & LEFT;\n var right = st & RIGHT;\n\n if (left && right) {\n\n // should scroll on the x axis\n ret = dxa > dya;\n } else if (left) {\n\n // should scroll left\n ret = dxa > dya && dx > 0;\n } else if (right) {\n\n // should scroll right\n ret = dxa > dya && dx < 0;\n }\n\n if (!ret) {\n if (up && down) {\n\n // should scroll on the y axis\n ret = dxa < dya;\n } else if (up) {\n\n // should scroll up\n ret = dxa < dya && dy > 0;\n } else if (down) {\n\n // should scroll down\n ret = dxa < dya && dy < 0;\n }\n }\n\n }\n this.firstXY = null;\n return ret;\n }\n },\n findTouch: function(inTL, inId) {\n for (var i = 0, l = inTL.length, t; i < l && (t = inTL[i]); i++) {\n if (t.identifier === inId) {\n return true;\n }\n }\n },\n\n // In some instances, a touchstart can happen without a touchend. This\n // leaves the pointermap in a broken state.\n // Therefore, on every touchstart, we remove the touches that did not fire a\n // touchend event.\n // To keep state globally consistent, we fire a\n // pointercancel for this \"abandoned\" touch\n vacuumTouches: function(inEvent) {\n var tl = inEvent.touches;\n\n // pointermap.size should be < tl.length here, as the touchstart has not\n // been processed yet.\n if (pointermap$1.size >= tl.length) {\n var d = [];\n pointermap$1.forEach(function(value, key) {\n\n // Never remove pointerId == 1, which is mouse.\n // Touch identifiers are 2 smaller than their pointerId, which is the\n // index in pointermap.\n if (key !== 1 && !this.findTouch(tl, key - 2)) {\n var p = value.out;\n d.push(p);\n }\n }, this);\n d.forEach(this.cancelOut, this);\n }\n },\n touchstart: function(inEvent) {\n this.vacuumTouches(inEvent);\n this.setPrimaryTouch(inEvent.changedTouches[0]);\n this.dedupSynthMouse(inEvent);\n if (!this.scrolling) {\n this.processTouches(inEvent, this.overDown);\n }\n },\n overDown: function(inPointer) {\n pointermap$1.set(inPointer.pointerId, {\n target: inPointer.target,\n out: inPointer,\n outTarget: inPointer.target\n });\n dispatcher.enterOver(inPointer);\n dispatcher.down(inPointer);\n },\n\n // Called when pressure or tilt changes without the x/y changing\n touchforcechange: function(inEvent) {\n this.touchmove(inEvent);\n },\n touchmove: function(inEvent) {\n if (!this.scrolling) {\n if (this.shouldScroll(inEvent)) {\n this.scrolling = true;\n this.touchcancel(inEvent);\n } else {\n if (inEvent.type !== 'touchforcechange') {\n inEvent.preventDefault();\n }\n this.processTouches(inEvent, this.moveOverOut);\n }\n }\n },\n moveOverOut: function(inPointer) {\n var event = inPointer;\n var pointer = pointermap$1.get(event.pointerId);\n\n // a finger drifted off the screen, ignore it\n if (!pointer) {\n return;\n }\n var outEvent = pointer.out;\n var outTarget = pointer.outTarget;\n dispatcher.move(event);\n if (outEvent && outTarget !== event.target) {\n outEvent.relatedTarget = event.target;\n event.relatedTarget = outTarget;\n\n // recover from retargeting by shadow\n outEvent.target = outTarget;\n if (event.target) {\n dispatcher.leaveOut(outEvent);\n dispatcher.enterOver(event);\n } else {\n\n // clean up case when finger leaves the screen\n event.target = outTarget;\n event.relatedTarget = null;\n this.cancelOut(event);\n }\n }\n pointer.out = event;\n pointer.outTarget = event.target;\n },\n touchend: function(inEvent) {\n this.dedupSynthMouse(inEvent);\n this.processTouches(inEvent, this.upOut);\n },\n upOut: function(inPointer) {\n if (!this.scrolling) {\n dispatcher.up(inPointer);\n dispatcher.leaveOut(inPointer);\n }\n this.cleanUpPointer(inPointer);\n },\n touchcancel: function(inEvent) {\n this.processTouches(inEvent, this.cancelOut);\n },\n cancelOut: function(inPointer) {\n dispatcher.cancel(inPointer);\n dispatcher.leaveOut(inPointer);\n this.cleanUpPointer(inPointer);\n },\n cleanUpPointer: function(inPointer) {\n pointermap$1.delete(inPointer.pointerId);\n this.removePrimaryPointer(inPointer);\n },\n\n // prevent synth mouse events from creating pointer events\n dedupSynthMouse: function(inEvent) {\n var lts = mouseEvents.lastTouches;\n var t = inEvent.changedTouches[0];\n\n // only the primary finger will synth mouse events\n if (this.isPrimaryTouch(t)) {\n\n // remember x/y of last touch\n var lt = { x: t.clientX, y: t.clientY };\n lts.push(lt);\n var fn = (function(lts, lt) {\n var i = lts.indexOf(lt);\n if (i > -1) {\n lts.splice(i, 1);\n }\n }).bind(null, lts, lt);\n setTimeout(fn, DEDUP_TIMEOUT);\n }\n }\n };\n\n INSTALLER = new Installer(touchEvents.elementAdded, touchEvents.elementRemoved,\n touchEvents.elementChanged, touchEvents);\n\n var pointermap$2 = dispatcher.pointermap;\n var HAS_BITMAP_TYPE = window.MSPointerEvent &&\n typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE === 'number';\n var msEvents = {\n events: [\n 'MSPointerDown',\n 'MSPointerMove',\n 'MSPointerUp',\n 'MSPointerOut',\n 'MSPointerOver',\n 'MSPointerCancel',\n 'MSGotPointerCapture',\n 'MSLostPointerCapture'\n ],\n register: function(target) {\n dispatcher.listen(target, this.events);\n },\n unregister: function(target) {\n dispatcher.unlisten(target, this.events);\n },\n POINTER_TYPES: [\n '',\n 'unavailable',\n 'touch',\n 'pen',\n 'mouse'\n ],\n prepareEvent: function(inEvent) {\n var e = inEvent;\n if (HAS_BITMAP_TYPE) {\n e = dispatcher.cloneEvent(inEvent);\n e.pointerType = this.POINTER_TYPES[inEvent.pointerType];\n }\n return e;\n },\n cleanup: function(id) {\n pointermap$2.delete(id);\n },\n MSPointerDown: function(inEvent) {\n pointermap$2.set(inEvent.pointerId, inEvent);\n var e = this.prepareEvent(inEvent);\n dispatcher.down(e);\n },\n MSPointerMove: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.move(e);\n },\n MSPointerUp: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.up(e);\n this.cleanup(inEvent.pointerId);\n },\n MSPointerOut: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.leaveOut(e);\n },\n MSPointerOver: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.enterOver(e);\n },\n MSPointerCancel: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.cancel(e);\n this.cleanup(inEvent.pointerId);\n },\n MSLostPointerCapture: function(inEvent) {\n var e = dispatcher.makeEvent('lostpointercapture', inEvent);\n dispatcher.dispatchEvent(e);\n },\n MSGotPointerCapture: function(inEvent) {\n var e = dispatcher.makeEvent('gotpointercapture', inEvent);\n dispatcher.dispatchEvent(e);\n }\n };\n\n function applyPolyfill() {\n\n // only activate if this platform does not have pointer events\n if (!window.PointerEvent) {\n window.PointerEvent = PointerEvent;\n\n if (window.navigator.msPointerEnabled) {\n var tp = window.navigator.msMaxTouchPoints;\n Object.defineProperty(window.navigator, 'maxTouchPoints', {\n value: tp,\n enumerable: true\n });\n dispatcher.registerSource('ms', msEvents);\n } else {\n Object.defineProperty(window.navigator, 'maxTouchPoints', {\n value: 0,\n enumerable: true\n });\n dispatcher.registerSource('mouse', mouseEvents);\n if (window.ontouchstart !== undefined) {\n dispatcher.registerSource('touch', touchEvents);\n }\n }\n\n dispatcher.register(document);\n }\n }\n\n var n = window.navigator;\n var s;\n var r;\n var h;\n function assertActive(id) {\n if (!dispatcher.pointermap.has(id)) {\n var error = new Error('NotFoundError');\n error.name = 'NotFoundError';\n throw error;\n }\n }\n function assertConnected(elem) {\n var parent = elem.parentNode;\n while (parent && parent !== elem.ownerDocument) {\n parent = parent.parentNode;\n }\n if (!parent) {\n var error = new Error('InvalidStateError');\n error.name = 'InvalidStateError';\n throw error;\n }\n }\n function inActiveButtonState(id) {\n var p = dispatcher.pointermap.get(id);\n return p.buttons !== 0;\n }\n if (n.msPointerEnabled) {\n s = function(pointerId) {\n assertActive(pointerId);\n assertConnected(this);\n if (inActiveButtonState(pointerId)) {\n dispatcher.setCapture(pointerId, this, true);\n this.msSetPointerCapture(pointerId);\n }\n };\n r = function(pointerId) {\n assertActive(pointerId);\n dispatcher.releaseCapture(pointerId, true);\n this.msReleasePointerCapture(pointerId);\n };\n } else {\n s = function setPointerCapture(pointerId) {\n assertActive(pointerId);\n assertConnected(this);\n if (inActiveButtonState(pointerId)) {\n dispatcher.setCapture(pointerId, this);\n }\n };\n r = function releasePointerCapture(pointerId) {\n assertActive(pointerId);\n dispatcher.releaseCapture(pointerId);\n };\n }\n h = function hasPointerCapture(pointerId) {\n return !!dispatcher.captureInfo[pointerId];\n };\n\n function applyPolyfill$1() {\n if (window.Element && !Element.prototype.setPointerCapture) {\n Object.defineProperties(Element.prototype, {\n 'setPointerCapture': {\n value: s\n },\n 'releasePointerCapture': {\n value: r\n },\n 'hasPointerCapture': {\n value: h\n }\n });\n }\n }\n\n applyAttributeStyles();\n applyPolyfill();\n applyPolyfill$1();\n\n var pointerevents = {\n dispatcher: dispatcher,\n Installer: Installer,\n PointerEvent: PointerEvent,\n PointerMap: PointerMap,\n targetFinding: targeting\n };\n\n return pointerevents;\n\n}));","'use strict';\n\nmodule.exports = Pbf;\n\nvar ieee754 = require('ieee754');\n\nfunction Pbf(buf) {\n this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);\n this.pos = 0;\n this.type = 0;\n this.length = this.buf.length;\n}\n\nPbf.Varint = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum\nPbf.Fixed64 = 1; // 64-bit: double, fixed64, sfixed64\nPbf.Bytes = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields\nPbf.Fixed32 = 5; // 32-bit: float, fixed32, sfixed32\n\nvar SHIFT_LEFT_32 = (1 << 16) * (1 << 16),\n SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;\n\n// Threshold chosen based on both benchmarking and knowledge about browser string\n// data structures (which currently switch structure types at 12 bytes or more)\nvar TEXT_DECODER_MIN_LENGTH = 12;\nvar utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf8');\n\nPbf.prototype = {\n\n destroy: function() {\n this.buf = null;\n },\n\n // === READING =================================================================\n\n readFields: function(readField, result, end) {\n end = end || this.length;\n\n while (this.pos < end) {\n var val = this.readVarint(),\n tag = val >> 3,\n startPos = this.pos;\n\n this.type = val & 0x7;\n readField(tag, result, this);\n\n if (this.pos === startPos) this.skip(val);\n }\n return result;\n },\n\n readMessage: function(readField, result) {\n return this.readFields(readField, result, this.readVarint() + this.pos);\n },\n\n readFixed32: function() {\n var val = readUInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n },\n\n readSFixed32: function() {\n var val = readInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n },\n\n // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)\n\n readFixed64: function() {\n var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;\n this.pos += 8;\n return val;\n },\n\n readSFixed64: function() {\n var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;\n this.pos += 8;\n return val;\n },\n\n readFloat: function() {\n var val = ieee754.read(this.buf, this.pos, true, 23, 4);\n this.pos += 4;\n return val;\n },\n\n readDouble: function() {\n var val = ieee754.read(this.buf, this.pos, true, 52, 8);\n this.pos += 8;\n return val;\n },\n\n readVarint: function(isSigned) {\n var buf = this.buf,\n val, b;\n\n b = buf[this.pos++]; val = b & 0x7f; if (b < 0x80) return val;\n b = buf[this.pos++]; val |= (b & 0x7f) << 7; if (b < 0x80) return val;\n b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;\n b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;\n b = buf[this.pos]; val |= (b & 0x0f) << 28;\n\n return readVarintRemainder(val, isSigned, this);\n },\n\n readVarint64: function() { // for compatibility with v2.0.1\n return this.readVarint(true);\n },\n\n readSVarint: function() {\n var num = this.readVarint();\n return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n },\n\n readBoolean: function() {\n return Boolean(this.readVarint());\n },\n\n readString: function() {\n var end = this.readVarint() + this.pos;\n var pos = this.pos;\n this.pos = end;\n\n if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {\n // longer strings are fast with the built-in browser TextDecoder API\n return readUtf8TextDecoder(this.buf, pos, end);\n }\n // short strings are fast with our custom implementation\n return readUtf8(this.buf, pos, end);\n },\n\n readBytes: function() {\n var end = this.readVarint() + this.pos,\n buffer = this.buf.subarray(this.pos, end);\n this.pos = end;\n return buffer;\n },\n\n // verbose for performance reasons; doesn't affect gzipped size\n\n readPackedVarint: function(arr, isSigned) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readVarint(isSigned));\n return arr;\n },\n readPackedSVarint: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readSVarint());\n return arr;\n },\n readPackedBoolean: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readBoolean());\n return arr;\n },\n readPackedFloat: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readFloat());\n return arr;\n },\n readPackedDouble: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readDouble());\n return arr;\n },\n readPackedFixed32: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readFixed32());\n return arr;\n },\n readPackedSFixed32: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readSFixed32());\n return arr;\n },\n readPackedFixed64: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readFixed64());\n return arr;\n },\n readPackedSFixed64: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readSFixed64());\n return arr;\n },\n\n skip: function(val) {\n var type = val & 0x7;\n if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {}\n else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;\n else if (type === Pbf.Fixed32) this.pos += 4;\n else if (type === Pbf.Fixed64) this.pos += 8;\n else throw new Error('Unimplemented type: ' + type);\n },\n\n // === WRITING =================================================================\n\n writeTag: function(tag, type) {\n this.writeVarint((tag << 3) | type);\n },\n\n realloc: function(min) {\n var length = this.length || 16;\n\n while (length < this.pos + min) length *= 2;\n\n if (length !== this.length) {\n var buf = new Uint8Array(length);\n buf.set(this.buf);\n this.buf = buf;\n this.length = length;\n }\n },\n\n finish: function() {\n this.length = this.pos;\n this.pos = 0;\n return this.buf.subarray(0, this.length);\n },\n\n writeFixed32: function(val) {\n this.realloc(4);\n writeInt32(this.buf, val, this.pos);\n this.pos += 4;\n },\n\n writeSFixed32: function(val) {\n this.realloc(4);\n writeInt32(this.buf, val, this.pos);\n this.pos += 4;\n },\n\n writeFixed64: function(val) {\n this.realloc(8);\n writeInt32(this.buf, val & -1, this.pos);\n writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);\n this.pos += 8;\n },\n\n writeSFixed64: function(val) {\n this.realloc(8);\n writeInt32(this.buf, val & -1, this.pos);\n writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);\n this.pos += 8;\n },\n\n writeVarint: function(val) {\n val = +val || 0;\n\n if (val > 0xfffffff || val < 0) {\n writeBigVarint(val, this);\n return;\n }\n\n this.realloc(4);\n\n this.buf[this.pos++] = val & 0x7f | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n this.buf[this.pos++] = (val >>> 7) & 0x7f;\n },\n\n writeSVarint: function(val) {\n this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);\n },\n\n writeBoolean: function(val) {\n this.writeVarint(Boolean(val));\n },\n\n writeString: function(str) {\n str = String(str);\n this.realloc(str.length * 4);\n\n this.pos++; // reserve 1 byte for short string length\n\n var startPos = this.pos;\n // write the string directly to the buffer and see how much was written\n this.pos = writeUtf8(this.buf, str, this.pos);\n var len = this.pos - startPos;\n\n if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n // finally, write the message length in the reserved place and restore the position\n this.pos = startPos - 1;\n this.writeVarint(len);\n this.pos += len;\n },\n\n writeFloat: function(val) {\n this.realloc(4);\n ieee754.write(this.buf, val, this.pos, true, 23, 4);\n this.pos += 4;\n },\n\n writeDouble: function(val) {\n this.realloc(8);\n ieee754.write(this.buf, val, this.pos, true, 52, 8);\n this.pos += 8;\n },\n\n writeBytes: function(buffer) {\n var len = buffer.length;\n this.writeVarint(len);\n this.realloc(len);\n for (var i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];\n },\n\n writeRawMessage: function(fn, obj) {\n this.pos++; // reserve 1 byte for short message length\n\n // write the message directly to the buffer and see how much was written\n var startPos = this.pos;\n fn(obj, this);\n var len = this.pos - startPos;\n\n if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n // finally, write the message length in the reserved place and restore the position\n this.pos = startPos - 1;\n this.writeVarint(len);\n this.pos += len;\n },\n\n writeMessage: function(tag, fn, obj) {\n this.writeTag(tag, Pbf.Bytes);\n this.writeRawMessage(fn, obj);\n },\n\n writePackedVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedVarint, arr); },\n writePackedSVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSVarint, arr); },\n writePackedBoolean: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedBoolean, arr); },\n writePackedFloat: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFloat, arr); },\n writePackedDouble: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedDouble, arr); },\n writePackedFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed32, arr); },\n writePackedSFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr); },\n writePackedFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed64, arr); },\n writePackedSFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr); },\n\n writeBytesField: function(tag, buffer) {\n this.writeTag(tag, Pbf.Bytes);\n this.writeBytes(buffer);\n },\n writeFixed32Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed32);\n this.writeFixed32(val);\n },\n writeSFixed32Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed32);\n this.writeSFixed32(val);\n },\n writeFixed64Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed64);\n this.writeFixed64(val);\n },\n writeSFixed64Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed64);\n this.writeSFixed64(val);\n },\n writeVarintField: function(tag, val) {\n this.writeTag(tag, Pbf.Varint);\n this.writeVarint(val);\n },\n writeSVarintField: function(tag, val) {\n this.writeTag(tag, Pbf.Varint);\n this.writeSVarint(val);\n },\n writeStringField: function(tag, str) {\n this.writeTag(tag, Pbf.Bytes);\n this.writeString(str);\n },\n writeFloatField: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed32);\n this.writeFloat(val);\n },\n writeDoubleField: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed64);\n this.writeDouble(val);\n },\n writeBooleanField: function(tag, val) {\n this.writeVarintField(tag, Boolean(val));\n }\n};\n\nfunction readVarintRemainder(l, s, p) {\n var buf = p.buf,\n h, b;\n\n b = buf[p.pos++]; h = (b & 0x70) >> 4; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 3; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);\n\n throw new Error('Expected varint not more than 10 bytes');\n}\n\nfunction readPackedEnd(pbf) {\n return pbf.type === Pbf.Bytes ?\n pbf.readVarint() + pbf.pos : pbf.pos + 1;\n}\n\nfunction toNum(low, high, isSigned) {\n if (isSigned) {\n return high * 0x100000000 + (low >>> 0);\n }\n\n return ((high >>> 0) * 0x100000000) + (low >>> 0);\n}\n\nfunction writeBigVarint(val, pbf) {\n var low, high;\n\n if (val >= 0) {\n low = (val % 0x100000000) | 0;\n high = (val / 0x100000000) | 0;\n } else {\n low = ~(-val % 0x100000000);\n high = ~(-val / 0x100000000);\n\n if (low ^ 0xffffffff) {\n low = (low + 1) | 0;\n } else {\n low = 0;\n high = (high + 1) | 0;\n }\n }\n\n if (val >= 0x10000000000000000 || val < -0x10000000000000000) {\n throw new Error('Given varint doesn\\'t fit into 10 bytes');\n }\n\n pbf.realloc(10);\n\n writeBigVarintLow(low, high, pbf);\n writeBigVarintHigh(high, pbf);\n}\n\nfunction writeBigVarintLow(low, high, pbf) {\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos] = low & 0x7f;\n}\n\nfunction writeBigVarintHigh(high, pbf) {\n var lsb = (high & 0x07) << 4;\n\n pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f;\n}\n\nfunction makeRoomForExtraLength(startPos, len, pbf) {\n var extraLen =\n len <= 0x3fff ? 1 :\n len <= 0x1fffff ? 2 :\n len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));\n\n // if 1 byte isn't enough for encoding message length, shift the data to the right\n pbf.realloc(extraLen);\n for (var i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];\n}\n\nfunction writePackedVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]); }\nfunction writePackedSVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]); }\nfunction writePackedFloat(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]); }\nfunction writePackedDouble(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]); }\nfunction writePackedBoolean(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]); }\nfunction writePackedFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]); }\nfunction writePackedSFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]); }\nfunction writePackedFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]); }\nfunction writePackedSFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]); }\n\n// Buffer code below from https://github.com/feross/buffer, MIT-licensed\n\nfunction readUInt32(buf, pos) {\n return ((buf[pos]) |\n (buf[pos + 1] << 8) |\n (buf[pos + 2] << 16)) +\n (buf[pos + 3] * 0x1000000);\n}\n\nfunction writeInt32(buf, val, pos) {\n buf[pos] = val;\n buf[pos + 1] = (val >>> 8);\n buf[pos + 2] = (val >>> 16);\n buf[pos + 3] = (val >>> 24);\n}\n\nfunction readInt32(buf, pos) {\n return ((buf[pos]) |\n (buf[pos + 1] << 8) |\n (buf[pos + 2] << 16)) +\n (buf[pos + 3] << 24);\n}\n\nfunction readUtf8(buf, pos, end) {\n var str = '';\n var i = pos;\n\n while (i < end) {\n var b0 = buf[i];\n var c = null; // codepoint\n var bytesPerSequence =\n b0 > 0xEF ? 4 :\n b0 > 0xDF ? 3 :\n b0 > 0xBF ? 2 : 1;\n\n if (i + bytesPerSequence > end) break;\n\n var b1, b2, b3;\n\n if (bytesPerSequence === 1) {\n if (b0 < 0x80) {\n c = b0;\n }\n } else if (bytesPerSequence === 2) {\n b1 = buf[i + 1];\n if ((b1 & 0xC0) === 0x80) {\n c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);\n if (c <= 0x7F) {\n c = null;\n }\n }\n } else if (bytesPerSequence === 3) {\n b1 = buf[i + 1];\n b2 = buf[i + 2];\n if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {\n c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);\n if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {\n c = null;\n }\n }\n } else if (bytesPerSequence === 4) {\n b1 = buf[i + 1];\n b2 = buf[i + 2];\n b3 = buf[i + 3];\n if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);\n if (c <= 0xFFFF || c >= 0x110000) {\n c = null;\n }\n }\n }\n\n if (c === null) {\n c = 0xFFFD;\n bytesPerSequence = 1;\n\n } else if (c > 0xFFFF) {\n c -= 0x10000;\n str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);\n c = 0xDC00 | c & 0x3FF;\n }\n\n str += String.fromCharCode(c);\n i += bytesPerSequence;\n }\n\n return str;\n}\n\nfunction readUtf8TextDecoder(buf, pos, end) {\n return utf8TextDecoder.decode(buf.subarray(pos, end));\n}\n\nfunction writeUtf8(buf, str, pos) {\n for (var i = 0, c, lead; i < str.length; i++) {\n c = str.charCodeAt(i); // code point\n\n if (c > 0xD7FF && c < 0xE000) {\n if (lead) {\n if (c < 0xDC00) {\n buf[pos++] = 0xEF;\n buf[pos++] = 0xBF;\n buf[pos++] = 0xBD;\n lead = c;\n continue;\n } else {\n c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;\n lead = null;\n }\n } else {\n if (c > 0xDBFF || (i + 1 === str.length)) {\n buf[pos++] = 0xEF;\n buf[pos++] = 0xBF;\n buf[pos++] = 0xBD;\n } else {\n lead = c;\n }\n continue;\n }\n } else if (lead) {\n buf[pos++] = 0xEF;\n buf[pos++] = 0xBF;\n buf[pos++] = 0xBD;\n lead = null;\n }\n\n if (c < 0x80) {\n buf[pos++] = c;\n } else {\n if (c < 0x800) {\n buf[pos++] = c >> 0x6 | 0xC0;\n } else {\n if (c < 0x10000) {\n buf[pos++] = c >> 0xC | 0xE0;\n } else {\n buf[pos++] = c >> 0x12 | 0xF0;\n buf[pos++] = c >> 0xC & 0x3F | 0x80;\n }\n buf[pos++] = c >> 0x6 & 0x3F | 0x80;\n }\n buf[pos++] = c & 0x3F | 0x80;\n }\n }\n return pos;\n}\n","var Processor = require('./processor');\n\nexports.Processor = Processor;\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var newImageData = require('./util').newImageData;\n\n/**\n * Create a function for running operations. This function is serialized for\n * use in a worker.\n * @param {function(Array, Object):*} operation The operation.\n * @return {function(Object):ArrayBuffer} A function that takes an object with\n * buffers, meta, imageOps, width, and height properties and returns an array\n * buffer.\n */\nfunction createMinion(operation) {\n var workerHasImageData = true;\n try {\n new ImageData(10, 10);\n } catch (_) {\n workerHasImageData = false;\n }\n\n function newWorkerImageData(data, width, height) {\n if (workerHasImageData) {\n return new ImageData(data, width, height);\n } else {\n return {data: data, width: width, height: height};\n }\n }\n\n return function(data) {\n // bracket notation for minification support\n var buffers = data['buffers'];\n var meta = data['meta'];\n var imageOps = data['imageOps'];\n var width = data['width'];\n var height = data['height'];\n\n var numBuffers = buffers.length;\n var numBytes = buffers[0].byteLength;\n var output, b;\n\n if (imageOps) {\n var images = new Array(numBuffers);\n for (b = 0; b < numBuffers; ++b) {\n images[b] = newWorkerImageData(\n new Uint8ClampedArray(buffers[b]), width, height);\n }\n output = operation(images, meta).data;\n } else {\n output = new Uint8ClampedArray(numBytes);\n var arrays = new Array(numBuffers);\n var pixels = new Array(numBuffers);\n for (b = 0; b < numBuffers; ++b) {\n arrays[b] = new Uint8ClampedArray(buffers[b]);\n pixels[b] = [0, 0, 0, 0];\n }\n for (var i = 0; i < numBytes; i += 4) {\n for (var j = 0; j < numBuffers; ++j) {\n var array = arrays[j];\n pixels[j][0] = array[i];\n pixels[j][1] = array[i + 1];\n pixels[j][2] = array[i + 2];\n pixels[j][3] = array[i + 3];\n }\n var pixel = operation(pixels, meta);\n output[i] = pixel[0];\n output[i + 1] = pixel[1];\n output[i + 2] = pixel[2];\n output[i + 3] = pixel[3];\n }\n }\n return output.buffer;\n };\n}\n\n/**\n * Create a worker for running operations.\n * @param {Object} config Configuration.\n * @param {function(MessageEvent)} onMessage Called with a message event.\n * @return {Worker} The worker.\n */\nfunction createWorker(config, onMessage) {\n var lib = Object.keys(config.lib || {}).map(function(name) {\n return 'var ' + name + ' = ' + config.lib[name].toString() + ';';\n });\n\n var lines = lib.concat([\n 'var __minion__ = (' + createMinion.toString() + ')(', config.operation.toString(), ');',\n 'self.addEventListener(\"message\", function(event) {',\n ' var buffer = __minion__(event.data);',\n ' self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);',\n '});'\n ]);\n\n var blob = new Blob(lines, {type: 'text/javascript'});\n var source = URL.createObjectURL(blob);\n var worker = new Worker(source);\n worker.addEventListener('message', onMessage);\n return worker;\n}\n\n/**\n * Create a faux worker for running operations.\n * @param {Object} config Configuration.\n * @param {function(MessageEvent)} onMessage Called with a message event.\n * @return {Object} The faux worker.\n */\nfunction createFauxWorker(config, onMessage) {\n var minion = createMinion(config.operation);\n return {\n postMessage: function(data) {\n setTimeout(function() {\n onMessage({'data': {'buffer': minion(data), 'meta': data['meta']}});\n }, 0);\n }\n };\n}\n\n/**\n * A processor runs pixel or image operations in workers.\n * @param {Object} config Configuration.\n */\nfunction Processor(config) {\n this._imageOps = !!config.imageOps;\n var threads;\n if (config.threads === 0) {\n threads = 0;\n } else if (this._imageOps) {\n threads = 1;\n } else {\n threads = config.threads || 1;\n }\n var workers = [];\n if (threads) {\n for (var i = 0; i < threads; ++i) {\n workers[i] = createWorker(config, this._onWorkerMessage.bind(this, i));\n }\n } else {\n workers[0] = createFauxWorker(config, this._onWorkerMessage.bind(this, 0));\n }\n this._workers = workers;\n this._queue = [];\n this._maxQueueLength = config.queue || Infinity;\n this._running = 0;\n this._dataLookup = {};\n this._job = null;\n}\n\n/**\n * Run operation on input data.\n * @param {Array.<Array|ImageData>} inputs Array of pixels or image data\n * (depending on the operation type).\n * @param {Object} meta A user data object. This is passed to all operations\n * and must be serializable.\n * @param {function(Error, ImageData, Object)} callback Called when work\n * completes. The first argument is any error. The second is the ImageData\n * generated by operations. The third is the user data object.\n */\nProcessor.prototype.process = function(inputs, meta, callback) {\n this._enqueue({\n inputs: inputs,\n meta: meta,\n callback: callback\n });\n this._dispatch();\n};\n\n/**\n * Stop responding to any completed work and destroy the processor.\n */\nProcessor.prototype.destroy = function() {\n for (var key in this) {\n this[key] = null;\n }\n this._destroyed = true;\n};\n\n/**\n * Add a job to the queue.\n * @param {Object} job The job.\n */\nProcessor.prototype._enqueue = function(job) {\n this._queue.push(job);\n while (this._queue.length > this._maxQueueLength) {\n this._queue.shift().callback(null, null);\n }\n};\n\n/**\n * Dispatch a job.\n */\nProcessor.prototype._dispatch = function() {\n if (this._running === 0 && this._queue.length > 0) {\n var job = this._job = this._queue.shift();\n var width = job.inputs[0].width;\n var height = job.inputs[0].height;\n var buffers = job.inputs.map(function(input) {\n return input.data.buffer;\n });\n var threads = this._workers.length;\n this._running = threads;\n if (threads === 1) {\n this._workers[0].postMessage({\n 'buffers': buffers,\n 'meta': job.meta,\n 'imageOps': this._imageOps,\n 'width': width,\n 'height': height\n }, buffers);\n } else {\n var length = job.inputs[0].data.length;\n var segmentLength = 4 * Math.ceil(length / 4 / threads);\n for (var i = 0; i < threads; ++i) {\n var offset = i * segmentLength;\n var slices = [];\n for (var j = 0, jj = buffers.length; j < jj; ++j) {\n slices.push(buffers[i].slice(offset, offset + segmentLength));\n }\n this._workers[i].postMessage({\n 'buffers': slices,\n 'meta': job.meta,\n 'imageOps': this._imageOps,\n 'width': width,\n 'height': height\n }, slices);\n }\n }\n }\n};\n\n/**\n * Handle messages from the worker.\n * @param {number} index The worker index.\n * @param {MessageEvent} event The message event.\n */\nProcessor.prototype._onWorkerMessage = function(index, event) {\n if (this._destroyed) {\n return;\n }\n this._dataLookup[index] = event.data;\n --this._running;\n if (this._running === 0) {\n this._resolveJob();\n }\n};\n\n/**\n * Resolve a job. If there are no more worker threads, the processor callback\n * will be called.\n */\nProcessor.prototype._resolveJob = function() {\n var job = this._job;\n var threads = this._workers.length;\n var data, meta;\n if (threads === 1) {\n data = new Uint8ClampedArray(this._dataLookup[0]['buffer']);\n meta = this._dataLookup[0]['meta'];\n } else {\n var length = job.inputs[0].data.length;\n data = new Uint8ClampedArray(length);\n meta = new Array(length);\n var segmentLength = 4 * Math.ceil(length / 4 / threads);\n for (var i = 0; i < threads; ++i) {\n var buffer = this._dataLookup[i]['buffer'];\n var offset = i * segmentLength;\n data.set(new Uint8ClampedArray(buffer), offset);\n meta[i] = this._dataLookup[i]['meta'];\n }\n }\n this._job = null;\n this._dataLookup = {};\n job.callback(null,\n newImageData(data, job.inputs[0].width, job.inputs[0].height), meta);\n this._dispatch();\n};\n\nmodule.exports = Processor;\n","var hasImageData = true;\ntry {\n new ImageData(10, 10);\n} catch (_) {\n hasImageData = false;\n}\n\nvar context = document.createElement('canvas').getContext('2d');\n\nfunction newImageData(data, width, height) {\n if (hasImageData) {\n return new ImageData(data, width, height);\n } else {\n var imageData = context.createImageData(width, height);\n imageData.data.set(data);\n return imageData;\n }\n}\n\nexports.newImageData = newImageData;\n","/**\n * @module ol/util\n */\n/**\n * @return {?} Any return.\n */\nexport function abstract() {\n return /** @type {?} */ ((function () {\n throw new Error('Unimplemented abstract method.');\n })());\n}\n/**\n * Counter for getUid.\n * @type {number}\n * @private\n */\nvar uidCounter_ = 0;\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 * OpenLayers version.\n * @type {string}\n */\nexport var VERSION = '6.1.1';\n//# sourceMappingURL=util.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/AssertionError\n */\nimport { VERSION } from './util.js';\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 */\nvar AssertionError = /** @class */ (function (_super) {\n __extends(AssertionError, _super);\n /**\n * @param {number} code Error code.\n */\n function AssertionError(code) {\n var _this = this;\n var path = VERSION === 'latest' ? VERSION : 'v' + VERSION.split('-')[0];\n var message = 'Assertion failed. See https://openlayers.org/en/' + path +\n '/doc/errors/#' + code + ' for details.';\n _this = _super.call(this, message) || this;\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 * @api\n */\n _this.code = code;\n /**\n * @type {string}\n */\n _this.name = 'AssertionError';\n // Re-assign message, see https://github.com/Rich-Harris/buble/issues/40\n _this.message = message;\n return _this;\n }\n return AssertionError;\n}(Error));\nexport default AssertionError;\n//# sourceMappingURL=AssertionError.js.map","/**\n * @module ol/CollectionEventType\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//# sourceMappingURL=CollectionEventType.js.map","/**\n * @module ol/ObjectEventType\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//# sourceMappingURL=ObjectEventType.js.map","/**\n * @module ol/obj\n */\n/**\n * Polyfill for Object.assign(). Assigns enumerable and own properties from\n * one or more source objects to a target object.\n * See https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign.\n *\n * @param {!Object} target The target object.\n * @param {...Object} var_sources The source object(s).\n * @return {!Object} The modified target object.\n */\nexport var assign = (typeof Object.assign === 'function') ? Object.assign : function (target, var_sources) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n var output = Object(target);\n for (var i = 1, ii = arguments.length; i < ii; ++i) {\n var source = arguments[i];\n if (source !== undefined && source !== null) {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n output[key] = source[key];\n }\n }\n }\n }\n return output;\n};\n/**\n * Removes all properties from an object.\n * @param {Object} object The object to clear.\n */\nexport function clear(object) {\n for (var property in object) {\n delete object[property];\n }\n}\n/**\n * Polyfill for Object.values(). Get an array of property values from an object.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values\n *\n * @param {!Object<K,V>} object The object from which to get the values.\n * @return {!Array<V>} The property values.\n * @template K,V\n */\nexport var getValues = (typeof Object.values === 'function') ? Object.values : function (object) {\n var values = [];\n for (var property in object) {\n values.push(object[property]);\n }\n return values;\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 var property;\n for (property in object) {\n return false;\n }\n return !property;\n}\n//# sourceMappingURL=obj.js.map","/**\n * @module ol/events\n */\nimport { clear } from './obj.js';\n/**\n * Key to use with {@link module:ol/Observable~Observable#unByKey}.\n * @typedef {Object} EventsKey\n * @property {ListenerFunction} listener\n * @property {import(\"./events/Target.js\").EventTargetLike} target\n * @property {string} type\n * @api\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 * 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=} opt_this Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @param {boolean=} opt_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, opt_this, opt_once) {\n if (opt_this && opt_this !== target) {\n listener = listener.bind(opt_this);\n }\n if (opt_once) {\n var originalListener_1 = listener;\n listener = function () {\n target.removeEventListener(type, listener);\n originalListener_1.apply(this, arguments);\n };\n }\n var eventsKey = {\n target: target,\n type: type,\n listener: listener\n };\n target.addEventListener(type, listener);\n return eventsKey;\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=} opt_this 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, opt_this) {\n return listen(target, type, listener, opt_this, true);\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//# sourceMappingURL=events.js.map","/**\n * @module ol/Disposable\n */\n/**\n * @classdesc\n * Objects that need to clean up after themselves.\n */\nvar Disposable = /** @class */ (function () {\n function Disposable() {\n /**\n * The object has already been disposed.\n * @type {boolean}\n * @private\n */\n this.disposed_ = false;\n }\n /**\n * Clean up.\n */\n Disposable.prototype.dispose = function () {\n if (!this.disposed_) {\n this.disposed_ = true;\n this.disposeInternal();\n }\n };\n /**\n * Extension point for disposable objects.\n * @protected\n */\n Disposable.prototype.disposeInternal = function () { };\n return Disposable;\n}());\nexport default Disposable;\n//# sourceMappingURL=Disposable.js.map","/**\n * @module ol/array\n */\n/**\n * Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.\n * https://github.com/darkskyapp/binary-search\n *\n * @param {Array<*>} haystack Items to search through.\n * @param {*} needle The item to look for.\n * @param {Function=} opt_comparator Comparator function.\n * @return {number} The index of the item if found, -1 if not.\n */\nexport function binarySearch(haystack, needle, opt_comparator) {\n var mid, cmp;\n var comparator = opt_comparator || numberSafeCompareFunction;\n var low = 0;\n var high = haystack.length;\n var found = false;\n while (low < high) {\n /* Note that \"(low + high) >>> 1\" may overflow, and results in a typecast\n * to double (which gives the wrong results). */\n mid = low + (high - low >> 1);\n cmp = +comparator(haystack[mid], needle);\n if (cmp < 0.0) { /* Too low. */\n low = mid + 1;\n }\n else { /* Key found or too high */\n high = mid;\n found = !cmp;\n }\n }\n /* Key not found. */\n return found ? low : ~low;\n}\n/**\n * Compare function for array sort that is safe for numbers.\n * @param {*} a The first object to be compared.\n * @param {*} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n * argument is less than, equal to, or greater than the second.\n */\nexport function numberSafeCompareFunction(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}\n/**\n * Whether the array contains the given object.\n * @param {Array<*>} arr The array to test for the presence of the element.\n * @param {*} obj The object for which to test.\n * @return {boolean} The object is in the array.\n */\nexport function includes(arr, obj) {\n return arr.indexOf(obj) >= 0;\n}\n/**\n * @param {Array<number>} arr Array.\n * @param {number} target Target.\n * @param {number} direction 0 means return the nearest, > 0\n * means return the largest nearest, < 0 means return the\n * smallest nearest.\n * @return {number} Index.\n */\nexport function linearFindNearest(arr, target, direction) {\n var n = arr.length;\n if (arr[0] <= target) {\n return 0;\n }\n else if (target <= arr[n - 1]) {\n return n - 1;\n }\n else {\n var i = void 0;\n if (direction > 0) {\n for (i = 1; i < n; ++i) {\n if (arr[i] < target) {\n return i - 1;\n }\n }\n }\n else if (direction < 0) {\n for (i = 1; i < n; ++i) {\n if (arr[i] <= target) {\n return i;\n }\n }\n }\n else {\n for (i = 1; i < n; ++i) {\n if (arr[i] == target) {\n return i;\n }\n else if (arr[i] < target) {\n if (arr[i - 1] - target < target - arr[i]) {\n return i - 1;\n }\n else {\n return i;\n }\n }\n }\n }\n return n - 1;\n }\n}\n/**\n * @param {Array<*>} arr Array.\n * @param {number} begin Begin index.\n * @param {number} end End index.\n */\nexport function reverseSubArray(arr, begin, end) {\n while (begin < end) {\n var tmp = arr[begin];\n arr[begin] = arr[end];\n arr[end] = tmp;\n ++begin;\n --end;\n }\n}\n/**\n * @param {Array<VALUE>} arr The array to modify.\n * @param {!Array<VALUE>|VALUE} data The elements or arrays of elements to add to arr.\n * @template VALUE\n */\nexport function extend(arr, data) {\n var extension = Array.isArray(data) ? data : [data];\n var length = extension.length;\n for (var i = 0; i < length; i++) {\n arr[arr.length] = extension[i];\n }\n}\n/**\n * @param {Array<VALUE>} arr The array to modify.\n * @param {VALUE} obj The element to remove.\n * @template VALUE\n * @return {boolean} If the element was removed.\n */\nexport function remove(arr, obj) {\n var i = arr.indexOf(obj);\n var found = i > -1;\n if (found) {\n arr.splice(i, 1);\n }\n return found;\n}\n/**\n * @param {Array<VALUE>} arr The array to search in.\n * @param {function(VALUE, number, ?) : boolean} func The function to compare.\n * @template VALUE\n * @return {VALUE|null} The element found or null.\n */\nexport function find(arr, func) {\n var length = arr.length >>> 0;\n var value;\n for (var i = 0; i < length; i++) {\n value = arr[i];\n if (func(value, i, arr)) {\n return value;\n }\n }\n return null;\n}\n/**\n * @param {Array|Uint8ClampedArray} arr1 The first array to compare.\n * @param {Array|Uint8ClampedArray} arr2 The second array to compare.\n * @return {boolean} Whether the two arrays are equal.\n */\nexport function equals(arr1, arr2) {\n var len1 = arr1.length;\n if (len1 !== arr2.length) {\n return false;\n }\n for (var i = 0; i < len1; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Sort the passed array such that the relative order of equal elements is preverved.\n * See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.\n * @param {Array<*>} arr The array to sort (modifies original).\n * @param {!function(*, *): number} compareFnc Comparison function.\n * @api\n */\nexport function stableSort(arr, compareFnc) {\n var length = arr.length;\n var tmp = Array(arr.length);\n var i;\n for (i = 0; i < length; i++) {\n tmp[i] = { index: i, value: arr[i] };\n }\n tmp.sort(function (a, b) {\n return compareFnc(a.value, b.value) || a.index - b.index;\n });\n for (i = 0; i < arr.length; i++) {\n arr[i] = tmp[i].value;\n }\n}\n/**\n * @param {Array<*>} arr The array to search in.\n * @param {Function} func Comparison function.\n * @return {number} Return index.\n */\nexport function findIndex(arr, func) {\n var index;\n var found = !arr.every(function (el, idx) {\n index = idx;\n return !func(el, idx, arr);\n });\n return found ? index : -1;\n}\n/**\n * @param {Array<*>} arr The array to test.\n * @param {Function=} opt_func Comparison function.\n * @param {boolean=} opt_strict Strictly sorted (default false).\n * @return {boolean} Return index.\n */\nexport function isSorted(arr, opt_func, opt_strict) {\n var compare = opt_func || numberSafeCompareFunction;\n return arr.every(function (currentVal, index) {\n if (index === 0) {\n return true;\n }\n var res = compare(arr[index - 1], currentVal);\n return !(res > 0 || opt_strict && res === 0);\n });\n}\n//# sourceMappingURL=array.js.map","/**\n * @module ol/functions\n */\nimport { equals as arrayEquals } from './array.js';\n/**\n * Always returns true.\n * @returns {boolean} true.\n */\nexport function TRUE() {\n return true;\n}\n/**\n * Always returns false.\n * @returns {boolean} false.\n */\nexport function FALSE() {\n return false;\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 * 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 var called = false;\n /** @type {ReturnType} */\n var lastResult;\n /** @type {Array<any>} */\n var lastArgs;\n var lastThis;\n return function () {\n var 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//# sourceMappingURL=functions.js.map","/**\n * @module ol/events/Event\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 */\nvar BaseEvent = /** @class */ (function () {\n /**\n * @param {string} type Type.\n */\n function BaseEvent(type) {\n /**\n * @type {boolean}\n */\n this.propagationStopped;\n /**\n * The event type.\n * @type {string}\n * @api\n */\n this.type = type;\n /**\n * The event target.\n * @type {Object}\n * @api\n */\n this.target = null;\n }\n /**\n * Stop event propagation.\n * @api\n */\n BaseEvent.prototype.preventDefault = function () {\n this.propagationStopped = true;\n };\n /**\n * Stop event propagation.\n * @api\n */\n BaseEvent.prototype.stopPropagation = function () {\n this.propagationStopped = true;\n };\n return BaseEvent;\n}());\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function stopPropagation(evt) {\n evt.stopPropagation();\n}\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function preventDefault(evt) {\n evt.preventDefault();\n}\nexport default BaseEvent;\n//# sourceMappingURL=Event.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/events/Target\n */\nimport Disposable from '../Disposable.js';\nimport { VOID } from '../functions.js';\nimport Event from './Event.js';\nimport { clear } from '../obj.js';\n/**\n * @typedef {EventTarget|Target} EventTargetLike\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 */\nvar Target = /** @class */ (function (_super) {\n __extends(Target, _super);\n /**\n * @param {*=} opt_target Default event target for dispatched events.\n */\n function Target(opt_target) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {*}\n */\n _this.eventTarget_ = opt_target;\n /**\n * @private\n * @type {!Object<string, number>}\n */\n _this.pendingRemovals_ = {};\n /**\n * @private\n * @type {!Object<string, number>}\n */\n _this.dispatching_ = {};\n /**\n * @private\n * @type {!Object<string, Array<import(\"../events.js\").ListenerFunction>>}\n */\n _this.listeners_ = {};\n return _this;\n }\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").ListenerFunction} listener Listener.\n */\n Target.prototype.addEventListener = function (type, listener) {\n if (!type || !listener) {\n return;\n }\n var listeners = this.listeners_[type];\n if (!listeners) {\n listeners = [];\n this.listeners_[type] = listeners;\n }\n if (listeners.indexOf(listener) === -1) {\n listeners.push(listener);\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 {{type: string,\n * target: (EventTargetLike|undefined),\n * propagationStopped: (boolean|undefined)}|\n * 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 Target.prototype.dispatchEvent = function (event) {\n var evt = typeof event === 'string' ? new Event(event) : event;\n var type = evt.type;\n if (!evt.target) {\n evt.target = this.eventTarget_ || this;\n }\n var listeners = this.listeners_[type];\n var propagate;\n if (listeners) {\n if (!(type in this.dispatching_)) {\n this.dispatching_[type] = 0;\n this.pendingRemovals_[type] = 0;\n }\n ++this.dispatching_[type];\n for (var i = 0, ii = listeners.length; i < ii; ++i) {\n if (listeners[i].call(this, evt) === false || evt.propagationStopped) {\n propagate = false;\n break;\n }\n }\n --this.dispatching_[type];\n if (this.dispatching_[type] === 0) {\n var pendingRemovals = this.pendingRemovals_[type];\n delete this.pendingRemovals_[type];\n while (pendingRemovals--) {\n this.removeEventListener(type, VOID);\n }\n delete this.dispatching_[type];\n }\n return propagate;\n }\n };\n /**\n * @inheritDoc\n */\n Target.prototype.disposeInternal = function () {\n clear(this.listeners_);\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\").ListenerFunction>} Listeners.\n */\n Target.prototype.getListeners = function (type) {\n return this.listeners_[type];\n };\n /**\n * @param {string=} opt_type Type. If not provided,\n * `true` will be returned if this event target has any listeners.\n * @return {boolean} Has listeners.\n */\n Target.prototype.hasListener = function (opt_type) {\n return opt_type ?\n opt_type in this.listeners_ :\n Object.keys(this.listeners_).length > 0;\n };\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").ListenerFunction} listener Listener.\n */\n Target.prototype.removeEventListener = function (type, listener) {\n var listeners = this.listeners_[type];\n if (listeners) {\n var index = listeners.indexOf(listener);\n if (index !== -1) {\n if (type in this.pendingRemovals_) {\n // make listener a no-op, and remove later in #dispatchEvent()\n listeners[index] = VOID;\n ++this.pendingRemovals_[type];\n }\n else {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n delete this.listeners_[type];\n }\n }\n }\n }\n };\n return Target;\n}(Disposable));\nexport default Target;\n//# sourceMappingURL=Target.js.map","/**\n * @module ol/events/EventType\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 * Generic error event. Triggered when an error occurs.\n * @event module:ol/events/Event~BaseEvent#error\n * @api\n */\n ERROR: 'error',\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 WHEEL: 'wheel'\n};\n//# sourceMappingURL=EventType.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Observable\n */\nimport { listen, unlistenByKey, listenOnce } from './events.js';\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\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 */\nvar Observable = /** @class */ (function (_super) {\n __extends(Observable, _super);\n function Observable() {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {number}\n */\n _this.revision_ = 0;\n return _this;\n }\n /**\n * Increases the revision counter and dispatches a 'change' event.\n * @api\n */\n Observable.prototype.changed = function () {\n ++this.revision_;\n this.dispatchEvent(EventType.CHANGE);\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 Observable.prototype.getRevision = function () {\n return this.revision_;\n };\n /**\n * Listen for a certain type of event.\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function(?): ?} 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 */\n Observable.prototype.on = function (type, listener) {\n if (Array.isArray(type)) {\n var len = type.length;\n var keys = new Array(len);\n for (var i = 0; i < len; ++i) {\n keys[i] = listen(this, type[i], listener);\n }\n return keys;\n }\n else {\n return listen(this, /** @type {string} */ (type), listener);\n }\n };\n /**\n * Listen once for a certain type of event.\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function(?): ?} 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 */\n Observable.prototype.once = function (type, listener) {\n if (Array.isArray(type)) {\n var len = type.length;\n var keys = new Array(len);\n for (var i = 0; i < len; ++i) {\n keys[i] = listenOnce(this, type[i], listener);\n }\n return keys;\n }\n else {\n return listenOnce(this, /** @type {string} */ (type), listener);\n }\n };\n /**\n * Unlisten for a certain type of event.\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function(?): ?} listener The listener function.\n * @api\n */\n Observable.prototype.un = function (type, listener) {\n if (Array.isArray(type)) {\n for (var i = 0, ii = type.length; i < ii; ++i) {\n this.removeEventListener(type[i], listener);\n }\n }\n else {\n this.removeEventListener(type, listener);\n }\n };\n return Observable;\n}(EventTarget));\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 (var i = 0, ii = key.length; i < ii; ++i) {\n unlistenByKey(key[i]);\n }\n }\n else {\n unlistenByKey(/** @type {import(\"./events.js\").EventsKey} */ (key));\n }\n}\nexport default Observable;\n//# sourceMappingURL=Observable.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Object\n */\nimport { getUid } from './util.js';\nimport ObjectEventType from './ObjectEventType.js';\nimport Observable from './Observable.js';\nimport Event from './events/Event.js';\nimport { assign } from './obj.js';\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.\n */\nvar ObjectEvent = /** @class */ (function (_super) {\n __extends(ObjectEvent, _super);\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 function ObjectEvent(type, key, oldValue) {\n var _this = _super.call(this, type) || this;\n /**\n * The name of the property whose value is changing.\n * @type {string}\n * @api\n */\n _this.key = key;\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 return _this;\n }\n return ObjectEvent;\n}(Event));\nexport { ObjectEvent };\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} 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 */\nvar BaseObject = /** @class */ (function (_super) {\n __extends(BaseObject, _super);\n /**\n * @param {Object<string, *>=} opt_values An object with key-value pairs.\n */\n function BaseObject(opt_values) {\n var _this = _super.call(this) || this;\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 * @private\n * @type {!Object<string, *>}\n */\n _this.values_ = {};\n if (opt_values !== undefined) {\n _this.setProperties(opt_values);\n }\n return _this;\n }\n /**\n * Gets a value.\n * @param {string} key Key name.\n * @return {*} Value.\n * @api\n */\n BaseObject.prototype.get = function (key) {\n var value;\n if (this.values_.hasOwnProperty(key)) {\n value = this.values_[key];\n }\n return value;\n };\n /**\n * Get a list of object property names.\n * @return {Array<string>} List of property names.\n * @api\n */\n BaseObject.prototype.getKeys = function () {\n return Object.keys(this.values_);\n };\n /**\n * Get an object of all property names and values.\n * @return {Object<string, *>} Object.\n * @api\n */\n BaseObject.prototype.getProperties = function () {\n return assign({}, this.values_);\n };\n /**\n * @param {string} key Key name.\n * @param {*} oldValue Old value.\n */\n BaseObject.prototype.notify = function (key, oldValue) {\n var eventType;\n eventType = getChangeEventType(key);\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n eventType = ObjectEventType.PROPERTYCHANGE;\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n };\n /**\n * Sets a value.\n * @param {string} key Key name.\n * @param {*} value Value.\n * @param {boolean=} opt_silent Update without triggering an event.\n * @api\n */\n BaseObject.prototype.set = function (key, value, opt_silent) {\n if (opt_silent) {\n this.values_[key] = value;\n }\n else {\n var oldValue = this.values_[key];\n this.values_[key] = value;\n if (oldValue !== value) {\n this.notify(key, oldValue);\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=} opt_silent Update without triggering an event.\n * @api\n */\n BaseObject.prototype.setProperties = function (values, opt_silent) {\n for (var key in values) {\n this.set(key, values[key], opt_silent);\n }\n };\n /**\n * Unsets a property.\n * @param {string} key Key name.\n * @param {boolean=} opt_silent Unset without triggering an event.\n * @api\n */\n BaseObject.prototype.unset = function (key, opt_silent) {\n if (key in this.values_) {\n var oldValue = this.values_[key];\n delete this.values_[key];\n if (!opt_silent) {\n this.notify(key, oldValue);\n }\n }\n };\n return BaseObject;\n}(Observable));\n/**\n * @type {Object<string, string>}\n */\nvar changeEventTypeCache = {};\n/**\n * @param {string} key Key name.\n * @return {string} Change name.\n */\nexport function getChangeEventType(key) {\n return changeEventTypeCache.hasOwnProperty(key) ?\n changeEventTypeCache[key] :\n (changeEventTypeCache[key] = 'change:' + key);\n}\nexport default BaseObject;\n//# sourceMappingURL=Object.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Collection\n */\nimport AssertionError from './AssertionError.js';\nimport CollectionEventType from './CollectionEventType.js';\nimport BaseObject from './Object.js';\nimport Event from './events/Event.js';\n/**\n * @enum {string}\n * @private\n */\nvar Property = {\n LENGTH: 'length'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Collection~Collection} instances are instances of this\n * type.\n */\nvar CollectionEvent = /** @class */ (function (_super) {\n __extends(CollectionEvent, _super);\n /**\n * @param {CollectionEventType} type Type.\n * @param {*=} opt_element Element.\n * @param {number} opt_index The index of the added or removed element.\n */\n function CollectionEvent(type, opt_element, opt_index) {\n var _this = _super.call(this, type) || this;\n /**\n * The element that is added to or removed from the collection.\n * @type {*}\n * @api\n */\n _this.element = opt_element;\n /**\n * The index of the added or removed element.\n * @type {number}\n * @api\n */\n _this.index = opt_index;\n return _this;\n }\n return CollectionEvent;\n}(Event));\nexport { CollectionEvent };\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 * @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 */\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n /**\n * @param {Array<T>=} opt_array Array.\n * @param {Options=} opt_options Collection options.\n */\n function Collection(opt_array, opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options || {};\n /**\n * @private\n * @type {boolean}\n */\n _this.unique_ = !!options.unique;\n /**\n * @private\n * @type {!Array<T>}\n */\n _this.array_ = opt_array ? opt_array : [];\n if (_this.unique_) {\n for (var i = 0, ii = _this.array_.length; i < ii; ++i) {\n _this.assertUnique_(_this.array_[i], i);\n }\n }\n _this.updateLength_();\n return _this;\n }\n /**\n * Remove all elements from the collection.\n * @api\n */\n Collection.prototype.clear = function () {\n while (this.getLength() > 0) {\n this.pop();\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 Collection.prototype.extend = function (arr) {\n for (var i = 0, ii = arr.length; i < ii; ++i) {\n this.push(arr[i]);\n }\n return this;\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 Collection.prototype.forEach = function (f) {\n var array = this.array_;\n for (var i = 0, ii = array.length; i < ii; ++i) {\n f(array[i], i, array);\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 Collection.prototype.getArray = function () {\n return this.array_;\n };\n /**\n * Get the element at the provided index.\n * @param {number} index Index.\n * @return {T} Element.\n * @api\n */\n Collection.prototype.item = function (index) {\n return this.array_[index];\n };\n /**\n * Get the length of this collection.\n * @return {number} The length of the array.\n * @observable\n * @api\n */\n Collection.prototype.getLength = function () {\n return this.get(Property.LENGTH);\n };\n /**\n * Insert an element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n Collection.prototype.insertAt = function (index, elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n this.array_.splice(index, 0, elem);\n this.updateLength_();\n this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD, elem, index));\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 Collection.prototype.pop = function () {\n return this.removeAt(this.getLength() - 1);\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 Collection.prototype.push = function (elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n var n = this.getLength();\n this.insertAt(n, elem);\n return this.getLength();\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 Collection.prototype.remove = function (elem) {\n var arr = this.array_;\n for (var 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 * 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 Collection.prototype.removeAt = function (index) {\n var prev = this.array_[index];\n this.array_.splice(index, 1);\n this.updateLength_();\n this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE, prev, index));\n return prev;\n };\n /**\n * Set the element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n Collection.prototype.setAt = function (index, elem) {\n var n = this.getLength();\n if (index < n) {\n if (this.unique_) {\n this.assertUnique_(elem, index);\n }\n var prev = this.array_[index];\n this.array_[index] = elem;\n this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE, prev, index));\n this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD, elem, index));\n }\n else {\n for (var j = n; j < index; ++j) {\n this.insertAt(j, undefined);\n }\n this.insertAt(index, elem);\n }\n };\n /**\n * @private\n */\n Collection.prototype.updateLength_ = function () {\n this.set(Property.LENGTH, this.array_.length);\n };\n /**\n * @private\n * @param {T} elem Element.\n * @param {number=} opt_except Optional index to ignore.\n */\n Collection.prototype.assertUnique_ = function (elem, opt_except) {\n for (var i = 0, ii = this.array_.length; i < ii; ++i) {\n if (this.array_[i] === elem && i !== opt_except) {\n throw new AssertionError(58);\n }\n }\n };\n return Collection;\n}(BaseObject));\nexport default Collection;\n//# sourceMappingURL=Collection.js.map","/**\n * @module ol/asserts\n */\nimport AssertionError from './AssertionError.js';\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//# sourceMappingURL=asserts.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Feature\n */\nimport { assert } from './asserts.js';\nimport { listen, unlistenByKey } from './events.js';\nimport EventType from './events/EventType.js';\nimport BaseObject, { getChangeEventType } from './Object.js';\n/**\n * @typedef {typeof Feature|typeof import(\"./render/Feature.js\").default} FeatureClass\n */\n/**\n * @typedef {Feature|import(\"./render/Feature.js\").default} FeatureLike\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} 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 * var 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 * var 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 * var point = feature.getGeometry();\n * ```\n *\n * @api\n * @template {import(\"./geom/Geometry.js\").default} Geometry\n */\nvar Feature = /** @class */ (function (_super) {\n __extends(Feature, _super);\n /**\n * @param {Geometry|Object<string, *>=} opt_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 function Feature(opt_geometryOrProperties) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {number|string|undefined}\n */\n _this.id_ = undefined;\n /**\n * @type {string}\n * @private\n */\n _this.geometryName_ = 'geometry';\n /**\n * User provided style.\n * @private\n * @type {import(\"./style/Style.js\").StyleLike}\n */\n _this.style_ = null;\n /**\n * @private\n * @type {import(\"./style/Style.js\").StyleFunction|undefined}\n */\n _this.styleFunction_ = undefined;\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.geometryChangeKey_ = null;\n _this.addEventListener(getChangeEventType(_this.geometryName_), _this.handleGeometryChanged_);\n if (opt_geometryOrProperties) {\n if (typeof /** @type {?} */ (opt_geometryOrProperties).getSimplifiedGeometry === 'function') {\n var geometry = /** @type {Geometry} */ (opt_geometryOrProperties);\n _this.setGeometry(geometry);\n }\n else {\n /** @type {Object<string, *>} */\n var properties = opt_geometryOrProperties;\n _this.setProperties(properties);\n }\n }\n return _this;\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} The clone.\n * @api\n */\n Feature.prototype.clone = function () {\n var clone = new Feature(this.getProperties());\n clone.setGeometryName(this.getGeometryName());\n var geometry = this.getGeometry();\n if (geometry) {\n clone.setGeometry(geometry.clone());\n }\n var style = this.getStyle();\n if (style) {\n clone.setStyle(style);\n }\n return clone;\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 Feature.prototype.getGeometry = function () {\n return (\n /** @type {Geometry|undefined} */ (this.get(this.geometryName_)));\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 Feature.prototype.getId = function () {\n return this.id_;\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 Feature.prototype.getGeometryName = function () {\n return this.geometryName_;\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} The feature style.\n * @api\n */\n Feature.prototype.getStyle = function () {\n return this.style_;\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 Feature.prototype.getStyleFunction = function () {\n return this.styleFunction_;\n };\n /**\n * @private\n */\n Feature.prototype.handleGeometryChange_ = function () {\n this.changed();\n };\n /**\n * @private\n */\n Feature.prototype.handleGeometryChanged_ = function () {\n if (this.geometryChangeKey_) {\n unlistenByKey(this.geometryChangeKey_);\n this.geometryChangeKey_ = null;\n }\n var geometry = this.getGeometry();\n if (geometry) {\n this.geometryChangeKey_ = listen(geometry, EventType.CHANGE, this.handleGeometryChange_, this);\n }\n this.changed();\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 Feature.prototype.setGeometry = function (geometry) {\n this.set(this.geometryName_, geometry);\n };\n /**\n * Set the style for the feature. This can be a single style object, an array\n * of styles, or a function that takes a resolution and returns an array of\n * styles. If it is `null` the feature has no style (a `null` style).\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 Feature.prototype.setStyle = function (style) {\n this.style_ = style;\n this.styleFunction_ = !style ? undefined : createStyleFunction(style);\n this.changed();\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 Feature.prototype.setId = function (id) {\n this.id_ = id;\n this.changed();\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 Feature.prototype.setGeometryName = function (name) {\n this.removeEventListener(getChangeEventType(this.geometryName_), this.handleGeometryChanged_);\n this.geometryName_ = name;\n this.addEventListener(getChangeEventType(this.geometryName_), this.handleGeometryChanged_);\n this.handleGeometryChanged_();\n };\n return Feature;\n}(BaseObject));\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 }\n else {\n /**\n * @type {Array<import(\"./style/Style.js\").default>}\n */\n var styles_1;\n if (Array.isArray(obj)) {\n styles_1 = obj;\n }\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 var style = /** @type {import(\"./style/Style.js\").default} */ (obj);\n styles_1 = [style];\n }\n return function () {\n return styles_1;\n };\n }\n}\nexport default Feature;\n//# sourceMappingURL=Feature.js.map","/**\n * @module ol/extent/Corner\n */\n/**\n * Extent corner.\n * @enum {string}\n */\nexport default {\n BOTTOM_LEFT: 'bottom-left',\n BOTTOM_RIGHT: 'bottom-right',\n TOP_LEFT: 'top-left',\n TOP_RIGHT: 'top-right'\n};\n//# sourceMappingURL=Corner.js.map","/**\n * @module ol/extent/Relationship\n */\n/**\n * Relationship to an extent.\n * @enum {number}\n */\nexport default {\n UNKNOWN: 0,\n INTERSECTING: 1,\n ABOVE: 2,\n RIGHT: 4,\n BELOW: 8,\n LEFT: 16\n};\n//# sourceMappingURL=Relationship.js.map","/**\n * @module ol/extent\n */\nimport { assert } from './asserts.js';\nimport Corner from './extent/Corner.js';\nimport Relationship from './extent/Relationship.js';\n/**\n * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.\n * @typedef {Array<number>} Extent\n * @api\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 var extent = createEmpty();\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n/**\n * @param {Array<number>} xs Xs.\n * @param {Array<number>} ys Ys.\n * @param {Extent=} opt_extent Destination extent.\n * @private\n * @return {Extent} Extent.\n */\nfunction _boundingExtentXYs(xs, ys, opt_extent) {\n var minX = Math.min.apply(null, xs);\n var minY = Math.min.apply(null, ys);\n var maxX = Math.max.apply(null, xs);\n var maxY = Math.max.apply(null, ys);\n return createOrUpdate(minX, minY, maxX, maxY, opt_extent);\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=} opt_extent Extent.\n * @return {Extent} Extent.\n * @api\n */\nexport function buffer(extent, value, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = extent[0] - value;\n opt_extent[1] = extent[1] - value;\n opt_extent[2] = extent[2] + value;\n opt_extent[3] = extent[3] + value;\n return opt_extent;\n }\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 * Creates a clone of an extent.\n *\n * @param {Extent} extent Extent to clone.\n * @param {Extent=} opt_extent Extent.\n * @return {Extent} The clone.\n */\nexport function clone(extent, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = extent[0];\n opt_extent[1] = extent[1];\n opt_extent[2] = extent[2];\n opt_extent[3] = extent[3];\n return opt_extent;\n }\n else {\n return extent.slice();\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 var dx, dy;\n if (x < extent[0]) {\n dx = extent[0] - x;\n }\n else if (extent[2] < x) {\n dx = x - extent[2];\n }\n else {\n dx = 0;\n }\n if (y < extent[1]) {\n dy = extent[1] - y;\n }\n else if (extent[3] < y) {\n dy = y - extent[3];\n }\n else {\n dy = 0;\n }\n return dx * dx + dy * dy;\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 * 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 extent1[0] <= extent2[0] && extent2[2] <= extent1[2] &&\n extent1[1] <= extent2[1] && extent2[3] <= extent1[3];\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 * 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 {Relationship} The relationship (bitwise compare with\n * import(\"./extent/Relationship.js\").Relationship).\n */\nexport function coordinateRelationship(extent, coordinate) {\n var minX = extent[0];\n var minY = extent[1];\n var maxX = extent[2];\n var maxY = extent[3];\n var x = coordinate[0];\n var y = coordinate[1];\n var relationship = Relationship.UNKNOWN;\n if (x < minX) {\n relationship = relationship | Relationship.LEFT;\n }\n else if (x > maxX) {\n relationship = relationship | Relationship.RIGHT;\n }\n if (y < minY) {\n relationship = relationship | Relationship.BELOW;\n }\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 * Create an empty extent.\n * @return {Extent} Empty extent.\n * @api\n */\nexport function createEmpty() {\n return [Infinity, Infinity, -Infinity, -Infinity];\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=} opt_extent Destination extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = minX;\n opt_extent[1] = minY;\n opt_extent[2] = maxX;\n opt_extent[3] = maxY;\n return opt_extent;\n }\n else {\n return [minX, minY, maxX, maxY];\n }\n}\n/**\n * Create a new empty extent or make the provided one empty.\n * @param {Extent=} opt_extent Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateEmpty(opt_extent) {\n return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, opt_extent);\n}\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Extent=} opt_extent Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinate(coordinate, opt_extent) {\n var x = coordinate[0];\n var y = coordinate[1];\n return createOrUpdate(x, y, x, y, opt_extent);\n}\n/**\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {Extent=} opt_extent Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinates(coordinates, opt_extent) {\n var extent = createOrUpdateEmpty(opt_extent);\n return extendCoordinates(extent, coordinates);\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=} opt_extent Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {\n var extent = createOrUpdateEmpty(opt_extent);\n return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);\n}\n/**\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @param {Extent=} opt_extent Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromRings(rings, opt_extent) {\n var extent = createOrUpdateEmpty(opt_extent);\n return extendRings(extent, rings);\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 extent1[0] == extent2[0] && extent1[2] == extent2[2] &&\n extent1[1] == extent2[1] && extent1[3] == extent2[3];\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 * @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 * @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 (var i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\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(extent, flatCoordinates, offset, end, stride) {\n for (; offset < end; offset += stride) {\n extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);\n }\n return extent;\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 (var i = 0, ii = rings.length; i < ii; ++i) {\n extendCoordinates(extent, rings[i]);\n }\n return extent;\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 * 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 var 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 * Get the size of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Area.\n * @api\n */\nexport function getArea(extent) {\n var area = 0;\n if (!isEmpty(extent)) {\n area = getWidth(extent) * getHeight(extent);\n }\n return area;\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 * 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 * 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 * 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 var coordinate;\n if (corner === Corner.BOTTOM_LEFT) {\n coordinate = getBottomLeft(extent);\n }\n else if (corner === Corner.BOTTOM_RIGHT) {\n coordinate = getBottomRight(extent);\n }\n else if (corner === Corner.TOP_LEFT) {\n coordinate = getTopLeft(extent);\n }\n else if (corner === Corner.TOP_RIGHT) {\n coordinate = getTopRight(extent);\n }\n else {\n assert(false, 13); // Invalid corner\n }\n return coordinate;\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 var minX = Math.min(extent1[0], extent2[0]);\n var minY = Math.min(extent1[1], extent2[1]);\n var maxX = Math.max(extent1[2], extent2[2]);\n var maxY = Math.max(extent1[3], extent2[3]);\n return (maxX - minX) * (maxY - minY);\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=} opt_extent Destination extent.\n * @return {Extent} Extent.\n */\nexport function getForViewAndSize(center, resolution, rotation, size, opt_extent) {\n var dx = resolution * size[0] / 2;\n var dy = resolution * size[1] / 2;\n var cosRotation = Math.cos(rotation);\n var sinRotation = Math.sin(rotation);\n var xCos = dx * cosRotation;\n var xSin = dx * sinRotation;\n var yCos = dy * cosRotation;\n var ySin = dy * sinRotation;\n var x = center[0];\n var y = center[1];\n var x0 = x - xCos + ySin;\n var x1 = x - xCos - ySin;\n var x2 = x + xCos - ySin;\n var x3 = x + xCos + ySin;\n var y0 = y - xSin - yCos;\n var y1 = y - xSin + yCos;\n var y2 = y + xSin + yCos;\n var y3 = y + xSin - yCos;\n return createOrUpdate(Math.min(x0, x1, x2, x3), Math.min(y0, y1, y2, y3), Math.max(x0, x1, x2, x3), Math.max(y0, y1, y2, y3), opt_extent);\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 * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Intersection area.\n */\nexport function getIntersectionArea(extent1, extent2) {\n var intersection = getIntersection(extent1, extent2);\n return getArea(intersection);\n}\n/**\n * Get the intersection of two extents.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {Extent=} opt_extent Optional extent to populate with intersection.\n * @return {Extent} Intersecting extent.\n * @api\n */\nexport function getIntersection(extent1, extent2, opt_extent) {\n var intersection = opt_extent ? opt_extent : createEmpty();\n if (intersects(extent1, extent2)) {\n if (extent1[0] > extent2[0]) {\n intersection[0] = extent1[0];\n }\n else {\n intersection[0] = extent2[0];\n }\n if (extent1[1] > extent2[1]) {\n intersection[1] = extent1[1];\n }\n else {\n intersection[1] = extent2[1];\n }\n if (extent1[2] < extent2[2]) {\n intersection[2] = extent1[2];\n }\n else {\n intersection[2] = extent2[2];\n }\n if (extent1[3] < extent2[3]) {\n intersection[3] = extent1[3];\n }\n else {\n intersection[3] = extent2[3];\n }\n }\n else {\n createOrUpdateEmpty(intersection);\n }\n return intersection;\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 * 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 * 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 * 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 * 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 * 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 extent1[0] <= extent2[2] &&\n extent1[2] >= extent2[0] &&\n extent1[1] <= extent2[3] &&\n extent1[3] >= extent2[1];\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 * @param {Extent} extent Extent.\n * @param {Extent=} opt_extent Extent.\n * @return {Extent} Extent.\n */\nexport function returnOrUpdate(extent, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = extent[0];\n opt_extent[1] = extent[1];\n opt_extent[2] = extent[2];\n opt_extent[3] = extent[3];\n return opt_extent;\n }\n else {\n return extent;\n }\n}\n/**\n * @param {Extent} extent Extent.\n * @param {number} value Value.\n */\nexport function scaleFromCenter(extent, value) {\n var deltaX = ((extent[2] - extent[0]) / 2) * (value - 1);\n var 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 * 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 var intersects = false;\n var startRel = coordinateRelationship(extent, start);\n var endRel = coordinateRelationship(extent, end);\n if (startRel === Relationship.INTERSECTING ||\n endRel === Relationship.INTERSECTING) {\n intersects = true;\n }\n else {\n var minX = extent[0];\n var minY = extent[1];\n var maxX = extent[2];\n var maxY = extent[3];\n var startX = start[0];\n var startY = start[1];\n var endX = end[0];\n var endY = end[1];\n var slope = (endY - startY) / (endX - startX);\n var x = void 0, y = void 0;\n if (!!(endRel & Relationship.ABOVE) &&\n !(startRel & Relationship.ABOVE)) {\n // potentially intersects top\n x = endX - ((endY - maxY) / slope);\n intersects = x >= minX && x <= maxX;\n }\n if (!intersects && !!(endRel & Relationship.RIGHT) &&\n !(startRel & Relationship.RIGHT)) {\n // potentially intersects right\n y = endY - ((endX - maxX) * slope);\n intersects = y >= minY && y <= maxY;\n }\n if (!intersects && !!(endRel & Relationship.BELOW) &&\n !(startRel & Relationship.BELOW)) {\n // potentially intersects bottom\n x = endX - ((endY - minY) / slope);\n intersects = x >= minX && x <= maxX;\n }\n if (!intersects && !!(endRel & Relationship.LEFT) &&\n !(startRel & Relationship.LEFT)) {\n // potentially intersects left\n y = endY - ((endX - minX) * slope);\n intersects = y >= minY && y <= maxY;\n }\n }\n return intersects;\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=} opt_extent Destination extent.\n * @return {Extent} Extent.\n * @api\n */\nexport function applyTransform(extent, transformFn, opt_extent) {\n var coordinates = [\n extent[0], extent[1],\n extent[0], extent[3],\n extent[2], extent[1],\n extent[2], extent[3]\n ];\n transformFn(coordinates, coordinates, 2);\n var xs = [coordinates[0], coordinates[2], coordinates[4], coordinates[6]];\n var ys = [coordinates[1], coordinates[3], coordinates[5], coordinates[7]];\n return _boundingExtentXYs(xs, ys, opt_extent);\n}\n//# sourceMappingURL=extent.js.map","/**\n * @module ol/geom/GeometryLayout\n */\n/**\n * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z')\n * or measure ('M') coordinate is available. Supported values are `'XY'`,\n * `'XYZ'`, `'XYM'`, `'XYZM'`.\n * @enum {string}\n */\nexport default {\n XY: 'XY',\n XYZ: 'XYZ',\n XYM: 'XYM',\n XYZM: 'XYZM'\n};\n//# sourceMappingURL=GeometryLayout.js.map","/**\n * @module ol/geom/GeometryType\n */\n/**\n * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`,\n * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`,\n * `'GeometryCollection'`, `'Circle'`.\n * @enum {string}\n */\nexport default {\n POINT: 'Point',\n LINE_STRING: 'LineString',\n LINEAR_RING: 'LinearRing',\n POLYGON: 'Polygon',\n MULTI_POINT: 'MultiPoint',\n MULTI_LINE_STRING: 'MultiLineString',\n MULTI_POLYGON: 'MultiPolygon',\n GEOMETRY_COLLECTION: 'GeometryCollection',\n CIRCLE: 'Circle'\n};\n//# sourceMappingURL=GeometryType.js.map","/**\n * @module ol/geom/flat/transform\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 {import(\"../../transform.js\").Transform} transform Transform.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nexport function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n var x = flatCoordinates[j];\n var y = flatCoordinates[j + 1];\n dest[i++] = transform[0] * x + transform[2] * y + transform[4];\n dest[i++] = transform[1] * x + transform[3] * y + transform[5];\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\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 {number} angle Angle.\n * @param {Array<number>} anchor Rotation anchor point.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nexport function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n var anchorX = anchor[0];\n var anchorY = anchor[1];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n var deltaX = flatCoordinates[j] - anchorX;\n var deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + deltaX * cos - deltaY * sin;\n dest[i++] = anchorY + deltaX * sin + deltaY * cos;\n for (var k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n/**\n * Scale the coordinates.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} sx Scale factor in the x-direction.\n * @param {number} sy Scale factor in the y-direction.\n * @param {Array<number>} anchor Scale anchor point.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nexport function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var anchorX = anchor[0];\n var anchorY = anchor[1];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n var deltaX = flatCoordinates[j] - anchorX;\n var deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + sx * deltaX;\n dest[i++] = anchorY + sy * deltaY;\n for (var k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\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 {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nexport function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n dest[i++] = flatCoordinates[j] + deltaX;\n dest[i++] = flatCoordinates[j + 1] + deltaY;\n for (var k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n//# sourceMappingURL=transform.js.map","/**\n * @module ol/math\n */\n/**\n * Takes a number and clamps it to within the provided bounds.\n * @param {number} value The input number.\n * @param {number} min The minimum value to return.\n * @param {number} max The maximum value to return.\n * @return {number} The input number if it is within bounds, or the nearest\n * number within the bounds.\n */\nexport function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n/**\n * Return the hyperbolic cosine of a given number. The method will use the\n * native `Math.cosh` function if it is available, otherwise the hyperbolic\n * cosine will be calculated via the reference implementation of the Mozilla\n * developer network.\n *\n * @param {number} x X.\n * @return {number} Hyperbolic cosine of x.\n */\nexport var cosh = (function () {\n // Wrapped in a iife, to save the overhead of checking for the native\n // implementation on every invocation.\n var cosh;\n if ('cosh' in Math) {\n // The environment supports the native Math.cosh function, use it…\n cosh = Math.cosh;\n }\n else {\n // … else, use the reference implementation of MDN:\n cosh = function (x) {\n var y = /** @type {Math} */ (Math).exp(x);\n return (y + 1 / y) / 2;\n };\n }\n return cosh;\n}());\n/**\n * Returns the square of the closest distance between the point (x, y) and the\n * line segment (x1, y1) to (x2, y2).\n * @param {number} x X.\n * @param {number} y Y.\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nexport function squaredSegmentDistance(x, y, x1, y1, x2, y2) {\n var dx = x2 - x1;\n var dy = y2 - y1;\n if (dx !== 0 || dy !== 0) {\n var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n x1 = x2;\n y1 = y2;\n }\n else if (t > 0) {\n x1 += dx * t;\n y1 += dy * t;\n }\n }\n return squaredDistance(x, y, x1, y1);\n}\n/**\n * Returns the square of the distance between the points (x1, y1) and (x2, y2).\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nexport function squaredDistance(x1, y1, x2, y2) {\n var dx = x2 - x1;\n var dy = y2 - y1;\n return dx * dx + dy * dy;\n}\n/**\n * Solves system of linear equations using Gaussian elimination method.\n *\n * @param {Array<Array<number>>} mat Augmented matrix (n x n + 1 column)\n * in row-major order.\n * @return {Array<number>} The resulting vector.\n */\nexport function solveLinearSystem(mat) {\n var n = mat.length;\n for (var i = 0; i < n; i++) {\n // Find max in the i-th column (ignoring i - 1 first rows)\n var maxRow = i;\n var maxEl = Math.abs(mat[i][i]);\n for (var r = i + 1; r < n; r++) {\n var absValue = Math.abs(mat[r][i]);\n if (absValue > maxEl) {\n maxEl = absValue;\n maxRow = r;\n }\n }\n if (maxEl === 0) {\n return null; // matrix is singular\n }\n // Swap max row with i-th (current) row\n var tmp = mat[maxRow];\n mat[maxRow] = mat[i];\n mat[i] = tmp;\n // Subtract the i-th row to make all the remaining rows 0 in the i-th column\n for (var j = i + 1; j < n; j++) {\n var coef = -mat[j][i] / mat[i][i];\n for (var k = i; k < n + 1; k++) {\n if (i == k) {\n mat[j][k] = 0;\n }\n else {\n mat[j][k] += coef * mat[i][k];\n }\n }\n }\n }\n // Solve Ax=b for upper triangular matrix A (mat)\n var x = new Array(n);\n for (var l = n - 1; l >= 0; l--) {\n x[l] = mat[l][n] / mat[l][l];\n for (var m = l - 1; m >= 0; m--) {\n mat[m][n] -= mat[m][l] * x[l];\n }\n }\n return x;\n}\n/**\n * Converts radians to to degrees.\n *\n * @param {number} angleInRadians Angle in radians.\n * @return {number} Angle in degrees.\n */\nexport function toDegrees(angleInRadians) {\n return angleInRadians * 180 / Math.PI;\n}\n/**\n * Converts degrees to radians.\n *\n * @param {number} angleInDegrees Angle in degrees.\n * @return {number} Angle in radians.\n */\nexport function toRadians(angleInDegrees) {\n return angleInDegrees * Math.PI / 180;\n}\n/**\n * Returns the modulo of a / b, depending on the sign of b.\n *\n * @param {number} a Dividend.\n * @param {number} b Divisor.\n * @return {number} Modulo.\n */\nexport function modulo(a, b) {\n var r = a % b;\n return r * b < 0 ? r + b : r;\n}\n/**\n * Calculates the linearly interpolated value of x between a and b.\n *\n * @param {number} a Number\n * @param {number} b Number\n * @param {number} x Value to be interpolated.\n * @return {number} Interpolated value.\n */\nexport function lerp(a, b, x) {\n return a + x * (b - a);\n}\n//# sourceMappingURL=math.js.map","/**\n * @license\n * Latitude/longitude spherical geodesy formulae taken from\n * http://www.movable-type.co.uk/scripts/latlong.html\n * Licensed under CC-BY-3.0.\n */\n/**\n * @module ol/sphere\n */\nimport { toRadians, toDegrees } from './math.js';\nimport GeometryType from './geom/GeometryType.js';\n/**\n * Object literal with options for the {@link getLength} or {@link getArea}\n * functions.\n * @typedef {Object} SphereMetricOptions\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857']\n * Projection of the geometry. By default, the geometry is assumed to be in\n * Web Mercator.\n * @property {number} [radius=6371008.8] Sphere radius. By default, the\n * [mean Earth radius](https://en.wikipedia.org/wiki/Earth_radius#Mean_radius)\n * for the WGS84 ellipsoid is used.\n */\n/**\n * The mean Earth radius (1/3 * (2a + b)) for the WGS84 ellipsoid.\n * https://en.wikipedia.org/wiki/Earth_radius#Mean_radius\n * @type {number}\n */\nexport var DEFAULT_RADIUS = 6371008.8;\n/**\n * Get the great circle distance (in meters) between two geographic coordinates.\n * @param {Array} c1 Starting coordinate.\n * @param {Array} c2 Ending coordinate.\n * @param {number=} opt_radius The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {number} The great circle distance between the points (in meters).\n * @api\n */\nexport function getDistance(c1, c2, opt_radius) {\n var radius = opt_radius || DEFAULT_RADIUS;\n var lat1 = toRadians(c1[1]);\n var lat2 = toRadians(c2[1]);\n var deltaLatBy2 = (lat2 - lat1) / 2;\n var deltaLonBy2 = toRadians(c2[0] - c1[0]) / 2;\n var a = Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) +\n Math.sin(deltaLonBy2) * Math.sin(deltaLonBy2) *\n Math.cos(lat1) * Math.cos(lat2);\n return 2 * radius * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n}\n/**\n * Get the cumulative great circle length of linestring coordinates (geographic).\n * @param {Array} coordinates Linestring coordinates.\n * @param {number} radius The sphere radius to use.\n * @return {number} The length (in meters).\n */\nfunction getLengthInternal(coordinates, radius) {\n var length = 0;\n for (var i = 0, ii = coordinates.length; i < ii - 1; ++i) {\n length += getDistance(coordinates[i], coordinates[i + 1], radius);\n }\n return length;\n}\n/**\n * Get the spherical length of a geometry. This length is the sum of the\n * great circle distances between coordinates. For polygons, the length is\n * the sum of all rings. For points, the length is zero. For multi-part\n * geometries, the length is the sum of the length of each part.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions=} opt_options Options for the\n * length calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical length (in meters).\n * @api\n */\nexport function getLength(geometry, opt_options) {\n var options = opt_options || {};\n var radius = options.radius || DEFAULT_RADIUS;\n var projection = options.projection || 'EPSG:3857';\n var type = geometry.getType();\n if (type !== GeometryType.GEOMETRY_COLLECTION) {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n var length = 0;\n var coordinates, coords, i, ii, j, jj;\n switch (type) {\n case GeometryType.POINT:\n case GeometryType.MULTI_POINT: {\n break;\n }\n case GeometryType.LINE_STRING:\n case GeometryType.LINEAR_RING: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n length = getLengthInternal(coordinates, radius);\n break;\n }\n case GeometryType.MULTI_LINE_STRING:\n case GeometryType.POLYGON: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n length += getLengthInternal(coordinates[i], radius);\n }\n break;\n }\n case GeometryType.MULTI_POLYGON: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n for (j = 0, jj = coords.length; j < jj; ++j) {\n length += getLengthInternal(coords[j], radius);\n }\n }\n break;\n }\n case GeometryType.GEOMETRY_COLLECTION: {\n var geometries = /** @type {import(\"./geom/GeometryCollection.js\").default} */ (geometry).getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n length += getLength(geometries[i], opt_options);\n }\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return length;\n}\n/**\n * Returns the spherical area for a list of coordinates.\n *\n * [Reference](https://trs-new.jpl.nasa.gov/handle/2014/40409)\n * Robert. G. Chamberlain and William H. Duquette, \"Some Algorithms for\n * Polygons on a Sphere\", JPL Publication 07-03, Jet Propulsion\n * Laboratory, Pasadena, CA, June 2007\n *\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates List of coordinates of a linear\n * ring. If the ring is oriented clockwise, the area will be positive,\n * otherwise it will be negative.\n * @param {number} radius The sphere radius.\n * @return {number} Area (in square meters).\n */\nfunction getAreaInternal(coordinates, radius) {\n var area = 0;\n var len = coordinates.length;\n var x1 = coordinates[len - 1][0];\n var y1 = coordinates[len - 1][1];\n for (var i = 0; i < len; i++) {\n var x2 = coordinates[i][0];\n var y2 = coordinates[i][1];\n area += toRadians(x2 - x1) *\n (2 + Math.sin(toRadians(y1)) +\n Math.sin(toRadians(y2)));\n x1 = x2;\n y1 = y2;\n }\n return area * radius * radius / 2.0;\n}\n/**\n * Get the spherical area of a geometry. This is the area (in meters) assuming\n * that polygon edges are segments of great circles on a sphere.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions=} opt_options Options for the area\n * calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical area (in square meters).\n * @api\n */\nexport function getArea(geometry, opt_options) {\n var options = opt_options || {};\n var radius = options.radius || DEFAULT_RADIUS;\n var projection = options.projection || 'EPSG:3857';\n var type = geometry.getType();\n if (type !== GeometryType.GEOMETRY_COLLECTION) {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n var area = 0;\n var coordinates, coords, i, ii, j, jj;\n switch (type) {\n case GeometryType.POINT:\n case GeometryType.MULTI_POINT:\n case GeometryType.LINE_STRING:\n case GeometryType.MULTI_LINE_STRING:\n case GeometryType.LINEAR_RING: {\n break;\n }\n case GeometryType.POLYGON: {\n coordinates = /** @type {import(\"./geom/Polygon.js\").default} */ (geometry).getCoordinates();\n area = Math.abs(getAreaInternal(coordinates[0], radius));\n for (i = 1, ii = coordinates.length; i < ii; ++i) {\n area -= Math.abs(getAreaInternal(coordinates[i], radius));\n }\n break;\n }\n case GeometryType.MULTI_POLYGON: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n area += Math.abs(getAreaInternal(coords[0], radius));\n for (j = 1, jj = coords.length; j < jj; ++j) {\n area -= Math.abs(getAreaInternal(coords[j], radius));\n }\n }\n break;\n }\n case GeometryType.GEOMETRY_COLLECTION: {\n var geometries = /** @type {import(\"./geom/GeometryCollection.js\").default} */ (geometry).getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n area += getArea(geometries[i], opt_options);\n }\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return area;\n}\n/**\n * Returns the coordinate at the given distance and bearing from `c1`.\n *\n * @param {import(\"./coordinate.js\").Coordinate} c1 The origin point (`[lon, lat]` in degrees).\n * @param {number} distance The great-circle distance between the origin\n * point and the target point.\n * @param {number} bearing The bearing (in radians).\n * @param {number=} opt_radius The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {import(\"./coordinate.js\").Coordinate} The target point.\n */\nexport function offset(c1, distance, bearing, opt_radius) {\n var radius = opt_radius || DEFAULT_RADIUS;\n var lat1 = toRadians(c1[1]);\n var lon1 = toRadians(c1[0]);\n var dByR = distance / radius;\n var lat = Math.asin(Math.sin(lat1) * Math.cos(dByR) +\n Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing));\n var lon = lon1 + Math.atan2(Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1), Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat));\n return [toDegrees(lon), toDegrees(lat)];\n}\n//# sourceMappingURL=sphere.js.map","/**\n * @module ol/proj/Units\n */\n/**\n * Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, `'tile-pixels'` or\n * `'us-ft'`.\n * @enum {string}\n */\nvar Units = {\n DEGREES: 'degrees',\n FEET: 'ft',\n METERS: 'm',\n PIXELS: 'pixels',\n TILE_PIXELS: 'tile-pixels',\n USFEET: 'us-ft'\n};\n/**\n * Meters per unit lookup table.\n * @const\n * @type {Object<Units, number>}\n * @api\n */\nexport var METERS_PER_UNIT = {};\n// use the radius of the Normal sphere\nMETERS_PER_UNIT[Units.DEGREES] = 2 * Math.PI * 6370997 / 360;\nMETERS_PER_UNIT[Units.FEET] = 0.3048;\nMETERS_PER_UNIT[Units.METERS] = 1;\nMETERS_PER_UNIT[Units.USFEET] = 1200 / 3937;\nexport default Units;\n//# sourceMappingURL=Units.js.map","/**\n * @module ol/proj/Projection\n */\nimport { METERS_PER_UNIT } from './Units.js';\n/**\n * @typedef {Object} Options\n * @property {string} code The SRS identifier code, e.g. `EPSG:4326`.\n * @property {import(\"./Units.js\").default|string} [units] Units. Required unless a\n * proj4 projection is defined for `code`.\n * @property {import(\"../extent.js\").Extent} [extent] The validity extent for the SRS.\n * @property {string} [axisOrientation='enu'] The axis orientation as specified in Proj4.\n * @property {boolean} [global=false] Whether the projection is valid for the whole globe.\n * @property {number} [metersPerUnit] The meters per unit for the SRS.\n * If not provided, the `units` are used to get the meters per unit from the {@link module:ol/proj/Units~METERS_PER_UNIT}\n * lookup table.\n * @property {import(\"../extent.js\").Extent} [worldExtent] The world extent for the SRS.\n * @property {function(number, import(\"../coordinate.js\").Coordinate):number} [getPointResolution]\n * Function to determine resolution at a point. The function is called with a\n * `{number}` view resolution and an `{import(\"../coordinate.js\").Coordinate}` as arguments, and returns\n * the `{number}` resolution in projection units at the passed coordinate. If this is `undefined`,\n * the default {@link module:ol/proj#getPointResolution} function will be used.\n */\n/**\n * @classdesc\n * Projection definition class. One of these is created for each projection\n * supported in the application and stored in the {@link module:ol/proj} namespace.\n * You can use these in applications, but this is not required, as API params\n * and options use {@link module:ol/proj~ProjectionLike} which means the simple string\n * code will suffice.\n *\n * You can use {@link module:ol/proj~get} to retrieve the object for a particular\n * projection.\n *\n * The library includes definitions for `EPSG:4326` and `EPSG:3857`, together\n * with the following aliases:\n * * `EPSG:4326`: CRS:84, urn:ogc:def:crs:EPSG:6.6:4326,\n * urn:ogc:def:crs:OGC:1.3:CRS84, urn:ogc:def:crs:OGC:2:84,\n * http://www.opengis.net/gml/srs/epsg.xml#4326,\n * urn:x-ogc:def:crs:EPSG:4326\n * * `EPSG:3857`: EPSG:102100, EPSG:102113, EPSG:900913,\n * urn:ogc:def:crs:EPSG:6.18:3:3857,\n * http://www.opengis.net/gml/srs/epsg.xml#3857\n *\n * If you use [proj4js](https://github.com/proj4js/proj4js), aliases can\n * be added using `proj4.defs()`. After all required projection definitions are\n * added, call the {@link module:ol/proj/proj4~register} function.\n *\n * @api\n */\nvar Projection = /** @class */ (function () {\n /**\n * @param {Options} options Projection options.\n */\n function Projection(options) {\n /**\n * @private\n * @type {string}\n */\n this.code_ = options.code;\n /**\n * Units of projected coordinates. When set to `TILE_PIXELS`, a\n * `this.extent_` and `this.worldExtent_` must be configured properly for each\n * tile.\n * @private\n * @type {import(\"./Units.js\").default}\n */\n this.units_ = /** @type {import(\"./Units.js\").default} */ (options.units);\n /**\n * Validity extent of the projection in projected coordinates. For projections\n * with `TILE_PIXELS` units, this is the extent of the tile in\n * tile pixel space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = options.extent !== undefined ? options.extent : null;\n /**\n * Extent of the world in EPSG:4326. For projections with\n * `TILE_PIXELS` units, this is the extent of the tile in\n * projected coordinate space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.worldExtent_ = options.worldExtent !== undefined ?\n options.worldExtent : null;\n /**\n * @private\n * @type {string}\n */\n this.axisOrientation_ = options.axisOrientation !== undefined ?\n options.axisOrientation : 'enu';\n /**\n * @private\n * @type {boolean}\n */\n this.global_ = options.global !== undefined ? options.global : false;\n /**\n * @private\n * @type {boolean}\n */\n this.canWrapX_ = !!(this.global_ && this.extent_);\n /**\n * @private\n * @type {function(number, import(\"../coordinate.js\").Coordinate):number|undefined}\n */\n this.getPointResolutionFunc_ = options.getPointResolution;\n /**\n * @private\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n this.defaultTileGrid_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n this.metersPerUnit_ = options.metersPerUnit;\n }\n /**\n * @return {boolean} The projection is suitable for wrapping the x-axis\n */\n Projection.prototype.canWrapX = function () {\n return this.canWrapX_;\n };\n /**\n * Get the code for this projection, e.g. 'EPSG:4326'.\n * @return {string} Code.\n * @api\n */\n Projection.prototype.getCode = function () {\n return this.code_;\n };\n /**\n * Get the validity extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n Projection.prototype.getExtent = function () {\n return this.extent_;\n };\n /**\n * Get the units of this projection.\n * @return {import(\"./Units.js\").default} Units.\n * @api\n */\n Projection.prototype.getUnits = function () {\n return this.units_;\n };\n /**\n * Get the amount of meters per unit of this projection. If the projection is\n * not configured with `metersPerUnit` or a units identifier, the return is\n * `undefined`.\n * @return {number|undefined} Meters.\n * @api\n */\n Projection.prototype.getMetersPerUnit = function () {\n return this.metersPerUnit_ || METERS_PER_UNIT[this.units_];\n };\n /**\n * Get the world extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n Projection.prototype.getWorldExtent = function () {\n return this.worldExtent_;\n };\n /**\n * Get the axis orientation of this projection.\n * Example values are:\n * enu - the default easting, northing, elevation.\n * neu - northing, easting, up - useful for \"lat/long\" geographic coordinates,\n * or south orientated transverse mercator.\n * wnu - westing, northing, up - some planetary coordinate systems have\n * \"west positive\" coordinate systems\n * @return {string} Axis orientation.\n * @api\n */\n Projection.prototype.getAxisOrientation = function () {\n return this.axisOrientation_;\n };\n /**\n * Is this projection a global projection which spans the whole world?\n * @return {boolean} Whether the projection is global.\n * @api\n */\n Projection.prototype.isGlobal = function () {\n return this.global_;\n };\n /**\n * Set if the projection is a global projection which spans the whole world\n * @param {boolean} global Whether the projection is global.\n * @api\n */\n Projection.prototype.setGlobal = function (global) {\n this.global_ = global;\n this.canWrapX_ = !!(global && this.extent_);\n };\n /**\n * @return {import(\"../tilegrid/TileGrid.js\").default} The default tile grid.\n */\n Projection.prototype.getDefaultTileGrid = function () {\n return this.defaultTileGrid_;\n };\n /**\n * @param {import(\"../tilegrid/TileGrid.js\").default} tileGrid The default tile grid.\n */\n Projection.prototype.setDefaultTileGrid = function (tileGrid) {\n this.defaultTileGrid_ = tileGrid;\n };\n /**\n * Set the validity extent for this projection.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n Projection.prototype.setExtent = function (extent) {\n this.extent_ = extent;\n this.canWrapX_ = !!(this.global_ && extent);\n };\n /**\n * Set the world extent for this projection.\n * @param {import(\"../extent.js\").Extent} worldExtent World extent\n * [minlon, minlat, maxlon, maxlat].\n * @api\n */\n Projection.prototype.setWorldExtent = function (worldExtent) {\n this.worldExtent_ = worldExtent;\n };\n /**\n * Set the getPointResolution function (see {@link module:ol/proj~getPointResolution}\n * for this projection.\n * @param {function(number, import(\"../coordinate.js\").Coordinate):number} func Function\n * @api\n */\n Projection.prototype.setGetPointResolution = function (func) {\n this.getPointResolutionFunc_ = func;\n };\n /**\n * Get the custom point resolution function for this projection (if set).\n * @return {function(number, import(\"../coordinate.js\").Coordinate):number|undefined} The custom point\n * resolution function (if set).\n */\n Projection.prototype.getPointResolutionFunc = function () {\n return this.getPointResolutionFunc_;\n };\n return Projection;\n}());\nexport default Projection;\n//# sourceMappingURL=Projection.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/proj/epsg3857\n */\nimport { cosh } from '../math.js';\nimport Projection from './Projection.js';\nimport Units from './Units.js';\n/**\n * Radius of WGS84 sphere\n *\n * @const\n * @type {number}\n */\nexport var RADIUS = 6378137;\n/**\n * @const\n * @type {number}\n */\nexport var HALF_SIZE = Math.PI * RADIUS;\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport var EXTENT = [\n -HALF_SIZE, -HALF_SIZE,\n HALF_SIZE, HALF_SIZE\n];\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport var WORLD_EXTENT = [-180, -85, 180, 85];\n/**\n * @classdesc\n * Projection object for web/spherical Mercator (EPSG:3857).\n */\nvar EPSG3857Projection = /** @class */ (function (_super) {\n __extends(EPSG3857Projection, _super);\n /**\n * @param {string} code Code.\n */\n function EPSG3857Projection(code) {\n return _super.call(this, {\n code: code,\n units: Units.METERS,\n extent: EXTENT,\n global: true,\n worldExtent: WORLD_EXTENT,\n getPointResolution: function (resolution, point) {\n return resolution / cosh(point[1] / RADIUS);\n }\n }) || this;\n }\n return EPSG3857Projection;\n}(Projection));\n/**\n * Projections equal to EPSG:3857.\n *\n * @const\n * @type {Array<import(\"./Projection.js\").default>}\n */\nexport var PROJECTIONS = [\n new EPSG3857Projection('EPSG:3857'),\n new EPSG3857Projection('EPSG:102100'),\n new EPSG3857Projection('EPSG:102113'),\n new EPSG3857Projection('EPSG:900913'),\n new EPSG3857Projection('urn:ogc:def:crs:EPSG:6.18:3:3857'),\n new EPSG3857Projection('urn:ogc:def:crs:EPSG::3857'),\n new EPSG3857Projection('http://www.opengis.net/gml/srs/epsg.xml#3857')\n];\n/**\n * Transformation from EPSG:4326 to EPSG:3857.\n *\n * @param {Array<number>} input Input array of coordinate values.\n * @param {Array<number>=} opt_output Output array of coordinate values.\n * @param {number=} opt_dimension Dimension (default is `2`).\n * @return {Array<number>} Output array of coordinate values.\n */\nexport function fromEPSG4326(input, opt_output, opt_dimension) {\n var length = input.length;\n var dimension = opt_dimension > 1 ? opt_dimension : 2;\n var output = opt_output;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n }\n else {\n output = new Array(length);\n }\n }\n var halfSize = HALF_SIZE;\n for (var i = 0; i < length; i += dimension) {\n output[i] = halfSize * input[i] / 180;\n var y = RADIUS *\n Math.log(Math.tan(Math.PI * (+input[i + 1] + 90) / 360));\n if (y > halfSize) {\n y = halfSize;\n }\n else if (y < -halfSize) {\n y = -halfSize;\n }\n output[i + 1] = y;\n }\n return output;\n}\n/**\n * Transformation from EPSG:3857 to EPSG:4326.\n *\n * @param {Array<number>} input Input array of coordinate values.\n * @param {Array<number>=} opt_output Output array of coordinate values.\n * @param {number=} opt_dimension Dimension (default is `2`).\n * @return {Array<number>} Output array of coordinate values.\n */\nexport function toEPSG4326(input, opt_output, opt_dimension) {\n var length = input.length;\n var dimension = opt_dimension > 1 ? opt_dimension : 2;\n var output = opt_output;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n }\n else {\n output = new Array(length);\n }\n }\n for (var i = 0; i < length; i += dimension) {\n output[i] = 180 * input[i] / HALF_SIZE;\n output[i + 1] = 360 * Math.atan(Math.exp(input[i + 1] / RADIUS)) / Math.PI - 90;\n }\n return output;\n}\n//# sourceMappingURL=epsg3857.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/proj/epsg4326\n */\nimport Projection from './Projection.js';\nimport Units from './Units.js';\n/**\n * Semi-major radius of the WGS84 ellipsoid.\n *\n * @const\n * @type {number}\n */\nexport var RADIUS = 6378137;\n/**\n * Extent of the EPSG:4326 projection which is the whole world.\n *\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport var EXTENT = [-180, -90, 180, 90];\n/**\n * @const\n * @type {number}\n */\nexport var METERS_PER_UNIT = Math.PI * RADIUS / 180;\n/**\n * @classdesc\n * Projection object for WGS84 geographic coordinates (EPSG:4326).\n *\n * Note that OpenLayers does not strictly comply with the EPSG definition.\n * The EPSG registry defines 4326 as a CRS for Latitude,Longitude (y,x).\n * OpenLayers treats EPSG:4326 as a pseudo-projection, with x,y coordinates.\n */\nvar EPSG4326Projection = /** @class */ (function (_super) {\n __extends(EPSG4326Projection, _super);\n /**\n * @param {string} code Code.\n * @param {string=} opt_axisOrientation Axis orientation.\n */\n function EPSG4326Projection(code, opt_axisOrientation) {\n return _super.call(this, {\n code: code,\n units: Units.DEGREES,\n extent: EXTENT,\n axisOrientation: opt_axisOrientation,\n global: true,\n metersPerUnit: METERS_PER_UNIT,\n worldExtent: EXTENT\n }) || this;\n }\n return EPSG4326Projection;\n}(Projection));\n/**\n * Projections equal to EPSG:4326.\n *\n * @const\n * @type {Array<import(\"./Projection.js\").default>}\n */\nexport var PROJECTIONS = [\n new EPSG4326Projection('CRS:84'),\n new EPSG4326Projection('EPSG:4326', 'neu'),\n new EPSG4326Projection('urn:ogc:def:crs:EPSG::4326', 'neu'),\n new EPSG4326Projection('urn:ogc:def:crs:EPSG:6.6:4326', 'neu'),\n new EPSG4326Projection('urn:ogc:def:crs:OGC:1.3:CRS84'),\n new EPSG4326Projection('urn:ogc:def:crs:OGC:2:84'),\n new EPSG4326Projection('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'),\n new EPSG4326Projection('urn:x-ogc:def:crs:EPSG:4326', 'neu')\n];\n//# sourceMappingURL=epsg4326.js.map","/**\n * @module ol/proj/transforms\n */\nimport { isEmpty } from '../obj.js';\n/**\n * @private\n * @type {!Object<string, Object<string, import(\"../proj.js\").TransformFunction>>}\n */\nvar transforms = {};\n/**\n * Clear the transform cache.\n */\nexport function clear() {\n transforms = {};\n}\n/**\n * Registers a conversion function to convert coordinates from the source\n * projection to the destination projection.\n *\n * @param {import(\"./Projection.js\").default} source Source.\n * @param {import(\"./Projection.js\").default} destination Destination.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform.\n */\nexport function add(source, destination, transformFn) {\n var sourceCode = source.getCode();\n var destinationCode = destination.getCode();\n if (!(sourceCode in transforms)) {\n transforms[sourceCode] = {};\n }\n transforms[sourceCode][destinationCode] = transformFn;\n}\n/**\n * Unregisters the conversion function to convert coordinates from the source\n * projection to the destination projection. This method is used to clean up\n * cached transforms during testing.\n *\n * @param {import(\"./Projection.js\").default} source Source projection.\n * @param {import(\"./Projection.js\").default} destination Destination projection.\n * @return {import(\"../proj.js\").TransformFunction} transformFn The unregistered transform.\n */\nexport function remove(source, destination) {\n var sourceCode = source.getCode();\n var destinationCode = destination.getCode();\n var transform = transforms[sourceCode][destinationCode];\n delete transforms[sourceCode][destinationCode];\n if (isEmpty(transforms[sourceCode])) {\n delete transforms[sourceCode];\n }\n return transform;\n}\n/**\n * Get a transform given a source code and a destination code.\n * @param {string} sourceCode The code for the source projection.\n * @param {string} destinationCode The code for the destination projection.\n * @return {import(\"../proj.js\").TransformFunction|undefined} The transform function (if found).\n */\nexport function get(sourceCode, destinationCode) {\n var transform;\n if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {\n transform = transforms[sourceCode][destinationCode];\n }\n return transform;\n}\n//# sourceMappingURL=transforms.js.map","/**\n * @module ol/proj/projections\n */\n/**\n * @type {Object<string, import(\"./Projection.js\").default>}\n */\nvar cache = {};\n/**\n * Clear the projections cache.\n */\nexport function clear() {\n cache = {};\n}\n/**\n * Get a cached projection by code.\n * @param {string} code The code for the projection.\n * @return {import(\"./Projection.js\").default} The projection (if cached).\n */\nexport function get(code) {\n return cache[code] || null;\n}\n/**\n * Add a projection to the cache.\n * @param {string} code The projection code.\n * @param {import(\"./Projection.js\").default} projection The projection to cache.\n */\nexport function add(code, projection) {\n cache[code] = projection;\n}\n//# sourceMappingURL=projections.js.map","/**\n * @module ol/proj\n */\n/**\n * The ol/proj module stores:\n * * a list of {@link module:ol/proj/Projection}\n * objects, one for each projection supported by the application\n * * a list of transform functions needed to convert coordinates in one projection\n * into another.\n *\n * The static functions are the methods used to maintain these.\n * Each transform function can handle not only simple coordinate pairs, but also\n * large arrays of coordinates such as vector geometries.\n *\n * When loaded, the library adds projection objects for EPSG:4326 (WGS84\n * geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used\n * for example by Bing Maps or OpenStreetMap), together with the relevant\n * transform functions.\n *\n * Additional transforms may be added by using the http://proj4js.org/\n * library (version 2.2 or later). You can use the full build supplied by\n * Proj4js, or create a custom build to support those projections you need; see\n * the Proj4js website for how to do this. You also need the Proj4js definitions\n * for the required projections. These definitions can be obtained from\n * https://epsg.io/, and are a JS function, so can be loaded in a script\n * tag (as in the examples) or pasted into your application.\n *\n * After all required projection definitions are added to proj4's registry (by\n * using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4`\n * package. Existing transforms are not changed by this function. See\n * examples/wms-image-custom-proj for an example of this.\n *\n * Additional projection definitions can be registered with `proj4.defs()` any\n * time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't\n * know in advance what projections are needed, you can initially load minimal\n * support and then load whichever are requested.\n *\n * Note that Proj4js does not support projection extents. If you want to add\n * one for creating default tile grids, you can add it after the Projection\n * object has been created with `setExtent`, for example,\n * `get('EPSG:1234').setExtent(extent)`.\n *\n * In addition to Proj4js support, any transform functions can be added with\n * {@link module:ol/proj~addCoordinateTransforms}. To use this, you must first create\n * a {@link module:ol/proj/Projection} object for the new projection and add it with\n * {@link module:ol/proj~addProjection}. You can then add the forward and inverse\n * functions with {@link module:ol/proj~addCoordinateTransforms}. See\n * examples/wms-custom-proj for an example of this.\n *\n * Note that if no transforms are needed and you only need to define the\n * projection, just add a {@link module:ol/proj/Projection} with\n * {@link module:ol/proj~addProjection}. See examples/wms-no-proj for an example of\n * this.\n */\nimport { getDistance } from './sphere.js';\nimport { applyTransform } from './extent.js';\nimport { modulo } from './math.js';\nimport { toEPSG4326, fromEPSG4326, PROJECTIONS as EPSG3857_PROJECTIONS } from './proj/epsg3857.js';\nimport { PROJECTIONS as EPSG4326_PROJECTIONS } from './proj/epsg4326.js';\nimport Projection from './proj/Projection.js';\nimport Units, { METERS_PER_UNIT } from './proj/Units.js';\nimport { add as addTransformFunc, clear as clearTransformFuncs, get as getTransformFunc } from './proj/transforms.js';\nimport { add as addProj, clear as clearProj, get as getProj } from './proj/projections.js';\n/**\n * A projection as {@link module:ol/proj/Projection}, SRS identifier\n * string or undefined.\n * @typedef {Projection|string|undefined} ProjectionLike\n * @api\n */\n/**\n * A transform function accepts an array of input coordinate values, an optional\n * output array, and an optional dimension (default should be 2). The function\n * transforms the input coordinate values, populates the output array, and\n * returns the output array.\n *\n * @typedef {function(Array<number>, Array<number>=, number=): Array<number>} TransformFunction\n * @api\n */\nexport { METERS_PER_UNIT };\nexport { Projection };\n/**\n * @param {Array<number>} input Input coordinate array.\n * @param {Array<number>=} opt_output Output array of coordinate values.\n * @param {number=} opt_dimension Dimension.\n * @return {Array<number>} Output coordinate array (new array, same coordinate\n * values).\n */\nexport function cloneTransform(input, opt_output, opt_dimension) {\n var output;\n if (opt_output !== undefined) {\n for (var i = 0, ii = input.length; i < ii; ++i) {\n opt_output[i] = input[i];\n }\n output = opt_output;\n }\n else {\n output = input.slice();\n }\n return output;\n}\n/**\n * @param {Array<number>} input Input coordinate array.\n * @param {Array<number>=} opt_output Output array of coordinate values.\n * @param {number=} opt_dimension Dimension.\n * @return {Array<number>} Input coordinate array (same array as input).\n */\nexport function identityTransform(input, opt_output, opt_dimension) {\n if (opt_output !== undefined && input !== opt_output) {\n for (var i = 0, ii = input.length; i < ii; ++i) {\n opt_output[i] = input[i];\n }\n input = opt_output;\n }\n return input;\n}\n/**\n * Add a Projection object to the list of supported projections that can be\n * looked up by their code.\n *\n * @param {Projection} projection Projection instance.\n * @api\n */\nexport function addProjection(projection) {\n addProj(projection.getCode(), projection);\n addTransformFunc(projection, projection, cloneTransform);\n}\n/**\n * @param {Array<Projection>} projections Projections.\n */\nexport function addProjections(projections) {\n projections.forEach(addProjection);\n}\n/**\n * Fetches a Projection object for the code specified.\n *\n * @param {ProjectionLike} projectionLike Either a code string which is\n * a combination of authority and identifier such as \"EPSG:4326\", or an\n * existing projection object, or undefined.\n * @return {Projection} Projection object, or null if not in list.\n * @api\n */\nexport function get(projectionLike) {\n return typeof projectionLike === 'string' ?\n getProj(/** @type {string} */ (projectionLike)) :\n ( /** @type {Projection} */(projectionLike) || null);\n}\n/**\n * Get the resolution of the point in degrees or distance units.\n * For projections with degrees as the unit this will simply return the\n * provided resolution. For other projections the point resolution is\n * by default estimated by transforming the 'point' pixel to EPSG:4326,\n * measuring its width and height on the normal sphere,\n * and taking the average of the width and height.\n * A custom function can be provided for a specific projection, either\n * by setting the `getPointResolution` option in the\n * {@link module:ol/proj/Projection~Projection} constructor or by using\n * {@link module:ol/proj/Projection~Projection#setGetPointResolution} to change an existing\n * projection object.\n * @param {ProjectionLike} projection The projection.\n * @param {number} resolution Nominal resolution in projection units.\n * @param {import(\"./coordinate.js\").Coordinate} point Point to find adjusted resolution at.\n * @param {Units=} opt_units Units to get the point resolution in.\n * Default is the projection's units.\n * @return {number} Point resolution.\n * @api\n */\nexport function getPointResolution(projection, resolution, point, opt_units) {\n projection = get(projection);\n var pointResolution;\n var getter = projection.getPointResolutionFunc();\n if (getter) {\n pointResolution = getter(resolution, point);\n if (opt_units && opt_units !== projection.getUnits()) {\n var metersPerUnit = projection.getMetersPerUnit();\n if (metersPerUnit) {\n pointResolution = pointResolution * metersPerUnit / METERS_PER_UNIT[opt_units];\n }\n }\n }\n else {\n var units = projection.getUnits();\n if (units == Units.DEGREES && !opt_units || opt_units == Units.DEGREES) {\n pointResolution = resolution;\n }\n else {\n // Estimate point resolution by transforming the center pixel to EPSG:4326,\n // measuring its width and height on the normal sphere, and taking the\n // average of the width and height.\n var toEPSG4326_1 = getTransformFromProjections(projection, get('EPSG:4326'));\n var vertices = [\n point[0] - resolution / 2, point[1],\n point[0] + resolution / 2, point[1],\n point[0], point[1] - resolution / 2,\n point[0], point[1] + resolution / 2\n ];\n vertices = toEPSG4326_1(vertices, vertices, 2);\n var width = getDistance(vertices.slice(0, 2), vertices.slice(2, 4));\n var height = getDistance(vertices.slice(4, 6), vertices.slice(6, 8));\n pointResolution = (width + height) / 2;\n var metersPerUnit = opt_units ?\n METERS_PER_UNIT[opt_units] :\n projection.getMetersPerUnit();\n if (metersPerUnit !== undefined) {\n pointResolution /= metersPerUnit;\n }\n }\n }\n return pointResolution;\n}\n/**\n * Registers transformation functions that don't alter coordinates. Those allow\n * to transform between projections with equal meaning.\n *\n * @param {Array<Projection>} projections Projections.\n * @api\n */\nexport function addEquivalentProjections(projections) {\n addProjections(projections);\n projections.forEach(function (source) {\n projections.forEach(function (destination) {\n if (source !== destination) {\n addTransformFunc(source, destination, cloneTransform);\n }\n });\n });\n}\n/**\n * Registers transformation functions to convert coordinates in any projection\n * in projection1 to any projection in projection2.\n *\n * @param {Array<Projection>} projections1 Projections with equal\n * meaning.\n * @param {Array<Projection>} projections2 Projections with equal\n * meaning.\n * @param {TransformFunction} forwardTransform Transformation from any\n * projection in projection1 to any projection in projection2.\n * @param {TransformFunction} inverseTransform Transform from any projection\n * in projection2 to any projection in projection1..\n */\nexport function addEquivalentTransforms(projections1, projections2, forwardTransform, inverseTransform) {\n projections1.forEach(function (projection1) {\n projections2.forEach(function (projection2) {\n addTransformFunc(projection1, projection2, forwardTransform);\n addTransformFunc(projection2, projection1, inverseTransform);\n });\n });\n}\n/**\n * Clear all cached projections and transforms.\n */\nexport function clearAllProjections() {\n clearProj();\n clearTransformFuncs();\n}\n/**\n * @param {Projection|string|undefined} projection Projection.\n * @param {string} defaultCode Default code.\n * @return {Projection} Projection.\n */\nexport function createProjection(projection, defaultCode) {\n if (!projection) {\n return get(defaultCode);\n }\n else if (typeof projection === 'string') {\n return get(projection);\n }\n else {\n return (\n /** @type {Projection} */ (projection));\n }\n}\n/**\n * Creates a {@link module:ol/proj~TransformFunction} from a simple 2D coordinate transform\n * function.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} coordTransform Coordinate\n * transform.\n * @return {TransformFunction} Transform function.\n */\nexport function createTransformFromCoordinateTransform(coordTransform) {\n return (\n /**\n * @param {Array<number>} input Input.\n * @param {Array<number>=} opt_output Output.\n * @param {number=} opt_dimension Dimension.\n * @return {Array<number>} Output.\n */\n function (input, opt_output, opt_dimension) {\n var length = input.length;\n var dimension = opt_dimension !== undefined ? opt_dimension : 2;\n var output = opt_output !== undefined ? opt_output : new Array(length);\n for (var i = 0; i < length; i += dimension) {\n var point = coordTransform([input[i], input[i + 1]]);\n output[i] = point[0];\n output[i + 1] = point[1];\n for (var j = dimension - 1; j >= 2; --j) {\n output[i + j] = input[i + j];\n }\n }\n return output;\n });\n}\n/**\n * Registers coordinate transform functions to convert coordinates between the\n * source projection and the destination projection.\n * The forward and inverse functions convert coordinate pairs; this function\n * converts these into the functions used internally which also handle\n * extents and coordinate arrays.\n *\n * @param {ProjectionLike} source Source projection.\n * @param {ProjectionLike} destination Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} forward The forward transform\n * function (that is, from the source projection to the destination\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} inverse The inverse transform\n * function (that is, from the destination projection to the source\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}.\n * @api\n */\nexport function addCoordinateTransforms(source, destination, forward, inverse) {\n var sourceProj = get(source);\n var destProj = get(destination);\n addTransformFunc(sourceProj, destProj, createTransformFromCoordinateTransform(forward));\n addTransformFunc(destProj, sourceProj, createTransformFromCoordinateTransform(inverse));\n}\n/**\n * Transforms a coordinate from longitude/latitude to a different projection.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate as longitude and latitude, i.e.\n * an array with longitude as 1st and latitude as 2nd element.\n * @param {ProjectionLike=} opt_projection Target projection. The\n * default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate projected to the target projection.\n * @api\n */\nexport function fromLonLat(coordinate, opt_projection) {\n return transform(coordinate, 'EPSG:4326', opt_projection !== undefined ? opt_projection : 'EPSG:3857');\n}\n/**\n * Transforms a coordinate to longitude/latitude.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Projected coordinate.\n * @param {ProjectionLike=} opt_projection Projection of the coordinate.\n * The default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate as longitude and latitude, i.e. an array\n * with longitude as 1st and latitude as 2nd element.\n * @api\n */\nexport function toLonLat(coordinate, opt_projection) {\n var lonLat = transform(coordinate, opt_projection !== undefined ? opt_projection : 'EPSG:3857', 'EPSG:4326');\n var lon = lonLat[0];\n if (lon < -180 || lon > 180) {\n lonLat[0] = modulo(lon + 180, 360) - 180;\n }\n return lonLat;\n}\n/**\n * Checks if two projections are the same, that is every coordinate in one\n * projection does represent the same geographic point as the same coordinate in\n * the other projection.\n *\n * @param {Projection} projection1 Projection 1.\n * @param {Projection} projection2 Projection 2.\n * @return {boolean} Equivalent.\n * @api\n */\nexport function equivalent(projection1, projection2) {\n if (projection1 === projection2) {\n return true;\n }\n var equalUnits = projection1.getUnits() === projection2.getUnits();\n if (projection1.getCode() === projection2.getCode()) {\n return equalUnits;\n }\n else {\n var transformFunc = getTransformFromProjections(projection1, projection2);\n return transformFunc === cloneTransform && equalUnits;\n }\n}\n/**\n * Searches in the list of transform functions for the function for converting\n * coordinates from the source projection to the destination projection.\n *\n * @param {Projection} sourceProjection Source Projection object.\n * @param {Projection} destinationProjection Destination Projection\n * object.\n * @return {TransformFunction} Transform function.\n */\nexport function getTransformFromProjections(sourceProjection, destinationProjection) {\n var sourceCode = sourceProjection.getCode();\n var destinationCode = destinationProjection.getCode();\n var transformFunc = getTransformFunc(sourceCode, destinationCode);\n if (!transformFunc) {\n transformFunc = identityTransform;\n }\n return transformFunc;\n}\n/**\n * Given the projection-like objects, searches for a transformation\n * function to convert a coordinates array from the source projection to the\n * destination projection.\n *\n * @param {ProjectionLike} source Source.\n * @param {ProjectionLike} destination Destination.\n * @return {TransformFunction} Transform function.\n * @api\n */\nexport function getTransform(source, destination) {\n var sourceProjection = get(source);\n var destinationProjection = get(destination);\n return getTransformFromProjections(sourceProjection, destinationProjection);\n}\n/**\n * Transforms a coordinate from source projection to destination projection.\n * This returns a new coordinate (and does not modify the original).\n *\n * See {@link module:ol/proj~transformExtent} for extent transformation.\n * See the transform method of {@link module:ol/geom/Geometry~Geometry} and its\n * subclasses for geometry transforms.\n *\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\nexport function transform(coordinate, source, destination) {\n var transformFunc = getTransform(source, destination);\n return transformFunc(coordinate, undefined, coordinate.length);\n}\n/**\n * Transforms an extent from source projection to destination projection. This\n * returns a new extent (and does not modify the original).\n *\n * @param {import(\"./extent.js\").Extent} extent The extent to transform.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @return {import(\"./extent.js\").Extent} The transformed extent.\n * @api\n */\nexport function transformExtent(extent, source, destination) {\n var transformFunc = getTransform(source, destination);\n return applyTransform(extent, transformFunc);\n}\n/**\n * Transforms the given point to the destination projection.\n *\n * @param {import(\"./coordinate.js\").Coordinate} point Point.\n * @param {Projection} sourceProjection Source projection.\n * @param {Projection} destinationProjection Destination projection.\n * @return {import(\"./coordinate.js\").Coordinate} Point.\n */\nexport function transformWithProjections(point, sourceProjection, destinationProjection) {\n var transformFunc = getTransformFromProjections(sourceProjection, destinationProjection);\n return transformFunc(point);\n}\n/**\n * @type {?Projection}\n */\nvar userProjection = null;\n/**\n * Set the projection for coordinates supplied from and returned by API methods.\n * Note that this method is not yet a part of the stable API. Support for user\n * projections is not yet complete and should be considered experimental.\n * @param {ProjectionLike} projection The user projection.\n */\nexport function setUserProjection(projection) {\n userProjection = get(projection);\n}\n/**\n * Clear the user projection if set. Note that this method is not yet a part of\n * the stable API. Support for user projections is not yet complete and should\n * be considered experimental.\n */\nexport function clearUserProjection() {\n userProjection = null;\n}\n/**\n * Get the projection for coordinates supplied from and returned by API methods.\n * Note that this method is not yet a part of the stable API. Support for user\n * projections is not yet complete and should be considered experimental.\n * @returns {?Projection} The user projection (or null if not set).\n */\nexport function getUserProjection() {\n return userProjection;\n}\n/**\n * Use geographic coordinates (WGS-84 datum) in API methods. Note that this\n * method is not yet a part of the stable API. Support for user projections is\n * not yet complete and should be considered experimental.\n */\nexport function useGeographic() {\n setUserProjection('EPSG:4326');\n}\n/**\n * Return a coordinate transformed into the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array<number>} coordinate Input coordinate.\n * @param {ProjectionLike} sourceProjection The input coordinate projection.\n * @returns {Array<number>} The input coordinate in the user projection.\n */\nexport function toUserCoordinate(coordinate, sourceProjection) {\n if (!userProjection) {\n return coordinate;\n }\n return transform(coordinate, sourceProjection, userProjection);\n}\n/**\n * Return a coordinate transformed from the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array<number>} coordinate Input coordinate.\n * @param {ProjectionLike} destProjection The destination projection.\n * @returns {Array<number>} The input coordinate transformed.\n */\nexport function fromUserCoordinate(coordinate, destProjection) {\n if (!userProjection) {\n return coordinate;\n }\n return transform(coordinate, userProjection, destProjection);\n}\n/**\n * Return an extent transformed into the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} sourceProjection The input extent projection.\n * @returns {import(\"./extent.js\").Extent} The input extent in the user projection.\n */\nexport function toUserExtent(extent, sourceProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, sourceProjection, userProjection);\n}\n/**\n * Return an extent transformed from the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} destProjection The destination projection.\n * @returns {import(\"./extent.js\").Extent} The input extent transformed.\n */\nexport function fromUserExtent(extent, destProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, userProjection, destProjection);\n}\n/**\n * Add transforms to and from EPSG:4326 and EPSG:3857. This function is called\n * by when this module is executed and should only need to be called again after\n * `clearAllProjections()` is called (e.g. in tests).\n */\nexport function addCommon() {\n // Add transformations that don't alter coordinates to convert within set of\n // projections with equal meaning.\n addEquivalentProjections(EPSG3857_PROJECTIONS);\n addEquivalentProjections(EPSG4326_PROJECTIONS);\n // Add transformations to convert EPSG:4326 like coordinates to EPSG:3857 like\n // coordinates and back.\n addEquivalentTransforms(EPSG4326_PROJECTIONS, EPSG3857_PROJECTIONS, fromEPSG4326, toEPSG4326);\n}\naddCommon();\n//# sourceMappingURL=proj.js.map","/**\n * @module ol/transform\n */\nimport { assert } from './asserts.js';\n/**\n * An array representing an affine 2d transformation for use with\n * {@link module:ol/transform} functions. The array has 6 elements.\n * @typedef {!Array<number>} Transform\n */\n/**\n * Collection of affine 2d transformation functions. The functions work on an\n * array of 6 elements. The element order is compatible with the [SVGMatrix\n * interface](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) and is\n * a subset (elements a to f) of a 3×3 matrix:\n * ```\n * [ a c e ]\n * [ b d f ]\n * [ 0 0 1 ]\n * ```\n */\n/**\n * @private\n * @type {Transform}\n */\nvar tmp_ = new Array(6);\n/**\n * Create an identity transform.\n * @return {!Transform} Identity transform.\n */\nexport function create() {\n return [1, 0, 0, 1, 0, 0];\n}\n/**\n * Resets the given transform to an identity transform.\n * @param {!Transform} transform Transform.\n * @return {!Transform} Transform.\n */\nexport function reset(transform) {\n return set(transform, 1, 0, 0, 1, 0, 0);\n}\n/**\n * Multiply the underlying matrices of two transforms and return the result in\n * the first transform.\n * @param {!Transform} transform1 Transform parameters of matrix 1.\n * @param {!Transform} transform2 Transform parameters of matrix 2.\n * @return {!Transform} transform1 multiplied with transform2.\n */\nexport function multiply(transform1, transform2) {\n var a1 = transform1[0];\n var b1 = transform1[1];\n var c1 = transform1[2];\n var d1 = transform1[3];\n var e1 = transform1[4];\n var f1 = transform1[5];\n var a2 = transform2[0];\n var b2 = transform2[1];\n var c2 = transform2[2];\n var d2 = transform2[3];\n var e2 = transform2[4];\n var f2 = transform2[5];\n transform1[0] = a1 * a2 + c1 * b2;\n transform1[1] = b1 * a2 + d1 * b2;\n transform1[2] = a1 * c2 + c1 * d2;\n transform1[3] = b1 * c2 + d1 * d2;\n transform1[4] = a1 * e2 + c1 * f2 + e1;\n transform1[5] = b1 * e2 + d1 * f2 + f1;\n return transform1;\n}\n/**\n * Set the transform components a-f on a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} a The a component of the transform.\n * @param {number} b The b component of the transform.\n * @param {number} c The c component of the transform.\n * @param {number} d The d component of the transform.\n * @param {number} e The e component of the transform.\n * @param {number} f The f component of the transform.\n * @return {!Transform} Matrix with transform applied.\n */\nexport function set(transform, a, b, c, d, e, f) {\n transform[0] = a;\n transform[1] = b;\n transform[2] = c;\n transform[3] = d;\n transform[4] = e;\n transform[5] = f;\n return transform;\n}\n/**\n * Set transform on one matrix from another matrix.\n * @param {!Transform} transform1 Matrix to set transform to.\n * @param {!Transform} transform2 Matrix to set transform from.\n * @return {!Transform} transform1 with transform from transform2 applied.\n */\nexport function setFromArray(transform1, transform2) {\n transform1[0] = transform2[0];\n transform1[1] = transform2[1];\n transform1[2] = transform2[2];\n transform1[3] = transform2[3];\n transform1[4] = transform2[4];\n transform1[5] = transform2[5];\n return transform1;\n}\n/**\n * Transforms the given coordinate with the given transform returning the\n * resulting, transformed coordinate. The coordinate will be modified in-place.\n *\n * @param {Transform} transform The transformation.\n * @param {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} coordinate The coordinate to transform.\n * @return {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} return coordinate so that operations can be\n * chained together.\n */\nexport function apply(transform, coordinate) {\n var x = coordinate[0];\n var y = coordinate[1];\n coordinate[0] = transform[0] * x + transform[2] * y + transform[4];\n coordinate[1] = transform[1] * x + transform[3] * y + transform[5];\n return coordinate;\n}\n/**\n * Applies rotation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} angle Angle in radians.\n * @return {!Transform} The rotated transform.\n */\nexport function rotate(transform, angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0));\n}\n/**\n * Applies scale to a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scaled transform.\n */\nexport function scale(transform, x, y) {\n return multiply(transform, set(tmp_, x, 0, 0, y, 0, 0));\n}\n/**\n * Creates a scale transform.\n * @param {!Transform} target Transform to overwrite.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scale transform.\n */\nexport function makeScale(target, x, y) {\n return set(target, x, 0, 0, y, 0, 0);\n}\n/**\n * Applies translation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} dx Translation x.\n * @param {number} dy Translation y.\n * @return {!Transform} The translated transform.\n */\nexport function translate(transform, dx, dy) {\n return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy));\n}\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative).\n * @param {!Transform} transform The transform (will be modified in place).\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {!Transform} The composite transform.\n */\nexport function compose(transform, dx1, dy1, sx, sy, angle, dx2, dy2) {\n var sin = Math.sin(angle);\n var cos = Math.cos(angle);\n transform[0] = sx * cos;\n transform[1] = sy * sin;\n transform[2] = -sx * sin;\n transform[3] = sy * cos;\n transform[4] = dx2 * sx * cos - dy2 * sx * sin + dx1;\n transform[5] = dx2 * sy * sin + dy2 * sy * cos + dy1;\n return transform;\n}\n/**\n * Invert the given transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (source) transform.\n */\nexport function invert(source) {\n return makeInverse(source, source);\n}\n/**\n * Invert the given transform.\n * @param {!Transform} target Transform to be set as the inverse of\n * the source transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (target) transform.\n */\nexport function makeInverse(target, source) {\n var det = determinant(source);\n assert(det !== 0, 32); // Transformation matrix cannot be inverted\n var a = source[0];\n var b = source[1];\n var c = source[2];\n var d = source[3];\n var e = source[4];\n var f = source[5];\n target[0] = d / det;\n target[1] = -b / det;\n target[2] = -c / det;\n target[3] = a / det;\n target[4] = (c * f - d * e) / det;\n target[5] = -(a * f - b * e) / det;\n return target;\n}\n/**\n * Returns the determinant of the given matrix.\n * @param {!Transform} mat Matrix.\n * @return {number} Determinant.\n */\nexport function determinant(mat) {\n return mat[0] * mat[3] - mat[1] * mat[2];\n}\n/**\n * A string version of the transform. This can be used\n * for CSS transforms.\n * @param {!Transform} mat Matrix.\n * @return {string} The transform as a string.\n */\nexport function toString(mat) {\n return 'matrix(' + mat.join(', ') + ')';\n}\n//# sourceMappingURL=transform.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Geometry\n */\nimport { abstract } from '../util.js';\nimport BaseObject from '../Object.js';\nimport { createEmpty, getHeight, returnOrUpdate } from '../extent.js';\nimport { transform2D } from './flat/transform.js';\nimport { get as getProjection, getTransform } from '../proj.js';\nimport Units from '../proj/Units.js';\nimport { create as createTransform, compose as composeTransform } from '../transform.js';\nimport { memoizeOne } from '../functions.js';\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nvar tmpTransform = createTransform();\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for vector geometries.\n *\n * To get notified of changes to the geometry, register a listener for the\n * generic `change` event on your geometry instance.\n *\n * @abstract\n * @api\n */\nvar Geometry = /** @class */ (function (_super) {\n __extends(Geometry, _super);\n function Geometry() {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.extent_ = createEmpty();\n /**\n * @private\n * @type {number}\n */\n _this.extentRevision_ = -1;\n /**\n * @protected\n * @type {number}\n */\n _this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n /**\n * @protected\n * @type {number}\n */\n _this.simplifiedGeometryRevision = 0;\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} revision The geometry revision.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n _this.simplifyTransformedInternal = memoizeOne(function (revision, squaredTolerance, opt_transform) {\n if (!opt_transform) {\n return this.getSimplifiedGeometry(squaredTolerance);\n }\n var clone = this.clone();\n clone.applyTransform(opt_transform);\n return clone.getSimplifiedGeometry(squaredTolerance);\n });\n return _this;\n }\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n Geometry.prototype.simplifyTransformed = function (squaredTolerance, opt_transform) {\n return this.simplifyTransformedInternal(this.getRevision(), squaredTolerance, opt_transform);\n };\n /**\n * Make a complete copy of the geometry.\n * @abstract\n * @return {!Geometry} Clone.\n */\n Geometry.prototype.clone = function () {\n return abstract();\n };\n /**\n * @abstract\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n Geometry.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n return abstract();\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n Geometry.prototype.containsXY = function (x, y) {\n var coord = this.getClosestPoint([x, y]);\n return coord[0] === x && coord[1] === y;\n };\n /**\n * Return the closest point of the geometry to the passed point as\n * {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} point Point.\n * @param {import(\"../coordinate.js\").Coordinate=} opt_closestPoint Closest point.\n * @return {import(\"../coordinate.js\").Coordinate} Closest point.\n * @api\n */\n Geometry.prototype.getClosestPoint = function (point, opt_closestPoint) {\n var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN];\n this.closestPointXY(point[0], point[1], closestPoint, Infinity);\n return closestPoint;\n };\n /**\n * Returns true if this geometry includes the specified coordinate. If the\n * coordinate is on the boundary of the geometry, returns false.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains coordinate.\n * @api\n */\n Geometry.prototype.intersectsCoordinate = function (coordinate) {\n return this.containsXY(coordinate[0], coordinate[1]);\n };\n /**\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n Geometry.prototype.computeExtent = function (extent) {\n return abstract();\n };\n /**\n * Get the extent of the geometry.\n * @param {import(\"../extent.js\").Extent=} opt_extent Extent.\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n Geometry.prototype.getExtent = function (opt_extent) {\n if (this.extentRevision_ != this.getRevision()) {\n this.extent_ = this.computeExtent(this.extent_);\n this.extentRevision_ = this.getRevision();\n }\n return returnOrUpdate(this.extent_, opt_extent);\n };\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n Geometry.prototype.rotate = function (angle, anchor) {\n abstract();\n };\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number=} opt_sy The scaling factor in the y-direction (defaults to\n * sx).\n * @param {import(\"../coordinate.js\").Coordinate=} opt_anchor The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n Geometry.prototype.scale = function (sx, opt_sy, opt_anchor) {\n abstract();\n };\n /**\n * Create a simplified version of this geometry. For linestrings, this uses\n * the [Douglas Peucker](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm)\n * algorithm. For polygons, a quantization-based\n * simplification is used to preserve topology.\n * @param {number} tolerance The tolerance distance for simplification.\n * @return {Geometry} A new, simplified version of the original geometry.\n * @api\n */\n Geometry.prototype.simplify = function (tolerance) {\n return this.getSimplifiedGeometry(tolerance * tolerance);\n };\n /**\n * Create a simplified version of this geometry using the Douglas Peucker\n * algorithm.\n * See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Geometry} Simplified geometry.\n */\n Geometry.prototype.getSimplifiedGeometry = function (squaredTolerance) {\n return abstract();\n };\n /**\n * Get the type of this geometry.\n * @abstract\n * @return {import(\"./GeometryType.js\").default} Geometry type.\n */\n Geometry.prototype.getType = function () {\n return abstract();\n };\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @abstract\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n */\n Geometry.prototype.applyTransform = function (transformFn) {\n abstract();\n };\n /**\n * Test if the geometry and the passed extent intersect.\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n */\n Geometry.prototype.intersectsExtent = function (extent) {\n return abstract();\n };\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @abstract\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n Geometry.prototype.translate = function (deltaX, deltaY) {\n abstract();\n };\n /**\n * Transform each coordinate of the geometry from one coordinate reference\n * system to another. The geometry is modified in place.\n * For example, a line will be transformed to a line and a circle to a circle.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {Geometry} This geometry. Note that original geometry is\n * modified in place.\n * @api\n */\n Geometry.prototype.transform = function (source, destination) {\n /** @type {import(\"../proj/Projection.js\").default} */\n var sourceProj = getProjection(source);\n var transformFn = sourceProj.getUnits() == Units.TILE_PIXELS ?\n function (inCoordinates, outCoordinates, stride) {\n var pixelExtent = sourceProj.getExtent();\n var projectedExtent = sourceProj.getWorldExtent();\n var scale = getHeight(projectedExtent) / getHeight(pixelExtent);\n composeTransform(tmpTransform, projectedExtent[0], projectedExtent[3], scale, -scale, 0, 0, 0);\n transform2D(inCoordinates, 0, inCoordinates.length, stride, tmpTransform, outCoordinates);\n return getTransform(sourceProj, destination)(inCoordinates, outCoordinates, stride);\n } :\n getTransform(sourceProj, destination);\n this.applyTransform(transformFn);\n return this;\n };\n return Geometry;\n}(BaseObject));\nexport default Geometry;\n//# sourceMappingURL=Geometry.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/SimpleGeometry\n */\nimport { abstract } from '../util.js';\nimport { createOrUpdateFromFlatCoordinates, getCenter } from '../extent.js';\nimport Geometry from './Geometry.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport { rotate, scale, translate, transform2D } from './flat/transform.js';\n/**\n * @classdesc\n * Abstract base class; only used for creating subclasses; do not instantiate\n * in apps, as cannot be rendered.\n *\n * @abstract\n * @api\n */\nvar SimpleGeometry = /** @class */ (function (_super) {\n __extends(SimpleGeometry, _super);\n function SimpleGeometry() {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {GeometryLayout}\n */\n _this.layout = GeometryLayout.XY;\n /**\n * @protected\n * @type {number}\n */\n _this.stride = 2;\n /**\n * @protected\n * @type {Array<number>}\n */\n _this.flatCoordinates = null;\n return _this;\n }\n /**\n * @inheritDoc\n */\n SimpleGeometry.prototype.computeExtent = function (extent) {\n return createOrUpdateFromFlatCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);\n };\n /**\n * @abstract\n * @return {Array<*>} Coordinates.\n */\n SimpleGeometry.prototype.getCoordinates = function () {\n return abstract();\n };\n /**\n * Return the first coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} First coordinate.\n * @api\n */\n SimpleGeometry.prototype.getFirstCoordinate = function () {\n return this.flatCoordinates.slice(0, this.stride);\n };\n /**\n * @return {Array<number>} Flat coordinates.\n */\n SimpleGeometry.prototype.getFlatCoordinates = function () {\n return this.flatCoordinates;\n };\n /**\n * Return the last coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} Last point.\n * @api\n */\n SimpleGeometry.prototype.getLastCoordinate = function () {\n return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);\n };\n /**\n * Return the {@link module:ol/geom/GeometryLayout layout} of the geometry.\n * @return {GeometryLayout} Layout.\n * @api\n */\n SimpleGeometry.prototype.getLayout = function () {\n return this.layout;\n };\n /**\n * @inheritDoc\n */\n SimpleGeometry.prototype.getSimplifiedGeometry = function (squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n // If squaredTolerance is negative or if we know that simplification will not\n // have any effect then just return this.\n if (squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance <= this.simplifiedGeometryMaxMinSquaredTolerance)) {\n return this;\n }\n var simplifiedGeometry = this.getSimplifiedGeometryInternal(squaredTolerance);\n var simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();\n if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {\n return simplifiedGeometry;\n }\n else {\n // Simplification did not actually remove any coordinates. We now know\n // that any calls to getSimplifiedGeometry with a squaredTolerance less\n // than or equal to the current squaredTolerance will also not have any\n // effect. This allows us to short circuit simplification (saving CPU\n // cycles) and prevents the cache of simplified geometries from filling\n // up with useless identical copies of this geometry (saving memory).\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n };\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n * @protected\n */\n SimpleGeometry.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n return this;\n };\n /**\n * @return {number} Stride.\n */\n SimpleGeometry.prototype.getStride = function () {\n return this.stride;\n };\n /**\n * @param {GeometryLayout} layout Layout.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n */\n SimpleGeometry.prototype.setFlatCoordinates = function (layout, flatCoordinates) {\n this.stride = getStrideForLayout(layout);\n this.layout = layout;\n this.flatCoordinates = flatCoordinates;\n };\n /**\n * @abstract\n * @param {!Array<*>} coordinates Coordinates.\n * @param {GeometryLayout=} opt_layout Layout.\n */\n SimpleGeometry.prototype.setCoordinates = function (coordinates, opt_layout) {\n abstract();\n };\n /**\n * @param {GeometryLayout|undefined} layout Layout.\n * @param {Array<*>} coordinates Coordinates.\n * @param {number} nesting Nesting.\n * @protected\n */\n SimpleGeometry.prototype.setLayout = function (layout, coordinates, nesting) {\n /** @type {number} */\n var stride;\n if (layout) {\n stride = getStrideForLayout(layout);\n }\n else {\n for (var i = 0; i < nesting; ++i) {\n if (coordinates.length === 0) {\n this.layout = GeometryLayout.XY;\n this.stride = 2;\n return;\n }\n else {\n coordinates = /** @type {Array} */ (coordinates[0]);\n }\n }\n stride = coordinates.length;\n layout = getLayoutForStride(stride);\n }\n this.layout = layout;\n this.stride = stride;\n };\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n */\n SimpleGeometry.prototype.applyTransform = function (transformFn) {\n if (this.flatCoordinates) {\n transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);\n this.changed();\n }\n };\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n SimpleGeometry.prototype.rotate = function (angle, anchor) {\n var flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n var stride = this.getStride();\n rotate(flatCoordinates, 0, flatCoordinates.length, stride, angle, anchor, flatCoordinates);\n this.changed();\n }\n };\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number=} opt_sy The scaling factor in the y-direction (defaults to\n * sx).\n * @param {import(\"../coordinate.js\").Coordinate=} opt_anchor The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n SimpleGeometry.prototype.scale = function (sx, opt_sy, opt_anchor) {\n var sy = opt_sy;\n if (sy === undefined) {\n sy = sx;\n }\n var anchor = opt_anchor;\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n var flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n var stride = this.getStride();\n scale(flatCoordinates, 0, flatCoordinates.length, stride, sx, sy, anchor, flatCoordinates);\n this.changed();\n }\n };\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n SimpleGeometry.prototype.translate = function (deltaX, deltaY) {\n var flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n var stride = this.getStride();\n translate(flatCoordinates, 0, flatCoordinates.length, stride, deltaX, deltaY, flatCoordinates);\n this.changed();\n }\n };\n return SimpleGeometry;\n}(Geometry));\n/**\n * @param {number} stride Stride.\n * @return {GeometryLayout} layout Layout.\n */\nfunction getLayoutForStride(stride) {\n var layout;\n if (stride == 2) {\n layout = GeometryLayout.XY;\n }\n else if (stride == 3) {\n layout = GeometryLayout.XYZ;\n }\n else if (stride == 4) {\n layout = GeometryLayout.XYZM;\n }\n return (\n /** @type {GeometryLayout} */ (layout));\n}\n/**\n * @param {GeometryLayout} layout Layout.\n * @return {number} Stride.\n */\nexport function getStrideForLayout(layout) {\n var stride;\n if (layout == GeometryLayout.XY) {\n stride = 2;\n }\n else if (layout == GeometryLayout.XYZ || layout == GeometryLayout.XYM) {\n stride = 3;\n }\n else if (layout == GeometryLayout.XYZM) {\n stride = 4;\n }\n return /** @type {number} */ (stride);\n}\n/**\n * @param {SimpleGeometry} simpleGeometry Simple geometry.\n * @param {import(\"../transform.js\").Transform} transform Transform.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Transformed flat coordinates.\n */\nexport function transformGeom2D(simpleGeometry, transform, opt_dest) {\n var flatCoordinates = simpleGeometry.getFlatCoordinates();\n if (!flatCoordinates) {\n return null;\n }\n else {\n var stride = simpleGeometry.getStride();\n return transform2D(flatCoordinates, 0, flatCoordinates.length, stride, transform, opt_dest);\n }\n}\nexport default SimpleGeometry;\n//# sourceMappingURL=SimpleGeometry.js.map","/**\n * @module ol/geom/flat/area\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 * @return {number} Area.\n */\nexport function linearRing(flatCoordinates, offset, end, stride) {\n var twiceArea = 0;\n var x1 = flatCoordinates[end - stride];\n var y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n twiceArea += y1 * x2 - x1 * y2;\n x1 = x2;\n y1 = y2;\n }\n return twiceArea / 2;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRings(flatCoordinates, offset, ends, stride) {\n var area = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n area += linearRing(flatCoordinates, offset, end, stride);\n offset = end;\n }\n return area;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRingss(flatCoordinates, offset, endss, stride) {\n var area = 0;\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n area += linearRings(flatCoordinates, offset, ends, stride);\n offset = ends[ends.length - 1];\n }\n return area;\n}\n//# sourceMappingURL=area.js.map","/**\n * @module ol/geom/flat/closest\n */\nimport { lerp, squaredDistance as squaredDx } from '../../math.js';\n/**\n * Returns the point on the 2D line segment flatCoordinates[offset1] to\n * flatCoordinates[offset2] that is closest to the point (x, y). Extra\n * dimensions are linearly interpolated.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset1 Offset 1.\n * @param {number} offset2 Offset 2.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n */\nfunction assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {\n var x1 = flatCoordinates[offset1];\n var y1 = flatCoordinates[offset1 + 1];\n var dx = flatCoordinates[offset2] - x1;\n var dy = flatCoordinates[offset2 + 1] - y1;\n var offset;\n if (dx === 0 && dy === 0) {\n offset = offset1;\n }\n else {\n var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n offset = offset2;\n }\n else if (t > 0) {\n for (var i = 0; i < stride; ++i) {\n closestPoint[i] = lerp(flatCoordinates[offset1 + i], flatCoordinates[offset2 + i], t);\n }\n closestPoint.length = stride;\n return;\n }\n else {\n offset = offset1;\n }\n }\n for (var i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n}\n/**\n * Return the squared of the largest distance between any pair of consecutive\n * coordinates.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function maxSquaredDelta(flatCoordinates, offset, end, stride, max) {\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n for (offset += stride; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n var squaredDelta = squaredDx(x1, y1, x2, y2);\n if (squaredDelta > max) {\n max = squaredDelta;\n }\n x1 = x2;\n y1 = y2;\n }\n return max;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n max = maxSquaredDelta(flatCoordinates, offset, end, stride, max);\n offset = end;\n }\n return max;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride, max) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n max = arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max);\n offset = ends[ends.length - 1];\n }\n return max;\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 {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array<number>=} opt_tmpPoint Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestPoint(flatCoordinates, offset, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {\n if (offset == end) {\n return minSquaredDistance;\n }\n var i, squaredDistance;\n if (maxDelta === 0) {\n // All points are identical, so just test the first point.\n squaredDistance = squaredDx(x, y, flatCoordinates[offset], flatCoordinates[offset + 1]);\n if (squaredDistance < minSquaredDistance) {\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n else {\n return minSquaredDistance;\n }\n }\n var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];\n var index = offset + stride;\n while (index < end) {\n assignClosest(flatCoordinates, index - stride, index, stride, x, y, tmpPoint);\n squaredDistance = squaredDx(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n index += stride;\n }\n else {\n // Skip ahead multiple points, because we know that all the skipped\n // points cannot be any closer than the closest point we have found so\n // far. We know this because we know how close the current point is, how\n // close the closest point we have found so far is, and the maximum\n // distance between consecutive points. For example, if we're currently\n // at distance 10, the best we've found so far is 3, and that the maximum\n // distance between consecutive points is 2, then we'll need to skip at\n // least (10 - 3) / 2 == 3 (rounded down) points to have any chance of\n // finding a closer point. We use Math.max(..., 1) to ensure that we\n // always advance at least one point, to avoid an infinite loop.\n index += stride * Math.max(((Math.sqrt(squaredDistance) -\n Math.sqrt(minSquaredDistance)) / maxDelta) | 0, 1);\n }\n }\n if (isRing) {\n // Check the closing segment.\n assignClosest(flatCoordinates, end - stride, offset, stride, x, y, tmpPoint);\n squaredDistance = squaredDx(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array<number>=} opt_tmpPoint Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestArrayPoint(flatCoordinates, offset, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {\n var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n minSquaredDistance = assignClosestPoint(flatCoordinates, offset, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);\n offset = end;\n }\n return minSquaredDistance;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array<number>=} opt_tmpPoint Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestMultiArrayPoint(flatCoordinates, offset, endss, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {\n var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n minSquaredDistance = assignClosestArrayPoint(flatCoordinates, offset, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);\n offset = ends[ends.length - 1];\n }\n return minSquaredDistance;\n}\n//# sourceMappingURL=closest.js.map","/**\n * @module ol/geom/flat/deflate\n */\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nexport function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {\n for (var i = 0, ii = coordinate.length; i < ii; ++i) {\n flatCoordinates[offset++] = coordinate[i];\n }\n return offset;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<import(\"../../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nexport function deflateCoordinates(flatCoordinates, offset, coordinates, stride) {\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n var coordinate = coordinates[i];\n for (var j = 0; j < stride; ++j) {\n flatCoordinates[offset++] = coordinate[j];\n }\n }\n return offset;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<import(\"../../coordinate.js\").Coordinate>>} coordinatess Coordinatess.\n * @param {number} stride Stride.\n * @param {Array<number>=} opt_ends Ends.\n * @return {Array<number>} Ends.\n */\nexport function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, opt_ends) {\n var ends = opt_ends ? opt_ends : [];\n var i = 0;\n for (var j = 0, jj = coordinatess.length; j < jj; ++j) {\n var end = deflateCoordinates(flatCoordinates, offset, coordinatess[j], stride);\n ends[i++] = end;\n offset = end;\n }\n ends.length = i;\n return ends;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<Array<import(\"../../coordinate.js\").Coordinate>>>} coordinatesss Coordinatesss.\n * @param {number} stride Stride.\n * @param {Array<Array<number>>=} opt_endss Endss.\n * @return {Array<Array<number>>} Endss.\n */\nexport function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, opt_endss) {\n var endss = opt_endss ? opt_endss : [];\n var i = 0;\n for (var j = 0, jj = coordinatesss.length; j < jj; ++j) {\n var ends = deflateCoordinatesArray(flatCoordinates, offset, coordinatesss[j], stride, endss[i]);\n endss[i++] = ends;\n offset = ends[ends.length - 1];\n }\n endss.length = i;\n return endss;\n}\n//# sourceMappingURL=deflate.js.map","/**\n * @module ol/geom/flat/inflate\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 {Array<import(\"../../coordinate.js\").Coordinate>=} opt_coordinates Coordinates.\n * @return {Array<import(\"../../coordinate.js\").Coordinate>} Coordinates.\n */\nexport function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {\n var coordinates = opt_coordinates !== undefined ? opt_coordinates : [];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n coordinates[i++] = flatCoordinates.slice(j, j + stride);\n }\n coordinates.length = i;\n return coordinates;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<Array<import(\"../../coordinate.js\").Coordinate>>=} opt_coordinatess Coordinatess.\n * @return {Array<Array<import(\"../../coordinate.js\").Coordinate>>} Coordinatess.\n */\nexport function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {\n var coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];\n var i = 0;\n for (var j = 0, jj = ends.length; j < jj; ++j) {\n var end = ends[j];\n coordinatess[i++] = inflateCoordinates(flatCoordinates, offset, end, stride, coordinatess[i]);\n offset = end;\n }\n coordinatess.length = i;\n return coordinatess;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array<Array<Array<import(\"../../coordinate.js\").Coordinate>>>=} opt_coordinatesss\n * Coordinatesss.\n * @return {Array<Array<Array<import(\"../../coordinate.js\").Coordinate>>>} Coordinatesss.\n */\nexport function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) {\n var coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];\n var i = 0;\n for (var j = 0, jj = endss.length; j < jj; ++j) {\n var ends = endss[j];\n coordinatesss[i++] = inflateCoordinatesArray(flatCoordinates, offset, ends, stride, coordinatesss[i]);\n offset = ends[ends.length - 1];\n }\n coordinatesss.length = i;\n return coordinatesss;\n}\n//# sourceMappingURL=inflate.js.map","/**\n * @module ol/geom/flat/simplify\n */\n// Based on simplify-js https://github.com/mourner/simplify-js\n// Copyright (c) 2012, Vladimir Agafonkin\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n//\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n// POSSIBILITY OF SUCH DAMAGE.\nimport { squaredSegmentDistance, squaredDistance } from '../../math.js';\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 {number} squaredTolerance Squared tolerance.\n * @param {boolean} highQuality Highest quality.\n * @param {Array<number>=} opt_simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @return {Array<number>} Simplified line string.\n */\nexport function simplifyLineString(flatCoordinates, offset, end, stride, squaredTolerance, highQuality, opt_simplifiedFlatCoordinates) {\n var simplifiedFlatCoordinates = opt_simplifiedFlatCoordinates !== undefined ?\n opt_simplifiedFlatCoordinates : [];\n if (!highQuality) {\n end = radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n flatCoordinates = simplifiedFlatCoordinates;\n offset = 0;\n stride = 2;\n }\n simplifiedFlatCoordinates.length = douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return simplifiedFlatCoordinates;\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 {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n var n = (end - offset) / stride;\n if (n < 3) {\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n /** @type {Array<number>} */\n var markers = new Array(n);\n markers[0] = 1;\n markers[n - 1] = 1;\n /** @type {Array<number>} */\n var stack = [offset, end - stride];\n var index = 0;\n while (stack.length > 0) {\n var last = stack.pop();\n var first = stack.pop();\n var maxSquaredDistance = 0;\n var x1 = flatCoordinates[first];\n var y1 = flatCoordinates[first + 1];\n var x2 = flatCoordinates[last];\n var y2 = flatCoordinates[last + 1];\n for (var i = first + stride; i < last; i += stride) {\n var x = flatCoordinates[i];\n var y = flatCoordinates[i + 1];\n var squaredDistance_1 = squaredSegmentDistance(x, y, x1, y1, x2, y2);\n if (squaredDistance_1 > maxSquaredDistance) {\n index = i;\n maxSquaredDistance = squaredDistance_1;\n }\n }\n if (maxSquaredDistance > squaredTolerance) {\n markers[(index - offset) / stride] = 1;\n if (first + stride < index) {\n stack.push(first, index);\n }\n if (index + stride < last) {\n stack.push(index, last);\n }\n }\n }\n for (var i = 0; i < n; ++i) {\n if (markers[i]) {\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + i * stride];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + i * stride + 1];\n }\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<number>} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nexport function douglasPeuckerArray(flatCoordinates, offset, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n simplifiedOffset = douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset);\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<Array<number>>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nexport function douglasPeuckerMultiArray(flatCoordinates, offset, endss, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n var simplifiedEnds = [];\n simplifiedOffset = douglasPeuckerArray(flatCoordinates, offset, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\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 {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n if (end <= offset + stride) {\n // zero or one point, no simplification possible, so copy and return\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n // copy first point\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n var x2 = x1;\n var y2 = y1;\n for (offset += stride; offset < end; offset += stride) {\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n if (squaredDistance(x1, y1, x2, y2) > squaredTolerance) {\n // copy point at offset\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n }\n }\n if (x2 != x1 || y2 != y1) {\n // copy last point\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n }\n return simplifiedOffset;\n}\n/**\n * @param {number} value Value.\n * @param {number} tolerance Tolerance.\n * @return {number} Rounded value.\n */\nexport function snap(value, tolerance) {\n return tolerance * Math.round(value / tolerance);\n}\n/**\n * Simplifies a line string using an algorithm designed by Tim Schaub.\n * Coordinates are snapped to the nearest value in a virtual grid and\n * consecutive duplicate coordinates are discarded. This effectively preserves\n * topology as the simplification of any subsection of a line string is\n * independent of the rest of the line string. This means that, for examples,\n * the common edge between two polygons will be simplified to the same line\n * string independently in both polygons. This implementation uses a single\n * pass over the coordinates and eliminates intermediate collinear points.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function quantize(flatCoordinates, offset, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n // do nothing if the line is empty\n if (offset == end) {\n return simplifiedOffset;\n }\n // snap the first coordinate (P1)\n var x1 = snap(flatCoordinates[offset], tolerance);\n var y1 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // add the first coordinate to the output\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n // find the next coordinate that does not snap to the same value as the first\n // coordinate (P2)\n var x2, y2;\n do {\n x2 = snap(flatCoordinates[offset], tolerance);\n y2 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n if (offset == end) {\n // all coordinates snap to the same value, the line collapses to a point\n // push the last snapped value anyway to ensure that the output contains\n // at least two points\n // FIXME should we really return at least two points anyway?\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n }\n } while (x2 == x1 && y2 == y1);\n while (offset < end) {\n // snap the next coordinate (P3)\n var x3 = snap(flatCoordinates[offset], tolerance);\n var y3 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // skip P3 if it is equal to P2\n if (x3 == x2 && y3 == y2) {\n continue;\n }\n // calculate the delta between P1 and P2\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n // calculate the delta between P3 and P1\n var dx2 = x3 - x1;\n var dy2 = y3 - y1;\n // if P1, P2, and P3 are colinear and P3 is further from P1 than P2 is from\n // P1 in the same direction then P2 is on the straight line between P1 and\n // P3\n if ((dx1 * dy2 == dy1 * dx2) &&\n ((dx1 < 0 && dx2 < dx1) || dx1 == dx2 || (dx1 > 0 && dx2 > dx1)) &&\n ((dy1 < 0 && dy2 < dy1) || dy1 == dy2 || (dy1 > 0 && dy2 > dy1))) {\n // discard P2 and set P2 = P3\n x2 = x3;\n y2 = y3;\n continue;\n }\n // either P1, P2, and P3 are not colinear, or they are colinear but P3 is\n // between P3 and P1 or on the opposite half of the line to P2. add P2,\n // and continue with P1 = P2 and P2 = P3\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n x2 = x3;\n y2 = y3;\n }\n // add the last point (P2)\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<number>} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nexport function quantizeArray(flatCoordinates, offset, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n simplifiedOffset = quantize(flatCoordinates, offset, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset);\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<Array<number>>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nexport function quantizeMultiArray(flatCoordinates, offset, endss, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n var simplifiedEnds = [];\n simplifiedOffset = quantizeArray(flatCoordinates, offset, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n//# sourceMappingURL=simplify.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/LinearRing\n */\nimport { closestSquaredDistanceXY } from '../extent.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { linearRing as linearRingArea } from './flat/area.js';\nimport { assignClosestPoint, maxSquaredDelta } from './flat/closest.js';\nimport { deflateCoordinates } from './flat/deflate.js';\nimport { inflateCoordinates } from './flat/inflate.js';\nimport { douglasPeucker } from './flat/simplify.js';\n/**\n * @classdesc\n * Linear ring geometry. Only used as part of polygon; cannot be rendered\n * on its own.\n *\n * @api\n */\nvar LinearRing = /** @class */ (function (_super) {\n __extends(LinearRing, _super);\n /**\n * @param {Array<import(\"../coordinate.js\").Coordinate>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `opt_layout` are also accepted.\n * @param {GeometryLayout=} opt_layout Layout.\n */\n function LinearRing(coordinates, opt_layout) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {\n _this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));\n }\n else {\n _this.setCoordinates(/** @type {Array<import(\"../coordinate.js\").Coordinate>} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Make a complete copy of the geometry.\n * @return {!LinearRing} Clone.\n * @override\n * @api\n */\n LinearRing.prototype.clone = function () {\n return new LinearRing(this.flatCoordinates.slice(), this.layout);\n };\n /**\n * @inheritDoc\n */\n LinearRing.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(maxSquaredDelta(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestPoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * Return the area of the linear ring on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n LinearRing.prototype.getArea = function () {\n return linearRingArea(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * Return the coordinates of the linear ring.\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates.\n * @override\n * @api\n */\n LinearRing.prototype.getCoordinates = function () {\n return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * @inheritDoc\n */\n LinearRing.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = douglasPeucker(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return new LinearRing(simplifiedFlatCoordinates, GeometryLayout.XY);\n };\n /**\n * @inheritDoc\n * @api\n */\n LinearRing.prototype.getType = function () {\n return GeometryType.LINEAR_RING;\n };\n /**\n * @inheritDoc\n */\n LinearRing.prototype.intersectsExtent = function (extent) {\n return false;\n };\n /**\n * Set the coordinates of the linear ring.\n * @param {!Array<import(\"../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {GeometryLayout=} opt_layout Layout.\n * @override\n * @api\n */\n LinearRing.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n };\n return LinearRing;\n}(SimpleGeometry));\nexport default LinearRing;\n//# sourceMappingURL=LinearRing.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Point\n */\nimport { createOrUpdateFromCoordinate, containsXY } from '../extent.js';\nimport GeometryType from './GeometryType.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { deflateCoordinate } from './flat/deflate.js';\nimport { squaredDistance as squaredDx } from '../math.js';\n/**\n * @classdesc\n * Point geometry.\n *\n * @api\n */\nvar Point = /** @class */ (function (_super) {\n __extends(Point, _super);\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default=} opt_layout Layout.\n */\n function Point(coordinates, opt_layout) {\n var _this = _super.call(this) || this;\n _this.setCoordinates(coordinates, opt_layout);\n return _this;\n }\n /**\n * Make a complete copy of the geometry.\n * @return {!Point} Clone.\n * @override\n * @api\n */\n Point.prototype.clone = function () {\n var point = new Point(this.flatCoordinates.slice(), this.layout);\n return point;\n };\n /**\n * @inheritDoc\n */\n Point.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n var flatCoordinates = this.flatCoordinates;\n var squaredDistance = squaredDx(x, y, flatCoordinates[0], flatCoordinates[1]);\n if (squaredDistance < minSquaredDistance) {\n var stride = this.stride;\n for (var i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n else {\n return minSquaredDistance;\n }\n };\n /**\n * Return the coordinate of the point.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinates.\n * @override\n * @api\n */\n Point.prototype.getCoordinates = function () {\n return !this.flatCoordinates ? [] : this.flatCoordinates.slice();\n };\n /**\n * @inheritDoc\n */\n Point.prototype.computeExtent = function (extent) {\n return createOrUpdateFromCoordinate(this.flatCoordinates, extent);\n };\n /**\n * @inheritDoc\n * @api\n */\n Point.prototype.getType = function () {\n return GeometryType.POINT;\n };\n /**\n * @inheritDoc\n * @api\n */\n Point.prototype.intersectsExtent = function (extent) {\n return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);\n };\n /**\n * @inheritDoc\n * @api\n */\n Point.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinate(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n };\n return Point;\n}(SimpleGeometry));\nexport default Point;\n//# sourceMappingURL=Point.js.map","/**\n * @module ol/geom/flat/contains\n */\nimport { forEachCorner } from '../../extent.js';\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 {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} Contains extent.\n */\nexport function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {\n var outside = forEachCorner(extent, \n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains (x, y).\n */\n function (coordinate) {\n return !linearRingContainsXY(flatCoordinates, offset, end, stride, coordinate[0], coordinate[1]);\n });\n return !outside;\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 {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingContainsXY(flatCoordinates, offset, end, stride, x, y) {\n // http://geomalgorithms.com/a03-_inclusion.html\n // Copyright 2000 softSurfer, 2012 Dan Sunday\n // This code may be freely used and modified for any purpose\n // providing that this copyright notice is included with it.\n // SoftSurfer makes no warranty for this code, and cannot be held\n // liable for any real or imagined damage resulting from its use.\n // Users of this code must verify correctness for their application.\n var wn = 0;\n var x1 = flatCoordinates[end - stride];\n var y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n if (y1 <= y) {\n if (y2 > y && ((x2 - x1) * (y - y1)) - ((x - x1) * (y2 - y1)) > 0) {\n wn++;\n }\n }\n else if (y2 <= y && ((x2 - x1) * (y - y1)) - ((x - x1) * (y2 - y1)) < 0) {\n wn--;\n }\n x1 = x2;\n y1 = y2;\n }\n return wn !== 0;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y) {\n if (ends.length === 0) {\n return false;\n }\n if (!linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) {\n return false;\n }\n for (var i = 1, ii = ends.length; i < ii; ++i) {\n if (linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)) {\n return false;\n }\n }\n return true;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingssContainsXY(flatCoordinates, offset, endss, stride, x, y) {\n if (endss.length === 0) {\n return false;\n }\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n//# sourceMappingURL=contains.js.map","/**\n * @module ol/geom/flat/interiorpoint\n */\nimport { numberSafeCompareFunction } from '../../array.js';\nimport { linearRingsContainsXY } from './contains.js';\n/**\n * Calculates a point that is likely to lie in the interior of the linear rings.\n * Inspired by JTS's com.vividsolutions.jts.geom.Geometry#getInteriorPoint.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<number>} flatCenters Flat centers.\n * @param {number} flatCentersOffset Flat center offset.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Destination point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nexport function getInteriorPointOfArray(flatCoordinates, offset, ends, stride, flatCenters, flatCentersOffset, opt_dest) {\n var i, ii, x, x1, x2, y1, y2;\n var y = flatCenters[flatCentersOffset + 1];\n /** @type {Array<number>} */\n var intersections = [];\n // Calculate intersections with the horizontal line\n for (var r = 0, rr = ends.length; r < rr; ++r) {\n var end = ends[r];\n x1 = flatCoordinates[end - stride];\n y1 = flatCoordinates[end - stride + 1];\n for (i = offset; i < end; i += stride) {\n x2 = flatCoordinates[i];\n y2 = flatCoordinates[i + 1];\n if ((y <= y1 && y2 <= y) || (y1 <= y && y <= y2)) {\n x = (y - y1) / (y2 - y1) * (x2 - x1) + x1;\n intersections.push(x);\n }\n x1 = x2;\n y1 = y2;\n }\n }\n // Find the longest segment of the horizontal line that has its center point\n // inside the linear ring.\n var pointX = NaN;\n var maxSegmentLength = -Infinity;\n intersections.sort(numberSafeCompareFunction);\n x1 = intersections[0];\n for (i = 1, ii = intersections.length; i < ii; ++i) {\n x2 = intersections[i];\n var segmentLength = Math.abs(x2 - x1);\n if (segmentLength > maxSegmentLength) {\n x = (x1 + x2) / 2;\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n pointX = x;\n maxSegmentLength = segmentLength;\n }\n }\n x1 = x2;\n }\n if (isNaN(pointX)) {\n // There is no horizontal line that has its center point inside the linear\n // ring. Use the center of the the linear ring's extent.\n pointX = flatCenters[flatCentersOffset];\n }\n if (opt_dest) {\n opt_dest.push(pointX, y, maxSegmentLength);\n return opt_dest;\n }\n else {\n return [pointX, y, maxSegmentLength];\n }\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array<number>} flatCenters Flat centers.\n * @return {Array<number>} Interior points as XYM coordinates, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nexport function getInteriorPointsOfMultiArray(flatCoordinates, offset, endss, stride, flatCenters) {\n var interiorPoints = [];\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n interiorPoints = getInteriorPointOfArray(flatCoordinates, offset, ends, stride, flatCenters, 2 * i, interiorPoints);\n offset = ends[ends.length - 1];\n }\n return interiorPoints;\n}\n//# sourceMappingURL=interiorpoint.js.map","/**\n * @module ol/geom/flat/segments\n */\n/**\n * This function calls `callback` for each segment of the flat coordinates\n * array. If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {function(import(\"../../coordinate.js\").Coordinate, import(\"../../coordinate.js\").Coordinate): T} callback Function\n * called for each segment.\n * @return {T|boolean} Value.\n * @template T\n */\nexport function forEach(flatCoordinates, offset, end, stride, callback) {\n var point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]];\n var point2 = [];\n var ret;\n for (; (offset + stride) < end; offset += stride) {\n point2[0] = flatCoordinates[offset + stride];\n point2[1] = flatCoordinates[offset + stride + 1];\n ret = callback(point1, point2);\n if (ret) {\n return ret;\n }\n point1[0] = point2[0];\n point1[1] = point2[1];\n }\n return false;\n}\n//# sourceMappingURL=segments.js.map","/**\n * @module ol/geom/flat/intersectsextent\n */\nimport { containsExtent, createEmpty, extendFlatCoordinates, intersects, intersectsSegment } from '../../extent.js';\nimport { linearRingContainsXY, linearRingContainsExtent } from './contains.js';\nimport { forEach as forEachSegment } from './segments.js';\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 {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLineString(flatCoordinates, offset, end, stride, extent) {\n var coordinatesExtent = extendFlatCoordinates(createEmpty(), flatCoordinates, offset, end, stride);\n if (!intersects(extent, coordinatesExtent)) {\n return false;\n }\n if (containsExtent(extent, coordinatesExtent)) {\n return true;\n }\n if (coordinatesExtent[0] >= extent[0] &&\n coordinatesExtent[2] <= extent[2]) {\n return true;\n }\n if (coordinatesExtent[1] >= extent[1] &&\n coordinatesExtent[3] <= extent[3]) {\n return true;\n }\n return forEachSegment(flatCoordinates, offset, end, stride, \n /**\n * @param {import(\"../../coordinate.js\").Coordinate} point1 Start point.\n * @param {import(\"../../coordinate.js\").Coordinate} point2 End point.\n * @return {boolean} `true` if the segment and the extent intersect,\n * `false` otherwise.\n */\n function (point1, point2) {\n return intersectsSegment(extent, point1, point2);\n });\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n if (intersectsLineString(flatCoordinates, offset, ends[i], stride, extent)) {\n return true;\n }\n offset = ends[i];\n }\n return false;\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 {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {\n if (intersectsLineString(flatCoordinates, offset, end, stride, extent)) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[0], extent[1])) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[0], extent[3])) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[2], extent[1])) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[2], extent[3])) {\n return true;\n }\n return false;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {\n if (!intersectsLinearRing(flatCoordinates, offset, ends[0], stride, extent)) {\n return false;\n }\n if (ends.length === 1) {\n return true;\n }\n for (var i = 1, ii = ends.length; i < ii; ++i) {\n if (linearRingContainsExtent(flatCoordinates, ends[i - 1], ends[i], stride, extent)) {\n if (!intersectsLineString(flatCoordinates, ends[i - 1], ends[i], stride, extent)) {\n return false;\n }\n }\n }\n return true;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n if (intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n//# sourceMappingURL=intersectsextent.js.map","/**\n * @module ol/geom/flat/reverse\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 */\nexport function coordinates(flatCoordinates, offset, end, stride) {\n while (offset < end - stride) {\n for (var i = 0; i < stride; ++i) {\n var tmp = flatCoordinates[offset + i];\n flatCoordinates[offset + i] = flatCoordinates[end - stride + i];\n flatCoordinates[end - stride + i] = tmp;\n }\n offset += stride;\n end -= stride;\n }\n}\n//# sourceMappingURL=reverse.js.map","/**\n * @module ol/geom/flat/orient\n */\nimport { coordinates as reverseCoordinates } from './reverse.js';\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {boolean} Is clockwise.\n */\nexport function linearRingIsClockwise(flatCoordinates, offset, end, stride) {\n // http://tinyurl.com/clockwise-method\n // https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrlinearring.cpp\n var edge = 0;\n var x1 = flatCoordinates[end - stride];\n var y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n edge += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n return edge > 0;\n}\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `opt_right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean=} opt_right Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nexport function linearRingsAreOriented(flatCoordinates, offset, ends, stride, opt_right) {\n var right = opt_right !== undefined ? opt_right : false;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var isClockwise = linearRingIsClockwise(flatCoordinates, offset, end, stride);\n if (i === 0) {\n if ((right && isClockwise) || (!right && !isClockwise)) {\n return false;\n }\n }\n else {\n if ((right && !isClockwise) || (!right && isClockwise)) {\n return false;\n }\n }\n offset = end;\n }\n return true;\n}\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `opt_right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean=} opt_right Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nexport function linearRingssAreOriented(flatCoordinates, offset, endss, stride, opt_right) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n if (!linearRingsAreOriented(flatCoordinates, offset, ends, stride, opt_right)) {\n return false;\n }\n if (ends.length) {\n offset = ends[ends.length - 1];\n }\n }\n return true;\n}\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `opt_right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {boolean=} opt_right Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nexport function orientLinearRings(flatCoordinates, offset, ends, stride, opt_right) {\n var right = opt_right !== undefined ? opt_right : false;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var isClockwise = linearRingIsClockwise(flatCoordinates, offset, end, stride);\n var reverse = i === 0 ?\n (right && isClockwise) || (!right && !isClockwise) :\n (right && !isClockwise) || (!right && isClockwise);\n if (reverse) {\n reverseCoordinates(flatCoordinates, offset, end, stride);\n }\n offset = end;\n }\n return offset;\n}\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `opt_right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean=} opt_right Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nexport function orientLinearRingsArray(flatCoordinates, offset, endss, stride, opt_right) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n offset = orientLinearRings(flatCoordinates, offset, endss[i], stride, opt_right);\n }\n return offset;\n}\n//# sourceMappingURL=orient.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Polygon\n */\nimport { extend } from '../array.js';\nimport { closestSquaredDistanceXY, getCenter } from '../extent.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport LinearRing from './LinearRing.js';\nimport Point from './Point.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { offset as sphereOffset } from '../sphere.js';\nimport { linearRings as linearRingsArea } from './flat/area.js';\nimport { assignClosestArrayPoint, arrayMaxSquaredDelta } from './flat/closest.js';\nimport { linearRingsContainsXY } from './flat/contains.js';\nimport { deflateCoordinatesArray } from './flat/deflate.js';\nimport { inflateCoordinatesArray } from './flat/inflate.js';\nimport { getInteriorPointOfArray } from './flat/interiorpoint.js';\nimport { intersectsLinearRingArray } from './flat/intersectsextent.js';\nimport { linearRingsAreOriented, orientLinearRings } from './flat/orient.js';\nimport { quantizeArray } from './flat/simplify.js';\nimport { modulo } from '../math.js';\n/**\n * @classdesc\n * Polygon geometry.\n *\n * @api\n */\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n /**\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>|!Array<number>} coordinates\n * Array of linear rings that define the polygon. The first linear ring of the\n * array defines the outer-boundary or surface of the polygon. Each subsequent\n * linear ring defines a hole in the surface of the polygon. A linear ring is\n * an array of vertices' coordinates where the first coordinate and the last are\n * equivalent. (For internal use, flat coordinates in combination with\n * `opt_layout` and `opt_ends` are also accepted.)\n * @param {GeometryLayout=} opt_layout Layout.\n * @param {Array<number>=} opt_ends Ends (for internal use with flat coordinates).\n */\n function Polygon(coordinates, opt_layout, opt_ends) {\n var _this = _super.call(this) || this;\n /**\n * @type {Array<number>}\n * @private\n */\n _this.ends_ = [];\n /**\n * @private\n * @type {number}\n */\n _this.flatInteriorPointRevision_ = -1;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.flatInteriorPoint_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.orientedRevision_ = -1;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.orientedFlatCoordinates_ = null;\n if (opt_layout !== undefined && opt_ends) {\n _this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));\n _this.ends_ = opt_ends;\n }\n else {\n _this.setCoordinates(/** @type {Array<Array<import(\"../coordinate.js\").Coordinate>>} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Append the passed linear ring to this polygon.\n * @param {LinearRing} linearRing Linear ring.\n * @api\n */\n Polygon.prototype.appendLinearRing = function (linearRing) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = linearRing.getFlatCoordinates().slice();\n }\n else {\n extend(this.flatCoordinates, linearRing.getFlatCoordinates());\n }\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!Polygon} Clone.\n * @override\n * @api\n */\n Polygon.prototype.clone = function () {\n return new Polygon(this.flatCoordinates.slice(), this.layout, this.ends_.slice());\n };\n /**\n * @inheritDoc\n */\n Polygon.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates, 0, this.ends_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestArrayPoint(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * @inheritDoc\n */\n Polygon.prototype.containsXY = function (x, y) {\n return linearRingsContainsXY(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y);\n };\n /**\n * Return the area of the polygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n Polygon.prototype.getArea = function () {\n return linearRingsArea(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride);\n };\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for polygons.\n *\n * @param {boolean=} opt_right Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array<Array<import(\"../coordinate.js\").Coordinate>>} Coordinates.\n * @override\n * @api\n */\n Polygon.prototype.getCoordinates = function (opt_right) {\n var flatCoordinates;\n if (opt_right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n orientLinearRings(flatCoordinates, 0, this.ends_, this.stride, opt_right);\n }\n else {\n flatCoordinates = this.flatCoordinates;\n }\n return inflateCoordinatesArray(flatCoordinates, 0, this.ends_, this.stride);\n };\n /**\n * @return {Array<number>} Ends.\n */\n Polygon.prototype.getEnds = function () {\n return this.ends_;\n };\n /**\n * @return {Array<number>} Interior point.\n */\n Polygon.prototype.getFlatInteriorPoint = function () {\n if (this.flatInteriorPointRevision_ != this.getRevision()) {\n var flatCenter = getCenter(this.getExtent());\n this.flatInteriorPoint_ = getInteriorPointOfArray(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, flatCenter, 0);\n this.flatInteriorPointRevision_ = this.getRevision();\n }\n return this.flatInteriorPoint_;\n };\n /**\n * Return an interior point of the polygon.\n * @return {Point} Interior point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n * @api\n */\n Polygon.prototype.getInteriorPoint = function () {\n return new Point(this.getFlatInteriorPoint(), GeometryLayout.XYM);\n };\n /**\n * Return the number of rings of the polygon, this includes the exterior\n * ring and any interior rings.\n *\n * @return {number} Number of rings.\n * @api\n */\n Polygon.prototype.getLinearRingCount = function () {\n return this.ends_.length;\n };\n /**\n * Return the Nth linear ring of the polygon geometry. Return `null` if the\n * given index is out of range.\n * The exterior linear ring is available at index `0` and the interior rings\n * at index `1` and beyond.\n *\n * @param {number} index Index.\n * @return {LinearRing} Linear ring.\n * @api\n */\n Polygon.prototype.getLinearRing = function (index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new LinearRing(this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);\n };\n /**\n * Return the linear rings of the polygon.\n * @return {Array<LinearRing>} Linear rings.\n * @api\n */\n Polygon.prototype.getLinearRings = function () {\n var layout = this.layout;\n var flatCoordinates = this.flatCoordinates;\n var ends = this.ends_;\n var linearRings = [];\n var offset = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var linearRing = new LinearRing(flatCoordinates.slice(offset, end), layout);\n linearRings.push(linearRing);\n offset = end;\n }\n return linearRings;\n };\n /**\n * @return {Array<number>} Oriented flat coordinates.\n */\n Polygon.prototype.getOrientedFlatCoordinates = function () {\n if (this.orientedRevision_ != this.getRevision()) {\n var flatCoordinates = this.flatCoordinates;\n if (linearRingsAreOriented(flatCoordinates, 0, this.ends_, this.stride)) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n }\n else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length =\n orientLinearRings(this.orientedFlatCoordinates_, 0, this.ends_, this.stride);\n }\n this.orientedRevision_ = this.getRevision();\n }\n return this.orientedFlatCoordinates_;\n };\n /**\n * @inheritDoc\n */\n Polygon.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n var simplifiedEnds = [];\n simplifiedFlatCoordinates.length = quantizeArray(this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEnds);\n return new Polygon(simplifiedFlatCoordinates, GeometryLayout.XY, simplifiedEnds);\n };\n /**\n * @inheritDoc\n * @api\n */\n Polygon.prototype.getType = function () {\n return GeometryType.POLYGON;\n };\n /**\n * @inheritDoc\n * @api\n */\n Polygon.prototype.intersectsExtent = function (extent) {\n return intersectsLinearRingArray(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, extent);\n };\n /**\n * Set the coordinates of the polygon.\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>} coordinates Coordinates.\n * @param {GeometryLayout=} opt_layout Layout.\n * @override\n * @api\n */\n Polygon.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n var ends = deflateCoordinatesArray(this.flatCoordinates, 0, coordinates, this.stride, this.ends_);\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n };\n return Polygon;\n}(SimpleGeometry));\nexport default Polygon;\n/**\n * Create an approximation of a circle on the surface of a sphere.\n * @param {import(\"../coordinate.js\").Coordinate} center Center (`[lon, lat]` in degrees).\n * @param {number} radius The great-circle distance from the center to\n * the polygon vertices.\n * @param {number=} opt_n Optional number of vertices for the resulting\n * polygon. Default is `32`.\n * @param {number=} opt_sphereRadius Optional radius for the sphere (defaults to\n * the Earth's mean radius using the WGS84 ellipsoid).\n * @return {Polygon} The \"circular\" polygon.\n * @api\n */\nexport function circular(center, radius, opt_n, opt_sphereRadius) {\n var n = opt_n ? opt_n : 32;\n /** @type {Array<number>} */\n var flatCoordinates = [];\n for (var i = 0; i < n; ++i) {\n extend(flatCoordinates, sphereOffset(center, radius, 2 * Math.PI * i / n, opt_sphereRadius));\n }\n flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);\n return new Polygon(flatCoordinates, GeometryLayout.XY, [flatCoordinates.length]);\n}\n/**\n * Create a polygon from an extent. The layout used is `XY`.\n * @param {import(\"../extent.js\").Extent} extent The extent.\n * @return {Polygon} The polygon.\n * @api\n */\nexport function fromExtent(extent) {\n var minX = extent[0];\n var minY = extent[1];\n var maxX = extent[2];\n var maxY = extent[3];\n var flatCoordinates = [minX, minY, minX, maxY, maxX, maxY, maxX, minY, minX, minY];\n return new Polygon(flatCoordinates, GeometryLayout.XY, [flatCoordinates.length]);\n}\n/**\n * Create a regular polygon from a circle.\n * @param {import(\"./Circle.js\").default} circle Circle geometry.\n * @param {number=} opt_sides Number of sides of the polygon. Default is 32.\n * @param {number=} opt_angle Start angle for the first vertex of the polygon in\n * radians. Default is 0.\n * @return {Polygon} Polygon geometry.\n * @api\n */\nexport function fromCircle(circle, opt_sides, opt_angle) {\n var sides = opt_sides ? opt_sides : 32;\n var stride = circle.getStride();\n var layout = circle.getLayout();\n var center = circle.getCenter();\n var arrayLength = stride * (sides + 1);\n var flatCoordinates = new Array(arrayLength);\n for (var i = 0; i < arrayLength; i += stride) {\n flatCoordinates[i] = 0;\n flatCoordinates[i + 1] = 0;\n for (var j = 2; j < stride; j++) {\n flatCoordinates[i + j] = center[j];\n }\n }\n var ends = [flatCoordinates.length];\n var polygon = new Polygon(flatCoordinates, layout, ends);\n makeRegular(polygon, center, circle.getRadius(), opt_angle);\n return polygon;\n}\n/**\n * Modify the coordinates of a polygon to make it a regular polygon.\n * @param {Polygon} polygon Polygon geometry.\n * @param {import(\"../coordinate.js\").Coordinate} center Center of the regular polygon.\n * @param {number} radius Radius of the regular polygon.\n * @param {number=} opt_angle Start angle for the first vertex of the polygon in\n * radians. Default is 0.\n */\nexport function makeRegular(polygon, center, radius, opt_angle) {\n var flatCoordinates = polygon.getFlatCoordinates();\n var stride = polygon.getStride();\n var sides = flatCoordinates.length / stride - 1;\n var startAngle = opt_angle ? opt_angle : 0;\n for (var i = 0; i <= sides; ++i) {\n var offset = i * stride;\n var angle = startAngle + (modulo(i, sides) * 2 * Math.PI / sides);\n flatCoordinates[offset] = center[0] + (radius * Math.cos(angle));\n flatCoordinates[offset + 1] = center[1] + (radius * Math.sin(angle));\n }\n polygon.changed();\n}\n//# sourceMappingURL=Polygon.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Geolocation\n */\nimport BaseObject, { getChangeEventType } from './Object.js';\nimport BaseEvent from './events/Event.js';\nimport EventType from './events/EventType.js';\nimport { circular as circularPolygon } from './geom/Polygon.js';\nimport { toRadians } from './math.js';\nimport { get as getProjection, getTransformFromProjections, identityTransform } from './proj.js';\n/**\n * @enum {string}\n */\nvar Property = {\n ACCURACY: 'accuracy',\n ACCURACY_GEOMETRY: 'accuracyGeometry',\n ALTITUDE: 'altitude',\n ALTITUDE_ACCURACY: 'altitudeAccuracy',\n HEADING: 'heading',\n POSITION: 'position',\n PROJECTION: 'projection',\n SPEED: 'speed',\n TRACKING: 'tracking',\n TRACKING_OPTIONS: 'trackingOptions'\n};\n/**\n * @classdesc\n * Events emitted on Geolocation error.\n */\nvar GeolocationError = /** @class */ (function (_super) {\n __extends(GeolocationError, _super);\n /**\n * @param {PositionError} error error object.\n */\n function GeolocationError(error) {\n var _this = _super.call(this, EventType.ERROR) || this;\n /**\n * @type {number}\n */\n _this.code = error.code;\n /**\n * @type {string}\n */\n _this.message = error.message;\n return _this;\n }\n return GeolocationError;\n}(BaseEvent));\n/**\n * @typedef {Object} Options\n * @property {boolean} [tracking=false] Start Tracking right after\n * instantiation.\n * @property {PositionOptions} [trackingOptions] Tracking options.\n * See http://www.w3.org/TR/geolocation-API/#position_options_interface.\n * @property {import(\"./proj.js\").ProjectionLike} [projection] The projection the position\n * is reported in.\n */\n/**\n * @classdesc\n * Helper class for providing HTML5 Geolocation capabilities.\n * The [Geolocation API](http://www.w3.org/TR/geolocation-API/)\n * is used to locate a user's position.\n *\n * To get notified of position changes, register a listener for the generic\n * `change` event on your instance of {@link module:ol/Geolocation~Geolocation}.\n *\n * Example:\n *\n * var geolocation = new Geolocation({\n * // take the projection to use from the map's view\n * projection: view.getProjection()\n * });\n * // listen to changes in position\n * geolocation.on('change', function(evt) {\n * window.console.log(geolocation.getPosition());\n * });\n *\n * @fires module:ol/events/Event~BaseEvent#event:error\n * @api\n */\nvar Geolocation = /** @class */ (function (_super) {\n __extends(Geolocation, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Geolocation(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options || {};\n /**\n * The unprojected (EPSG:4326) device position.\n * @private\n * @type {?import(\"./coordinate.js\").Coordinate}\n */\n _this.position_ = null;\n /**\n * @private\n * @type {import(\"./proj.js\").TransformFunction}\n */\n _this.transform_ = identityTransform;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.watchId_ = undefined;\n _this.addEventListener(getChangeEventType(Property.PROJECTION), _this.handleProjectionChanged_);\n _this.addEventListener(getChangeEventType(Property.TRACKING), _this.handleTrackingChanged_);\n if (options.projection !== undefined) {\n _this.setProjection(options.projection);\n }\n if (options.trackingOptions !== undefined) {\n _this.setTrackingOptions(options.trackingOptions);\n }\n _this.setTracking(options.tracking !== undefined ? options.tracking : false);\n return _this;\n }\n /**\n * @inheritDoc\n */\n Geolocation.prototype.disposeInternal = function () {\n this.setTracking(false);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @private\n */\n Geolocation.prototype.handleProjectionChanged_ = function () {\n var projection = this.getProjection();\n if (projection) {\n this.transform_ = getTransformFromProjections(getProjection('EPSG:4326'), projection);\n if (this.position_) {\n this.set(Property.POSITION, this.transform_(this.position_));\n }\n }\n };\n /**\n * @private\n */\n Geolocation.prototype.handleTrackingChanged_ = function () {\n if ('geolocation' in navigator) {\n var tracking = this.getTracking();\n if (tracking && this.watchId_ === undefined) {\n this.watchId_ = navigator.geolocation.watchPosition(this.positionChange_.bind(this), this.positionError_.bind(this), this.getTrackingOptions());\n }\n else if (!tracking && this.watchId_ !== undefined) {\n navigator.geolocation.clearWatch(this.watchId_);\n this.watchId_ = undefined;\n }\n }\n };\n /**\n * @private\n * @param {Position} position position event.\n */\n Geolocation.prototype.positionChange_ = function (position) {\n var coords = position.coords;\n this.set(Property.ACCURACY, coords.accuracy);\n this.set(Property.ALTITUDE, coords.altitude === null ? undefined : coords.altitude);\n this.set(Property.ALTITUDE_ACCURACY, coords.altitudeAccuracy === null ?\n undefined : coords.altitudeAccuracy);\n this.set(Property.HEADING, coords.heading === null ?\n undefined : toRadians(coords.heading));\n if (!this.position_) {\n this.position_ = [coords.longitude, coords.latitude];\n }\n else {\n this.position_[0] = coords.longitude;\n this.position_[1] = coords.latitude;\n }\n var projectedPosition = this.transform_(this.position_);\n this.set(Property.POSITION, projectedPosition);\n this.set(Property.SPEED, coords.speed === null ? undefined : coords.speed);\n var geometry = circularPolygon(this.position_, coords.accuracy);\n geometry.applyTransform(this.transform_);\n this.set(Property.ACCURACY_GEOMETRY, geometry);\n this.changed();\n };\n /**\n * @private\n * @param {PositionError} error error object.\n */\n Geolocation.prototype.positionError_ = function (error) {\n this.setTracking(false);\n this.dispatchEvent(new GeolocationError(error));\n };\n /**\n * Get the accuracy of the position in meters.\n * @return {number|undefined} The accuracy of the position measurement in\n * meters.\n * @observable\n * @api\n */\n Geolocation.prototype.getAccuracy = function () {\n return /** @type {number|undefined} */ (this.get(Property.ACCURACY));\n };\n /**\n * Get a geometry of the position accuracy.\n * @return {?import(\"./geom/Polygon.js\").default} A geometry of the position accuracy.\n * @observable\n * @api\n */\n Geolocation.prototype.getAccuracyGeometry = function () {\n return (\n /** @type {?import(\"./geom/Polygon.js\").default} */ (this.get(Property.ACCURACY_GEOMETRY) || null));\n };\n /**\n * Get the altitude associated with the position.\n * @return {number|undefined} The altitude of the position in meters above mean\n * sea level.\n * @observable\n * @api\n */\n Geolocation.prototype.getAltitude = function () {\n return /** @type {number|undefined} */ (this.get(Property.ALTITUDE));\n };\n /**\n * Get the altitude accuracy of the position.\n * @return {number|undefined} The accuracy of the altitude measurement in\n * meters.\n * @observable\n * @api\n */\n Geolocation.prototype.getAltitudeAccuracy = function () {\n return /** @type {number|undefined} */ (this.get(Property.ALTITUDE_ACCURACY));\n };\n /**\n * Get the heading as radians clockwise from North.\n * Note: depending on the browser, the heading is only defined if the `enableHighAccuracy`\n * is set to `true` in the tracking options.\n * @return {number|undefined} The heading of the device in radians from north.\n * @observable\n * @api\n */\n Geolocation.prototype.getHeading = function () {\n return /** @type {number|undefined} */ (this.get(Property.HEADING));\n };\n /**\n * Get the position of the device.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The current position of the device reported\n * in the current projection.\n * @observable\n * @api\n */\n Geolocation.prototype.getPosition = function () {\n return (\n /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (this.get(Property.POSITION)));\n };\n /**\n * Get the projection associated with the position.\n * @return {import(\"./proj/Projection.js\").default|undefined} The projection the position is\n * reported in.\n * @observable\n * @api\n */\n Geolocation.prototype.getProjection = function () {\n return (\n /** @type {import(\"./proj/Projection.js\").default|undefined} */ (this.get(Property.PROJECTION)));\n };\n /**\n * Get the speed in meters per second.\n * @return {number|undefined} The instantaneous speed of the device in meters\n * per second.\n * @observable\n * @api\n */\n Geolocation.prototype.getSpeed = function () {\n return /** @type {number|undefined} */ (this.get(Property.SPEED));\n };\n /**\n * Determine if the device location is being tracked.\n * @return {boolean} The device location is being tracked.\n * @observable\n * @api\n */\n Geolocation.prototype.getTracking = function () {\n return /** @type {boolean} */ (this.get(Property.TRACKING));\n };\n /**\n * Get the tracking options.\n * See http://www.w3.org/TR/geolocation-API/#position-options.\n * @return {PositionOptions|undefined} PositionOptions as defined by\n * the [HTML5 Geolocation spec\n * ](http://www.w3.org/TR/geolocation-API/#position_options_interface).\n * @observable\n * @api\n */\n Geolocation.prototype.getTrackingOptions = function () {\n return /** @type {PositionOptions|undefined} */ (this.get(Property.TRACKING_OPTIONS));\n };\n /**\n * Set the projection to use for transforming the coordinates.\n * @param {import(\"./proj.js\").ProjectionLike} projection The projection the position is\n * reported in.\n * @observable\n * @api\n */\n Geolocation.prototype.setProjection = function (projection) {\n this.set(Property.PROJECTION, getProjection(projection));\n };\n /**\n * Enable or disable tracking.\n * @param {boolean} tracking Enable tracking.\n * @observable\n * @api\n */\n Geolocation.prototype.setTracking = function (tracking) {\n this.set(Property.TRACKING, tracking);\n };\n /**\n * Set the tracking options.\n * See http://www.w3.org/TR/geolocation-API/#position-options.\n * @param {PositionOptions} options PositionOptions as defined by the\n * [HTML5 Geolocation spec\n * ](http://www.w3.org/TR/geolocation-API/#position_options_interface).\n * @observable\n * @api\n */\n Geolocation.prototype.setTrackingOptions = function (options) {\n this.set(Property.TRACKING_OPTIONS, options);\n };\n return Geolocation;\n}(BaseObject));\nexport default Geolocation;\n//# sourceMappingURL=Geolocation.js.map","/**\n * @module ol/Kinetic\n */\n/**\n * @classdesc\n * Implementation of inertial deceleration for map movement.\n *\n * @api\n */\nvar Kinetic = /** @class */ (function () {\n /**\n * @param {number} decay Rate of decay (must be negative).\n * @param {number} minVelocity Minimum velocity (pixels/millisecond).\n * @param {number} delay Delay to consider to calculate the kinetic\n * initial values (milliseconds).\n */\n function Kinetic(decay, minVelocity, delay) {\n /**\n * @private\n * @type {number}\n */\n this.decay_ = decay;\n /**\n * @private\n * @type {number}\n */\n this.minVelocity_ = minVelocity;\n /**\n * @private\n * @type {number}\n */\n this.delay_ = delay;\n /**\n * @private\n * @type {Array<number>}\n */\n this.points_ = [];\n /**\n * @private\n * @type {number}\n */\n this.angle_ = 0;\n /**\n * @private\n * @type {number}\n */\n this.initialVelocity_ = 0;\n }\n /**\n * FIXME empty description for jsdoc\n */\n Kinetic.prototype.begin = function () {\n this.points_.length = 0;\n this.angle_ = 0;\n this.initialVelocity_ = 0;\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n */\n Kinetic.prototype.update = function (x, y) {\n this.points_.push(x, y, Date.now());\n };\n /**\n * @return {boolean} Whether we should do kinetic animation.\n */\n Kinetic.prototype.end = function () {\n if (this.points_.length < 6) {\n // at least 2 points are required (i.e. there must be at least 6 elements\n // in the array)\n return false;\n }\n var delay = Date.now() - this.delay_;\n var lastIndex = this.points_.length - 3;\n if (this.points_[lastIndex + 2] < delay) {\n // the last tracked point is too old, which means that the user stopped\n // panning before releasing the map\n return false;\n }\n // get the first point which still falls into the delay time\n var firstIndex = lastIndex - 3;\n while (firstIndex > 0 && this.points_[firstIndex + 2] > delay) {\n firstIndex -= 3;\n }\n var duration = this.points_[lastIndex + 2] - this.points_[firstIndex + 2];\n // we don't want a duration of 0 (divide by zero)\n // we also make sure the user panned for a duration of at least one frame\n // (1/60s) to compute sane displacement values\n if (duration < 1000 / 60) {\n return false;\n }\n var dx = this.points_[lastIndex] - this.points_[firstIndex];\n var dy = this.points_[lastIndex + 1] - this.points_[firstIndex + 1];\n this.angle_ = Math.atan2(dy, dx);\n this.initialVelocity_ = Math.sqrt(dx * dx + dy * dy) / duration;\n return this.initialVelocity_ > this.minVelocity_;\n };\n /**\n * @return {number} Total distance travelled (pixels).\n */\n Kinetic.prototype.getDistance = function () {\n return (this.minVelocity_ - this.initialVelocity_) / this.decay_;\n };\n /**\n * @return {number} Angle of the kinetic panning animation (radians).\n */\n Kinetic.prototype.getAngle = function () {\n return this.angle_;\n };\n return Kinetic;\n}());\nexport default Kinetic;\n//# sourceMappingURL=Kinetic.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/MapEvent\n */\nimport Event from './events/Event.js';\n/**\n * @classdesc\n * Events emitted as map events are instances of this type.\n * See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map event.\n */\nvar MapEvent = /** @class */ (function (_super) {\n __extends(MapEvent, _super);\n /**\n * @param {string} type Event type.\n * @param {import(\"./PluggableMap.js\").default} map Map.\n * @param {?import(\"./PluggableMap.js\").FrameState=} opt_frameState Frame state.\n */\n function MapEvent(type, map, opt_frameState) {\n var _this = _super.call(this, type) || this;\n /**\n * The map where the event occurred.\n * @type {import(\"./PluggableMap.js\").default}\n * @api\n */\n _this.map = map;\n /**\n * The frame state at the time of the event.\n * @type {?import(\"./PluggableMap.js\").FrameState}\n * @api\n */\n _this.frameState = opt_frameState !== undefined ? opt_frameState : null;\n return _this;\n }\n return MapEvent;\n}(Event));\nexport default MapEvent;\n//# sourceMappingURL=MapEvent.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/MapBrowserEvent\n */\nimport MapEvent from './MapEvent.js';\n/**\n * @classdesc\n * Events emitted as map browser events are instances of this type.\n * See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map browser event.\n */\nvar MapBrowserEvent = /** @class */ (function (_super) {\n __extends(MapBrowserEvent, _super);\n /**\n * @param {string} type Event type.\n * @param {import(\"./PluggableMap.js\").default} map Map.\n * @param {Event} browserEvent Browser event.\n * @param {boolean=} opt_dragging Is the map currently being dragged?\n * @param {?import(\"./PluggableMap.js\").FrameState=} opt_frameState Frame state.\n */\n function MapBrowserEvent(type, map, browserEvent, opt_dragging, opt_frameState) {\n var _this = _super.call(this, type, map, opt_frameState) || this;\n /**\n * The original browser event.\n * @const\n * @type {Event}\n * @api\n */\n _this.originalEvent = browserEvent;\n /**\n * The map pixel relative to the viewport corresponding to the original browser event.\n * @type {?import(\"./pixel.js\").Pixel}\n */\n _this.pixel_ = null;\n /**\n * The coordinate in the user projection corresponding to the original browser event.\n * @type {?import(\"./coordinate.js\").Coordinate}\n */\n _this.coordinate_ = null;\n /**\n * Indicates if the map is currently being dragged. Only set for\n * `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.\n *\n * @type {boolean}\n * @api\n */\n _this.dragging = opt_dragging !== undefined ? opt_dragging : false;\n return _this;\n }\n Object.defineProperty(MapBrowserEvent.prototype, \"pixel\", {\n /**\n * The map pixel relative to the viewport corresponding to the original browser event.\n * @type {import(\"./pixel.js\").Pixel}\n * @api\n */\n get: function () {\n if (!this.pixel_) {\n this.pixel_ = this.map.getEventPixel(this.originalEvent);\n }\n return this.pixel_;\n },\n set: function (pixel) {\n this.pixel_ = pixel;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MapBrowserEvent.prototype, \"coordinate\", {\n /**\n * The coordinate corresponding to the original browser event. This will be in the user\n * projection if one is set. Otherwise it will be in the view projection.\n * @type {import(\"./coordinate.js\").Coordinate}\n * @api\n */\n get: function () {\n if (!this.coordinate_) {\n this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel);\n }\n return this.coordinate_;\n },\n set: function (coordinate) {\n this.coordinate_ = coordinate;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Prevents the default browser action.\n * See https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault.\n * @override\n * @api\n */\n MapBrowserEvent.prototype.preventDefault = function () {\n _super.prototype.preventDefault.call(this);\n this.originalEvent.preventDefault();\n };\n /**\n * Prevents further propagation of the current event.\n * See https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation.\n * @override\n * @api\n */\n MapBrowserEvent.prototype.stopPropagation = function () {\n _super.prototype.stopPropagation.call(this);\n this.originalEvent.stopPropagation();\n };\n return MapBrowserEvent;\n}(MapEvent));\nexport default MapBrowserEvent;\n//# sourceMappingURL=MapBrowserEvent.js.map","/**\n * @module ol/has\n */\nvar ua = typeof navigator !== 'undefined' ?\n navigator.userAgent.toLowerCase() : '';\n/**\n * User agent string says we are dealing with Firefox as browser.\n * @type {boolean}\n */\nexport var FIREFOX = ua.indexOf('firefox') !== -1;\n/**\n * User agent string says we are dealing with Safari as browser.\n * @type {boolean}\n */\nexport var SAFARI = ua.indexOf('safari') !== -1 && ua.indexOf('chrom') == -1;\n/**\n * User agent string says we are dealing with a WebKit engine.\n * @type {boolean}\n */\nexport var WEBKIT = ua.indexOf('webkit') !== -1 && ua.indexOf('edge') == -1;\n/**\n * User agent string says we are dealing with a Mac as platform.\n * @type {boolean}\n */\nexport var MAC = ua.indexOf('macintosh') !== -1;\n/**\n * The ratio between physical pixels and device-independent pixels\n * (dips) on the device (`window.devicePixelRatio`).\n * @const\n * @type {number}\n * @api\n */\nexport var DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1;\n/**\n * Image.prototype.decode() is supported.\n * @type {boolean}\n */\nexport var IMAGE_DECODE = typeof Image !== 'undefined' && Image.prototype.decode;\n//# sourceMappingURL=has.js.map","/**\n * @module ol/MapBrowserEventType\n */\nimport EventType from './events/EventType.js';\n/**\n * Constants for event names.\n * @enum {string}\n */\nexport default {\n /**\n * A true single click with no dragging and no double click. Note that this\n * event is delayed by 250 ms to ensure that it is not a double click.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick\n * @api\n */\n SINGLECLICK: 'singleclick',\n /**\n * A click with no dragging. A double click will fire two of this.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#click\n * @api\n */\n CLICK: EventType.CLICK,\n /**\n * A true double click, with no dragging.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick\n * @api\n */\n DBLCLICK: EventType.DBLCLICK,\n /**\n * Triggered when a pointer is dragged.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag\n * @api\n */\n POINTERDRAG: 'pointerdrag',\n /**\n * Triggered when a pointer is moved. Note that on touch devices this is\n * triggered when the map is panned, so is not the same as mousemove.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove\n * @api\n */\n POINTERMOVE: 'pointermove',\n POINTERDOWN: 'pointerdown',\n POINTERUP: 'pointerup',\n POINTEROVER: 'pointerover',\n POINTEROUT: 'pointerout',\n POINTERENTER: 'pointerenter',\n POINTERLEAVE: 'pointerleave',\n POINTERCANCEL: 'pointercancel'\n};\n//# sourceMappingURL=MapBrowserEventType.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/MapBrowserPointerEvent\n */\nimport MapBrowserEvent from './MapBrowserEvent.js';\nvar MapBrowserPointerEvent = /** @class */ (function (_super) {\n __extends(MapBrowserPointerEvent, _super);\n /**\n * @param {string} type Event type.\n * @param {import(\"./PluggableMap.js\").default} map Map.\n * @param {PointerEvent} pointerEvent Pointer event.\n * @param {boolean=} opt_dragging Is the map currently being dragged?\n * @param {?import(\"./PluggableMap.js\").FrameState=} opt_frameState Frame state.\n */\n function MapBrowserPointerEvent(type, map, pointerEvent, opt_dragging, opt_frameState) {\n var _this = _super.call(this, type, map, pointerEvent, opt_dragging, opt_frameState) || this;\n /**\n * @const\n * @type {PointerEvent}\n */\n _this.pointerEvent = pointerEvent;\n return _this;\n }\n return MapBrowserPointerEvent;\n}(MapBrowserEvent));\nexport default MapBrowserPointerEvent;\n//# sourceMappingURL=MapBrowserPointerEvent.js.map","/**\n * @module ol/pointer/EventType\n */\n/**\n * Constants for event names.\n * @enum {string}\n */\nexport default {\n POINTERMOVE: 'pointermove',\n POINTERDOWN: 'pointerdown',\n POINTERUP: 'pointerup',\n POINTEROVER: 'pointerover',\n POINTEROUT: 'pointerout',\n POINTERENTER: 'pointerenter',\n POINTERLEAVE: 'pointerleave',\n POINTERCANCEL: 'pointercancel'\n};\n//# sourceMappingURL=EventType.js.map","/**\n * @module ol/MapBrowserEventHandler\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport '@openlayers/pepjs';\nimport { DEVICE_PIXEL_RATIO } from './has.js';\nimport MapBrowserEventType from './MapBrowserEventType.js';\nimport MapBrowserPointerEvent from './MapBrowserPointerEvent.js';\nimport { listen, unlistenByKey } from './events.js';\nimport EventTarget from './events/Target.js';\nimport PointerEventType from './pointer/EventType.js';\nvar MapBrowserEventHandler = /** @class */ (function (_super) {\n __extends(MapBrowserEventHandler, _super);\n /**\n * @param {import(\"./PluggableMap.js\").default} map The map with the viewport to listen to events on.\n * @param {number=} moveTolerance The minimal distance the pointer must travel to trigger a move.\n */\n function MapBrowserEventHandler(map, moveTolerance) {\n var _this = _super.call(this, map) || this;\n /**\n * This is the element that we will listen to the real events on.\n * @type {import(\"./PluggableMap.js\").default}\n * @private\n */\n _this.map_ = map;\n /**\n * @type {any}\n * @private\n */\n _this.clickTimeoutId_;\n /**\n * @type {boolean}\n * @private\n */\n _this.dragging_ = false;\n /**\n * @type {!Array<import(\"./events.js\").EventsKey>}\n * @private\n */\n _this.dragListenerKeys_ = [];\n /**\n * @type {number}\n * @private\n */\n _this.moveTolerance_ = moveTolerance ?\n moveTolerance * DEVICE_PIXEL_RATIO : DEVICE_PIXEL_RATIO;\n /**\n * The most recent \"down\" type event (or null if none have occurred).\n * Set on pointerdown.\n * @type {PointerEvent}\n * @private\n */\n _this.down_ = null;\n var element = _this.map_.getViewport();\n /**\n * @type {number}\n * @private\n */\n _this.activePointers_ = 0;\n /**\n * @type {!Object<number, boolean>}\n * @private\n */\n _this.trackedTouches_ = {};\n _this.element_ = element;\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n _this.pointerdownListenerKey_ = listen(element, PointerEventType.POINTERDOWN, _this.handlePointerDown_, _this);\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n _this.relayedListenerKey_ = listen(element, PointerEventType.POINTERMOVE, _this.relayEvent_, _this);\n return _this;\n }\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.emulateClick_ = function (pointerEvent) {\n var newEvent = new MapBrowserPointerEvent(MapBrowserEventType.CLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n if (this.clickTimeoutId_ !== undefined) {\n // double-click\n clearTimeout(this.clickTimeoutId_);\n this.clickTimeoutId_ = undefined;\n newEvent = new MapBrowserPointerEvent(MapBrowserEventType.DBLCLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n }\n else {\n // click\n this.clickTimeoutId_ = setTimeout(function () {\n this.clickTimeoutId_ = undefined;\n var newEvent = new MapBrowserPointerEvent(MapBrowserEventType.SINGLECLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n }.bind(this), 250);\n }\n };\n /**\n * Keeps track on how many pointers are currently active.\n *\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.updateActivePointers_ = function (pointerEvent) {\n var event = pointerEvent;\n if (event.type == MapBrowserEventType.POINTERUP ||\n event.type == MapBrowserEventType.POINTERCANCEL) {\n delete this.trackedTouches_[event.pointerId];\n }\n else if (event.type == MapBrowserEventType.POINTERDOWN) {\n this.trackedTouches_[event.pointerId] = true;\n }\n this.activePointers_ = Object.keys(this.trackedTouches_).length;\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.handlePointerUp_ = function (pointerEvent) {\n this.updateActivePointers_(pointerEvent);\n var newEvent = new MapBrowserPointerEvent(MapBrowserEventType.POINTERUP, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n // We emulate click events on left mouse button click, touch contact, and pen\n // contact. isMouseActionButton returns true in these cases (evt.button is set\n // to 0).\n // See http://www.w3.org/TR/pointerevents/#button-states\n // We only fire click, singleclick, and doubleclick if nobody has called\n // event.stopPropagation() or event.preventDefault().\n if (!newEvent.propagationStopped && !this.dragging_ && this.isMouseActionButton_(pointerEvent)) {\n this.emulateClick_(this.down_);\n }\n if (this.activePointers_ === 0) {\n this.dragListenerKeys_.forEach(unlistenByKey);\n this.dragListenerKeys_.length = 0;\n this.dragging_ = false;\n this.down_ = null;\n }\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @return {boolean} If the left mouse button was pressed.\n * @private\n */\n MapBrowserEventHandler.prototype.isMouseActionButton_ = function (pointerEvent) {\n return pointerEvent.button === 0;\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.handlePointerDown_ = function (pointerEvent) {\n this.updateActivePointers_(pointerEvent);\n var newEvent = new MapBrowserPointerEvent(MapBrowserEventType.POINTERDOWN, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n this.down_ = pointerEvent;\n if (this.dragListenerKeys_.length === 0) {\n this.dragListenerKeys_.push(listen(document, MapBrowserEventType.POINTERMOVE, this.handlePointerMove_, this), listen(document, MapBrowserEventType.POINTERUP, this.handlePointerUp_, this), \n /* Note that the listener for `pointercancel is set up on\n * `pointerEventHandler_` and not `documentPointerEventHandler_` like\n * the `pointerup` and `pointermove` listeners.\n *\n * The reason for this is the following: `TouchSource.vacuumTouches_()`\n * issues `pointercancel` events, when there was no `touchend` for a\n * `touchstart`. Now, let's say a first `touchstart` is registered on\n * `pointerEventHandler_`. The `documentPointerEventHandler_` is set up.\n * But `documentPointerEventHandler_` doesn't know about the first\n * `touchstart`. If there is no `touchend` for the `touchstart`, we can\n * only receive a `touchcancel` from `pointerEventHandler_`, because it is\n * only registered there.\n */\n listen(this.element_, MapBrowserEventType.POINTERCANCEL, this.handlePointerUp_, this));\n }\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.handlePointerMove_ = function (pointerEvent) {\n // Between pointerdown and pointerup, pointermove events are triggered.\n // To avoid a 'false' touchmove event to be dispatched, we test if the pointer\n // moved a significant distance.\n if (this.isMoving_(pointerEvent)) {\n this.dragging_ = true;\n var newEvent = new MapBrowserPointerEvent(MapBrowserEventType.POINTERDRAG, this.map_, pointerEvent, this.dragging_);\n this.dispatchEvent(newEvent);\n }\n };\n /**\n * Wrap and relay a pointer event. Note that this requires that the type\n * string for the MapBrowserPointerEvent matches the PointerEvent type.\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.relayEvent_ = function (pointerEvent) {\n var dragging = !!(this.down_ && this.isMoving_(pointerEvent));\n this.dispatchEvent(new MapBrowserPointerEvent(pointerEvent.type, this.map_, pointerEvent, dragging));\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @return {boolean} Is moving.\n * @private\n */\n MapBrowserEventHandler.prototype.isMoving_ = function (pointerEvent) {\n return this.dragging_ ||\n Math.abs(pointerEvent.clientX - this.down_.clientX) > this.moveTolerance_ ||\n Math.abs(pointerEvent.clientY - this.down_.clientY) > this.moveTolerance_;\n };\n /**\n * @inheritDoc\n */\n MapBrowserEventHandler.prototype.disposeInternal = function () {\n if (this.relayedListenerKey_) {\n unlistenByKey(this.relayedListenerKey_);\n this.relayedListenerKey_ = null;\n }\n if (this.pointerdownListenerKey_) {\n unlistenByKey(this.pointerdownListenerKey_);\n this.pointerdownListenerKey_ = null;\n }\n this.dragListenerKeys_.forEach(unlistenByKey);\n this.dragListenerKeys_.length = 0;\n this.element_ = null;\n _super.prototype.disposeInternal.call(this);\n };\n return MapBrowserEventHandler;\n}(EventTarget));\nexport default MapBrowserEventHandler;\n//# sourceMappingURL=MapBrowserEventHandler.js.map","/**\n * @module ol/MapEventType\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 * Triggered when the map starts moving.\n * @event module:ol/MapEvent~MapEvent#movestart\n * @api\n */\n MOVESTART: 'movestart',\n /**\n * Triggered after the map is moved.\n * @event module:ol/MapEvent~MapEvent#moveend\n * @api\n */\n MOVEEND: 'moveend'\n};\n//# sourceMappingURL=MapEventType.js.map","/**\n * @module ol/MapProperty\n */\n/**\n * @enum {string}\n */\nexport default {\n LAYERGROUP: 'layergroup',\n SIZE: 'size',\n TARGET: 'target',\n VIEW: 'view'\n};\n//# sourceMappingURL=MapProperty.js.map","/**\n * @module ol/render/EventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered before a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#prerender\n * @api\n */\n PRERENDER: 'prerender',\n /**\n * Triggered after a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n /**\n * Triggered before layers are rendered.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#precompose\n * @api\n */\n PRECOMPOSE: 'precompose',\n /**\n * Triggered after all layers are rendered.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#postcompose\n * @api\n */\n POSTCOMPOSE: 'postcompose',\n /**\n * Triggered when rendering is complete, i.e. all sources and tiles have\n * finished loading for the current viewport, and all tiles are faded in.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#rendercomplete\n * @api\n */\n RENDERCOMPLETE: 'rendercomplete'\n};\n//# sourceMappingURL=EventType.js.map","/**\n * @module ol/TileState\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 ABORT: 5\n};\n//# sourceMappingURL=TileState.js.map","/**\n * @module ol/structs/PriorityQueue\n */\nimport { assert } from '../asserts.js';\nimport { clear } from '../obj.js';\n/**\n * @type {number}\n */\nexport var DROP = Infinity;\n/**\n * @classdesc\n * Priority queue.\n *\n * The implementation is inspired from the Closure Library's Heap class and\n * Python's heapq module.\n *\n * See http://closure-library.googlecode.com/svn/docs/closure_goog_structs_heap.js.source.html\n * and http://hg.python.org/cpython/file/2.7/Lib/heapq.py.\n *\n * @template T\n */\nvar PriorityQueue = /** @class */ (function () {\n /**\n * @param {function(T): number} priorityFunction Priority function.\n * @param {function(T): string} keyFunction Key function.\n */\n function PriorityQueue(priorityFunction, keyFunction) {\n /**\n * @type {function(T): number}\n * @private\n */\n this.priorityFunction_ = priorityFunction;\n /**\n * @type {function(T): string}\n * @private\n */\n this.keyFunction_ = keyFunction;\n /**\n * @type {Array<T>}\n * @private\n */\n this.elements_ = [];\n /**\n * @type {Array<number>}\n * @private\n */\n this.priorities_ = [];\n /**\n * @type {!Object<string, boolean>}\n * @private\n */\n this.queuedElements_ = {};\n }\n /**\n * FIXME empty description for jsdoc\n */\n PriorityQueue.prototype.clear = function () {\n this.elements_.length = 0;\n this.priorities_.length = 0;\n clear(this.queuedElements_);\n };\n /**\n * Remove and return the highest-priority element. O(log N).\n * @return {T} Element.\n */\n PriorityQueue.prototype.dequeue = function () {\n var elements = this.elements_;\n var priorities = this.priorities_;\n var element = elements[0];\n if (elements.length == 1) {\n elements.length = 0;\n priorities.length = 0;\n }\n else {\n elements[0] = elements.pop();\n priorities[0] = priorities.pop();\n this.siftUp_(0);\n }\n var elementKey = this.keyFunction_(element);\n delete this.queuedElements_[elementKey];\n return element;\n };\n /**\n * Enqueue an element. O(log N).\n * @param {T} element Element.\n * @return {boolean} The element was added to the queue.\n */\n PriorityQueue.prototype.enqueue = function (element) {\n assert(!(this.keyFunction_(element) in this.queuedElements_), 31); // Tried to enqueue an `element` that was already added to the queue\n var priority = this.priorityFunction_(element);\n if (priority != DROP) {\n this.elements_.push(element);\n this.priorities_.push(priority);\n this.queuedElements_[this.keyFunction_(element)] = true;\n this.siftDown_(0, this.elements_.length - 1);\n return true;\n }\n return false;\n };\n /**\n * @return {number} Count.\n */\n PriorityQueue.prototype.getCount = function () {\n return this.elements_.length;\n };\n /**\n * Gets the index of the left child of the node at the given index.\n * @param {number} index The index of the node to get the left child for.\n * @return {number} The index of the left child.\n * @private\n */\n PriorityQueue.prototype.getLeftChildIndex_ = function (index) {\n return index * 2 + 1;\n };\n /**\n * Gets the index of the right child of the node at the given index.\n * @param {number} index The index of the node to get the right child for.\n * @return {number} The index of the right child.\n * @private\n */\n PriorityQueue.prototype.getRightChildIndex_ = function (index) {\n return index * 2 + 2;\n };\n /**\n * Gets the index of the parent of the node at the given index.\n * @param {number} index The index of the node to get the parent for.\n * @return {number} The index of the parent.\n * @private\n */\n PriorityQueue.prototype.getParentIndex_ = function (index) {\n return (index - 1) >> 1;\n };\n /**\n * Make this a heap. O(N).\n * @private\n */\n PriorityQueue.prototype.heapify_ = function () {\n var i;\n for (i = (this.elements_.length >> 1) - 1; i >= 0; i--) {\n this.siftUp_(i);\n }\n };\n /**\n * @return {boolean} Is empty.\n */\n PriorityQueue.prototype.isEmpty = function () {\n return this.elements_.length === 0;\n };\n /**\n * @param {string} key Key.\n * @return {boolean} Is key queued.\n */\n PriorityQueue.prototype.isKeyQueued = function (key) {\n return key in this.queuedElements_;\n };\n /**\n * @param {T} element Element.\n * @return {boolean} Is queued.\n */\n PriorityQueue.prototype.isQueued = function (element) {\n return this.isKeyQueued(this.keyFunction_(element));\n };\n /**\n * @param {number} index The index of the node to move down.\n * @private\n */\n PriorityQueue.prototype.siftUp_ = function (index) {\n var elements = this.elements_;\n var priorities = this.priorities_;\n var count = elements.length;\n var element = elements[index];\n var priority = priorities[index];\n var startIndex = index;\n while (index < (count >> 1)) {\n var lIndex = this.getLeftChildIndex_(index);\n var rIndex = this.getRightChildIndex_(index);\n var smallerChildIndex = rIndex < count &&\n priorities[rIndex] < priorities[lIndex] ?\n rIndex : lIndex;\n elements[index] = elements[smallerChildIndex];\n priorities[index] = priorities[smallerChildIndex];\n index = smallerChildIndex;\n }\n elements[index] = element;\n priorities[index] = priority;\n this.siftDown_(startIndex, index);\n };\n /**\n * @param {number} startIndex The index of the root.\n * @param {number} index The index of the node to move up.\n * @private\n */\n PriorityQueue.prototype.siftDown_ = function (startIndex, index) {\n var elements = this.elements_;\n var priorities = this.priorities_;\n var element = elements[index];\n var priority = priorities[index];\n while (index > startIndex) {\n var parentIndex = this.getParentIndex_(index);\n if (priorities[parentIndex] > priority) {\n elements[index] = elements[parentIndex];\n priorities[index] = priorities[parentIndex];\n index = parentIndex;\n }\n else {\n break;\n }\n }\n elements[index] = element;\n priorities[index] = priority;\n };\n /**\n * FIXME empty description for jsdoc\n */\n PriorityQueue.prototype.reprioritize = function () {\n var priorityFunction = this.priorityFunction_;\n var elements = this.elements_;\n var priorities = this.priorities_;\n var index = 0;\n var n = elements.length;\n var element, i, priority;\n for (i = 0; i < n; ++i) {\n element = elements[i];\n priority = priorityFunction(element);\n if (priority == DROP) {\n delete this.queuedElements_[this.keyFunction_(element)];\n }\n else {\n priorities[index] = priority;\n elements[index++] = element;\n }\n }\n elements.length = index;\n priorities.length = index;\n this.heapify_();\n };\n return PriorityQueue;\n}());\nexport default PriorityQueue;\n//# sourceMappingURL=PriorityQueue.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/TileQueue\n */\nimport TileState from './TileState.js';\nimport EventType from './events/EventType.js';\nimport PriorityQueue from './structs/PriorityQueue.js';\n/**\n * @typedef {function(import(\"./Tile.js\").default, string, import(\"./coordinate.js\").Coordinate, number): number} PriorityFunction\n */\nvar TileQueue = /** @class */ (function (_super) {\n __extends(TileQueue, _super);\n /**\n * @param {PriorityFunction} tilePriorityFunction Tile priority function.\n * @param {function(): ?} tileChangeCallback Function called on each tile change event.\n */\n function TileQueue(tilePriorityFunction, tileChangeCallback) {\n var _this = _super.call(this, \n /**\n * @param {Array} element Element.\n * @return {number} Priority.\n */\n function (element) {\n return tilePriorityFunction.apply(null, element);\n }, \n /**\n * @param {Array} element Element.\n * @return {string} Key.\n */\n function (element) {\n return ( /** @type {import(\"./Tile.js\").default} */(element[0]).getKey());\n }) || this;\n /** @private */\n _this.boundHandleTileChange_ = _this.handleTileChange.bind(_this);\n /**\n * @private\n * @type {function(): ?}\n */\n _this.tileChangeCallback_ = tileChangeCallback;\n /**\n * @private\n * @type {number}\n */\n _this.tilesLoading_ = 0;\n /**\n * @private\n * @type {!Object<string,boolean>}\n */\n _this.tilesLoadingKeys_ = {};\n return _this;\n }\n /**\n * @inheritDoc\n */\n TileQueue.prototype.enqueue = function (element) {\n var added = _super.prototype.enqueue.call(this, element);\n if (added) {\n var tile = element[0];\n tile.addEventListener(EventType.CHANGE, this.boundHandleTileChange_);\n }\n return added;\n };\n /**\n * @return {number} Number of tiles loading.\n */\n TileQueue.prototype.getTilesLoading = function () {\n return this.tilesLoading_;\n };\n /**\n * @param {import(\"./events/Event.js\").default} event Event.\n * @protected\n */\n TileQueue.prototype.handleTileChange = function (event) {\n var tile = /** @type {import(\"./Tile.js\").default} */ (event.target);\n var state = tile.getState();\n if (tile.hifi && state === TileState.LOADED || state === TileState.ERROR ||\n state === TileState.EMPTY || state === TileState.ABORT) {\n tile.removeEventListener(EventType.CHANGE, this.boundHandleTileChange_);\n var tileKey = tile.getKey();\n if (tileKey in this.tilesLoadingKeys_) {\n delete this.tilesLoadingKeys_[tileKey];\n --this.tilesLoading_;\n }\n this.tileChangeCallback_();\n }\n };\n /**\n * @param {number} maxTotalLoading Maximum number tiles to load simultaneously.\n * @param {number} maxNewLoads Maximum number of new tiles to load.\n */\n TileQueue.prototype.loadMoreTiles = function (maxTotalLoading, maxNewLoads) {\n var newLoads = 0;\n var abortedTiles = false;\n var state, tile, tileKey;\n while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads &&\n this.getCount() > 0) {\n tile = /** @type {import(\"./Tile.js\").default} */ (this.dequeue()[0]);\n tileKey = tile.getKey();\n state = tile.getState();\n if (state === TileState.ABORT) {\n abortedTiles = true;\n }\n else if (state === TileState.IDLE && !(tileKey in this.tilesLoadingKeys_)) {\n this.tilesLoadingKeys_[tileKey] = true;\n ++this.tilesLoading_;\n ++newLoads;\n tile.load();\n }\n }\n if (newLoads === 0 && abortedTiles) {\n // Do not stop the render loop when all wanted tiles were aborted due to\n // a small, saturated tile cache.\n this.tileChangeCallback_();\n }\n };\n return TileQueue;\n}(PriorityQueue));\nexport default TileQueue;\n//# sourceMappingURL=TileQueue.js.map","/**\n * @module ol/tilegrid/common\n */\n/**\n * Default maximum zoom for default tile grids.\n * @type {number}\n */\nexport var DEFAULT_MAX_ZOOM = 42;\n/**\n * Default tile size.\n * @type {number}\n */\nexport var DEFAULT_TILE_SIZE = 256;\n//# sourceMappingURL=common.js.map","/**\n * @module ol/centerconstraint\n */\nimport { clamp } from './math.js';\n/**\n * @typedef {function((import(\"./coordinate.js\").Coordinate|undefined), number, import(\"./size.js\").Size, boolean=): (import(\"./coordinate.js\").Coordinate|undefined)} Type\n */\n/**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {boolean} onlyCenter If true, the constraint will only apply to the view center.\n * @param {boolean} smooth If true, the view will be able to go slightly out of the given extent\n * (only during interaction and animation).\n * @return {Type} The constraint.\n */\nexport function createExtent(extent, onlyCenter, smooth) {\n return (\n /**\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center Center.\n * @param {number} resolution Resolution.\n * @param {import(\"./size.js\").Size} size Viewport size; unused if `onlyCenter` was specified.\n * @param {boolean=} opt_isMoving True if an interaction or animation is in progress.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center.\n */\n function (center, resolution, size, opt_isMoving) {\n if (center) {\n var viewWidth = onlyCenter ? 0 : size[0] * resolution;\n var viewHeight = onlyCenter ? 0 : size[1] * resolution;\n var minX = extent[0] + viewWidth / 2;\n var maxX = extent[2] - viewWidth / 2;\n var minY = extent[1] + viewHeight / 2;\n var maxY = extent[3] - viewHeight / 2;\n // note: when zooming out of bounds, min and max values for x and y may\n // end up inverted (min > max); this has to be accounted for\n if (minX > maxX) {\n minX = (maxX + minX) / 2;\n maxX = minX;\n }\n if (minY > maxY) {\n minY = (maxY + minY) / 2;\n maxY = minY;\n }\n var x = clamp(center[0], minX, maxX);\n var y = clamp(center[1], minY, maxY);\n var ratio = 30 * resolution;\n // during an interaction, allow some overscroll\n if (opt_isMoving && smooth) {\n x += -ratio * Math.log(1 + Math.max(0, minX - center[0]) / ratio) +\n ratio * Math.log(1 + Math.max(0, center[0] - maxX) / ratio);\n y += -ratio * Math.log(1 + Math.max(0, minY - center[1]) / ratio) +\n ratio * Math.log(1 + Math.max(0, center[1] - maxY) / ratio);\n }\n return [x, y];\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {import(\"./coordinate.js\").Coordinate=} center Center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center.\n */\nexport function none(center) {\n return center;\n}\n//# sourceMappingURL=centerconstraint.js.map","/**\n * @module ol/resolutionconstraint\n */\nimport { linearFindNearest } from './array.js';\nimport { getHeight, getWidth } from './extent.js';\nimport { clamp } from './math.js';\n/**\n * @typedef {function((number|undefined), number, import(\"./size.js\").Size, boolean=): (number|undefined)} Type\n */\n/**\n * Returns a modified resolution taking into acocunt the viewport size and maximum\n * allowed extent.\n * @param {number} resolution Resolution\n * @param {import(\"./extent.js\").Extent=} maxExtent Maximum allowed extent.\n * @param {import(\"./size.js\").Size} viewportSize Viewport size.\n * @return {number} Capped resolution.\n */\nfunction getViewportClampedResolution(resolution, maxExtent, viewportSize) {\n var xResolution = getWidth(maxExtent) / viewportSize[0];\n var yResolution = getHeight(maxExtent) / viewportSize[1];\n return Math.min(resolution, Math.min(xResolution, yResolution));\n}\n/**\n * Returns a modified resolution to be between maxResolution and minResolution while\n * still allowing the value to be slightly out of bounds.\n * Note: the computation is based on the logarithm function (ln):\n * - at 1, ln(x) is 0\n * - above 1, ln(x) keeps increasing but at a much slower pace than x\n * The final result is clamped to prevent getting too far away from bounds.\n * @param {number} resolution Resolution.\n * @param {number} maxResolution Max resolution.\n * @param {number} minResolution Min resolution.\n * @return {number} Smoothed resolution.\n */\nfunction getSmoothClampedResolution(resolution, maxResolution, minResolution) {\n var result = Math.min(resolution, maxResolution);\n var ratio = 50;\n result *= Math.log(1 + ratio * Math.max(0, resolution / maxResolution - 1)) / ratio + 1;\n if (minResolution) {\n result = Math.max(result, minResolution);\n result /= Math.log(1 + ratio * Math.max(0, minResolution / resolution - 1)) / ratio + 1;\n }\n return clamp(result, minResolution / 2, maxResolution * 2);\n}\n/**\n * @param {Array<number>} resolutions Resolutions.\n * @param {boolean=} opt_smooth If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent=} opt_maxExtent Maximum allowed extent.\n * @return {Type} Zoom function.\n */\nexport function createSnapToResolutions(resolutions, opt_smooth, opt_maxExtent) {\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean=} opt_isMoving True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, opt_isMoving) {\n if (resolution !== undefined) {\n var maxResolution = resolutions[0];\n var minResolution = resolutions[resolutions.length - 1];\n var cappedMaxRes = opt_maxExtent ?\n getViewportClampedResolution(maxResolution, opt_maxExtent, size) :\n maxResolution;\n // during interacting or animating, allow intermediary values\n if (opt_isMoving) {\n var smooth = opt_smooth !== undefined ? opt_smooth : true;\n if (!smooth) {\n return clamp(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n var capped = Math.min(cappedMaxRes, resolution);\n var z = Math.floor(linearFindNearest(resolutions, capped, direction));\n if (resolutions[z] > cappedMaxRes && z < resolutions.length - 1) {\n return resolutions[z + 1];\n }\n return resolutions[z];\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {number} power Power.\n * @param {number} maxResolution Maximum resolution.\n * @param {number=} opt_minResolution Minimum resolution.\n * @param {boolean=} opt_smooth If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent=} opt_maxExtent Maximum allowed extent.\n * @return {Type} Zoom function.\n */\nexport function createSnapToPower(power, maxResolution, opt_minResolution, opt_smooth, opt_maxExtent) {\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean=} opt_isMoving True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, opt_isMoving) {\n if (resolution !== undefined) {\n var cappedMaxRes = opt_maxExtent ?\n getViewportClampedResolution(maxResolution, opt_maxExtent, size) :\n maxResolution;\n var minResolution = opt_minResolution !== undefined ? opt_minResolution : 0;\n // during interacting or animating, allow intermediary values\n if (opt_isMoving) {\n var smooth = opt_smooth !== undefined ? opt_smooth : true;\n if (!smooth) {\n return clamp(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n var tolerance = 1e-9;\n var minZoomLevel = Math.ceil(Math.log(maxResolution / cappedMaxRes) / Math.log(power) - tolerance);\n var offset = -direction * (0.5 - tolerance) + 0.5;\n var capped = Math.min(cappedMaxRes, resolution);\n var cappedZoomLevel = Math.floor(Math.log(maxResolution / capped) / Math.log(power) + offset);\n var zoomLevel = Math.max(minZoomLevel, cappedZoomLevel);\n var newResolution = maxResolution / Math.pow(power, zoomLevel);\n return clamp(newResolution, minResolution, cappedMaxRes);\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {number} maxResolution Max resolution.\n * @param {number} minResolution Min resolution.\n * @param {boolean=} opt_smooth If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent=} opt_maxExtent Maximum allowed extent.\n * @return {Type} Zoom function.\n */\nexport function createMinMaxResolution(maxResolution, minResolution, opt_smooth, opt_maxExtent) {\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean=} opt_isMoving True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, opt_isMoving) {\n if (resolution !== undefined) {\n var cappedMaxRes = opt_maxExtent ?\n getViewportClampedResolution(maxResolution, opt_maxExtent, size) :\n maxResolution;\n var smooth = opt_smooth !== undefined ? opt_smooth : true;\n if (!smooth || !opt_isMoving) {\n return clamp(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n else {\n return undefined;\n }\n });\n}\n//# sourceMappingURL=resolutionconstraint.js.map","/**\n * @module ol/rotationconstraint\n */\nimport { toRadians } from './math.js';\n/**\n * @typedef {function((number|undefined), boolean=): (number|undefined)} Type\n */\n/**\n * @param {number|undefined} rotation Rotation.\n * @return {number|undefined} Rotation.\n */\nexport function disable(rotation) {\n if (rotation !== undefined) {\n return 0;\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {number|undefined} rotation Rotation.\n * @return {number|undefined} Rotation.\n */\nexport function none(rotation) {\n if (rotation !== undefined) {\n return rotation;\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {number} n N.\n * @return {Type} Rotation constraint.\n */\nexport function createSnapToN(n) {\n var theta = 2 * Math.PI / n;\n return (\n /**\n * @param {number|undefined} rotation Rotation.\n * @param {boolean=} opt_isMoving True if an interaction or animation is in progress.\n * @return {number|undefined} Rotation.\n */\n function (rotation, opt_isMoving) {\n if (opt_isMoving) {\n return rotation;\n }\n if (rotation !== undefined) {\n rotation = Math.floor(rotation / theta + 0.5) * theta;\n return rotation;\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {number=} opt_tolerance Tolerance.\n * @return {Type} Rotation constraint.\n */\nexport function createSnapToZero(opt_tolerance) {\n var tolerance = opt_tolerance || toRadians(5);\n return (\n /**\n * @param {number|undefined} rotation Rotation.\n * @param {boolean} opt_isMoving True if an interaction or animation is in progress.\n * @return {number|undefined} Rotation.\n */\n function (rotation, opt_isMoving) {\n if (opt_isMoving) {\n return rotation;\n }\n if (rotation !== undefined) {\n if (Math.abs(rotation) <= tolerance) {\n return 0;\n }\n else {\n return rotation;\n }\n }\n else {\n return undefined;\n }\n });\n}\n//# sourceMappingURL=rotationconstraint.js.map","/**\n * @module ol/ViewHint\n */\n/**\n * @enum {number}\n */\nexport default {\n ANIMATING: 0,\n INTERACTING: 1\n};\n//# sourceMappingURL=ViewHint.js.map","/**\n * @module ol/ViewProperty\n */\n/**\n * @enum {string}\n */\nexport default {\n CENTER: 'center',\n RESOLUTION: 'resolution',\n ROTATION: 'rotation'\n};\n//# sourceMappingURL=ViewProperty.js.map","/**\n * @module ol/string\n */\n/**\n * @param {number} number Number to be formatted\n * @param {number} width The desired width\n * @param {number=} opt_precision Precision of the output string (i.e. number of decimal places)\n * @returns {string} Formatted string\n */\nexport function padNumber(number, width, opt_precision) {\n var numberString = opt_precision !== undefined ? number.toFixed(opt_precision) : '' + number;\n var decimal = numberString.indexOf('.');\n decimal = decimal === -1 ? numberString.length : decimal;\n return decimal > width ? numberString : new Array(1 + width - decimal).join('0') + numberString;\n}\n/**\n * Adapted from https://github.com/omichelsen/compare-versions/blob/master/index.js\n * @param {string|number} v1 First version\n * @param {string|number} v2 Second version\n * @returns {number} Value\n */\nexport function compareVersions(v1, v2) {\n var s1 = ('' + v1).split('.');\n var s2 = ('' + v2).split('.');\n for (var i = 0; i < Math.max(s1.length, s2.length); i++) {\n var n1 = parseInt(s1[i] || '0', 10);\n var n2 = parseInt(s2[i] || '0', 10);\n if (n1 > n2) {\n return 1;\n }\n if (n2 > n1) {\n return -1;\n }\n }\n return 0;\n}\n//# sourceMappingURL=string.js.map","/**\n * @module ol/coordinate\n */\nimport { modulo } from './math.js';\nimport { padNumber } from './string.js';\n/**\n * An array of numbers representing an xy coordinate. Example: `[16, 48]`.\n * @typedef {Array<number>} Coordinate\n * @api\n */\n/**\n * A function that takes a {@link module:ol/coordinate~Coordinate} and\n * transforms it into a `{string}`.\n *\n * @typedef {function((Coordinate|undefined)): string} CoordinateFormat\n * @api\n */\n/**\n * Add `delta` to `coordinate`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {add} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * add(coord, [-2, 4]);\n * // coord is now [5.85, 51.983333]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {Coordinate} delta Delta.\n * @return {Coordinate} The input coordinate adjusted by\n * the given delta.\n * @api\n */\nexport function add(coordinate, delta) {\n coordinate[0] += +delta[0];\n coordinate[1] += +delta[1];\n return coordinate;\n}\n/**\n * Calculates the point closest to the passed coordinate on the passed circle.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {import(\"./geom/Circle.js\").default} circle The circle.\n * @return {Coordinate} Closest point on the circumference.\n */\nexport function closestOnCircle(coordinate, circle) {\n var r = circle.getRadius();\n var center = circle.getCenter();\n var x0 = center[0];\n var y0 = center[1];\n var x1 = coordinate[0];\n var y1 = coordinate[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n if (dx === 0 && dy === 0) {\n dx = 1;\n }\n var d = Math.sqrt(dx * dx + dy * dy);\n var x = x0 + r * dx / d;\n var y = y0 + r * dy / d;\n return [x, y];\n}\n/**\n * Calculates the point closest to the passed coordinate on the passed segment.\n * This is the foot of the perpendicular of the coordinate to the segment when\n * the foot is on the segment, or the closest segment coordinate when the foot\n * is outside the segment.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {Array<Coordinate>} segment The two coordinates\n * of the segment.\n * @return {Coordinate} The foot of the perpendicular of\n * the coordinate to the segment.\n */\nexport function closestOnSegment(coordinate, segment) {\n var x0 = coordinate[0];\n var y0 = coordinate[1];\n var start = segment[0];\n var end = segment[1];\n var x1 = start[0];\n var y1 = start[1];\n var x2 = end[0];\n var y2 = end[1];\n var dx = x2 - x1;\n var dy = y2 - y1;\n var along = (dx === 0 && dy === 0) ? 0 :\n ((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0);\n var x, y;\n if (along <= 0) {\n x = x1;\n y = y1;\n }\n else if (along >= 1) {\n x = x2;\n y = y2;\n }\n else {\n x = x1 + along * dx;\n y = y1 + along * dy;\n }\n return [x, y];\n}\n/**\n * Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be\n * used to format\n * a {Coordinate} to a string.\n *\n * Example without specifying the fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var stringifyFunc = createStringXY();\n * var out = stringifyFunc(coord);\n * // out is now '8, 48'\n *\n * Example with explicitly specifying 2 fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var stringifyFunc = createStringXY(2);\n * var out = stringifyFunc(coord);\n * // out is now '7.85, 47.98'\n *\n * @param {number=} opt_fractionDigits The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {CoordinateFormat} Coordinate format.\n * @api\n */\nexport function createStringXY(opt_fractionDigits) {\n return (\n /**\n * @param {Coordinate} coordinate Coordinate.\n * @return {string} String XY.\n */\n function (coordinate) {\n return toStringXY(coordinate, opt_fractionDigits);\n });\n}\n/**\n * @param {string} hemispheres Hemispheres.\n * @param {number} degrees Degrees.\n * @param {number=} opt_fractionDigits The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} String.\n */\nexport function degreesToStringHDMS(hemispheres, degrees, opt_fractionDigits) {\n var normalizedDegrees = modulo(degrees + 180, 360) - 180;\n var x = Math.abs(3600 * normalizedDegrees);\n var dflPrecision = opt_fractionDigits || 0;\n var precision = Math.pow(10, dflPrecision);\n var deg = Math.floor(x / 3600);\n var min = Math.floor((x - deg * 3600) / 60);\n var sec = x - (deg * 3600) - (min * 60);\n sec = Math.ceil(sec * precision) / precision;\n if (sec >= 60) {\n sec = 0;\n min += 1;\n }\n if (min >= 60) {\n min = 0;\n deg += 1;\n }\n return deg + '\\u00b0 ' + padNumber(min, 2) + '\\u2032 ' +\n padNumber(sec, 2, dflPrecision) + '\\u2033' +\n (normalizedDegrees == 0 ? '' : ' ' + hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0));\n}\n/**\n * Transforms the given {@link module:ol/coordinate~Coordinate} to a string\n * using the given string template. The strings `{x}` and `{y}` in the template\n * will be replaced with the first and second coordinate values respectively.\n *\n * Example without specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var template = 'Coordinate is ({x}|{y}).';\n * var out = format(coord, template);\n * // out is now 'Coordinate is (8|48).'\n *\n * Example explicitly specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var template = 'Coordinate is ({x}|{y}).';\n * var out = format(coord, template, 2);\n * // out is now 'Coordinate is (7.85|47.98).'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {string} template A template string with `{x}` and `{y}` placeholders\n * that will be replaced by first and second coordinate values.\n * @param {number=} opt_fractionDigits The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Formatted coordinate.\n * @api\n */\nexport function format(coordinate, template, opt_fractionDigits) {\n if (coordinate) {\n return template\n .replace('{x}', coordinate[0].toFixed(opt_fractionDigits))\n .replace('{y}', coordinate[1].toFixed(opt_fractionDigits));\n }\n else {\n return '';\n }\n}\n/**\n * @param {Coordinate} coordinate1 First coordinate.\n * @param {Coordinate} coordinate2 Second coordinate.\n * @return {boolean} The two coordinates are equal.\n */\nexport function equals(coordinate1, coordinate2) {\n var equals = true;\n for (var i = coordinate1.length - 1; i >= 0; --i) {\n if (coordinate1[i] != coordinate2[i]) {\n equals = false;\n break;\n }\n }\n return equals;\n}\n/**\n * Rotate `coordinate` by `angle`. `coordinate` is modified in place and\n * returned by the function.\n *\n * Example:\n *\n * import {rotate} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var rotateRadians = Math.PI / 2; // 90 degrees\n * rotate(coord, rotateRadians);\n * // coord is now [-47.983333, 7.85]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} angle Angle in radian.\n * @return {Coordinate} Coordinate.\n * @api\n */\nexport function rotate(coordinate, angle) {\n var cosAngle = Math.cos(angle);\n var sinAngle = Math.sin(angle);\n var x = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n var y = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n coordinate[0] = x;\n coordinate[1] = y;\n return coordinate;\n}\n/**\n * Scale `coordinate` by `scale`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {scale as scaleCoordinate} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var scale = 1.2;\n * scaleCoordinate(coord, scale);\n * // coord is now [9.42, 57.5799996]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} scale Scale factor.\n * @return {Coordinate} Coordinate.\n */\nexport function scale(coordinate, scale) {\n coordinate[0] *= scale;\n coordinate[1] *= scale;\n return coordinate;\n}\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Squared distance between coord1 and coord2.\n */\nexport function squaredDistance(coord1, coord2) {\n var dx = coord1[0] - coord2[0];\n var dy = coord1[1] - coord2[1];\n return dx * dx + dy * dy;\n}\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Distance between coord1 and coord2.\n */\nexport function distance(coord1, coord2) {\n return Math.sqrt(squaredDistance(coord1, coord2));\n}\n/**\n * Calculate the squared distance from a coordinate to a line segment.\n *\n * @param {Coordinate} coordinate Coordinate of the point.\n * @param {Array<Coordinate>} segment Line segment (2\n * coordinates).\n * @return {number} Squared distance from the point to the line segment.\n */\nexport function squaredDistanceToSegment(coordinate, segment) {\n return squaredDistance(coordinate, closestOnSegment(coordinate, segment));\n}\n/**\n * Format a geographic coordinate with the hemisphere, degrees, minutes, and\n * seconds.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringHDMS} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringHDMS(coord);\n * // out is now '47° 58′ 60″ N 7° 50′ 60″ E'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringHDMS} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringHDMS(coord, 1);\n * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number=} opt_fractionDigits The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Hemisphere, degrees, minutes and seconds.\n * @api\n */\nexport function toStringHDMS(coordinate, opt_fractionDigits) {\n if (coordinate) {\n return degreesToStringHDMS('NS', coordinate[1], opt_fractionDigits) + ' ' +\n degreesToStringHDMS('EW', coordinate[0], opt_fractionDigits);\n }\n else {\n return '';\n }\n}\n/**\n * Format a coordinate as a comma delimited string.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringXY(coord);\n * // out is now '8, 48'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringXY(coord, 1);\n * // out is now '7.8, 48.0'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number=} opt_fractionDigits The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} XY.\n * @api\n */\nexport function toStringXY(coordinate, opt_fractionDigits) {\n return format(coordinate, '{x}, {y}', opt_fractionDigits);\n}\n//# sourceMappingURL=coordinate.js.map","/**\n * @module ol/easing\n */\n/**\n * Start slow and speed up.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function easeIn(t) {\n return Math.pow(t, 3);\n}\n/**\n * Start fast and slow down.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function easeOut(t) {\n return 1 - easeIn(1 - t);\n}\n/**\n * Start slow, speed up, and then slow down again.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function inAndOut(t) {\n return 3 * t * t - 2 * t * t * t;\n}\n/**\n * Maintain a constant speed over time.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function linear(t) {\n return t;\n}\n/**\n * Start slow, speed up, and at the very end slow down again. This has the\n * same general behavior as {@link module:ol/easing~inAndOut}, but the final\n * slowdown is delayed.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function upAndDown(t) {\n if (t < 0.5) {\n return inAndOut(2 * t);\n }\n else {\n return 1 - inAndOut(2 * (t - 0.5));\n }\n}\n//# sourceMappingURL=easing.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/View\n */\nimport { DEFAULT_TILE_SIZE } from './tilegrid/common.js';\nimport { getUid } from './util.js';\nimport { VOID } from './functions.js';\nimport { createExtent, none as centerNone } from './centerconstraint.js';\nimport BaseObject from './Object.js';\nimport { createSnapToResolutions, createSnapToPower } from './resolutionconstraint.js';\nimport { createSnapToZero, createSnapToN, none as rotationNone, disable } from './rotationconstraint.js';\nimport ViewHint from './ViewHint.js';\nimport ViewProperty from './ViewProperty.js';\nimport { linearFindNearest } from './array.js';\nimport { assert } from './asserts.js';\nimport { add as addCoordinate, rotate as rotateCoordinate, equals as coordinatesEqual } from './coordinate.js';\nimport { inAndOut } from './easing.js';\nimport { getForViewAndSize, getCenter, getHeight, getWidth, isEmpty } from './extent.js';\nimport GeometryType from './geom/GeometryType.js';\nimport { fromExtent as polygonFromExtent } from './geom/Polygon.js';\nimport { clamp, modulo } from './math.js';\nimport { assign } from './obj.js';\nimport { createProjection, METERS_PER_UNIT, toUserCoordinate, toUserExtent, fromUserCoordinate, fromUserExtent, getUserProjection } from './proj.js';\nimport Units from './proj/Units.js';\nimport { equals } from './coordinate.js';\nimport { easeOut } from './easing.js';\nimport { createMinMaxResolution } from './resolutionconstraint.js';\n/**\n * An animation configuration\n *\n * @typedef {Object} Animation\n * @property {import(\"./coordinate.js\").Coordinate} [sourceCenter]\n * @property {import(\"./coordinate.js\").Coordinate} [targetCenter]\n * @property {number} [sourceResolution]\n * @property {number} [targetResolution]\n * @property {number} [sourceRotation]\n * @property {number} [targetRotation]\n * @property {import(\"./coordinate.js\").Coordinate} [anchor]\n * @property {number} start\n * @property {number} duration\n * @property {boolean} complete\n * @property {function(number):number} easing\n * @property {function(boolean)} callback\n */\n/**\n * @typedef {Object} Constraints\n * @property {import(\"./centerconstraint.js\").Type} center\n * @property {import(\"./resolutionconstraint.js\").Type} resolution\n * @property {import(\"./rotationconstraint.js\").Type} rotation\n */\n/**\n * @typedef {Object} FitOptions\n * @property {import(\"./size.js\").Size} [size] The size in pixels of the box to fit\n * the extent into. Default is the current size of the first map in the DOM that\n * uses this view, or `[100, 100]` if no such map is found.\n * @property {!Array<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be\n * cleared inside the view. Values in the array are top, right, bottom and left\n * padding.\n * @property {boolean} [nearest=false] If the view `constrainResolution` option is `true`,\n * get the nearest extent instead of the closest that actually fits the view.\n * @property {number} [minResolution=0] Minimum resolution that we zoom to.\n * @property {number} [maxZoom] Maximum zoom level that we zoom to. If\n * `minResolution` is given, this property is ignored.\n * @property {number} [duration] The duration of the animation in milliseconds.\n * By default, there is no animation to the target extent.\n * @property {function(number):number} [easing] The easing function used during\n * the animation (defaults to {@link module:ol/easing~inAndOut}).\n * The function will be called for each frame with a number representing a\n * fraction of the animation's duration. The function should return a number\n * between 0 and 1 representing the progress toward the destination state.\n * @property {function(boolean)} [callback] Function called when the view is in\n * its final position. The callback will be called with `true` if the animation\n * series completed on its own or `false` if it was cancelled.\n */\n/**\n * @typedef {Object} ViewOptions\n * @property {import(\"./coordinate.js\").Coordinate} [center] The initial center for\n * the view. If a user projection is not set, the coordinate system for the center is\n * specified with the `projection` option. Layer sources will not be fetched if this\n * is not set, but the center can be set later with {@link #setCenter}.\n * @property {boolean|number} [constrainRotation=true] Rotation constraint.\n * `false` means no constraint. `true` means no constraint, but snap to zero\n * near zero. A number constrains the rotation to that number of values. For\n * example, `4` will constrain the rotation to 0, 90, 180, and 270 degrees.\n * @property {boolean} [enableRotation=true] Enable rotation.\n * If `false`, a rotation constraint that always sets the rotation to zero is\n * used. The `constrainRotation` option has no effect if `enableRotation` is\n * `false`.\n * @property {import(\"./extent.js\").Extent} [extent] The extent that constrains the\n * view, in other words, nothing outside of this extent can be visible on the map.\n * @property {boolean} [constrainOnlyCenter=false] If true, the extent\n * constraint will only apply to the view center and not the whole extent.\n * @property {boolean} [smoothExtentConstraint=true] If true, the extent\n * constraint will be applied smoothly, i.e. allow the view to go slightly outside\n * of the given `extent`.\n * @property {number} [maxResolution] The maximum resolution used to determine\n * the resolution constraint. It is used together with `minResolution` (or\n * `maxZoom`) and `zoomFactor`. If unspecified it is calculated in such a way\n * that the projection's validity extent fits in a 256x256 px tile. If the\n * projection is Spherical Mercator (the default) then `maxResolution` defaults\n * to `40075016.68557849 / 256 = 156543.03392804097`.\n * @property {number} [minResolution] The minimum resolution used to determine\n * the resolution constraint. It is used together with `maxResolution` (or\n * `minZoom`) and `zoomFactor`. If unspecified it is calculated assuming 29\n * zoom levels (with a factor of 2). If the projection is Spherical Mercator\n * (the default) then `minResolution` defaults to\n * `40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253`.\n * @property {number} [maxZoom=28] The maximum zoom level used to determine the\n * resolution constraint. It is used together with `minZoom` (or\n * `maxResolution`) and `zoomFactor`. Note that if `minResolution` is also\n * provided, it is given precedence over `maxZoom`.\n * @property {number} [minZoom=0] The minimum zoom level used to determine the\n * resolution constraint. It is used together with `maxZoom` (or\n * `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also\n * provided, it is given precedence over `minZoom`.\n * @property {boolean} [multiWorld=false] If `false` the view is constrained so\n * only one world is visible, and you cannot pan off the edge. If `true` the map\n * may show multiple worlds at low zoom levels. Only used if the `projection` is\n * global. Note that if `extent` is also provided it is given precedence.\n * @property {boolean} [constrainResolution=false] If true, the view will always\n * animate to the closest zoom level after an interaction; false means\n * intermediary zoom levels are allowed.\n * @property {boolean} [smoothResolutionConstraint=true] If true, the resolution\n * min/max values will be applied smoothly, i. e. allow the view to exceed slightly\n * the given resolution or zoom bounds.\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857'] The\n * projection. The default is Spherical Mercator.\n * @property {number} [resolution] The initial resolution for the view. The\n * units are `projection` units per pixel (e.g. meters per pixel). An\n * alternative to setting this is to set `zoom`. Layer sources will not be\n * fetched if neither this nor `zoom` are defined, but they can be set later\n * with {@link #setZoom} or {@link #setResolution}.\n * @property {Array<number>} [resolutions] Resolutions to determine the\n * resolution constraint. If set the `maxResolution`, `minResolution`,\n * `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.\n * @property {number} [rotation=0] The initial rotation for the view in radians\n * (positive rotation clockwise, 0 means North).\n * @property {number} [zoom] Only used if `resolution` is not defined. Zoom\n * level used to calculate the initial resolution for the view.\n * @property {number} [zoomFactor=2] The zoom factor used to compute the\n * corresponding resolution.\n */\n/**\n * @typedef {Object} AnimationOptions\n * @property {import(\"./coordinate.js\").Coordinate} [center] The center of the view at the end of\n * the animation.\n * @property {number} [zoom] The zoom level of the view at the end of the\n * animation. This takes precedence over `resolution`.\n * @property {number} [resolution] The resolution of the view at the end\n * of the animation. If `zoom` is also provided, this option will be ignored.\n * @property {number} [rotation] The rotation of the view at the end of\n * the animation.\n * @property {import(\"./coordinate.js\").Coordinate} [anchor] Optional anchor to remain fixed\n * during a rotation or resolution animation.\n * @property {number} [duration=1000] The duration of the animation in milliseconds.\n * @property {function(number):number} [easing] The easing function used\n * during the animation (defaults to {@link module:ol/easing~inAndOut}).\n * The function will be called for each frame with a number representing a\n * fraction of the animation's duration. The function should return a number\n * between 0 and 1 representing the progress toward the destination state.\n */\n/**\n * @typedef {Object} State\n * @property {import(\"./coordinate.js\").Coordinate} center\n * @property {import(\"./proj/Projection.js\").default} projection\n * @property {number} resolution\n * @property {number} rotation\n * @property {number} zoom\n */\n/**\n * Default min zoom level for the map view.\n * @type {number}\n */\nvar DEFAULT_MIN_ZOOM = 0;\n/**\n * @classdesc\n * A View object represents a simple 2D view of the map.\n *\n * This is the object to act upon to change the center, resolution,\n * and rotation of the map.\n *\n * A View has a `projection`. The projection determines the\n * coordinate system of the center, and its units determine the units of the\n * resolution (projection units per pixel). The default projection is\n * Spherical Mercator (EPSG:3857).\n *\n * ### The view states\n *\n * A View is determined by three states: `center`, `resolution`,\n * and `rotation`. Each state has a corresponding getter and setter, e.g.\n * `getCenter` and `setCenter` for the `center` state.\n *\n * The `zoom` state is actually not saved on the view: all computations\n * internally use the `resolution` state. Still, the `setZoom` and `getZoom`\n * methods are available, as well as `getResolutionForZoom` and\n * `getZoomForResolution` to switch from one system to the other.\n *\n * ### The constraints\n *\n * `setCenter`, `setResolution` and `setRotation` can be used to change the\n * states of the view, but any constraint defined in the constructor will\n * be applied along the way.\n *\n * A View object can have a *resolution constraint*, a *rotation constraint*\n * and a *center constraint*.\n *\n * The *resolution constraint* typically restricts min/max values and\n * snaps to specific resolutions. It is determined by the following\n * options: `resolutions`, `maxResolution`, `maxZoom` and `zoomFactor`.\n * If `resolutions` is set, the other three options are ignored. See\n * documentation for each option for more information. By default, the view\n * only has a min/max restriction and allow intermediary zoom levels when\n * pinch-zooming for example.\n *\n * The *rotation constraint* snaps to specific angles. It is determined\n * by the following options: `enableRotation` and `constrainRotation`.\n * By default rotation is allowed and its value is snapped to zero when approaching the\n * horizontal.\n *\n * The *center constraint* is determined by the `extent` option. By\n * default the view center is not constrained at all.\n *\n * ### Changing the view state\n *\n * It is important to note that `setZoom`, `setResolution`, `setCenter` and\n * `setRotation` are subject to the above mentioned constraints. As such, it\n * may sometimes not be possible to know in advance the resulting state of the\n * View. For example, calling `setResolution(10)` does not guarantee that\n * `getResolution()` will return `10`.\n *\n * A consequence of this is that, when applying a delta on the view state, one\n * should use `adjustCenter`, `adjustRotation`, `adjustZoom` and `adjustResolution`\n * rather than the corresponding setters. This will let view do its internal\n * computations. Besides, the `adjust*` methods also take an `opt_anchor`\n * argument which allows specifying an origin for the transformation.\n *\n * ### Interacting with the view\n *\n * View constraints are usually only applied when the view is *at rest*, meaning that\n * no interaction or animation is ongoing. As such, if the user puts the view in a\n * state that is not equivalent to a constrained one (e.g. rotating the view when\n * the snap angle is 0), an animation will be triggered at the interaction end to\n * put back the view to a stable state;\n *\n * @api\n */\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n /**\n * @param {ViewOptions=} opt_options View options.\n */\n function View(opt_options) {\n var _this = _super.call(this) || this;\n var options = assign({}, opt_options);\n /**\n * @private\n * @type {Array<number>}\n */\n _this.hints_ = [0, 0];\n /**\n * @private\n * @type {Array<Array<Animation>>}\n */\n _this.animations_ = [];\n /**\n * @private\n * @type {number|undefined}\n */\n _this.updateAnimationKey_;\n /**\n * @private\n * @const\n * @type {import(\"./proj/Projection.js\").default}\n */\n _this.projection_ = createProjection(options.projection, 'EPSG:3857');\n /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate|undefined}\n */\n _this.targetCenter_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.targetResolution_;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.targetRotation_;\n if (options.center) {\n options.center = fromUserCoordinate(options.center, _this.projection_);\n }\n if (options.extent) {\n options.extent = fromUserExtent(options.extent, _this.projection_);\n }\n _this.applyOptions_(options);\n return _this;\n }\n /**\n * Set up the view with the given options.\n * @param {ViewOptions} options View options.\n */\n View.prototype.applyOptions_ = function (options) {\n /**\n * @type {Object<string, *>}\n */\n var properties = {};\n var resolutionConstraintInfo = createResolutionConstraint(options);\n /**\n * @private\n * @type {number}\n */\n this.maxResolution_ = resolutionConstraintInfo.maxResolution;\n /**\n * @private\n * @type {number}\n */\n this.minResolution_ = resolutionConstraintInfo.minResolution;\n /**\n * @private\n * @type {number}\n */\n this.zoomFactor_ = resolutionConstraintInfo.zoomFactor;\n /**\n * @private\n * @type {Array<number>|undefined}\n */\n this.resolutions_ = options.resolutions;\n /**\n * @private\n * @type {number}\n */\n this.minZoom_ = resolutionConstraintInfo.minZoom;\n var centerConstraint = createCenterConstraint(options);\n var resolutionConstraint = resolutionConstraintInfo.constraint;\n var rotationConstraint = createRotationConstraint(options);\n /**\n * @private\n * @type {Constraints}\n */\n this.constraints_ = {\n center: centerConstraint,\n resolution: resolutionConstraint,\n rotation: rotationConstraint\n };\n this.setRotation(options.rotation !== undefined ? options.rotation : 0);\n this.setCenterInternal(options.center !== undefined ? options.center : null);\n if (options.resolution !== undefined) {\n this.setResolution(options.resolution);\n }\n else if (options.zoom !== undefined) {\n this.setZoom(options.zoom);\n }\n this.resolveConstraints(0);\n this.setProperties(properties);\n /**\n * @private\n * @type {ViewOptions}\n */\n this.options_ = options;\n };\n /**\n * Get an updated version of the view options used to construct the view. The\n * current resolution (or zoom), center, and rotation are applied to any stored\n * options. The provided options can be used to apply new min/max zoom or\n * resolution limits.\n * @param {ViewOptions} newOptions New options to be applied.\n * @return {ViewOptions} New options updated with the current view state.\n */\n View.prototype.getUpdatedOptions_ = function (newOptions) {\n var options = assign({}, this.options_);\n // preserve resolution (or zoom)\n if (options.resolution !== undefined) {\n options.resolution = this.getResolution();\n }\n else {\n options.zoom = this.getZoom();\n }\n // preserve center\n options.center = this.getCenterInternal();\n // preserve rotation\n options.rotation = this.getRotation();\n return assign({}, options, newOptions);\n };\n /**\n * Animate the view. The view's center, zoom (or resolution), and rotation\n * can be animated for smooth transitions between view states. For example,\n * to animate the view to a new zoom level:\n *\n * view.animate({zoom: view.getZoom() + 1});\n *\n * By default, the animation lasts one second and uses in-and-out easing. You\n * can customize this behavior by including `duration` (in milliseconds) and\n * `easing` options (see {@link module:ol/easing}).\n *\n * To chain together multiple animations, call the method with multiple\n * animation objects. For example, to first zoom and then pan:\n *\n * view.animate({zoom: 10}, {center: [0, 0]});\n *\n * If you provide a function as the last argument to the animate method, it\n * will get called at the end of an animation series. The callback will be\n * called with `true` if the animation series completed on its own or `false`\n * if it was cancelled.\n *\n * Animations are cancelled by user interactions (e.g. dragging the map) or by\n * calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`\n * (or another method that calls one of these).\n *\n * @param {...(AnimationOptions|function(boolean): void)} var_args Animation\n * options. Multiple animations can be run in series by passing multiple\n * options objects. To run multiple animations in parallel, call the method\n * multiple times. An optional callback can be provided as a final\n * argument. The callback will be called with a boolean indicating whether\n * the animation completed without being cancelled.\n * @api\n */\n View.prototype.animate = function (var_args) {\n if (this.isDef() && !this.getAnimating()) {\n this.resolveConstraints(0);\n }\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; ++i) {\n var options = arguments[i];\n if (options.center) {\n options = assign({}, options);\n options.center = fromUserCoordinate(options.center, this.getProjection());\n }\n if (options.anchor) {\n options = assign({}, options);\n options.anchor = fromUserCoordinate(options.anchor, this.getProjection());\n }\n args[i] = options;\n }\n this.animateInternal.apply(this, args);\n };\n /**\n * @param {...(AnimationOptions|function(boolean): void)} var_args Animation options.\n */\n View.prototype.animateInternal = function (var_args) {\n var animationCount = arguments.length;\n var callback;\n if (animationCount > 1 && typeof arguments[animationCount - 1] === 'function') {\n callback = arguments[animationCount - 1];\n --animationCount;\n }\n if (!this.isDef()) {\n // if view properties are not yet set, shortcut to the final state\n var state = arguments[animationCount - 1];\n if (state.center) {\n this.setCenterInternal(state.center);\n }\n if (state.zoom !== undefined) {\n this.setZoom(state.zoom);\n }\n if (state.rotation !== undefined) {\n this.setRotation(state.rotation);\n }\n if (callback) {\n animationCallback(callback, true);\n }\n return;\n }\n var start = Date.now();\n var center = this.targetCenter_.slice();\n var resolution = this.targetResolution_;\n var rotation = this.targetRotation_;\n var series = [];\n for (var i = 0; i < animationCount; ++i) {\n var options = /** @type {AnimationOptions} */ (arguments[i]);\n var animation = {\n start: start,\n complete: false,\n anchor: options.anchor,\n duration: options.duration !== undefined ? options.duration : 1000,\n easing: options.easing || inAndOut,\n callback: callback\n };\n if (options.center) {\n animation.sourceCenter = center;\n animation.targetCenter = options.center.slice();\n center = animation.targetCenter;\n }\n if (options.zoom !== undefined) {\n animation.sourceResolution = resolution;\n animation.targetResolution = this.getResolutionForZoom(options.zoom);\n resolution = animation.targetResolution;\n }\n else if (options.resolution) {\n animation.sourceResolution = resolution;\n animation.targetResolution = options.resolution;\n resolution = animation.targetResolution;\n }\n if (options.rotation !== undefined) {\n animation.sourceRotation = rotation;\n var delta = modulo(options.rotation - rotation + Math.PI, 2 * Math.PI) - Math.PI;\n animation.targetRotation = rotation + delta;\n rotation = animation.targetRotation;\n }\n // check if animation is a no-op\n if (isNoopAnimation(animation)) {\n animation.complete = true;\n // we still push it onto the series for callback handling\n }\n else {\n start += animation.duration;\n }\n series.push(animation);\n }\n this.animations_.push(series);\n this.setHint(ViewHint.ANIMATING, 1);\n this.updateAnimations_();\n };\n /**\n * Determine if the view is being animated.\n * @return {boolean} The view is being animated.\n * @api\n */\n View.prototype.getAnimating = function () {\n return this.hints_[ViewHint.ANIMATING] > 0;\n };\n /**\n * Determine if the user is interacting with the view, such as panning or zooming.\n * @return {boolean} The view is being interacted with.\n * @api\n */\n View.prototype.getInteracting = function () {\n return this.hints_[ViewHint.INTERACTING] > 0;\n };\n /**\n * Cancel any ongoing animations.\n * @api\n */\n View.prototype.cancelAnimations = function () {\n this.setHint(ViewHint.ANIMATING, -this.hints_[ViewHint.ANIMATING]);\n for (var i = 0, ii = this.animations_.length; i < ii; ++i) {\n var series = this.animations_[i];\n if (series[0].callback) {\n animationCallback(series[0].callback, false);\n }\n }\n this.animations_.length = 0;\n };\n /**\n * Update all animations.\n */\n View.prototype.updateAnimations_ = function () {\n if (this.updateAnimationKey_ !== undefined) {\n cancelAnimationFrame(this.updateAnimationKey_);\n this.updateAnimationKey_ = undefined;\n }\n if (!this.getAnimating()) {\n return;\n }\n var now = Date.now();\n var more = false;\n for (var i = this.animations_.length - 1; i >= 0; --i) {\n var series = this.animations_[i];\n var seriesComplete = true;\n for (var j = 0, jj = series.length; j < jj; ++j) {\n var animation = series[j];\n if (animation.complete) {\n continue;\n }\n var elapsed = now - animation.start;\n var fraction = animation.duration > 0 ? elapsed / animation.duration : 1;\n if (fraction >= 1) {\n animation.complete = true;\n fraction = 1;\n }\n else {\n seriesComplete = false;\n }\n var progress = animation.easing(fraction);\n if (animation.sourceCenter) {\n var x0 = animation.sourceCenter[0];\n var y0 = animation.sourceCenter[1];\n var x1 = animation.targetCenter[0];\n var y1 = animation.targetCenter[1];\n var x = x0 + progress * (x1 - x0);\n var y = y0 + progress * (y1 - y0);\n this.targetCenter_ = [x, y];\n }\n if (animation.sourceResolution && animation.targetResolution) {\n var resolution = progress === 1 ?\n animation.targetResolution :\n animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution);\n if (animation.anchor) {\n var size = this.getSizeFromViewport_(this.getRotation());\n var constrainedResolution = this.constraints_.resolution(resolution, 0, size, true);\n this.targetCenter_ = this.calculateCenterZoom(constrainedResolution, animation.anchor);\n }\n this.targetResolution_ = resolution;\n this.applyTargetState_(true);\n }\n if (animation.sourceRotation !== undefined && animation.targetRotation !== undefined) {\n var rotation = progress === 1 ?\n modulo(animation.targetRotation + Math.PI, 2 * Math.PI) - Math.PI :\n animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation);\n if (animation.anchor) {\n var constrainedRotation = this.constraints_.rotation(rotation, true);\n this.targetCenter_ = this.calculateCenterRotate(constrainedRotation, animation.anchor);\n }\n this.targetRotation_ = rotation;\n }\n this.applyTargetState_(true);\n more = true;\n if (!animation.complete) {\n break;\n }\n }\n if (seriesComplete) {\n this.animations_[i] = null;\n this.setHint(ViewHint.ANIMATING, -1);\n var callback = series[0].callback;\n if (callback) {\n animationCallback(callback, true);\n }\n }\n }\n // prune completed series\n this.animations_ = this.animations_.filter(Boolean);\n if (more && this.updateAnimationKey_ === undefined) {\n this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_.bind(this));\n }\n };\n /**\n * @param {number} rotation Target rotation.\n * @param {import(\"./coordinate.js\").Coordinate} anchor Rotation anchor.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center for rotation and anchor.\n */\n View.prototype.calculateCenterRotate = function (rotation, anchor) {\n var center;\n var currentCenter = this.getCenterInternal();\n if (currentCenter !== undefined) {\n center = [currentCenter[0] - anchor[0], currentCenter[1] - anchor[1]];\n rotateCoordinate(center, rotation - this.getRotation());\n addCoordinate(center, anchor);\n }\n return center;\n };\n /**\n * @param {number} resolution Target resolution.\n * @param {import(\"./coordinate.js\").Coordinate} anchor Zoom anchor.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center for resolution and anchor.\n */\n View.prototype.calculateCenterZoom = function (resolution, anchor) {\n var center;\n var currentCenter = this.getCenterInternal();\n var currentResolution = this.getResolution();\n if (currentCenter !== undefined && currentResolution !== undefined) {\n var x = anchor[0] - resolution * (anchor[0] - currentCenter[0]) / currentResolution;\n var y = anchor[1] - resolution * (anchor[1] - currentCenter[1]) / currentResolution;\n center = [x, y];\n }\n return center;\n };\n /**\n * @private\n * @param {number=} opt_rotation Take into account the rotation of the viewport when giving the size\n * @return {import(\"./size.js\").Size} Viewport size or `[100, 100]` when no viewport is found.\n */\n View.prototype.getSizeFromViewport_ = function (opt_rotation) {\n var size = [100, 100];\n var selector = '.ol-viewport[data-view=\"' + getUid(this) + '\"]';\n var element = document.querySelector(selector);\n if (element) {\n var metrics = getComputedStyle(element);\n size[0] = parseInt(metrics.width, 10);\n size[1] = parseInt(metrics.height, 10);\n }\n if (opt_rotation) {\n var w = size[0];\n var h = size[1];\n size[0] = Math.abs(w * Math.cos(opt_rotation)) + Math.abs(h * Math.sin(opt_rotation));\n size[1] = Math.abs(w * Math.sin(opt_rotation)) + Math.abs(h * Math.cos(opt_rotation));\n }\n return size;\n };\n /**\n * Get the view center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The center of the view.\n * @observable\n * @api\n */\n View.prototype.getCenter = function () {\n var center = this.getCenterInternal();\n if (!center) {\n return center;\n }\n return toUserCoordinate(center, this.getProjection());\n };\n /**\n * Get the view center without transforming to user projection.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The center of the view.\n */\n View.prototype.getCenterInternal = function () {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (this.get(ViewProperty.CENTER));\n };\n /**\n * @return {Constraints} Constraints.\n */\n View.prototype.getConstraints = function () {\n return this.constraints_;\n };\n /**\n * @param {Array<number>=} opt_hints Destination array.\n * @return {Array<number>} Hint.\n */\n View.prototype.getHints = function (opt_hints) {\n if (opt_hints !== undefined) {\n opt_hints[0] = this.hints_[0];\n opt_hints[1] = this.hints_[1];\n return opt_hints;\n }\n else {\n return this.hints_.slice();\n }\n };\n /**\n * Calculate the extent for the current view state and the passed size.\n * The size is the pixel dimensions of the box into which the calculated extent\n * should fit. In most cases you want to get the extent of the entire map,\n * that is `map.getSize()`.\n * @param {import(\"./size.js\").Size=} opt_size Box pixel size. If not provided, the size of the\n * first map that uses this view will be used.\n * @return {import(\"./extent.js\").Extent} Extent.\n * @api\n */\n View.prototype.calculateExtent = function (opt_size) {\n var extent = this.calculateExtentInternal(opt_size);\n return toUserExtent(extent, this.getProjection());\n };\n /**\n * @param {import(\"./size.js\").Size=} opt_size Box pixel size. If not provided, the size of the\n * first map that uses this view will be used.\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n View.prototype.calculateExtentInternal = function (opt_size) {\n var size = opt_size || this.getSizeFromViewport_();\n var center = /** @type {!import(\"./coordinate.js\").Coordinate} */ (this.getCenterInternal());\n assert(center, 1); // The view center is not defined\n var resolution = /** @type {!number} */ (this.getResolution());\n assert(resolution !== undefined, 2); // The view resolution is not defined\n var rotation = /** @type {!number} */ (this.getRotation());\n assert(rotation !== undefined, 3); // The view rotation is not defined\n return getForViewAndSize(center, resolution, rotation, size);\n };\n /**\n * Get the maximum resolution of the view.\n * @return {number} The maximum resolution of the view.\n * @api\n */\n View.prototype.getMaxResolution = function () {\n return this.maxResolution_;\n };\n /**\n * Get the minimum resolution of the view.\n * @return {number} The minimum resolution of the view.\n * @api\n */\n View.prototype.getMinResolution = function () {\n return this.minResolution_;\n };\n /**\n * Get the maximum zoom level for the view.\n * @return {number} The maximum zoom level.\n * @api\n */\n View.prototype.getMaxZoom = function () {\n return /** @type {number} */ (this.getZoomForResolution(this.minResolution_));\n };\n /**\n * Set a new maximum zoom level for the view.\n * @param {number} zoom The maximum zoom level.\n * @api\n */\n View.prototype.setMaxZoom = function (zoom) {\n this.applyOptions_(this.getUpdatedOptions_({ maxZoom: zoom }));\n };\n /**\n * Get the minimum zoom level for the view.\n * @return {number} The minimum zoom level.\n * @api\n */\n View.prototype.getMinZoom = function () {\n return /** @type {number} */ (this.getZoomForResolution(this.maxResolution_));\n };\n /**\n * Set a new minimum zoom level for the view.\n * @param {number} zoom The minimum zoom level.\n * @api\n */\n View.prototype.setMinZoom = function (zoom) {\n this.applyOptions_(this.getUpdatedOptions_({ minZoom: zoom }));\n };\n /**\n * Set whether the view shoud allow intermediary zoom levels.\n * @param {boolean} enabled Whether the resolution is constrained.\n * @api\n */\n View.prototype.setConstrainResolution = function (enabled) {\n this.applyOptions_(this.getUpdatedOptions_({ constrainResolution: enabled }));\n };\n /**\n * Get the view projection.\n * @return {import(\"./proj/Projection.js\").default} The projection of the view.\n * @api\n */\n View.prototype.getProjection = function () {\n return this.projection_;\n };\n /**\n * Get the view resolution.\n * @return {number|undefined} The resolution of the view.\n * @observable\n * @api\n */\n View.prototype.getResolution = function () {\n return /** @type {number|undefined} */ (this.get(ViewProperty.RESOLUTION));\n };\n /**\n * Get the resolutions for the view. This returns the array of resolutions\n * passed to the constructor of the View, or undefined if none were given.\n * @return {Array<number>|undefined} The resolutions of the view.\n * @api\n */\n View.prototype.getResolutions = function () {\n return this.resolutions_;\n };\n /**\n * Get the resolution for a provided extent (in map units) and size (in pixels).\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {import(\"./size.js\").Size=} opt_size Box pixel size.\n * @return {number} The resolution at which the provided extent will render at\n * the given size.\n * @api\n */\n View.prototype.getResolutionForExtent = function (extent, opt_size) {\n return this.getResolutionForExtentInternal(fromUserExtent(extent, this.getProjection()), opt_size);\n };\n /**\n * Get the resolution for a provided extent (in map units) and size (in pixels).\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {import(\"./size.js\").Size=} opt_size Box pixel size.\n * @return {number} The resolution at which the provided extent will render at\n * the given size.\n */\n View.prototype.getResolutionForExtentInternal = function (extent, opt_size) {\n var size = opt_size || this.getSizeFromViewport_();\n var xResolution = getWidth(extent) / size[0];\n var yResolution = getHeight(extent) / size[1];\n return Math.max(xResolution, yResolution);\n };\n /**\n * Return a function that returns a value between 0 and 1 for a\n * resolution. Exponential scaling is assumed.\n * @param {number=} opt_power Power.\n * @return {function(number): number} Resolution for value function.\n */\n View.prototype.getResolutionForValueFunction = function (opt_power) {\n var power = opt_power || 2;\n var maxResolution = this.maxResolution_;\n var minResolution = this.minResolution_;\n var max = Math.log(maxResolution / minResolution) / Math.log(power);\n return (\n /**\n * @param {number} value Value.\n * @return {number} Resolution.\n */\n function (value) {\n var resolution = maxResolution / Math.pow(power, value * max);\n return resolution;\n });\n };\n /**\n * Get the view rotation.\n * @return {number} The rotation of the view in radians.\n * @observable\n * @api\n */\n View.prototype.getRotation = function () {\n return /** @type {number} */ (this.get(ViewProperty.ROTATION));\n };\n /**\n * Return a function that returns a resolution for a value between\n * 0 and 1. Exponential scaling is assumed.\n * @param {number=} opt_power Power.\n * @return {function(number): number} Value for resolution function.\n */\n View.prototype.getValueForResolutionFunction = function (opt_power) {\n var power = opt_power || 2;\n var maxResolution = this.maxResolution_;\n var minResolution = this.minResolution_;\n var max = Math.log(maxResolution / minResolution) / Math.log(power);\n return (\n /**\n * @param {number} resolution Resolution.\n * @return {number} Value.\n */\n function (resolution) {\n var value = (Math.log(maxResolution / resolution) / Math.log(power)) / max;\n return value;\n });\n };\n /**\n * @return {State} View state.\n */\n View.prototype.getState = function () {\n var center = /** @type {import(\"./coordinate.js\").Coordinate} */ (this.getCenterInternal());\n var projection = this.getProjection();\n var resolution = /** @type {number} */ (this.getResolution());\n var rotation = this.getRotation();\n return {\n center: center.slice(0),\n projection: projection !== undefined ? projection : null,\n resolution: resolution,\n rotation: rotation,\n zoom: this.getZoom()\n };\n };\n /**\n * Get the current zoom level. This method may return non-integer zoom levels\n * if the view does not constrain the resolution, or if an interaction or\n * animation is underway.\n * @return {number|undefined} Zoom.\n * @api\n */\n View.prototype.getZoom = function () {\n var zoom;\n var resolution = this.getResolution();\n if (resolution !== undefined) {\n zoom = this.getZoomForResolution(resolution);\n }\n return zoom;\n };\n /**\n * Get the zoom level for a resolution.\n * @param {number} resolution The resolution.\n * @return {number|undefined} The zoom level for the provided resolution.\n * @api\n */\n View.prototype.getZoomForResolution = function (resolution) {\n var offset = this.minZoom_ || 0;\n var max, zoomFactor;\n if (this.resolutions_) {\n var nearest = linearFindNearest(this.resolutions_, resolution, 1);\n offset = nearest;\n max = this.resolutions_[nearest];\n if (nearest == this.resolutions_.length - 1) {\n zoomFactor = 2;\n }\n else {\n zoomFactor = max / this.resolutions_[nearest + 1];\n }\n }\n else {\n max = this.maxResolution_;\n zoomFactor = this.zoomFactor_;\n }\n return offset + Math.log(max / resolution) / Math.log(zoomFactor);\n };\n /**\n * Get the resolution for a zoom level.\n * @param {number} zoom Zoom level.\n * @return {number} The view resolution for the provided zoom level.\n * @api\n */\n View.prototype.getResolutionForZoom = function (zoom) {\n if (this.resolutions_) {\n if (this.resolutions_.length <= 1) {\n return 0;\n }\n var baseLevel = clamp(Math.floor(zoom), 0, this.resolutions_.length - 2);\n var zoomFactor = this.resolutions_[baseLevel] / this.resolutions_[baseLevel + 1];\n return this.resolutions_[baseLevel] / Math.pow(zoomFactor, clamp(zoom - baseLevel, 0, 1));\n }\n else {\n return this.maxResolution_ / Math.pow(this.zoomFactor_, zoom - this.minZoom_);\n }\n };\n /**\n * Fit the given geometry or extent based on the given map size and border.\n * The size is pixel dimensions of the box to fit the extent into.\n * In most cases you will want to use the map size, that is `map.getSize()`.\n * Takes care of the map angle.\n * @param {import(\"./geom/SimpleGeometry.js\").default|import(\"./extent.js\").Extent} geometryOrExtent The geometry or\n * extent to fit the view to.\n * @param {FitOptions=} opt_options Options.\n * @api\n */\n View.prototype.fit = function (geometryOrExtent, opt_options) {\n var options = assign({ size: this.getSizeFromViewport_() }, opt_options || {});\n /** @type {import(\"./geom/SimpleGeometry.js\").default} */\n var geometry;\n assert(Array.isArray(geometryOrExtent) || typeof /** @type {?} */ (geometryOrExtent).getSimplifiedGeometry === 'function', 24); // Invalid extent or geometry provided as `geometry`\n if (Array.isArray(geometryOrExtent)) {\n assert(!isEmpty(geometryOrExtent), 25); // Cannot fit empty extent provided as `geometry`\n var extent = fromUserExtent(geometryOrExtent, this.getProjection());\n geometry = polygonFromExtent(extent);\n }\n else if (geometryOrExtent.getType() === GeometryType.CIRCLE) {\n var extent = fromUserExtent(geometryOrExtent.getExtent(), this.getProjection());\n geometry = polygonFromExtent(extent);\n geometry.rotate(this.getRotation(), getCenter(extent));\n }\n else {\n var userProjection = getUserProjection();\n if (userProjection) {\n geometry = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry.clone().transform(userProjection, this.getProjection()));\n }\n else {\n geometry = geometryOrExtent;\n }\n }\n this.fitInternal(geometry, options);\n };\n /**\n * @param {import(\"./geom/SimpleGeometry.js\").default} geometry The geometry.\n * @param {FitOptions=} opt_options Options.\n */\n View.prototype.fitInternal = function (geometry, opt_options) {\n var options = opt_options || {};\n var size = options.size;\n if (!size) {\n size = this.getSizeFromViewport_();\n }\n var padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0];\n var nearest = options.nearest !== undefined ? options.nearest : false;\n var minResolution;\n if (options.minResolution !== undefined) {\n minResolution = options.minResolution;\n }\n else if (options.maxZoom !== undefined) {\n minResolution = this.getResolutionForZoom(options.maxZoom);\n }\n else {\n minResolution = 0;\n }\n var coords = geometry.getFlatCoordinates();\n // calculate rotated extent\n var rotation = this.getRotation();\n var cosAngle = Math.cos(-rotation);\n var sinAngle = Math.sin(-rotation);\n var minRotX = +Infinity;\n var minRotY = +Infinity;\n var maxRotX = -Infinity;\n var maxRotY = -Infinity;\n var stride = geometry.getStride();\n for (var i = 0, ii = coords.length; i < ii; i += stride) {\n var rotX = coords[i] * cosAngle - coords[i + 1] * sinAngle;\n var rotY = coords[i] * sinAngle + coords[i + 1] * cosAngle;\n minRotX = Math.min(minRotX, rotX);\n minRotY = Math.min(minRotY, rotY);\n maxRotX = Math.max(maxRotX, rotX);\n maxRotY = Math.max(maxRotY, rotY);\n }\n // calculate resolution\n var resolution = this.getResolutionForExtentInternal([minRotX, minRotY, maxRotX, maxRotY], [size[0] - padding[1] - padding[3], size[1] - padding[0] - padding[2]]);\n resolution = isNaN(resolution) ? minResolution :\n Math.max(resolution, minResolution);\n resolution = this.getConstrainedResolution(resolution, nearest ? 0 : 1);\n // calculate center\n sinAngle = -sinAngle; // go back to original rotation\n var centerRotX = (minRotX + maxRotX) / 2;\n var centerRotY = (minRotY + maxRotY) / 2;\n centerRotX += (padding[1] - padding[3]) / 2 * resolution;\n centerRotY += (padding[0] - padding[2]) / 2 * resolution;\n var centerX = centerRotX * cosAngle - centerRotY * sinAngle;\n var centerY = centerRotY * cosAngle + centerRotX * sinAngle;\n var center = [centerX, centerY];\n var callback = options.callback ? options.callback : VOID;\n if (options.duration !== undefined) {\n this.animateInternal({\n resolution: resolution,\n center: this.getConstrainedCenter(center, resolution),\n duration: options.duration,\n easing: options.easing\n }, callback);\n }\n else {\n this.targetResolution_ = resolution;\n this.targetCenter_ = center;\n this.applyTargetState_(false, true);\n animationCallback(callback, true);\n }\n };\n /**\n * Center on coordinate and view position.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n * @api\n */\n View.prototype.centerOn = function (coordinate, size, position) {\n this.centerOnInternal(fromUserCoordinate(coordinate, this.getProjection()), size, position);\n };\n /**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n */\n View.prototype.centerOnInternal = function (coordinate, size, position) {\n // calculate rotated position\n var rotation = this.getRotation();\n var cosAngle = Math.cos(-rotation);\n var sinAngle = Math.sin(-rotation);\n var rotX = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n var rotY = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n var resolution = this.getResolution();\n rotX += (size[0] / 2 - position[0]) * resolution;\n rotY += (position[1] - size[1] / 2) * resolution;\n // go back to original angle\n sinAngle = -sinAngle; // go back to original rotation\n var centerX = rotX * cosAngle - rotY * sinAngle;\n var centerY = rotY * cosAngle + rotX * sinAngle;\n this.setCenterInternal([centerX, centerY]);\n };\n /**\n * @return {boolean} Is defined.\n */\n View.prototype.isDef = function () {\n return !!this.getCenterInternal() && this.getResolution() !== undefined;\n };\n /**\n * Adds relative coordinates to the center of the view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate} deltaCoordinates Relative value to add.\n * @api\n */\n View.prototype.adjustCenter = function (deltaCoordinates) {\n var center = toUserCoordinate(this.targetCenter_, this.getProjection());\n this.setCenter([center[0] + deltaCoordinates[0], center[1] + deltaCoordinates[1]]);\n };\n /**\n * Adds relative coordinates to the center of the view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate} deltaCoordinates Relative value to add.\n */\n View.prototype.adjustCenterInternal = function (deltaCoordinates) {\n var center = this.targetCenter_;\n this.setCenterInternal([center[0] + deltaCoordinates[0], center[1] + deltaCoordinates[1]]);\n };\n /**\n * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} ratio The ratio to apply on the view resolution.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The origin of the transformation.\n * @api\n */\n View.prototype.adjustResolution = function (ratio, opt_anchor) {\n var anchor = opt_anchor && fromUserCoordinate(opt_anchor, this.getProjection());\n this.adjustResolutionInternal(ratio, anchor);\n };\n /**\n * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} ratio The ratio to apply on the view resolution.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The origin of the transformation.\n */\n View.prototype.adjustResolutionInternal = function (ratio, opt_anchor) {\n var isMoving = this.getAnimating() || this.getInteracting();\n var size = this.getSizeFromViewport_(this.getRotation());\n var newResolution = this.constraints_.resolution(this.targetResolution_ * ratio, 0, size, isMoving);\n if (opt_anchor !== undefined) {\n this.targetCenter_ = this.calculateCenterZoom(newResolution, opt_anchor);\n }\n this.targetResolution_ *= ratio;\n this.applyTargetState_();\n };\n /**\n * Adds a value to the view zoom level, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} delta Relative value to add to the zoom level.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The origin of the transformation.\n * @api\n */\n View.prototype.adjustZoom = function (delta, opt_anchor) {\n this.adjustResolution(Math.pow(this.zoomFactor_, -delta), opt_anchor);\n };\n /**\n * Adds a value to the view rotation, optionally using an anchor. Any rotation\n * constraint will apply.\n * @param {number} delta Relative value to add to the zoom rotation, in radians.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The rotation center.\n * @api\n */\n View.prototype.adjustRotation = function (delta, opt_anchor) {\n if (opt_anchor) {\n opt_anchor = fromUserCoordinate(opt_anchor, this.getProjection());\n }\n this.adjustRotationInternal(delta, opt_anchor);\n };\n /**\n * @param {number} delta Relative value to add to the zoom rotation, in radians.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The rotation center.\n */\n View.prototype.adjustRotationInternal = function (delta, opt_anchor) {\n var isMoving = this.getAnimating() || this.getInteracting();\n var newRotation = this.constraints_.rotation(this.targetRotation_ + delta, isMoving);\n if (opt_anchor !== undefined) {\n this.targetCenter_ = this.calculateCenterRotate(newRotation, opt_anchor);\n }\n this.targetRotation_ += delta;\n this.applyTargetState_();\n };\n /**\n * Set the center of the current view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center The center of the view.\n * @observable\n * @api\n */\n View.prototype.setCenter = function (center) {\n this.setCenterInternal(fromUserCoordinate(center, this.getProjection()));\n };\n /**\n * Set the center using the view projection (not the user projection).\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center The center of the view.\n */\n View.prototype.setCenterInternal = function (center) {\n this.targetCenter_ = center;\n this.applyTargetState_();\n };\n /**\n * @param {ViewHint} hint Hint.\n * @param {number} delta Delta.\n * @return {number} New value.\n */\n View.prototype.setHint = function (hint, delta) {\n this.hints_[hint] += delta;\n this.changed();\n return this.hints_[hint];\n };\n /**\n * Set the resolution for this view. Any resolution constraint will apply.\n * @param {number|undefined} resolution The resolution of the view.\n * @observable\n * @api\n */\n View.prototype.setResolution = function (resolution) {\n this.targetResolution_ = resolution;\n this.applyTargetState_();\n };\n /**\n * Set the rotation for this view. Any rotation constraint will apply.\n * @param {number} rotation The rotation of the view in radians.\n * @observable\n * @api\n */\n View.prototype.setRotation = function (rotation) {\n this.targetRotation_ = rotation;\n this.applyTargetState_();\n };\n /**\n * Zoom to a specific zoom level. Any resolution constrain will apply.\n * @param {number} zoom Zoom level.\n * @api\n */\n View.prototype.setZoom = function (zoom) {\n this.setResolution(this.getResolutionForZoom(zoom));\n };\n /**\n * Recompute rotation/resolution/center based on target values.\n * Note: we have to compute rotation first, then resolution and center considering that\n * parameters can influence one another in case a view extent constraint is present.\n * @param {boolean=} opt_doNotCancelAnims Do not cancel animations.\n * @param {boolean=} opt_forceMoving Apply constraints as if the view is moving.\n * @private\n */\n View.prototype.applyTargetState_ = function (opt_doNotCancelAnims, opt_forceMoving) {\n var isMoving = this.getAnimating() || this.getInteracting() || opt_forceMoving;\n // compute rotation\n var newRotation = this.constraints_.rotation(this.targetRotation_, isMoving);\n var size = this.getSizeFromViewport_(newRotation);\n var newResolution = this.constraints_.resolution(this.targetResolution_, 0, size, isMoving);\n var newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, isMoving);\n if (this.get(ViewProperty.ROTATION) !== newRotation) {\n this.set(ViewProperty.ROTATION, newRotation);\n }\n if (this.get(ViewProperty.RESOLUTION) !== newResolution) {\n this.set(ViewProperty.RESOLUTION, newResolution);\n }\n if (!this.get(ViewProperty.CENTER) || !equals(this.get(ViewProperty.CENTER), newCenter)) {\n this.set(ViewProperty.CENTER, newCenter);\n }\n if (this.getAnimating() && !opt_doNotCancelAnims) {\n this.cancelAnimations();\n }\n };\n /**\n * If any constraints need to be applied, an animation will be triggered.\n * This is typically done on interaction end.\n * Note: calling this with a duration of 0 will apply the constrained values straight away,\n * without animation.\n * @param {number=} opt_duration The animation duration in ms.\n * @param {number=} opt_resolutionDirection Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The origin of the transformation.\n */\n View.prototype.resolveConstraints = function (opt_duration, opt_resolutionDirection, opt_anchor) {\n var duration = opt_duration !== undefined ? opt_duration : 200;\n var direction = opt_resolutionDirection || 0;\n var newRotation = this.constraints_.rotation(this.targetRotation_);\n var size = this.getSizeFromViewport_(newRotation);\n var newResolution = this.constraints_.resolution(this.targetResolution_, direction, size);\n var newCenter = this.constraints_.center(this.targetCenter_, newResolution, size);\n if (duration === 0) {\n this.targetResolution_ = newResolution;\n this.targetRotation_ = newRotation;\n this.targetCenter_ = newCenter;\n this.applyTargetState_();\n return;\n }\n if (this.getResolution() !== newResolution ||\n this.getRotation() !== newRotation ||\n !this.getCenterInternal() ||\n !equals(this.getCenterInternal(), newCenter)) {\n if (this.getAnimating()) {\n this.cancelAnimations();\n }\n this.animateInternal({\n rotation: newRotation,\n center: newCenter,\n resolution: newResolution,\n duration: duration,\n easing: easeOut,\n anchor: opt_anchor\n });\n }\n };\n /**\n * Notify the View that an interaction has started.\n * The view state will be resolved to a stable one if needed\n * (depending on its constraints).\n * @api\n */\n View.prototype.beginInteraction = function () {\n this.resolveConstraints(0);\n this.setHint(ViewHint.INTERACTING, 1);\n };\n /**\n * Notify the View that an interaction has ended. The view state will be resolved\n * to a stable one if needed (depending on its constraints).\n * @param {number=} opt_duration Animation duration in ms.\n * @param {number=} opt_resolutionDirection Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The origin of the transformation.\n * @api\n */\n View.prototype.endInteraction = function (opt_duration, opt_resolutionDirection, opt_anchor) {\n var anchor = opt_anchor && fromUserCoordinate(opt_anchor, this.getProjection());\n this.endInteractionInternal(opt_duration, opt_resolutionDirection, anchor);\n };\n /**\n * Notify the View that an interaction has ended. The view state will be resolved\n * to a stable one if needed (depending on its constraints).\n * @param {number=} opt_duration Animation duration in ms.\n * @param {number=} opt_resolutionDirection Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate=} opt_anchor The origin of the transformation.\n */\n View.prototype.endInteractionInternal = function (opt_duration, opt_resolutionDirection, opt_anchor) {\n this.setHint(ViewHint.INTERACTING, -1);\n this.resolveConstraints(opt_duration, opt_resolutionDirection, opt_anchor);\n };\n /**\n * Get a valid position for the view center according to the current constraints.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} targetCenter Target center position.\n * @param {number=} opt_targetResolution Target resolution. If not supplied, the current one will be used.\n * This is useful to guess a valid center position at a different zoom level.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Valid center position.\n */\n View.prototype.getConstrainedCenter = function (targetCenter, opt_targetResolution) {\n var size = this.getSizeFromViewport_(this.getRotation());\n return this.constraints_.center(targetCenter, opt_targetResolution || this.getResolution(), size);\n };\n /**\n * Get a valid zoom level according to the current view constraints.\n * @param {number|undefined} targetZoom Target zoom.\n * @param {number=} [opt_direction=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @return {number|undefined} Valid zoom level.\n */\n View.prototype.getConstrainedZoom = function (targetZoom, opt_direction) {\n var targetRes = this.getResolutionForZoom(targetZoom);\n return this.getZoomForResolution(this.getConstrainedResolution(targetRes, opt_direction));\n };\n /**\n * Get a valid resolution according to the current view constraints.\n * @param {number|undefined} targetResolution Target resolution.\n * @param {number=} [opt_direction=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @return {number|undefined} Valid resolution.\n */\n View.prototype.getConstrainedResolution = function (targetResolution, opt_direction) {\n var direction = opt_direction || 0;\n var size = this.getSizeFromViewport_(this.getRotation());\n return this.constraints_.resolution(targetResolution, direction, size);\n };\n return View;\n}(BaseObject));\n/**\n * @param {Function} callback Callback.\n * @param {*} returnValue Return value.\n */\nfunction animationCallback(callback, returnValue) {\n setTimeout(function () {\n callback(returnValue);\n }, 0);\n}\n/**\n * @param {ViewOptions} options View options.\n * @return {import(\"./centerconstraint.js\").Type} The constraint.\n */\nexport function createCenterConstraint(options) {\n if (options.extent !== undefined) {\n var smooth = options.smoothExtentConstraint !== undefined ? options.smoothExtentConstraint : true;\n return createExtent(options.extent, options.constrainOnlyCenter, smooth);\n }\n var projection = createProjection(options.projection, 'EPSG:3857');\n if (options.multiWorld !== true && projection.isGlobal()) {\n var extent = projection.getExtent().slice();\n extent[0] = -Infinity;\n extent[2] = Infinity;\n return createExtent(extent, false, false);\n }\n return centerNone;\n}\n/**\n * @param {ViewOptions} options View options.\n * @return {{constraint: import(\"./resolutionconstraint.js\").Type, maxResolution: number,\n * minResolution: number, minZoom: number, zoomFactor: number}} The constraint.\n */\nexport function createResolutionConstraint(options) {\n var resolutionConstraint;\n var maxResolution;\n var minResolution;\n // TODO: move these to be ol constants\n // see https://github.com/openlayers/openlayers/issues/2076\n var defaultMaxZoom = 28;\n var defaultZoomFactor = 2;\n var minZoom = options.minZoom !== undefined ?\n options.minZoom : DEFAULT_MIN_ZOOM;\n var maxZoom = options.maxZoom !== undefined ?\n options.maxZoom : defaultMaxZoom;\n var zoomFactor = options.zoomFactor !== undefined ?\n options.zoomFactor : defaultZoomFactor;\n var multiWorld = options.multiWorld !== undefined ?\n options.multiWorld : false;\n var smooth = options.smoothResolutionConstraint !== undefined ? options.smoothResolutionConstraint : true;\n var projection = createProjection(options.projection, 'EPSG:3857');\n var projExtent = projection.getExtent();\n var constrainOnlyCenter = options.constrainOnlyCenter;\n var extent = options.extent;\n if (!multiWorld && !extent && projection.isGlobal()) {\n constrainOnlyCenter = false;\n extent = projExtent;\n }\n if (options.resolutions !== undefined) {\n var resolutions = options.resolutions;\n maxResolution = resolutions[minZoom];\n minResolution = resolutions[maxZoom] !== undefined ?\n resolutions[maxZoom] : resolutions[resolutions.length - 1];\n if (options.constrainResolution) {\n resolutionConstraint = createSnapToResolutions(resolutions, smooth, !constrainOnlyCenter && extent);\n }\n else {\n resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent);\n }\n }\n else {\n // calculate the default min and max resolution\n var size = !projExtent ?\n // use an extent that can fit the whole world if need be\n 360 * METERS_PER_UNIT[Units.DEGREES] /\n projection.getMetersPerUnit() :\n Math.max(getWidth(projExtent), getHeight(projExtent));\n var defaultMaxResolution = size / DEFAULT_TILE_SIZE / Math.pow(defaultZoomFactor, DEFAULT_MIN_ZOOM);\n var defaultMinResolution = defaultMaxResolution / Math.pow(defaultZoomFactor, defaultMaxZoom - DEFAULT_MIN_ZOOM);\n // user provided maxResolution takes precedence\n maxResolution = options.maxResolution;\n if (maxResolution !== undefined) {\n minZoom = 0;\n }\n else {\n maxResolution = defaultMaxResolution / Math.pow(zoomFactor, minZoom);\n }\n // user provided minResolution takes precedence\n minResolution = options.minResolution;\n if (minResolution === undefined) {\n if (options.maxZoom !== undefined) {\n if (options.maxResolution !== undefined) {\n minResolution = maxResolution / Math.pow(zoomFactor, maxZoom);\n }\n else {\n minResolution = defaultMaxResolution / Math.pow(zoomFactor, maxZoom);\n }\n }\n else {\n minResolution = defaultMinResolution;\n }\n }\n // given discrete zoom levels, minResolution may be different than provided\n maxZoom = minZoom + Math.floor(Math.log(maxResolution / minResolution) / Math.log(zoomFactor));\n minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom);\n if (options.constrainResolution) {\n resolutionConstraint = createSnapToPower(zoomFactor, maxResolution, minResolution, smooth, !constrainOnlyCenter && extent);\n }\n else {\n resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent);\n }\n }\n return { constraint: resolutionConstraint, maxResolution: maxResolution,\n minResolution: minResolution, minZoom: minZoom, zoomFactor: zoomFactor };\n}\n/**\n * @param {ViewOptions} options View options.\n * @return {import(\"./rotationconstraint.js\").Type} Rotation constraint.\n */\nexport function createRotationConstraint(options) {\n var enableRotation = options.enableRotation !== undefined ?\n options.enableRotation : true;\n if (enableRotation) {\n var constrainRotation = options.constrainRotation;\n if (constrainRotation === undefined || constrainRotation === true) {\n return createSnapToZero();\n }\n else if (constrainRotation === false) {\n return rotationNone;\n }\n else if (typeof constrainRotation === 'number') {\n return createSnapToN(constrainRotation);\n }\n else {\n return rotationNone;\n }\n }\n else {\n return disable;\n }\n}\n/**\n * Determine if an animation involves no view change.\n * @param {Animation} animation The animation.\n * @return {boolean} The animation involves no view change.\n */\nexport function isNoopAnimation(animation) {\n if (animation.sourceCenter && animation.targetCenter) {\n if (!coordinatesEqual(animation.sourceCenter, animation.targetCenter)) {\n return false;\n }\n }\n if (animation.sourceResolution !== animation.targetResolution) {\n return false;\n }\n if (animation.sourceRotation !== animation.targetRotation) {\n return false;\n }\n return true;\n}\nexport default View;\n//# sourceMappingURL=View.js.map","/**\n * @module ol/dom\n */\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number=} opt_width Canvas width.\n * @param {number=} opt_height Canvas height.\n * @return {CanvasRenderingContext2D} The context.\n */\nexport function createCanvasContext2D(opt_width, opt_height) {\n var canvas = document.createElement('canvas');\n if (opt_width) {\n canvas.width = opt_width;\n }\n if (opt_height) {\n canvas.height = opt_height;\n }\n return canvas.getContext('2d');\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 var width = element.offsetWidth;\n var style = getComputedStyle(element);\n width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);\n return width;\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 var height = element.offsetHeight;\n var style = getComputedStyle(element);\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n return height;\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 var parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n}\n/**\n * @param {Node} node The node to remove.\n * @returns {Node} 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 * @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 * 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 var oldChildren = node.childNodes;\n for (var i = 0; true; ++i) {\n var oldChild = oldChildren[i];\n var newChild = children[i];\n // check if our work is done\n if (!oldChild && !newChild) {\n break;\n }\n // check if children match\n if (oldChild === newChild) {\n continue;\n }\n // check if a new child needs to be added\n if (!oldChild) {\n node.appendChild(newChild);\n continue;\n }\n // check if an old child needs to be removed\n if (!newChild) {\n node.removeChild(oldChild);\n --i;\n continue;\n }\n // reorder\n node.insertBefore(newChild, oldChild);\n }\n}\n//# sourceMappingURL=dom.js.map","/**\n * @module ol/layer/Property\n */\n/**\n * @enum {string}\n */\nexport default {\n OPACITY: 'opacity',\n VISIBLE: 'visible',\n EXTENT: 'extent',\n Z_INDEX: 'zIndex',\n MAX_RESOLUTION: 'maxResolution',\n MIN_RESOLUTION: 'minResolution',\n MAX_ZOOM: 'maxZoom',\n MIN_ZOOM: 'minZoom',\n SOURCE: 'source'\n};\n//# sourceMappingURL=Property.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Base\n */\nimport { abstract } from '../util.js';\nimport BaseObject from '../Object.js';\nimport LayerProperty from './Property.js';\nimport { clamp } from '../math.js';\nimport { assign } from '../obj.js';\nimport { assert } from '../asserts.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Note that with {@link module:ol/layer/Base} and all its subclasses, any property set in\n * the options is set as a {@link module:ol/Object} property on the layer object, so\n * is observable, and has get/set accessors.\n *\n * @api\n */\nvar BaseLayer = /** @class */ (function (_super) {\n __extends(BaseLayer, _super);\n /**\n * @param {Options} options Layer options.\n */\n function BaseLayer(options) {\n var _this = _super.call(this) || this;\n /**\n * @type {Object<string, *>}\n */\n var properties = assign({}, options);\n properties[LayerProperty.OPACITY] =\n options.opacity !== undefined ? options.opacity : 1;\n assert(typeof properties[LayerProperty.OPACITY] === 'number', 64); // Layer opacity must be a number\n properties[LayerProperty.VISIBLE] =\n options.visible !== undefined ? options.visible : true;\n properties[LayerProperty.Z_INDEX] = options.zIndex;\n properties[LayerProperty.MAX_RESOLUTION] =\n options.maxResolution !== undefined ? options.maxResolution : Infinity;\n properties[LayerProperty.MIN_RESOLUTION] =\n options.minResolution !== undefined ? options.minResolution : 0;\n properties[LayerProperty.MIN_ZOOM] =\n options.minZoom !== undefined ? options.minZoom : -Infinity;\n properties[LayerProperty.MAX_ZOOM] =\n options.maxZoom !== undefined ? options.maxZoom : Infinity;\n /**\n * @type {string}\n * @private\n */\n _this.className_ = properties.className !== undefined ? options.className : 'ol-layer';\n delete properties.className;\n _this.setProperties(properties);\n /**\n * @type {import(\"./Layer.js\").State}\n * @private\n */\n _this.state_ = null;\n return _this;\n }\n /**\n * @return {string} CSS class name.\n */\n BaseLayer.prototype.getClassName = function () {\n return this.className_;\n };\n /**\n * This method is not meant to be called by layers or layer renderers because the state\n * is incorrect if the layer is included in a layer group.\n *\n * @param {boolean=} opt_managed Layer is managed.\n * @return {import(\"./Layer.js\").State} Layer state.\n */\n BaseLayer.prototype.getLayerState = function (opt_managed) {\n /** @type {import(\"./Layer.js\").State} */\n var state = this.state_ || /** @type {?} */ ({\n layer: this,\n managed: opt_managed === undefined ? true : opt_managed\n });\n var zIndex = this.getZIndex();\n state.opacity = clamp(Math.round(this.getOpacity() * 100) / 100, 0, 1);\n state.sourceState = this.getSourceState();\n state.visible = this.getVisible();\n state.extent = this.getExtent();\n state.zIndex = zIndex !== undefined ? zIndex : (state.managed === false ? Infinity : 0);\n state.maxResolution = this.getMaxResolution();\n state.minResolution = Math.max(this.getMinResolution(), 0);\n state.minZoom = this.getMinZoom();\n state.maxZoom = this.getMaxZoom();\n this.state_ = state;\n return state;\n };\n /**\n * @abstract\n * @param {Array<import(\"./Layer.js\").default>=} opt_array Array of layers (to be\n * modified in place).\n * @return {Array<import(\"./Layer.js\").default>} Array of layers.\n */\n BaseLayer.prototype.getLayersArray = function (opt_array) {\n return abstract();\n };\n /**\n * @abstract\n * @param {Array<import(\"./Layer.js\").State>=} opt_states Optional list of layer\n * states (to be modified in place).\n * @return {Array<import(\"./Layer.js\").State>} List of layer states.\n */\n BaseLayer.prototype.getLayerStatesArray = function (opt_states) {\n return abstract();\n };\n /**\n * Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it\n * will be visible regardless of extent.\n * @return {import(\"../extent.js\").Extent|undefined} The layer extent.\n * @observable\n * @api\n */\n BaseLayer.prototype.getExtent = function () {\n return (\n /** @type {import(\"../extent.js\").Extent|undefined} */ (this.get(LayerProperty.EXTENT)));\n };\n /**\n * Return the maximum resolution of the layer.\n * @return {number} The maximum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMaxResolution = function () {\n return /** @type {number} */ (this.get(LayerProperty.MAX_RESOLUTION));\n };\n /**\n * Return the minimum resolution of the layer.\n * @return {number} The minimum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMinResolution = function () {\n return /** @type {number} */ (this.get(LayerProperty.MIN_RESOLUTION));\n };\n /**\n * Return the minimum zoom level of the layer.\n * @return {number} The minimum zoom level of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMinZoom = function () {\n return /** @type {number} */ (this.get(LayerProperty.MIN_ZOOM));\n };\n /**\n * Return the maximum zoom level of the layer.\n * @return {number} The maximum zoom level of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMaxZoom = function () {\n return /** @type {number} */ (this.get(LayerProperty.MAX_ZOOM));\n };\n /**\n * Return the opacity of the layer (between 0 and 1).\n * @return {number} The opacity of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getOpacity = function () {\n return /** @type {number} */ (this.get(LayerProperty.OPACITY));\n };\n /**\n * @abstract\n * @return {import(\"../source/State.js\").default} Source state.\n */\n BaseLayer.prototype.getSourceState = function () {\n return abstract();\n };\n /**\n * Return the visibility of the layer (`true` or `false`).\n * @return {boolean} The visibility of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getVisible = function () {\n return /** @type {boolean} */ (this.get(LayerProperty.VISIBLE));\n };\n /**\n * Return the Z-index of the layer, which is used to order layers before\n * rendering. The default Z-index is 0.\n * @return {number} The Z-index of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getZIndex = function () {\n return /** @type {number} */ (this.get(LayerProperty.Z_INDEX));\n };\n /**\n * Set the extent at which the layer is visible. If `undefined`, the layer\n * will be visible at all extents.\n * @param {import(\"../extent.js\").Extent|undefined} extent The extent of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setExtent = function (extent) {\n this.set(LayerProperty.EXTENT, extent);\n };\n /**\n * Set the maximum resolution at which the layer is visible.\n * @param {number} maxResolution The maximum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMaxResolution = function (maxResolution) {\n this.set(LayerProperty.MAX_RESOLUTION, maxResolution);\n };\n /**\n * Set the minimum resolution at which the layer is visible.\n * @param {number} minResolution The minimum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMinResolution = function (minResolution) {\n this.set(LayerProperty.MIN_RESOLUTION, minResolution);\n };\n /**\n * Set the maximum zoom (exclusive) at which the layer is visible.\n * Note that the zoom levels for layer visibility are based on the\n * view zoom level, which may be different from a tile source zoom level.\n * @param {number} maxZoom The maximum zoom of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMaxZoom = function (maxZoom) {\n this.set(LayerProperty.MAX_ZOOM, maxZoom);\n };\n /**\n * Set the minimum zoom (inclusive) at which the layer is visible.\n * Note that the zoom levels for layer visibility are based on the\n * view zoom level, which may be different from a tile source zoom level.\n * @param {number} minZoom The minimum zoom of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMinZoom = function (minZoom) {\n this.set(LayerProperty.MIN_ZOOM, minZoom);\n };\n /**\n * Set the opacity of the layer, allowed values range from 0 to 1.\n * @param {number} opacity The opacity of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setOpacity = function (opacity) {\n assert(typeof opacity === 'number', 64); // Layer opacity must be a number\n this.set(LayerProperty.OPACITY, opacity);\n };\n /**\n * Set the visibility of the layer (`true` or `false`).\n * @param {boolean} visible The visibility of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setVisible = function (visible) {\n this.set(LayerProperty.VISIBLE, visible);\n };\n /**\n * Set Z-index of the layer, which is used to order layers before rendering.\n * The default Z-index is 0.\n * @param {number} zindex The z-index of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setZIndex = function (zindex) {\n this.set(LayerProperty.Z_INDEX, zindex);\n };\n /**\n * @inheritDoc\n */\n BaseLayer.prototype.disposeInternal = function () {\n if (this.state_) {\n this.state_.layer = null;\n this.state_ = null;\n }\n _super.prototype.disposeInternal.call(this);\n };\n return BaseLayer;\n}(BaseObject));\nexport default BaseLayer;\n//# sourceMappingURL=Base.js.map","/**\n * @module ol/source/State\n */\n/**\n * @enum {string}\n * State of the source, one of 'undefined', 'loading', 'ready' or 'error'.\n */\nexport default {\n UNDEFINED: 'undefined',\n LOADING: 'loading',\n READY: 'ready',\n ERROR: 'error'\n};\n//# sourceMappingURL=State.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Group\n */\nimport { getUid } from '../util.js';\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport { getChangeEventType } from '../Object.js';\nimport ObjectEventType from '../ObjectEventType.js';\nimport { assert } from '../asserts.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { getIntersection } from '../extent.js';\nimport BaseLayer from './Base.js';\nimport { assign, clear } from '../obj.js';\nimport SourceState from '../source/State.js';\n/**\n * @typedef {Object} Options\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {Array<import(\"./Base.js\").default>|import(\"../Collection.js\").default<import(\"./Base.js\").default>} [layers] Child layers.\n */\n/**\n * @enum {string}\n * @private\n */\nvar Property = {\n LAYERS: 'layers'\n};\n/**\n * @classdesc\n * A {@link module:ol/Collection~Collection} of layers that are handled together.\n *\n * A generic `change` event is triggered when the group/Collection changes.\n *\n * @api\n */\nvar LayerGroup = /** @class */ (function (_super) {\n __extends(LayerGroup, _super);\n /**\n * @param {Options=} opt_options Layer options.\n */\n function LayerGroup(opt_options) {\n var _this = this;\n var options = opt_options || {};\n var baseOptions = /** @type {Options} */ (assign({}, options));\n delete baseOptions.layers;\n var layers = options.layers;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @private\n * @type {Array<import(\"../events.js\").EventsKey>}\n */\n _this.layersListenerKeys_ = [];\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").EventsKey>>}\n */\n _this.listenerKeys_ = {};\n _this.addEventListener(getChangeEventType(Property.LAYERS), _this.handleLayersChanged_);\n if (layers) {\n if (Array.isArray(layers)) {\n layers = new Collection(layers.slice(), { unique: true });\n }\n else {\n assert(typeof /** @type {?} */ (layers).getArray === 'function', 43); // Expected `layers` to be an array or a `Collection`\n }\n }\n else {\n layers = new Collection(undefined, { unique: true });\n }\n _this.setLayers(layers);\n return _this;\n }\n /**\n * @private\n */\n LayerGroup.prototype.handleLayerChange_ = function () {\n this.changed();\n };\n /**\n * @private\n */\n LayerGroup.prototype.handleLayersChanged_ = function () {\n this.layersListenerKeys_.forEach(unlistenByKey);\n this.layersListenerKeys_.length = 0;\n var layers = this.getLayers();\n this.layersListenerKeys_.push(listen(layers, CollectionEventType.ADD, this.handleLayersAdd_, this), listen(layers, CollectionEventType.REMOVE, this.handleLayersRemove_, this));\n for (var id in this.listenerKeys_) {\n this.listenerKeys_[id].forEach(unlistenByKey);\n }\n clear(this.listenerKeys_);\n var layersArray = layers.getArray();\n for (var i = 0, ii = layersArray.length; i < ii; i++) {\n var layer = layersArray[i];\n this.listenerKeys_[getUid(layer)] = [\n listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),\n listen(layer, EventType.CHANGE, this.handleLayerChange_, this)\n ];\n }\n this.changed();\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} collectionEvent CollectionEvent.\n * @private\n */\n LayerGroup.prototype.handleLayersAdd_ = function (collectionEvent) {\n var layer = /** @type {import(\"./Base.js\").default} */ (collectionEvent.element);\n this.listenerKeys_[getUid(layer)] = [\n listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),\n listen(layer, EventType.CHANGE, this.handleLayerChange_, this)\n ];\n this.changed();\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} collectionEvent CollectionEvent.\n * @private\n */\n LayerGroup.prototype.handleLayersRemove_ = function (collectionEvent) {\n var layer = /** @type {import(\"./Base.js\").default} */ (collectionEvent.element);\n var key = getUid(layer);\n this.listenerKeys_[key].forEach(unlistenByKey);\n delete this.listenerKeys_[key];\n this.changed();\n };\n /**\n * Returns the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}\n * in this group.\n * @return {!import(\"../Collection.js\").default<import(\"./Base.js\").default>} Collection of\n * {@link module:ol/layer/Base layers} that are part of this group.\n * @observable\n * @api\n */\n LayerGroup.prototype.getLayers = function () {\n return (\n /** @type {!import(\"../Collection.js\").default<import(\"./Base.js\").default>} */ (this.get(Property.LAYERS)));\n };\n /**\n * Set the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}\n * in this group.\n * @param {!import(\"../Collection.js\").default<import(\"./Base.js\").default>} layers Collection of\n * {@link module:ol/layer/Base layers} that are part of this group.\n * @observable\n * @api\n */\n LayerGroup.prototype.setLayers = function (layers) {\n this.set(Property.LAYERS, layers);\n };\n /**\n * @inheritDoc\n */\n LayerGroup.prototype.getLayersArray = function (opt_array) {\n var array = opt_array !== undefined ? opt_array : [];\n this.getLayers().forEach(function (layer) {\n layer.getLayersArray(array);\n });\n return array;\n };\n /**\n * @inheritDoc\n */\n LayerGroup.prototype.getLayerStatesArray = function (opt_states) {\n var states = opt_states !== undefined ? opt_states : [];\n var pos = states.length;\n this.getLayers().forEach(function (layer) {\n layer.getLayerStatesArray(states);\n });\n var ownLayerState = this.getLayerState();\n for (var i = pos, ii = states.length; i < ii; i++) {\n var layerState = states[i];\n layerState.opacity *= ownLayerState.opacity;\n layerState.visible = layerState.visible && ownLayerState.visible;\n layerState.maxResolution = Math.min(layerState.maxResolution, ownLayerState.maxResolution);\n layerState.minResolution = Math.max(layerState.minResolution, ownLayerState.minResolution);\n layerState.minZoom = Math.max(layerState.minZoom, ownLayerState.minZoom);\n layerState.maxZoom = Math.min(layerState.maxZoom, ownLayerState.maxZoom);\n if (ownLayerState.extent !== undefined) {\n if (layerState.extent !== undefined) {\n layerState.extent = getIntersection(layerState.extent, ownLayerState.extent);\n }\n else {\n layerState.extent = ownLayerState.extent;\n }\n }\n }\n return states;\n };\n /**\n * @inheritDoc\n */\n LayerGroup.prototype.getSourceState = function () {\n return SourceState.READY;\n };\n return LayerGroup;\n}(BaseLayer));\nexport default LayerGroup;\n//# sourceMappingURL=Group.js.map","/**\n * @module ol/size\n */\n/**\n * An array of numbers representing a size: `[width, height]`.\n * @typedef {Array<number>} Size\n * @api\n */\n/**\n * Returns a buffered size.\n * @param {Size} size Size.\n * @param {number} num The amount by which to buffer.\n * @param {Size=} opt_size Optional reusable size array.\n * @return {Size} The buffered size.\n */\nexport function buffer(size, num, opt_size) {\n if (opt_size === undefined) {\n opt_size = [0, 0];\n }\n opt_size[0] = size[0] + 2 * num;\n opt_size[1] = size[1] + 2 * num;\n return opt_size;\n}\n/**\n * Determines if a size has a positive area.\n * @param {Size} size The size to test.\n * @return {boolean} The size has a positive area.\n */\nexport function hasArea(size) {\n return size[0] > 0 && size[1] > 0;\n}\n/**\n * Returns a size scaled by a ratio. The result will be an array of integers.\n * @param {Size} size Size.\n * @param {number} ratio Ratio.\n * @param {Size=} opt_size Optional reusable size array.\n * @return {Size} The scaled size.\n */\nexport function scale(size, ratio, opt_size) {\n if (opt_size === undefined) {\n opt_size = [0, 0];\n }\n opt_size[0] = (size[0] * ratio + 0.5) | 0;\n opt_size[1] = (size[1] * ratio + 0.5) | 0;\n return opt_size;\n}\n/**\n * Returns an `Size` array for the passed in number (meaning: square) or\n * `Size` array.\n * (meaning: non-square),\n * @param {number|Size} size Width and height.\n * @param {Size=} opt_size Optional reusable size array.\n * @return {Size} Size.\n * @api\n */\nexport function toSize(size, opt_size) {\n if (Array.isArray(size)) {\n return size;\n }\n else {\n if (opt_size === undefined) {\n opt_size = [size, size];\n }\n else {\n opt_size[0] = size;\n opt_size[1] = size;\n }\n return opt_size;\n }\n}\n//# sourceMappingURL=size.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/PluggableMap\n */\nimport { getUid } from './util.js';\nimport Collection from './Collection.js';\nimport CollectionEventType from './CollectionEventType.js';\nimport MapBrowserEvent from './MapBrowserEvent.js';\nimport MapBrowserEventHandler from './MapBrowserEventHandler.js';\nimport MapBrowserEventType from './MapBrowserEventType.js';\nimport MapEvent from './MapEvent.js';\nimport MapEventType from './MapEventType.js';\nimport MapProperty from './MapProperty.js';\nimport RenderEventType from './render/EventType.js';\nimport BaseObject, { getChangeEventType } from './Object.js';\nimport ObjectEventType from './ObjectEventType.js';\nimport TileQueue from './TileQueue.js';\nimport View from './View.js';\nimport ViewHint from './ViewHint.js';\nimport { assert } from './asserts.js';\nimport { removeNode } from './dom.js';\nimport { listen, unlistenByKey } from './events.js';\nimport EventType from './events/EventType.js';\nimport { clone, createOrUpdateEmpty, equals, getForViewAndSize, isEmpty } from './extent.js';\nimport { TRUE } from './functions.js';\nimport { DEVICE_PIXEL_RATIO, IMAGE_DECODE } from './has.js';\nimport LayerGroup from './layer/Group.js';\nimport { hasArea } from './size.js';\nimport { DROP } from './structs/PriorityQueue.js';\nimport { create as createTransform, apply as applyTransform } from './transform.js';\nimport { toUserCoordinate, fromUserCoordinate } from './proj.js';\n/**\n * State of the current frame. Only `pixelRatio`, `time` and `viewState` should\n * be used in applications.\n * @typedef {Object} FrameState\n * @property {number} pixelRatio The pixel ratio of the frame.\n * @property {number} time The time when rendering of the frame was requested.\n * @property {import(\"./View.js\").State} viewState The state of the current view.\n * @property {boolean} animate\n * @property {import(\"./transform.js\").Transform} coordinateToPixelTransform\n * @property {null|import(\"./extent.js\").Extent} extent\n * @property {Array<DeclutterItems>} declutterItems\n * @property {number} index\n * @property {Array<import(\"./layer/Layer.js\").State>} layerStatesArray\n * @property {number} layerIndex\n * @property {import(\"./transform.js\").Transform} pixelToCoordinateTransform\n * @property {Array<PostRenderFunction>} postRenderFunctions\n * @property {import(\"./size.js\").Size} size\n * @property {TileQueue} tileQueue\n * @property {!Object<string, Object<string, boolean>>} usedTiles\n * @property {Array<number>} viewHints\n * @property {!Object<string, Object<string, boolean>>} wantedTiles\n */\n/**\n * @typedef {Object} DeclutterItems\n * @property {Array<*>} items Declutter items of an executor.\n * @property {number} opacity Layer opacity.\n */\n/**\n * @typedef {function(PluggableMap, ?FrameState): any} PostRenderFunction\n */\n/**\n * @typedef {Object} AtPixelOptions\n * @property {undefined|function(import(\"./layer/Layer.js\").default): boolean} [layerFilter] Layer filter\n * function. The filter function will receive one argument, the\n * {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.\n * Only layers which are visible and for which this function returns `true`\n * will be tested for features. By default, all visible layers will be tested.\n * @property {number} [hitTolerance=0] Hit-detection tolerance in pixels. Pixels\n * inside the radius around the given position will be checked for features.\n * @property {boolean} [checkWrapped=true] Check-Wrapped Will check for for wrapped geometries inside the range of\n * +/- 1 world width. Works only if a projection is used that can be wrapped.\n */\n/**\n * @typedef {Object} MapOptionsInternal\n * @property {Collection<import(\"./control/Control.js\").default>} [controls]\n * @property {Collection<import(\"./interaction/Interaction.js\").default>} [interactions]\n * @property {HTMLElement|Document} keyboardEventTarget\n * @property {Collection<import(\"./Overlay.js\").default>} overlays\n * @property {Object<string, *>} values\n */\n/**\n * Object literal with config options for the map.\n * @typedef {Object} MapOptions\n * @property {Collection<import(\"./control/Control.js\").default>|Array<import(\"./control/Control.js\").default>} [controls]\n * Controls initially added to the map. If not specified,\n * {@link module:ol/control~defaults} is used.\n * @property {number} [pixelRatio=window.devicePixelRatio] The ratio between\n * physical pixels and device-independent pixels (dips) on the device.\n * @property {Collection<import(\"./interaction/Interaction.js\").default>|Array<import(\"./interaction/Interaction.js\").default>} [interactions]\n * Interactions that are initially added to the map. If not specified,\n * {@link module:ol/interaction~defaults} is used.\n * @property {HTMLElement|Document|string} [keyboardEventTarget] The element to\n * listen to keyboard events on. This determines when the `KeyboardPan` and\n * `KeyboardZoom` interactions trigger. For example, if this option is set to\n * `document` the keyboard interactions will always trigger. If this option is\n * not specified, the element the library listens to keyboard events on is the\n * map target (i.e. the user-provided div for the map). If this is not\n * `document`, the target element needs to be focused for key events to be\n * emitted, requiring that the target element has a `tabindex` attribute.\n * @property {Array<import(\"./layer/Base.js\").default>|Collection<import(\"./layer/Base.js\").default>|LayerGroup} [layers]\n * Layers. If this is not defined, a map with no layers will be rendered. Note\n * that layers are rendered in the order supplied, so if you want, for example,\n * a vector layer to appear on top of a tile layer, it must come after the tile\n * layer.\n * @property {number} [maxTilesLoading=16] Maximum number tiles to load\n * simultaneously.\n * @property {number} [moveTolerance=1] The minimum distance in pixels the\n * cursor must move to be detected as a map move event instead of a click.\n * Increasing this value can make it easier to click on the map.\n * @property {Collection<import(\"./Overlay.js\").default>|Array<import(\"./Overlay.js\").default>} [overlays]\n * Overlays initially added to the map. By default, no overlays are added.\n * @property {HTMLElement|string} [target] The container for the map, either the\n * element itself or the `id` of the element. If not specified at construction\n * time, {@link module:ol/Map~Map#setTarget} must be called for the map to be\n * rendered.\n * @property {View} [view] The map's view. No layer sources will be\n * fetched unless this is specified at construction time or through\n * {@link module:ol/Map~Map#setView}.\n */\n/**\n * @param {HTMLElement} element Element.\n * @param {string} touchAction Value for `touch-action'.\n */\nfunction setTouchAction(element, touchAction) {\n element.style.msTouchAction = touchAction;\n element.style.touchAction = touchAction;\n element.setAttribute('touch-action', touchAction);\n}\n/**\n * @fires import(\"./MapBrowserEvent.js\").MapBrowserEvent\n * @fires import(\"./MapEvent.js\").MapEvent\n * @fires import(\"./render/Event.js\").default#precompose\n * @fires import(\"./render/Event.js\").default#postcompose\n * @fires import(\"./render/Event.js\").default#rendercomplete\n * @api\n */\nvar PluggableMap = /** @class */ (function (_super) {\n __extends(PluggableMap, _super);\n /**\n * @param {MapOptions} options Map options.\n */\n function PluggableMap(options) {\n var _this = _super.call(this) || this;\n var optionsInternal = createOptionsInternal(options);\n /** @private */\n _this.boundHandleBrowserEvent_ = _this.handleBrowserEvent.bind(_this);\n /**\n * @type {number}\n * @private\n */\n _this.maxTilesLoading_ = options.maxTilesLoading !== undefined ? options.maxTilesLoading : 16;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ = options.pixelRatio !== undefined ?\n options.pixelRatio : DEVICE_PIXEL_RATIO;\n /**\n * @private\n * @type {*}\n */\n _this.postRenderTimeoutHandle_;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.animationDelayKey_;\n /**\n * @private\n */\n _this.animationDelay_ = function () {\n this.animationDelayKey_ = undefined;\n this.renderFrame_(Date.now());\n }.bind(_this);\n /**\n * @private\n * @type {import(\"./transform.js\").Transform}\n */\n _this.coordinateToPixelTransform_ = createTransform();\n /**\n * @private\n * @type {import(\"./transform.js\").Transform}\n */\n _this.pixelToCoordinateTransform_ = createTransform();\n /**\n * @private\n * @type {number}\n */\n _this.frameIndex_ = 0;\n /**\n * @private\n * @type {?FrameState}\n */\n _this.frameState_ = null;\n /**\n * The extent at the previous 'moveend' event.\n * @private\n * @type {import(\"./extent.js\").Extent}\n */\n _this.previousExtent_ = null;\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.viewPropertyListenerKey_ = null;\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.viewChangeListenerKey_ = null;\n /**\n * @private\n * @type {?Array<import(\"./events.js\").EventsKey>}\n */\n _this.layerGroupPropertyListenerKeys_ = null;\n /**\n * @private\n * @type {!HTMLElement}\n */\n _this.viewport_ = document.createElement('div');\n _this.viewport_.className = 'ol-viewport' + ('ontouchstart' in window ? ' ol-touch' : '');\n _this.viewport_.style.position = 'relative';\n _this.viewport_.style.overflow = 'hidden';\n _this.viewport_.style.width = '100%';\n _this.viewport_.style.height = '100%';\n /**\n * @private\n * @type {!HTMLElement}\n */\n _this.overlayContainer_ = document.createElement('div');\n _this.overlayContainer_.style.position = 'absolute';\n _this.overlayContainer_.style.zIndex = '0';\n _this.overlayContainer_.style.width = '100%';\n _this.overlayContainer_.style.height = '100%';\n _this.overlayContainer_.className = 'ol-overlaycontainer';\n _this.viewport_.appendChild(_this.overlayContainer_);\n /**\n * @private\n * @type {!HTMLElement}\n */\n _this.overlayContainerStopEvent_ = document.createElement('div');\n _this.overlayContainerStopEvent_.style.position = 'absolute';\n _this.overlayContainerStopEvent_.style.zIndex = '0';\n _this.overlayContainerStopEvent_.style.width = '100%';\n _this.overlayContainerStopEvent_.style.height = '100%';\n _this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';\n _this.viewport_.appendChild(_this.overlayContainerStopEvent_);\n /**\n * @private\n * @type {MapBrowserEventHandler}\n */\n _this.mapBrowserEventHandler_ = new MapBrowserEventHandler(_this, options.moveTolerance);\n var handleMapBrowserEvent = _this.handleMapBrowserEvent.bind(_this);\n for (var key in MapBrowserEventType) {\n _this.mapBrowserEventHandler_.addEventListener(MapBrowserEventType[key], handleMapBrowserEvent);\n }\n /**\n * @private\n * @type {HTMLElement|Document}\n */\n _this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;\n /**\n * @private\n * @type {?Array<import(\"./events.js\").EventsKey>}\n */\n _this.keyHandlerKeys_ = null;\n /**\n * @private\n * @type {?Array<import(\"./events.js\").EventsKey>}\n */\n _this.focusHandlerKeys_ = null;\n var handleBrowserEvent = _this.handleBrowserEvent.bind(_this);\n _this.viewport_.addEventListener(EventType.CONTEXTMENU, handleBrowserEvent, false);\n _this.viewport_.addEventListener(EventType.WHEEL, handleBrowserEvent, false);\n /**\n * @type {Collection<import(\"./control/Control.js\").default>}\n * @protected\n */\n _this.controls = optionsInternal.controls || new Collection();\n /**\n * @type {Collection<import(\"./interaction/Interaction.js\").default>}\n * @protected\n */\n _this.interactions = optionsInternal.interactions || new Collection();\n /**\n * @type {Collection<import(\"./Overlay.js\").default>}\n * @private\n */\n _this.overlays_ = optionsInternal.overlays;\n /**\n * A lookup of overlays by id.\n * @private\n * @type {Object<string, import(\"./Overlay.js\").default>}\n */\n _this.overlayIdIndex_ = {};\n /**\n * @type {import(\"./renderer/Map.js\").default}\n * @private\n */\n _this.renderer_ = null;\n /**\n * @type {undefined|function(Event): void}\n * @private\n */\n _this.handleResize_;\n /**\n * @private\n * @type {!Array<PostRenderFunction>}\n */\n _this.postRenderFunctions_ = [];\n /**\n * @private\n * @type {TileQueue}\n */\n _this.tileQueue_ = new TileQueue(_this.getTilePriority.bind(_this), _this.handleTileChange_.bind(_this));\n _this.addEventListener(getChangeEventType(MapProperty.LAYERGROUP), _this.handleLayerGroupChanged_);\n _this.addEventListener(getChangeEventType(MapProperty.VIEW), _this.handleViewChanged_);\n _this.addEventListener(getChangeEventType(MapProperty.SIZE), _this.handleSizeChanged_);\n _this.addEventListener(getChangeEventType(MapProperty.TARGET), _this.handleTargetChanged_);\n // setProperties will trigger the rendering of the map if the map\n // is \"defined\" already.\n _this.setProperties(optionsInternal.values);\n _this.controls.forEach(\n /**\n * @param {import(\"./control/Control.js\").default} control Control.\n * @this {PluggableMap}\n */\n function (control) {\n control.setMap(this);\n }.bind(_this));\n _this.controls.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(this);\n }.bind(_this));\n _this.controls.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(null);\n }.bind(_this));\n _this.interactions.forEach(\n /**\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction.\n * @this {PluggableMap}\n */\n function (interaction) {\n interaction.setMap(this);\n }.bind(_this));\n _this.interactions.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(this);\n }.bind(_this));\n _this.interactions.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(null);\n }.bind(_this));\n _this.overlays_.forEach(_this.addOverlayInternal_.bind(_this));\n _this.overlays_.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n this.addOverlayInternal_(/** @type {import(\"./Overlay.js\").default} */ (event.element));\n }.bind(_this));\n _this.overlays_.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n var overlay = /** @type {import(\"./Overlay.js\").default} */ (event.element);\n var id = overlay.getId();\n if (id !== undefined) {\n delete this.overlayIdIndex_[id.toString()];\n }\n event.element.setMap(null);\n }.bind(_this));\n return _this;\n }\n /**\n * @abstract\n * @return {import(\"./renderer/Map.js\").default} The map renderer\n */\n PluggableMap.prototype.createRenderer = function () {\n throw new Error('Use a map type that has a createRenderer method');\n };\n /**\n * Add the given control to the map.\n * @param {import(\"./control/Control.js\").default} control Control.\n * @api\n */\n PluggableMap.prototype.addControl = function (control) {\n this.getControls().push(control);\n };\n /**\n * Add the given interaction to the map. If you want to add an interaction\n * at another point of the collection use `getInteraction()` and the methods\n * available on {@link module:ol/Collection~Collection}. This can be used to\n * stop the event propagation from the handleEvent function. The interactions\n * get to handle the events in the reverse order of this collection.\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction to add.\n * @api\n */\n PluggableMap.prototype.addInteraction = function (interaction) {\n this.getInteractions().push(interaction);\n };\n /**\n * Adds the given layer to the top of this map. If you want to add a layer\n * elsewhere in the stack, use `getLayers()` and the methods available on\n * {@link module:ol/Collection~Collection}.\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @api\n */\n PluggableMap.prototype.addLayer = function (layer) {\n var layers = this.getLayerGroup().getLayers();\n layers.push(layer);\n };\n /**\n * Add the given overlay to the map.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @api\n */\n PluggableMap.prototype.addOverlay = function (overlay) {\n this.getOverlays().push(overlay);\n };\n /**\n * This deals with map's overlay collection changes.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @private\n */\n PluggableMap.prototype.addOverlayInternal_ = function (overlay) {\n var id = overlay.getId();\n if (id !== undefined) {\n this.overlayIdIndex_[id.toString()] = overlay;\n }\n overlay.setMap(this);\n };\n /**\n *\n * @inheritDoc\n */\n PluggableMap.prototype.disposeInternal = function () {\n this.mapBrowserEventHandler_.dispose();\n this.viewport_.removeEventListener(EventType.CONTEXTMENU, this.boundHandleBrowserEvent_);\n this.viewport_.removeEventListener(EventType.WHEEL, this.boundHandleBrowserEvent_);\n if (this.handleResize_ !== undefined) {\n removeEventListener(EventType.RESIZE, this.handleResize_, false);\n this.handleResize_ = undefined;\n }\n this.setTarget(null);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Detect features that intersect a pixel on the viewport, and execute a\n * callback with each intersecting feature. Layers included in the detection can\n * be configured through the `layerFilter` option in `opt_options`.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {function(this: S, import(\"./Feature.js\").FeatureLike,\n * import(\"./layer/Layer.js\").default): T} callback Feature callback. The callback will be\n * called with two arguments. The first argument is one\n * {@link module:ol/Feature feature} or\n * {@link module:ol/render/Feature render feature} at the pixel, the second is\n * the {@link module:ol/layer/Layer layer} of the feature and will be null for\n * unmanaged layers. To stop detection, callback functions can return a\n * truthy value.\n * @param {AtPixelOptions=} opt_options Optional options.\n * @return {T|undefined} Callback result, i.e. the return value of last\n * callback execution, or the first truthy callback return value.\n * @template S,T\n * @api\n */\n PluggableMap.prototype.forEachFeatureAtPixel = function (pixel, callback, opt_options) {\n if (!this.frameState_) {\n return;\n }\n var coordinate = this.getCoordinateFromPixelInternal(pixel);\n opt_options = opt_options !== undefined ? opt_options : {};\n var hitTolerance = opt_options.hitTolerance !== undefined ?\n opt_options.hitTolerance * this.frameState_.pixelRatio : 0;\n var layerFilter = opt_options.layerFilter !== undefined ?\n opt_options.layerFilter : TRUE;\n var checkWrapped = opt_options.checkWrapped !== false;\n return this.renderer_.forEachFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, callback, null, layerFilter, null);\n };\n /**\n * Get all features that intersect a pixel on the viewport.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {AtPixelOptions=} opt_options Optional options.\n * @return {Array<import(\"./Feature.js\").FeatureLike>} The detected features or\n * an empty array if none were found.\n * @api\n */\n PluggableMap.prototype.getFeaturesAtPixel = function (pixel, opt_options) {\n var features = [];\n this.forEachFeatureAtPixel(pixel, function (feature) {\n features.push(feature);\n }, opt_options);\n return features;\n };\n /**\n * Detect layers that have a color value at a pixel on the viewport, and\n * execute a callback with each matching layer. Layers included in the\n * detection can be configured through `opt_layerFilter`.\n *\n * Note: this may give false positives unless the map layers have had different `className`\n * properties assigned to them.\n *\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {function(this: S, import(\"./layer/Layer.js\").default, (Uint8ClampedArray|Uint8Array)): T} callback\n * Layer callback. This callback will receive two arguments: first is the\n * {@link module:ol/layer/Layer layer}, second argument is an array representing\n * [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types\n * that do not currently support this argument. To stop detection, callback\n * functions can return a truthy value.\n * @param {AtPixelOptions=} opt_options Configuration options.\n * @return {T|undefined} Callback result, i.e. the return value of last\n * callback execution, or the first truthy callback return value.\n * @template S,T\n * @api\n */\n PluggableMap.prototype.forEachLayerAtPixel = function (pixel, callback, opt_options) {\n if (!this.frameState_) {\n return;\n }\n var options = opt_options || {};\n var hitTolerance = options.hitTolerance !== undefined ?\n options.hitTolerance * this.frameState_.pixelRatio : 0;\n var layerFilter = options.layerFilter || TRUE;\n return this.renderer_.forEachLayerAtPixel(pixel, this.frameState_, hitTolerance, callback, layerFilter);\n };\n /**\n * Detect if features intersect a pixel on the viewport. Layers included in the\n * detection can be configured through `opt_layerFilter`.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {AtPixelOptions=} opt_options Optional options.\n * @return {boolean} Is there a feature at the given pixel?\n * @api\n */\n PluggableMap.prototype.hasFeatureAtPixel = function (pixel, opt_options) {\n if (!this.frameState_) {\n return false;\n }\n var coordinate = this.getCoordinateFromPixelInternal(pixel);\n opt_options = opt_options !== undefined ? opt_options : {};\n var layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;\n var hitTolerance = opt_options.hitTolerance !== undefined ?\n opt_options.hitTolerance * this.frameState_.pixelRatio : 0;\n var checkWrapped = opt_options.checkWrapped !== false;\n return this.renderer_.hasFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, layerFilter, null);\n };\n /**\n * Returns the coordinate in user projection for a browser event.\n * @param {Event} event Event.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\n PluggableMap.prototype.getEventCoordinate = function (event) {\n return this.getCoordinateFromPixel(this.getEventPixel(event));\n };\n /**\n * Returns the coordinate in view projection for a browser event.\n * @param {Event} event Event.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n */\n PluggableMap.prototype.getEventCoordinateInternal = function (event) {\n return this.getCoordinateFromPixelInternal(this.getEventPixel(event));\n };\n /**\n * Returns the map pixel position for a browser event relative to the viewport.\n * @param {Event|TouchEvent} event Event.\n * @return {import(\"./pixel.js\").Pixel} Pixel.\n * @api\n */\n PluggableMap.prototype.getEventPixel = function (event) {\n var viewportPosition = this.viewport_.getBoundingClientRect();\n var eventPosition = 'changedTouches' in event ?\n /** @type {TouchEvent} */ (event).changedTouches[0] :\n /** @type {MouseEvent} */ (event);\n return [\n eventPosition.clientX - viewportPosition.left,\n eventPosition.clientY - viewportPosition.top\n ];\n };\n /**\n * Get the target in which this map is rendered.\n * Note that this returns what is entered as an option or in setTarget:\n * if that was an element, it returns an element; if a string, it returns that.\n * @return {HTMLElement|string|undefined} The Element or id of the Element that the\n * map is rendered in.\n * @observable\n * @api\n */\n PluggableMap.prototype.getTarget = function () {\n return /** @type {HTMLElement|string|undefined} */ (this.get(MapProperty.TARGET));\n };\n /**\n * Get the DOM element into which this map is rendered. In contrast to\n * `getTarget` this method always return an `Element`, or `null` if the\n * map has no target.\n * @return {HTMLElement} The element that the map is rendered in.\n * @api\n */\n PluggableMap.prototype.getTargetElement = function () {\n var target = this.getTarget();\n if (target !== undefined) {\n return typeof target === 'string' ? document.getElementById(target) : target;\n }\n else {\n return null;\n }\n };\n /**\n * Get the coordinate for a given pixel. This returns a coordinate in the\n * user projection.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel position in the map viewport.\n * @return {import(\"./coordinate.js\").Coordinate} The coordinate for the pixel position.\n * @api\n */\n PluggableMap.prototype.getCoordinateFromPixel = function (pixel) {\n return toUserCoordinate(this.getCoordinateFromPixelInternal(pixel), this.getView().getProjection());\n };\n /**\n * Get the coordinate for a given pixel. This returns a coordinate in the\n * map view projection.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel position in the map viewport.\n * @return {import(\"./coordinate.js\").Coordinate} The coordinate for the pixel position.\n */\n PluggableMap.prototype.getCoordinateFromPixelInternal = function (pixel) {\n var frameState = this.frameState_;\n if (!frameState) {\n return null;\n }\n else {\n return applyTransform(frameState.pixelToCoordinateTransform, pixel.slice());\n }\n };\n /**\n * Get the map controls. Modifying this collection changes the controls\n * associated with the map.\n * @return {Collection<import(\"./control/Control.js\").default>} Controls.\n * @api\n */\n PluggableMap.prototype.getControls = function () {\n return this.controls;\n };\n /**\n * Get the map overlays. Modifying this collection changes the overlays\n * associated with the map.\n * @return {Collection<import(\"./Overlay.js\").default>} Overlays.\n * @api\n */\n PluggableMap.prototype.getOverlays = function () {\n return this.overlays_;\n };\n /**\n * Get an overlay by its identifier (the value returned by overlay.getId()).\n * Note that the index treats string and numeric identifiers as the same. So\n * `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.\n * @param {string|number} id Overlay identifier.\n * @return {import(\"./Overlay.js\").default} Overlay.\n * @api\n */\n PluggableMap.prototype.getOverlayById = function (id) {\n var overlay = this.overlayIdIndex_[id.toString()];\n return overlay !== undefined ? overlay : null;\n };\n /**\n * Get the map interactions. Modifying this collection changes the interactions\n * associated with the map.\n *\n * Interactions are used for e.g. pan, zoom and rotate.\n * @return {Collection<import(\"./interaction/Interaction.js\").default>} Interactions.\n * @api\n */\n PluggableMap.prototype.getInteractions = function () {\n return this.interactions;\n };\n /**\n * Get the layergroup associated with this map.\n * @return {LayerGroup} A layer group containing the layers in this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.getLayerGroup = function () {\n return (\n /** @type {LayerGroup} */ (this.get(MapProperty.LAYERGROUP)));\n };\n /**\n * Get the collection of layers associated with this map.\n * @return {!Collection<import(\"./layer/Base.js\").default>} Layers.\n * @api\n */\n PluggableMap.prototype.getLayers = function () {\n var layers = this.getLayerGroup().getLayers();\n return layers;\n };\n /**\n * @return {boolean} Layers have sources that are still loading.\n */\n PluggableMap.prototype.getLoading = function () {\n var layerStatesArray = this.getLayerGroup().getLayerStatesArray();\n for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n var layer = layerStatesArray[i].layer;\n var source = /** @type {import(\"./layer/Layer.js\").default} */ (layer).getSource();\n if (source && source.loading) {\n return true;\n }\n }\n return false;\n };\n /**\n * Get the pixel for a coordinate. This takes a coordinate in the user\n * projection and returns the corresponding pixel.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate A map coordinate.\n * @return {import(\"./pixel.js\").Pixel} A pixel position in the map viewport.\n * @api\n */\n PluggableMap.prototype.getPixelFromCoordinate = function (coordinate) {\n var viewCoordinate = fromUserCoordinate(coordinate, this.getView().getProjection());\n return this.getPixelFromCoordinateInternal(viewCoordinate);\n };\n /**\n * Get the pixel for a coordinate. This takes a coordinate in the map view\n * projection and returns the corresponding pixel.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate A map coordinate.\n * @return {import(\"./pixel.js\").Pixel} A pixel position in the map viewport.\n */\n PluggableMap.prototype.getPixelFromCoordinateInternal = function (coordinate) {\n var frameState = this.frameState_;\n if (!frameState) {\n return null;\n }\n else {\n return applyTransform(frameState.coordinateToPixelTransform, coordinate.slice(0, 2));\n }\n };\n /**\n * Get the map renderer.\n * @return {import(\"./renderer/Map.js\").default} Renderer\n */\n PluggableMap.prototype.getRenderer = function () {\n return this.renderer_;\n };\n /**\n * Get the size of this map.\n * @return {import(\"./size.js\").Size|undefined} The size in pixels of the map in the DOM.\n * @observable\n * @api\n */\n PluggableMap.prototype.getSize = function () {\n return (\n /** @type {import(\"./size.js\").Size|undefined} */ (this.get(MapProperty.SIZE)));\n };\n /**\n * Get the view associated with this map. A view manages properties such as\n * center and resolution.\n * @return {View} The view that controls this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.getView = function () {\n return (\n /** @type {View} */ (this.get(MapProperty.VIEW)));\n };\n /**\n * Get the element that serves as the map viewport.\n * @return {HTMLElement} Viewport.\n * @api\n */\n PluggableMap.prototype.getViewport = function () {\n return this.viewport_;\n };\n /**\n * Get the element that serves as the container for overlays. Elements added to\n * this container will let mousedown and touchstart events through to the map,\n * so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}\n * events.\n * @return {!HTMLElement} The map's overlay container.\n */\n PluggableMap.prototype.getOverlayContainer = function () {\n return this.overlayContainer_;\n };\n /**\n * Get the element that serves as a container for overlays that don't allow\n * event propagation. Elements added to this container won't let mousedown and\n * touchstart events through to the map, so clicks and gestures on an overlay\n * don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @return {!HTMLElement} The map's overlay container that stops events.\n */\n PluggableMap.prototype.getOverlayContainerStopEvent = function () {\n return this.overlayContainerStopEvent_;\n };\n /**\n * @param {import(\"./Tile.js\").default} tile Tile.\n * @param {string} tileSourceKey Tile source key.\n * @param {import(\"./coordinate.js\").Coordinate} tileCenter Tile center.\n * @param {number} tileResolution Tile resolution.\n * @return {number} Tile priority.\n */\n PluggableMap.prototype.getTilePriority = function (tile, tileSourceKey, tileCenter, tileResolution) {\n // Filter out tiles at higher zoom levels than the current zoom level, or that\n // are outside the visible extent.\n var frameState = this.frameState_;\n if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {\n return DROP;\n }\n if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {\n return DROP;\n }\n // Prioritize the highest zoom level tiles closest to the focus.\n // Tiles at higher zoom levels are prioritized using Math.log(tileResolution).\n // Within a zoom level, tiles are prioritized by the distance in pixels between\n // the center of the tile and the center of the viewport. The factor of 65536\n // means that the prioritization should behave as desired for tiles up to\n // 65536 * Math.log(2) = 45426 pixels from the focus.\n var center = frameState.viewState.center;\n var deltaX = tileCenter[0] - center[0];\n var deltaY = tileCenter[1] - center[1];\n return 65536 * Math.log(tileResolution) +\n Math.sqrt(deltaX * deltaX + deltaY * deltaY) / tileResolution;\n };\n /**\n * @param {Event} browserEvent Browser event.\n * @param {string=} opt_type Type.\n */\n PluggableMap.prototype.handleBrowserEvent = function (browserEvent, opt_type) {\n var type = opt_type || browserEvent.type;\n var mapBrowserEvent = new MapBrowserEvent(type, this, browserEvent);\n this.handleMapBrowserEvent(mapBrowserEvent);\n };\n /**\n * @param {MapBrowserEvent} mapBrowserEvent The event to handle.\n */\n PluggableMap.prototype.handleMapBrowserEvent = function (mapBrowserEvent) {\n if (!this.frameState_) {\n // With no view defined, we cannot translate pixels into geographical\n // coordinates so interactions cannot be used.\n return;\n }\n var target = mapBrowserEvent.originalEvent.target;\n while (target instanceof HTMLElement) {\n if (target.parentElement === this.overlayContainerStopEvent_) {\n return;\n }\n target = target.parentElement;\n }\n mapBrowserEvent.frameState = this.frameState_;\n var interactionsArray = this.getInteractions().getArray();\n if (this.dispatchEvent(mapBrowserEvent) !== false) {\n for (var i = interactionsArray.length - 1; i >= 0; i--) {\n var interaction = interactionsArray[i];\n if (!interaction.getActive()) {\n continue;\n }\n var cont = interaction.handleEvent(mapBrowserEvent);\n if (!cont) {\n break;\n }\n }\n }\n };\n /**\n * @protected\n */\n PluggableMap.prototype.handlePostRender = function () {\n var frameState = this.frameState_;\n // Manage the tile queue\n // Image loads are expensive and a limited resource, so try to use them\n // efficiently:\n // * When the view is static we allow a large number of parallel tile loads\n // to complete the frame as quickly as possible.\n // * When animating or interacting, image loads can cause janks, so we reduce\n // the maximum number of loads per frame and limit the number of parallel\n // tile loads to remain reactive to view changes and to reduce the chance of\n // loading tiles that will quickly disappear from view.\n var tileQueue = this.tileQueue_;\n if (!tileQueue.isEmpty()) {\n var maxTotalLoading = this.maxTilesLoading_;\n var maxNewLoads = maxTotalLoading;\n if (frameState) {\n var hints = frameState.viewHints;\n if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) {\n var lowOnFrameBudget = !IMAGE_DECODE && Date.now() - frameState.time > 8;\n maxTotalLoading = lowOnFrameBudget ? 0 : 8;\n maxNewLoads = lowOnFrameBudget ? 0 : 2;\n }\n }\n if (tileQueue.getTilesLoading() < maxTotalLoading) {\n tileQueue.reprioritize(); // FIXME only call if view has changed\n tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);\n }\n }\n if (frameState && this.hasListener(RenderEventType.RENDERCOMPLETE) && !frameState.animate &&\n !this.tileQueue_.getTilesLoading() && !this.getLoading()) {\n this.renderer_.dispatchRenderEvent(RenderEventType.RENDERCOMPLETE, frameState);\n }\n var postRenderFunctions = this.postRenderFunctions_;\n for (var i = 0, ii = postRenderFunctions.length; i < ii; ++i) {\n postRenderFunctions[i](this, frameState);\n }\n postRenderFunctions.length = 0;\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleSizeChanged_ = function () {\n if (this.getView()) {\n this.getView().resolveConstraints(0);\n }\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleTargetChanged_ = function () {\n // target may be undefined, null, a string or an Element.\n // If it's a string we convert it to an Element before proceeding.\n // If it's not now an Element we remove the viewport from the DOM.\n // If it's an Element we append the viewport element to it.\n var targetElement;\n if (this.getTarget()) {\n targetElement = this.getTargetElement();\n }\n if (this.focusHandlerKeys_) {\n for (var i = 0, ii = this.focusHandlerKeys_.length; i < ii; ++i) {\n unlistenByKey(this.focusHandlerKeys_[i]);\n }\n this.focusHandlerKeys_ = null;\n }\n if (this.keyHandlerKeys_) {\n for (var i = 0, ii = this.keyHandlerKeys_.length; i < ii; ++i) {\n unlistenByKey(this.keyHandlerKeys_[i]);\n }\n this.keyHandlerKeys_ = null;\n }\n if (!targetElement) {\n if (this.renderer_) {\n clearTimeout(this.postRenderTimeoutHandle_);\n this.postRenderFunctions_.length = 0;\n this.renderer_.dispose();\n this.renderer_ = null;\n }\n if (this.animationDelayKey_) {\n cancelAnimationFrame(this.animationDelayKey_);\n this.animationDelayKey_ = undefined;\n }\n removeNode(this.viewport_);\n if (this.handleResize_ !== undefined) {\n removeEventListener(EventType.RESIZE, this.handleResize_, false);\n this.handleResize_ = undefined;\n }\n }\n else {\n targetElement.appendChild(this.viewport_);\n if (!this.renderer_) {\n this.renderer_ = this.createRenderer();\n }\n var hasFocus = true;\n if (targetElement.hasAttribute('tabindex')) {\n hasFocus = document.activeElement === targetElement;\n this.focusHandlerKeys_ = [\n listen(targetElement, EventType.FOCUS, setTouchAction.bind(this, this.viewport_, 'none')),\n listen(targetElement, EventType.BLUR, setTouchAction.bind(this, this.viewport_, 'auto'))\n ];\n }\n setTouchAction(this.viewport_, hasFocus ? 'none' : 'auto');\n var keyboardEventTarget = !this.keyboardEventTarget_ ?\n targetElement : this.keyboardEventTarget_;\n this.keyHandlerKeys_ = [\n listen(keyboardEventTarget, EventType.KEYDOWN, this.handleBrowserEvent, this),\n listen(keyboardEventTarget, EventType.KEYPRESS, this.handleBrowserEvent, this)\n ];\n if (!this.handleResize_) {\n this.handleResize_ = this.updateSize.bind(this);\n window.addEventListener(EventType.RESIZE, this.handleResize_, false);\n }\n }\n this.updateSize();\n // updateSize calls setSize, so no need to call this.render\n // ourselves here.\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleTileChange_ = function () {\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleViewPropertyChanged_ = function () {\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleViewChanged_ = function () {\n if (this.viewPropertyListenerKey_) {\n unlistenByKey(this.viewPropertyListenerKey_);\n this.viewPropertyListenerKey_ = null;\n }\n if (this.viewChangeListenerKey_) {\n unlistenByKey(this.viewChangeListenerKey_);\n this.viewChangeListenerKey_ = null;\n }\n var view = this.getView();\n if (view) {\n this.viewport_.setAttribute('data-view', getUid(view));\n this.viewPropertyListenerKey_ = listen(view, ObjectEventType.PROPERTYCHANGE, this.handleViewPropertyChanged_, this);\n this.viewChangeListenerKey_ = listen(view, EventType.CHANGE, this.handleViewPropertyChanged_, this);\n view.resolveConstraints(0);\n }\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleLayerGroupChanged_ = function () {\n if (this.layerGroupPropertyListenerKeys_) {\n this.layerGroupPropertyListenerKeys_.forEach(unlistenByKey);\n this.layerGroupPropertyListenerKeys_ = null;\n }\n var layerGroup = this.getLayerGroup();\n if (layerGroup) {\n this.layerGroupPropertyListenerKeys_ = [\n listen(layerGroup, ObjectEventType.PROPERTYCHANGE, this.render, this),\n listen(layerGroup, EventType.CHANGE, this.render, this)\n ];\n }\n this.render();\n };\n /**\n * @return {boolean} Is rendered.\n */\n PluggableMap.prototype.isRendered = function () {\n return !!this.frameState_;\n };\n /**\n * Requests an immediate render in a synchronous manner.\n * @api\n */\n PluggableMap.prototype.renderSync = function () {\n if (this.animationDelayKey_) {\n cancelAnimationFrame(this.animationDelayKey_);\n }\n this.animationDelay_();\n };\n /**\n * Redraws all text after new fonts have loaded\n */\n PluggableMap.prototype.redrawText = function () {\n var layerStates = this.getLayerGroup().getLayerStatesArray();\n for (var i = 0, ii = layerStates.length; i < ii; ++i) {\n var layer = layerStates[i].layer;\n if (layer.hasRenderer()) {\n layer.getRenderer().handleFontsChanged();\n }\n }\n };\n /**\n * Request a map rendering (at the next animation frame).\n * @api\n */\n PluggableMap.prototype.render = function () {\n if (this.renderer_ && this.animationDelayKey_ === undefined) {\n this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_);\n }\n };\n /**\n * Remove the given control from the map.\n * @param {import(\"./control/Control.js\").default} control Control.\n * @return {import(\"./control/Control.js\").default|undefined} The removed control (or undefined\n * if the control was not found).\n * @api\n */\n PluggableMap.prototype.removeControl = function (control) {\n return this.getControls().remove(control);\n };\n /**\n * Remove the given interaction from the map.\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction to remove.\n * @return {import(\"./interaction/Interaction.js\").default|undefined} The removed interaction (or\n * undefined if the interaction was not found).\n * @api\n */\n PluggableMap.prototype.removeInteraction = function (interaction) {\n return this.getInteractions().remove(interaction);\n };\n /**\n * Removes the given layer from the map.\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @return {import(\"./layer/Base.js\").default|undefined} The removed layer (or undefined if the\n * layer was not found).\n * @api\n */\n PluggableMap.prototype.removeLayer = function (layer) {\n var layers = this.getLayerGroup().getLayers();\n return layers.remove(layer);\n };\n /**\n * Remove the given overlay from the map.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @return {import(\"./Overlay.js\").default|undefined} The removed overlay (or undefined\n * if the overlay was not found).\n * @api\n */\n PluggableMap.prototype.removeOverlay = function (overlay) {\n return this.getOverlays().remove(overlay);\n };\n /**\n * @param {number} time Time.\n * @private\n */\n PluggableMap.prototype.renderFrame_ = function (time) {\n var size = this.getSize();\n var view = this.getView();\n var previousFrameState = this.frameState_;\n /** @type {?FrameState} */\n var frameState = null;\n if (size !== undefined && hasArea(size) && view && view.isDef()) {\n var viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);\n var viewState = view.getState();\n frameState = {\n animate: false,\n coordinateToPixelTransform: this.coordinateToPixelTransform_,\n declutterItems: previousFrameState ? previousFrameState.declutterItems : [],\n extent: getForViewAndSize(viewState.center, viewState.resolution, viewState.rotation, size),\n index: this.frameIndex_++,\n layerIndex: 0,\n layerStatesArray: this.getLayerGroup().getLayerStatesArray(),\n pixelRatio: this.pixelRatio_,\n pixelToCoordinateTransform: this.pixelToCoordinateTransform_,\n postRenderFunctions: [],\n size: size,\n tileQueue: this.tileQueue_,\n time: time,\n usedTiles: {},\n viewState: viewState,\n viewHints: viewHints,\n wantedTiles: {}\n };\n }\n this.frameState_ = frameState;\n this.renderer_.renderFrame(frameState);\n if (frameState) {\n if (frameState.animate) {\n this.render();\n }\n Array.prototype.push.apply(this.postRenderFunctions_, frameState.postRenderFunctions);\n if (previousFrameState) {\n var moveStart = !this.previousExtent_ ||\n (!isEmpty(this.previousExtent_) &&\n !equals(frameState.extent, this.previousExtent_));\n if (moveStart) {\n this.dispatchEvent(new MapEvent(MapEventType.MOVESTART, this, previousFrameState));\n this.previousExtent_ = createOrUpdateEmpty(this.previousExtent_);\n }\n }\n var idle = this.previousExtent_ &&\n !frameState.viewHints[ViewHint.ANIMATING] &&\n !frameState.viewHints[ViewHint.INTERACTING] &&\n !equals(frameState.extent, this.previousExtent_);\n if (idle) {\n this.dispatchEvent(new MapEvent(MapEventType.MOVEEND, this, frameState));\n clone(frameState.extent, this.previousExtent_);\n }\n }\n this.dispatchEvent(new MapEvent(MapEventType.POSTRENDER, this, frameState));\n this.postRenderTimeoutHandle_ = setTimeout(this.handlePostRender.bind(this), 0);\n };\n /**\n * Sets the layergroup of this map.\n * @param {LayerGroup} layerGroup A layer group containing the layers in this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.setLayerGroup = function (layerGroup) {\n this.set(MapProperty.LAYERGROUP, layerGroup);\n };\n /**\n * Set the size of this map.\n * @param {import(\"./size.js\").Size|undefined} size The size in pixels of the map in the DOM.\n * @observable\n * @api\n */\n PluggableMap.prototype.setSize = function (size) {\n this.set(MapProperty.SIZE, size);\n };\n /**\n * Set the target element to render this map into.\n * @param {HTMLElement|string|undefined} target The Element or id of the Element\n * that the map is rendered in.\n * @observable\n * @api\n */\n PluggableMap.prototype.setTarget = function (target) {\n this.set(MapProperty.TARGET, target);\n };\n /**\n * Set the view for this map.\n * @param {View} view The view that controls this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.setView = function (view) {\n this.set(MapProperty.VIEW, view);\n };\n /**\n * Force a recalculation of the map viewport size. This should be called when\n * third-party code changes the size of the map viewport.\n * @api\n */\n PluggableMap.prototype.updateSize = function () {\n var targetElement = this.getTargetElement();\n if (!targetElement) {\n this.setSize(undefined);\n }\n else {\n var computedStyle = getComputedStyle(targetElement);\n this.setSize([\n targetElement.offsetWidth -\n parseFloat(computedStyle['borderLeftWidth']) -\n parseFloat(computedStyle['paddingLeft']) -\n parseFloat(computedStyle['paddingRight']) -\n parseFloat(computedStyle['borderRightWidth']),\n targetElement.offsetHeight -\n parseFloat(computedStyle['borderTopWidth']) -\n parseFloat(computedStyle['paddingTop']) -\n parseFloat(computedStyle['paddingBottom']) -\n parseFloat(computedStyle['borderBottomWidth'])\n ]);\n }\n };\n return PluggableMap;\n}(BaseObject));\n/**\n * @param {MapOptions} options Map options.\n * @return {MapOptionsInternal} Internal map options.\n */\nfunction createOptionsInternal(options) {\n /**\n * @type {HTMLElement|Document}\n */\n var keyboardEventTarget = null;\n if (options.keyboardEventTarget !== undefined) {\n keyboardEventTarget = typeof options.keyboardEventTarget === 'string' ?\n document.getElementById(options.keyboardEventTarget) :\n options.keyboardEventTarget;\n }\n /**\n * @type {Object<string, *>}\n */\n var values = {};\n var layerGroup = options.layers && typeof /** @type {?} */ (options.layers).getLayers === 'function' ?\n /** @type {LayerGroup} */ (options.layers) : new LayerGroup({ layers: /** @type {Collection} */ (options.layers) });\n values[MapProperty.LAYERGROUP] = layerGroup;\n values[MapProperty.TARGET] = options.target;\n values[MapProperty.VIEW] = options.view !== undefined ?\n options.view : new View();\n var controls;\n if (options.controls !== undefined) {\n if (Array.isArray(options.controls)) {\n controls = new Collection(options.controls.slice());\n }\n else {\n assert(typeof /** @type {?} */ (options.controls).getArray === 'function', 47); // Expected `controls` to be an array or an `import(\"./Collection.js\").Collection`\n controls = /** @type {Collection} */ (options.controls);\n }\n }\n var interactions;\n if (options.interactions !== undefined) {\n if (Array.isArray(options.interactions)) {\n interactions = new Collection(options.interactions.slice());\n }\n else {\n assert(typeof /** @type {?} */ (options.interactions).getArray === 'function', 48); // Expected `interactions` to be an array or an `import(\"./Collection.js\").Collection`\n interactions = /** @type {Collection} */ (options.interactions);\n }\n }\n var overlays;\n if (options.overlays !== undefined) {\n if (Array.isArray(options.overlays)) {\n overlays = new Collection(options.overlays.slice());\n }\n else {\n assert(typeof /** @type {?} */ (options.overlays).getArray === 'function', 49); // Expected `overlays` to be an array or an `import(\"./Collection.js\").Collection`\n overlays = options.overlays;\n }\n }\n else {\n overlays = new Collection();\n }\n return {\n controls: controls,\n interactions: interactions,\n keyboardEventTarget: keyboardEventTarget,\n overlays: overlays,\n values: values\n };\n}\nexport default PluggableMap;\n//# sourceMappingURL=PluggableMap.js.map","/**\n * @module ol/css\n */\n/**\n * @typedef {Object} FontParameters\n * @property {Array<string>} families\n * @property {string} style\n * @property {string} weight\n */\n/**\n * The CSS class for hidden feature.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_HIDDEN = 'ol-hidden';\n/**\n * The CSS class that we'll give the DOM elements to have them selectable.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_SELECTABLE = 'ol-selectable';\n/**\n * The CSS class that we'll give the DOM elements to have them unselectable.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_UNSELECTABLE = 'ol-unselectable';\n/**\n * The CSS class for unsupported feature.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_UNSUPPORTED = 'ol-unsupported';\n/**\n * The CSS class for controls.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_CONTROL = 'ol-control';\n/**\n * The CSS class that we'll give the DOM elements that are collapsed, i.e.\n * to those elements which usually can be expanded.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_COLLAPSED = 'ol-collapsed';\n/**\n * Get the list of font families from a font spec. Note that this doesn't work\n * for font families that have commas in them.\n * @param {string} The CSS font property.\n * @return {FontParameters} The font families (or null if the input spec is invalid).\n */\nexport var getFontParameters = (function () {\n /**\n * @type {CSSStyleDeclaration}\n */\n var style;\n /**\n * @type {Object<string, FontParameters>}\n */\n var cache = {};\n return function (font) {\n if (!style) {\n style = document.createElement('div').style;\n }\n if (!(font in cache)) {\n style.font = font;\n var family = style.fontFamily;\n var fontWeight = style.fontWeight;\n var fontStyle = style.fontStyle;\n style.font = '';\n if (!family) {\n return null;\n }\n var families = family.split(/,\\s?/);\n cache[font] = {\n families: families,\n weight: fontWeight,\n style: fontStyle\n };\n }\n return cache[font];\n };\n})();\n//# sourceMappingURL=css.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Control\n */\nimport { VOID } from '../functions.js';\nimport MapEventType from '../MapEventType.js';\nimport BaseObject from '../Object.js';\nimport { removeNode } from '../dom.js';\nimport { listen, unlistenByKey } from '../events.js';\n/**\n * @typedef {Object} Options\n * @property {HTMLElement} [element] The element is the control's\n * container element. This only needs to be specified if you're developing\n * a custom control.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when\n * the control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n * @property {HTMLElement|string} [target] Specify a target if you want\n * the control to be rendered outside of the map's viewport.\n */\n/**\n * @classdesc\n * A control is a visible widget with a DOM element in a fixed position on the\n * screen. They can involve user input (buttons), or be informational only;\n * the position is determined using CSS. By default these are placed in the\n * container with CSS class name `ol-overlaycontainer-stopevent`, but can use\n * any outside DOM element.\n *\n * This is the base class for controls. You can use it for simple custom\n * controls by creating the element with listeners, creating an instance:\n * ```js\n * var myControl = new Control({element: myElement});\n * ```\n * and then adding this to the map.\n *\n * The main advantage of having this as a control rather than a simple separate\n * DOM element is that preventing propagation is handled for you. Controls\n * will also be objects in a {@link module:ol/Collection~Collection}, so you can use their methods.\n *\n * You can also extend this base for your own control class. See\n * examples/custom-controls for an example of how to do this.\n *\n * @api\n */\nvar Control = /** @class */ (function (_super) {\n __extends(Control, _super);\n /**\n * @param {Options} options Control options.\n */\n function Control(options) {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {HTMLElement}\n */\n _this.element = options.element ? options.element : null;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.target_ = null;\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = null;\n /**\n * @protected\n * @type {!Array<import(\"../events.js\").EventsKey>}\n */\n _this.listenerKeys = [];\n /**\n * @type {function(import(\"../MapEvent.js\").default): void}\n */\n _this.render = options.render ? options.render : VOID;\n if (options.target) {\n _this.setTarget(options.target);\n }\n return _this;\n }\n /**\n * @inheritDoc\n */\n Control.prototype.disposeInternal = function () {\n removeNode(this.element);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Get the map associated with this control.\n * @return {import(\"../PluggableMap.js\").default} Map.\n * @api\n */\n Control.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @api\n */\n Control.prototype.setMap = function (map) {\n if (this.map_) {\n removeNode(this.element);\n }\n for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {\n unlistenByKey(this.listenerKeys[i]);\n }\n this.listenerKeys.length = 0;\n this.map_ = map;\n if (this.map_) {\n var target = this.target_ ?\n this.target_ : map.getOverlayContainerStopEvent();\n target.appendChild(this.element);\n if (this.render !== VOID) {\n this.listenerKeys.push(listen(map, MapEventType.POSTRENDER, this.render, this));\n }\n map.render();\n }\n };\n /**\n * This function is used to set a target element for the control. It has no\n * effect if it is called after the control has been added to the map (i.e.\n * after `setMap` is called on the control). If no `target` is set in the\n * options passed to the control constructor and if `setTarget` is not called\n * then the control is added to the map's overlay container.\n * @param {HTMLElement|string} target Target.\n * @api\n */\n Control.prototype.setTarget = function (target) {\n this.target_ = typeof target === 'string' ?\n document.getElementById(target) :\n target;\n };\n return Control;\n}(BaseObject));\nexport default Control;\n//# sourceMappingURL=Control.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Layer\n */\nimport { listen, unlistenByKey } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { getChangeEventType } from '../Object.js';\nimport BaseLayer from './Base.js';\nimport LayerProperty from './Property.js';\nimport { assign } from '../obj.js';\nimport RenderEventType from '../render/EventType.js';\nimport SourceState from '../source/State.js';\n/**\n * @typedef {function(import(\"../PluggableMap.js\").FrameState):HTMLElement} RenderFunction\n */\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {import(\"../source/Source.js\").default} [source] Source for this layer. If not provided to the constructor,\n * the source can be set by calling {@link module:ol/layer/Layer#setSource layer.setSource(source)} after\n * construction.\n * @property {import(\"../PluggableMap.js\").default} [map] Map.\n * @property {RenderFunction} [render] Render function. Takes the frame state as input and is expected to return an\n * HTML element. Will overwrite the default rendering for the layer.\n */\n/**\n * @typedef {Object} State\n * @property {import(\"./Base.js\").default} layer\n * @property {number} opacity Opacity, the value is rounded to two digits to appear after the decimal point.\n * @property {SourceState} sourceState\n * @property {boolean} visible\n * @property {boolean} managed\n * @property {import(\"../extent.js\").Extent} [extent]\n * @property {number} zIndex\n * @property {number} maxResolution\n * @property {number} minResolution\n * @property {number} minZoom\n * @property {number} maxZoom\n */\n/**\n * @classdesc\n * Base class from which all layer types are derived. This should only be instantiated\n * in the case where a custom layer is be added to the map with a custom `render` function.\n * Such a function can be specified in the `options` object, and is expected to return an HTML element.\n *\n * A visual representation of raster or vector map data.\n * Layers group together those properties that pertain to how the data is to be\n * displayed, irrespective of the source of that data.\n *\n * Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components\n * like {@link module:ol/interaction/Select~Select} use unmanaged layers\n * internally. These unmanaged layers are associated with the map using\n * {@link module:ol/layer/Layer~Layer#setMap} instead.\n *\n * A generic `change` event is fired when the state of the source changes.\n *\n * Please note that for performance reasons several layers might get rendered to\n * the same HTML element, which will cause {@link module:ol/Map~Map#forEachLayerAtPixel} to\n * give false positives. To avoid this, apply different `className` properties to the\n * layers at creation time.\n *\n * @fires import(\"../render/Event.js\").RenderEvent#prerender\n * @fires import(\"../render/Event.js\").RenderEvent#postrender\n *\n * @template {import(\"../source/Source.js\").default} SourceType\n * @api\n */\nvar Layer = /** @class */ (function (_super) {\n __extends(Layer, _super);\n /**\n * @param {Options} options Layer options.\n */\n function Layer(options) {\n var _this = this;\n var baseOptions = assign({}, options);\n delete baseOptions.source;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.mapPrecomposeKey_ = null;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.mapRenderKey_ = null;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.sourceChangeKey_ = null;\n /**\n * @private\n * @type {import(\"../renderer/Layer.js\").default}\n */\n _this.renderer_ = null;\n // Overwrite default render method with a custom one\n if (options.render) {\n _this.render = options.render;\n }\n if (options.map) {\n _this.setMap(options.map);\n }\n _this.addEventListener(getChangeEventType(LayerProperty.SOURCE), _this.handleSourcePropertyChange_);\n var source = options.source ? /** @type {SourceType} */ (options.source) : null;\n _this.setSource(source);\n return _this;\n }\n /**\n * @inheritDoc\n */\n Layer.prototype.getLayersArray = function (opt_array) {\n var array = opt_array ? opt_array : [];\n array.push(this);\n return array;\n };\n /**\n * @inheritDoc\n */\n Layer.prototype.getLayerStatesArray = function (opt_states) {\n var states = opt_states ? opt_states : [];\n states.push(this.getLayerState());\n return states;\n };\n /**\n * Get the layer source.\n * @return {SourceType} The layer source (or `null` if not yet set).\n * @observable\n * @api\n */\n Layer.prototype.getSource = function () {\n return /** @type {SourceType} */ (this.get(LayerProperty.SOURCE)) || null;\n };\n /**\n * @inheritDoc\n */\n Layer.prototype.getSourceState = function () {\n var source = this.getSource();\n return !source ? SourceState.UNDEFINED : source.getState();\n };\n /**\n * @private\n */\n Layer.prototype.handleSourceChange_ = function () {\n this.changed();\n };\n /**\n * @private\n */\n Layer.prototype.handleSourcePropertyChange_ = function () {\n if (this.sourceChangeKey_) {\n unlistenByKey(this.sourceChangeKey_);\n this.sourceChangeKey_ = null;\n }\n var source = this.getSource();\n if (source) {\n this.sourceChangeKey_ = listen(source, EventType.CHANGE, this.handleSourceChange_, this);\n }\n this.changed();\n };\n /**\n * @param {import(\"../pixel\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").default>>} Promise that resolves with\n * an array of features.\n */\n Layer.prototype.getFeatures = function (pixel) {\n return this.renderer_.getFeatures(pixel);\n };\n /**\n * In charge to manage the rendering of the layer. One layer type is\n * bounded with one layer renderer.\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {HTMLElement} target Target which the renderer may (but need not) use\n * for rendering its content.\n * @return {HTMLElement} The rendered element.\n */\n Layer.prototype.render = function (frameState, target) {\n var layerRenderer = this.getRenderer();\n if (layerRenderer.prepareFrame(frameState)) {\n return layerRenderer.renderFrame(frameState, target);\n }\n };\n /**\n * Sets the layer to be rendered on top of other layers on a map. The map will\n * not manage this layer in its layers collection, and the callback in\n * {@link module:ol/Map#forEachLayerAtPixel} will receive `null` as layer. This\n * is useful for temporary layers. To remove an unmanaged layer from the map,\n * use `#setMap(null)`.\n *\n * To add the layer to a map and have it managed by the map, use\n * {@link module:ol/Map#addLayer} instead.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @api\n */\n Layer.prototype.setMap = function (map) {\n if (this.mapPrecomposeKey_) {\n unlistenByKey(this.mapPrecomposeKey_);\n this.mapPrecomposeKey_ = null;\n }\n if (!map) {\n this.changed();\n }\n if (this.mapRenderKey_) {\n unlistenByKey(this.mapRenderKey_);\n this.mapRenderKey_ = null;\n }\n if (map) {\n this.mapPrecomposeKey_ = listen(map, RenderEventType.PRECOMPOSE, function (evt) {\n var renderEvent = /** @type {import(\"../render/Event.js\").default} */ (evt);\n renderEvent.frameState.layerStatesArray.push(this.getLayerState(false));\n }, this);\n this.mapRenderKey_ = listen(this, EventType.CHANGE, map.render, map);\n this.changed();\n }\n };\n /**\n * Set the layer source.\n * @param {SourceType} source The layer source.\n * @observable\n * @api\n */\n Layer.prototype.setSource = function (source) {\n this.set(LayerProperty.SOURCE, source);\n };\n /**\n * Get the renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} The layer renderer.\n */\n Layer.prototype.getRenderer = function () {\n if (!this.renderer_) {\n this.renderer_ = this.createRenderer();\n }\n return this.renderer_;\n };\n /**\n * @return {boolean} The layer has a renderer.\n */\n Layer.prototype.hasRenderer = function () {\n return !!this.renderer_;\n };\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n Layer.prototype.createRenderer = function () {\n return null;\n };\n /**\n * @inheritDoc\n */\n Layer.prototype.disposeInternal = function () {\n this.setSource(null);\n _super.prototype.disposeInternal.call(this);\n };\n return Layer;\n}(BaseLayer));\n/**\n * Return `true` if the layer is visible and if the provided view state\n * has resolution and zoom levels that are in range of the layer's min/max.\n * @param {State} layerState Layer state.\n * @param {import(\"../View.js\").State} viewState View state.\n * @return {boolean} The layer is visible at the given view state.\n */\nexport function inView(layerState, viewState) {\n if (!layerState.visible) {\n return false;\n }\n var resolution = viewState.resolution;\n if (resolution < layerState.minResolution || resolution >= layerState.maxResolution) {\n return false;\n }\n var zoom = viewState.zoom;\n return zoom > layerState.minZoom && zoom <= layerState.maxZoom;\n}\nexport default Layer;\n//# sourceMappingURL=Layer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Attribution\n */\nimport { equals } from '../array.js';\nimport Control from './Control.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE, CLASS_COLLAPSED } from '../css.js';\nimport { removeChildren, replaceNode } from '../dom.js';\nimport EventType from '../events/EventType.js';\nimport { inView } from '../layer/Layer.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-attribution'] CSS class name.\n * @property {HTMLElement|string} [target] Specify a target if you\n * want the control to be rendered outside of the map's\n * viewport.\n * @property {boolean} [collapsible] Specify if attributions can\n * be collapsed. If not specified, sources control this behavior with their\n * `attributionsCollapsible` setting.\n * @property {boolean} [collapsed=true] Specify if attributions should\n * be collapsed at startup.\n * @property {string} [tipLabel='Attributions'] Text label to use for the button tip.\n * @property {string} [label='i'] Text label to use for the\n * collapsed attributions button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string|HTMLElement} [collapseLabel='»'] Text label to use\n * for the expanded attributions button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when\n * the control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n */\n/**\n * @classdesc\n * Control to show all the attributions associated with the layer sources\n * in the map. This control is one of the default controls included in maps.\n * By default it will show in the bottom right portion of the map, but this can\n * be changed by using a css selector for `.ol-attribution`.\n *\n * @api\n */\nvar Attribution = /** @class */ (function (_super) {\n __extends(Attribution, _super);\n /**\n * @param {Options=} opt_options Attribution options.\n */\n function Attribution(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render || render,\n target: options.target\n }) || this;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.ulElement_ = document.createElement('ul');\n /**\n * @private\n * @type {boolean}\n */\n _this.collapsed_ = options.collapsed !== undefined ? options.collapsed : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.overrideCollapsible_ = options.collapsible !== undefined;\n /**\n * @private\n * @type {boolean}\n */\n _this.collapsible_ = options.collapsible !== undefined ?\n options.collapsible : true;\n if (!_this.collapsible_) {\n _this.collapsed_ = false;\n }\n var className = options.className !== undefined ? options.className : 'ol-attribution';\n var tipLabel = options.tipLabel !== undefined ? options.tipLabel : 'Attributions';\n var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\\u00BB';\n if (typeof collapseLabel === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.collapseLabel_ = document.createElement('span');\n _this.collapseLabel_.textContent = collapseLabel;\n }\n else {\n _this.collapseLabel_ = collapseLabel;\n }\n var label = options.label !== undefined ? options.label : 'i';\n if (typeof label === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.label_ = document.createElement('span');\n _this.label_.textContent = label;\n }\n else {\n _this.label_ = label;\n }\n var activeLabel = (_this.collapsible_ && !_this.collapsed_) ?\n _this.collapseLabel_ : _this.label_;\n var button = document.createElement('button');\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(activeLabel);\n button.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL +\n (_this.collapsed_ && _this.collapsible_ ? ' ' + CLASS_COLLAPSED : '') +\n (_this.collapsible_ ? '' : ' ol-uncollapsible');\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(_this.ulElement_);\n element.appendChild(button);\n /**\n * A list of currently rendered resolutions.\n * @type {Array<string>}\n * @private\n */\n _this.renderedAttributions_ = [];\n /**\n * @private\n * @type {boolean}\n */\n _this.renderedVisible_ = true;\n return _this;\n }\n /**\n * Collect a list of visible attributions and set the collapsible state.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @return {Array<string>} Attributions.\n * @private\n */\n Attribution.prototype.collectSourceAttributions_ = function (frameState) {\n /**\n * Used to determine if an attribution already exists.\n * @type {!Object<string, boolean>}\n */\n var lookup = {};\n /**\n * A list of visible attributions.\n * @type {Array<string>}\n */\n var visibleAttributions = [];\n var layerStatesArray = frameState.layerStatesArray;\n for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n var layerState = layerStatesArray[i];\n if (!inView(layerState, frameState.viewState)) {\n continue;\n }\n var source = /** @type {import(\"../layer/Layer.js\").default} */ (layerState.layer).getSource();\n if (!source) {\n continue;\n }\n var attributionGetter = source.getAttributions();\n if (!attributionGetter) {\n continue;\n }\n var attributions = attributionGetter(frameState);\n if (!attributions) {\n continue;\n }\n if (!this.overrideCollapsible_ && source.getAttributionsCollapsible() === false) {\n this.setCollapsible(false);\n }\n if (Array.isArray(attributions)) {\n for (var j = 0, jj = attributions.length; j < jj; ++j) {\n if (!(attributions[j] in lookup)) {\n visibleAttributions.push(attributions[j]);\n lookup[attributions[j]] = true;\n }\n }\n }\n else {\n if (!(attributions in lookup)) {\n visibleAttributions.push(attributions);\n lookup[attributions] = true;\n }\n }\n }\n return visibleAttributions;\n };\n /**\n * @private\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n Attribution.prototype.updateElement_ = function (frameState) {\n if (!frameState) {\n if (this.renderedVisible_) {\n this.element.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n var attributions = this.collectSourceAttributions_(frameState);\n var visible = attributions.length > 0;\n if (this.renderedVisible_ != visible) {\n this.element.style.display = visible ? '' : 'none';\n this.renderedVisible_ = visible;\n }\n if (equals(attributions, this.renderedAttributions_)) {\n return;\n }\n removeChildren(this.ulElement_);\n // append the attributions\n for (var i = 0, ii = attributions.length; i < ii; ++i) {\n var element = document.createElement('li');\n element.innerHTML = attributions[i];\n this.ulElement_.appendChild(element);\n }\n this.renderedAttributions_ = attributions;\n };\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n Attribution.prototype.handleClick_ = function (event) {\n event.preventDefault();\n this.handleToggle_();\n };\n /**\n * @private\n */\n Attribution.prototype.handleToggle_ = function () {\n this.element.classList.toggle(CLASS_COLLAPSED);\n if (this.collapsed_) {\n replaceNode(this.collapseLabel_, this.label_);\n }\n else {\n replaceNode(this.label_, this.collapseLabel_);\n }\n this.collapsed_ = !this.collapsed_;\n };\n /**\n * Return `true` if the attribution is collapsible, `false` otherwise.\n * @return {boolean} True if the widget is collapsible.\n * @api\n */\n Attribution.prototype.getCollapsible = function () {\n return this.collapsible_;\n };\n /**\n * Set whether the attribution should be collapsible.\n * @param {boolean} collapsible True if the widget is collapsible.\n * @api\n */\n Attribution.prototype.setCollapsible = function (collapsible) {\n if (this.collapsible_ === collapsible) {\n return;\n }\n this.collapsible_ = collapsible;\n this.element.classList.toggle('ol-uncollapsible');\n if (!collapsible && this.collapsed_) {\n this.handleToggle_();\n }\n };\n /**\n * Collapse or expand the attribution according to the passed parameter. Will\n * not do anything if the attribution isn't collapsible or if the current\n * collapsed state is already the one requested.\n * @param {boolean} collapsed True if the widget is collapsed.\n * @api\n */\n Attribution.prototype.setCollapsed = function (collapsed) {\n if (!this.collapsible_ || this.collapsed_ === collapsed) {\n return;\n }\n this.handleToggle_();\n };\n /**\n * Return `true` when the attribution is currently collapsed or `false`\n * otherwise.\n * @return {boolean} True if the widget is collapsed.\n * @api\n */\n Attribution.prototype.getCollapsed = function () {\n return this.collapsed_;\n };\n return Attribution;\n}(Control));\n/**\n * Update the attribution element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @this {Attribution}\n * @api\n */\nexport function render(mapEvent) {\n this.updateElement_(mapEvent.frameState);\n}\nexport default Attribution;\n//# sourceMappingURL=Attribution.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Rotate\n */\nimport Control from './Control.js';\nimport { CLASS_CONTROL, CLASS_HIDDEN, CLASS_UNSELECTABLE } from '../css.js';\nimport { easeOut } from '../easing.js';\nimport EventType from '../events/EventType.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-rotate'] CSS class name.\n * @property {string|HTMLElement} [label='⇧'] Text label to use for the rotate button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {boolean} [autoHide=true] Hide the control when rotation is 0.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when the control should\n * be re-rendered. This is called in a `requestAnimationFrame` callback.\n * @property {function()} [resetNorth] Function called when the control is clicked.\n * This will override the default `resetNorth`.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n/**\n * @classdesc\n * A button control to reset rotation to 0.\n * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css\n * selector is added to the button when the rotation is 0.\n *\n * @api\n */\nvar Rotate = /** @class */ (function (_super) {\n __extends(Rotate, _super);\n /**\n * @param {Options=} opt_options Rotate options.\n */\n function Rotate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render || render,\n target: options.target\n }) || this;\n var className = options.className !== undefined ? options.className : 'ol-rotate';\n var label = options.label !== undefined ? options.label : '\\u21E7';\n /**\n * @type {HTMLElement}\n * @private\n */\n _this.label_ = null;\n if (typeof label === 'string') {\n _this.label_ = document.createElement('span');\n _this.label_.className = 'ol-compass';\n _this.label_.textContent = label;\n }\n else {\n _this.label_ = label;\n _this.label_.classList.add('ol-compass');\n }\n var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';\n var button = document.createElement('button');\n button.className = className + '-reset';\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(_this.label_);\n button.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(button);\n _this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;\n /**\n * @type {number}\n * @private\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n /**\n * @type {boolean}\n * @private\n */\n _this.autoHide_ = options.autoHide !== undefined ? options.autoHide : true;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.rotation_ = undefined;\n if (_this.autoHide_) {\n _this.element.classList.add(CLASS_HIDDEN);\n }\n return _this;\n }\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n Rotate.prototype.handleClick_ = function (event) {\n event.preventDefault();\n if (this.callResetNorth_ !== undefined) {\n this.callResetNorth_();\n }\n else {\n this.resetNorth_();\n }\n };\n /**\n * @private\n */\n Rotate.prototype.resetNorth_ = function () {\n var map = this.getMap();\n var view = map.getView();\n if (!view) {\n // the map does not have a view, so we can't act\n // upon it\n return;\n }\n if (view.getRotation() !== undefined) {\n if (this.duration_ > 0) {\n view.animate({\n rotation: 0,\n duration: this.duration_,\n easing: easeOut\n });\n }\n else {\n view.setRotation(0);\n }\n }\n };\n return Rotate;\n}(Control));\n/**\n * Update the rotate control element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @this {Rotate}\n * @api\n */\nexport function render(mapEvent) {\n var frameState = mapEvent.frameState;\n if (!frameState) {\n return;\n }\n var rotation = frameState.viewState.rotation;\n if (rotation != this.rotation_) {\n var transform = 'rotate(' + rotation + 'rad)';\n if (this.autoHide_) {\n var contains = this.element.classList.contains(CLASS_HIDDEN);\n if (!contains && rotation === 0) {\n this.element.classList.add(CLASS_HIDDEN);\n }\n else if (contains && rotation !== 0) {\n this.element.classList.remove(CLASS_HIDDEN);\n }\n }\n this.label_.style.transform = transform;\n }\n this.rotation_ = rotation;\n}\nexport default Rotate;\n//# sourceMappingURL=Rotate.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Zoom\n */\nimport EventType from '../events/EventType.js';\nimport Control from './Control.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE } from '../css.js';\nimport { easeOut } from '../easing.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {string} [className='ol-zoom'] CSS class name.\n * @property {string|HTMLElement} [zoomInLabel='+'] Text label to use for the zoom-in\n * button. Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string|HTMLElement} [zoomOutLabel='-'] Text label to use for the zoom-out button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [zoomInTipLabel='Zoom in'] Text label to use for the button tip.\n * @property {string} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip.\n * @property {number} [delta=1] The zoom delta applied on each click.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n/**\n * @classdesc\n * A control with 2 buttons, one for zoom in and one for zoom out.\n * This control is one of the default controls of a map. To style this control\n * use css selectors `.ol-zoom-in` and `.ol-zoom-out`.\n *\n * @api\n */\nvar Zoom = /** @class */ (function (_super) {\n __extends(Zoom, _super);\n /**\n * @param {Options=} opt_options Zoom options.\n */\n function Zoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n target: options.target\n }) || this;\n var className = options.className !== undefined ? options.className : 'ol-zoom';\n var delta = options.delta !== undefined ? options.delta : 1;\n var zoomInLabel = options.zoomInLabel !== undefined ? options.zoomInLabel : '+';\n var zoomOutLabel = options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\\u2212';\n var zoomInTipLabel = options.zoomInTipLabel !== undefined ?\n options.zoomInTipLabel : 'Zoom in';\n var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?\n options.zoomOutTipLabel : 'Zoom out';\n var inElement = document.createElement('button');\n inElement.className = className + '-in';\n inElement.setAttribute('type', 'button');\n inElement.title = zoomInTipLabel;\n inElement.appendChild(typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel);\n inElement.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this, delta), false);\n var outElement = document.createElement('button');\n outElement.className = className + '-out';\n outElement.setAttribute('type', 'button');\n outElement.title = zoomOutTipLabel;\n outElement.appendChild(typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel);\n outElement.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this, -delta), false);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(inElement);\n element.appendChild(outElement);\n /**\n * @type {number}\n * @private\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n /**\n * @param {number} delta Zoom delta.\n * @param {MouseEvent} event The event to handle\n * @private\n */\n Zoom.prototype.handleClick_ = function (delta, event) {\n event.preventDefault();\n this.zoomByDelta_(delta);\n };\n /**\n * @param {number} delta Zoom delta.\n * @private\n */\n Zoom.prototype.zoomByDelta_ = function (delta) {\n var map = this.getMap();\n var view = map.getView();\n if (!view) {\n // the map does not have a view, so we can't act\n // upon it\n return;\n }\n var currentZoom = view.getZoom();\n if (currentZoom !== undefined) {\n var newZoom = view.getConstrainedZoom(currentZoom + delta);\n if (this.duration_ > 0) {\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n zoom: newZoom,\n duration: this.duration_,\n easing: easeOut\n });\n }\n else {\n view.setZoom(newZoom);\n }\n }\n };\n return Zoom;\n}(Control));\nexport default Zoom;\n//# sourceMappingURL=Zoom.js.map","/**\n * @module ol/control\n */\nimport Collection from './Collection.js';\nimport Attribution from './control/Attribution.js';\nimport Rotate from './control/Rotate.js';\nimport Zoom from './control/Zoom.js';\nexport { default as Attribution } from './control/Attribution.js';\nexport { default as Control } from './control/Control.js';\nexport { default as FullScreen } from './control/FullScreen.js';\nexport { default as MousePosition } from './control/MousePosition.js';\nexport { default as OverviewMap } from './control/OverviewMap.js';\nexport { default as Rotate } from './control/Rotate.js';\nexport { default as ScaleLine } from './control/ScaleLine.js';\nexport { default as Zoom } from './control/Zoom.js';\nexport { default as ZoomSlider } from './control/ZoomSlider.js';\nexport { default as ZoomToExtent } from './control/ZoomToExtent.js';\n/**\n * @typedef {Object} DefaultsOptions\n * @property {boolean} [attribution=true] Include\n * {@link module:ol/control/Attribution~Attribution}.\n * @property {import(\"./control/Attribution.js\").Options} [attributionOptions]\n * Options for {@link module:ol/control/Attribution~Attribution}.\n * @property {boolean} [rotate=true] Include\n * {@link module:ol/control/Rotate~Rotate}.\n * @property {import(\"./control/Rotate.js\").Options} [rotateOptions] Options\n * for {@link module:ol/control/Rotate~Rotate}.\n * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.\n * @property {import(\"./control/Zoom.js\").Options} [zoomOptions] Options for\n * {@link module:ol/control/Zoom~Zoom}.\n * @api\n */\n/**\n * Set of controls included in maps by default. Unless configured otherwise,\n * this returns a collection containing an instance of each of the following\n * controls:\n * * {@link module:ol/control/Zoom~Zoom}\n * * {@link module:ol/control/Rotate~Rotate}\n * * {@link module:ol/control/Attribution~Attribution}\n *\n * @param {DefaultsOptions=} opt_options\n * Defaults options.\n * @return {Collection<import(\"./control/Control.js\").default>}\n * Controls.\n * @api\n */\nexport function defaults(opt_options) {\n var options = opt_options ? opt_options : {};\n var controls = new Collection();\n var zoomControl = options.zoom !== undefined ? options.zoom : true;\n if (zoomControl) {\n controls.push(new Zoom(options.zoomOptions));\n }\n var rotateControl = options.rotate !== undefined ? options.rotate : true;\n if (rotateControl) {\n controls.push(new Rotate(options.rotateOptions));\n }\n var attributionControl = options.attribution !== undefined ?\n options.attribution : true;\n if (attributionControl) {\n controls.push(new Attribution(options.attributionOptions));\n }\n return controls;\n}\n//# sourceMappingURL=control.js.map","/**\n * @module ol/interaction/Property\n */\n/**\n * @enum {string}\n */\nexport default {\n ACTIVE: 'active'\n};\n//# sourceMappingURL=Property.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Interaction\n */\nimport BaseObject from '../Object.js';\nimport { easeOut, linear } from '../easing.js';\nimport InteractionProperty from './Property.js';\n/**\n * Object literal with config options for interactions.\n * @typedef {Object} InteractionOptions\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} handleEvent\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. If the function returns a falsy value, propagation of\n * the event to other interactions in the map's interactions chain will be\n * prevented (this includes functions with no explicit return). The interactions\n * are traversed in reverse order of the interactions collection of the map.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * User actions that change the state of the map. Some are similar to controls,\n * but are not associated with a DOM element.\n * For example, {@link module:ol/interaction/KeyboardZoom~KeyboardZoom} is\n * functionally the same as {@link module:ol/control/Zoom~Zoom}, but triggered\n * by a keyboard event not a button element event.\n * Although interactions do not have a DOM element, some of them do render\n * vectors and so are visible on the screen.\n * @api\n */\nvar Interaction = /** @class */ (function (_super) {\n __extends(Interaction, _super);\n /**\n * @param {InteractionOptions} options Options.\n */\n function Interaction(options) {\n var _this = _super.call(this) || this;\n if (options.handleEvent) {\n _this.handleEvent = options.handleEvent;\n }\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = null;\n _this.setActive(true);\n return _this;\n }\n /**\n * Return whether the interaction is currently active.\n * @return {boolean} `true` if the interaction is active, `false` otherwise.\n * @observable\n * @api\n */\n Interaction.prototype.getActive = function () {\n return /** @type {boolean} */ (this.get(InteractionProperty.ACTIVE));\n };\n /**\n * Get the map associated with this interaction.\n * @return {import(\"../PluggableMap.js\").default} Map.\n * @api\n */\n Interaction.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event}.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n Interaction.prototype.handleEvent = function (mapBrowserEvent) {\n return true;\n };\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n Interaction.prototype.setActive = function (active) {\n this.set(InteractionProperty.ACTIVE, active);\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n Interaction.prototype.setMap = function (map) {\n this.map_ = map;\n };\n return Interaction;\n}(BaseObject));\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {import(\"../coordinate.js\").Coordinate} delta Delta.\n * @param {number=} opt_duration Duration.\n */\nexport function pan(view, delta, opt_duration) {\n var currentCenter = view.getCenterInternal();\n if (currentCenter) {\n var center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];\n view.animateInternal({\n duration: opt_duration !== undefined ? opt_duration : 250,\n easing: linear,\n center: view.getConstrainedCenter(center)\n });\n }\n}\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {number} delta Delta from previous zoom level.\n * @param {import(\"../coordinate.js\").Coordinate=} opt_anchor Anchor coordinate in the user projection.\n * @param {number=} opt_duration Duration.\n */\nexport function zoomByDelta(view, delta, opt_anchor, opt_duration) {\n var currentZoom = view.getZoom();\n if (currentZoom === undefined) {\n return;\n }\n var newZoom = view.getConstrainedZoom(currentZoom + delta);\n var newResolution = view.getResolutionForZoom(newZoom);\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n resolution: newResolution,\n anchor: opt_anchor,\n duration: opt_duration !== undefined ? opt_duration : 250,\n easing: easeOut\n });\n}\nexport default Interaction;\n//# sourceMappingURL=Interaction.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DoubleClickZoom\n */\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport Interaction, { zoomByDelta } from './Interaction.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {number} [delta=1] The zoom delta applied on each double click.\n */\n/**\n * @classdesc\n * Allows the user to zoom by double-clicking on the map.\n * @api\n */\nvar DoubleClickZoom = /** @class */ (function (_super) {\n __extends(DoubleClickZoom, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DoubleClickZoom(opt_options) {\n var _this = _super.call(this, {\n handleEvent: handleEvent\n }) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {number}\n */\n _this.delta_ = options.delta ? options.delta : 1;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n return DoubleClickZoom;\n}(Interaction));\n/**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a\n * doubleclick) and eventually zooms the map.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {DoubleClickZoom}\n */\nfunction handleEvent(mapBrowserEvent) {\n var stopEvent = false;\n if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {\n var browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);\n var map = mapBrowserEvent.map;\n var anchor = mapBrowserEvent.coordinate;\n var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;\n var view = map.getView();\n zoomByDelta(view, delta, anchor, this.duration_);\n mapBrowserEvent.preventDefault();\n stopEvent = true;\n }\n return !stopEvent;\n}\nexport default DoubleClickZoom;\n//# sourceMappingURL=DoubleClickZoom.js.map","/**\n * @module ol/events/condition\n */\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport { assert } from '../asserts.js';\nimport { TRUE, FALSE } from '../functions.js';\nimport { WEBKIT, MAC } from '../has.js';\n/**\n * A function that takes an {@link module:ol/MapBrowserEvent} and returns a\n * `{boolean}`. If the condition is met, true should be returned.\n *\n * @typedef {function(this: ?, import(\"../MapBrowserEvent.js\").default): boolean} Condition\n */\n/**\n * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when\n * additionally the shift-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the alt key is pressed.\n * @api\n */\nexport var altKeyOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n !originalEvent.shiftKey);\n};\n/**\n * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise\n * (e.g. when additionally the platform-modifier-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the alt and shift keys are pressed.\n * @api\n */\nexport var altShiftKeysOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n originalEvent.shiftKey);\n};\n/**\n * Return `true` if the map has the focus. This condition requires a map target\n * element with a `tabindex` attribute, e.g. `<div id=\"map\" tabindex=\"1\">`.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} event Map browser event.\n * @return {boolean} The map has the focus.\n * @api\n */\nexport var focus = function (event) {\n return event.target.getTargetElement() === document.activeElement;\n};\n/**\n * Return always true.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True.\n * @api\n */\nexport var always = TRUE;\n/**\n * Return `true` if the event is a `click` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `click` event.\n * @api\n */\nexport var click = function (mapBrowserEvent) {\n return mapBrowserEvent.type == MapBrowserEventType.CLICK;\n};\n/**\n * Return `true` if the event has an \"action\"-producing mouse button.\n *\n * By definition, this includes left-click on windows/linux, and left-click\n * without the ctrl key on Macs.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} The result.\n */\nexport var mouseActionButton = function (mapBrowserEvent) {\n var originalEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);\n return originalEvent.button == 0 &&\n !(WEBKIT && MAC && originalEvent.ctrlKey);\n};\n/**\n * Return always false.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} False.\n * @api\n */\nexport var never = FALSE;\n/**\n * Return `true` if the browser event is a `pointermove` event, `false`\n * otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the browser event is a `pointermove` event.\n * @api\n */\nexport var pointerMove = function (mapBrowserEvent) {\n return mapBrowserEvent.type == 'pointermove';\n};\n/**\n * Return `true` if the event is a map `singleclick` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `singleclick` event.\n * @api\n */\nexport var singleClick = function (mapBrowserEvent) {\n return mapBrowserEvent.type == MapBrowserEventType.SINGLECLICK;\n};\n/**\n * Return `true` if the event is a map `dblclick` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `dblclick` event.\n * @api\n */\nexport var doubleClick = function (mapBrowserEvent) {\n return mapBrowserEvent.type == MapBrowserEventType.DBLCLICK;\n};\n/**\n * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is\n * pressed.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True only if there no modifier keys are pressed.\n * @api\n */\nexport var noModifierKeys = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (!originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n !originalEvent.shiftKey);\n};\n/**\n * Return `true` if only the platform-modifier-key (the meta-key on Mac,\n * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally\n * the shift-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the platform modifier key is pressed.\n * @api\n */\nexport var platformModifierKeyOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return !originalEvent.altKey &&\n (MAC ? originalEvent.metaKey : originalEvent.ctrlKey) &&\n !originalEvent.shiftKey;\n};\n/**\n * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when\n * additionally the alt-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the shift key is pressed.\n * @api\n */\nexport var shiftKeyOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (!originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n originalEvent.shiftKey);\n};\n/**\n * Return `true` if the target element is not editable, i.e. not a `<input>`-,\n * `<select>`- or `<textarea>`-element, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True only if the target element is not editable.\n * @api\n */\nexport var targetNotEditable = function (mapBrowserEvent) {\n var target = mapBrowserEvent.target;\n var tagName = /** @type {Element} */ (target).tagName;\n return (tagName !== 'INPUT' &&\n tagName !== 'SELECT' &&\n tagName !== 'TEXTAREA');\n};\n/**\n * Return `true` if the event originates from a mouse device.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a mouse device.\n * @api\n */\nexport var mouseOnly = function (mapBrowserEvent) {\n var pointerEvent = /** @type {import(\"../MapBrowserPointerEvent\").default} */ (mapBrowserEvent).pointerEvent;\n assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event\n // see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType\n return pointerEvent.pointerType == 'mouse';\n};\n/**\n * Return `true` if the event originates from a touchable device.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a touchable device.\n * @api\n */\nexport var touchOnly = function (mapBrowserEvent) {\n var pointerEvt = /** @type {import(\"../MapBrowserPointerEvent\").default} */ (mapBrowserEvent).pointerEvent;\n assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event\n // see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType\n return pointerEvt.pointerType === 'touch';\n};\n/**\n * Return `true` if the event originates from a digital pen.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a digital pen.\n * @api\n */\nexport var penOnly = function (mapBrowserEvent) {\n var pointerEvt = /** @type {import(\"../MapBrowserPointerEvent\").default} */ (mapBrowserEvent).pointerEvent;\n assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event\n // see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType\n return pointerEvt.pointerType === 'pen';\n};\n/**\n * Return `true` if the event originates from a primary pointer in\n * contact with the surface or if the left mouse button is pressed.\n * See http://www.w3.org/TR/pointerevents/#button-states.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a primary pointer.\n * @api\n */\nexport var primaryAction = function (mapBrowserEvent) {\n var pointerEvent = /** @type {import(\"../MapBrowserPointerEvent\").default} */ (mapBrowserEvent).pointerEvent;\n assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event\n return pointerEvent.isPrimary && pointerEvent.button === 0;\n};\n//# sourceMappingURL=condition.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Pointer\n */\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport Interaction from './Interaction.js';\nimport { getValues } from '../obj.js';\n/**\n * @typedef {Object} Options\n * @property {function(import(\"../MapBrowserPointerEvent.js\").default):boolean} [handleDownEvent]\n * Function handling \"down\" events. If the function returns `true` then a drag\n * sequence is started.\n * @property {function(import(\"../MapBrowserPointerEvent.js\").default)} [handleDragEvent]\n * Function handling \"drag\" events. This function is called on \"move\" events\n * during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleEvent]\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. The function may return `false` to prevent the\n * propagation of the event to other interactions in the map's interactions\n * chain.\n * @property {function(import(\"../MapBrowserPointerEvent.js\").default)} [handleMoveEvent]\n * Function handling \"move\" events. This function is called on \"move\" events.\n * This functions is also called during a drag sequence, so during a drag\n * sequence both the `handleDragEvent` function and this function are called.\n * If `handleDownEvent` is defined and it returns true this function will not\n * be called during a drag sequence.\n * @property {function(import(\"../MapBrowserPointerEvent.js\").default):boolean} [handleUpEvent]\n * Function handling \"up\" events. If the function returns `false` then the\n * current drag sequence is stopped.\n * @property {function(boolean):boolean} [stopDown]\n * Should the down event be propagated to other interactions, or should be\n * stopped?\n */\n/**\n * @classdesc\n * Base class that calls user-defined functions on `down`, `move` and `up`\n * events. This class also manages \"drag sequences\".\n *\n * When the `handleDownEvent` user function returns `true` a drag sequence is\n * started. During a drag sequence the `handleDragEvent` user function is\n * called on `move` events. The drag sequence ends when the `handleUpEvent`\n * user function is called and returns `false`.\n * @api\n */\nvar PointerInteraction = /** @class */ (function (_super) {\n __extends(PointerInteraction, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function PointerInteraction(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, /** @type {import(\"./Interaction.js\").InteractionOptions} */ (options)) || this;\n if (options.handleDownEvent) {\n _this.handleDownEvent = options.handleDownEvent;\n }\n if (options.handleDragEvent) {\n _this.handleDragEvent = options.handleDragEvent;\n }\n if (options.handleMoveEvent) {\n _this.handleMoveEvent = options.handleMoveEvent;\n }\n if (options.handleUpEvent) {\n _this.handleUpEvent = options.handleUpEvent;\n }\n if (options.stopDown) {\n _this.stopDown = options.stopDown;\n }\n /**\n * @type {boolean}\n * @protected\n */\n _this.handlingDownUpSequence = false;\n /**\n * @type {!Object<string, PointerEvent>}\n * @private\n */\n _this.trackedPointers_ = {};\n /**\n * @type {Array<PointerEvent>}\n * @protected\n */\n _this.targetPointers = [];\n return _this;\n }\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n PointerInteraction.prototype.handleDownEvent = function (mapBrowserEvent) {\n return false;\n };\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n PointerInteraction.prototype.handleDragEvent = function (mapBrowserEvent) { };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} and may call into\n * other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are\n * detected.\n * @override\n * @api\n */\n PointerInteraction.prototype.handleEvent = function (mapBrowserEvent) {\n if (!( /** @type {import(\"../MapBrowserPointerEvent.js\").default} */(mapBrowserEvent).pointerEvent)) {\n return true;\n }\n var stopEvent = false;\n this.updateTrackedPointers_(mapBrowserEvent);\n if (this.handlingDownUpSequence) {\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {\n this.handleDragEvent(mapBrowserEvent);\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {\n var handledUp = this.handleUpEvent(mapBrowserEvent);\n this.handlingDownUpSequence = handledUp && this.targetPointers.length > 0;\n }\n }\n else {\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {\n var handled = this.handleDownEvent(mapBrowserEvent);\n if (handled) {\n mapBrowserEvent.preventDefault();\n }\n this.handlingDownUpSequence = handled;\n stopEvent = this.stopDown(handled);\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE) {\n this.handleMoveEvent(mapBrowserEvent);\n }\n }\n return !stopEvent;\n };\n /**\n * Handle pointer move events.\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n PointerInteraction.prototype.handleMoveEvent = function (mapBrowserEvent) { };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n PointerInteraction.prototype.handleUpEvent = function (mapBrowserEvent) {\n return false;\n };\n /**\n * This function is used to determine if \"down\" events should be propagated\n * to other interactions or should be stopped.\n * @param {boolean} handled Was the event handled by the interaction?\n * @return {boolean} Should the `down` event be stopped?\n */\n PointerInteraction.prototype.stopDown = function (handled) {\n return handled;\n };\n /**\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Event.\n * @private\n */\n PointerInteraction.prototype.updateTrackedPointers_ = function (mapBrowserEvent) {\n if (isPointerDraggingEvent(mapBrowserEvent)) {\n var event_1 = mapBrowserEvent.pointerEvent;\n var id = event_1.pointerId.toString();\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {\n delete this.trackedPointers_[id];\n }\n else if (mapBrowserEvent.type ==\n MapBrowserEventType.POINTERDOWN) {\n this.trackedPointers_[id] = event_1;\n }\n else if (id in this.trackedPointers_) {\n // update only when there was a pointerdown event for this pointer\n this.trackedPointers_[id] = event_1;\n }\n this.targetPointers = getValues(this.trackedPointers_);\n }\n };\n return PointerInteraction;\n}(Interaction));\n/**\n * @param {Array<PointerEvent>} pointerEvents List of events.\n * @return {import(\"../pixel.js\").Pixel} Centroid pixel.\n */\nexport function centroid(pointerEvents) {\n var length = pointerEvents.length;\n var clientX = 0;\n var clientY = 0;\n for (var i = 0; i < length; i++) {\n clientX += pointerEvents[i].clientX;\n clientY += pointerEvents[i].clientY;\n }\n return [clientX / length, clientY / length];\n}\n/**\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} Whether the event is a pointerdown, pointerdrag\n * or pointerup event.\n */\nfunction isPointerDraggingEvent(mapBrowserEvent) {\n var type = mapBrowserEvent.type;\n return type === MapBrowserEventType.POINTERDOWN ||\n type === MapBrowserEventType.POINTERDRAG ||\n type === MapBrowserEventType.POINTERUP;\n}\nexport default PointerInteraction;\n//# sourceMappingURL=Pointer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DragPan\n */\nimport { scale as scaleCoordinate, rotate as rotateCoordinate } from '../coordinate.js';\nimport { easeOut } from '../easing.js';\nimport { noModifierKeys, primaryAction } from '../events/condition.js';\nimport { FALSE } from '../functions.js';\nimport PointerInteraction, { centroid as centroidFromPointers } from './Pointer.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean\n * to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition~noModifierKeys} and {@link module:ol/events/condition~primaryAction}.\n * @property {import(\"../Kinetic.js\").default} [kinetic] Kinetic inertia to apply to the pan.\n */\n/**\n * @classdesc\n * Allows the user to pan the map by dragging the map.\n * @api\n */\nvar DragPan = /** @class */ (function (_super) {\n __extends(DragPan, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DragPan(opt_options) {\n var _this = _super.call(this, {\n stopDown: FALSE\n }) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {import(\"../Kinetic.js\").default|undefined}\n */\n _this.kinetic_ = options.kinetic;\n /**\n * @type {import(\"../pixel.js\").Pixel}\n */\n _this.lastCentroid = null;\n /**\n * @type {number}\n */\n _this.lastPointersCount_;\n /**\n * @type {boolean}\n */\n _this.panning_ = false;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : defaultCondition;\n /**\n * @private\n * @type {boolean}\n */\n _this.noKinetic_ = false;\n return _this;\n }\n /**\n * @inheritDoc\n */\n DragPan.prototype.handleDragEvent = function (mapBrowserEvent) {\n if (!this.panning_) {\n this.panning_ = true;\n this.getMap().getView().beginInteraction();\n }\n var targetPointers = this.targetPointers;\n var centroid = centroidFromPointers(targetPointers);\n if (targetPointers.length == this.lastPointersCount_) {\n if (this.kinetic_) {\n this.kinetic_.update(centroid[0], centroid[1]);\n }\n if (this.lastCentroid) {\n var delta = [\n this.lastCentroid[0] - centroid[0],\n centroid[1] - this.lastCentroid[1]\n ];\n var map = mapBrowserEvent.map;\n var view = map.getView();\n scaleCoordinate(delta, view.getResolution());\n rotateCoordinate(delta, view.getRotation());\n view.adjustCenterInternal(delta);\n }\n }\n else if (this.kinetic_) {\n // reset so we don't overestimate the kinetic energy after\n // after one finger down, tiny drag, second finger down\n this.kinetic_.begin();\n }\n this.lastCentroid = centroid;\n this.lastPointersCount_ = targetPointers.length;\n };\n /**\n * @inheritDoc\n */\n DragPan.prototype.handleUpEvent = function (mapBrowserEvent) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n if (this.targetPointers.length === 0) {\n if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {\n var distance = this.kinetic_.getDistance();\n var angle = this.kinetic_.getAngle();\n var center = view.getCenterInternal();\n var centerpx = map.getPixelFromCoordinateInternal(center);\n var dest = map.getCoordinateFromPixelInternal([\n centerpx[0] - distance * Math.cos(angle),\n centerpx[1] - distance * Math.sin(angle)\n ]);\n view.animateInternal({\n center: view.getConstrainedCenter(dest),\n duration: 500,\n easing: easeOut\n });\n }\n if (this.panning_) {\n this.panning_ = false;\n view.endInteraction();\n }\n return false;\n }\n else {\n if (this.kinetic_) {\n // reset so we don't overestimate the kinetic energy after\n // after one finger up, tiny drag, second finger up\n this.kinetic_.begin();\n }\n this.lastCentroid = null;\n return true;\n }\n };\n /**\n * @inheritDoc\n */\n DragPan.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length > 0 && this.condition_(mapBrowserEvent)) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n this.lastCentroid = null;\n // stop any current animation\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n if (this.kinetic_) {\n this.kinetic_.begin();\n }\n // No kinetic as soon as more than one pointer on the screen is\n // detected. This is to prevent nasty pans after pinch.\n this.noKinetic_ = this.targetPointers.length > 1;\n return true;\n }\n else {\n return false;\n }\n };\n return DragPan;\n}(PointerInteraction));\n/**\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\nfunction defaultCondition(mapBrowserEvent) {\n return noModifierKeys(mapBrowserEvent) && primaryAction(mapBrowserEvent);\n}\nexport default DragPan;\n//# sourceMappingURL=DragPan.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DragRotate\n */\nimport { disable } from '../rotationconstraint.js';\nimport { altShiftKeysOnly, mouseOnly, mouseActionButton } from '../events/condition.js';\nimport { FALSE } from '../functions.js';\nimport PointerInteraction from './Pointer.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that takes an\n * {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean\n * to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition~altShiftKeysOnly}.\n * @property {number} [duration=250] Animation duration in milliseconds.\n */\n/**\n * @classdesc\n * Allows the user to rotate the map by clicking and dragging on the map,\n * normally combined with an {@link module:ol/events/condition} that limits\n * it to when the alt and shift keys are held down.\n *\n * This interaction is only supported for mouse devices.\n * @api\n */\nvar DragRotate = /** @class */ (function (_super) {\n __extends(DragRotate, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DragRotate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n stopDown: FALSE\n }) || this;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : altShiftKeysOnly;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastAngle_ = undefined;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n /**\n * @inheritDoc\n */\n DragRotate.prototype.handleDragEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return;\n }\n var map = mapBrowserEvent.map;\n var view = map.getView();\n if (view.getConstraints().rotation === disable) {\n return;\n }\n var size = map.getSize();\n var offset = mapBrowserEvent.pixel;\n var theta = Math.atan2(size[1] / 2 - offset[1], offset[0] - size[0] / 2);\n if (this.lastAngle_ !== undefined) {\n var delta = theta - this.lastAngle_;\n view.adjustRotationInternal(-delta);\n }\n this.lastAngle_ = theta;\n };\n /**\n * @inheritDoc\n */\n DragRotate.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return true;\n }\n var map = mapBrowserEvent.map;\n var view = map.getView();\n view.endInteraction(this.duration_);\n return false;\n };\n /**\n * @inheritDoc\n */\n DragRotate.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return false;\n }\n if (mouseActionButton(mapBrowserEvent) && this.condition_(mapBrowserEvent)) {\n var map = mapBrowserEvent.map;\n map.getView().beginInteraction();\n this.lastAngle_ = undefined;\n return true;\n }\n else {\n return false;\n }\n };\n return DragRotate;\n}(PointerInteraction));\nexport default DragRotate;\n//# sourceMappingURL=DragRotate.js.map","/**\n * @module ol/render/Box\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport Disposable from '../Disposable.js';\nimport Polygon from '../geom/Polygon.js';\nvar RenderBox = /** @class */ (function (_super) {\n __extends(RenderBox, _super);\n /**\n * @param {string} className CSS class name.\n */\n function RenderBox(className) {\n var _this = _super.call(this) || this;\n /**\n * @type {import(\"../geom/Polygon.js\").default}\n * @private\n */\n _this.geometry_ = null;\n /**\n * @type {HTMLDivElement}\n * @private\n */\n _this.element_ = document.createElement('div');\n _this.element_.style.position = 'absolute';\n _this.element_.className = 'ol-box ' + className;\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = null;\n /**\n * @private\n * @type {import(\"../pixel.js\").Pixel}\n */\n _this.startPixel_ = null;\n /**\n * @private\n * @type {import(\"../pixel.js\").Pixel}\n */\n _this.endPixel_ = null;\n return _this;\n }\n /**\n * @inheritDoc\n */\n RenderBox.prototype.disposeInternal = function () {\n this.setMap(null);\n };\n /**\n * @private\n */\n RenderBox.prototype.render_ = function () {\n var startPixel = this.startPixel_;\n var endPixel = this.endPixel_;\n var px = 'px';\n var style = this.element_.style;\n style.left = Math.min(startPixel[0], endPixel[0]) + px;\n style.top = Math.min(startPixel[1], endPixel[1]) + px;\n style.width = Math.abs(endPixel[0] - startPixel[0]) + px;\n style.height = Math.abs(endPixel[1] - startPixel[1]) + px;\n };\n /**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n RenderBox.prototype.setMap = function (map) {\n if (this.map_) {\n this.map_.getOverlayContainer().removeChild(this.element_);\n var style = this.element_.style;\n style.left = 'inherit';\n style.top = 'inherit';\n style.width = 'inherit';\n style.height = 'inherit';\n }\n this.map_ = map;\n if (this.map_) {\n this.map_.getOverlayContainer().appendChild(this.element_);\n }\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} startPixel Start pixel.\n * @param {import(\"../pixel.js\").Pixel} endPixel End pixel.\n */\n RenderBox.prototype.setPixels = function (startPixel, endPixel) {\n this.startPixel_ = startPixel;\n this.endPixel_ = endPixel;\n this.createOrUpdateGeometry();\n this.render_();\n };\n /**\n * Creates or updates the cached geometry.\n */\n RenderBox.prototype.createOrUpdateGeometry = function () {\n var startPixel = this.startPixel_;\n var endPixel = this.endPixel_;\n var pixels = [\n startPixel,\n [startPixel[0], endPixel[1]],\n endPixel,\n [endPixel[0], startPixel[1]]\n ];\n var coordinates = pixels.map(this.map_.getCoordinateFromPixelInternal, this.map_);\n // close the polygon\n coordinates[4] = coordinates[0].slice();\n if (!this.geometry_) {\n this.geometry_ = new Polygon([coordinates]);\n }\n else {\n this.geometry_.setCoordinates([coordinates]);\n }\n };\n /**\n * @return {import(\"../geom/Polygon.js\").default} Geometry.\n */\n RenderBox.prototype.getGeometry = function () {\n return this.geometry_;\n };\n return RenderBox;\n}(Disposable));\nexport default RenderBox;\n//# sourceMappingURL=Box.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DragBox\n */\n// FIXME draw drag box\nimport Event from '../events/Event.js';\nimport { always, mouseOnly, mouseActionButton } from '../events/condition.js';\nimport { VOID } from '../functions.js';\nimport PointerInteraction from './Pointer.js';\nimport RenderBox from '../render/Box.js';\n/**\n * A function that takes a {@link module:ol/MapBrowserEvent} and two\n * {@link module:ol/pixel~Pixel}s and returns a `{boolean}`. If the condition is met,\n * true should be returned.\n * @typedef {function(this: ?, import(\"../MapBrowserEvent.js\").default, import(\"../pixel.js\").Pixel, import(\"../pixel.js\").Pixel):boolean} EndCondition\n */\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-dragbox'] CSS class name for styling the box.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean\n * to indicate whether that event should be handled.\n * Default is {@link ol/events/condition~always}.\n * @property {number} [minArea=64] The minimum area of the box in pixel, this value is used by the default\n * `boxEndCondition` function.\n * @property {EndCondition} [boxEndCondition] A function that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and two\n * {@link module:ol/pixel~Pixel}s to indicate whether a `boxend` event should be fired.\n * Default is `true` if the area of the box is bigger than the `minArea` option.\n * @property {function(this:DragBox, import(\"../MapBrowserEvent.js\").default)} [onBoxEnd] Code to execute just\n * before `boxend` is fired.\n */\n/**\n * @enum {string}\n */\nvar DragBoxEventType = {\n /**\n * Triggered upon drag box start.\n * @event DragBoxEvent#boxstart\n * @api\n */\n BOXSTART: 'boxstart',\n /**\n * Triggered on drag when box is active.\n * @event DragBoxEvent#boxdrag\n * @api\n */\n BOXDRAG: 'boxdrag',\n /**\n * Triggered upon drag box end.\n * @event DragBoxEvent#boxend\n * @api\n */\n BOXEND: 'boxend'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/DragBox~DragBox} instances are instances of\n * this type.\n */\nvar DragBoxEvent = /** @class */ (function (_super) {\n __extends(DragBoxEvent, _super);\n /**\n * @param {string} type The event type.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The event coordinate.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Originating event.\n */\n function DragBoxEvent(type, coordinate, mapBrowserEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * The coordinate of the drag event.\n * @const\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n _this.coordinate = coordinate;\n /**\n * @const\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserEvent;\n return _this;\n }\n return DragBoxEvent;\n}(Event));\n/**\n * @classdesc\n * Allows the user to draw a vector box by clicking and dragging on the map,\n * normally combined with an {@link module:ol/events/condition} that limits\n * it to when the shift or other key is held down. This is used, for example,\n * for zooming to a specific area of the map\n * (see {@link module:ol/interaction/DragZoom~DragZoom} and\n * {@link module:ol/interaction/DragRotateAndZoom}).\n *\n * This interaction is only supported for mouse devices.\n *\n * @fires DragBoxEvent\n * @api\n */\nvar DragBox = /** @class */ (function (_super) {\n __extends(DragBox, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DragBox(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @type {import(\"../render/Box.js\").default}\n * @private\n */\n _this.box_ = new RenderBox(options.className || 'ol-dragbox');\n /**\n * @type {number}\n * @private\n */\n _this.minArea_ = options.minArea !== undefined ? options.minArea : 64;\n /**\n * Function to execute just before `onboxend` is fired\n * @type {function(this:DragBox, import(\"../MapBrowserEvent.js\").default): void}\n * @private\n */\n _this.onBoxEnd_ = options.onBoxEnd ? options.onBoxEnd : VOID;\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n _this.startPixel_ = null;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : always;\n /**\n * @private\n * @type {EndCondition}\n */\n _this.boxEndCondition_ = options.boxEndCondition ?\n options.boxEndCondition : _this.defaultBoxEndCondition;\n return _this;\n }\n /**\n * The default condition for determining whether the boxend event\n * should fire.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent The originating MapBrowserEvent\n * leading to the box end.\n * @param {import(\"../pixel.js\").Pixel} startPixel The starting pixel of the box.\n * @param {import(\"../pixel.js\").Pixel} endPixel The end pixel of the box.\n * @return {boolean} Whether or not the boxend condition should be fired.\n */\n DragBox.prototype.defaultBoxEndCondition = function (mapBrowserEvent, startPixel, endPixel) {\n var width = endPixel[0] - startPixel[0];\n var height = endPixel[1] - startPixel[1];\n return width * width + height * height >= this.minArea_;\n };\n /**\n * Returns geometry of last drawn box.\n * @return {import(\"../geom/Polygon.js\").default} Geometry.\n * @api\n */\n DragBox.prototype.getGeometry = function () {\n return this.box_.getGeometry();\n };\n /**\n * @inheritDoc\n */\n DragBox.prototype.handleDragEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return;\n }\n this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel);\n this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXDRAG, mapBrowserEvent.coordinate, mapBrowserEvent));\n };\n /**\n * @inheritDoc\n */\n DragBox.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return true;\n }\n this.box_.setMap(null);\n if (this.boxEndCondition_(mapBrowserEvent, this.startPixel_, mapBrowserEvent.pixel)) {\n this.onBoxEnd_(mapBrowserEvent);\n this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXEND, mapBrowserEvent.coordinate, mapBrowserEvent));\n }\n return false;\n };\n /**\n * @inheritDoc\n */\n DragBox.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return false;\n }\n if (mouseActionButton(mapBrowserEvent) &&\n this.condition_(mapBrowserEvent)) {\n this.startPixel_ = mapBrowserEvent.pixel;\n this.box_.setMap(mapBrowserEvent.map);\n this.box_.setPixels(this.startPixel_, this.startPixel_);\n this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXSTART, mapBrowserEvent.coordinate, mapBrowserEvent));\n return true;\n }\n else {\n return false;\n }\n };\n return DragBox;\n}(PointerInteraction));\nexport default DragBox;\n//# sourceMappingURL=DragBox.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DragZoom\n */\nimport { easeOut } from '../easing.js';\nimport { shiftKeyOnly } from '../events/condition.js';\nimport { createOrUpdateFromCoordinates, getBottomLeft, getCenter, getTopRight, scaleFromCenter } from '../extent.js';\nimport DragBox from './DragBox.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-dragzoom'] CSS class name for styling the\n * box.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition~shiftKeyOnly}.\n * @property {number} [duration=200] Animation duration in milliseconds.\n * @property {boolean} [out=false] Use interaction for zooming out.\n * @property {number} [minArea=64] The minimum area of the box in pixel, this value is used by the parent default\n * `boxEndCondition` function.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map by clicking and dragging on the map,\n * normally combined with an {@link module:ol/events/condition} that limits\n * it to when a key, shift by default, is held down.\n *\n * To change the style of the box, use CSS and the `.ol-dragzoom` selector, or\n * your custom one configured with `className`.\n * @api\n */\nvar DragZoom = /** @class */ (function (_super) {\n __extends(DragZoom, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DragZoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var condition = options.condition ? options.condition : shiftKeyOnly;\n _this = _super.call(this, {\n condition: condition,\n className: options.className || 'ol-dragzoom',\n minArea: options.minArea,\n onBoxEnd: onBoxEnd\n }) || this;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 200;\n /**\n * @private\n * @type {boolean}\n */\n _this.out_ = options.out !== undefined ? options.out : false;\n return _this;\n }\n return DragZoom;\n}(DragBox));\n/**\n * @this {DragZoom}\n */\nfunction onBoxEnd() {\n var map = this.getMap();\n var view = /** @type {!import(\"../View.js\").default} */ (map.getView());\n var size = /** @type {!import(\"../size.js\").Size} */ (map.getSize());\n var extent = this.getGeometry().getExtent();\n if (this.out_) {\n var mapExtent = view.calculateExtentInternal(size);\n var boxPixelExtent = createOrUpdateFromCoordinates([\n map.getPixelFromCoordinateInternal(getBottomLeft(extent)),\n map.getPixelFromCoordinateInternal(getTopRight(extent))\n ]);\n var factor = view.getResolutionForExtentInternal(boxPixelExtent, size);\n scaleFromCenter(mapExtent, 1 / factor);\n extent = mapExtent;\n }\n var resolution = view.getConstrainedResolution(view.getResolutionForExtentInternal(extent, size));\n var center = view.getConstrainedCenter(getCenter(extent), resolution);\n view.animateInternal({\n resolution: resolution,\n center: center,\n duration: this.duration_,\n easing: easeOut\n });\n}\nexport default DragZoom;\n//# sourceMappingURL=DragZoom.js.map","/**\n * @module ol/events/KeyCode\n */\n/**\n * @enum {number}\n * @const\n */\nexport default {\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n};\n//# sourceMappingURL=KeyCode.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/KeyboardPan\n */\nimport { rotate as rotateCoordinate } from '../coordinate.js';\nimport EventType from '../events/EventType.js';\nimport KeyCode from '../events/KeyCode.js';\nimport { noModifierKeys, targetNotEditable } from '../events/condition.js';\nimport Interaction, { pan } from './Interaction.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition~noModifierKeys} and\n * {@link module:ol/events/condition~targetNotEditable}.\n * @property {number} [duration=100] Animation duration in milliseconds.\n * @property {number} [pixelDelta=128] The amount of pixels to pan on each key\n * press.\n */\n/**\n * @classdesc\n * Allows the user to pan the map using keyboard arrows.\n * Note that, although this interaction is by default included in maps,\n * the keys can only be used when browser focus is on the element to which\n * the keyboard events are attached. By default, this is the map div,\n * though you can change this with the `keyboardEventTarget` in\n * {@link module:ol/Map~Map}. `document` never loses focus but, for any other\n * element, focus will have to be on, and returned to, this element if the keys\n * are to function.\n * See also {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}.\n * @api\n */\nvar KeyboardPan = /** @class */ (function (_super) {\n __extends(KeyboardPan, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function KeyboardPan(opt_options) {\n var _this = _super.call(this, {\n handleEvent: handleEvent\n }) || this;\n var options = opt_options || {};\n /**\n * @private\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\n _this.defaultCondition_ = function (mapBrowserEvent) {\n return noModifierKeys(mapBrowserEvent) &&\n targetNotEditable(mapBrowserEvent);\n };\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition !== undefined ?\n options.condition : _this.defaultCondition_;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 100;\n /**\n * @private\n * @type {number}\n */\n _this.pixelDelta_ = options.pixelDelta !== undefined ?\n options.pixelDelta : 128;\n return _this;\n }\n return KeyboardPan;\n}(Interaction));\n/**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} if it was a\n * `KeyEvent`, and decides the direction to pan to (if an arrow key was\n * pressed).\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {KeyboardPan}\n */\nfunction handleEvent(mapBrowserEvent) {\n var stopEvent = false;\n if (mapBrowserEvent.type == EventType.KEYDOWN) {\n var keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);\n var keyCode = keyEvent.keyCode;\n if (this.condition_(mapBrowserEvent) &&\n (keyCode == KeyCode.DOWN ||\n keyCode == KeyCode.LEFT ||\n keyCode == KeyCode.RIGHT ||\n keyCode == KeyCode.UP)) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n var mapUnitsDelta = view.getResolution() * this.pixelDelta_;\n var deltaX = 0, deltaY = 0;\n if (keyCode == KeyCode.DOWN) {\n deltaY = -mapUnitsDelta;\n }\n else if (keyCode == KeyCode.LEFT) {\n deltaX = -mapUnitsDelta;\n }\n else if (keyCode == KeyCode.RIGHT) {\n deltaX = mapUnitsDelta;\n }\n else {\n deltaY = mapUnitsDelta;\n }\n var delta = [deltaX, deltaY];\n rotateCoordinate(delta, view.getRotation());\n pan(view, delta, this.duration_);\n mapBrowserEvent.preventDefault();\n stopEvent = true;\n }\n }\n return !stopEvent;\n}\nexport default KeyboardPan;\n//# sourceMappingURL=KeyboardPan.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/KeyboardZoom\n */\nimport EventType from '../events/EventType.js';\nimport { targetNotEditable } from '../events/condition.js';\nimport Interaction, { zoomByDelta } from './Interaction.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=100] Animation duration in milliseconds.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition~targetNotEditable}.\n * @property {number} [delta=1] The zoom level delta on each key press.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map using keyboard + and -.\n * Note that, although this interaction is by default included in maps,\n * the keys can only be used when browser focus is on the element to which\n * the keyboard events are attached. By default, this is the map div,\n * though you can change this with the `keyboardEventTarget` in\n * {@link module:ol/Map~Map}. `document` never loses focus but, for any other\n * element, focus will have to be on, and returned to, this element if the keys\n * are to function.\n * See also {@link module:ol/interaction/KeyboardPan~KeyboardPan}.\n * @api\n */\nvar KeyboardZoom = /** @class */ (function (_super) {\n __extends(KeyboardZoom, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function KeyboardZoom(opt_options) {\n var _this = _super.call(this, {\n handleEvent: handleEvent\n }) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : targetNotEditable;\n /**\n * @private\n * @type {number}\n */\n _this.delta_ = options.delta ? options.delta : 1;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 100;\n return _this;\n }\n return KeyboardZoom;\n}(Interaction));\n/**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} if it was a\n * `KeyEvent`, and decides whether to zoom in or out (depending on whether the\n * key pressed was '+' or '-').\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {KeyboardZoom}\n */\nfunction handleEvent(mapBrowserEvent) {\n var stopEvent = false;\n if (mapBrowserEvent.type == EventType.KEYDOWN ||\n mapBrowserEvent.type == EventType.KEYPRESS) {\n var keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);\n var charCode = keyEvent.charCode;\n if (this.condition_(mapBrowserEvent) &&\n (charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0))) {\n var map = mapBrowserEvent.map;\n var delta = (charCode == '+'.charCodeAt(0)) ? this.delta_ : -this.delta_;\n var view = map.getView();\n zoomByDelta(view, delta, undefined, this.duration_);\n mapBrowserEvent.preventDefault();\n stopEvent = true;\n }\n }\n return !stopEvent;\n}\nexport default KeyboardZoom;\n//# sourceMappingURL=KeyboardZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/MouseWheelZoom\n */\nimport { always } from '../events/condition.js';\nimport EventType from '../events/EventType.js';\nimport { DEVICE_PIXEL_RATIO, FIREFOX } from '../has.js';\nimport Interaction, { zoomByDelta } from './Interaction.js';\nimport { clamp } from '../math.js';\n/**\n * @enum {string}\n */\nexport var Mode = {\n TRACKPAD: 'trackpad',\n WHEEL: 'wheel'\n};\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition~always}.\n * @property {number} [maxDelta=1] Maximum mouse wheel delta.\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {number} [timeout=80] Mouse wheel timeout duration in milliseconds.\n * @property {boolean} [useAnchor=true] Enable zooming using the mouse's\n * location as the anchor. When set to `false`, zooming in and out will zoom to\n * the center of the screen instead of zooming on the mouse's location.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map by scrolling the mouse wheel.\n * @api\n */\nvar MouseWheelZoom = /** @class */ (function (_super) {\n __extends(MouseWheelZoom, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function MouseWheelZoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, /** @type {import(\"./Interaction.js\").InteractionOptions} */ (options)) || this;\n /**\n * @private\n * @type {number}\n */\n _this.totalDelta_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.lastDelta_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = options.maxDelta !== undefined ? options.maxDelta : 1;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n /**\n * @private\n * @type {number}\n */\n _this.timeout_ = options.timeout !== undefined ? options.timeout : 80;\n /**\n * @private\n * @type {boolean}\n */\n _this.useAnchor_ = options.useAnchor !== undefined ? options.useAnchor : true;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : always;\n /**\n * @private\n * @type {?import(\"../coordinate.js\").Coordinate}\n */\n _this.lastAnchor_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.startTime_ = undefined;\n /**\n * @private\n * @type {?}\n */\n _this.timeoutId_;\n /**\n * @private\n * @type {Mode|undefined}\n */\n _this.mode_ = undefined;\n /**\n * Trackpad events separated by this delay will be considered separate\n * interactions.\n * @type {number}\n */\n _this.trackpadEventGap_ = 400;\n /**\n * @type {?}\n */\n _this.trackpadTimeoutId_;\n /**\n * The number of delta values per zoom level\n * @private\n * @type {number}\n */\n _this.trackpadDeltaPerZoom_ = 300;\n return _this;\n }\n /**\n * @private\n */\n MouseWheelZoom.prototype.endInteraction_ = function () {\n this.trackpadTimeoutId_ = undefined;\n var view = this.getMap().getView();\n view.endInteraction(undefined, Math.sign(this.lastDelta_), this.lastAnchor_);\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a mousewheel-event) and eventually\n * zooms the map.\n * @override\n */\n MouseWheelZoom.prototype.handleEvent = function (mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n var type = mapBrowserEvent.type;\n if (type !== EventType.WHEEL) {\n return true;\n }\n mapBrowserEvent.preventDefault();\n var map = mapBrowserEvent.map;\n var wheelEvent = /** @type {WheelEvent} */ (mapBrowserEvent.originalEvent);\n if (this.useAnchor_) {\n this.lastAnchor_ = mapBrowserEvent.coordinate;\n }\n // Delta normalisation inspired by\n // https://github.com/mapbox/mapbox-gl-js/blob/001c7b9/js/ui/handler/scroll_zoom.js\n var delta;\n if (mapBrowserEvent.type == EventType.WHEEL) {\n delta = wheelEvent.deltaY;\n if (FIREFOX &&\n wheelEvent.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n delta /= DEVICE_PIXEL_RATIO;\n }\n if (wheelEvent.deltaMode === WheelEvent.DOM_DELTA_LINE) {\n delta *= 40;\n }\n }\n if (delta === 0) {\n return false;\n }\n else {\n this.lastDelta_ = delta;\n }\n var now = Date.now();\n if (this.startTime_ === undefined) {\n this.startTime_ = now;\n }\n if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) {\n this.mode_ = Math.abs(delta) < 4 ?\n Mode.TRACKPAD :\n Mode.WHEEL;\n }\n if (this.mode_ === Mode.TRACKPAD) {\n var view = map.getView();\n if (this.trackpadTimeoutId_) {\n clearTimeout(this.trackpadTimeoutId_);\n }\n else {\n view.beginInteraction();\n }\n this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.trackpadEventGap_);\n view.adjustZoom(-delta / this.trackpadDeltaPerZoom_, this.lastAnchor_);\n this.startTime_ = now;\n return false;\n }\n this.totalDelta_ += delta;\n var timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0);\n clearTimeout(this.timeoutId_);\n this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft);\n return false;\n };\n /**\n * @private\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n MouseWheelZoom.prototype.handleWheelZoom_ = function (map) {\n var view = map.getView();\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n var delta = clamp(this.totalDelta_, -this.maxDelta_, this.maxDelta_);\n zoomByDelta(view, -delta, this.lastAnchor_, this.duration_);\n this.mode_ = undefined;\n this.totalDelta_ = 0;\n this.lastAnchor_ = null;\n this.startTime_ = undefined;\n this.timeoutId_ = undefined;\n };\n /**\n * Enable or disable using the mouse's location as an anchor when zooming\n * @param {boolean} useAnchor true to zoom to the mouse's location, false\n * to zoom to the center of the map\n * @api\n */\n MouseWheelZoom.prototype.setMouseAnchor = function (useAnchor) {\n this.useAnchor_ = useAnchor;\n if (!useAnchor) {\n this.lastAnchor_ = null;\n }\n };\n return MouseWheelZoom;\n}(Interaction));\nexport default MouseWheelZoom;\n//# sourceMappingURL=MouseWheelZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/PinchRotate\n */\nimport { FALSE } from '../functions.js';\nimport PointerInteraction, { centroid as centroidFromPointers } from './Pointer.js';\nimport { disable } from '../rotationconstraint.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] The duration of the animation in\n * milliseconds.\n * @property {number} [threshold=0.3] Minimal angle in radians to start a rotation.\n */\n/**\n * @classdesc\n * Allows the user to rotate the map by twisting with two fingers\n * on a touch screen.\n * @api\n */\nvar PinchRotate = /** @class */ (function (_super) {\n __extends(PinchRotate, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function PinchRotate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.anchor_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastAngle_ = undefined;\n /**\n * @private\n * @type {boolean}\n */\n _this.rotating_ = false;\n /**\n * @private\n * @type {number}\n */\n _this.rotationDelta_ = 0.0;\n /**\n * @private\n * @type {number}\n */\n _this.threshold_ = options.threshold !== undefined ? options.threshold : 0.3;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n /**\n * @inheritDoc\n */\n PinchRotate.prototype.handleDragEvent = function (mapBrowserEvent) {\n var rotationDelta = 0.0;\n var touch0 = this.targetPointers[0];\n var touch1 = this.targetPointers[1];\n // angle between touches\n var angle = Math.atan2(touch1.clientY - touch0.clientY, touch1.clientX - touch0.clientX);\n if (this.lastAngle_ !== undefined) {\n var delta = angle - this.lastAngle_;\n this.rotationDelta_ += delta;\n if (!this.rotating_ &&\n Math.abs(this.rotationDelta_) > this.threshold_) {\n this.rotating_ = true;\n }\n rotationDelta = delta;\n }\n this.lastAngle_ = angle;\n var map = mapBrowserEvent.map;\n var view = map.getView();\n if (view.getConstraints().rotation === disable) {\n return;\n }\n // rotate anchor point.\n // FIXME: should be the intersection point between the lines:\n // touch0,touch1 and previousTouch0,previousTouch1\n var viewportPosition = map.getViewport().getBoundingClientRect();\n var centroid = centroidFromPointers(this.targetPointers);\n centroid[0] -= viewportPosition.left;\n centroid[1] -= viewportPosition.top;\n this.anchor_ = map.getCoordinateFromPixelInternal(centroid);\n // rotate\n if (this.rotating_) {\n map.render();\n view.adjustRotationInternal(rotationDelta, this.anchor_);\n }\n };\n /**\n * @inheritDoc\n */\n PinchRotate.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length < 2) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n view.endInteraction(this.duration_);\n return false;\n }\n else {\n return true;\n }\n };\n /**\n * @inheritDoc\n */\n PinchRotate.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length >= 2) {\n var map = mapBrowserEvent.map;\n this.anchor_ = null;\n this.lastAngle_ = undefined;\n this.rotating_ = false;\n this.rotationDelta_ = 0.0;\n if (!this.handlingDownUpSequence) {\n map.getView().beginInteraction();\n }\n return true;\n }\n else {\n return false;\n }\n };\n return PinchRotate;\n}(PointerInteraction));\nexport default PinchRotate;\n//# sourceMappingURL=PinchRotate.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/PinchZoom\n */\nimport { FALSE } from '../functions.js';\nimport PointerInteraction, { centroid as centroidFromPointers } from './Pointer.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=400] Animation duration in milliseconds.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map by pinching with two fingers\n * on a touch screen.\n * @api\n */\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function PinchZoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.anchor_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 400;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastDistance_ = undefined;\n /**\n * @private\n * @type {number}\n */\n _this.lastScaleDelta_ = 1;\n return _this;\n }\n /**\n * @inheritDoc\n */\n PinchZoom.prototype.handleDragEvent = function (mapBrowserEvent) {\n var scaleDelta = 1.0;\n var touch0 = this.targetPointers[0];\n var touch1 = this.targetPointers[1];\n var dx = touch0.clientX - touch1.clientX;\n var dy = touch0.clientY - touch1.clientY;\n // distance between touches\n var distance = Math.sqrt(dx * dx + dy * dy);\n if (this.lastDistance_ !== undefined) {\n scaleDelta = this.lastDistance_ / distance;\n }\n this.lastDistance_ = distance;\n var map = mapBrowserEvent.map;\n var view = map.getView();\n if (scaleDelta != 1.0) {\n this.lastScaleDelta_ = scaleDelta;\n }\n // scale anchor point.\n var viewportPosition = map.getViewport().getBoundingClientRect();\n var centroid = centroidFromPointers(this.targetPointers);\n centroid[0] -= viewportPosition.left;\n centroid[1] -= viewportPosition.top;\n this.anchor_ = map.getCoordinateFromPixelInternal(centroid);\n // scale, bypass the resolution constraint\n map.render();\n view.adjustResolutionInternal(scaleDelta, this.anchor_);\n };\n /**\n * @inheritDoc\n */\n PinchZoom.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length < 2) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n var direction = this.lastScaleDelta_ > 1 ? 1 : -1;\n view.endInteraction(this.duration_, direction);\n return false;\n }\n else {\n return true;\n }\n };\n /**\n * @inheritDoc\n */\n PinchZoom.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length >= 2) {\n var map = mapBrowserEvent.map;\n this.anchor_ = null;\n this.lastDistance_ = undefined;\n this.lastScaleDelta_ = 1;\n if (!this.handlingDownUpSequence) {\n map.getView().beginInteraction();\n }\n return true;\n }\n else {\n return false;\n }\n };\n return PinchZoom;\n}(PointerInteraction));\nexport default PinchZoom;\n//# sourceMappingURL=PinchZoom.js.map","/**\n * @module ol/interaction\n */\nimport Collection from './Collection.js';\nimport Kinetic from './Kinetic.js';\nimport DoubleClickZoom from './interaction/DoubleClickZoom.js';\nimport DragPan from './interaction/DragPan.js';\nimport DragRotate from './interaction/DragRotate.js';\nimport DragZoom from './interaction/DragZoom.js';\nimport KeyboardPan from './interaction/KeyboardPan.js';\nimport KeyboardZoom from './interaction/KeyboardZoom.js';\nimport MouseWheelZoom from './interaction/MouseWheelZoom.js';\nimport PinchRotate from './interaction/PinchRotate.js';\nimport PinchZoom from './interaction/PinchZoom.js';\nimport { focus } from './events/condition.js';\nexport { default as DoubleClickZoom } from './interaction/DoubleClickZoom.js';\nexport { default as DragAndDrop } from './interaction/DragAndDrop.js';\nexport { default as DragBox } from './interaction/DragBox.js';\nexport { default as DragPan } from './interaction/DragPan.js';\nexport { default as DragRotate } from './interaction/DragRotate.js';\nexport { default as DragRotateAndZoom } from './interaction/DragRotateAndZoom.js';\nexport { default as DragZoom } from './interaction/DragZoom.js';\nexport { default as Draw } from './interaction/Draw.js';\nexport { default as Extent } from './interaction/Extent.js';\nexport { default as Interaction } from './interaction/Interaction.js';\nexport { default as KeyboardPan } from './interaction/KeyboardPan.js';\nexport { default as KeyboardZoom } from './interaction/KeyboardZoom.js';\nexport { default as Modify } from './interaction/Modify.js';\nexport { default as MouseWheelZoom } from './interaction/MouseWheelZoom.js';\nexport { default as PinchRotate } from './interaction/PinchRotate.js';\nexport { default as PinchZoom } from './interaction/PinchZoom.js';\nexport { default as Pointer } from './interaction/Pointer.js';\nexport { default as Select } from './interaction/Select.js';\nexport { default as Snap } from './interaction/Snap.js';\nexport { default as Translate } from './interaction/Translate.js';\n/**\n * @typedef {Object} DefaultsOptions\n * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is\n * desired.\n * @property {boolean} [onFocusOnly=false] Interact only when the map has the\n * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is\n * useful when page scroll is desired for maps that do not have the browser's\n * focus.\n * @property {boolean} [doubleClickZoom=true] Whether double click zoom is\n * desired.\n * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.\n * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.\n * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.\n * @property {boolean} [dragPan=true] Whether drag pan is desired.\n * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.\n * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.\n * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.\n * @property {number} [zoomDuration] Duration of the zoom animation in\n * milliseconds.\n */\n/**\n * Set of interactions included in maps by default. Specific interactions can be\n * excluded by setting the appropriate option to false in the constructor\n * options, but the order of the interactions is fixed. If you want to specify\n * a different order for interactions, you will need to create your own\n * {@link module:ol/interaction/Interaction} instances and insert\n * them into a {@link module:ol/Collection} in the order you want\n * before creating your {@link module:ol/Map~Map} instance. Changing the order can\n * be of interest if the event propagation needs to be stopped at a point.\n * The default set of interactions, in sequence, is:\n * * {@link module:ol/interaction/DragRotate~DragRotate}\n * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}\n * * {@link module:ol/interaction/DragPan~DragPan}\n * * {@link module:ol/interaction/PinchRotate~PinchRotate}\n * * {@link module:ol/interaction/PinchZoom~PinchZoom}\n * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}\n * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}\n * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}\n * * {@link module:ol/interaction/DragZoom~DragZoom}\n *\n * @param {DefaultsOptions=} opt_options Defaults options.\n * @return {import(\"./Collection.js\").default<import(\"./interaction/Interaction.js\").default>}\n * A collection of interactions to be used with the {@link module:ol/Map~Map}\n * constructor's `interactions` option.\n * @api\n */\nexport function defaults(opt_options) {\n var options = opt_options ? opt_options : {};\n var interactions = new Collection();\n var kinetic = new Kinetic(-0.005, 0.05, 100);\n var altShiftDragRotate = options.altShiftDragRotate !== undefined ?\n options.altShiftDragRotate : true;\n if (altShiftDragRotate) {\n interactions.push(new DragRotate());\n }\n var doubleClickZoom = options.doubleClickZoom !== undefined ?\n options.doubleClickZoom : true;\n if (doubleClickZoom) {\n interactions.push(new DoubleClickZoom({\n delta: options.zoomDelta,\n duration: options.zoomDuration\n }));\n }\n var dragPan = options.dragPan !== undefined ? options.dragPan : true;\n if (dragPan) {\n interactions.push(new DragPan({\n condition: options.onFocusOnly ? focus : undefined,\n kinetic: kinetic\n }));\n }\n var pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate :\n true;\n if (pinchRotate) {\n interactions.push(new PinchRotate());\n }\n var pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;\n if (pinchZoom) {\n interactions.push(new PinchZoom({\n duration: options.zoomDuration\n }));\n }\n var keyboard = options.keyboard !== undefined ? options.keyboard : true;\n if (keyboard) {\n interactions.push(new KeyboardPan());\n interactions.push(new KeyboardZoom({\n delta: options.zoomDelta,\n duration: options.zoomDuration\n }));\n }\n var mouseWheelZoom = options.mouseWheelZoom !== undefined ?\n options.mouseWheelZoom : true;\n if (mouseWheelZoom) {\n interactions.push(new MouseWheelZoom({\n condition: options.onFocusOnly ? focus : undefined,\n duration: options.zoomDuration\n }));\n }\n var shiftDragZoom = options.shiftDragZoom !== undefined ?\n options.shiftDragZoom : true;\n if (shiftDragZoom) {\n interactions.push(new DragZoom({\n duration: options.zoomDuration\n }));\n }\n return interactions;\n}\n//# sourceMappingURL=interaction.js.map","/**\n * @module ol/render/Event\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport Event from '../events/Event.js';\nvar RenderEvent = /** @class */ (function (_super) {\n __extends(RenderEvent, _super);\n /**\n * @param {import(\"./EventType.js\").default} type Type.\n * @param {import(\"../transform.js\").Transform=} opt_inversePixelTransform Transform for\n * CSS pixels to rendered pixels.\n * @param {import(\"../PluggableMap.js\").FrameState=} opt_frameState Frame state.\n * @param {?CanvasRenderingContext2D=} opt_context Context.\n */\n function RenderEvent(type, opt_inversePixelTransform, opt_frameState, opt_context) {\n var _this = _super.call(this, type) || this;\n /**\n * Transform from CSS pixels (relative to the top-left corner of the map viewport)\n * to rendered pixels on this event's `context`.\n * @type {import(\"../transform.js\").Transform|undefined}\n * @api\n */\n _this.inversePixelTransform = opt_inversePixelTransform;\n /**\n * An object representing the current render frame state.\n * @type {import(\"../PluggableMap.js\").FrameState|undefined}\n * @api\n */\n _this.frameState = opt_frameState;\n /**\n * Canvas context. Not available when the event is dispatched by the map. Only available\n * when a Canvas renderer is used, null otherwise.\n * @type {CanvasRenderingContext2D|null|undefined}\n * @api\n */\n _this.context = opt_context;\n return _this;\n }\n return RenderEvent;\n}(Event));\nexport default RenderEvent;\n//# sourceMappingURL=Event.js.map","/**\n * @module ol/color\n */\nimport { assert } from './asserts.js';\nimport { clamp } from './math.js';\n/**\n * A color represented as a short array [red, green, blue, alpha].\n * red, green, and blue should be integers in the range 0..255 inclusive.\n * alpha should be a float in the range 0..1 inclusive. If no alpha value is\n * given then `1` will be used.\n * @typedef {Array<number>} Color\n * @api\n */\n/**\n * This RegExp matches # followed by 3, 4, 6, or 8 hex digits.\n * @const\n * @type {RegExp}\n * @private\n */\nvar HEX_COLOR_RE_ = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i;\n/**\n * Regular expression for matching potential named color style strings.\n * @const\n * @type {RegExp}\n * @private\n */\nvar NAMED_COLOR_RE_ = /^([a-z]*)$|^hsla?\\(.*\\)$/i;\n/**\n * Return the color as an rgba string.\n * @param {Color|string} color Color.\n * @return {string} Rgba string.\n * @api\n */\nexport function asString(color) {\n if (typeof color === 'string') {\n return color;\n }\n else {\n return toString(color);\n }\n}\n/**\n * Return named color as an rgba string.\n * @param {string} color Named color.\n * @return {string} Rgb string.\n */\nfunction fromNamed(color) {\n var el = document.createElement('div');\n el.style.color = color;\n if (el.style.color !== '') {\n document.body.appendChild(el);\n var rgb = getComputedStyle(el).color;\n document.body.removeChild(el);\n return rgb;\n }\n else {\n return '';\n }\n}\n/**\n * @param {string} s String.\n * @return {Color} Color.\n */\nexport var fromString = (function () {\n // We maintain a small cache of parsed strings. To provide cheap LRU-like\n // semantics, whenever the cache grows too large we simply delete an\n // arbitrary 25% of the entries.\n /**\n * @const\n * @type {number}\n */\n var MAX_CACHE_SIZE = 1024;\n /**\n * @type {Object<string, Color>}\n */\n var cache = {};\n /**\n * @type {number}\n */\n var cacheSize = 0;\n return (\n /**\n * @param {string} s String.\n * @return {Color} Color.\n */\n function (s) {\n var color;\n if (cache.hasOwnProperty(s)) {\n color = cache[s];\n }\n else {\n if (cacheSize >= MAX_CACHE_SIZE) {\n var i = 0;\n for (var key in cache) {\n if ((i++ & 3) === 0) {\n delete cache[key];\n --cacheSize;\n }\n }\n }\n color = fromStringInternal_(s);\n cache[s] = color;\n ++cacheSize;\n }\n return color;\n });\n})();\n/**\n * Return the color as an array. This function maintains a cache of calculated\n * arrays which means the result should not be modified.\n * @param {Color|string} color Color.\n * @return {Color} Color.\n * @api\n */\nexport function asArray(color) {\n if (Array.isArray(color)) {\n return color;\n }\n else {\n return fromString(color);\n }\n}\n/**\n * @param {string} s String.\n * @private\n * @return {Color} Color.\n */\nfunction fromStringInternal_(s) {\n var r, g, b, a, color;\n if (NAMED_COLOR_RE_.exec(s)) {\n s = fromNamed(s);\n }\n if (HEX_COLOR_RE_.exec(s)) { // hex\n var n = s.length - 1; // number of hex digits\n var d = // number of digits per channel\n void 0; // number of digits per channel\n if (n <= 4) {\n d = 1;\n }\n else {\n d = 2;\n }\n var hasAlpha = n === 4 || n === 8;\n r = parseInt(s.substr(1 + 0 * d, d), 16);\n g = parseInt(s.substr(1 + 1 * d, d), 16);\n b = parseInt(s.substr(1 + 2 * d, d), 16);\n if (hasAlpha) {\n a = parseInt(s.substr(1 + 3 * d, d), 16);\n }\n else {\n a = 255;\n }\n if (d == 1) {\n r = (r << 4) + r;\n g = (g << 4) + g;\n b = (b << 4) + b;\n if (hasAlpha) {\n a = (a << 4) + a;\n }\n }\n color = [r, g, b, a / 255];\n }\n else if (s.indexOf('rgba(') == 0) { // rgba()\n color = s.slice(5, -1).split(',').map(Number);\n normalize(color);\n }\n else if (s.indexOf('rgb(') == 0) { // rgb()\n color = s.slice(4, -1).split(',').map(Number);\n color.push(1);\n normalize(color);\n }\n else {\n assert(false, 14); // Invalid color\n }\n return color;\n}\n/**\n * TODO this function is only used in the test, we probably shouldn't export it\n * @param {Color} color Color.\n * @return {Color} Clamped color.\n */\nexport function normalize(color) {\n color[0] = clamp((color[0] + 0.5) | 0, 0, 255);\n color[1] = clamp((color[1] + 0.5) | 0, 0, 255);\n color[2] = clamp((color[2] + 0.5) | 0, 0, 255);\n color[3] = clamp(color[3], 0, 1);\n return color;\n}\n/**\n * @param {Color} color Color.\n * @return {string} String.\n */\nexport function toString(color) {\n var r = color[0];\n if (r != (r | 0)) {\n r = (r + 0.5) | 0;\n }\n var g = color[1];\n if (g != (g | 0)) {\n g = (g + 0.5) | 0;\n }\n var b = color[2];\n if (b != (b | 0)) {\n b = (b + 0.5) | 0;\n }\n var a = color[3] === undefined ? 1 : color[3];\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n}\n/**\n * @param {string} s String.\n * @return {boolean} Whether the string is actually a valid color\n */\nexport function isStringColor(s) {\n if (NAMED_COLOR_RE_.test(s)) {\n s = fromNamed(s);\n }\n return HEX_COLOR_RE_.test(s) || s.indexOf('rgba(') === 0 || s.indexOf('rgb(') === 0;\n}\n//# sourceMappingURL=color.js.map","/**\n * @module ol/style/IconImageCache\n */\nimport { asString } from '../color.js';\n/**\n * @classdesc\n * Singleton class. Available through {@link module:ol/style/IconImageCache~shared}.\n */\nvar IconImageCache = /** @class */ (function () {\n function IconImageCache() {\n /**\n * @type {!Object<string, import(\"./IconImage.js\").default>}\n * @private\n */\n this.cache_ = {};\n /**\n * @type {number}\n * @private\n */\n this.cacheSize_ = 0;\n /**\n * @type {number}\n * @private\n */\n this.maxCacheSize_ = 32;\n }\n /**\n * FIXME empty description for jsdoc\n */\n IconImageCache.prototype.clear = function () {\n this.cache_ = {};\n this.cacheSize_ = 0;\n };\n /**\n * @return {boolean} Can expire cache.\n */\n IconImageCache.prototype.canExpireCache = function () {\n return this.cacheSize_ > this.maxCacheSize_;\n };\n /**\n * FIXME empty description for jsdoc\n */\n IconImageCache.prototype.expire = function () {\n if (this.canExpireCache()) {\n var i = 0;\n for (var key in this.cache_) {\n var iconImage = this.cache_[key];\n if ((i++ & 3) === 0 && !iconImage.hasListener()) {\n delete this.cache_[key];\n --this.cacheSize_;\n }\n }\n }\n };\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {import(\"./IconImage.js\").default} Icon image.\n */\n IconImageCache.prototype.get = function (src, crossOrigin, color) {\n var key = getKey(src, crossOrigin, color);\n return key in this.cache_ ? this.cache_[key] : null;\n };\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @param {import(\"./IconImage.js\").default} iconImage Icon image.\n */\n IconImageCache.prototype.set = function (src, crossOrigin, color, iconImage) {\n var key = getKey(src, crossOrigin, color);\n this.cache_[key] = iconImage;\n ++this.cacheSize_;\n };\n /**\n * Set the cache size of the icon cache. Default is `32`. Change this value when\n * your map uses more than 32 different icon images and you are not caching icon\n * styles on the application level.\n * @param {number} maxCacheSize Cache max size.\n * @api\n */\n IconImageCache.prototype.setSize = function (maxCacheSize) {\n this.maxCacheSize_ = maxCacheSize;\n this.expire();\n };\n return IconImageCache;\n}());\n/**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {string} Cache key.\n */\nfunction getKey(src, crossOrigin, color) {\n var colorString = color ? asString(color) : 'null';\n return crossOrigin + ':' + src + ':' + colorString;\n}\nexport default IconImageCache;\n/**\n * The {@link module:ol/style/IconImageCache~IconImageCache} for\n * {@link module:ol/style/Icon~Icon} images.\n * @api\n */\nexport var shared = new IconImageCache();\n//# sourceMappingURL=IconImageCache.js.map","/**\n * @module ol/colorlike\n */\nimport { toString } from './color.js';\n/**\n * A type accepted by CanvasRenderingContext2D.fillStyle\n * or CanvasRenderingContext2D.strokeStyle.\n * Represents a color, pattern, or gradient. The origin for patterns and\n * gradients as fill style is an increment of 512 css pixels from map coordinate\n * `[0, 0]`. For seamless repeat patterns, width and height of the pattern image\n * must be a factor of two (2, 4, 8, ..., 512).\n *\n * @typedef {string|CanvasPattern|CanvasGradient} ColorLike\n * @api\n */\n/**\n * @param {import(\"./color.js\").Color|ColorLike} color Color.\n * @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}.\n * @api\n */\nexport function asColorLike(color) {\n if (Array.isArray(color)) {\n return toString(color);\n }\n else {\n return color;\n }\n}\n//# sourceMappingURL=colorlike.js.map","/**\n * @module ol/render/VectorContext\n */\n/**\n * @classdesc\n * Context for drawing geometries. A vector context is available on render\n * events and does not need to be constructed directly.\n * @api\n */\nvar VectorContext = /** @class */ (function () {\n function VectorContext() {\n }\n /**\n * Render a geometry with a custom renderer.\n *\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {Function} renderer Renderer.\n */\n VectorContext.prototype.drawCustom = function (geometry, feature, renderer) { };\n /**\n * Render a geometry.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry The geometry to render.\n */\n VectorContext.prototype.drawGeometry = function (geometry) { };\n /**\n * Set the rendering style.\n *\n * @param {import(\"../style/Style.js\").default} style The rendering style.\n */\n VectorContext.prototype.setStyle = function (style) { };\n /**\n * @param {import(\"../geom/Circle.js\").default} circleGeometry Circle geometry.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\n VectorContext.prototype.drawCircle = function (circleGeometry, feature) { };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n */\n VectorContext.prototype.drawFeature = function (feature, style) { };\n /**\n * @param {import(\"../geom/GeometryCollection.js\").default} geometryCollectionGeometry Geometry collection.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\n VectorContext.prototype.drawGeometryCollection = function (geometryCollectionGeometry, feature) { };\n /**\n * @param {import(\"../geom/LineString.js\").default|import(\"./Feature.js\").default} lineStringGeometry Line string geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawLineString = function (lineStringGeometry, feature) { };\n /**\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"./Feature.js\").default} multiLineStringGeometry MultiLineString geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawMultiLineString = function (multiLineStringGeometry, feature) { };\n /**\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"./Feature.js\").default} multiPointGeometry MultiPoint geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawMultiPoint = function (multiPointGeometry, feature) { };\n /**\n * @param {import(\"../geom/MultiPolygon.js\").default} multiPolygonGeometry MultiPolygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawMultiPolygon = function (multiPolygonGeometry, feature) { };\n /**\n * @param {import(\"../geom/Point.js\").default|import(\"./Feature.js\").default} pointGeometry Point geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawPoint = function (pointGeometry, feature) { };\n /**\n * @param {import(\"../geom/Polygon.js\").default|import(\"./Feature.js\").default} polygonGeometry Polygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawPolygon = function (polygonGeometry, feature) { };\n /**\n * @param {import(\"../geom/Geometry.js\").default|import(\"./Feature.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n VectorContext.prototype.drawText = function (geometry, feature) { };\n /**\n * @param {import(\"../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../style/Stroke.js\").default} strokeStyle Stroke style.\n */\n VectorContext.prototype.setFillStrokeStyle = function (fillStyle, strokeStyle) { };\n /**\n * @param {import(\"../style/Image.js\").default} imageStyle Image style.\n * @param {import(\"./canvas.js\").DeclutterGroup=} opt_declutterGroup Declutter.\n */\n VectorContext.prototype.setImageStyle = function (imageStyle, opt_declutterGroup) { };\n /**\n * @param {import(\"../style/Text.js\").default} textStyle Text style.\n * @param {import(\"./canvas.js\").DeclutterGroups=} opt_declutterGroups Declutter.\n */\n VectorContext.prototype.setTextStyle = function (textStyle, opt_declutterGroups) { };\n return VectorContext;\n}());\nexport default VectorContext;\n//# sourceMappingURL=VectorContext.js.map","/**\n * @module ol/render/canvas\n */\nimport { getFontParameters } from '../css.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport { clear } from '../obj.js';\nimport { create as createTransform } from '../transform.js';\nimport LabelCache from './canvas/LabelCache.js';\n/**\n * @typedef {Object} FillState\n * @property {import(\"../colorlike.js\").ColorLike} fillStyle\n */\n/**\n * @typedef {Object} FillStrokeState\n * @property {import(\"../colorlike.js\").ColorLike} [currentFillStyle]\n * @property {import(\"../colorlike.js\").ColorLike} [currentStrokeStyle]\n * @property {CanvasLineCap} [currentLineCap]\n * @property {Array<number>} currentLineDash\n * @property {number} [currentLineDashOffset]\n * @property {CanvasLineJoin} [currentLineJoin]\n * @property {number} [currentLineWidth]\n * @property {number} [currentMiterLimit]\n * @property {number} [lastStroke]\n * @property {import(\"../colorlike.js\").ColorLike} [fillStyle]\n * @property {import(\"../colorlike.js\").ColorLike} [strokeStyle]\n * @property {CanvasLineCap} [lineCap]\n * @property {Array<number>} lineDash\n * @property {number} [lineDashOffset]\n * @property {CanvasLineJoin} [lineJoin]\n * @property {number} [lineWidth]\n * @property {number} [miterLimit]\n */\n/**\n * @typedef {Object} StrokeState\n * @property {CanvasLineCap} lineCap\n * @property {Array<number>} lineDash\n * @property {number} lineDashOffset\n * @property {CanvasLineJoin} lineJoin\n * @property {number} lineWidth\n * @property {number} miterLimit\n * @property {import(\"../colorlike.js\").ColorLike} strokeStyle\n */\n/**\n * @typedef {Object} TextState\n * @property {string} font\n * @property {string} [textAlign]\n * @property {string} textBaseline\n * @property {string} [placement]\n * @property {number} [maxAngle]\n * @property {boolean} [overflow]\n * @property {import(\"../style/Fill.js\").default} [backgroundFill]\n * @property {import(\"../style/Stroke.js\").default} [backgroundStroke]\n * @property {number} [scale]\n * @property {Array<number>} [padding]\n */\n/**\n * Container for decluttered replay instructions that need to be rendered or\n * omitted together, i.e. when styles render both an image and text, or for the\n * characters that form text along lines. The basic elements of this array are\n * `[minX, minY, maxX, maxY, count]`, where the first four entries are the\n * rendered extent of the group in pixel space. `count` is the number of styles\n * in the group, i.e. 2 when an image and a text are grouped, or 1 otherwise.\n * In addition to these four elements, declutter instruction arrays (i.e. the\n * arguments to {@link module:ol/render/canvas~drawImage} are appended to the array.\n * @typedef {Array<*>} DeclutterGroup\n */\n/**\n * Declutter groups for support of multi geometries.\n * @typedef {Array<DeclutterGroup>} DeclutterGroups\n */\n/**\n * @const\n * @type {string}\n */\nexport var defaultFont = '10px sans-serif';\n/**\n * @const\n * @type {import(\"../colorlike.js\").ColorLike}\n */\nexport var defaultFillStyle = '#000';\n/**\n * @const\n * @type {CanvasLineCap}\n */\nexport var defaultLineCap = 'round';\n/**\n * @const\n * @type {Array<number>}\n */\nexport var defaultLineDash = [];\n/**\n * @const\n * @type {number}\n */\nexport var defaultLineDashOffset = 0;\n/**\n * @const\n * @type {CanvasLineJoin}\n */\nexport var defaultLineJoin = 'round';\n/**\n * @const\n * @type {number}\n */\nexport var defaultMiterLimit = 10;\n/**\n * @const\n * @type {import(\"../colorlike.js\").ColorLike}\n */\nexport var defaultStrokeStyle = '#000';\n/**\n * @const\n * @type {string}\n */\nexport var defaultTextAlign = 'center';\n/**\n * @const\n * @type {string}\n */\nexport var defaultTextBaseline = 'middle';\n/**\n * @const\n * @type {Array<number>}\n */\nexport var defaultPadding = [0, 0, 0, 0];\n/**\n * @const\n * @type {number}\n */\nexport var defaultLineWidth = 1;\n/**\n * The label cache for text rendering. To change the default cache size of 2048\n * entries, use {@link module:ol/structs/LRUCache#setSize}.\n * @type {LabelCache}\n * @api\n */\nexport var labelCache = new LabelCache();\n/**\n * @type {!Object<string, number>}\n */\nexport var checkedFonts = {};\n/**\n * @type {CanvasRenderingContext2D}\n */\nvar measureContext = null;\n/**\n * @type {string}\n */\nvar measureFont;\n/**\n * @type {!Object<string, number>}\n */\nexport var textHeights = {};\n/**\n * Clears the label cache when a font becomes available.\n * @param {string} fontSpec CSS font spec.\n */\nexport var checkFont = (function () {\n var retries = 100;\n var checked = checkedFonts;\n var size = '32px ';\n var referenceFonts = ['monospace', 'serif'];\n var len = referenceFonts.length;\n var text = 'wmytzilWMYTZIL@#/&?$%10\\uF013';\n var interval, referenceWidth;\n /**\n * @param {string} fontStyle Css font-style\n * @param {string} fontWeight Css font-weight\n * @param {*} fontFamily Css font-family\n * @return {boolean} Font with style and weight is available\n */\n function isAvailable(fontStyle, fontWeight, fontFamily) {\n var context = getMeasureContext();\n var available = true;\n for (var i = 0; i < len; ++i) {\n var referenceFont = referenceFonts[i];\n context.font = fontStyle + ' ' + fontWeight + ' ' + size + referenceFont;\n referenceWidth = context.measureText(text).width;\n if (fontFamily != referenceFont) {\n context.font = fontStyle + ' ' + fontWeight + ' ' + size + fontFamily + ',' + referenceFont;\n var width = context.measureText(text).width;\n // If width and referenceWidth are the same, then the fallback was used\n // instead of the font we wanted, so the font is not available.\n available = available && width != referenceWidth;\n }\n }\n if (available) {\n return true;\n }\n return false;\n }\n function check() {\n var done = true;\n for (var font in checked) {\n if (checked[font] < retries) {\n if (isAvailable.apply(this, font.split('\\n'))) {\n checked[font] = retries;\n clear(textHeights);\n // Make sure that loaded fonts are picked up by Safari\n measureContext = null;\n measureFont = undefined;\n if (labelCache.getCount()) {\n labelCache.clear();\n }\n }\n else {\n ++checked[font];\n done = false;\n }\n }\n }\n if (done) {\n clearInterval(interval);\n interval = undefined;\n }\n }\n return function (fontSpec) {\n var font = getFontParameters(fontSpec);\n if (!font) {\n return;\n }\n var families = font.families;\n for (var i = 0, ii = families.length; i < ii; ++i) {\n var family = families[i];\n var key = font.style + '\\n' + font.weight + '\\n' + family;\n if (!(key in checked)) {\n checked[key] = retries;\n if (!isAvailable(font.style, font.weight, family)) {\n checked[key] = 0;\n if (interval === undefined) {\n interval = setInterval(check, 32);\n }\n }\n }\n }\n };\n})();\n/**\n * @return {CanvasRenderingContext2D} Measure context.\n */\nfunction getMeasureContext() {\n if (!measureContext) {\n measureContext = createCanvasContext2D(1, 1);\n }\n return measureContext;\n}\n/**\n * @param {string} font Font to use for measuring.\n * @return {import(\"../size.js\").Size} Measurement.\n */\nexport var measureTextHeight = (function () {\n /**\n * @type {HTMLDivElement}\n */\n var div;\n var heights = textHeights;\n return function (font) {\n var height = heights[font];\n if (height == undefined) {\n if (!div) {\n div = document.createElement('div');\n div.innerHTML = 'M';\n div.style.margin = '0 !important';\n div.style.padding = '0 !important';\n div.style.position = 'absolute !important';\n div.style.left = '-99999px !important';\n }\n div.style.font = font;\n document.body.appendChild(div);\n height = div.offsetHeight;\n heights[font] = height;\n document.body.removeChild(div);\n }\n return height;\n };\n})();\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {number} Width.\n */\nexport function measureTextWidth(font, text) {\n var measureContext = getMeasureContext();\n if (font != measureFont) {\n measureContext.font = font;\n measureFont = measureContext.font;\n }\n return measureContext.measureText(text).width;\n}\n/**\n * Measure text width using a cache.\n * @param {string} font The font.\n * @param {string} text The text to measure.\n * @param {Object<string, number>} cache A lookup of cached widths by text.\n * @returns {number} The text width.\n */\nexport function measureAndCacheTextWidth(font, text, cache) {\n if (text in cache) {\n return cache[text];\n }\n var width = measureTextWidth(font, text);\n cache[text] = width;\n return width;\n}\n/**\n * @param {string} font Font to use for measuring.\n * @param {Array<string>} lines Lines to measure.\n * @param {Array<number>} widths Array will be populated with the widths of\n * each line.\n * @return {number} Width of the whole text.\n */\nexport function measureTextWidths(font, lines, widths) {\n var numLines = lines.length;\n var width = 0;\n for (var i = 0; i < numLines; ++i) {\n var currentWidth = measureTextWidth(font, lines[i]);\n width = Math.max(width, currentWidth);\n widths.push(currentWidth);\n }\n return width;\n}\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} rotation Rotation.\n * @param {number} offsetX X offset.\n * @param {number} offsetY Y offset.\n */\nexport function rotateAtOffset(context, rotation, offsetX, offsetY) {\n if (rotation !== 0) {\n context.translate(offsetX, offsetY);\n context.rotate(rotation);\n context.translate(-offsetX, -offsetY);\n }\n}\nexport var resetTransform = createTransform();\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../transform.js\").Transform|null} transform Transform.\n * @param {number} opacity Opacity.\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image Image.\n * @param {number} originX Origin X.\n * @param {number} originY Origin Y.\n * @param {number} w Width.\n * @param {number} h Height.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {number} scale Scale.\n */\nexport function drawImage(context, transform, opacity, image, originX, originY, w, h, x, y, scale) {\n var alpha;\n if (opacity != 1) {\n alpha = context.globalAlpha;\n context.globalAlpha = alpha * opacity;\n }\n if (transform) {\n context.setTransform.apply(context, transform);\n }\n context.drawImage(image, originX, originY, w, h, x, y, w * scale, h * scale);\n if (opacity != 1) {\n context.globalAlpha = alpha;\n }\n if (transform) {\n context.setTransform.apply(context, resetTransform);\n }\n}\n//# sourceMappingURL=canvas.js.map","/**\n * @module ol/structs/LRUCache\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { assert } from '../asserts.js';\nimport EventTarget from '../events/Target.js';\nimport EventType from '../events/EventType.js';\n/**\n * @typedef {Object} Entry\n * @property {string} key_\n * @property {Object} newer\n * @property {Object} older\n * @property {*} value_\n */\n/**\n * @classdesc\n * Implements a Least-Recently-Used cache where the keys do not conflict with\n * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring\n * items from the cache is the responsibility of the user.\n *\n * @fires import(\"../events/Event.js\").default\n * @template T\n */\nvar LRUCache = /** @class */ (function (_super) {\n __extends(LRUCache, _super);\n /**\n * @param {number=} opt_highWaterMark High water mark.\n */\n function LRUCache(opt_highWaterMark) {\n var _this = _super.call(this) || this;\n /**\n * @type {number}\n */\n _this.highWaterMark = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048;\n /**\n * @private\n * @type {number}\n */\n _this.count_ = 0;\n /**\n * @private\n * @type {!Object<string, Entry>}\n */\n _this.entries_ = {};\n /**\n * @private\n * @type {?Entry}\n */\n _this.oldest_ = null;\n /**\n * @private\n * @type {?Entry}\n */\n _this.newest_ = null;\n return _this;\n }\n /**\n * @return {boolean} Can expire cache.\n */\n LRUCache.prototype.canExpireCache = function () {\n return this.getCount() > this.highWaterMark;\n };\n /**\n * FIXME empty description for jsdoc\n */\n LRUCache.prototype.clear = function () {\n this.count_ = 0;\n this.entries_ = {};\n this.oldest_ = null;\n this.newest_ = null;\n this.dispatchEvent(EventType.CLEAR);\n };\n /**\n * @param {string} key Key.\n * @return {boolean} Contains key.\n */\n LRUCache.prototype.containsKey = function (key) {\n return this.entries_.hasOwnProperty(key);\n };\n /**\n * @param {function(T, string, LRUCache<T>): ?} f The function\n * to call for every entry from the oldest to the newer. This function takes\n * 3 arguments (the entry value, the entry key and the LRUCache object).\n * The return value is ignored.\n */\n LRUCache.prototype.forEach = function (f) {\n var entry = this.oldest_;\n while (entry) {\n f(entry.value_, entry.key_, this);\n entry = entry.newer;\n }\n };\n /**\n * @param {string} key Key.\n * @param {*=} opt_options Options (reserverd for subclasses).\n * @return {T} Value.\n */\n LRUCache.prototype.get = function (key, opt_options) {\n var entry = this.entries_[key];\n assert(entry !== undefined, 15); // Tried to get a value for a key that does not exist in the cache\n if (entry === this.newest_) {\n return entry.value_;\n }\n else if (entry === this.oldest_) {\n this.oldest_ = /** @type {Entry} */ (this.oldest_.newer);\n this.oldest_.older = null;\n }\n else {\n entry.newer.older = entry.older;\n entry.older.newer = entry.newer;\n }\n entry.newer = null;\n entry.older = this.newest_;\n this.newest_.newer = entry;\n this.newest_ = entry;\n return entry.value_;\n };\n /**\n * Remove an entry from the cache.\n * @param {string} key The entry key.\n * @return {T} The removed entry.\n */\n LRUCache.prototype.remove = function (key) {\n var entry = this.entries_[key];\n assert(entry !== undefined, 15); // Tried to get a value for a key that does not exist in the cache\n if (entry === this.newest_) {\n this.newest_ = /** @type {Entry} */ (entry.older);\n if (this.newest_) {\n this.newest_.newer = null;\n }\n }\n else if (entry === this.oldest_) {\n this.oldest_ = /** @type {Entry} */ (entry.newer);\n if (this.oldest_) {\n this.oldest_.older = null;\n }\n }\n else {\n entry.newer.older = entry.older;\n entry.older.newer = entry.newer;\n }\n delete this.entries_[key];\n --this.count_;\n return entry.value_;\n };\n /**\n * @return {number} Count.\n */\n LRUCache.prototype.getCount = function () {\n return this.count_;\n };\n /**\n * @return {Array<string>} Keys.\n */\n LRUCache.prototype.getKeys = function () {\n var keys = new Array(this.count_);\n var i = 0;\n var entry;\n for (entry = this.newest_; entry; entry = entry.older) {\n keys[i++] = entry.key_;\n }\n return keys;\n };\n /**\n * @return {Array<T>} Values.\n */\n LRUCache.prototype.getValues = function () {\n var values = new Array(this.count_);\n var i = 0;\n var entry;\n for (entry = this.newest_; entry; entry = entry.older) {\n values[i++] = entry.value_;\n }\n return values;\n };\n /**\n * @return {T} Last value.\n */\n LRUCache.prototype.peekLast = function () {\n return this.oldest_.value_;\n };\n /**\n * @return {string} Last key.\n */\n LRUCache.prototype.peekLastKey = function () {\n return this.oldest_.key_;\n };\n /**\n * Get the key of the newest item in the cache. Throws if the cache is empty.\n * @return {string} The newest key.\n */\n LRUCache.prototype.peekFirstKey = function () {\n return this.newest_.key_;\n };\n /**\n * @return {T} value Value.\n */\n LRUCache.prototype.pop = function () {\n var entry = this.oldest_;\n delete this.entries_[entry.key_];\n if (entry.newer) {\n entry.newer.older = null;\n }\n this.oldest_ = /** @type {Entry} */ (entry.newer);\n if (!this.oldest_) {\n this.newest_ = null;\n }\n --this.count_;\n return entry.value_;\n };\n /**\n * @param {string} key Key.\n * @param {T} value Value.\n */\n LRUCache.prototype.replace = function (key, value) {\n this.get(key); // update `newest_`\n this.entries_[key].value_ = value;\n };\n /**\n * @param {string} key Key.\n * @param {T} value Value.\n */\n LRUCache.prototype.set = function (key, value) {\n assert(!(key in this.entries_), 16); // Tried to set a value for a key that is used already\n var entry = {\n key_: key,\n newer: null,\n older: this.newest_,\n value_: value\n };\n if (!this.newest_) {\n this.oldest_ = entry;\n }\n else {\n this.newest_.newer = entry;\n }\n this.newest_ = entry;\n this.entries_[key] = entry;\n ++this.count_;\n };\n /**\n * Set a maximum number of entries for the cache.\n * @param {number} size Cache size.\n * @api\n */\n LRUCache.prototype.setSize = function (size) {\n this.highWaterMark = size;\n };\n return LRUCache;\n}(EventTarget));\nexport default LRUCache;\n//# sourceMappingURL=LRUCache.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { getUid } from '../../util.js';\nimport LRUCache from '../../structs/LRUCache.js';\n/**\n * @module ol/render/canvas/LabelCache\n */\n/**\n * @classdesc\n * Cache of pre-rendered labels.\n */\nvar LabelCache = /** @class */ (function (_super) {\n __extends(LabelCache, _super);\n /**\n * @inheritDoc\n */\n function LabelCache(opt_highWaterMark) {\n var _this = _super.call(this, opt_highWaterMark) || this;\n _this.consumers = {};\n return _this;\n }\n LabelCache.prototype.clear = function () {\n this.consumers = {};\n _super.prototype.clear.call(this);\n };\n /**\n * @override\n * @param {string} key Label key.\n * @param {import(\"./Executor.js\").default} consumer Label consumer.\n * @return {HTMLCanvasElement} Label.\n */\n LabelCache.prototype.get = function (key, consumer) {\n var canvas = _super.prototype.get.call(this, key);\n var consumerId = getUid(consumer);\n if (!(consumerId in this.consumers)) {\n this.consumers[consumerId] = {};\n }\n this.consumers[consumerId][key] = true;\n return canvas;\n };\n LabelCache.prototype.prune = function () {\n outer: while (this.canExpireCache()) {\n var key = this.peekLastKey();\n for (var consumerId in this.consumers) {\n if (key in this.consumers[consumerId]) {\n break outer;\n }\n }\n var canvas = this.pop();\n canvas.width = 0;\n canvas.height = 0;\n for (var consumerId in this.consumers) {\n delete this.consumers[consumerId][key];\n }\n }\n };\n /**\n * @param {import(\"./Executor.js\").default} consumer Label consumer.\n */\n LabelCache.prototype.release = function (consumer) {\n delete this.consumers[getUid(consumer)];\n };\n return LabelCache;\n}(LRUCache));\nexport default LabelCache;\n//# sourceMappingURL=LabelCache.js.map","/**\n * @module ol/render/canvas/Immediate\n */\n// FIXME test, especially polygons with holes and multipolygons\n// FIXME need to handle large thick features (where pixel size matters)\n// FIXME add offset and end to ol/geom/flat/transform~transform2D?\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { equals } from '../../array.js';\nimport { asColorLike } from '../../colorlike.js';\nimport { intersects } from '../../extent.js';\nimport GeometryType from '../../geom/GeometryType.js';\nimport { transformGeom2D } from '../../geom/SimpleGeometry.js';\nimport { transform2D } from '../../geom/flat/transform.js';\nimport VectorContext from '../VectorContext.js';\nimport { defaultTextAlign, defaultFillStyle, defaultLineCap, defaultLineDash, defaultLineDashOffset, defaultLineJoin, defaultLineWidth, defaultMiterLimit, defaultStrokeStyle, defaultTextBaseline, defaultFont } from '../canvas.js';\nimport { create as createTransform, compose as composeTransform } from '../../transform.js';\n/**\n * @classdesc\n * A concrete subclass of {@link module:ol/render/VectorContext} that implements\n * direct rendering of features and geometries to an HTML5 Canvas context.\n * Instances of this class are created internally by the library and\n * provided to application code as vectorContext member of the\n * {@link module:ol/render/Event~RenderEvent} object associated with postcompose, precompose and\n * render events emitted by layers and maps.\n */\nvar CanvasImmediateRenderer = /** @class */ (function (_super) {\n __extends(CanvasImmediateRenderer, _super);\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {number=} opt_squaredTolerance Optional squared tolerance for simplification.\n * @param {import(\"../../proj.js\").TransformFunction=} opt_userTransform Transform from user to view projection.\n */\n function CanvasImmediateRenderer(context, pixelRatio, extent, transform, viewRotation, opt_squaredTolerance, opt_userTransform) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n _this.context_ = context;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ = pixelRatio;\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.extent_ = extent;\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.transform_ = transform;\n /**\n * @private\n * @type {number}\n */\n _this.viewRotation_ = viewRotation;\n /**\n * @private\n * @type {number}\n */\n _this.squaredTolerance_ = opt_squaredTolerance;\n /**\n * @private\n * @type {import(\"../../proj.js\").TransformFunction}\n */\n _this.userTransform_ = opt_userTransform;\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n _this.contextFillState_ = null;\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n _this.contextStrokeState_ = null;\n /**\n * @private\n * @type {?import(\"../canvas.js\").TextState}\n */\n _this.contextTextState_ = null;\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n _this.fillState_ = null;\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n _this.strokeState_ = null;\n /**\n * @private\n * @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement}\n */\n _this.image_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.imageAnchorX_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageAnchorY_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageHeight_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageOpacity_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageOriginX_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageOriginY_ = 0;\n /**\n * @private\n * @type {boolean}\n */\n _this.imageRotateWithView_ = false;\n /**\n * @private\n * @type {number}\n */\n _this.imageRotation_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageScale_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.imageWidth_ = 0;\n /**\n * @private\n * @type {string}\n */\n _this.text_ = '';\n /**\n * @private\n * @type {number}\n */\n _this.textOffsetX_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.textOffsetY_ = 0;\n /**\n * @private\n * @type {boolean}\n */\n _this.textRotateWithView_ = false;\n /**\n * @private\n * @type {number}\n */\n _this.textRotation_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.textScale_ = 0;\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n _this.textFillState_ = null;\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n _this.textStrokeState_ = null;\n /**\n * @private\n * @type {?import(\"../canvas.js\").TextState}\n */\n _this.textState_ = null;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.pixelCoordinates_ = [];\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.tmpLocalTransform_ = createTransform();\n return _this;\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 * @private\n */\n CanvasImmediateRenderer.prototype.drawImages_ = function (flatCoordinates, offset, end, stride) {\n if (!this.image_) {\n return;\n }\n var pixelCoordinates = transform2D(flatCoordinates, offset, end, 2, this.transform_, this.pixelCoordinates_);\n var context = this.context_;\n var localTransform = this.tmpLocalTransform_;\n var alpha = context.globalAlpha;\n if (this.imageOpacity_ != 1) {\n context.globalAlpha = alpha * this.imageOpacity_;\n }\n var rotation = this.imageRotation_;\n if (this.imageRotateWithView_) {\n rotation += this.viewRotation_;\n }\n for (var i = 0, ii = pixelCoordinates.length; i < ii; i += 2) {\n var x = pixelCoordinates[i] - this.imageAnchorX_;\n var y = pixelCoordinates[i + 1] - this.imageAnchorY_;\n if (rotation !== 0 || this.imageScale_ != 1) {\n var centerX = x + this.imageAnchorX_;\n var centerY = y + this.imageAnchorY_;\n composeTransform(localTransform, centerX, centerY, this.imageScale_, this.imageScale_, rotation, -centerX, -centerY);\n context.setTransform.apply(context, localTransform);\n }\n context.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, x, y, this.imageWidth_, this.imageHeight_);\n }\n if (rotation !== 0 || this.imageScale_ != 1) {\n context.setTransform(1, 0, 0, 1, 0, 0);\n }\n if (this.imageOpacity_ != 1) {\n context.globalAlpha = alpha;\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 * @private\n */\n CanvasImmediateRenderer.prototype.drawText_ = function (flatCoordinates, offset, end, stride) {\n if (!this.textState_ || this.text_ === '') {\n return;\n }\n if (this.textFillState_) {\n this.setContextFillState_(this.textFillState_);\n }\n if (this.textStrokeState_) {\n this.setContextStrokeState_(this.textStrokeState_);\n }\n this.setContextTextState_(this.textState_);\n var pixelCoordinates = transform2D(flatCoordinates, offset, end, stride, this.transform_, this.pixelCoordinates_);\n var context = this.context_;\n var rotation = this.textRotation_;\n if (this.textRotateWithView_) {\n rotation += this.viewRotation_;\n }\n for (; offset < end; offset += stride) {\n var x = pixelCoordinates[offset] + this.textOffsetX_;\n var y = pixelCoordinates[offset + 1] + this.textOffsetY_;\n if (rotation !== 0 || this.textScale_ != 1) {\n var localTransform = composeTransform(this.tmpLocalTransform_, x, y, this.textScale_, this.textScale_, rotation, -x, -y);\n context.setTransform.apply(context, localTransform);\n }\n if (this.textStrokeState_) {\n context.strokeText(this.text_, x, y);\n }\n if (this.textFillState_) {\n context.fillText(this.text_, x, y);\n }\n }\n if (rotation !== 0 || this.textScale_ != 1) {\n context.setTransform(1, 0, 0, 1, 0, 0);\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 {boolean} close Close.\n * @private\n * @return {number} end End.\n */\n CanvasImmediateRenderer.prototype.moveToLineTo_ = function (flatCoordinates, offset, end, stride, close) {\n var context = this.context_;\n var pixelCoordinates = transform2D(flatCoordinates, offset, end, stride, this.transform_, this.pixelCoordinates_);\n context.moveTo(pixelCoordinates[0], pixelCoordinates[1]);\n var length = pixelCoordinates.length;\n if (close) {\n length -= 2;\n }\n for (var i = 2; i < length; i += 2) {\n context.lineTo(pixelCoordinates[i], pixelCoordinates[i + 1]);\n }\n if (close) {\n context.closePath();\n }\n return end;\n };\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @private\n * @return {number} End.\n */\n CanvasImmediateRenderer.prototype.drawRings_ = function (flatCoordinates, offset, ends, stride) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.moveToLineTo_(flatCoordinates, offset, ends[i], stride, true);\n }\n return offset;\n };\n /**\n * Render a circle geometry into the canvas. Rendering is immediate and uses\n * the current fill and stroke styles.\n *\n * @param {import(\"../../geom/Circle.js\").default} geometry Circle geometry.\n * @override\n * @api\n */\n CanvasImmediateRenderer.prototype.drawCircle = function (geometry) {\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.fillState_ || this.strokeState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n var pixelCoordinates = transformGeom2D(geometry, this.transform_, this.pixelCoordinates_);\n var dx = pixelCoordinates[2] - pixelCoordinates[0];\n var dy = pixelCoordinates[3] - pixelCoordinates[1];\n var radius = Math.sqrt(dx * dx + dy * dy);\n var context = this.context_;\n context.beginPath();\n context.arc(pixelCoordinates[0], pixelCoordinates[1], radius, 0, 2 * Math.PI);\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n this.drawText_(geometry.getCenter(), 0, 2, 2);\n }\n };\n /**\n * Set the rendering style. Note that since this is an immediate rendering API,\n * any `zIndex` on the provided style will be ignored.\n *\n * @param {import(\"../../style/Style.js\").default} style The rendering style.\n * @override\n * @api\n */\n CanvasImmediateRenderer.prototype.setStyle = function (style) {\n this.setFillStrokeStyle(style.getFill(), style.getStroke());\n this.setImageStyle(style.getImage());\n this.setTextStyle(style.getText());\n };\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n */\n CanvasImmediateRenderer.prototype.setTransform = function (transform) {\n this.transform_ = transform;\n };\n /**\n * Render a geometry into the canvas. Call\n * {@link module:ol/render/canvas/Immediate#setStyle} first to set the rendering style.\n *\n * @param {import(\"../../geom/Geometry.js\").default|import(\"../Feature.js\").default} geometry The geometry to render.\n * @override\n * @api\n */\n CanvasImmediateRenderer.prototype.drawGeometry = function (geometry) {\n var type = geometry.getType();\n switch (type) {\n case GeometryType.POINT:\n this.drawPoint(/** @type {import(\"../../geom/Point.js\").default} */ (geometry));\n break;\n case GeometryType.LINE_STRING:\n this.drawLineString(/** @type {import(\"../../geom/LineString.js\").default} */ (geometry));\n break;\n case GeometryType.POLYGON:\n this.drawPolygon(/** @type {import(\"../../geom/Polygon.js\").default} */ (geometry));\n break;\n case GeometryType.MULTI_POINT:\n this.drawMultiPoint(/** @type {import(\"../../geom/MultiPoint.js\").default} */ (geometry));\n break;\n case GeometryType.MULTI_LINE_STRING:\n this.drawMultiLineString(/** @type {import(\"../../geom/MultiLineString.js\").default} */ (geometry));\n break;\n case GeometryType.MULTI_POLYGON:\n this.drawMultiPolygon(/** @type {import(\"../../geom/MultiPolygon.js\").default} */ (geometry));\n break;\n case GeometryType.GEOMETRY_COLLECTION:\n this.drawGeometryCollection(/** @type {import(\"../../geom/GeometryCollection.js\").default} */ (geometry));\n break;\n case GeometryType.CIRCLE:\n this.drawCircle(/** @type {import(\"../../geom/Circle.js\").default} */ (geometry));\n break;\n default:\n }\n };\n /**\n * Render a feature into the canvas. Note that any `zIndex` on the provided\n * style will be ignored - features are rendered immediately in the order that\n * this method is called. If you need `zIndex` support, you should be using an\n * {@link module:ol/layer/Vector~VectorLayer} instead.\n *\n * @param {import(\"../../Feature.js\").default} feature Feature.\n * @param {import(\"../../style/Style.js\").default} style Style.\n * @override\n * @api\n */\n CanvasImmediateRenderer.prototype.drawFeature = function (feature, style) {\n var geometry = style.getGeometryFunction()(feature);\n if (!geometry || !intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n this.setStyle(style);\n this.drawGeometry(geometry);\n };\n /**\n * Render a GeometryCollection to the canvas. Rendering is immediate and\n * uses the current styles appropriate for each geometry in the collection.\n *\n * @param {import(\"../../geom/GeometryCollection.js\").default} geometry Geometry collection.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawGeometryCollection = function (geometry) {\n var geometries = geometry.getGeometriesArray();\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n this.drawGeometry(geometries[i]);\n }\n };\n /**\n * Render a Point geometry into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/Point.js\").default|import(\"../Feature.js\").default} geometry Point geometry.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawPoint = function (geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Point.js\").default} */ (geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_));\n }\n var flatCoordinates = geometry.getFlatCoordinates();\n var stride = geometry.getStride();\n if (this.image_) {\n this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n if (this.text_ !== '') {\n this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n };\n /**\n * Render a MultiPoint geometry into the canvas. Rendering is immediate and\n * uses the current style.\n *\n * @param {import(\"../../geom/MultiPoint.js\").default|import(\"../Feature.js\").default} geometry MultiPoint geometry.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawMultiPoint = function (geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiPoint.js\").default} */ (geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_));\n }\n var flatCoordinates = geometry.getFlatCoordinates();\n var stride = geometry.getStride();\n if (this.image_) {\n this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n if (this.text_ !== '') {\n this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n };\n /**\n * Render a LineString into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/LineString.js\").default|import(\"../Feature.js\").default} geometry LineString geometry.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawLineString = function (geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/LineString.js\").default} */ (geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_));\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n var context = this.context_;\n var flatCoordinates = geometry.getFlatCoordinates();\n context.beginPath();\n this.moveToLineTo_(flatCoordinates, 0, flatCoordinates.length, geometry.getStride(), false);\n context.stroke();\n }\n if (this.text_ !== '') {\n var flatMidpoint = geometry.getFlatMidpoint();\n this.drawText_(flatMidpoint, 0, 2, 2);\n }\n };\n /**\n * Render a MultiLineString geometry into the canvas. Rendering is immediate\n * and uses the current style.\n *\n * @param {import(\"../../geom/MultiLineString.js\").default|import(\"../Feature.js\").default} geometry MultiLineString geometry.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawMultiLineString = function (geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiLineString.js\").default} */ (geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_));\n }\n var geometryExtent = geometry.getExtent();\n if (!intersects(this.extent_, geometryExtent)) {\n return;\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n var context = this.context_;\n var flatCoordinates = geometry.getFlatCoordinates();\n var offset = 0;\n var ends = /** @type {Array<number>} */ (geometry.getEnds());\n var stride = geometry.getStride();\n context.beginPath();\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.moveToLineTo_(flatCoordinates, offset, ends[i], stride, false);\n }\n context.stroke();\n }\n if (this.text_ !== '') {\n var flatMidpoints = geometry.getFlatMidpoints();\n this.drawText_(flatMidpoints, 0, flatMidpoints.length, 2);\n }\n };\n /**\n * Render a Polygon geometry into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/Polygon.js\").default|import(\"../Feature.js\").default} geometry Polygon geometry.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawPolygon = function (geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Polygon.js\").default} */ (geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_));\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_ || this.fillState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n var context = this.context_;\n context.beginPath();\n this.drawRings_(geometry.getOrientedFlatCoordinates(), 0, /** @type {Array<number>} */ (geometry.getEnds()), geometry.getStride());\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n var flatInteriorPoint = geometry.getFlatInteriorPoint();\n this.drawText_(flatInteriorPoint, 0, 2, 2);\n }\n };\n /**\n * Render MultiPolygon geometry into the canvas. Rendering is immediate and\n * uses the current style.\n * @param {import(\"../../geom/MultiPolygon.js\").default} geometry MultiPolygon geometry.\n * @override\n */\n CanvasImmediateRenderer.prototype.drawMultiPolygon = function (geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_));\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_ || this.fillState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n var context = this.context_;\n var flatCoordinates = geometry.getOrientedFlatCoordinates();\n var offset = 0;\n var endss = geometry.getEndss();\n var stride = geometry.getStride();\n context.beginPath();\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n offset = this.drawRings_(flatCoordinates, offset, ends, stride);\n }\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n var flatInteriorPoints = geometry.getFlatInteriorPoints();\n this.drawText_(flatInteriorPoints, 0, flatInteriorPoints.length, 2);\n }\n };\n /**\n * @param {import(\"../canvas.js\").FillState} fillState Fill state.\n * @private\n */\n CanvasImmediateRenderer.prototype.setContextFillState_ = function (fillState) {\n var context = this.context_;\n var contextFillState = this.contextFillState_;\n if (!contextFillState) {\n context.fillStyle = fillState.fillStyle;\n this.contextFillState_ = {\n fillStyle: fillState.fillStyle\n };\n }\n else {\n if (contextFillState.fillStyle != fillState.fillStyle) {\n contextFillState.fillStyle = fillState.fillStyle;\n context.fillStyle = fillState.fillStyle;\n }\n }\n };\n /**\n * @param {import(\"../canvas.js\").StrokeState} strokeState Stroke state.\n * @private\n */\n CanvasImmediateRenderer.prototype.setContextStrokeState_ = function (strokeState) {\n var context = this.context_;\n var contextStrokeState = this.contextStrokeState_;\n if (!contextStrokeState) {\n context.lineCap = strokeState.lineCap;\n if (context.setLineDash) {\n context.setLineDash(strokeState.lineDash);\n context.lineDashOffset = strokeState.lineDashOffset;\n }\n context.lineJoin = strokeState.lineJoin;\n context.lineWidth = strokeState.lineWidth;\n context.miterLimit = strokeState.miterLimit;\n context.strokeStyle = strokeState.strokeStyle;\n this.contextStrokeState_ = {\n lineCap: strokeState.lineCap,\n lineDash: strokeState.lineDash,\n lineDashOffset: strokeState.lineDashOffset,\n lineJoin: strokeState.lineJoin,\n lineWidth: strokeState.lineWidth,\n miterLimit: strokeState.miterLimit,\n strokeStyle: strokeState.strokeStyle\n };\n }\n else {\n if (contextStrokeState.lineCap != strokeState.lineCap) {\n contextStrokeState.lineCap = strokeState.lineCap;\n context.lineCap = strokeState.lineCap;\n }\n if (context.setLineDash) {\n if (!equals(contextStrokeState.lineDash, strokeState.lineDash)) {\n context.setLineDash(contextStrokeState.lineDash = strokeState.lineDash);\n }\n if (contextStrokeState.lineDashOffset != strokeState.lineDashOffset) {\n contextStrokeState.lineDashOffset = strokeState.lineDashOffset;\n context.lineDashOffset = strokeState.lineDashOffset;\n }\n }\n if (contextStrokeState.lineJoin != strokeState.lineJoin) {\n contextStrokeState.lineJoin = strokeState.lineJoin;\n context.lineJoin = strokeState.lineJoin;\n }\n if (contextStrokeState.lineWidth != strokeState.lineWidth) {\n contextStrokeState.lineWidth = strokeState.lineWidth;\n context.lineWidth = strokeState.lineWidth;\n }\n if (contextStrokeState.miterLimit != strokeState.miterLimit) {\n contextStrokeState.miterLimit = strokeState.miterLimit;\n context.miterLimit = strokeState.miterLimit;\n }\n if (contextStrokeState.strokeStyle != strokeState.strokeStyle) {\n contextStrokeState.strokeStyle = strokeState.strokeStyle;\n context.strokeStyle = strokeState.strokeStyle;\n }\n }\n };\n /**\n * @param {import(\"../canvas.js\").TextState} textState Text state.\n * @private\n */\n CanvasImmediateRenderer.prototype.setContextTextState_ = function (textState) {\n var context = this.context_;\n var contextTextState = this.contextTextState_;\n var textAlign = textState.textAlign ?\n textState.textAlign : defaultTextAlign;\n if (!contextTextState) {\n context.font = textState.font;\n context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);\n context.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline);\n this.contextTextState_ = {\n font: textState.font,\n textAlign: textAlign,\n textBaseline: textState.textBaseline\n };\n }\n else {\n if (contextTextState.font != textState.font) {\n contextTextState.font = textState.font;\n context.font = textState.font;\n }\n if (contextTextState.textAlign != textAlign) {\n contextTextState.textAlign = /** @type {CanvasTextAlign} */ (textAlign);\n context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);\n }\n if (contextTextState.textBaseline != textState.textBaseline) {\n contextTextState.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline);\n context.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline);\n }\n }\n };\n /**\n * Set the fill and stroke style for subsequent draw operations. To clear\n * either fill or stroke styles, pass null for the appropriate parameter.\n *\n * @param {import(\"../../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../../style/Stroke.js\").default} strokeStyle Stroke style.\n * @override\n */\n CanvasImmediateRenderer.prototype.setFillStrokeStyle = function (fillStyle, strokeStyle) {\n if (!fillStyle) {\n this.fillState_ = null;\n }\n else {\n var fillStyleColor = fillStyle.getColor();\n this.fillState_ = {\n fillStyle: asColorLike(fillStyleColor ?\n fillStyleColor : defaultFillStyle)\n };\n }\n if (!strokeStyle) {\n this.strokeState_ = null;\n }\n else {\n var strokeStyleColor = strokeStyle.getColor();\n var strokeStyleLineCap = strokeStyle.getLineCap();\n var strokeStyleLineDash = strokeStyle.getLineDash();\n var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();\n var strokeStyleLineJoin = strokeStyle.getLineJoin();\n var strokeStyleWidth = strokeStyle.getWidth();\n var strokeStyleMiterLimit = strokeStyle.getMiterLimit();\n this.strokeState_ = {\n lineCap: strokeStyleLineCap !== undefined ?\n strokeStyleLineCap : defaultLineCap,\n lineDash: strokeStyleLineDash ?\n strokeStyleLineDash : defaultLineDash,\n lineDashOffset: strokeStyleLineDashOffset ?\n strokeStyleLineDashOffset : defaultLineDashOffset,\n lineJoin: strokeStyleLineJoin !== undefined ?\n strokeStyleLineJoin : defaultLineJoin,\n lineWidth: this.pixelRatio_ * (strokeStyleWidth !== undefined ?\n strokeStyleWidth : defaultLineWidth),\n miterLimit: strokeStyleMiterLimit !== undefined ?\n strokeStyleMiterLimit : defaultMiterLimit,\n strokeStyle: asColorLike(strokeStyleColor ?\n strokeStyleColor : defaultStrokeStyle)\n };\n }\n };\n /**\n * Set the image style for subsequent draw operations. Pass null to remove\n * the image style.\n *\n * @param {import(\"../../style/Image.js\").default} imageStyle Image style.\n * @override\n */\n CanvasImmediateRenderer.prototype.setImageStyle = function (imageStyle) {\n if (!imageStyle) {\n this.image_ = null;\n }\n else {\n var imageAnchor = imageStyle.getAnchor();\n // FIXME pixel ratio\n var imageImage = imageStyle.getImage(1);\n var imageOrigin = imageStyle.getOrigin();\n var imageSize = imageStyle.getSize();\n this.imageAnchorX_ = imageAnchor[0];\n this.imageAnchorY_ = imageAnchor[1];\n this.imageHeight_ = imageSize[1];\n this.image_ = imageImage;\n this.imageOpacity_ = imageStyle.getOpacity();\n this.imageOriginX_ = imageOrigin[0];\n this.imageOriginY_ = imageOrigin[1];\n this.imageRotateWithView_ = imageStyle.getRotateWithView();\n this.imageRotation_ = imageStyle.getRotation();\n this.imageScale_ = imageStyle.getScale() * this.pixelRatio_;\n this.imageWidth_ = imageSize[0];\n }\n };\n /**\n * Set the text style for subsequent draw operations. Pass null to\n * remove the text style.\n *\n * @param {import(\"../../style/Text.js\").default} textStyle Text style.\n * @override\n */\n CanvasImmediateRenderer.prototype.setTextStyle = function (textStyle) {\n if (!textStyle) {\n this.text_ = '';\n }\n else {\n var textFillStyle = textStyle.getFill();\n if (!textFillStyle) {\n this.textFillState_ = null;\n }\n else {\n var textFillStyleColor = textFillStyle.getColor();\n this.textFillState_ = {\n fillStyle: asColorLike(textFillStyleColor ?\n textFillStyleColor : defaultFillStyle)\n };\n }\n var textStrokeStyle = textStyle.getStroke();\n if (!textStrokeStyle) {\n this.textStrokeState_ = null;\n }\n else {\n var textStrokeStyleColor = textStrokeStyle.getColor();\n var textStrokeStyleLineCap = textStrokeStyle.getLineCap();\n var textStrokeStyleLineDash = textStrokeStyle.getLineDash();\n var textStrokeStyleLineDashOffset = textStrokeStyle.getLineDashOffset();\n var textStrokeStyleLineJoin = textStrokeStyle.getLineJoin();\n var textStrokeStyleWidth = textStrokeStyle.getWidth();\n var textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();\n this.textStrokeState_ = {\n lineCap: textStrokeStyleLineCap !== undefined ?\n textStrokeStyleLineCap : defaultLineCap,\n lineDash: textStrokeStyleLineDash ?\n textStrokeStyleLineDash : defaultLineDash,\n lineDashOffset: textStrokeStyleLineDashOffset ?\n textStrokeStyleLineDashOffset : defaultLineDashOffset,\n lineJoin: textStrokeStyleLineJoin !== undefined ?\n textStrokeStyleLineJoin : defaultLineJoin,\n lineWidth: textStrokeStyleWidth !== undefined ?\n textStrokeStyleWidth : defaultLineWidth,\n miterLimit: textStrokeStyleMiterLimit !== undefined ?\n textStrokeStyleMiterLimit : defaultMiterLimit,\n strokeStyle: asColorLike(textStrokeStyleColor ?\n textStrokeStyleColor : defaultStrokeStyle)\n };\n }\n var textFont = textStyle.getFont();\n var textOffsetX = textStyle.getOffsetX();\n var textOffsetY = textStyle.getOffsetY();\n var textRotateWithView = textStyle.getRotateWithView();\n var textRotation = textStyle.getRotation();\n var textScale = textStyle.getScale();\n var textText = textStyle.getText();\n var textTextAlign = textStyle.getTextAlign();\n var textTextBaseline = textStyle.getTextBaseline();\n this.textState_ = {\n font: textFont !== undefined ?\n textFont : defaultFont,\n textAlign: textTextAlign !== undefined ?\n textTextAlign : defaultTextAlign,\n textBaseline: textTextBaseline !== undefined ?\n textTextBaseline : defaultTextBaseline\n };\n this.text_ = textText !== undefined ? textText : '';\n this.textOffsetX_ =\n textOffsetX !== undefined ? (this.pixelRatio_ * textOffsetX) : 0;\n this.textOffsetY_ =\n textOffsetY !== undefined ? (this.pixelRatio_ * textOffsetY) : 0;\n this.textRotateWithView_ = textRotateWithView !== undefined ? textRotateWithView : false;\n this.textRotation_ = textRotation !== undefined ? textRotation : 0;\n this.textScale_ = this.pixelRatio_ * (textScale !== undefined ?\n textScale : 1);\n }\n };\n return CanvasImmediateRenderer;\n}(VectorContext));\nexport default CanvasImmediateRenderer;\n//# sourceMappingURL=Immediate.js.map","/**\n * @module ol/ImageState\n */\n/**\n * @enum {number}\n */\nexport default {\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n ERROR: 3,\n EMPTY: 4\n};\n//# sourceMappingURL=ImageState.js.map","/**\n * @module ol/render/canvas/BuilderType\n */\n/**\n * @enum {string}\n */\nexport default {\n CIRCLE: 'Circle',\n DEFAULT: 'Default',\n IMAGE: 'Image',\n LINE_STRING: 'LineString',\n POLYGON: 'Polygon',\n TEXT: 'Text'\n};\n//# sourceMappingURL=BuilderType.js.map","/**\n * @module ol/renderer/vector\n */\nimport { getUid } from '../util.js';\nimport ImageState from '../ImageState.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport BuilderType from '../render/canvas/BuilderType.js';\n/**\n * Tolerance for geometry simplification in device pixels.\n * @type {number}\n */\nvar SIMPLIFY_TOLERANCE = 0.5;\n/**\n * @const\n * @type {Object<import(\"../geom/GeometryType.js\").default,\n * function(import(\"../render/canvas/BuilderGroup.js\").default, import(\"../geom/Geometry.js\").default,\n * import(\"../style/Style.js\").default, Object): void>}\n */\nvar GEOMETRY_RENDERERS = {\n 'Point': renderPointGeometry,\n 'LineString': renderLineStringGeometry,\n 'Polygon': renderPolygonGeometry,\n 'MultiPoint': renderMultiPointGeometry,\n 'MultiLineString': renderMultiLineStringGeometry,\n 'MultiPolygon': renderMultiPolygonGeometry,\n 'GeometryCollection': renderGeometryCollectionGeometry,\n 'Circle': renderCircleGeometry\n};\n/**\n * @param {import(\"../Feature.js\").FeatureLike} feature1 Feature 1.\n * @param {import(\"../Feature.js\").FeatureLike} feature2 Feature 2.\n * @return {number} Order.\n */\nexport function defaultOrder(feature1, feature2) {\n return parseInt(getUid(feature1), 10) - parseInt(getUid(feature2), 10);\n}\n/**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Squared pixel tolerance.\n */\nexport function getSquaredTolerance(resolution, pixelRatio) {\n var tolerance = getTolerance(resolution, pixelRatio);\n return tolerance * tolerance;\n}\n/**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel tolerance.\n */\nexport function getTolerance(resolution, pixelRatio) {\n return SIMPLIFY_TOLERANCE * resolution / pixelRatio;\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Builder group.\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\nfunction renderCircleGeometry(builderGroup, geometry, style, feature) {\n var fillStyle = style.getFill();\n var strokeStyle = style.getStroke();\n if (fillStyle || strokeStyle) {\n var circleReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.CIRCLE);\n circleReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n circleReplay.drawCircle(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(false));\n textReplay.drawText(geometry, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Transform from user to view projection.\n * @return {boolean} `true` if style is loading.\n * @template T\n */\nexport function renderFeature(replayGroup, feature, style, squaredTolerance, listener, opt_transform) {\n var loading = false;\n var imageStyle = style.getImage();\n if (imageStyle) {\n var imageState = imageStyle.getImageState();\n if (imageState == ImageState.LOADED || imageState == ImageState.ERROR) {\n imageStyle.unlistenImageChange(listener);\n }\n else {\n if (imageState == ImageState.IDLE) {\n imageStyle.load();\n }\n imageState = imageStyle.getImageState();\n imageStyle.listenImageChange(listener);\n loading = true;\n }\n }\n renderFeatureInternal(replayGroup, feature, style, squaredTolerance, opt_transform);\n return loading;\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Optional transform function.\n */\nfunction renderFeatureInternal(replayGroup, feature, style, squaredTolerance, opt_transform) {\n var geometry = style.getGeometryFunction()(feature);\n if (!geometry) {\n return;\n }\n var simplifiedGeometry = geometry.simplifyTransformed(squaredTolerance, opt_transform);\n var renderer = style.getRenderer();\n if (renderer) {\n renderGeometry(replayGroup, simplifiedGeometry, style, feature);\n }\n else {\n var geometryRenderer = GEOMETRY_RENDERERS[simplifiedGeometry.getType()];\n geometryRenderer(replayGroup, simplifiedGeometry, style, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderGeometry(replayGroup, geometry, style, feature) {\n if (geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {\n var geometries = /** @type {import(\"../geom/GeometryCollection.js\").default} */ (geometry).getGeometries();\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n renderGeometry(replayGroup, geometries[i], style, feature);\n }\n return;\n }\n var replay = replayGroup.getBuilder(style.getZIndex(), BuilderType.DEFAULT);\n replay.drawCustom(/** @type {import(\"../geom/SimpleGeometry.js\").default} */ (geometry), feature, style.getRenderer());\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\nfunction renderGeometryCollectionGeometry(replayGroup, geometry, style, feature) {\n var geometries = geometry.getGeometriesArray();\n var i, ii;\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n var geometryRenderer = GEOMETRY_RENDERERS[geometries[i].getType()];\n geometryRenderer(replayGroup, geometries[i], style, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/LineString.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderLineStringGeometry(builderGroup, geometry, style, feature) {\n var strokeStyle = style.getStroke();\n if (strokeStyle) {\n var lineStringReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.LINE_STRING);\n lineStringReplay.setFillStrokeStyle(null, strokeStyle);\n lineStringReplay.drawLineString(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(false));\n textReplay.drawText(geometry, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderMultiLineStringGeometry(builderGroup, geometry, style, feature) {\n var strokeStyle = style.getStroke();\n if (strokeStyle) {\n var lineStringReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.LINE_STRING);\n lineStringReplay.setFillStrokeStyle(null, strokeStyle);\n lineStringReplay.drawMultiLineString(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(false));\n textReplay.drawText(geometry, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\nfunction renderMultiPolygonGeometry(builderGroup, geometry, style, feature) {\n var fillStyle = style.getFill();\n var strokeStyle = style.getStroke();\n if (strokeStyle || fillStyle) {\n var polygonReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.POLYGON);\n polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n polygonReplay.drawMultiPolygon(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(false));\n textReplay.drawText(geometry, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/Point.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderPointGeometry(builderGroup, geometry, style, feature) {\n var imageStyle = style.getImage();\n if (imageStyle) {\n if (imageStyle.getImageState() != ImageState.LOADED) {\n return;\n }\n var imageReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.IMAGE);\n imageReplay.setImageStyle(imageStyle, builderGroup.addDeclutter(false));\n imageReplay.drawPoint(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(!!imageStyle));\n textReplay.drawText(geometry, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderMultiPointGeometry(builderGroup, geometry, style, feature) {\n var imageStyle = style.getImage();\n if (imageStyle) {\n if (imageStyle.getImageState() != ImageState.LOADED) {\n return;\n }\n var imageReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.IMAGE);\n imageReplay.setImageStyle(imageStyle, builderGroup.addDeclutter(false));\n imageReplay.drawMultiPoint(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(!!imageStyle));\n textReplay.drawText(geometry, feature);\n }\n}\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/Polygon.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderPolygonGeometry(builderGroup, geometry, style, feature) {\n var fillStyle = style.getFill();\n var strokeStyle = style.getStroke();\n if (fillStyle || strokeStyle) {\n var polygonReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.POLYGON);\n polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n polygonReplay.drawPolygon(geometry, feature);\n }\n var textStyle = style.getText();\n if (textStyle) {\n var textReplay = builderGroup.getBuilder(style.getZIndex(), BuilderType.TEXT);\n textReplay.setTextStyle(textStyle, builderGroup.addDeclutter(false));\n textReplay.drawText(geometry, feature);\n }\n}\n//# sourceMappingURL=vector.js.map","/**\n * @module ol/render\n */\nimport { DEVICE_PIXEL_RATIO } from './has.js';\nimport { apply as applyTransform, create as createTransform, multiply as multiplyTransform, scale as scaleTransform } from './transform.js';\nimport CanvasImmediateRenderer from './render/canvas/Immediate.js';\nimport { getSquaredTolerance } from './renderer/vector.js';\nimport { getUserProjection, getTransformFromProjections } from './proj.js';\n/**\n * @typedef {Object} State\n * @property {CanvasRenderingContext2D} context Canvas context that the layer is being rendered to.\n * @property {import(\"./Feature.js\").FeatureLike} feature\n * @property {import(\"./geom/SimpleGeometry.js\").default} geometry\n * @property {number} pixelRatio Pixel ratio used by the layer renderer.\n * @property {number} resolution Resolution that the render batch was created and optimized for.\n * This is not the view's resolution that is being rendered.\n * @property {number} rotation Rotation of the rendered layer in radians.\n */\n/**\n * A function to be used when sorting features before rendering.\n * It takes two instances of {@link module:ol/Feature} or\n * {@link module:ol/render/Feature} and returns a `{number}`.\n *\n * @typedef {function(import(\"./Feature.js\").FeatureLike, import(\"./Feature.js\").FeatureLike):number} OrderFunction\n */\n/**\n * @typedef {Object} ToContextOptions\n * @property {import(\"./size.js\").Size} [size] Desired size of the canvas in css\n * pixels. When provided, both canvas and css size will be set according to the\n * `pixelRatio`. If not provided, the current canvas and css sizes will not be\n * altered.\n * @property {number} [pixelRatio=window.devicePixelRatio] Pixel ratio (canvas\n * pixel to css pixel ratio) for the canvas.\n */\n/**\n * Binds a Canvas Immediate API to a canvas context, to allow drawing geometries\n * to the context's canvas.\n *\n * The units for geometry coordinates are css pixels relative to the top left\n * corner of the canvas element.\n * ```js\n * import {toContext} from 'ol/render';\n * import Fill from 'ol/style/Fill';\n * import Polygon from 'ol/geom/Polygon';\n *\n * var canvas = document.createElement('canvas');\n * var render = toContext(canvas.getContext('2d'),\n * { size: [100, 100] });\n * render.setFillStrokeStyle(new Fill({ color: blue }));\n * render.drawPolygon(\n * new Polygon([[[0, 0], [100, 100], [100, 0], [0, 0]]]));\n * ```\n *\n * @param {CanvasRenderingContext2D} context Canvas context.\n * @param {ToContextOptions=} opt_options Options.\n * @return {CanvasImmediateRenderer} Canvas Immediate.\n * @api\n */\nexport function toContext(context, opt_options) {\n var canvas = context.canvas;\n var options = opt_options ? opt_options : {};\n var pixelRatio = options.pixelRatio || DEVICE_PIXEL_RATIO;\n var size = options.size;\n if (size) {\n canvas.width = size[0] * pixelRatio;\n canvas.height = size[1] * pixelRatio;\n canvas.style.width = size[0] + 'px';\n canvas.style.height = size[1] + 'px';\n }\n var extent = [0, 0, canvas.width, canvas.height];\n var transform = scaleTransform(createTransform(), pixelRatio, pixelRatio);\n return new CanvasImmediateRenderer(context, pixelRatio, extent, transform, 0);\n}\n/**\n * Gets a vector context for drawing to the event's canvas.\n * @param {import(\"./render/Event.js\").default} event Render event.\n * @returns {CanvasImmediateRenderer} Vector context.\n * @api\n */\nexport function getVectorContext(event) {\n var frameState = event.frameState;\n var transform = multiplyTransform(event.inversePixelTransform.slice(), frameState.coordinateToPixelTransform);\n var squaredTolerance = getSquaredTolerance(frameState.viewState.resolution, frameState.pixelRatio);\n var userTransform;\n var userProjection = getUserProjection();\n if (userProjection) {\n userTransform = getTransformFromProjections(userProjection, frameState.viewState.projection);\n }\n return new CanvasImmediateRenderer(event.context, frameState.pixelRatio, frameState.extent, transform, frameState.viewState.rotation, squaredTolerance, userTransform);\n}\n/**\n * Gets the pixel of the event's canvas context from the map viewport's CSS pixel.\n * @param {import(\"./render/Event.js\").default} event Render event.\n * @param {import(\"./pixel.js\").Pixel} pixel CSS pixel relative to the top-left\n * corner of the map viewport.\n * @returns {import(\"./pixel.js\").Pixel} Pixel on the event's canvas context.\n * @api\n */\nexport function getRenderPixel(event, pixel) {\n var result = pixel.slice(0);\n applyTransform(event.inversePixelTransform.slice(), result);\n return result;\n}\n/**\n * @param {import(\"./PluggableMap.js\").FrameState} frameState Frame state.\n * @param {?} declutterTree Declutter tree.\n * @returns {?} Declutter tree.\n */\nexport function renderDeclutterItems(frameState, declutterTree) {\n if (declutterTree) {\n declutterTree.clear();\n }\n var items = frameState.declutterItems;\n for (var z = items.length - 1; z >= 0; --z) {\n var item = items[z];\n var zIndexItems = item.items;\n for (var i = 0, ii = zIndexItems.length; i < ii; i += 3) {\n declutterTree = zIndexItems[i].renderDeclutter(zIndexItems[i + 1], zIndexItems[i + 2], item.opacity, declutterTree);\n }\n }\n items.length = 0;\n return declutterTree;\n}\n//# sourceMappingURL=render.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/Map\n */\nimport { abstract } from '../util.js';\nimport Disposable from '../Disposable.js';\nimport { getWidth } from '../extent.js';\nimport { TRUE } from '../functions.js';\nimport { inView } from '../layer/Layer.js';\nimport { shared as iconImageCache } from '../style/IconImageCache.js';\nimport { compose as composeTransform, makeInverse } from '../transform.js';\nimport { renderDeclutterItems } from '../render.js';\n/**\n * @abstract\n */\nvar MapRenderer = /** @class */ (function (_super) {\n __extends(MapRenderer, _super);\n /**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n function MapRenderer(map) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = map;\n /**\n * @private\n */\n _this.declutterTree_ = null;\n return _this;\n }\n /**\n * @abstract\n * @param {import(\"../render/EventType.js\").default} type Event type.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n MapRenderer.prototype.dispatchRenderEvent = function (type, frameState) {\n abstract();\n };\n /**\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @protected\n */\n MapRenderer.prototype.calculateMatrices2D = function (frameState) {\n var viewState = frameState.viewState;\n var coordinateToPixelTransform = frameState.coordinateToPixelTransform;\n var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform;\n composeTransform(coordinateToPixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / viewState.resolution, -1 / viewState.resolution, -viewState.rotation, -viewState.center[0], -viewState.center[1]);\n makeInverse(pixelToCoordinateTransform, coordinateToPixelTransform);\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {boolean} checkWrapped Check for wrapped geometries.\n * @param {function(this: S, import(\"../Feature.js\").FeatureLike,\n * import(\"../layer/Layer.js\").default): T} callback Feature callback.\n * @param {S} thisArg Value to use as `this` when executing `callback`.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @param {U} thisArg2 Value to use as `this` when executing `layerFilter`.\n * @return {T|undefined} Callback result.\n * @template S,T,U\n */\n MapRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, checkWrapped, callback, thisArg, layerFilter, thisArg2) {\n var result;\n var viewState = frameState.viewState;\n /**\n * @param {boolean} managed Managed layer.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {?} Callback result.\n */\n function forEachFeatureAtCoordinate(managed, feature, layer) {\n return callback.call(thisArg, feature, managed ? layer : null);\n }\n var projection = viewState.projection;\n var translatedCoordinate = coordinate;\n var offsets = [[0, 0]];\n if (projection.canWrapX()) {\n var projectionExtent = projection.getExtent();\n var worldWidth = getWidth(projectionExtent);\n var x = coordinate[0];\n if (x < projectionExtent[0] || x > projectionExtent[2]) {\n var worldsAway = Math.ceil((projectionExtent[0] - x) / worldWidth);\n translatedCoordinate = [x + worldWidth * worldsAway, coordinate[1]];\n }\n if (checkWrapped) {\n offsets.push([-worldWidth, 0], [worldWidth, 0]);\n }\n }\n var layerStates = frameState.layerStatesArray;\n var numLayers = layerStates.length;\n var declutteredFeatures;\n if (this.declutterTree_) {\n declutteredFeatures = this.declutterTree_.all().map(function (entry) {\n return entry.value;\n });\n }\n var tmpCoord = [];\n for (var i = 0; i < offsets.length; i++) {\n for (var j = numLayers - 1; j >= 0; --j) {\n var layerState = layerStates[j];\n var layer = /** @type {import(\"../layer/Layer.js\").default} */ (layerState.layer);\n if (layer.hasRenderer() && inView(layerState, viewState) && layerFilter.call(thisArg2, layer)) {\n var layerRenderer = layer.getRenderer();\n var source = layer.getSource();\n if (layerRenderer && source) {\n var coordinates = source.getWrapX() ? translatedCoordinate : coordinate;\n var callback_1 = forEachFeatureAtCoordinate.bind(null, layerState.managed);\n tmpCoord[0] = coordinates[0] + offsets[i][0];\n tmpCoord[1] = coordinates[1] + offsets[i][1];\n result = layerRenderer.forEachFeatureAtCoordinate(tmpCoord, frameState, hitTolerance, callback_1, declutteredFeatures);\n }\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n };\n /**\n * @abstract\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(this: S, import(\"../layer/Layer.js\").default, (Uint8ClampedArray|Uint8Array)): T} callback Layer\n * callback.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @return {T|undefined} Callback result.\n * @template S,T,U\n */\n MapRenderer.prototype.forEachLayerAtPixel = function (pixel, frameState, hitTolerance, callback, layerFilter) {\n return abstract();\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {boolean} checkWrapped Check for wrapped geometries.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @param {U} thisArg Value to use as `this` when executing `layerFilter`.\n * @return {boolean} Is there a feature at the given coordinate?\n * @template U\n */\n MapRenderer.prototype.hasFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, checkWrapped, layerFilter, thisArg) {\n var hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, checkWrapped, TRUE, this, layerFilter, thisArg);\n return hasFeature !== undefined;\n };\n /**\n * @return {import(\"../PluggableMap.js\").default} Map.\n */\n MapRenderer.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Render.\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n MapRenderer.prototype.renderFrame = function (frameState) {\n this.declutterTree_ = renderDeclutterItems(frameState, this.declutterTree_);\n };\n /**\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @protected\n */\n MapRenderer.prototype.scheduleExpireIconCache = function (frameState) {\n if (iconImageCache.canExpireCache()) {\n frameState.postRenderFunctions.push(expireIconCache);\n }\n };\n return MapRenderer;\n}(Disposable));\n/**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\nfunction expireIconCache(map, frameState) {\n iconImageCache.expire();\n}\nexport default MapRenderer;\n//# sourceMappingURL=Map.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/Composite\n */\nimport { CLASS_UNSELECTABLE } from '../css.js';\nimport { inView } from '../layer/Layer.js';\nimport RenderEvent from '../render/Event.js';\nimport RenderEventType from '../render/EventType.js';\nimport MapRenderer from './Map.js';\nimport SourceState from '../source/State.js';\nimport { replaceChildren } from '../dom.js';\nimport { labelCache } from '../render/canvas.js';\nimport EventType from '../events/EventType.js';\nimport { listen, unlistenByKey } from '../events.js';\n/**\n * @classdesc\n * Canvas map renderer.\n * @api\n */\nvar CompositeMapRenderer = /** @class */ (function (_super) {\n __extends(CompositeMapRenderer, _super);\n /**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n function CompositeMapRenderer(map) {\n var _this = _super.call(this, map) || this;\n /**\n * @type {import(\"../events.js\").EventsKey}\n */\n _this.labelCacheKey_ = listen(labelCache, EventType.CLEAR, map.redrawText.bind(map));\n /**\n * @private\n * @type {HTMLDivElement}\n */\n _this.element_ = document.createElement('div');\n var style = _this.element_.style;\n style.position = 'absolute';\n style.width = '100%';\n style.height = '100%';\n style.zIndex = '0';\n _this.element_.className = CLASS_UNSELECTABLE + ' ol-layers';\n var container = map.getViewport();\n container.insertBefore(_this.element_, container.firstChild || null);\n /**\n * @private\n * @type {Array<HTMLElement>}\n */\n _this.children_ = [];\n /**\n * @private\n * @type {boolean}\n */\n _this.renderedVisible_ = true;\n return _this;\n }\n /**\n * @param {import(\"../render/EventType.js\").default} type Event type.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n CompositeMapRenderer.prototype.dispatchRenderEvent = function (type, frameState) {\n var map = this.getMap();\n if (map.hasListener(type)) {\n var event_1 = new RenderEvent(type, undefined, frameState);\n map.dispatchEvent(event_1);\n }\n };\n CompositeMapRenderer.prototype.disposeInternal = function () {\n unlistenByKey(this.labelCacheKey_);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @inheritDoc\n */\n CompositeMapRenderer.prototype.renderFrame = function (frameState) {\n if (!frameState) {\n if (this.renderedVisible_) {\n this.element_.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n this.calculateMatrices2D(frameState);\n this.dispatchRenderEvent(RenderEventType.PRECOMPOSE, frameState);\n var layerStatesArray = frameState.layerStatesArray.sort(function (a, b) {\n return a.zIndex - b.zIndex;\n });\n var viewState = frameState.viewState;\n this.children_.length = 0;\n var previousElement = null;\n for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n var layerState = layerStatesArray[i];\n frameState.layerIndex = i;\n if (!inView(layerState, viewState) ||\n (layerState.sourceState != SourceState.READY && layerState.sourceState != SourceState.UNDEFINED)) {\n continue;\n }\n var layer = layerState.layer;\n var element = layer.render(frameState, previousElement);\n if (!element) {\n continue;\n }\n if (element !== previousElement) {\n this.children_.push(element);\n previousElement = element;\n }\n }\n _super.prototype.renderFrame.call(this, frameState);\n replaceChildren(this.element_, this.children_);\n this.dispatchRenderEvent(RenderEventType.POSTCOMPOSE, frameState);\n if (!this.renderedVisible_) {\n this.element_.style.display = '';\n this.renderedVisible_ = true;\n }\n this.scheduleExpireIconCache(frameState);\n };\n /**\n * @inheritDoc\n */\n CompositeMapRenderer.prototype.forEachLayerAtPixel = function (pixel, frameState, hitTolerance, callback, layerFilter) {\n var viewState = frameState.viewState;\n var layerStates = frameState.layerStatesArray;\n var numLayers = layerStates.length;\n for (var i = numLayers - 1; i >= 0; --i) {\n var layerState = layerStates[i];\n var layer = layerState.layer;\n if (layer.hasRenderer() && inView(layerState, viewState) && layerFilter(layer)) {\n var layerRenderer = layer.getRenderer();\n var data = layerRenderer.getDataAtPixel(pixel, frameState, hitTolerance);\n if (data) {\n var result = callback(layer, data);\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n };\n return CompositeMapRenderer;\n}(MapRenderer));\nexport default CompositeMapRenderer;\n//# sourceMappingURL=Composite.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Map\n */\nimport PluggableMap from './PluggableMap.js';\nimport { defaults as defaultControls } from './control.js';\nimport { defaults as defaultInteractions } from './interaction.js';\nimport { assign } from './obj.js';\nimport CompositeMapRenderer from './renderer/Composite.js';\n/**\n * @classdesc\n * The map is the core component of OpenLayers. For a map to render, a view,\n * one or more layers, and a target container are needed:\n *\n * import Map from 'ol/Map';\n * import View from 'ol/View';\n * import TileLayer from 'ol/layer/Tile';\n * import OSM from 'ol/source/OSM';\n *\n * var map = new Map({\n * view: new View({\n * center: [0, 0],\n * zoom: 1\n * }),\n * layers: [\n * new TileLayer({\n * source: new OSM()\n * })\n * ],\n * target: 'map'\n * });\n *\n * The above snippet creates a map using a {@link module:ol/layer/Tile} to\n * display {@link module:ol/source/OSM~OSM} OSM data and render it to a DOM\n * element with the id `map`.\n *\n * The constructor places a viewport container (with CSS class name\n * `ol-viewport`) in the target element (see `getViewport()`), and then two\n * further elements within the viewport: one with CSS class name\n * `ol-overlaycontainer-stopevent` for controls and some overlays, and one with\n * CSS class name `ol-overlaycontainer` for other overlays (see the `stopEvent`\n * option of {@link module:ol/Overlay~Overlay} for the difference). The map\n * itself is placed in a further element within the viewport.\n *\n * Layers are stored as a {@link module:ol/Collection~Collection} in\n * layerGroups. A top-level group is provided by the library. This is what is\n * accessed by `getLayerGroup` and `setLayerGroup`. Layers entered in the\n * options are added to this group, and `addLayer` and `removeLayer` change the\n * layer collection in the group. `getLayers` is a convenience function for\n * `getLayerGroup().getLayers()`. Note that {@link module:ol/layer/Group~Group}\n * is a subclass of {@link module:ol/layer/Base}, so layers entered in the\n * options or added with `addLayer` can be groups, which can contain further\n * groups, and so on.\n *\n * @api\n */\nvar Map = /** @class */ (function (_super) {\n __extends(Map, _super);\n /**\n * @param {import(\"./PluggableMap.js\").MapOptions} options Map options.\n */\n function Map(options) {\n var _this = this;\n options = assign({}, options);\n if (!options.controls) {\n options.controls = defaultControls();\n }\n if (!options.interactions) {\n options.interactions = defaultInteractions();\n }\n _this = _super.call(this, options) || this;\n return _this;\n }\n Map.prototype.createRenderer = function () {\n return new CompositeMapRenderer(this);\n };\n return Map;\n}(PluggableMap));\nexport default Map;\n//# sourceMappingURL=Map.js.map","/**\n * @module ol/OverlayPositioning\n */\n/**\n * Overlay position: `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, `'top-right'`\n * @enum {string}\n */\nexport default {\n BOTTOM_LEFT: 'bottom-left',\n BOTTOM_CENTER: 'bottom-center',\n BOTTOM_RIGHT: 'bottom-right',\n CENTER_LEFT: 'center-left',\n CENTER_CENTER: 'center-center',\n CENTER_RIGHT: 'center-right',\n TOP_LEFT: 'top-left',\n TOP_CENTER: 'top-center',\n TOP_RIGHT: 'top-right'\n};\n//# sourceMappingURL=OverlayPositioning.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Overlay\n */\nimport MapEventType from './MapEventType.js';\nimport BaseObject, { getChangeEventType } from './Object.js';\nimport OverlayPositioning from './OverlayPositioning.js';\nimport { CLASS_SELECTABLE } from './css.js';\nimport { removeNode, removeChildren, outerWidth, outerHeight } from './dom.js';\nimport { listen, unlistenByKey } from './events.js';\nimport { containsExtent } from './extent.js';\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 {OverlayPositioning} [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 {boolean} [autoPan=false] If set to `true` the map is panned when\n * calling `setPosition`, so that the overlay is entirely visible in the current\n * viewport.\n * @property {PanOptions} [autoPanAnimation] The\n * animation options used to pan the overlay into view. This animation is only\n * used when `autoPan` is enabled. A `duration` and `easing` may be provided to\n * customize the animation.\n * @property {number} [autoPanMargin=20] The margin (in pixels) between the\n * overlay and the borders of the map when autopanning.\n * @property {string} [className='ol-overlay-container ol-selectable'] CSS class\n * name.\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 * @enum {string}\n * @protected\n */\nvar Property = {\n ELEMENT: 'element',\n MAP: 'map',\n OFFSET: 'offset',\n POSITION: 'position',\n POSITIONING: 'positioning'\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 * var popup = new Overlay({\n * element: document.getElementById('popup')\n * });\n * popup.setPosition(coordinate);\n * map.addOverlay(popup);\n *\n * @api\n */\nvar Overlay = /** @class */ (function (_super) {\n __extends(Overlay, _super);\n /**\n * @param {Options} options Overlay options.\n */\n function Overlay(options) {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {Options}\n */\n _this.options = options;\n /**\n * @protected\n * @type {number|string|undefined}\n */\n _this.id = options.id;\n /**\n * @protected\n * @type {boolean}\n */\n _this.insertFirst = options.insertFirst !== undefined ?\n options.insertFirst : true;\n /**\n * @protected\n * @type {boolean}\n */\n _this.stopEvent = options.stopEvent !== undefined ? options.stopEvent : true;\n /**\n * @protected\n * @type {HTMLElement}\n */\n _this.element = document.createElement('div');\n _this.element.className = options.className !== undefined ?\n options.className : 'ol-overlay-container ' + CLASS_SELECTABLE;\n _this.element.style.position = 'absolute';\n /**\n * @protected\n * @type {boolean}\n */\n _this.autoPan = options.autoPan !== undefined ? options.autoPan : false;\n /**\n * @protected\n * @type {PanOptions}\n */\n _this.autoPanAnimation = options.autoPanAnimation || /** @type {PanOptions} */ ({});\n /**\n * @protected\n * @type {number}\n */\n _this.autoPanMargin = options.autoPanMargin !== undefined ?\n options.autoPanMargin : 20;\n /**\n * @protected\n * @type {{bottom_: string,\n * left_: string,\n * right_: string,\n * top_: string,\n * visible: boolean}}\n */\n _this.rendered = {\n bottom_: '',\n left_: '',\n right_: '',\n top_: '',\n visible: true\n };\n /**\n * @protected\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.mapPostrenderListenerKey = null;\n _this.addEventListener(getChangeEventType(Property.ELEMENT), _this.handleElementChanged);\n _this.addEventListener(getChangeEventType(Property.MAP), _this.handleMapChanged);\n _this.addEventListener(getChangeEventType(Property.OFFSET), _this.handleOffsetChanged);\n _this.addEventListener(getChangeEventType(Property.POSITION), _this.handlePositionChanged);\n _this.addEventListener(getChangeEventType(Property.POSITIONING), _this.handlePositioningChanged);\n if (options.element !== undefined) {\n _this.setElement(options.element);\n }\n _this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);\n _this.setPositioning(options.positioning !== undefined ?\n /** @type {OverlayPositioning} */ (options.positioning) :\n OverlayPositioning.TOP_LEFT);\n if (options.position !== undefined) {\n _this.setPosition(options.position);\n }\n return _this;\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 Overlay.prototype.getElement = function () {\n return /** @type {HTMLElement|undefined} */ (this.get(Property.ELEMENT));\n };\n /**\n * Get the overlay identifier which is set on constructor.\n * @return {number|string|undefined} Id.\n * @api\n */\n Overlay.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get the map associated with this overlay.\n * @return {import(\"./PluggableMap.js\").default|undefined} The map that the\n * overlay is part of.\n * @observable\n * @api\n */\n Overlay.prototype.getMap = function () {\n return (\n /** @type {import(\"./PluggableMap.js\").default|undefined} */ (this.get(Property.MAP)));\n };\n /**\n * Get the offset of this overlay.\n * @return {Array<number>} The offset.\n * @observable\n * @api\n */\n Overlay.prototype.getOffset = function () {\n return /** @type {Array<number>} */ (this.get(Property.OFFSET));\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 Overlay.prototype.getPosition = function () {\n return (\n /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (this.get(Property.POSITION)));\n };\n /**\n * Get the current positioning of this overlay.\n * @return {OverlayPositioning} How the overlay is positioned\n * relative to its point on the map.\n * @observable\n * @api\n */\n Overlay.prototype.getPositioning = function () {\n return (\n /** @type {OverlayPositioning} */ (this.get(Property.POSITIONING)));\n };\n /**\n * @protected\n */\n Overlay.prototype.handleElementChanged = function () {\n removeChildren(this.element);\n var element = this.getElement();\n if (element) {\n this.element.appendChild(element);\n }\n };\n /**\n * @protected\n */\n Overlay.prototype.handleMapChanged = function () {\n if (this.mapPostrenderListenerKey) {\n removeNode(this.element);\n unlistenByKey(this.mapPostrenderListenerKey);\n this.mapPostrenderListenerKey = null;\n }\n var map = this.getMap();\n if (map) {\n this.mapPostrenderListenerKey = listen(map, MapEventType.POSTRENDER, this.render, this);\n this.updatePixelPosition();\n var container = this.stopEvent ?\n map.getOverlayContainerStopEvent() : map.getOverlayContainer();\n if (this.insertFirst) {\n container.insertBefore(this.element, container.childNodes[0] || null);\n }\n else {\n container.appendChild(this.element);\n }\n }\n };\n /**\n * @protected\n */\n Overlay.prototype.render = function () {\n this.updatePixelPosition();\n };\n /**\n * @protected\n */\n Overlay.prototype.handleOffsetChanged = function () {\n this.updatePixelPosition();\n };\n /**\n * @protected\n */\n Overlay.prototype.handlePositionChanged = function () {\n this.updatePixelPosition();\n if (this.get(Property.POSITION) && this.autoPan) {\n this.panIntoView();\n }\n };\n /**\n * @protected\n */\n Overlay.prototype.handlePositioningChanged = function () {\n this.updatePixelPosition();\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 Overlay.prototype.setElement = function (element) {\n this.set(Property.ELEMENT, element);\n };\n /**\n * Set the map to be associated with this overlay.\n * @param {import(\"./PluggableMap.js\").default|undefined} map The map that the\n * overlay is part of.\n * @observable\n * @api\n */\n Overlay.prototype.setMap = function (map) {\n this.set(Property.MAP, map);\n };\n /**\n * Set the offset for this overlay.\n * @param {Array<number>} offset Offset.\n * @observable\n * @api\n */\n Overlay.prototype.setOffset = function (offset) {\n this.set(Property.OFFSET, offset);\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 Overlay.prototype.setPosition = function (position) {\n this.set(Property.POSITION, position);\n };\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary).\n * @protected\n */\n Overlay.prototype.panIntoView = function () {\n var map = this.getMap();\n if (!map || !map.getTargetElement()) {\n return;\n }\n var mapRect = this.getRect(map.getTargetElement(), map.getSize());\n var element = this.getElement();\n var overlayRect = this.getRect(element, [outerWidth(element), outerHeight(element)]);\n var margin = this.autoPanMargin;\n if (!containsExtent(mapRect, overlayRect)) {\n // the overlay is not completely inside the viewport, so pan the map\n var offsetLeft = overlayRect[0] - mapRect[0];\n var offsetRight = mapRect[2] - overlayRect[2];\n var offsetTop = overlayRect[1] - mapRect[1];\n var offsetBottom = mapRect[3] - overlayRect[3];\n var delta = [0, 0];\n if (offsetLeft < 0) {\n // move map to the left\n delta[0] = offsetLeft - margin;\n }\n else if (offsetRight < 0) {\n // move map to the right\n delta[0] = Math.abs(offsetRight) + margin;\n }\n if (offsetTop < 0) {\n // move map up\n delta[1] = offsetTop - margin;\n }\n else if (offsetBottom < 0) {\n // move map down\n delta[1] = Math.abs(offsetBottom) + margin;\n }\n if (delta[0] !== 0 || delta[1] !== 0) {\n var center = /** @type {import(\"./coordinate.js\").Coordinate} */ (map.getView().getCenterInternal());\n var centerPx = map.getPixelFromCoordinateInternal(center);\n var newCenterPx = [\n centerPx[0] + delta[0],\n centerPx[1] + delta[1]\n ];\n map.getView().animateInternal({\n center: map.getCoordinateFromPixelInternal(newCenterPx),\n duration: this.autoPanAnimation.duration,\n easing: this.autoPanAnimation.easing\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 Overlay.prototype.getRect = function (element, size) {\n var box = element.getBoundingClientRect();\n var offsetX = box.left + window.pageXOffset;\n var offsetY = box.top + window.pageYOffset;\n return [\n offsetX,\n offsetY,\n offsetX + size[0],\n offsetY + size[1]\n ];\n };\n /**\n * Set the positioning for this overlay.\n * @param {OverlayPositioning} positioning how the overlay is\n * positioned relative to its point on the map.\n * @observable\n * @api\n */\n Overlay.prototype.setPositioning = function (positioning) {\n this.set(Property.POSITIONING, positioning);\n };\n /**\n * Modify the visibility of the element.\n * @param {boolean} visible Element visibility.\n * @protected\n */\n Overlay.prototype.setVisible = function (visible) {\n if (this.rendered.visible !== visible) {\n this.element.style.display = visible ? '' : 'none';\n this.rendered.visible = visible;\n }\n };\n /**\n * Update pixel position.\n * @protected\n */\n Overlay.prototype.updatePixelPosition = function () {\n var map = this.getMap();\n var position = this.getPosition();\n if (!map || !map.isRendered() || !position) {\n this.setVisible(false);\n return;\n }\n var pixel = map.getPixelFromCoordinate(position);\n var mapSize = map.getSize();\n this.updateRenderedPosition(pixel, mapSize);\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 Overlay.prototype.updateRenderedPosition = function (pixel, mapSize) {\n var style = this.element.style;\n var offset = this.getOffset();\n var positioning = this.getPositioning();\n this.setVisible(true);\n var offsetX = offset[0];\n var offsetY = offset[1];\n if (positioning == OverlayPositioning.BOTTOM_RIGHT ||\n positioning == OverlayPositioning.CENTER_RIGHT ||\n positioning == OverlayPositioning.TOP_RIGHT) {\n if (this.rendered.left_ !== '') {\n this.rendered.left_ = '';\n style.left = '';\n }\n var right = Math.round(mapSize[0] - pixel[0] - offsetX) + 'px';\n if (this.rendered.right_ != right) {\n this.rendered.right_ = right;\n style.right = right;\n }\n }\n else {\n if (this.rendered.right_ !== '') {\n this.rendered.right_ = '';\n style.right = '';\n }\n if (positioning == OverlayPositioning.BOTTOM_CENTER ||\n positioning == OverlayPositioning.CENTER_CENTER ||\n positioning == OverlayPositioning.TOP_CENTER) {\n offsetX -= this.element.offsetWidth / 2;\n }\n var left = Math.round(pixel[0] + offsetX) + 'px';\n if (this.rendered.left_ != left) {\n this.rendered.left_ = left;\n style.left = left;\n }\n }\n if (positioning == OverlayPositioning.BOTTOM_LEFT ||\n positioning == OverlayPositioning.BOTTOM_CENTER ||\n positioning == OverlayPositioning.BOTTOM_RIGHT) {\n if (this.rendered.top_ !== '') {\n this.rendered.top_ = '';\n style.top = '';\n }\n var bottom = Math.round(mapSize[1] - pixel[1] - offsetY) + 'px';\n if (this.rendered.bottom_ != bottom) {\n this.rendered.bottom_ = bottom;\n style.bottom = bottom;\n }\n }\n else {\n if (this.rendered.bottom_ !== '') {\n this.rendered.bottom_ = '';\n style.bottom = '';\n }\n if (positioning == OverlayPositioning.CENTER_LEFT ||\n positioning == OverlayPositioning.CENTER_CENTER ||\n positioning == OverlayPositioning.CENTER_RIGHT) {\n offsetY -= this.element.offsetHeight / 2;\n }\n var top_1 = Math.round(pixel[1] + offsetY) + 'px';\n if (this.rendered.top_ != top_1) {\n this.rendered.top_ = 'top';\n style.top = top_1;\n }\n }\n };\n /**\n * returns the options this Overlay has been created with\n * @return {Options} overlay options\n */\n Overlay.prototype.getOptions = function () {\n return this.options;\n };\n return Overlay;\n}(BaseObject));\nexport default Overlay;\n//# sourceMappingURL=Overlay.js.map","/**\n * @module ol/format/FormatType\n */\n/**\n * @enum {string}\n */\nexport default {\n ARRAY_BUFFER: 'arraybuffer',\n JSON: 'json',\n TEXT: 'text',\n XML: 'xml'\n};\n//# sourceMappingURL=FormatType.js.map","/**\n * @module ol/featureloader\n */\nimport { VOID } from './functions.js';\nimport FormatType from './format/FormatType.js';\n/**\n *\n * @type {boolean}\n * @private\n */\nvar withCredentials = false;\n/**\n * {@link module:ol/source/Vector} sources use a function of this type to\n * load features.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area to be loaded,\n * a `{number}` representing the resolution (map units per pixel) and an\n * {@link module:ol/proj/Projection} for the projection as\n * arguments. `this` within the function is bound to the\n * {@link module:ol/source/Vector} it's called from.\n *\n * The function is responsible for loading the features and adding them to the\n * source.\n * @typedef {function(this:(import(\"./source/Vector\").default|import(\"./VectorTile.js\").default), import(\"./extent.js\").Extent, number,\n * import(\"./proj/Projection.js\").default): void} FeatureLoader\n * @api\n */\n/**\n * {@link module:ol/source/Vector} sources use a function of this type to\n * get the url to load features from.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area\n * to be loaded, a `{number}` representing the resolution (map units per pixel)\n * and an {@link module:ol/proj/Projection} for the projection as\n * arguments and returns a `{string}` representing the URL.\n * @typedef {function(import(\"./extent.js\").Extent, number, import(\"./proj/Projection.js\").default): string} FeatureUrlFunction\n * @api\n */\n/**\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @param {function(this:import(\"./VectorTile.js\").default, Array<import(\"./Feature.js\").default>, import(\"./proj/Projection.js\").default, import(\"./extent.js\").Extent): void|function(this:import(\"./source/Vector\").default, Array<import(\"./Feature.js\").default>): void} success\n * Function called with the loaded features and optionally with the data\n * projection. Called with the vector tile or source as `this`.\n * @param {function(this:import(\"./VectorTile.js\").default): void|function(this:import(\"./source/Vector\").default): void} failure\n * Function called when loading failed. Called with the vector tile or\n * source as `this`.\n * @return {FeatureLoader} The feature loader.\n */\nexport function loadFeaturesXhr(url, format, success, failure) {\n return (\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @this {import(\"./source/Vector\").default|import(\"./VectorTile.js\").default}\n */\n function (extent, resolution, projection) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', typeof url === 'function' ? url(extent, resolution, projection) : url, true);\n if (format.getType() == FormatType.ARRAY_BUFFER) {\n xhr.responseType = 'arraybuffer';\n }\n xhr.withCredentials = withCredentials;\n /**\n * @param {Event} event Event.\n * @private\n */\n xhr.onload = function (event) {\n // status will be 0 for file:// urls\n if (!xhr.status || xhr.status >= 200 && xhr.status < 300) {\n var type = format.getType();\n /** @type {Document|Node|Object|string|undefined} */\n var source = void 0;\n if (type == FormatType.JSON || type == FormatType.TEXT) {\n source = xhr.responseText;\n }\n else if (type == FormatType.XML) {\n source = xhr.responseXML;\n if (!source) {\n source = new DOMParser().parseFromString(xhr.responseText, 'application/xml');\n }\n }\n else if (type == FormatType.ARRAY_BUFFER) {\n source = /** @type {ArrayBuffer} */ (xhr.response);\n }\n if (source) {\n success.call(this, format.readFeatures(source, {\n extent: extent,\n featureProjection: projection\n }), format.readProjection(source));\n }\n else {\n failure.call(this);\n }\n }\n else {\n failure.call(this);\n }\n }.bind(this);\n /**\n * @private\n */\n xhr.onerror = function () {\n failure.call(this);\n }.bind(this);\n xhr.send();\n });\n}\n/**\n * Create an XHR feature loader for a `url` and `format`. The feature loader\n * loads features (with XHR), parses the features, and adds them to the\n * vector source.\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @return {FeatureLoader} The feature loader.\n * @api\n */\nexport function xhr(url, format) {\n return loadFeaturesXhr(url, format, \n /**\n * @param {Array<import(\"./Feature.js\").default>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data\n * projection.\n * @this {import(\"./source/Vector\").default|import(\"./VectorTile.js\").default}\n */\n function (features, dataProjection) {\n var sourceOrTile = /** @type {?} */ (this);\n if (typeof sourceOrTile.addFeatures === 'function') {\n /** @type {import(\"./source/Vector\").default} */ (sourceOrTile).addFeatures(features);\n }\n }, /* FIXME handle error */ VOID);\n}\n/**\n * Setter for the withCredentials configuration for the XHR.\n *\n * @param {boolean} xhrWithCredentials The value of withCredentials to set.\n * Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/\n * @api\n */\nexport function setWithCredentials(xhrWithCredentials) {\n withCredentials = xhrWithCredentials;\n}\n//# sourceMappingURL=featureloader.js.map","/**\n * @module ol/loadingstrategy\n */\n/**\n * Strategy function for loading all features with a single request.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array<import(\"./extent.js\").Extent>} Extents.\n * @api\n */\nexport function all(extent, resolution) {\n return [[-Infinity, -Infinity, Infinity, Infinity]];\n}\n/**\n * Strategy function for loading features based on the view's extent and\n * resolution.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array<import(\"./extent.js\").Extent>} Extents.\n * @api\n */\nexport function bbox(extent, resolution) {\n return [extent];\n}\n/**\n * Creates a strategy function for loading features based on a tile grid.\n * @param {import(\"./tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @return {function(import(\"./extent.js\").Extent, number): Array<import(\"./extent.js\").Extent>} Loading strategy.\n * @api\n */\nexport function tile(tileGrid) {\n return (\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array<import(\"./extent.js\").Extent>} Extents.\n */\n function (extent, resolution) {\n var z = tileGrid.getZForResolution(resolution);\n var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);\n /** @type {Array<import(\"./extent.js\").Extent>} */\n var extents = [];\n /** @type {import(\"./tilecoord.js\").TileCoord} */\n var tileCoord = [z, 0, 0];\n for (tileCoord[1] = tileRange.minX; tileCoord[1] <= tileRange.maxX; ++tileCoord[1]) {\n for (tileCoord[2] = tileRange.minY; tileCoord[2] <= tileRange.maxY; ++tileCoord[2]) {\n extents.push(tileGrid.getTileCoordExtent(tileCoord));\n }\n }\n return extents;\n });\n}\n//# sourceMappingURL=loadingstrategy.js.map","/**\n * @module ol/TileRange\n */\n/**\n * A representation of a contiguous block of tiles. A tile range is specified\n * by its min/max tile coordinates and is inclusive of coordinates.\n */\nvar TileRange = /** @class */ (function () {\n /**\n * @param {number} minX Minimum X.\n * @param {number} maxX Maximum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxY Maximum Y.\n */\n function TileRange(minX, maxX, minY, maxY) {\n /**\n * @type {number}\n */\n this.minX = minX;\n /**\n * @type {number}\n */\n this.maxX = maxX;\n /**\n * @type {number}\n */\n this.minY = minY;\n /**\n * @type {number}\n */\n this.maxY = maxY;\n }\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @return {boolean} Contains tile coordinate.\n */\n TileRange.prototype.contains = function (tileCoord) {\n return this.containsXY(tileCoord[1], tileCoord[2]);\n };\n /**\n * @param {TileRange} tileRange Tile range.\n * @return {boolean} Contains.\n */\n TileRange.prototype.containsTileRange = function (tileRange) {\n return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX &&\n this.minY <= tileRange.minY && tileRange.maxY <= this.maxY;\n };\n /**\n * @param {number} x Tile coordinate x.\n * @param {number} y Tile coordinate y.\n * @return {boolean} Contains coordinate.\n */\n TileRange.prototype.containsXY = function (x, y) {\n return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY;\n };\n /**\n * @param {TileRange} tileRange Tile range.\n * @return {boolean} Equals.\n */\n TileRange.prototype.equals = function (tileRange) {\n return this.minX == tileRange.minX && this.minY == tileRange.minY &&\n this.maxX == tileRange.maxX && this.maxY == tileRange.maxY;\n };\n /**\n * @param {TileRange} tileRange Tile range.\n */\n TileRange.prototype.extend = function (tileRange) {\n if (tileRange.minX < this.minX) {\n this.minX = tileRange.minX;\n }\n if (tileRange.maxX > this.maxX) {\n this.maxX = tileRange.maxX;\n }\n if (tileRange.minY < this.minY) {\n this.minY = tileRange.minY;\n }\n if (tileRange.maxY > this.maxY) {\n this.maxY = tileRange.maxY;\n }\n };\n /**\n * @return {number} Height.\n */\n TileRange.prototype.getHeight = function () {\n return this.maxY - this.minY + 1;\n };\n /**\n * @return {import(\"./size.js\").Size} Size.\n */\n TileRange.prototype.getSize = function () {\n return [this.getWidth(), this.getHeight()];\n };\n /**\n * @return {number} Width.\n */\n TileRange.prototype.getWidth = function () {\n return this.maxX - this.minX + 1;\n };\n /**\n * @param {TileRange} tileRange Tile range.\n * @return {boolean} Intersects.\n */\n TileRange.prototype.intersects = function (tileRange) {\n return this.minX <= tileRange.maxX &&\n this.maxX >= tileRange.minX &&\n this.minY <= tileRange.maxY &&\n this.maxY >= tileRange.minY;\n };\n return TileRange;\n}());\n/**\n * @param {number} minX Minimum X.\n * @param {number} maxX Maximum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxY Maximum Y.\n * @param {TileRange=} tileRange TileRange.\n * @return {TileRange} Tile range.\n */\nexport function createOrUpdate(minX, maxX, minY, maxY, tileRange) {\n if (tileRange !== undefined) {\n tileRange.minX = minX;\n tileRange.maxX = maxX;\n tileRange.minY = minY;\n tileRange.maxY = maxY;\n return tileRange;\n }\n else {\n return new TileRange(minX, maxX, minY, maxY);\n }\n}\nexport default TileRange;\n//# sourceMappingURL=TileRange.js.map","/**\n * @module ol/tilecoord\n */\n/**\n * An array of three numbers representing the location of a tile in a tile\n * grid. The order is `z` (zoom level), `x` (column), and `y` (row).\n * @typedef {Array<number>} TileCoord\n * @api\n */\n/**\n * @param {number} z Z.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {TileCoord=} opt_tileCoord Tile coordinate.\n * @return {TileCoord} Tile coordinate.\n */\nexport function createOrUpdate(z, x, y, opt_tileCoord) {\n if (opt_tileCoord !== undefined) {\n opt_tileCoord[0] = z;\n opt_tileCoord[1] = x;\n opt_tileCoord[2] = y;\n return opt_tileCoord;\n }\n else {\n return [z, x, y];\n }\n}\n/**\n * @param {number} z Z.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {string} Key.\n */\nexport function getKeyZXY(z, x, y) {\n return z + '/' + x + '/' + y;\n}\n/**\n * Get the key for a tile coord.\n * @param {TileCoord} tileCoord The tile coord.\n * @return {string} Key.\n */\nexport function getKey(tileCoord) {\n return getKeyZXY(tileCoord[0], tileCoord[1], tileCoord[2]);\n}\n/**\n * Get a tile coord given a key.\n * @param {string} key The tile coord key.\n * @return {TileCoord} The tile coord.\n */\nexport function fromKey(key) {\n return key.split('/').map(Number);\n}\n/**\n * @param {TileCoord} tileCoord Tile coord.\n * @return {number} Hash.\n */\nexport function hash(tileCoord) {\n return (tileCoord[1] << tileCoord[0]) + tileCoord[2];\n}\n/**\n * @param {TileCoord} tileCoord Tile coordinate.\n * @param {!import(\"./tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @return {boolean} Tile coordinate is within extent and zoom level range.\n */\nexport function withinExtentAndZ(tileCoord, tileGrid) {\n var z = tileCoord[0];\n var x = tileCoord[1];\n var y = tileCoord[2];\n if (tileGrid.getMinZoom() > z || z > tileGrid.getMaxZoom()) {\n return false;\n }\n var extent = tileGrid.getExtent();\n var tileRange;\n if (!extent) {\n tileRange = tileGrid.getFullTileRange(z);\n }\n else {\n tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);\n }\n if (!tileRange) {\n return true;\n }\n else {\n return tileRange.containsXY(x, y);\n }\n}\n//# sourceMappingURL=tilecoord.js.map","/**\n * @module ol/tilegrid/TileGrid\n */\nimport { DEFAULT_TILE_SIZE } from './common.js';\nimport { assert } from '../asserts.js';\nimport TileRange, { createOrUpdate as createOrUpdateTileRange } from '../TileRange.js';\nimport { isSorted, linearFindNearest } from '../array.js';\nimport { createOrUpdate, getTopLeft } from '../extent.js';\nimport { clamp } from '../math.js';\nimport { toSize } from '../size.js';\nimport { createOrUpdate as createOrUpdateTileCoord } from '../tilecoord.js';\n/**\n * @private\n * @type {import(\"../tilecoord.js\").TileCoord}\n */\nvar tmpTileCoord = [0, 0, 0];\n/**\n * @typedef {Object} Options\n * @property {import(\"../extent.js\").Extent} [extent] Extent for the tile grid. No tiles outside this\n * extent will be requested by {@link module:ol/source/Tile} sources. When no `origin` or\n * `origins` are configured, the `origin` will be set to the top-left corner of the extent.\n * @property {number} [minZoom=0] Minimum zoom.\n * @property {import(\"../coordinate.js\").Coordinate} [origin] The tile grid origin, i.e. where the `x`\n * and `y` axes meet (`[z, 0, 0]`). Tile coordinates increase left to right and upwards. If not\n * specified, `extent` or `origins` must be provided.\n * @property {Array<import(\"../coordinate.js\").Coordinate>} [origins] Tile grid origins, i.e. where\n * the `x` and `y` axes meet (`[z, 0, 0]`), for each zoom level. If given, the array length\n * should match the length of the `resolutions` array, i.e. each resolution can have a different\n * origin. Tile coordinates increase left to right and upwards. If not specified, `extent` or\n * `origin` must be provided.\n * @property {!Array<number>} resolutions Resolutions. The array index of each resolution needs\n * to match the zoom level. This means that even if a `minZoom` is configured, the resolutions\n * array will have a length of `maxZoom + 1`.\n * @property {Array<import(\"../size.js\").Size>} [sizes] Sizes.\n * @property {number|import(\"../size.js\").Size} [tileSize] Tile size.\n * Default is `[256, 256]`.\n * @property {Array<import(\"../size.js\").Size>} [tileSizes] Tile sizes. If given, the array length\n * should match the length of the `resolutions` array, i.e. each resolution can have a different\n * tile size.\n */\n/**\n * @classdesc\n * Base class for setting the grid pattern for sources accessing tiled-image\n * servers.\n * @api\n */\nvar TileGrid = /** @class */ (function () {\n /**\n * @param {Options} options Tile grid options.\n */\n function TileGrid(options) {\n /**\n * @protected\n * @type {number}\n */\n this.minZoom = options.minZoom !== undefined ? options.minZoom : 0;\n /**\n * @private\n * @type {!Array<number>}\n */\n this.resolutions_ = options.resolutions;\n assert(isSorted(this.resolutions_, function (a, b) {\n return b - a;\n }, true), 17); // `resolutions` must be sorted in descending order\n // check if we've got a consistent zoom factor and origin\n var zoomFactor;\n if (!options.origins) {\n for (var i = 0, ii = this.resolutions_.length - 1; i < ii; ++i) {\n if (!zoomFactor) {\n zoomFactor = this.resolutions_[i] / this.resolutions_[i + 1];\n }\n else {\n if (this.resolutions_[i] / this.resolutions_[i + 1] !== zoomFactor) {\n zoomFactor = undefined;\n break;\n }\n }\n }\n }\n /**\n * @private\n * @type {number|undefined}\n */\n this.zoomFactor_ = zoomFactor;\n /**\n * @protected\n * @type {number}\n */\n this.maxZoom = this.resolutions_.length - 1;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n this.origin_ = options.origin !== undefined ? options.origin : null;\n /**\n * @private\n * @type {Array<import(\"../coordinate.js\").Coordinate>}\n */\n this.origins_ = null;\n if (options.origins !== undefined) {\n this.origins_ = options.origins;\n assert(this.origins_.length == this.resolutions_.length, 20); // Number of `origins` and `resolutions` must be equal\n }\n var extent = options.extent;\n if (extent !== undefined &&\n !this.origin_ && !this.origins_) {\n this.origin_ = getTopLeft(extent);\n }\n assert((!this.origin_ && this.origins_) || (this.origin_ && !this.origins_), 18); // Either `origin` or `origins` must be configured, never both\n /**\n * @private\n * @type {Array<number|import(\"../size.js\").Size>}\n */\n this.tileSizes_ = null;\n if (options.tileSizes !== undefined) {\n this.tileSizes_ = options.tileSizes;\n assert(this.tileSizes_.length == this.resolutions_.length, 19); // Number of `tileSizes` and `resolutions` must be equal\n }\n /**\n * @private\n * @type {number|import(\"../size.js\").Size}\n */\n this.tileSize_ = options.tileSize !== undefined ?\n options.tileSize :\n !this.tileSizes_ ? DEFAULT_TILE_SIZE : null;\n assert((!this.tileSize_ && this.tileSizes_) ||\n (this.tileSize_ && !this.tileSizes_), 22); // Either `tileSize` or `tileSizes` must be configured, never both\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = extent !== undefined ? extent : null;\n /**\n * @private\n * @type {Array<import(\"../TileRange.js\").default>}\n */\n this.fullTileRanges_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.tmpSize_ = [0, 0];\n if (options.sizes !== undefined) {\n this.fullTileRanges_ = options.sizes.map(function (size, z) {\n var tileRange = new TileRange(Math.min(0, size[0]), Math.max(size[0] - 1, -1), Math.min(0, size[1]), Math.max(size[1] - 1, -1));\n return tileRange;\n }, this);\n }\n else if (extent) {\n this.calculateTileRanges_(extent);\n }\n }\n /**\n * Call a function with each tile coordinate for a given extent and zoom level.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} zoom Integer zoom level.\n * @param {function(import(\"../tilecoord.js\").TileCoord): void} callback Function called with each tile coordinate.\n * @api\n */\n TileGrid.prototype.forEachTileCoord = function (extent, zoom, callback) {\n var tileRange = this.getTileRangeForExtentAndZ(extent, zoom);\n for (var i = tileRange.minX, ii = tileRange.maxX; i <= ii; ++i) {\n for (var j = tileRange.minY, jj = tileRange.maxY; j <= jj; ++j) {\n callback([zoom, i, j]);\n }\n }\n };\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {function(number, import(\"../TileRange.js\").default): boolean} callback Callback.\n * @param {import(\"../TileRange.js\").default=} opt_tileRange Temporary import(\"../TileRange.js\").default object.\n * @param {import(\"../extent.js\").Extent=} opt_extent Temporary import(\"../extent.js\").Extent object.\n * @return {boolean} Callback succeeded.\n */\n TileGrid.prototype.forEachTileCoordParentTileRange = function (tileCoord, callback, opt_tileRange, opt_extent) {\n var tileRange, x, y;\n var tileCoordExtent = null;\n var z = tileCoord[0] - 1;\n if (this.zoomFactor_ === 2) {\n x = tileCoord[1];\n y = tileCoord[2];\n }\n else {\n tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent);\n }\n while (z >= this.minZoom) {\n if (this.zoomFactor_ === 2) {\n x = Math.floor(x / 2);\n y = Math.floor(y / 2);\n tileRange = createOrUpdateTileRange(x, x, y, y, opt_tileRange);\n }\n else {\n tileRange = this.getTileRangeForExtentAndZ(tileCoordExtent, z, opt_tileRange);\n }\n if (callback(z, tileRange)) {\n return true;\n }\n --z;\n }\n return false;\n };\n /**\n * Get the extent for this tile grid, if it was configured.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n TileGrid.prototype.getExtent = function () {\n return this.extent_;\n };\n /**\n * Get the maximum zoom level for the grid.\n * @return {number} Max zoom.\n * @api\n */\n TileGrid.prototype.getMaxZoom = function () {\n return this.maxZoom;\n };\n /**\n * Get the minimum zoom level for the grid.\n * @return {number} Min zoom.\n * @api\n */\n TileGrid.prototype.getMinZoom = function () {\n return this.minZoom;\n };\n /**\n * Get the origin for the grid at the given zoom level.\n * @param {number} z Integer zoom level.\n * @return {import(\"../coordinate.js\").Coordinate} Origin.\n * @api\n */\n TileGrid.prototype.getOrigin = function (z) {\n if (this.origin_) {\n return this.origin_;\n }\n else {\n return this.origins_[z];\n }\n };\n /**\n * Get the resolution for the given zoom level.\n * @param {number} z Integer zoom level.\n * @return {number} Resolution.\n * @api\n */\n TileGrid.prototype.getResolution = function (z) {\n return this.resolutions_[z];\n };\n /**\n * Get the list of resolutions for the tile grid.\n * @return {Array<number>} Resolutions.\n * @api\n */\n TileGrid.prototype.getResolutions = function () {\n return this.resolutions_;\n };\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"../TileRange.js\").default=} opt_tileRange Temporary import(\"../TileRange.js\").default object.\n * @param {import(\"../extent.js\").Extent=} opt_extent Temporary import(\"../extent.js\").Extent object.\n * @return {import(\"../TileRange.js\").default} Tile range.\n */\n TileGrid.prototype.getTileCoordChildTileRange = function (tileCoord, opt_tileRange, opt_extent) {\n if (tileCoord[0] < this.maxZoom) {\n if (this.zoomFactor_ === 2) {\n var minX = tileCoord[1] * 2;\n var minY = tileCoord[2] * 2;\n return createOrUpdateTileRange(minX, minX + 1, minY, minY + 1, opt_tileRange);\n }\n var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent);\n return this.getTileRangeForExtentAndZ(tileCoordExtent, tileCoord[0] + 1, opt_tileRange);\n }\n return null;\n };\n /**\n * Get the extent for a tile range.\n * @param {number} z Integer zoom level.\n * @param {import(\"../TileRange.js\").default} tileRange Tile range.\n * @param {import(\"../extent.js\").Extent=} opt_extent Temporary import(\"../extent.js\").Extent object.\n * @return {import(\"../extent.js\").Extent} Extent.\n */\n TileGrid.prototype.getTileRangeExtent = function (z, tileRange, opt_extent) {\n var origin = this.getOrigin(z);\n var resolution = this.getResolution(z);\n var tileSize = toSize(this.getTileSize(z), this.tmpSize_);\n var minX = origin[0] + tileRange.minX * tileSize[0] * resolution;\n var maxX = origin[0] + (tileRange.maxX + 1) * tileSize[0] * resolution;\n var minY = origin[1] + tileRange.minY * tileSize[1] * resolution;\n var maxY = origin[1] + (tileRange.maxY + 1) * tileSize[1] * resolution;\n return createOrUpdate(minX, minY, maxX, maxY, opt_extent);\n };\n /**\n * Get a tile range for the given extent and integer zoom level.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} z Integer zoom level.\n * @param {import(\"../TileRange.js\").default=} opt_tileRange Temporary tile range object.\n * @return {import(\"../TileRange.js\").default} Tile range.\n */\n TileGrid.prototype.getTileRangeForExtentAndZ = function (extent, z, opt_tileRange) {\n var tileCoord = tmpTileCoord;\n this.getTileCoordForXYAndZ_(extent[0], extent[3], z, false, tileCoord);\n var minX = tileCoord[1];\n var minY = tileCoord[2];\n this.getTileCoordForXYAndZ_(extent[2], extent[1], z, true, tileCoord);\n return createOrUpdateTileRange(minX, tileCoord[1], minY, tileCoord[2], opt_tileRange);\n };\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @return {import(\"../coordinate.js\").Coordinate} Tile center.\n */\n TileGrid.prototype.getTileCoordCenter = function (tileCoord) {\n var origin = this.getOrigin(tileCoord[0]);\n var resolution = this.getResolution(tileCoord[0]);\n var tileSize = toSize(this.getTileSize(tileCoord[0]), this.tmpSize_);\n return [\n origin[0] + (tileCoord[1] + 0.5) * tileSize[0] * resolution,\n origin[1] - (tileCoord[2] + 0.5) * tileSize[1] * resolution\n ];\n };\n /**\n * Get the extent of a tile coordinate.\n *\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"../extent.js\").Extent=} opt_extent Temporary extent object.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n TileGrid.prototype.getTileCoordExtent = function (tileCoord, opt_extent) {\n var origin = this.getOrigin(tileCoord[0]);\n var resolution = this.getResolution(tileCoord[0]);\n var tileSize = toSize(this.getTileSize(tileCoord[0]), this.tmpSize_);\n var minX = origin[0] + tileCoord[1] * tileSize[0] * resolution;\n var minY = origin[1] - (tileCoord[2] + 1) * tileSize[1] * resolution;\n var maxX = minX + tileSize[0] * resolution;\n var maxY = minY + tileSize[1] * resolution;\n return createOrUpdate(minX, minY, maxX, maxY, opt_extent);\n };\n /**\n * Get the tile coordinate for the given map coordinate and resolution. This\n * method considers that coordinates that intersect tile boundaries should be\n * assigned the higher tile coordinate.\n *\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {import(\"../tilecoord.js\").TileCoord=} opt_tileCoord Destination import(\"../tilecoord.js\").TileCoord object.\n * @return {import(\"../tilecoord.js\").TileCoord} Tile coordinate.\n * @api\n */\n TileGrid.prototype.getTileCoordForCoordAndResolution = function (coordinate, resolution, opt_tileCoord) {\n return this.getTileCoordForXYAndResolution_(coordinate[0], coordinate[1], resolution, false, opt_tileCoord);\n };\n /**\n * Note that this method should not be called for resolutions that correspond\n * to an integer zoom level. Instead call the `getTileCoordForXYAndZ_` method.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {number} resolution Resolution (for a non-integer zoom level).\n * @param {boolean} reverseIntersectionPolicy Instead of letting edge\n * intersections go to the higher tile coordinate, let edge intersections\n * go to the lower tile coordinate.\n * @param {import(\"../tilecoord.js\").TileCoord=} opt_tileCoord Temporary import(\"../tilecoord.js\").TileCoord object.\n * @return {import(\"../tilecoord.js\").TileCoord} Tile coordinate.\n * @private\n */\n TileGrid.prototype.getTileCoordForXYAndResolution_ = function (x, y, resolution, reverseIntersectionPolicy, opt_tileCoord) {\n var z = this.getZForResolution(resolution);\n var scale = resolution / this.getResolution(z);\n var origin = this.getOrigin(z);\n var tileSize = toSize(this.getTileSize(z), this.tmpSize_);\n var adjustX = reverseIntersectionPolicy ? 0.5 : 0;\n var adjustY = reverseIntersectionPolicy ? 0.5 : 0;\n var xFromOrigin = Math.floor((x - origin[0]) / resolution + adjustX);\n var yFromOrigin = Math.floor((origin[1] - y) / resolution + adjustY);\n var tileCoordX = scale * xFromOrigin / tileSize[0];\n var tileCoordY = scale * yFromOrigin / tileSize[1];\n if (reverseIntersectionPolicy) {\n tileCoordX = Math.ceil(tileCoordX) - 1;\n tileCoordY = Math.ceil(tileCoordY) - 1;\n }\n else {\n tileCoordX = Math.floor(tileCoordX);\n tileCoordY = Math.floor(tileCoordY);\n }\n return createOrUpdateTileCoord(z, tileCoordX, tileCoordY, opt_tileCoord);\n };\n /**\n * Although there is repetition between this method and `getTileCoordForXYAndResolution_`,\n * they should have separate implementations. This method is for integer zoom\n * levels. The other method should only be called for resolutions corresponding\n * to non-integer zoom levels.\n * @param {number} x Map x coordinate.\n * @param {number} y Map y coordinate.\n * @param {number} z Integer zoom level.\n * @param {boolean} reverseIntersectionPolicy Instead of letting edge\n * intersections go to the higher tile coordinate, let edge intersections\n * go to the lower tile coordinate.\n * @param {import(\"../tilecoord.js\").TileCoord=} opt_tileCoord Temporary import(\"../tilecoord.js\").TileCoord object.\n * @return {import(\"../tilecoord.js\").TileCoord} Tile coordinate.\n * @private\n */\n TileGrid.prototype.getTileCoordForXYAndZ_ = function (x, y, z, reverseIntersectionPolicy, opt_tileCoord) {\n var origin = this.getOrigin(z);\n var resolution = this.getResolution(z);\n var tileSize = toSize(this.getTileSize(z), this.tmpSize_);\n var adjustX = reverseIntersectionPolicy ? 0.5 : 0;\n var adjustY = reverseIntersectionPolicy ? 0.5 : 0;\n var xFromOrigin = Math.floor((x - origin[0]) / resolution + adjustX);\n var yFromOrigin = Math.floor((origin[1] - y) / resolution + adjustY);\n var tileCoordX = xFromOrigin / tileSize[0];\n var tileCoordY = yFromOrigin / tileSize[1];\n if (reverseIntersectionPolicy) {\n tileCoordX = Math.ceil(tileCoordX) - 1;\n tileCoordY = Math.ceil(tileCoordY) - 1;\n }\n else {\n tileCoordX = Math.floor(tileCoordX);\n tileCoordY = Math.floor(tileCoordY);\n }\n return createOrUpdateTileCoord(z, tileCoordX, tileCoordY, opt_tileCoord);\n };\n /**\n * Get a tile coordinate given a map coordinate and zoom level.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} z Zoom level.\n * @param {import(\"../tilecoord.js\").TileCoord=} opt_tileCoord Destination import(\"../tilecoord.js\").TileCoord object.\n * @return {import(\"../tilecoord.js\").TileCoord} Tile coordinate.\n * @api\n */\n TileGrid.prototype.getTileCoordForCoordAndZ = function (coordinate, z, opt_tileCoord) {\n return this.getTileCoordForXYAndZ_(coordinate[0], coordinate[1], z, false, opt_tileCoord);\n };\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @return {number} Tile resolution.\n */\n TileGrid.prototype.getTileCoordResolution = function (tileCoord) {\n return this.resolutions_[tileCoord[0]];\n };\n /**\n * Get the tile size for a zoom level. The type of the return value matches the\n * `tileSize` or `tileSizes` that the tile grid was configured with. To always\n * get an `import(\"../size.js\").Size`, run the result through `import(\"../size.js\").Size.toSize()`.\n * @param {number} z Z.\n * @return {number|import(\"../size.js\").Size} Tile size.\n * @api\n */\n TileGrid.prototype.getTileSize = function (z) {\n if (this.tileSize_) {\n return this.tileSize_;\n }\n else {\n return this.tileSizes_[z];\n }\n };\n /**\n * @param {number} z Zoom level.\n * @return {import(\"../TileRange.js\").default} Extent tile range for the specified zoom level.\n */\n TileGrid.prototype.getFullTileRange = function (z) {\n if (!this.fullTileRanges_) {\n return null;\n }\n else {\n return this.fullTileRanges_[z];\n }\n };\n /**\n * @param {number} resolution Resolution.\n * @param {number=} opt_direction If 0, the nearest resolution will be used.\n * If 1, the nearest lower resolution will be used. If -1, the nearest\n * higher resolution will be used. Default is 0.\n * @return {number} Z.\n * @api\n */\n TileGrid.prototype.getZForResolution = function (resolution, opt_direction) {\n var z = linearFindNearest(this.resolutions_, resolution, opt_direction || 0);\n return clamp(z, this.minZoom, this.maxZoom);\n };\n /**\n * @param {!import(\"../extent.js\").Extent} extent Extent for this tile grid.\n * @private\n */\n TileGrid.prototype.calculateTileRanges_ = function (extent) {\n var length = this.resolutions_.length;\n var fullTileRanges = new Array(length);\n for (var z = this.minZoom; z < length; ++z) {\n fullTileRanges[z] = this.getTileRangeForExtentAndZ(extent, z);\n }\n this.fullTileRanges_ = fullTileRanges;\n };\n return TileGrid;\n}());\nexport default TileGrid;\n//# sourceMappingURL=TileGrid.js.map","/**\n * @module ol/tilegrid\n */\nimport { DEFAULT_MAX_ZOOM, DEFAULT_TILE_SIZE } from './tilegrid/common.js';\nimport { toSize } from './size.js';\nimport { containsCoordinate, createOrUpdate, getCorner, getHeight, getWidth } from './extent.js';\nimport Corner from './extent/Corner.js';\nimport { get as getProjection, METERS_PER_UNIT } from './proj.js';\nimport Units from './proj/Units.js';\nimport TileGrid from './tilegrid/TileGrid.js';\n/**\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {!TileGrid} Default tile grid for the\n * passed projection.\n */\nexport function getForProjection(projection) {\n var tileGrid = projection.getDefaultTileGrid();\n if (!tileGrid) {\n tileGrid = createForProjection(projection);\n projection.setDefaultTileGrid(tileGrid);\n }\n return tileGrid;\n}\n/**\n * @param {TileGrid} tileGrid Tile grid.\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {import(\"./tilecoord.js\").TileCoord} Tile coordinate.\n */\nexport function wrapX(tileGrid, tileCoord, projection) {\n var z = tileCoord[0];\n var center = tileGrid.getTileCoordCenter(tileCoord);\n var projectionExtent = extentFromProjection(projection);\n if (!containsCoordinate(projectionExtent, center)) {\n var worldWidth = getWidth(projectionExtent);\n var worldsAway = Math.ceil((projectionExtent[0] - center[0]) / worldWidth);\n center[0] += worldWidth * worldsAway;\n return tileGrid.getTileCoordForCoordAndZ(center, z);\n }\n else {\n return tileCoord;\n }\n}\n/**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number=} opt_maxZoom Maximum zoom level (default is\n * DEFAULT_MAX_ZOOM).\n * @param {number|import(\"./size.js\").Size=} opt_tileSize Tile size (default uses\n * DEFAULT_TILE_SIZE).\n * @param {Corner=} opt_corner Extent corner (default is `'top-left'`).\n * @return {!TileGrid} TileGrid instance.\n */\nexport function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {\n var corner = opt_corner !== undefined ? opt_corner : Corner.TOP_LEFT;\n var resolutions = resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize);\n return new TileGrid({\n extent: extent,\n origin: getCorner(extent, corner),\n resolutions: resolutions,\n tileSize: opt_tileSize\n });\n}\n/**\n * @typedef {Object} XYZOptions\n * @property {import(\"./extent.js\").Extent} [extent] Extent for the tile grid. The origin for an XYZ tile grid is the\n * top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the\n * provided extent. If not provided, the extent of the EPSG:3857 projection is used.\n * @property {number} [maxZoom] Maximum zoom. The default is `42`. This determines the number of levels\n * in the grid set. For example, a `maxZoom` of 21 means there are 22 levels in the grid set.\n * @property {number} [minZoom=0] Minimum zoom.\n * @property {number|import(\"./size.js\").Size} [tileSize=[256, 256]] Tile size in pixels.\n */\n/**\n * Creates a tile grid with a standard XYZ tiling scheme.\n * @param {XYZOptions=} opt_options Tile grid options.\n * @return {!TileGrid} Tile grid instance.\n * @api\n */\nexport function createXYZ(opt_options) {\n var xyzOptions = opt_options || {};\n var extent = xyzOptions.extent || getProjection('EPSG:3857').getExtent();\n var gridOptions = {\n extent: extent,\n minZoom: xyzOptions.minZoom,\n tileSize: xyzOptions.tileSize,\n resolutions: resolutionsFromExtent(extent, xyzOptions.maxZoom, xyzOptions.tileSize)\n };\n return new TileGrid(gridOptions);\n}\n/**\n * Create a resolutions array from an extent. A zoom factor of 2 is assumed.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number=} opt_maxZoom Maximum zoom level (default is\n * DEFAULT_MAX_ZOOM).\n * @param {number|import(\"./size.js\").Size=} opt_tileSize Tile size (default uses\n * DEFAULT_TILE_SIZE).\n * @return {!Array<number>} Resolutions array.\n */\nfunction resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) {\n var maxZoom = opt_maxZoom !== undefined ?\n opt_maxZoom : DEFAULT_MAX_ZOOM;\n var height = getHeight(extent);\n var width = getWidth(extent);\n var tileSize = toSize(opt_tileSize !== undefined ?\n opt_tileSize : DEFAULT_TILE_SIZE);\n var maxResolution = Math.max(width / tileSize[0], height / tileSize[1]);\n var length = maxZoom + 1;\n var resolutions = new Array(length);\n for (var z = 0; z < length; ++z) {\n resolutions[z] = maxResolution / Math.pow(2, z);\n }\n return resolutions;\n}\n/**\n * @param {import(\"./proj.js\").ProjectionLike} projection Projection.\n * @param {number=} opt_maxZoom Maximum zoom level (default is\n * DEFAULT_MAX_ZOOM).\n * @param {number|import(\"./size.js\").Size=} opt_tileSize Tile size (default uses\n * DEFAULT_TILE_SIZE).\n * @param {Corner=} opt_corner Extent corner (default is `'top-left'`).\n * @return {!TileGrid} TileGrid instance.\n */\nexport function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_corner) {\n var extent = extentFromProjection(projection);\n return createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner);\n}\n/**\n * Generate a tile grid extent from a projection. If the projection has an\n * extent, it is used. If not, a global extent is assumed.\n * @param {import(\"./proj.js\").ProjectionLike} projection Projection.\n * @return {import(\"./extent.js\").Extent} Extent.\n */\nexport function extentFromProjection(projection) {\n projection = getProjection(projection);\n var extent = projection.getExtent();\n if (!extent) {\n var half = 180 * METERS_PER_UNIT[Units.DEGREES] / projection.getMetersPerUnit();\n extent = createOrUpdate(-half, -half, half, half);\n }\n return extent;\n}\n//# sourceMappingURL=tilegrid.js.map","/**\n * @module ol/webgl\n */\n/**\n * Constants taken from goog.webgl\n */\n/**\n * Used by {@link module:ol/webgl/Helper~WebGLHelper} for buffers containing vertices data, such as\n * position, color, texture coordinate, etc. These vertices are then referenced by an index buffer\n * to be drawn on screen (see {@link module:ol/webgl.ELEMENT_ARRAY_BUFFER}).\n * @const\n * @type {number}\n * @api\n */\nexport var ARRAY_BUFFER = 0x8892;\n/**\n * Used by {@link module:ol/webgl/Helper~WebGLHelper} for buffers containing indices data.\n * Index buffers are essentially lists of references to vertices defined in a vertex buffer\n * (see {@link module:ol/webgl.ARRAY_BUFFER}), and define the primitives (triangles) to be drawn.\n * @const\n * @type {number}\n * @api\n */\nexport var ELEMENT_ARRAY_BUFFER = 0x8893;\n/**\n * Used by {link module:ol/webgl/Buffer~WebGLArrayBuffer}.\n * @const\n * @type {number}\n * @api\n */\nexport var STREAM_DRAW = 0x88E0;\n/**\n * Used by {link module:ol/webgl/Buffer~WebGLArrayBuffer}.\n * @const\n * @type {number}\n * @api\n */\nexport var STATIC_DRAW = 0x88E4;\n/**\n * Used by {link module:ol/webgl/Buffer~WebGLArrayBuffer}.\n * @const\n * @type {number}\n * @api\n */\nexport var DYNAMIC_DRAW = 0x88E8;\n/**\n * @const\n * @type {number}\n */\nexport var UNSIGNED_BYTE = 0x1401;\n/**\n * @const\n * @type {number}\n */\nexport var UNSIGNED_SHORT = 0x1403;\n/**\n * @const\n * @type {number}\n */\nexport var UNSIGNED_INT = 0x1405;\n/**\n * @const\n * @type {number}\n */\nexport var FLOAT = 0x1406;\n/** end of goog.webgl constants\n */\n/**\n * @const\n * @type {Array<string>}\n */\nvar CONTEXT_IDS = [\n 'experimental-webgl',\n 'webgl',\n 'webkit-3d',\n 'moz-webgl'\n];\n/**\n * @param {HTMLCanvasElement} canvas Canvas.\n * @param {Object=} opt_attributes Attributes.\n * @return {WebGLRenderingContext} WebGL rendering context.\n */\nexport function getContext(canvas, opt_attributes) {\n var ii = CONTEXT_IDS.length;\n for (var i = 0; i < ii; ++i) {\n try {\n var context = canvas.getContext(CONTEXT_IDS[i], opt_attributes);\n if (context) {\n return /** @type {!WebGLRenderingContext} */ (context);\n }\n }\n catch (e) {\n // pass\n }\n }\n return null;\n}\n/**\n * @type {Array<string>}\n */\nvar supportedExtensions;\n/**\n * @return {Array<string>} List of supported WebGL extensions.\n */\nexport function getSupportedExtensions() {\n if (!supportedExtensions) {\n var canvas = document.createElement('canvas');\n var gl = getContext(canvas);\n if (gl) {\n supportedExtensions = gl.getSupportedExtensions();\n }\n }\n return supportedExtensions;\n}\n//# sourceMappingURL=webgl.js.map","/**\n * @module ol/xml\n */\nimport { extend } from './array.js';\n/**\n * When using {@link module:ol/xml~makeChildAppender} or\n * {@link module:ol/xml~makeSimpleNodeFactory}, the top `objectStack` item needs\n * to have this structure.\n * @typedef {Object} NodeStackItem\n * @property {Node} node\n */\n/**\n * @typedef {function(Element, Array<*>): void} Parser\n */\n/**\n * @typedef {function(Element, *, Array<*>): void} Serializer\n */\n/**\n * This document should be used when creating nodes for XML serializations. This\n * document is also used by {@link module:ol/xml~createElementNS}\n * @const\n * @type {Document}\n */\nexport var DOCUMENT = document.implementation.createDocument('', '', null);\n/**\n * @type {string}\n */\nexport var XML_SCHEMA_INSTANCE_URI = 'http://www.w3.org/2001/XMLSchema-instance';\n/**\n * @param {string} namespaceURI Namespace URI.\n * @param {string} qualifiedName Qualified name.\n * @return {Element} Node.\n */\nexport function createElementNS(namespaceURI, qualifiedName) {\n return DOCUMENT.createElementNS(namespaceURI, qualifiedName);\n}\n/**\n * Recursively grab all text content of child nodes into a single string.\n * @param {Node} node Node.\n * @param {boolean} normalizeWhitespace Normalize whitespace: remove all line\n * breaks.\n * @return {string} All text content.\n * @api\n */\nexport function getAllTextContent(node, normalizeWhitespace) {\n return getAllTextContent_(node, normalizeWhitespace, []).join('');\n}\n/**\n * Recursively grab all text content of child nodes into a single string.\n * @param {Node} node Node.\n * @param {boolean} normalizeWhitespace Normalize whitespace: remove all line\n * breaks.\n * @param {Array<string>} accumulator Accumulator.\n * @private\n * @return {Array<string>} Accumulator.\n */\nexport function getAllTextContent_(node, normalizeWhitespace, accumulator) {\n if (node.nodeType == Node.CDATA_SECTION_NODE ||\n node.nodeType == Node.TEXT_NODE) {\n if (normalizeWhitespace) {\n accumulator.push(String(node.nodeValue).replace(/(\\r\\n|\\r|\\n)/g, ''));\n }\n else {\n accumulator.push(node.nodeValue);\n }\n }\n else {\n var n = void 0;\n for (n = node.firstChild; n; n = n.nextSibling) {\n getAllTextContent_(n, normalizeWhitespace, accumulator);\n }\n }\n return accumulator;\n}\n/**\n * @param {Object} object Object.\n * @return {boolean} Is a document.\n */\nexport function isDocument(object) {\n return 'documentElement' in object;\n}\n/**\n * @param {Element} node Node.\n * @param {?string} namespaceURI Namespace URI.\n * @param {string} name Attribute name.\n * @return {string} Value\n */\nexport function getAttributeNS(node, namespaceURI, name) {\n return node.getAttributeNS(namespaceURI, name) || '';\n}\n/**\n * Parse an XML string to an XML Document.\n * @param {string} xml XML.\n * @return {Document} Document.\n * @api\n */\nexport function parse(xml) {\n return new DOMParser().parseFromString(xml, 'application/xml');\n}\n/**\n * Make an array extender function for extending the array at the top of the\n * object stack.\n * @param {function(this: T, Node, Array<*>): (Array<*>|undefined)} valueReader Value reader.\n * @param {T=} opt_this The object to use as `this` in `valueReader`.\n * @return {Parser} Parser.\n * @template T\n */\nexport function makeArrayExtender(valueReader, opt_this) {\n return (\n /**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\n function (node, objectStack) {\n var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack);\n if (value !== undefined) {\n var array = /** @type {Array<*>} */ (objectStack[objectStack.length - 1]);\n extend(array, value);\n }\n });\n}\n/**\n * Make an array pusher function for pushing to the array at the top of the\n * object stack.\n * @param {function(this: T, Element, Array<*>): *} valueReader Value reader.\n * @param {T=} opt_this The object to use as `this` in `valueReader`.\n * @return {Parser} Parser.\n * @template T\n */\nexport function makeArrayPusher(valueReader, opt_this) {\n return (\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\n function (node, objectStack) {\n var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack);\n if (value !== undefined) {\n var array = /** @type {Array<*>} */ (objectStack[objectStack.length - 1]);\n array.push(value);\n }\n });\n}\n/**\n * Make an object stack replacer function for replacing the object at the\n * top of the stack.\n * @param {function(this: T, Node, Array<*>): *} valueReader Value reader.\n * @param {T=} opt_this The object to use as `this` in `valueReader`.\n * @return {Parser} Parser.\n * @template T\n */\nexport function makeReplacer(valueReader, opt_this) {\n return (\n /**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\n function (node, objectStack) {\n var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack);\n if (value !== undefined) {\n objectStack[objectStack.length - 1] = value;\n }\n });\n}\n/**\n * Make an object property pusher function for adding a property to the\n * object at the top of the stack.\n * @param {function(this: T, Element, Array<*>): *} valueReader Value reader.\n * @param {string=} opt_property Property.\n * @param {T=} opt_this The object to use as `this` in `valueReader`.\n * @return {Parser} Parser.\n * @template T\n */\nexport function makeObjectPropertyPusher(valueReader, opt_property, opt_this) {\n return (\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\n function (node, objectStack) {\n var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack);\n if (value !== undefined) {\n var object = /** @type {!Object} */ (objectStack[objectStack.length - 1]);\n var property = opt_property !== undefined ? opt_property : node.localName;\n var array = void 0;\n if (property in object) {\n array = object[property];\n }\n else {\n array = [];\n object[property] = array;\n }\n array.push(value);\n }\n });\n}\n/**\n * Make an object property setter function.\n * @param {function(this: T, Element, Array<*>): *} valueReader Value reader.\n * @param {string=} opt_property Property.\n * @param {T=} opt_this The object to use as `this` in `valueReader`.\n * @return {Parser} Parser.\n * @template T\n */\nexport function makeObjectPropertySetter(valueReader, opt_property, opt_this) {\n return (\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\n function (node, objectStack) {\n var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack);\n if (value !== undefined) {\n var object = /** @type {!Object} */ (objectStack[objectStack.length - 1]);\n var property = opt_property !== undefined ? opt_property : node.localName;\n object[property] = value;\n }\n });\n}\n/**\n * Create a serializer that appends nodes written by its `nodeWriter` to its\n * designated parent. The parent is the `node` of the\n * {@link module:ol/xml~NodeStackItem} at the top of the `objectStack`.\n * @param {function(this: T, Node, V, Array<*>): void} nodeWriter Node writer.\n * @param {T=} opt_this The object to use as `this` in `nodeWriter`.\n * @return {Serializer} Serializer.\n * @template T, V\n */\nexport function makeChildAppender(nodeWriter, opt_this) {\n return function (node, value, objectStack) {\n nodeWriter.call(opt_this !== undefined ? opt_this : this, node, value, objectStack);\n var parent = /** @type {NodeStackItem} */ (objectStack[objectStack.length - 1]);\n var parentNode = parent.node;\n parentNode.appendChild(node);\n };\n}\n/**\n * Create a serializer that calls the provided `nodeWriter` from\n * {@link module:ol/xml~serialize}. This can be used by the parent writer to have the\n * 'nodeWriter' called with an array of values when the `nodeWriter` was\n * designed to serialize a single item. An example would be a LineString\n * geometry writer, which could be reused for writing MultiLineString\n * geometries.\n * @param {function(this: T, Element, V, Array<*>): void} nodeWriter Node writer.\n * @param {T=} opt_this The object to use as `this` in `nodeWriter`.\n * @return {Serializer} Serializer.\n * @template T, V\n */\nexport function makeArraySerializer(nodeWriter, opt_this) {\n var serializersNS, nodeFactory;\n return function (node, value, objectStack) {\n if (serializersNS === undefined) {\n serializersNS = {};\n var serializers = {};\n serializers[node.localName] = nodeWriter;\n serializersNS[node.namespaceURI] = serializers;\n nodeFactory = makeSimpleNodeFactory(node.localName);\n }\n serialize(serializersNS, nodeFactory, value, objectStack);\n };\n}\n/**\n * Create a node factory which can use the `opt_keys` passed to\n * {@link module:ol/xml~serialize} or {@link module:ol/xml~pushSerializeAndPop} as node names,\n * or a fixed node name. The namespace of the created nodes can either be fixed,\n * or the parent namespace will be used.\n * @param {string=} opt_nodeName Fixed node name which will be used for all\n * created nodes. If not provided, the 3rd argument to the resulting node\n * factory needs to be provided and will be the nodeName.\n * @param {string=} opt_namespaceURI Fixed namespace URI which will be used for\n * all created nodes. If not provided, the namespace of the parent node will\n * be used.\n * @return {function(*, Array<*>, string=): (Node|undefined)} Node factory.\n */\nexport function makeSimpleNodeFactory(opt_nodeName, opt_namespaceURI) {\n var fixedNodeName = opt_nodeName;\n return (\n /**\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node} Node.\n */\n function (value, objectStack, opt_nodeName) {\n var context = /** @type {NodeStackItem} */ (objectStack[objectStack.length - 1]);\n var node = context.node;\n var nodeName = fixedNodeName;\n if (nodeName === undefined) {\n nodeName = opt_nodeName;\n }\n var namespaceURI = opt_namespaceURI !== undefined ? opt_namespaceURI : node.namespaceURI;\n return createElementNS(namespaceURI, /** @type {string} */ (nodeName));\n });\n}\n/**\n * A node factory that creates a node using the parent's `namespaceURI` and the\n * `nodeName` passed by {@link module:ol/xml~serialize} or\n * {@link module:ol/xml~pushSerializeAndPop} to the node factory.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nexport var OBJECT_PROPERTY_NODE_FACTORY = makeSimpleNodeFactory();\n/**\n * Create an array of `values` to be used with {@link module:ol/xml~serialize} or\n * {@link module:ol/xml~pushSerializeAndPop}, where `orderedKeys` has to be provided as\n * `opt_key` argument.\n * @param {Object<string, *>} object Key-value pairs for the sequence. Keys can\n * be a subset of the `orderedKeys`.\n * @param {Array<string>} orderedKeys Keys in the order of the sequence.\n * @return {Array<*>} Values in the order of the sequence. The resulting array\n * has the same length as the `orderedKeys` array. Values that are not\n * present in `object` will be `undefined` in the resulting array.\n */\nexport function makeSequence(object, orderedKeys) {\n var length = orderedKeys.length;\n var sequence = new Array(length);\n for (var i = 0; i < length; ++i) {\n sequence[i] = object[orderedKeys[i]];\n }\n return sequence;\n}\n/**\n * Create a namespaced structure, using the same values for each namespace.\n * This can be used as a starting point for versioned parsers, when only a few\n * values are version specific.\n * @param {Array<string>} namespaceURIs Namespace URIs.\n * @param {T} structure Structure.\n * @param {Object<string, T>=} opt_structureNS Namespaced structure to add to.\n * @return {Object<string, T>} Namespaced structure.\n * @template T\n */\nexport function makeStructureNS(namespaceURIs, structure, opt_structureNS) {\n /**\n * @type {Object<string, T>}\n */\n var structureNS = opt_structureNS !== undefined ? opt_structureNS : {};\n var i, ii;\n for (i = 0, ii = namespaceURIs.length; i < ii; ++i) {\n structureNS[namespaceURIs[i]] = structure;\n }\n return structureNS;\n}\n/**\n * Parse a node using the parsers and object stack.\n * @param {Object<string, Object<string, Parser>>} parsersNS\n * Parsers by namespace.\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @param {*=} opt_this The object to use as `this`.\n */\nexport function parseNode(parsersNS, node, objectStack, opt_this) {\n var n;\n for (n = node.firstElementChild; n; n = n.nextElementSibling) {\n var parsers = parsersNS[n.namespaceURI];\n if (parsers !== undefined) {\n var parser = parsers[n.localName];\n if (parser !== undefined) {\n parser.call(opt_this, n, objectStack);\n }\n }\n }\n}\n/**\n * Push an object on top of the stack, parse and return the popped object.\n * @param {T} object Object.\n * @param {Object<string, Object<string, Parser>>} parsersNS\n * Parsers by namespace.\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @param {*=} opt_this The object to use as `this`.\n * @return {T} Object.\n * @template T\n */\nexport function pushParseAndPop(object, parsersNS, node, objectStack, opt_this) {\n objectStack.push(object);\n parseNode(parsersNS, node, objectStack, opt_this);\n return /** @type {T} */ (objectStack.pop());\n}\n/**\n * Walk through an array of `values` and call a serializer for each value.\n * @param {Object<string, Object<string, Serializer>>} serializersNS\n * Namespaced serializers.\n * @param {function(this: T, *, Array<*>, (string|undefined)): (Node|undefined)} nodeFactory\n * Node factory. The `nodeFactory` creates the node whose namespace and name\n * will be used to choose a node writer from `serializersNS`. This\n * separation allows us to decide what kind of node to create, depending on\n * the value we want to serialize. An example for this would be different\n * geometry writers based on the geometry type.\n * @param {Array<*>} values Values to serialize. An example would be an array\n * of {@link module:ol/Feature~Feature} instances.\n * @param {Array<*>} objectStack Node stack.\n * @param {Array<string>=} opt_keys Keys of the `values`. Will be passed to the\n * `nodeFactory`. This is used for serializing object literals where the\n * node name relates to the property key. The array length of `opt_keys` has\n * to match the length of `values`. For serializing a sequence, `opt_keys`\n * determines the order of the sequence.\n * @param {T=} opt_this The object to use as `this` for the node factory and\n * serializers.\n * @template T\n */\nexport function serialize(serializersNS, nodeFactory, values, objectStack, opt_keys, opt_this) {\n var length = (opt_keys !== undefined ? opt_keys : values).length;\n var value, node;\n for (var i = 0; i < length; ++i) {\n value = values[i];\n if (value !== undefined) {\n node = nodeFactory.call(opt_this !== undefined ? opt_this : this, value, objectStack, opt_keys !== undefined ? opt_keys[i] : undefined);\n if (node !== undefined) {\n serializersNS[node.namespaceURI][node.localName]\n .call(opt_this, node, value, objectStack);\n }\n }\n }\n}\n/**\n * @param {O} object Object.\n * @param {Object<string, Object<string, Serializer>>} serializersNS\n * Namespaced serializers.\n * @param {function(this: T, *, Array<*>, (string|undefined)): (Node|undefined)} nodeFactory\n * Node factory. The `nodeFactory` creates the node whose namespace and name\n * will be used to choose a node writer from `serializersNS`. This\n * separation allows us to decide what kind of node to create, depending on\n * the value we want to serialize. An example for this would be different\n * geometry writers based on the geometry type.\n * @param {Array<*>} values Values to serialize. An example would be an array\n * of {@link module:ol/Feature~Feature} instances.\n * @param {Array<*>} objectStack Node stack.\n * @param {Array<string>=} opt_keys Keys of the `values`. Will be passed to the\n * `nodeFactory`. This is used for serializing object literals where the\n * node name relates to the property key. The array length of `opt_keys` has\n * to match the length of `values`. For serializing a sequence, `opt_keys`\n * determines the order of the sequence.\n * @param {T=} opt_this The object to use as `this` for the node factory and\n * serializers.\n * @return {O|undefined} Object.\n * @template O, T\n */\nexport function pushSerializeAndPop(object, serializersNS, nodeFactory, values, objectStack, opt_keys, opt_this) {\n objectStack.push(object);\n serialize(serializersNS, nodeFactory, values, objectStack, opt_keys, opt_this);\n return /** @type {O|undefined} */ (objectStack.pop());\n}\n//# sourceMappingURL=xml.js.map","/**\n * @module ol/webgl/Buffer\n */\nimport { STATIC_DRAW, STREAM_DRAW, DYNAMIC_DRAW } from '../webgl.js';\nimport { ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER } from '../webgl.js';\nimport { assert } from '../asserts.js';\n/**\n * Used to describe the intended usage for the data: `STATIC_DRAW`, `STREAM_DRAW`\n * or `DYNAMIC_DRAW`.\n * @enum {number}\n */\nexport var BufferUsage = {\n STATIC_DRAW: STATIC_DRAW,\n STREAM_DRAW: STREAM_DRAW,\n DYNAMIC_DRAW: DYNAMIC_DRAW\n};\n/**\n * @classdesc\n * Object used to store an array of data as well as usage information for that data.\n * Stores typed arrays internally, either Float32Array or Uint16/32Array depending on\n * the buffer type (ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER) and available extensions.\n *\n * To populate the array, you can either use:\n * * A size using `#ofSize(buffer)`\n * * An `ArrayBuffer` object using `#fromArrayBuffer(buffer)`\n * * A plain array using `#fromArray(array)`\n *\n * Note:\n * See the documentation of [WebGLRenderingContext.bufferData](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData)\n * for more info on buffer usage.\n * @api\n */\nvar WebGLArrayBuffer = /** @class */ (function () {\n /**\n * @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.\n * @param {number=} opt_usage Intended usage, either `STATIC_DRAW`, `STREAM_DRAW` or `DYNAMIC_DRAW`.\n * Default is `DYNAMIC_DRAW`.\n */\n function WebGLArrayBuffer(type, opt_usage) {\n /**\n * @private\n * @type {Float32Array|Uint32Array}\n */\n this.array = null;\n /**\n * @private\n * @type {number}\n */\n this.type = type;\n assert(type === ARRAY_BUFFER || type === ELEMENT_ARRAY_BUFFER, 62);\n /**\n * @private\n * @type {number}\n */\n this.usage = opt_usage !== undefined ? opt_usage : BufferUsage.STATIC_DRAW;\n }\n /**\n * Populates the buffer with an array of the given size (all values will be zeroes).\n * @param {number} size Array size\n */\n WebGLArrayBuffer.prototype.ofSize = function (size) {\n this.array = new (getArrayClassForType(this.type))(size);\n };\n /**\n * Populates the buffer with an array of the given size (all values will be zeroes).\n * @param {Array<number>} array Numerical array\n */\n WebGLArrayBuffer.prototype.fromArray = function (array) {\n this.array = (getArrayClassForType(this.type)).from(array);\n };\n /**\n * Populates the buffer with a raw binary array buffer.\n * @param {ArrayBuffer} buffer Raw binary buffer to populate the array with. Note that this buffer must have been\n * initialized for the same typed array class.\n */\n WebGLArrayBuffer.prototype.fromArrayBuffer = function (buffer) {\n this.array = new (getArrayClassForType(this.type))(buffer);\n };\n /**\n * @return {number} Buffer type.\n */\n WebGLArrayBuffer.prototype.getType = function () {\n return this.type;\n };\n /**\n * Will return null if the buffer was not initialized\n * @return {Float32Array|Uint32Array} Array.\n */\n WebGLArrayBuffer.prototype.getArray = function () {\n return this.array;\n };\n /**\n * @return {number} Usage.\n */\n WebGLArrayBuffer.prototype.getUsage = function () {\n return this.usage;\n };\n /**\n * Will return 0 if the buffer is not initialized\n * @return {number} Array size\n */\n WebGLArrayBuffer.prototype.getSize = function () {\n return this.array ? this.array.length : 0;\n };\n return WebGLArrayBuffer;\n}());\n/**\n * Returns a typed array constructor based on the given buffer type\n * @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.\n * @returns {Float32ArrayConstructor|Uint32ArrayConstructor} The typed array class to use for this buffer.\n */\nexport function getArrayClassForType(type) {\n switch (type) {\n case ARRAY_BUFFER:\n return Float32Array;\n case ELEMENT_ARRAY_BUFFER:\n return Uint32Array;\n default:\n return Float32Array;\n }\n}\nexport default WebGLArrayBuffer;\n//# sourceMappingURL=Buffer.js.map","/**\n * @module ol/webgl/ContextEventType\n */\n/**\n * @enum {string}\n */\nexport default {\n LOST: 'webglcontextlost',\n RESTORED: 'webglcontextrestored'\n};\n//# sourceMappingURL=ContextEventType.js.map","/**\n * @module ol/vec/mat4\n */\n/**\n * @return {Array<number>} \"4x4 matrix representing a 3D identity transform.\"\n */\nexport function create() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n/**\n * @param {Array<number>} mat4 Flattened 4x4 matrix receiving the result.\n * @param {import(\"../transform.js\").Transform} transform Transformation matrix.\n * @return {Array<number>} \"2D transformation matrix as flattened 4x4 matrix.\"\n */\nexport function fromTransform(mat4, transform) {\n mat4[0] = transform[0];\n mat4[1] = transform[1];\n mat4[4] = transform[2];\n mat4[5] = transform[3];\n mat4[12] = transform[4];\n mat4[13] = transform[5];\n return mat4;\n}\n//# sourceMappingURL=mat4.js.map","/**\n * @module ol/webgl/PostProcessingPass\n */\nvar DEFAULT_VERTEX_SHADER = \"\\n precision mediump float;\\n \\n attribute vec2 a_position;\\n varying vec2 v_texCoord;\\n varying vec2 v_screenCoord;\\n \\n uniform vec2 u_screenSize;\\n \\n void main() {\\n v_texCoord = a_position * 0.5 + 0.5;\\n v_screenCoord = v_texCoord * u_screenSize;\\n gl_Position = vec4(a_position, 0.0, 1.0);\\n }\\n\";\nvar DEFAULT_FRAGMENT_SHADER = \"\\n precision mediump float;\\n \\n uniform sampler2D u_image;\\n \\n varying vec2 v_texCoord;\\n varying vec2 v_screenCoord;\\n \\n void main() {\\n gl_FragColor = texture2D(u_image, v_texCoord);\\n }\\n\";\n/**\n * @typedef {Object} Options\n * @property {WebGLRenderingContext} webGlContext WebGL context; mandatory.\n * @property {number} [scaleRatio] Scale ratio; if < 1, the post process will render to a texture smaller than\n * the main canvas that will then be sampled up (useful for saving resource on blur steps).\n * @property {string} [vertexShader] Vertex shader source\n * @property {string} [fragmentShader] Fragment shader source\n * @property {Object.<string,import(\"./Helper\").UniformValue>} [uniforms] Uniform definitions for the post process step\n */\n/**\n * @typedef {Object} UniformInternalDescription\n * @property {import(\"./Helper\").UniformValue} value Value\n * @property {number} location Location\n * @property {WebGLTexture} [texture] Texture\n * @private\n */\n/**\n * @classdesc\n * This class is used to define Post Processing passes with custom shaders and uniforms.\n * This is used internally by {@link module:ol/webgl/Helper~WebGLHelper}.\n *\n * Please note that the final output on the DOM canvas is expected to have premultiplied alpha, which means that\n * a pixel which is 100% red with an opacity of 50% must have a color of (r=0.5, g=0, b=0, a=0.5).\n * Failing to provide pixel colors with premultiplied alpha will result in render anomalies.\n *\n * The default post-processing pass does *not* multiply color values with alpha value, it expects color values to be\n * premultiplied.\n *\n * Default shaders are shown hereafter:\n *\n * * Vertex shader:\n *\n * ```\n * precision mediump float;\n *\n * attribute vec2 a_position;\n * varying vec2 v_texCoord;\n * varying vec2 v_screenCoord;\n *\n * uniform vec2 u_screenSize;\n *\n * void main() {\n * v_texCoord = a_position * 0.5 + 0.5;\n * v_screenCoord = v_texCoord * u_screenSize;\n * gl_Position = vec4(a_position, 0.0, 1.0);\n * }\n * ```\n *\n * * Fragment shader:\n *\n * ```\n * precision mediump float;\n *\n * uniform sampler2D u_image;\n *\n * varying vec2 v_texCoord;\n * varying vec2 v_screenCoord;\n *\n * void main() {\n * gl_FragColor = texture2D(u_image, v_texCoord);\n * }\n * ```\n *\n * @api\n */\nvar WebGLPostProcessingPass = /** @class */ (function () {\n /**\n * @param {Options} options Options.\n */\n function WebGLPostProcessingPass(options) {\n this.gl_ = options.webGlContext;\n var gl = this.gl_;\n this.scaleRatio_ = options.scaleRatio || 1;\n this.renderTargetTexture_ = gl.createTexture();\n this.renderTargetTextureSize_ = null;\n this.frameBuffer_ = gl.createFramebuffer();\n // compile the program for the frame buffer\n // TODO: make compilation errors show up\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, options.vertexShader || DEFAULT_VERTEX_SHADER);\n gl.compileShader(vertexShader);\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, options.fragmentShader || DEFAULT_FRAGMENT_SHADER);\n gl.compileShader(fragmentShader);\n this.renderTargetProgram_ = gl.createProgram();\n gl.attachShader(this.renderTargetProgram_, vertexShader);\n gl.attachShader(this.renderTargetProgram_, fragmentShader);\n gl.linkProgram(this.renderTargetProgram_);\n // bind the vertices buffer for the frame buffer\n this.renderTargetVerticesBuffer_ = gl.createBuffer();\n var verticesArray = [\n -1, -1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n -1, 1\n ];\n gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verticesArray), gl.STATIC_DRAW);\n this.renderTargetAttribLocation_ = gl.getAttribLocation(this.renderTargetProgram_, 'a_position');\n this.renderTargetUniformLocation_ = gl.getUniformLocation(this.renderTargetProgram_, 'u_screenSize');\n this.renderTargetTextureLocation_ = gl.getUniformLocation(this.renderTargetProgram_, 'u_image');\n /**\n * Holds info about custom uniforms used in the post processing pass\n * @type {Array<UniformInternalDescription>}\n * @private\n */\n this.uniforms_ = [];\n options.uniforms && Object.keys(options.uniforms).forEach(function (name) {\n this.uniforms_.push({\n value: options.uniforms[name],\n location: gl.getUniformLocation(this.renderTargetProgram_, name)\n });\n }.bind(this));\n }\n /**\n * Get the WebGL rendering context\n * @return {WebGLRenderingContext} The rendering context.\n * @api\n */\n WebGLPostProcessingPass.prototype.getGL = function () {\n return this.gl_;\n };\n /**\n * Initialize the render target texture of the post process, make sure it is at the\n * right size and bind it as a render target for the next draw calls.\n * The last step to be initialized will be the one where the primitives are rendered.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState current frame state\n * @api\n */\n WebGLPostProcessingPass.prototype.init = function (frameState) {\n var gl = this.getGL();\n var canvas = gl.canvas;\n var size = frameState.size;\n // rendering goes to my buffer\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.getFrameBuffer());\n gl.viewport(0, 0, canvas.width * this.scaleRatio_, canvas.height * this.scaleRatio_);\n // if size has changed: adjust canvas & render target texture\n if (!this.renderTargetTextureSize_ ||\n this.renderTargetTextureSize_[0] !== size[0] || this.renderTargetTextureSize_[1] !== size[1]) {\n this.renderTargetTextureSize_ = size;\n // create a new texture\n var level = 0;\n var internalFormat = gl.RGBA;\n var border = 0;\n var format = gl.RGBA;\n var type = gl.UNSIGNED_BYTE;\n var data = null;\n gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, canvas.width * this.scaleRatio_, canvas.height * this.scaleRatio_, border, format, type, data);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n // bind the texture to the framebuffer\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.renderTargetTexture_, 0);\n }\n };\n /**\n * Render to the next postprocessing pass (or to the canvas if final pass).\n * @param {import(\"../PluggableMap.js\").FrameState} frameState current frame state\n * @param {WebGLPostProcessingPass} [nextPass] Next pass, optional\n * @api\n */\n WebGLPostProcessingPass.prototype.apply = function (frameState, nextPass) {\n var gl = this.getGL();\n var canvas = gl.canvas;\n gl.bindFramebuffer(gl.FRAMEBUFFER, nextPass ? nextPass.getFrameBuffer() : null);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);\n // render the frame buffer to the canvas\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);\n gl.useProgram(this.renderTargetProgram_);\n gl.enableVertexAttribArray(this.renderTargetAttribLocation_);\n gl.vertexAttribPointer(this.renderTargetAttribLocation_, 2, gl.FLOAT, false, 0, 0);\n gl.uniform2f(this.renderTargetUniformLocation_, canvas.width, canvas.height);\n gl.uniform1i(this.renderTargetTextureLocation_, 0);\n this.applyUniforms(frameState);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n /**\n * @returns {WebGLFramebuffer} Frame buffer\n * @api\n */\n WebGLPostProcessingPass.prototype.getFrameBuffer = function () {\n return this.frameBuffer_;\n };\n /**\n * Sets the custom uniforms based on what was given in the constructor.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @private\n */\n WebGLPostProcessingPass.prototype.applyUniforms = function (frameState) {\n var gl = this.getGL();\n var value;\n var textureSlot = 1;\n this.uniforms_.forEach(function (uniform) {\n value = typeof uniform.value === 'function' ? uniform.value(frameState) : uniform.value;\n // apply value based on type\n if (value instanceof HTMLCanvasElement || value instanceof ImageData) {\n // create a texture & put data\n if (!uniform.texture) {\n uniform.texture = gl.createTexture();\n }\n gl.activeTexture(gl[\"TEXTURE\" + textureSlot]);\n gl.bindTexture(gl.TEXTURE_2D, uniform.texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n if (value instanceof ImageData) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, value.width, value.height, 0, gl.UNSIGNED_BYTE, new Uint8Array(value.data));\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, value);\n }\n // fill texture slots\n gl.uniform1i(uniform.location, textureSlot++);\n }\n else if (Array.isArray(value)) {\n switch (value.length) {\n case 2:\n gl.uniform2f(uniform.location, value[0], value[1]);\n return;\n case 3:\n gl.uniform3f(uniform.location, value[0], value[1], value[2]);\n return;\n case 4:\n gl.uniform4f(uniform.location, value[0], value[1], value[2], value[3]);\n return;\n default: return;\n }\n }\n else if (typeof value === 'number') {\n gl.uniform1f(uniform.location, value);\n }\n });\n };\n return WebGLPostProcessingPass;\n}());\nexport default WebGLPostProcessingPass;\n//# sourceMappingURL=PostProcessingPass.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/webgl/Helper\n */\nimport { getUid } from '../util.js';\nimport Disposable from '../Disposable.js';\nimport { clear } from '../obj.js';\nimport ContextEventType from '../webgl/ContextEventType.js';\nimport { compose as composeTransform, create as createTransform, reset as resetTransform, rotate as rotateTransform, scale as scaleTransform } from '../transform.js';\nimport { create, fromTransform } from '../vec/mat4.js';\nimport WebGLPostProcessingPass from './PostProcessingPass.js';\nimport { FLOAT, getContext, getSupportedExtensions, UNSIGNED_BYTE, UNSIGNED_INT, UNSIGNED_SHORT } from '../webgl.js';\nimport { includes } from '../array.js';\nimport { assert } from '../asserts.js';\n/**\n * @typedef {Object} BufferCacheEntry\n * @property {import(\"./Buffer.js\").default} buffer\n * @property {WebGLBuffer} webGlBuffer\n */\n/**\n * Shader types, either `FRAGMENT_SHADER` or `VERTEX_SHADER`.\n * @enum {number}\n */\nexport var ShaderType = {\n FRAGMENT_SHADER: 0x8B30,\n VERTEX_SHADER: 0x8B31\n};\n/**\n * Uniform names used in the default shaders: `PROJECTION_MATRIX`, `OFFSET_SCALE_MATRIX`.\n * and `OFFSET_ROTATION_MATRIX`.\n * @enum {string}\n */\nexport var DefaultUniform = {\n PROJECTION_MATRIX: 'u_projectionMatrix',\n OFFSET_SCALE_MATRIX: 'u_offsetScaleMatrix',\n OFFSET_ROTATION_MATRIX: 'u_offsetRotateMatrix',\n TIME: 'u_time',\n ZOOM: 'u_zoom',\n RESOLUTION: 'u_resolution'\n};\n/**\n * Attribute types, either `UNSIGNED_BYTE`, `UNSIGNED_SHORT`, `UNSIGNED_INT` or `FLOAT`\n * Note: an attribute stored in a `Float32Array` should be of type `FLOAT`.\n * @enum {number}\n */\nexport var AttributeType = {\n UNSIGNED_BYTE: UNSIGNED_BYTE,\n UNSIGNED_SHORT: UNSIGNED_SHORT,\n UNSIGNED_INT: UNSIGNED_INT,\n FLOAT: FLOAT\n};\n/**\n * Description of an attribute in a buffer\n * @typedef {Object} AttributeDescription\n * @property {string} name Attribute name to use in shaders\n * @property {number} size Number of components per attributes\n * @property {AttributeType} [type] Attribute type, i.e. number of bytes used to store the value. This is\n * determined by the class of typed array which the buffer uses (eg. `Float32Array` for a `FLOAT` attribute).\n * Default is `FLOAT`.\n */\n/**\n * @typedef {number|Array<number>|HTMLCanvasElement|HTMLImageElement|ImageData|import(\"../transform\").Transform} UniformLiteralValue\n */\n/**\n * Uniform value can be a number, array of numbers (2 to 4), canvas element or a callback returning\n * one of the previous types.\n * @typedef {UniformLiteralValue|function(import(\"../PluggableMap.js\").FrameState):UniformLiteralValue} UniformValue\n */\n/**\n * @typedef {Object} PostProcessesOptions\n * @property {number} [scaleRatio] Scale ratio; if < 1, the post process will render to a texture smaller than\n * the main canvas which will then be sampled up (useful for saving resource on blur steps).\n * @property {string} [vertexShader] Vertex shader source\n * @property {string} [fragmentShader] Fragment shader source\n * @property {Object.<string,UniformValue>} [uniforms] Uniform definitions for the post process step\n */\n/**\n * @typedef {Object} Options\n * @property {Object.<string,UniformValue>} [uniforms] Uniform definitions; property names must match the uniform\n * names in the provided or default shaders.\n * @property {Array<PostProcessesOptions>} [postProcesses] Post-processes definitions\n */\n/**\n * @typedef {Object} UniformInternalDescription\n * @property {string} name Name\n * @property {UniformValue=} value Value\n * @property {WebGLTexture} [texture] Texture\n * @private\n */\n/**\n * @classdesc\n * This class is intended to provide low-level functions related to WebGL rendering, so that accessing\n * directly the WebGL API should not be required anymore.\n *\n * Several operations are handled by the `WebGLHelper` class:\n *\n * ### Define custom shaders and uniforms\n *\n * *Shaders* are low-level programs executed on the GPU and written in GLSL. There are two types of shaders:\n *\n * Vertex shaders are used to manipulate the position and attribute of *vertices* of rendered primitives (ie. corners of a square).\n * Outputs are:\n *\n * * `gl_Position`: position of the vertex in screen space\n *\n * * Varyings usually prefixed with `v_` are passed on to the fragment shader\n *\n * Fragment shaders are used to control the actual color of the pixels drawn on screen. Their only output is `gl_FragColor`.\n *\n * Both shaders can take *uniforms* or *attributes* as input. Attributes are explained later. Uniforms are common, read-only values that\n * can be changed at every frame and can be of type float, arrays of float or images.\n *\n * Shaders must be compiled and assembled into a program like so:\n * ```js\n * // here we simply create two shaders and assemble them in a program which is then used\n * // for subsequent rendering calls\n * const vertexShader = new WebGLVertex(VERTEX_SHADER);\n * const fragmentShader = new WebGLFragment(FRAGMENT_SHADER);\n * const program = this.context.getProgram(fragmentShader, vertexShader);\n * helper.useProgram(this.program);\n * ```\n *\n * Uniforms are defined using the `uniforms` option and can either be explicit values or callbacks taking the frame state as argument.\n * You can also change their value along the way like so:\n * ```js\n * helper.setUniformFloatValue('u_value', valueAsNumber);\n * ```\n *\n * ### Defining post processing passes\n *\n * *Post processing* describes the act of rendering primitives to a texture, and then rendering this texture to the final canvas\n * while applying special effects in screen space.\n * Typical uses are: blurring, color manipulation, depth of field, filtering...\n *\n * The `WebGLHelper` class offers the possibility to define post processes at creation time using the `postProcesses` option.\n * A post process step accepts the following options:\n *\n * * `fragmentShader` and `vertexShader`: text literals in GLSL language that will be compiled and used in the post processing step.\n * * `uniforms`: uniforms can be defined for the post processing steps just like for the main render.\n * * `scaleRatio`: allows using an intermediate texture smaller or higher than the final canvas in the post processing step.\n * This is typically used in blur steps to reduce the performance overhead by using an already downsampled texture as input.\n *\n * The {@link module:ol/webgl/PostProcessingPass~WebGLPostProcessingPass} class is used internally, refer to its documentation for more info.\n *\n * ### Binding WebGL buffers and flushing data into them\n *\n * Data that must be passed to the GPU has to be transferred using {@link module:ol/webgl/Buffer~WebGLArrayBuffer} objects.\n * A buffer has to be created only once, but must be bound every time the buffer content will be used for rendering.\n * This is done using {@link bindBuffer}.\n * When the buffer's array content has changed, the new data has to be flushed to the GPU memory; this is done using\n * {@link flushBufferData}. Note: this operation is expensive and should be done as infrequently as possible.\n *\n * When binding an array buffer, a `target` parameter must be given: it should be either {@link module:ol/webgl.ARRAY_BUFFER}\n * (if the buffer contains vertices data) or {@link module:ol/webgl.ELEMENT_ARRAY_BUFFER} (if the buffer contains indices data).\n *\n * Examples below:\n * ```js\n * // at initialization phase\n * const verticesBuffer = new WebGLArrayBuffer([], DYNAMIC_DRAW);\n * const indicesBuffer = new WebGLArrayBuffer([], DYNAMIC_DRAW);\n *\n * // when array values have changed\n * helper.flushBufferData(ARRAY_BUFFER, this.verticesBuffer);\n * helper.flushBufferData(ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n *\n * // at rendering phase\n * helper.bindBuffer(ARRAY_BUFFER, this.verticesBuffer);\n * helper.bindBuffer(ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n * ```\n *\n * ### Specifying attributes\n *\n * The GPU only receives the data as arrays of numbers. These numbers must be handled differently depending on what it describes (position, texture coordinate...).\n * Attributes are used to specify these uses. Use {@link enableAttributeArray_} and either\n * the default attribute names in {@link module:ol/webgl/Helper.DefaultAttrib} or custom ones.\n *\n * Please note that you will have to specify the type and offset of the attributes in the data array. You can refer to the documentation of [WebGLRenderingContext.vertexAttribPointer](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer) for more explanation.\n * ```js\n * // here we indicate that the data array has the following structure:\n * // [posX, posY, offsetX, offsetY, texCoordU, texCoordV, posX, posY, ...]\n * helper.enableAttributes([\n * {\n * name: 'a_position',\n * size: 2\n * },\n * {\n * name: 'a_offset',\n * size: 2\n * },\n * {\n * name: 'a_texCoord',\n * size: 2\n * }\n * ])\n * ```\n *\n * ### Rendering primitives\n *\n * Once all the steps above have been achieved, rendering primitives to the screen is done using {@link prepareDraw}, {@link drawElements} and {@link finalizeDraw}.\n * ```js\n * // frame preparation step\n * helper.prepareDraw(frameState);\n *\n * // call this for every data array that has to be rendered on screen\n * helper.drawElements(0, this.indicesBuffer.getArray().length);\n *\n * // finalize the rendering by applying post processes\n * helper.finalizeDraw(frameState);\n * ```\n *\n * For an example usage of this class, refer to {@link module:ol/renderer/webgl/PointsLayer~WebGLPointsLayerRenderer}.\n *\n *\n * @api\n */\nvar WebGLHelper = /** @class */ (function (_super) {\n __extends(WebGLHelper, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function WebGLHelper(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options || {};\n /** @private */\n _this.boundHandleWebGLContextLost_ = _this.handleWebGLContextLost.bind(_this);\n /** @private */\n _this.boundHandleWebGLContextRestored_ = _this.handleWebGLContextRestored.bind(_this);\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = document.createElement('canvas');\n _this.canvas_.style.position = 'absolute';\n _this.canvas_.style.left = '0';\n /**\n * @private\n * @type {WebGLRenderingContext}\n */\n _this.gl_ = getContext(_this.canvas_);\n var gl = _this.getGL();\n /**\n * @private\n * @type {!Object<string, BufferCacheEntry>}\n */\n _this.bufferCache_ = {};\n /**\n * @private\n * @type {WebGLProgram}\n */\n _this.currentProgram_ = null;\n assert(includes(getSupportedExtensions(), 'OES_element_index_uint'), 63);\n gl.getExtension('OES_element_index_uint');\n _this.canvas_.addEventListener(ContextEventType.LOST, _this.boundHandleWebGLContextLost_);\n _this.canvas_.addEventListener(ContextEventType.RESTORED, _this.boundHandleWebGLContextRestored_);\n /**\n * @private\n * @type {import(\"../transform.js\").Transform}\n */\n _this.offsetRotateMatrix_ = createTransform();\n /**\n * @private\n * @type {import(\"../transform.js\").Transform}\n */\n _this.offsetScaleMatrix_ = createTransform();\n /**\n * @private\n * @type {Array<number>}\n */\n _this.tmpMat4_ = create();\n /**\n * @private\n * @type {Object.<string, WebGLUniformLocation>}\n */\n _this.uniformLocations_ = {};\n /**\n * @private\n * @type {Object.<string, number>}\n */\n _this.attribLocations_ = {};\n /**\n * Holds info about custom uniforms used in the post processing pass.\n * If the uniform is a texture, the WebGL Texture object will be stored here.\n * @type {Array<UniformInternalDescription>}\n * @private\n */\n _this.uniforms_ = [];\n if (options.uniforms) {\n for (var name_1 in options.uniforms) {\n _this.uniforms_.push({\n name: name_1,\n value: options.uniforms[name_1]\n });\n }\n }\n /**\n * An array of PostProcessingPass objects is kept in this variable, built from the steps provided in the\n * options. If no post process was given, a default one is used (so as not to have to make an exception to\n * the frame buffer logic).\n * @type {Array<WebGLPostProcessingPass>}\n * @private\n */\n _this.postProcessPasses_ = options.postProcesses ? options.postProcesses.map(function (options) {\n return new WebGLPostProcessingPass({\n webGlContext: gl,\n scaleRatio: options.scaleRatio,\n vertexShader: options.vertexShader,\n fragmentShader: options.fragmentShader,\n uniforms: options.uniforms\n });\n }) : [new WebGLPostProcessingPass({ webGlContext: gl })];\n /**\n * @type {string|null}\n * @private\n */\n _this.shaderCompileErrors_ = null;\n /**\n * @type {number}\n * @private\n */\n _this.startTime_ = Date.now();\n return _this;\n }\n /**\n * Just bind the buffer if it's in the cache. Otherwise create\n * the WebGL buffer, bind it, populate it, and add an entry to\n * the cache.\n * @param {import(\"./Buffer\").default} buffer Buffer.\n * @api\n */\n WebGLHelper.prototype.bindBuffer = function (buffer) {\n var gl = this.getGL();\n var bufferKey = getUid(buffer);\n var bufferCache = this.bufferCache_[bufferKey];\n if (!bufferCache) {\n var webGlBuffer = gl.createBuffer();\n bufferCache = {\n buffer: buffer,\n webGlBuffer: webGlBuffer\n };\n this.bufferCache_[bufferKey] = bufferCache;\n }\n gl.bindBuffer(buffer.getType(), bufferCache.webGlBuffer);\n };\n /**\n * Update the data contained in the buffer array; this is required for the\n * new data to be rendered\n * @param {import(\"./Buffer\").default} buffer Buffer.\n * @api\n */\n WebGLHelper.prototype.flushBufferData = function (buffer) {\n var gl = this.getGL();\n this.bindBuffer(buffer);\n gl.bufferData(buffer.getType(), buffer.getArray(), buffer.getUsage());\n };\n /**\n * @param {import(\"./Buffer.js\").default} buf Buffer.\n */\n WebGLHelper.prototype.deleteBuffer = function (buf) {\n var gl = this.getGL();\n var bufferKey = getUid(buf);\n var bufferCacheEntry = this.bufferCache_[bufferKey];\n if (!gl.isContextLost()) {\n gl.deleteBuffer(bufferCacheEntry.buffer);\n }\n delete this.bufferCache_[bufferKey];\n };\n /**\n * @inheritDoc\n */\n WebGLHelper.prototype.disposeInternal = function () {\n this.canvas_.removeEventListener(ContextEventType.LOST, this.boundHandleWebGLContextLost_);\n this.canvas_.removeEventListener(ContextEventType.RESTORED, this.boundHandleWebGLContextRestored_);\n };\n /**\n * Clear the buffer & set the viewport to draw.\n * Post process passes will be initialized here, the first one being bound as a render target for\n * subsequent draw calls.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState current frame state\n * @api\n */\n WebGLHelper.prototype.prepareDraw = function (frameState) {\n var gl = this.getGL();\n var canvas = this.getCanvas();\n var size = frameState.size;\n var pixelRatio = frameState.pixelRatio;\n canvas.width = size[0] * pixelRatio;\n canvas.height = size[1] * pixelRatio;\n canvas.style.width = size[0] + 'px';\n canvas.style.height = size[1] + 'px';\n gl.useProgram(this.currentProgram_);\n // loop backwards in post processes list\n for (var i = this.postProcessPasses_.length - 1; i >= 0; i--) {\n this.postProcessPasses_[i].init(frameState);\n }\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n gl.useProgram(this.currentProgram_);\n this.applyFrameState(frameState);\n this.applyUniforms(frameState);\n };\n /**\n * Clear the render target & bind it for future draw operations.\n * This is similar to `prepareDraw`, only post processes will not be applied.\n * Note: the whole viewport will be drawn to the render target, regardless of its size.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState current frame state\n * @param {import(\"./RenderTarget.js\").default} renderTarget Render target to draw to\n * @param {boolean} [opt_disableAlphaBlend] If true, no alpha blending will happen.\n */\n WebGLHelper.prototype.prepareDrawToRenderTarget = function (frameState, renderTarget, opt_disableAlphaBlend) {\n var gl = this.getGL();\n var size = renderTarget.getSize();\n gl.bindFramebuffer(gl.FRAMEBUFFER, renderTarget.getFramebuffer());\n gl.viewport(0, 0, size[0], size[1]);\n gl.bindTexture(gl.TEXTURE_2D, renderTarget.getTexture());\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, opt_disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);\n gl.useProgram(this.currentProgram_);\n this.applyFrameState(frameState);\n this.applyUniforms(frameState);\n };\n /**\n * Execute a draw call based on the currently bound program, texture, buffers, attributes.\n * @param {number} start Start index.\n * @param {number} end End index.\n * @api\n */\n WebGLHelper.prototype.drawElements = function (start, end) {\n var gl = this.getGL();\n var elementType = gl.UNSIGNED_INT;\n var elementSize = 4;\n var numItems = end - start;\n var offsetInBytes = start * elementSize;\n gl.drawElements(gl.TRIANGLES, numItems, elementType, offsetInBytes);\n };\n /**\n * Apply the successive post process passes which will eventually render to the actual canvas.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState current frame state\n * @api\n */\n WebGLHelper.prototype.finalizeDraw = function (frameState) {\n // apply post processes using the next one as target\n for (var i = 0; i < this.postProcessPasses_.length; i++) {\n this.postProcessPasses_[i].apply(frameState, this.postProcessPasses_[i + 1] || null);\n }\n };\n /**\n * @return {HTMLCanvasElement} Canvas.\n * @api\n */\n WebGLHelper.prototype.getCanvas = function () {\n return this.canvas_;\n };\n /**\n * Get the WebGL rendering context\n * @return {WebGLRenderingContext} The rendering context.\n * @api\n */\n WebGLHelper.prototype.getGL = function () {\n return this.gl_;\n };\n /**\n * Sets the default matrix uniforms for a given frame state. This is called internally in `prepareDraw`.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @private\n */\n WebGLHelper.prototype.applyFrameState = function (frameState) {\n var size = frameState.size;\n var rotation = frameState.viewState.rotation;\n var offsetScaleMatrix = resetTransform(this.offsetScaleMatrix_);\n scaleTransform(offsetScaleMatrix, 2 / size[0], 2 / size[1]);\n var offsetRotateMatrix = resetTransform(this.offsetRotateMatrix_);\n if (rotation !== 0) {\n rotateTransform(offsetRotateMatrix, -rotation);\n }\n this.setUniformMatrixValue(DefaultUniform.OFFSET_SCALE_MATRIX, fromTransform(this.tmpMat4_, offsetScaleMatrix));\n this.setUniformMatrixValue(DefaultUniform.OFFSET_ROTATION_MATRIX, fromTransform(this.tmpMat4_, offsetRotateMatrix));\n this.setUniformFloatValue(DefaultUniform.TIME, (Date.now() - this.startTime_) * 0.001);\n this.setUniformFloatValue(DefaultUniform.ZOOM, frameState.viewState.zoom);\n this.setUniformFloatValue(DefaultUniform.RESOLUTION, frameState.viewState.resolution);\n };\n /**\n * Sets the custom uniforms based on what was given in the constructor. This is called internally in `prepareDraw`.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @private\n */\n WebGLHelper.prototype.applyUniforms = function (frameState) {\n var gl = this.getGL();\n var value;\n var textureSlot = 0;\n this.uniforms_.forEach(function (uniform) {\n value = typeof uniform.value === 'function' ? uniform.value(frameState) : uniform.value;\n // apply value based on type\n if (value instanceof HTMLCanvasElement || value instanceof HTMLImageElement || value instanceof ImageData) {\n // create a texture & put data\n if (!uniform.texture) {\n uniform.texture = gl.createTexture();\n }\n gl.activeTexture(gl[\"TEXTURE\" + textureSlot]);\n gl.bindTexture(gl.TEXTURE_2D, uniform.texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n var imageReady = !(value instanceof HTMLImageElement) || /** @type {HTMLImageElement} */ (value).complete;\n if (imageReady) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, value);\n }\n // fill texture slots by increasing index\n gl.uniform1i(this.getUniformLocation(uniform.name), textureSlot++);\n }\n else if (Array.isArray(value) && value.length === 6) {\n this.setUniformMatrixValue(uniform.name, fromTransform(this.tmpMat4_, value));\n }\n else if (Array.isArray(value) && value.length <= 4) {\n switch (value.length) {\n case 2:\n gl.uniform2f(this.getUniformLocation(uniform.name), value[0], value[1]);\n return;\n case 3:\n gl.uniform3f(this.getUniformLocation(uniform.name), value[0], value[1], value[2]);\n return;\n case 4:\n gl.uniform4f(this.getUniformLocation(uniform.name), value[0], value[1], value[2], value[3]);\n return;\n default:\n return;\n }\n }\n else if (typeof value === 'number') {\n gl.uniform1f(this.getUniformLocation(uniform.name), value);\n }\n }.bind(this));\n };\n /**\n * Use a program. If the program is already in use, this will return `false`.\n * @param {WebGLProgram} program Program.\n * @return {boolean} Changed.\n * @api\n */\n WebGLHelper.prototype.useProgram = function (program) {\n if (program == this.currentProgram_) {\n return false;\n }\n else {\n var gl = this.getGL();\n gl.useProgram(program);\n this.currentProgram_ = program;\n this.uniformLocations_ = {};\n this.attribLocations_ = {};\n return true;\n }\n };\n /**\n * Will attempt to compile a vertex or fragment shader based on source\n * On error, the shader will be returned but\n * `gl.getShaderParameter(shader, gl.COMPILE_STATUS)` will return `true`\n * Use `gl.getShaderInfoLog(shader)` to have details\n * @param {string} source Shader source\n * @param {ShaderType} type VERTEX_SHADER or FRAGMENT_SHADER\n * @return {WebGLShader} Shader object\n */\n WebGLHelper.prototype.compileShader = function (source, type) {\n var gl = this.getGL();\n var shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n return shader;\n };\n /**\n * Create a program for a vertex and fragment shader. The shaders compilation may have failed:\n * use `WebGLHelper.getShaderCompileErrors()`to have details if any.\n * @param {string} fragmentShaderSource Fragment shader source.\n * @param {string} vertexShaderSource Vertex shader source.\n * @return {WebGLProgram} Program\n * @api\n */\n WebGLHelper.prototype.getProgram = function (fragmentShaderSource, vertexShaderSource) {\n var gl = this.getGL();\n var fragmentShader = this.compileShader(fragmentShaderSource, gl.FRAGMENT_SHADER);\n var vertexShader = this.compileShader(vertexShaderSource, gl.VERTEX_SHADER);\n this.shaderCompileErrors_ = null;\n if (gl.getShaderInfoLog(fragmentShader)) {\n this.shaderCompileErrors_ =\n \"Fragment shader compilation failed:\\n\" + gl.getShaderInfoLog(fragmentShader);\n }\n if (gl.getShaderInfoLog(vertexShader)) {\n this.shaderCompileErrors_ = (this.shaderCompileErrors_ || '') +\n (\"Vertex shader compilation failed:\\n\" + gl.getShaderInfoLog(vertexShader));\n }\n var program = gl.createProgram();\n gl.attachShader(program, fragmentShader);\n gl.attachShader(program, vertexShader);\n gl.linkProgram(program);\n return program;\n };\n /**\n * Will return the last shader compilation errors. If no error happened, will return null;\n * @return {string|null} Errors description, or null if last compilation was successful\n * @api\n */\n WebGLHelper.prototype.getShaderCompileErrors = function () {\n return this.shaderCompileErrors_;\n };\n /**\n * Will get the location from the shader or the cache\n * @param {string} name Uniform name\n * @return {WebGLUniformLocation} uniformLocation\n * @api\n */\n WebGLHelper.prototype.getUniformLocation = function (name) {\n if (this.uniformLocations_[name] === undefined) {\n this.uniformLocations_[name] = this.getGL().getUniformLocation(this.currentProgram_, name);\n }\n return this.uniformLocations_[name];\n };\n /**\n * Will get the location from the shader or the cache\n * @param {string} name Attribute name\n * @return {number} attribLocation\n * @api\n */\n WebGLHelper.prototype.getAttributeLocation = function (name) {\n if (this.attribLocations_[name] === undefined) {\n this.attribLocations_[name] = this.getGL().getAttribLocation(this.currentProgram_, name);\n }\n return this.attribLocations_[name];\n };\n /**\n * Modifies the given transform to apply the rotation/translation/scaling of the given frame state.\n * The resulting transform can be used to convert world space coordinates to view coordinates.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {import(\"../transform\").Transform} transform Transform to update.\n * @return {import(\"../transform\").Transform} The updated transform object.\n * @api\n */\n WebGLHelper.prototype.makeProjectionTransform = function (frameState, transform) {\n var size = frameState.size;\n var rotation = frameState.viewState.rotation;\n var resolution = frameState.viewState.resolution;\n var center = frameState.viewState.center;\n resetTransform(transform);\n composeTransform(transform, 0, 0, 2 / (resolution * size[0]), 2 / (resolution * size[1]), -rotation, -center[0], -center[1]);\n return transform;\n };\n /**\n * Give a value for a standard float uniform\n * @param {string} uniform Uniform name\n * @param {number} value Value\n * @api\n */\n WebGLHelper.prototype.setUniformFloatValue = function (uniform, value) {\n this.getGL().uniform1f(this.getUniformLocation(uniform), value);\n };\n /**\n * Give a value for a standard matrix4 uniform\n * @param {string} uniform Uniform name\n * @param {Array<number>} value Matrix value\n * @api\n */\n WebGLHelper.prototype.setUniformMatrixValue = function (uniform, value) {\n this.getGL().uniformMatrix4fv(this.getUniformLocation(uniform), false, value);\n };\n /**\n * Will set the currently bound buffer to an attribute of the shader program. Used by `#enableAttributes`\n * internally.\n * @param {string} attribName Attribute name\n * @param {number} size Number of components per attributes\n * @param {number} type UNSIGNED_INT, UNSIGNED_BYTE, UNSIGNED_SHORT or FLOAT\n * @param {number} stride Stride in bytes (0 means attribs are packed)\n * @param {number} offset Offset in bytes\n * @private\n */\n WebGLHelper.prototype.enableAttributeArray_ = function (attribName, size, type, stride, offset) {\n var location = this.getAttributeLocation(attribName);\n // the attribute has not been found in the shaders; do not enable it\n if (location < 0) {\n return;\n }\n this.getGL().enableVertexAttribArray(location);\n this.getGL().vertexAttribPointer(location, size, type, false, stride, offset);\n };\n /**\n * Will enable the following attributes to be read from the currently bound buffer,\n * i.e. tell the GPU where to read the different attributes in the buffer. An error in the\n * size/type/order of attributes will most likely break the rendering and throw a WebGL exception.\n * @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer\n * @api\n */\n WebGLHelper.prototype.enableAttributes = function (attributes) {\n var stride = computeAttributesStride(attributes);\n var offset = 0;\n for (var i = 0; i < attributes.length; i++) {\n var attr = attributes[i];\n this.enableAttributeArray_(attr.name, attr.size, attr.type || FLOAT, stride, offset);\n offset += attr.size * getByteSizeFromType(attr.type);\n }\n };\n /**\n * WebGL context was lost\n * @private\n */\n WebGLHelper.prototype.handleWebGLContextLost = function () {\n clear(this.bufferCache_);\n this.currentProgram_ = null;\n };\n /**\n * WebGL context was restored\n * @private\n */\n WebGLHelper.prototype.handleWebGLContextRestored = function () {\n };\n /**\n * Will create or reuse a given webgl texture and apply the given size. If no image data\n * specified, the texture will be empty, otherwise image data will be used and the `size`\n * parameter will be ignored.\n * Note: wrap parameters are set to clamp to edge, min filter is set to linear.\n * @param {Array<number>} size Expected size of the texture\n * @param {ImageData|HTMLImageElement|HTMLCanvasElement} [opt_data] Image data/object to bind to the texture\n * @param {WebGLTexture} [opt_texture] Existing texture to reuse\n * @return {WebGLTexture} The generated texture\n * @api\n */\n WebGLHelper.prototype.createTexture = function (size, opt_data, opt_texture) {\n var gl = this.getGL();\n var texture = opt_texture || gl.createTexture();\n // set params & size\n var level = 0;\n var internalFormat = gl.RGBA;\n var border = 0;\n var format = gl.RGBA;\n var type = gl.UNSIGNED_BYTE;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (opt_data) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, format, type, opt_data);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, size[0], size[1], border, format, type, null);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n return texture;\n };\n return WebGLHelper;\n}(Disposable));\n/**\n * Compute a stride in bytes based on a list of attributes\n * @param {Array<AttributeDescription>} attributes Ordered list of attributes\n * @returns {number} Stride, ie amount of values for each vertex in the vertex buffer\n * @api\n */\nexport function computeAttributesStride(attributes) {\n var stride = 0;\n for (var i = 0; i < attributes.length; i++) {\n var attr = attributes[i];\n stride += attr.size * getByteSizeFromType(attr.type);\n }\n return stride;\n}\n/**\n * Computes the size in byte of an attribute type.\n * @param {AttributeType} type Attribute type\n * @returns {number} The size in bytes\n */\nfunction getByteSizeFromType(type) {\n switch (type) {\n case AttributeType.UNSIGNED_BYTE: return Uint8Array.BYTES_PER_ELEMENT;\n case AttributeType.UNSIGNED_SHORT: return Uint16Array.BYTES_PER_ELEMENT;\n case AttributeType.UNSIGNED_INT: return Uint32Array.BYTES_PER_ELEMENT;\n case AttributeType.FLOAT:\n default: return Float32Array.BYTES_PER_ELEMENT;\n }\n}\nexport default WebGLHelper;\n//# sourceMappingURL=Helper.js.map","/**\n * A wrapper class to simplify rendering to a texture instead of the final canvas\n * @module ol/webgl/RenderTarget\n */\nimport { equals } from '../array.js';\n// for pixel color reading\nvar tmpArray4 = new Uint8Array(4);\n/**\n * @classdesc\n * This class is a wrapper around the association of both a `WebGLTexture` and a `WebGLFramebuffer` instances,\n * simplifying initialization and binding for rendering.\n * @api\n */\nvar WebGLRenderTarget = /** @class */ (function () {\n /**\n * @param {import(\"./Helper.js\").default} helper WebGL helper; mandatory.\n * @param {Array<number>} [opt_size] Expected size of the render target texture; note: this can be changed later on.\n */\n function WebGLRenderTarget(helper, opt_size) {\n /**\n * @private\n * @type {import(\"./Helper.js\").default}\n */\n this.helper_ = helper;\n var gl = helper.getGL();\n /**\n * @private\n * @type {WebGLTexture}\n */\n this.texture_ = gl.createTexture();\n /**\n * @private\n * @type {WebGLFramebuffer}\n */\n this.framebuffer_ = gl.createFramebuffer();\n /**\n * @type {Array<number>}\n * @private\n */\n this.size_ = opt_size || [1, 1];\n /**\n * @type {Uint8Array}\n * @private\n */\n this.data_ = new Uint8Array(0);\n /**\n * @type {boolean}\n * @private\n */\n this.dataCacheDirty_ = true;\n this.updateSize_();\n }\n /**\n * Changes the size of the render target texture. Note: will do nothing if the size\n * is already the same.\n * @param {Array<number>} size Expected size of the render target texture\n * @api\n */\n WebGLRenderTarget.prototype.setSize = function (size) {\n if (equals(size, this.size_)) {\n return;\n }\n this.size_[0] = size[0];\n this.size_[1] = size[1];\n this.updateSize_();\n };\n /**\n * Returns the size of the render target texture\n * @return {Array<number>} Size of the render target texture\n * @api\n */\n WebGLRenderTarget.prototype.getSize = function () {\n return this.size_;\n };\n /**\n * This will cause following calls to `#readAll` or `#readPixel` to download the content of the\n * render target into memory, which is an expensive operation.\n * This content will be kept in cache but should be cleared after each new render.\n * @api\n */\n WebGLRenderTarget.prototype.clearCachedData = function () {\n this.dataCacheDirty_ = true;\n };\n /**\n * Returns the full content of the frame buffer as a series of r, g, b, a components\n * in the 0-255 range (unsigned byte).\n * @return {Uint8Array} Integer array of color values\n * @api\n */\n WebGLRenderTarget.prototype.readAll = function () {\n if (this.dataCacheDirty_) {\n var size = this.size_;\n var gl = this.helper_.getGL();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer_);\n gl.readPixels(0, 0, size[0], size[1], gl.RGBA, gl.UNSIGNED_BYTE, this.data_);\n this.dataCacheDirty_ = false;\n }\n return this.data_;\n };\n /**\n * Reads one pixel of the frame buffer as an array of r, g, b, a components\n * in the 0-255 range (unsigned byte).\n * If x and/or y are outside of existing data, an array filled with 0 is returned.\n * @param {number} x Pixel coordinate\n * @param {number} y Pixel coordinate\n * @returns {Uint8Array} Integer array with one color value (4 components)\n * @api\n */\n WebGLRenderTarget.prototype.readPixel = function (x, y) {\n if (x < 0 || y < 0 || x > this.size_[0] || y >= this.size_[1]) {\n tmpArray4[0] = 0;\n tmpArray4[1] = 0;\n tmpArray4[2] = 0;\n tmpArray4[3] = 0;\n return tmpArray4;\n }\n this.readAll();\n var index = Math.floor(x) + (this.size_[1] - Math.floor(y) - 1) * this.size_[0];\n tmpArray4[0] = this.data_[index * 4];\n tmpArray4[1] = this.data_[index * 4 + 1];\n tmpArray4[2] = this.data_[index * 4 + 2];\n tmpArray4[3] = this.data_[index * 4 + 3];\n return tmpArray4;\n };\n /**\n * @return {WebGLTexture} Texture to render to\n */\n WebGLRenderTarget.prototype.getTexture = function () {\n return this.texture_;\n };\n /**\n * @return {WebGLFramebuffer} Frame buffer of the render target\n */\n WebGLRenderTarget.prototype.getFramebuffer = function () {\n return this.framebuffer_;\n };\n /**\n * @private\n */\n WebGLRenderTarget.prototype.updateSize_ = function () {\n var size = this.size_;\n var gl = this.helper_.getGL();\n this.texture_ = this.helper_.createTexture(size, null, this.texture_);\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer_);\n gl.viewport(0, 0, size[0], size[1]);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture_, 0);\n this.data_ = new Uint8Array(size[0] * size[1] * 4);\n };\n return WebGLRenderTarget;\n}());\nexport default WebGLRenderTarget;\n//# sourceMappingURL=RenderTarget.js.map","/**\n * @module ol/tilegrid/WMTS\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { find } from '../array.js';\nimport { get as getProjection } from '../proj.js';\nimport TileGrid from './TileGrid.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../extent.js\").Extent} [extent] Extent for the tile grid. No tiles\n * outside this extent will be requested by {@link module:ol/source/Tile} sources.\n * When no `origin` or `origins` are configured, the `origin` will be set to the\n * top-left corner of the extent.\n * @property {import(\"../coordinate.js\").Coordinate} [origin] The tile grid origin, i.e.\n * where the `x` and `y` axes meet (`[z, 0, 0]`). Tile coordinates increase left\n * to right and upwards. If not specified, `extent` or `origins` must be provided.\n * @property {Array<import(\"../coordinate.js\").Coordinate>} [origins] Tile grid origins,\n * i.e. where the `x` and `y` axes meet (`[z, 0, 0]`), for each zoom level. If\n * given, the array length should match the length of the `resolutions` array, i.e.\n * each resolution can have a different origin. Tile coordinates increase left to\n * right and upwards. If not specified, `extent` or `origin` must be provided.\n * @property {!Array<number>} resolutions Resolutions. The array index of each\n * resolution needs to match the zoom level. This means that even if a `minZoom`\n * is configured, the resolutions array will have a length of `maxZoom + 1`\n * @property {!Array<string>} matrixIds matrix IDs. The length of this array needs\n * to match the length of the `resolutions` array.\n * @property {Array<import(\"../size.js\").Size>} [sizes] Number of tile rows and columns\n * of the grid for each zoom level. The values here are the `TileMatrixWidth` and\n * `TileMatrixHeight` advertised in the GetCapabilities response of the WMTS, and\n * define the grid's extent together with the `origin`.\n * An `extent` can be configured in addition, and will further limit the extent for\n * which tile requests are made by sources. If the bottom-left corner of\n * the `extent` is used as `origin` or `origins`, then the `y` value must be\n * negative because OpenLayers tile coordinates use the top left as the origin.\n * @property {number|import(\"../size.js\").Size} [tileSize] Tile size.\n * @property {Array<import(\"../size.js\").Size>} [tileSizes] Tile sizes. The length of\n * this array needs to match the length of the `resolutions` array.\n * @property {Array<number>} [widths] Number of tile columns that cover the grid's\n * extent for each zoom level. Only required when used with a source that has `wrapX`\n * set to `true`, and only when the grid's origin differs from the one of the\n * projection's extent. The array length has to match the length of the `resolutions`\n * array, i.e. each resolution will have a matching entry here.\n */\n/**\n * @classdesc\n * Set the grid pattern for sources accessing WMTS tiled-image servers.\n * @api\n */\nvar WMTSTileGrid = /** @class */ (function (_super) {\n __extends(WMTSTileGrid, _super);\n /**\n * @param {Options} options WMTS options.\n */\n function WMTSTileGrid(options) {\n var _this = _super.call(this, {\n extent: options.extent,\n origin: options.origin,\n origins: options.origins,\n resolutions: options.resolutions,\n tileSize: options.tileSize,\n tileSizes: options.tileSizes,\n sizes: options.sizes\n }) || this;\n /**\n * @private\n * @type {!Array<string>}\n */\n _this.matrixIds_ = options.matrixIds;\n return _this;\n }\n /**\n * @param {number} z Z.\n * @return {string} MatrixId..\n */\n WMTSTileGrid.prototype.getMatrixId = function (z) {\n return this.matrixIds_[z];\n };\n /**\n * Get the list of matrix identifiers.\n * @return {Array<string>} MatrixIds.\n * @api\n */\n WMTSTileGrid.prototype.getMatrixIds = function () {\n return this.matrixIds_;\n };\n return WMTSTileGrid;\n}(TileGrid));\nexport default WMTSTileGrid;\n/**\n * Create a tile grid from a WMTS capabilities matrix set and an\n * optional TileMatrixSetLimits.\n * @param {Object} matrixSet An object representing a matrixSet in the\n * capabilities document.\n * @param {import(\"../extent.js\").Extent=} opt_extent An optional extent to restrict the tile\n * ranges the server provides.\n * @param {Array<Object>=} opt_matrixLimits An optional object representing\n * the available matrices for tileGrid.\n * @return {WMTSTileGrid} WMTS tileGrid instance.\n * @api\n */\nexport function createFromCapabilitiesMatrixSet(matrixSet, opt_extent, opt_matrixLimits) {\n /** @type {!Array<number>} */\n var resolutions = [];\n /** @type {!Array<string>} */\n var matrixIds = [];\n /** @type {!Array<import(\"../coordinate.js\").Coordinate>} */\n var origins = [];\n /** @type {!Array<import(\"../size.js\").Size>} */\n var tileSizes = [];\n /** @type {!Array<import(\"../size.js\").Size>} */\n var sizes = [];\n var matrixLimits = opt_matrixLimits !== undefined ? opt_matrixLimits : [];\n var supportedCRSPropName = 'SupportedCRS';\n var matrixIdsPropName = 'TileMatrix';\n var identifierPropName = 'Identifier';\n var scaleDenominatorPropName = 'ScaleDenominator';\n var topLeftCornerPropName = 'TopLeftCorner';\n var tileWidthPropName = 'TileWidth';\n var tileHeightPropName = 'TileHeight';\n var code = matrixSet[supportedCRSPropName];\n var projection = getProjection(code.replace(/urn:ogc:def:crs:(\\w+):(.*:)?(\\w+)$/, '$1:$3')) ||\n getProjection(code);\n var metersPerUnit = projection.getMetersPerUnit();\n // swap origin x and y coordinates if axis orientation is lat/long\n var switchOriginXY = projection.getAxisOrientation().substr(0, 2) == 'ne';\n matrixSet[matrixIdsPropName].sort(function (a, b) {\n return b[scaleDenominatorPropName] - a[scaleDenominatorPropName];\n });\n matrixSet[matrixIdsPropName].forEach(function (elt) {\n var matrixAvailable;\n // use of matrixLimits to filter TileMatrices from GetCapabilities\n // TileMatrixSet from unavailable matrix levels.\n if (matrixLimits.length > 0) {\n matrixAvailable = find(matrixLimits, function (elt_ml) {\n if (elt[identifierPropName] == elt_ml[matrixIdsPropName]) {\n return true;\n }\n // Fallback for tileMatrix identifiers that don't get prefixed\n // by their tileMatrixSet identifiers.\n if (elt[identifierPropName].indexOf(':') === -1) {\n return matrixSet[identifierPropName] + ':' + elt[identifierPropName] === elt_ml[matrixIdsPropName];\n }\n return false;\n });\n }\n else {\n matrixAvailable = true;\n }\n if (matrixAvailable) {\n matrixIds.push(elt[identifierPropName]);\n var resolution = elt[scaleDenominatorPropName] * 0.28E-3 / metersPerUnit;\n var tileWidth = elt[tileWidthPropName];\n var tileHeight = elt[tileHeightPropName];\n if (switchOriginXY) {\n origins.push([elt[topLeftCornerPropName][1],\n elt[topLeftCornerPropName][0]]);\n }\n else {\n origins.push(elt[topLeftCornerPropName]);\n }\n resolutions.push(resolution);\n tileSizes.push(tileWidth == tileHeight ?\n tileWidth : [tileWidth, tileHeight]);\n sizes.push([elt['MatrixWidth'], elt['MatrixHeight']]);\n }\n });\n return new WMTSTileGrid({\n extent: opt_extent,\n origins: origins,\n resolutions: resolutions,\n matrixIds: matrixIds,\n tileSizes: tileSizes,\n sizes: sizes\n });\n}\n//# sourceMappingURL=WMTS.js.map","/**\n * @module ol/style/Image\n */\nimport { abstract } from '../util.js';\n/**\n * @typedef {Object} Options\n * @property {number} opacity\n * @property {boolean} rotateWithView\n * @property {number} rotation\n * @property {number} scale\n */\n/**\n * @classdesc\n * A base class used for creating subclasses and not instantiated in\n * apps. Base class for {@link module:ol/style/Icon~Icon}, {@link module:ol/style/Circle~CircleStyle} and\n * {@link module:ol/style/RegularShape~RegularShape}.\n * @abstract\n * @api\n */\nvar ImageStyle = /** @class */ (function () {\n /**\n * @param {Options} options Options.\n */\n function ImageStyle(options) {\n /**\n * @private\n * @type {number}\n */\n this.opacity_ = options.opacity;\n /**\n * @private\n * @type {boolean}\n */\n this.rotateWithView_ = options.rotateWithView;\n /**\n * @private\n * @type {number}\n */\n this.rotation_ = options.rotation;\n /**\n * @private\n * @type {number}\n */\n this.scale_ = options.scale;\n }\n /**\n * Clones the style.\n * @return {ImageStyle} The cloned style.\n * @api\n */\n ImageStyle.prototype.clone = function () {\n return new ImageStyle({\n opacity: this.getOpacity(),\n scale: this.getScale(),\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView()\n });\n };\n /**\n * Get the symbolizer opacity.\n * @return {number} Opacity.\n * @api\n */\n ImageStyle.prototype.getOpacity = function () {\n return this.opacity_;\n };\n /**\n * Determine whether the symbolizer rotates with the map.\n * @return {boolean} Rotate with map.\n * @api\n */\n ImageStyle.prototype.getRotateWithView = function () {\n return this.rotateWithView_;\n };\n /**\n * Get the symoblizer rotation.\n * @return {number} Rotation.\n * @api\n */\n ImageStyle.prototype.getRotation = function () {\n return this.rotation_;\n };\n /**\n * Get the symbolizer scale.\n * @return {number} Scale.\n * @api\n */\n ImageStyle.prototype.getScale = function () {\n return this.scale_;\n };\n /**\n * Get the anchor point in pixels. The anchor determines the center point for the\n * symbolizer.\n * @abstract\n * @return {Array<number>} Anchor.\n */\n ImageStyle.prototype.getAnchor = function () {\n return abstract();\n };\n /**\n * Get the image element for the symbolizer.\n * @abstract\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element.\n */\n ImageStyle.prototype.getImage = function (pixelRatio) {\n return abstract();\n };\n /**\n * @abstract\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element.\n */\n ImageStyle.prototype.getHitDetectionImage = function (pixelRatio) {\n return abstract();\n };\n /**\n * @abstract\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n ImageStyle.prototype.getImageState = function () {\n return abstract();\n };\n /**\n * @abstract\n * @return {import(\"../size.js\").Size} Image size.\n */\n ImageStyle.prototype.getImageSize = function () {\n return abstract();\n };\n /**\n * @abstract\n * @return {import(\"../size.js\").Size} Size of the hit-detection image.\n */\n ImageStyle.prototype.getHitDetectionImageSize = function () {\n return abstract();\n };\n /**\n * Get the origin of the symbolizer.\n * @abstract\n * @return {Array<number>} Origin.\n */\n ImageStyle.prototype.getOrigin = function () {\n return abstract();\n };\n /**\n * Get the size of the symbolizer (in pixels).\n * @abstract\n * @return {import(\"../size.js\").Size} Size.\n */\n ImageStyle.prototype.getSize = function () {\n return abstract();\n };\n /**\n * Set the opacity.\n *\n * @param {number} opacity Opacity.\n * @api\n */\n ImageStyle.prototype.setOpacity = function (opacity) {\n this.opacity_ = opacity;\n };\n /**\n * Set whether to rotate the style with the view.\n *\n * @param {boolean} rotateWithView Rotate with map.\n * @api\n */\n ImageStyle.prototype.setRotateWithView = function (rotateWithView) {\n this.rotateWithView_ = rotateWithView;\n };\n /**\n * Set the rotation.\n *\n * @param {number} rotation Rotation.\n * @api\n */\n ImageStyle.prototype.setRotation = function (rotation) {\n this.rotation_ = rotation;\n };\n /**\n * Set the scale.\n *\n * @param {number} scale Scale.\n * @api\n */\n ImageStyle.prototype.setScale = function (scale) {\n this.scale_ = scale;\n };\n /**\n * @abstract\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @template T\n */\n ImageStyle.prototype.listenImageChange = function (listener) {\n abstract();\n };\n /**\n * Load not yet loaded URI.\n * @abstract\n */\n ImageStyle.prototype.load = function () {\n abstract();\n };\n /**\n * @abstract\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @template T\n */\n ImageStyle.prototype.unlistenImageChange = function (listener) {\n abstract();\n };\n return ImageStyle;\n}());\nexport default ImageStyle;\n//# sourceMappingURL=Image.js.map","/**\n * @module ol/style/RegularShape\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { asArray } from '../color.js';\nimport { asColorLike } from '../colorlike.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport ImageState from '../ImageState.js';\nimport { defaultStrokeStyle, defaultFillStyle, defaultLineCap, defaultLineWidth, defaultLineJoin, defaultMiterLimit } from '../render/canvas.js';\nimport ImageStyle from './Image.js';\n/**\n * Specify radius for regular polygons, or radius1 and radius2 for stars.\n * @typedef {Object} Options\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {number} points Number of points for stars and regular polygons. In case of a polygon, the number of points\n * is the number of sides.\n * @property {number} [radius] Radius of a regular polygon.\n * @property {number} [radius1] Outer radius of a star.\n * @property {number} [radius2] Inner radius of a star.\n * @property {number} [angle=0] Shape's angle in radians. A value of 0 will have one of the shape's point facing up.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view.\n */\n/**\n * @typedef {Object} RenderOptions\n * @property {import(\"../colorlike.js\").ColorLike} [strokeStyle]\n * @property {number} strokeWidth\n * @property {number} size\n * @property {CanvasLineCap} lineCap\n * @property {Array<number>} lineDash\n * @property {number} lineDashOffset\n * @property {CanvasLineJoin} lineJoin\n * @property {number} miterLimit\n */\n/**\n * @classdesc\n * Set regular shape style for vector features. The resulting shape will be\n * a regular polygon when `radius` is provided, or a star when `radius1` and\n * `radius2` are provided.\n * @api\n */\nvar RegularShape = /** @class */ (function (_super) {\n __extends(RegularShape, _super);\n /**\n * @param {Options} options Options.\n */\n function RegularShape(options) {\n var _this = this;\n /**\n * @type {boolean}\n */\n var rotateWithView = options.rotateWithView !== undefined ?\n options.rotateWithView : false;\n _this = _super.call(this, {\n opacity: 1,\n rotateWithView: rotateWithView,\n rotation: options.rotation !== undefined ? options.rotation : 0,\n scale: 1\n }) || this;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = null;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.hitDetectionCanvas_ = null;\n /**\n * @private\n * @type {import(\"./Fill.js\").default}\n */\n _this.fill_ = options.fill !== undefined ? options.fill : null;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.origin_ = [0, 0];\n /**\n * @private\n * @type {number}\n */\n _this.points_ = options.points;\n /**\n * @protected\n * @type {number}\n */\n _this.radius_ = options.radius !== undefined ? options.radius : options.radius1;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.radius2_ = options.radius2;\n /**\n * @private\n * @type {number}\n */\n _this.angle_ = options.angle !== undefined ? options.angle : 0;\n /**\n * @private\n * @type {import(\"./Stroke.js\").default}\n */\n _this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.anchor_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.size_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.imageSize_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.hitDetectionImageSize_ = null;\n _this.render();\n return _this;\n }\n /**\n * Clones the style.\n * @return {RegularShape} The cloned style.\n * @api\n */\n RegularShape.prototype.clone = function () {\n var style = new RegularShape({\n fill: this.getFill() ? this.getFill().clone() : undefined,\n points: this.getPoints(),\n radius: this.getRadius(),\n radius2: this.getRadius2(),\n angle: this.getAngle(),\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView()\n });\n style.setOpacity(this.getOpacity());\n style.setScale(this.getScale());\n return style;\n };\n /**\n * @inheritDoc\n * @api\n */\n RegularShape.prototype.getAnchor = function () {\n return this.anchor_;\n };\n /**\n * Get the angle used in generating the shape.\n * @return {number} Shape's rotation in radians.\n * @api\n */\n RegularShape.prototype.getAngle = function () {\n return this.angle_;\n };\n /**\n * Get the fill style for the shape.\n * @return {import(\"./Fill.js\").default} Fill style.\n * @api\n */\n RegularShape.prototype.getFill = function () {\n return this.fill_;\n };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.getHitDetectionImage = function (pixelRatio) {\n return this.hitDetectionCanvas_;\n };\n /**\n * @inheritDoc\n * @api\n */\n RegularShape.prototype.getImage = function (pixelRatio) {\n return this.canvas_;\n };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.getImageSize = function () {\n return this.imageSize_;\n };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.getHitDetectionImageSize = function () {\n return this.hitDetectionImageSize_;\n };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.getImageState = function () {\n return ImageState.LOADED;\n };\n /**\n * @inheritDoc\n * @api\n */\n RegularShape.prototype.getOrigin = function () {\n return this.origin_;\n };\n /**\n * Get the number of points for generating the shape.\n * @return {number} Number of points for stars and regular polygons.\n * @api\n */\n RegularShape.prototype.getPoints = function () {\n return this.points_;\n };\n /**\n * Get the (primary) radius for the shape.\n * @return {number} Radius.\n * @api\n */\n RegularShape.prototype.getRadius = function () {\n return this.radius_;\n };\n /**\n * Get the secondary radius for the shape.\n * @return {number|undefined} Radius2.\n * @api\n */\n RegularShape.prototype.getRadius2 = function () {\n return this.radius2_;\n };\n /**\n * @inheritDoc\n * @api\n */\n RegularShape.prototype.getSize = function () {\n return this.size_;\n };\n /**\n * Get the stroke style for the shape.\n * @return {import(\"./Stroke.js\").default} Stroke style.\n * @api\n */\n RegularShape.prototype.getStroke = function () {\n return this.stroke_;\n };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.listenImageChange = function (listener) { };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.load = function () { };\n /**\n * @inheritDoc\n */\n RegularShape.prototype.unlistenImageChange = function (listener) { };\n /**\n * @protected\n */\n RegularShape.prototype.render = function () {\n var lineCap = defaultLineCap;\n var lineJoin = defaultLineJoin;\n var miterLimit = 0;\n var lineDash = null;\n var lineDashOffset = 0;\n var strokeStyle;\n var strokeWidth = 0;\n if (this.stroke_) {\n strokeStyle = this.stroke_.getColor();\n if (strokeStyle === null) {\n strokeStyle = defaultStrokeStyle;\n }\n strokeStyle = asColorLike(strokeStyle);\n strokeWidth = this.stroke_.getWidth();\n if (strokeWidth === undefined) {\n strokeWidth = defaultLineWidth;\n }\n lineDash = this.stroke_.getLineDash();\n lineDashOffset = this.stroke_.getLineDashOffset();\n lineJoin = this.stroke_.getLineJoin();\n if (lineJoin === undefined) {\n lineJoin = defaultLineJoin;\n }\n lineCap = this.stroke_.getLineCap();\n if (lineCap === undefined) {\n lineCap = defaultLineCap;\n }\n miterLimit = this.stroke_.getMiterLimit();\n if (miterLimit === undefined) {\n miterLimit = defaultMiterLimit;\n }\n }\n var size = 2 * (this.radius_ + strokeWidth) + 1;\n var renderOptions = {\n strokeStyle: strokeStyle,\n strokeWidth: strokeWidth,\n size: size,\n lineCap: lineCap,\n lineDash: lineDash,\n lineDashOffset: lineDashOffset,\n lineJoin: lineJoin,\n miterLimit: miterLimit\n };\n var context = createCanvasContext2D(size, size);\n this.canvas_ = context.canvas;\n // canvas.width and height are rounded to the closest integer\n size = this.canvas_.width;\n var imageSize = size;\n this.draw_(renderOptions, context, 0, 0);\n this.createHitDetectionCanvas_(renderOptions);\n this.anchor_ = [size / 2, size / 2];\n this.size_ = [size, size];\n this.imageSize_ = [imageSize, imageSize];\n };\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @param {CanvasRenderingContext2D} context The rendering context.\n * @param {number} x The origin for the symbol (x).\n * @param {number} y The origin for the symbol (y).\n */\n RegularShape.prototype.draw_ = function (renderOptions, context, x, y) {\n var i, angle0, radiusC;\n // reset transform\n context.setTransform(1, 0, 0, 1, 0, 0);\n // then move to (x, y)\n context.translate(x, y);\n context.beginPath();\n var points = this.points_;\n if (points === Infinity) {\n context.arc(renderOptions.size / 2, renderOptions.size / 2, this.radius_, 0, 2 * Math.PI, true);\n }\n else {\n var radius2 = (this.radius2_ !== undefined) ? this.radius2_\n : this.radius_;\n if (radius2 !== this.radius_) {\n points = 2 * points;\n }\n for (i = 0; i <= points; i++) {\n angle0 = i * 2 * Math.PI / points - Math.PI / 2 + this.angle_;\n radiusC = i % 2 === 0 ? this.radius_ : radius2;\n context.lineTo(renderOptions.size / 2 + radiusC * Math.cos(angle0), renderOptions.size / 2 + radiusC * Math.sin(angle0));\n }\n }\n if (this.fill_) {\n var color = this.fill_.getColor();\n if (color === null) {\n color = defaultFillStyle;\n }\n context.fillStyle = asColorLike(color);\n context.fill();\n }\n if (this.stroke_) {\n context.strokeStyle = renderOptions.strokeStyle;\n context.lineWidth = renderOptions.strokeWidth;\n if (context.setLineDash && renderOptions.lineDash) {\n context.setLineDash(renderOptions.lineDash);\n context.lineDashOffset = renderOptions.lineDashOffset;\n }\n context.lineCap = renderOptions.lineCap;\n context.lineJoin = renderOptions.lineJoin;\n context.miterLimit = renderOptions.miterLimit;\n context.stroke();\n }\n context.closePath();\n };\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n */\n RegularShape.prototype.createHitDetectionCanvas_ = function (renderOptions) {\n this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size];\n this.hitDetectionCanvas_ = this.canvas_;\n if (this.fill_) {\n var color = this.fill_.getColor();\n // determine if fill is transparent (or pattern or gradient)\n var opacity = 0;\n if (typeof color === 'string') {\n color = asArray(color);\n }\n if (color === null) {\n opacity = 1;\n }\n else if (Array.isArray(color)) {\n opacity = color.length === 4 ? color[3] : 1;\n }\n if (opacity === 0) {\n // if a transparent fill style is set, create an extra hit-detection image\n // with a default fill style\n var context = createCanvasContext2D(renderOptions.size, renderOptions.size);\n this.hitDetectionCanvas_ = context.canvas;\n this.drawHitDetectionCanvas_(renderOptions, context, 0, 0);\n }\n }\n };\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @param {CanvasRenderingContext2D} context The context.\n * @param {number} x The origin for the symbol (x).\n * @param {number} y The origin for the symbol (y).\n */\n RegularShape.prototype.drawHitDetectionCanvas_ = function (renderOptions, context, x, y) {\n // reset transform\n context.setTransform(1, 0, 0, 1, 0, 0);\n // then move to (x, y)\n context.translate(x, y);\n context.beginPath();\n var points = this.points_;\n if (points === Infinity) {\n context.arc(renderOptions.size / 2, renderOptions.size / 2, this.radius_, 0, 2 * Math.PI, true);\n }\n else {\n var radius2 = (this.radius2_ !== undefined) ? this.radius2_\n : this.radius_;\n if (radius2 !== this.radius_) {\n points = 2 * points;\n }\n var i = void 0, radiusC = void 0, angle0 = void 0;\n for (i = 0; i <= points; i++) {\n angle0 = i * 2 * Math.PI / points - Math.PI / 2 + this.angle_;\n radiusC = i % 2 === 0 ? this.radius_ : radius2;\n context.lineTo(renderOptions.size / 2 + radiusC * Math.cos(angle0), renderOptions.size / 2 + radiusC * Math.sin(angle0));\n }\n }\n context.fillStyle = defaultFillStyle;\n context.fill();\n if (this.stroke_) {\n context.strokeStyle = renderOptions.strokeStyle;\n context.lineWidth = renderOptions.strokeWidth;\n if (renderOptions.lineDash) {\n context.setLineDash(renderOptions.lineDash);\n context.lineDashOffset = renderOptions.lineDashOffset;\n }\n context.stroke();\n }\n context.closePath();\n };\n return RegularShape;\n}(ImageStyle));\nexport default RegularShape;\n//# sourceMappingURL=RegularShape.js.map","/**\n * @module ol/style/Circle\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport RegularShape from './RegularShape.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {number} radius Circle radius.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n */\n/**\n * @classdesc\n * Set circle style for vector features.\n * @api\n */\nvar CircleStyle = /** @class */ (function (_super) {\n __extends(CircleStyle, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function CircleStyle(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n points: Infinity,\n fill: options.fill,\n radius: options.radius,\n stroke: options.stroke\n }) || this;\n return _this;\n }\n /**\n * Clones the style.\n * @return {CircleStyle} The cloned style.\n * @override\n * @api\n */\n CircleStyle.prototype.clone = function () {\n var style = new CircleStyle({\n fill: this.getFill() ? this.getFill().clone() : undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n radius: this.getRadius()\n });\n style.setOpacity(this.getOpacity());\n style.setScale(this.getScale());\n return style;\n };\n /**\n * Set the circle radius.\n *\n * @param {number} radius Circle radius.\n * @api\n */\n CircleStyle.prototype.setRadius = function (radius) {\n this.radius_ = radius;\n this.render();\n };\n return CircleStyle;\n}(RegularShape));\nexport default CircleStyle;\n//# sourceMappingURL=Circle.js.map","/**\n * @module ol/style/Fill\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} [color=null] A color, gradient or pattern.\n * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats.\n * Default null; if null, the Canvas/renderer default black will be used.\n */\n/**\n * @classdesc\n * Set fill style for vector features.\n * @api\n */\nvar Fill = /** @class */ (function () {\n /**\n * @param {Options=} opt_options Options.\n */\n function Fill(opt_options) {\n var options = opt_options || {};\n /**\n * @private\n * @type {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike}\n */\n this.color_ = options.color !== undefined ? options.color : null;\n }\n /**\n * Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}.\n * @return {Fill} The cloned style.\n * @api\n */\n Fill.prototype.clone = function () {\n var color = this.getColor();\n return new Fill({\n color: Array.isArray(color) ? color.slice() : color || undefined\n });\n };\n /**\n * Get the fill color.\n * @return {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} Color.\n * @api\n */\n Fill.prototype.getColor = function () {\n return this.color_;\n };\n /**\n * Set the color.\n *\n * @param {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} color Color.\n * @api\n */\n Fill.prototype.setColor = function (color) {\n this.color_ = color;\n };\n return Fill;\n}());\nexport default Fill;\n//# sourceMappingURL=Fill.js.map","/**\n * @module ol/style/IconAnchorUnits\n */\n/**\n * Icon anchor units. One of 'fraction', 'pixels'.\n * @enum {string}\n */\nexport default {\n FRACTION: 'fraction',\n PIXELS: 'pixels'\n};\n//# sourceMappingURL=IconAnchorUnits.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/ImageBase\n */\nimport { abstract } from './util.js';\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\n/**\n * @abstract\n */\nvar ImageBase = /** @class */ (function (_super) {\n __extends(ImageBase, _super);\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number|undefined} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./ImageState.js\").default} state State.\n */\n function ImageBase(extent, resolution, pixelRatio, state) {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {import(\"./extent.js\").Extent}\n */\n _this.extent = extent;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ = pixelRatio;\n /**\n * @protected\n * @type {number|undefined}\n */\n _this.resolution = resolution;\n /**\n * @protected\n * @type {import(\"./ImageState.js\").default}\n */\n _this.state = state;\n return _this;\n }\n /**\n * @protected\n */\n ImageBase.prototype.changed = function () {\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n ImageBase.prototype.getExtent = function () {\n return this.extent;\n };\n /**\n * @abstract\n * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.\n */\n ImageBase.prototype.getImage = function () {\n return abstract();\n };\n /**\n * @return {number} PixelRatio.\n */\n ImageBase.prototype.getPixelRatio = function () {\n return this.pixelRatio_;\n };\n /**\n * @return {number} Resolution.\n */\n ImageBase.prototype.getResolution = function () {\n return /** @type {number} */ (this.resolution);\n };\n /**\n * @return {import(\"./ImageState.js\").default} State.\n */\n ImageBase.prototype.getState = function () {\n return this.state;\n };\n /**\n * Load not yet loaded URI.\n * @abstract\n */\n ImageBase.prototype.load = function () {\n abstract();\n };\n return ImageBase;\n}(EventTarget));\nexport default ImageBase;\n//# sourceMappingURL=ImageBase.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Image\n */\nimport ImageBase from './ImageBase.js';\nimport ImageState from './ImageState.js';\nimport { listenOnce, unlistenByKey } from './events.js';\nimport EventType from './events/EventType.js';\nimport { getHeight } from './extent.js';\nimport { IMAGE_DECODE } from './has.js';\n/**\n * A function that takes an {@link module:ol/Image~Image} for the image and a\n * `{string}` for the src as arguments. It is supposed to make it so the\n * underlying image {@link module:ol/Image~Image#getImage} is assigned the\n * content specified by the src. If not specified, the default is\n *\n * function(image, src) {\n * image.getImage().src = src;\n * }\n *\n * Providing a custom `imageLoadFunction` can be useful to load images with\n * post requests or - in general - through XHR requests, where the src of the\n * image element would be set to a data URI when the content is loaded.\n *\n * @typedef {function(ImageWrapper, string): void} LoadFunction\n * @api\n */\nvar ImageWrapper = /** @class */ (function (_super) {\n __extends(ImageWrapper, _super);\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number|undefined} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {string} src Image source URI.\n * @param {?string} crossOrigin Cross origin.\n * @param {LoadFunction} imageLoadFunction Image load function.\n */\n function ImageWrapper(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {\n var _this = _super.call(this, extent, resolution, pixelRatio, ImageState.IDLE) || this;\n /**\n * @private\n * @type {string}\n */\n _this.src_ = src;\n /**\n * @private\n * @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement}\n */\n _this.image_ = new Image();\n if (crossOrigin !== null) {\n _this.image_.crossOrigin = crossOrigin;\n }\n /**\n * @private\n * @type {?function():void}\n */\n _this.unlisten_ = null;\n /**\n * @protected\n * @type {ImageState}\n */\n _this.state = ImageState.IDLE;\n /**\n * @private\n * @type {LoadFunction}\n */\n _this.imageLoadFunction_ = imageLoadFunction;\n return _this;\n }\n /**\n * @inheritDoc\n * @api\n */\n ImageWrapper.prototype.getImage = function () {\n return this.image_;\n };\n /**\n * Tracks loading or read errors.\n *\n * @private\n */\n ImageWrapper.prototype.handleImageError_ = function () {\n this.state = ImageState.ERROR;\n this.unlistenImage_();\n this.changed();\n };\n /**\n * Tracks successful image load.\n *\n * @private\n */\n ImageWrapper.prototype.handleImageLoad_ = function () {\n if (this.resolution === undefined) {\n this.resolution = getHeight(this.extent) / this.image_.height;\n }\n this.state = ImageState.LOADED;\n this.unlistenImage_();\n this.changed();\n };\n /**\n * Load the image or retry if loading previously failed.\n * Loading is taken care of by the tile queue, and calling this method is\n * only needed for preloading or for reloading in case of an error.\n * @override\n * @api\n */\n ImageWrapper.prototype.load = function () {\n if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) {\n this.state = ImageState.LOADING;\n this.changed();\n this.imageLoadFunction_(this, this.src_);\n this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));\n }\n };\n /**\n * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image.\n */\n ImageWrapper.prototype.setImage = function (image) {\n this.image_ = image;\n };\n /**\n * Discards event handlers which listen for load completion or errors.\n *\n * @private\n */\n ImageWrapper.prototype.unlistenImage_ = function () {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n };\n return ImageWrapper;\n}(ImageBase));\n/**\n * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image element.\n * @param {function():any} loadHandler Load callback function.\n * @param {function():any} errorHandler Error callback function.\n * @return {function():void} Callback to stop listening.\n */\nexport function listenImage(image, loadHandler, errorHandler) {\n var img = /** @type {HTMLImageElement} */ (image);\n if (img.src && IMAGE_DECODE) {\n var promise = img.decode();\n var listening_1 = true;\n var unlisten = function () {\n listening_1 = false;\n };\n promise.then(function () {\n if (listening_1) {\n loadHandler();\n }\n }).catch(function (error) {\n if (listening_1) {\n // FIXME: Unconditionally call errorHandler() when this bug is fixed upstream:\n // https://bugs.webkit.org/show_bug.cgi?id=198527\n if (error.name === 'EncodingError' && error.message === 'Invalid image type.') {\n loadHandler();\n }\n else {\n errorHandler();\n }\n }\n });\n return unlisten;\n }\n var listenerKeys = [\n listenOnce(img, EventType.LOAD, loadHandler),\n listenOnce(img, EventType.ERROR, errorHandler)\n ];\n return function unlisten() {\n listenerKeys.forEach(unlistenByKey);\n };\n}\nexport default ImageWrapper;\n//# sourceMappingURL=Image.js.map","/**\n * @module ol/style/IconImage\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { createCanvasContext2D } from '../dom.js';\nimport EventTarget from '../events/Target.js';\nimport EventType from '../events/EventType.js';\nimport ImageState from '../ImageState.js';\nimport { shared as iconImageCache } from './IconImageCache.js';\nimport { listenImage } from '../Image.js';\nvar IconImage = /** @class */ (function (_super) {\n __extends(IconImage, _super);\n /**\n * @param {HTMLImageElement|HTMLCanvasElement} image Image.\n * @param {string|undefined} src Src.\n * @param {import(\"../size.js\").Size} size Size.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../ImageState.js\").default} imageState Image state.\n * @param {import(\"../color.js\").Color} color Color.\n */\n function IconImage(image, src, size, crossOrigin, imageState, color) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement}\n */\n _this.hitDetectionImage_ = null;\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement}\n */\n _this.image_ = !image ? new Image() : image;\n if (crossOrigin !== null) {\n /** @type {HTMLImageElement} */ (_this.image_).crossOrigin = crossOrigin;\n }\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = color ? document.createElement('canvas') : null;\n /**\n * @private\n * @type {import(\"../color.js\").Color}\n */\n _this.color_ = color;\n /**\n * @private\n * @type {?function():void}\n */\n _this.unlisten_ = null;\n /**\n * @private\n * @type {import(\"../ImageState.js\").default}\n */\n _this.imageState_ = imageState;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.size_ = size;\n /**\n * @private\n * @type {string|undefined}\n */\n _this.src_ = src;\n /**\n * @private\n * @type {boolean|undefined}\n */\n _this.tainted_;\n return _this;\n }\n /**\n * @private\n * @return {boolean} The image canvas is tainted.\n */\n IconImage.prototype.isTainted_ = function () {\n if (this.tainted_ === undefined && this.imageState_ === ImageState.LOADED) {\n this.tainted_ = false;\n var context = createCanvasContext2D(1, 1);\n try {\n context.drawImage(this.image_, 0, 0);\n context.getImageData(0, 0, 1, 1);\n }\n catch (e) {\n this.tainted_ = true;\n }\n }\n return this.tainted_ === true;\n };\n /**\n * @private\n */\n IconImage.prototype.dispatchChangeEvent_ = function () {\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * @private\n */\n IconImage.prototype.handleImageError_ = function () {\n this.imageState_ = ImageState.ERROR;\n this.unlistenImage_();\n this.dispatchChangeEvent_();\n };\n /**\n * @private\n */\n IconImage.prototype.handleImageLoad_ = function () {\n this.imageState_ = ImageState.LOADED;\n if (this.size_) {\n this.image_.width = this.size_[0];\n this.image_.height = this.size_[1];\n }\n this.size_ = [this.image_.width, this.image_.height];\n this.unlistenImage_();\n this.replaceColor_();\n this.dispatchChangeEvent_();\n };\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLImageElement|HTMLCanvasElement} Image or Canvas element.\n */\n IconImage.prototype.getImage = function (pixelRatio) {\n return this.canvas_ ? this.canvas_ : this.image_;\n };\n /**\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n IconImage.prototype.getImageState = function () {\n return this.imageState_;\n };\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLImageElement|HTMLCanvasElement} Image element.\n */\n IconImage.prototype.getHitDetectionImage = function (pixelRatio) {\n if (!this.hitDetectionImage_) {\n if (this.isTainted_()) {\n var width = this.size_[0];\n var height = this.size_[1];\n var context = createCanvasContext2D(width, height);\n context.fillRect(0, 0, width, height);\n this.hitDetectionImage_ = context.canvas;\n }\n else {\n this.hitDetectionImage_ = this.image_;\n }\n }\n return this.hitDetectionImage_;\n };\n /**\n * @return {import(\"../size.js\").Size} Image size.\n */\n IconImage.prototype.getSize = function () {\n return this.size_;\n };\n /**\n * @return {string|undefined} Image src.\n */\n IconImage.prototype.getSrc = function () {\n return this.src_;\n };\n /**\n * Load not yet loaded URI.\n */\n IconImage.prototype.load = function () {\n if (this.imageState_ == ImageState.IDLE) {\n this.imageState_ = ImageState.LOADING;\n try {\n /** @type {HTMLImageElement} */ (this.image_).src = this.src_;\n }\n catch (e) {\n this.handleImageError_();\n }\n this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));\n }\n };\n /**\n * @private\n */\n IconImage.prototype.replaceColor_ = function () {\n if (!this.color_ || this.isTainted_()) {\n return;\n }\n this.canvas_.width = this.image_.width;\n this.canvas_.height = this.image_.height;\n var ctx = this.canvas_.getContext('2d');\n ctx.drawImage(this.image_, 0, 0);\n var imgData = ctx.getImageData(0, 0, this.image_.width, this.image_.height);\n var data = imgData.data;\n var r = this.color_[0] / 255.0;\n var g = this.color_[1] / 255.0;\n var b = this.color_[2] / 255.0;\n for (var i = 0, ii = data.length; i < ii; i += 4) {\n data[i] *= r;\n data[i + 1] *= g;\n data[i + 2] *= b;\n }\n ctx.putImageData(imgData, 0, 0);\n };\n /**\n * Discards event handlers which listen for load completion or errors.\n *\n * @private\n */\n IconImage.prototype.unlistenImage_ = function () {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n };\n return IconImage;\n}(EventTarget));\n/**\n * @param {HTMLImageElement|HTMLCanvasElement} image Image.\n * @param {string} src Src.\n * @param {import(\"../size.js\").Size} size Size.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../ImageState.js\").default} imageState Image state.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {IconImage} Icon image.\n */\nexport function get(image, src, size, crossOrigin, imageState, color) {\n var iconImage = iconImageCache.get(src, crossOrigin, color);\n if (!iconImage) {\n iconImage = new IconImage(image, src, size, crossOrigin, imageState, color);\n iconImageCache.set(src, crossOrigin, color, iconImage);\n }\n return iconImage;\n}\nexport default IconImage;\n//# sourceMappingURL=IconImage.js.map","/**\n * @module ol/style/IconOrigin\n */\n/**\n * Icon origin. One of 'bottom-left', 'bottom-right', 'top-left', 'top-right'.\n * @enum {string}\n */\nexport default {\n BOTTOM_LEFT: 'bottom-left',\n BOTTOM_RIGHT: 'bottom-right',\n TOP_LEFT: 'top-left',\n TOP_RIGHT: 'top-right'\n};\n//# sourceMappingURL=IconOrigin.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/style/Icon\n */\nimport { getUid } from '../util.js';\nimport ImageState from '../ImageState.js';\nimport { assert } from '../asserts.js';\nimport { asArray } from '../color.js';\nimport EventType from '../events/EventType.js';\nimport IconAnchorUnits from './IconAnchorUnits.js';\nimport { get as getIconImage } from './IconImage.js';\nimport IconOrigin from './IconOrigin.js';\nimport ImageStyle from './Image.js';\n/**\n * @typedef {Object} Options\n * @property {Array<number>} [anchor=[0.5, 0.5]] Anchor. Default value is the icon center.\n * @property {import(\"./IconOrigin.js\").default} [anchorOrigin='top-left'] Origin of the anchor: `bottom-left`, `bottom-right`,\n * `top-left` or `top-right`.\n * @property {import(\"./IconAnchorUnits.js\").default} [anchorXUnits='fraction'] Units in which the anchor x value is\n * specified. A value of `'fraction'` indicates the x value is a fraction of the icon. A value of `'pixels'` indicates\n * the x value in pixels.\n * @property {import(\"./IconAnchorUnits.js\").default} [anchorYUnits='fraction'] Units in which the anchor y value is\n * specified. A value of `'fraction'` indicates the y value is a fraction of the icon. A value of `'pixels'` indicates\n * the y value in pixels.\n * @property {import(\"../color.js\").Color|string} [color] Color to tint the icon. If not specified,\n * the icon will be left as is.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that you must provide a\n * `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {HTMLImageElement|HTMLCanvasElement} [img] Image object for the icon. If the `src` option is not provided then the\n * provided image must already be loaded. And in that case, it is required\n * to provide the size of the image, with the `imgSize` option.\n * @property {Array<number>} [offset=[0, 0]] Offset, which, together with the size and the offset origin, define the\n * sub-rectangle to use from the original icon image.\n * @property {import(\"./IconOrigin.js\").default} [offsetOrigin='top-left'] Origin of the offset: `bottom-left`, `bottom-right`,\n * `top-left` or `top-right`.\n * @property {number} [opacity=1] Opacity of the icon.\n * @property {number} [scale=1] Scale.\n * @property {boolean} [rotateWithView=false] Whether to rotate the icon with the view.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {import(\"../size.js\").Size} [size] Icon size in pixel. Can be used together with `offset` to define the\n * sub-rectangle to use from the origin (sprite) icon image.\n * @property {import(\"../size.js\").Size} [imgSize] Image size in pixels. Only required if `img` is set and `src` is not, and\n * for SVG images in Internet Explorer 11. The provided `imgSize` needs to match the actual size of the image.\n * @property {string} [src] Image source URI.\n */\n/**\n * @classdesc\n * Set icon style for vector features.\n * @api\n */\nvar Icon = /** @class */ (function (_super) {\n __extends(Icon, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Icon(opt_options) {\n var _this = this;\n var options = opt_options || {};\n /**\n * @type {number}\n */\n var opacity = options.opacity !== undefined ? options.opacity : 1;\n /**\n * @type {number}\n */\n var rotation = options.rotation !== undefined ? options.rotation : 0;\n /**\n * @type {number}\n */\n var scale = options.scale !== undefined ? options.scale : 1;\n /**\n * @type {boolean}\n */\n var rotateWithView = options.rotateWithView !== undefined ?\n options.rotateWithView : false;\n _this = _super.call(this, {\n opacity: opacity,\n rotation: rotation,\n scale: scale,\n rotateWithView: rotateWithView\n }) || this;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.anchor_ = options.anchor !== undefined ? options.anchor : [0.5, 0.5];\n /**\n * @private\n * @type {Array<number>}\n */\n _this.normalizedAnchor_ = null;\n /**\n * @private\n * @type {import(\"./IconOrigin.js\").default}\n */\n _this.anchorOrigin_ = options.anchorOrigin !== undefined ?\n options.anchorOrigin : IconOrigin.TOP_LEFT;\n /**\n * @private\n * @type {import(\"./IconAnchorUnits.js\").default}\n */\n _this.anchorXUnits_ = options.anchorXUnits !== undefined ?\n options.anchorXUnits : IconAnchorUnits.FRACTION;\n /**\n * @private\n * @type {import(\"./IconAnchorUnits.js\").default}\n */\n _this.anchorYUnits_ = options.anchorYUnits !== undefined ?\n options.anchorYUnits : IconAnchorUnits.FRACTION;\n /**\n * @private\n * @type {?string}\n */\n _this.crossOrigin_ =\n options.crossOrigin !== undefined ? options.crossOrigin : null;\n /**\n * @type {HTMLImageElement|HTMLCanvasElement}\n */\n var image = options.img !== undefined ? options.img : null;\n /**\n * @type {import(\"../size.js\").Size}\n */\n var imgSize = options.imgSize !== undefined ? options.imgSize : null;\n /**\n * @type {string|undefined}\n */\n var src = options.src;\n assert(!(src !== undefined && image), 4); // `image` and `src` cannot be provided at the same time\n assert(!image || (image && imgSize), 5); // `imgSize` must be set when `image` is provided\n if ((src === undefined || src.length === 0) && image) {\n src = /** @type {HTMLImageElement} */ (image).src || getUid(image);\n }\n assert(src !== undefined && src.length > 0, 6); // A defined and non-empty `src` or `image` must be provided\n /**\n * @type {import(\"../ImageState.js\").default}\n */\n var imageState = options.src !== undefined ?\n ImageState.IDLE : ImageState.LOADED;\n /**\n * @private\n * @type {import(\"../color.js\").Color}\n */\n _this.color_ = options.color !== undefined ? asArray(options.color) : null;\n /**\n * @private\n * @type {import(\"./IconImage.js\").default}\n */\n _this.iconImage_ = getIconImage(image, /** @type {string} */ (src), imgSize, _this.crossOrigin_, imageState, _this.color_);\n /**\n * @private\n * @type {Array<number>}\n */\n _this.offset_ = options.offset !== undefined ? options.offset : [0, 0];\n /**\n * @private\n * @type {import(\"./IconOrigin.js\").default}\n */\n _this.offsetOrigin_ = options.offsetOrigin !== undefined ?\n options.offsetOrigin : IconOrigin.TOP_LEFT;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.origin_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.size_ = options.size !== undefined ? options.size : null;\n return _this;\n }\n /**\n * Clones the style. The underlying Image/HTMLCanvasElement is not cloned.\n * @return {Icon} The cloned style.\n * @api\n */\n Icon.prototype.clone = function () {\n return new Icon({\n anchor: this.anchor_.slice(),\n anchorOrigin: this.anchorOrigin_,\n anchorXUnits: this.anchorXUnits_,\n anchorYUnits: this.anchorYUnits_,\n crossOrigin: this.crossOrigin_,\n color: (this.color_ && this.color_.slice) ? this.color_.slice() : this.color_ || undefined,\n src: this.getSrc(),\n offset: this.offset_.slice(),\n offsetOrigin: this.offsetOrigin_,\n size: this.size_ !== null ? this.size_.slice() : undefined,\n opacity: this.getOpacity(),\n scale: this.getScale(),\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView()\n });\n };\n /**\n * @inheritDoc\n * @api\n */\n Icon.prototype.getAnchor = function () {\n if (this.normalizedAnchor_) {\n return this.normalizedAnchor_;\n }\n var anchor = this.anchor_;\n var size = this.getSize();\n if (this.anchorXUnits_ == IconAnchorUnits.FRACTION ||\n this.anchorYUnits_ == IconAnchorUnits.FRACTION) {\n if (!size) {\n return null;\n }\n anchor = this.anchor_.slice();\n if (this.anchorXUnits_ == IconAnchorUnits.FRACTION) {\n anchor[0] *= size[0];\n }\n if (this.anchorYUnits_ == IconAnchorUnits.FRACTION) {\n anchor[1] *= size[1];\n }\n }\n if (this.anchorOrigin_ != IconOrigin.TOP_LEFT) {\n if (!size) {\n return null;\n }\n if (anchor === this.anchor_) {\n anchor = this.anchor_.slice();\n }\n if (this.anchorOrigin_ == IconOrigin.TOP_RIGHT ||\n this.anchorOrigin_ == IconOrigin.BOTTOM_RIGHT) {\n anchor[0] = -anchor[0] + size[0];\n }\n if (this.anchorOrigin_ == IconOrigin.BOTTOM_LEFT ||\n this.anchorOrigin_ == IconOrigin.BOTTOM_RIGHT) {\n anchor[1] = -anchor[1] + size[1];\n }\n }\n this.normalizedAnchor_ = anchor;\n return this.normalizedAnchor_;\n };\n /**\n * Set the anchor point. The anchor determines the center point for the\n * symbolizer.\n *\n * @param {Array<number>} anchor Anchor.\n * @api\n */\n Icon.prototype.setAnchor = function (anchor) {\n this.anchor_ = anchor;\n this.normalizedAnchor_ = null;\n };\n /**\n * Get the icon color.\n * @return {import(\"../color.js\").Color} Color.\n * @api\n */\n Icon.prototype.getColor = function () {\n return this.color_;\n };\n /**\n * Get the image icon.\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLImageElement|HTMLCanvasElement} Image or Canvas element.\n * @override\n * @api\n */\n Icon.prototype.getImage = function (pixelRatio) {\n return this.iconImage_.getImage(pixelRatio);\n };\n /**\n * @override\n */\n Icon.prototype.getImageSize = function () {\n return this.iconImage_.getSize();\n };\n /**\n * @override\n */\n Icon.prototype.getHitDetectionImageSize = function () {\n return this.getImageSize();\n };\n /**\n * @override\n */\n Icon.prototype.getImageState = function () {\n return this.iconImage_.getImageState();\n };\n /**\n * @override\n */\n Icon.prototype.getHitDetectionImage = function (pixelRatio) {\n return this.iconImage_.getHitDetectionImage(pixelRatio);\n };\n /**\n * @inheritDoc\n * @api\n */\n Icon.prototype.getOrigin = function () {\n if (this.origin_) {\n return this.origin_;\n }\n var offset = this.offset_;\n if (this.offsetOrigin_ != IconOrigin.TOP_LEFT) {\n var size = this.getSize();\n var iconImageSize = this.iconImage_.getSize();\n if (!size || !iconImageSize) {\n return null;\n }\n offset = offset.slice();\n if (this.offsetOrigin_ == IconOrigin.TOP_RIGHT ||\n this.offsetOrigin_ == IconOrigin.BOTTOM_RIGHT) {\n offset[0] = iconImageSize[0] - size[0] - offset[0];\n }\n if (this.offsetOrigin_ == IconOrigin.BOTTOM_LEFT ||\n this.offsetOrigin_ == IconOrigin.BOTTOM_RIGHT) {\n offset[1] = iconImageSize[1] - size[1] - offset[1];\n }\n }\n this.origin_ = offset;\n return this.origin_;\n };\n /**\n * Get the image URL.\n * @return {string|undefined} Image src.\n * @api\n */\n Icon.prototype.getSrc = function () {\n return this.iconImage_.getSrc();\n };\n /**\n * @inheritDoc\n * @api\n */\n Icon.prototype.getSize = function () {\n return !this.size_ ? this.iconImage_.getSize() : this.size_;\n };\n /**\n * @override\n */\n Icon.prototype.listenImageChange = function (listener) {\n this.iconImage_.addEventListener(EventType.CHANGE, listener);\n };\n /**\n * Load not yet loaded URI.\n * When rendering a feature with an icon style, the vector renderer will\n * automatically call this method. However, you might want to call this\n * method yourself for preloading or other purposes.\n * @override\n * @api\n */\n Icon.prototype.load = function () {\n this.iconImage_.load();\n };\n /**\n * @override\n */\n Icon.prototype.unlistenImageChange = function (listener) {\n this.iconImage_.removeEventListener(EventType.CHANGE, listener);\n };\n return Icon;\n}(ImageStyle));\nexport default Icon;\n//# sourceMappingURL=Icon.js.map","/**\n * @module ol/style/Stroke\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} [color] A color, gradient or pattern.\n * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats.\n * Default null; if null, the Canvas/renderer default black will be used.\n * @property {CanvasLineCap} [lineCap='round'] Line cap style: `butt`, `round`, or `square`.\n * @property {CanvasLineJoin} [lineJoin='round'] Line join style: `bevel`, `round`, or `miter`.\n * @property {Array<number>} [lineDash] Line dash pattern. Default is `undefined` (no dash).\n * Please note that Internet Explorer 10 and lower do not support the `setLineDash` method on\n * the `CanvasRenderingContext2D` and therefore this option will have no visual effect in these browsers.\n * @property {number} [lineDashOffset=0] Line dash offset.\n * @property {number} [miterLimit=10] Miter limit.\n * @property {number} [width] Width.\n */\n/**\n * @classdesc\n * Set stroke style for vector features.\n * Note that the defaults given are the Canvas defaults, which will be used if\n * option is not defined. The `get` functions return whatever was entered in\n * the options; they will not return the default.\n * @api\n */\nvar Stroke = /** @class */ (function () {\n /**\n * @param {Options=} opt_options Options.\n */\n function Stroke(opt_options) {\n var options = opt_options || {};\n /**\n * @private\n * @type {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike}\n */\n this.color_ = options.color !== undefined ? options.color : null;\n /**\n * @private\n * @type {CanvasLineCap|undefined}\n */\n this.lineCap_ = options.lineCap;\n /**\n * @private\n * @type {Array<number>}\n */\n this.lineDash_ = options.lineDash !== undefined ? options.lineDash : null;\n /**\n * @private\n * @type {number|undefined}\n */\n this.lineDashOffset_ = options.lineDashOffset;\n /**\n * @private\n * @type {CanvasLineJoin|undefined}\n */\n this.lineJoin_ = options.lineJoin;\n /**\n * @private\n * @type {number|undefined}\n */\n this.miterLimit_ = options.miterLimit;\n /**\n * @private\n * @type {number|undefined}\n */\n this.width_ = options.width;\n }\n /**\n * Clones the style.\n * @return {Stroke} The cloned style.\n * @api\n */\n Stroke.prototype.clone = function () {\n var color = this.getColor();\n return new Stroke({\n color: Array.isArray(color) ? color.slice() : color || undefined,\n lineCap: this.getLineCap(),\n lineDash: this.getLineDash() ? this.getLineDash().slice() : undefined,\n lineDashOffset: this.getLineDashOffset(),\n lineJoin: this.getLineJoin(),\n miterLimit: this.getMiterLimit(),\n width: this.getWidth()\n });\n };\n /**\n * Get the stroke color.\n * @return {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} Color.\n * @api\n */\n Stroke.prototype.getColor = function () {\n return this.color_;\n };\n /**\n * Get the line cap type for the stroke.\n * @return {CanvasLineCap|undefined} Line cap.\n * @api\n */\n Stroke.prototype.getLineCap = function () {\n return this.lineCap_;\n };\n /**\n * Get the line dash style for the stroke.\n * @return {Array<number>} Line dash.\n * @api\n */\n Stroke.prototype.getLineDash = function () {\n return this.lineDash_;\n };\n /**\n * Get the line dash offset for the stroke.\n * @return {number|undefined} Line dash offset.\n * @api\n */\n Stroke.prototype.getLineDashOffset = function () {\n return this.lineDashOffset_;\n };\n /**\n * Get the line join type for the stroke.\n * @return {CanvasLineJoin|undefined} Line join.\n * @api\n */\n Stroke.prototype.getLineJoin = function () {\n return this.lineJoin_;\n };\n /**\n * Get the miter limit for the stroke.\n * @return {number|undefined} Miter limit.\n * @api\n */\n Stroke.prototype.getMiterLimit = function () {\n return this.miterLimit_;\n };\n /**\n * Get the stroke width.\n * @return {number|undefined} Width.\n * @api\n */\n Stroke.prototype.getWidth = function () {\n return this.width_;\n };\n /**\n * Set the color.\n *\n * @param {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} color Color.\n * @api\n */\n Stroke.prototype.setColor = function (color) {\n this.color_ = color;\n };\n /**\n * Set the line cap.\n *\n * @param {CanvasLineCap|undefined} lineCap Line cap.\n * @api\n */\n Stroke.prototype.setLineCap = function (lineCap) {\n this.lineCap_ = lineCap;\n };\n /**\n * Set the line dash.\n *\n * Please note that Internet Explorer 10 and lower [do not support][mdn] the\n * `setLineDash` method on the `CanvasRenderingContext2D` and therefore this\n * property will have no visual effect in these browsers.\n *\n * [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility\n *\n * @param {Array<number>} lineDash Line dash.\n * @api\n */\n Stroke.prototype.setLineDash = function (lineDash) {\n this.lineDash_ = lineDash;\n };\n /**\n * Set the line dash offset.\n *\n * @param {number|undefined} lineDashOffset Line dash offset.\n * @api\n */\n Stroke.prototype.setLineDashOffset = function (lineDashOffset) {\n this.lineDashOffset_ = lineDashOffset;\n };\n /**\n * Set the line join.\n *\n * @param {CanvasLineJoin|undefined} lineJoin Line join.\n * @api\n */\n Stroke.prototype.setLineJoin = function (lineJoin) {\n this.lineJoin_ = lineJoin;\n };\n /**\n * Set the miter limit.\n *\n * @param {number|undefined} miterLimit Miter limit.\n * @api\n */\n Stroke.prototype.setMiterLimit = function (miterLimit) {\n this.miterLimit_ = miterLimit;\n };\n /**\n * Set the width.\n *\n * @param {number|undefined} width Width.\n * @api\n */\n Stroke.prototype.setWidth = function (width) {\n this.width_ = width;\n };\n return Stroke;\n}());\nexport default Stroke;\n//# sourceMappingURL=Stroke.js.map","/**\n * @module ol/style/Style\n */\nimport { assert } from '../asserts.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport CircleStyle from './Circle.js';\nimport Fill from './Fill.js';\nimport Stroke from './Stroke.js';\n/**\n * A function that takes an {@link module:ol/Feature} and a `{number}`\n * representing the view's resolution. The function should return a\n * {@link module:ol/style/Style} or an array of them. This way e.g. a\n * vector layer can be styled.\n *\n * @typedef {function(import(\"../Feature.js\").FeatureLike, number):(Style|Array<Style>)} StyleFunction\n */\n/**\n * A {@link Style}, an array of {@link Style}, or a {@link StyleFunction}.\n * @typedef {Style|Array<Style>|StyleFunction} StyleLike\n */\n/**\n * A function that takes an {@link module:ol/Feature} as argument and returns an\n * {@link module:ol/geom/Geometry} that will be rendered and styled for the feature.\n *\n * @typedef {function(import(\"../Feature.js\").FeatureLike):\n * (import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default|undefined)} GeometryFunction\n */\n/**\n * Custom renderer function. Takes two arguments:\n *\n * 1. The pixel coordinates of the geometry in GeoJSON notation.\n * 2. The {@link module:ol/render~State} of the layer renderer.\n *\n * @typedef {function((import(\"../coordinate.js\").Coordinate|Array<import(\"../coordinate.js\").Coordinate>|Array<Array<import(\"../coordinate.js\").Coordinate>>),import(\"../render.js\").State): void}\n * RenderFunction\n */\n/**\n * @typedef {Object} Options\n * @property {string|import(\"../geom/Geometry.js\").default|GeometryFunction} [geometry] Feature property or geometry\n * or function returning a geometry to render for this style.\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {import(\"./Image.js\").default} [image] Image style.\n * @property {RenderFunction} [renderer] Custom renderer. When configured, `fill`, `stroke` and `image` will be\n * ignored, and the provided function will be called with each render frame for each geometry.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {import(\"./Text.js\").default} [text] Text style.\n * @property {number} [zIndex] Z index.\n */\n/**\n * @classdesc\n * Container for vector feature rendering styles. Any changes made to the style\n * or its children through `set*()` methods will not take effect until the\n * feature or layer that uses the style is re-rendered.\n *\n * ## Feature styles\n *\n * If no style is defined, the following default style is used:\n * ```js\n * import {Fill, Stroke, Circle, Style} from 'ol/style';\n *\n * var fill = new Fill({\n * color: 'rgba(255,255,255,0.4)'\n * });\n * var stroke = new Stroke({\n * color: '#3399CC',\n * width: 1.25\n * });\n * var styles = [\n * new Style({\n * image: new Circle({\n * fill: fill,\n * stroke: stroke,\n * radius: 5\n * }),\n * fill: fill,\n * stroke: stroke\n * })\n * ];\n * ```\n *\n * A separate editing style has the following defaults:\n * ```js\n * import {Fill, Stroke, Circle, Style} from 'ol/style';\n * import GeometryType from 'ol/geom/GeometryType';\n *\n * var white = [255, 255, 255, 1];\n * var blue = [0, 153, 255, 1];\n * var width = 3;\n * styles[GeometryType.POLYGON] = [\n * new Style({\n * fill: new Fill({\n * color: [255, 255, 255, 0.5]\n * })\n * })\n * ];\n * styles[GeometryType.MULTI_POLYGON] =\n * styles[GeometryType.POLYGON];\n * styles[GeometryType.LINE_STRING] = [\n * new Style({\n * stroke: new Stroke({\n * color: white,\n * width: width + 2\n * })\n * }),\n * new Style({\n * stroke: new Stroke({\n * color: blue,\n * width: width\n * })\n * })\n * ];\n * styles[GeometryType.MULTI_LINE_STRING] =\n * styles[GeometryType.LINE_STRING];\n * styles[GeometryType.POINT] = [\n * new Style({\n * image: new Circle({\n * radius: width * 2,\n * fill: new Fill({\n * color: blue\n * }),\n * stroke: new Stroke({\n * color: white,\n * width: width / 2\n * })\n * }),\n * zIndex: Infinity\n * })\n * ];\n * styles[GeometryType.MULTI_POINT] =\n * styles[GeometryType.POINT];\n * styles[GeometryType.GEOMETRY_COLLECTION] =\n * styles[GeometryType.POLYGON].concat(\n * styles[GeometryType.LINE_STRING],\n * styles[GeometryType.POINT]\n * );\n * ```\n *\n * @api\n */\nvar Style = /** @class */ (function () {\n /**\n * @param {Options=} opt_options Style options.\n */\n function Style(opt_options) {\n var options = opt_options || {};\n /**\n * @private\n * @type {string|import(\"../geom/Geometry.js\").default|GeometryFunction}\n */\n this.geometry_ = null;\n /**\n * @private\n * @type {!GeometryFunction}\n */\n this.geometryFunction_ = defaultGeometryFunction;\n if (options.geometry !== undefined) {\n this.setGeometry(options.geometry);\n }\n /**\n * @private\n * @type {import(\"./Fill.js\").default}\n */\n this.fill_ = options.fill !== undefined ? options.fill : null;\n /**\n * @private\n * @type {import(\"./Image.js\").default}\n */\n this.image_ = options.image !== undefined ? options.image : null;\n /**\n * @private\n * @type {RenderFunction|null}\n */\n this.renderer_ = options.renderer !== undefined ? options.renderer : null;\n /**\n * @private\n * @type {import(\"./Stroke.js\").default}\n */\n this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n /**\n * @private\n * @type {import(\"./Text.js\").default}\n */\n this.text_ = options.text !== undefined ? options.text : null;\n /**\n * @private\n * @type {number|undefined}\n */\n this.zIndex_ = options.zIndex;\n }\n /**\n * Clones the style.\n * @return {Style} The cloned style.\n * @api\n */\n Style.prototype.clone = function () {\n var geometry = this.getGeometry();\n if (geometry && typeof geometry === 'object') {\n geometry = /** @type {import(\"../geom/Geometry.js\").default} */ (geometry).clone();\n }\n return new Style({\n geometry: geometry,\n fill: this.getFill() ? this.getFill().clone() : undefined,\n image: this.getImage() ? this.getImage().clone() : undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n text: this.getText() ? this.getText().clone() : undefined,\n zIndex: this.getZIndex()\n });\n };\n /**\n * Get the custom renderer function that was configured with\n * {@link #setRenderer} or the `renderer` constructor option.\n * @return {RenderFunction|null} Custom renderer function.\n * @api\n */\n Style.prototype.getRenderer = function () {\n return this.renderer_;\n };\n /**\n * Sets a custom renderer function for this style. When set, `fill`, `stroke`\n * and `image` options of the style will be ignored.\n * @param {RenderFunction|null} renderer Custom renderer function.\n * @api\n */\n Style.prototype.setRenderer = function (renderer) {\n this.renderer_ = renderer;\n };\n /**\n * Get the geometry to be rendered.\n * @return {string|import(\"../geom/Geometry.js\").default|GeometryFunction}\n * Feature property or geometry or function that returns the geometry that will\n * be rendered with this style.\n * @api\n */\n Style.prototype.getGeometry = function () {\n return this.geometry_;\n };\n /**\n * Get the function used to generate a geometry for rendering.\n * @return {!GeometryFunction} Function that is called with a feature\n * and returns the geometry to render instead of the feature's geometry.\n * @api\n */\n Style.prototype.getGeometryFunction = function () {\n return this.geometryFunction_;\n };\n /**\n * Get the fill style.\n * @return {import(\"./Fill.js\").default} Fill style.\n * @api\n */\n Style.prototype.getFill = function () {\n return this.fill_;\n };\n /**\n * Set the fill style.\n * @param {import(\"./Fill.js\").default} fill Fill style.\n * @api\n */\n Style.prototype.setFill = function (fill) {\n this.fill_ = fill;\n };\n /**\n * Get the image style.\n * @return {import(\"./Image.js\").default} Image style.\n * @api\n */\n Style.prototype.getImage = function () {\n return this.image_;\n };\n /**\n * Set the image style.\n * @param {import(\"./Image.js\").default} image Image style.\n * @api\n */\n Style.prototype.setImage = function (image) {\n this.image_ = image;\n };\n /**\n * Get the stroke style.\n * @return {import(\"./Stroke.js\").default} Stroke style.\n * @api\n */\n Style.prototype.getStroke = function () {\n return this.stroke_;\n };\n /**\n * Set the stroke style.\n * @param {import(\"./Stroke.js\").default} stroke Stroke style.\n * @api\n */\n Style.prototype.setStroke = function (stroke) {\n this.stroke_ = stroke;\n };\n /**\n * Get the text style.\n * @return {import(\"./Text.js\").default} Text style.\n * @api\n */\n Style.prototype.getText = function () {\n return this.text_;\n };\n /**\n * Set the text style.\n * @param {import(\"./Text.js\").default} text Text style.\n * @api\n */\n Style.prototype.setText = function (text) {\n this.text_ = text;\n };\n /**\n * Get the z-index for the style.\n * @return {number|undefined} ZIndex.\n * @api\n */\n Style.prototype.getZIndex = function () {\n return this.zIndex_;\n };\n /**\n * Set a geometry that is rendered instead of the feature's geometry.\n *\n * @param {string|import(\"../geom/Geometry.js\").default|GeometryFunction} geometry\n * Feature property or geometry or function returning a geometry to render\n * for this style.\n * @api\n */\n Style.prototype.setGeometry = function (geometry) {\n if (typeof geometry === 'function') {\n this.geometryFunction_ = geometry;\n }\n else if (typeof geometry === 'string') {\n this.geometryFunction_ = function (feature) {\n return (\n /** @type {import(\"../geom/Geometry.js\").default} */ (feature.get(geometry)));\n };\n }\n else if (!geometry) {\n this.geometryFunction_ = defaultGeometryFunction;\n }\n else if (geometry !== undefined) {\n this.geometryFunction_ = function () {\n return (\n /** @type {import(\"../geom/Geometry.js\").default} */ (geometry));\n };\n }\n this.geometry_ = geometry;\n };\n /**\n * Set the z-index.\n *\n * @param {number|undefined} zIndex ZIndex.\n * @api\n */\n Style.prototype.setZIndex = function (zIndex) {\n this.zIndex_ = zIndex;\n };\n return Style;\n}());\n/**\n * Convert the provided object into a style function. Functions passed through\n * unchanged. Arrays of Style or single style objects wrapped in a\n * new style function.\n * @param {StyleFunction|Array<Style>|Style} obj\n * A style function, a single style, or an array of styles.\n * @return {StyleFunction} A style function.\n */\nexport function toFunction(obj) {\n var styleFunction;\n if (typeof obj === 'function') {\n styleFunction = obj;\n }\n else {\n /**\n * @type {Array<Style>}\n */\n var styles_1;\n if (Array.isArray(obj)) {\n styles_1 = obj;\n }\n else {\n assert(typeof /** @type {?} */ (obj).getZIndex === 'function', 41); // Expected an `Style` or an array of `Style`\n var style = /** @type {Style} */ (obj);\n styles_1 = [style];\n }\n styleFunction = function () {\n return styles_1;\n };\n }\n return styleFunction;\n}\n/**\n * @type {Array<Style>}\n */\nvar defaultStyles = null;\n/**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} resolution Resolution.\n * @return {Array<Style>} Style.\n */\nexport function createDefaultStyle(feature, resolution) {\n // We don't use an immediately-invoked function\n // and a closure so we don't get an error at script evaluation time in\n // browsers that do not support Canvas. (import(\"./Circle.js\").CircleStyle does\n // canvas.getContext('2d') at construction time, which will cause an.error\n // in such browsers.)\n if (!defaultStyles) {\n var fill = new Fill({\n color: 'rgba(255,255,255,0.4)'\n });\n var stroke = new Stroke({\n color: '#3399CC',\n width: 1.25\n });\n defaultStyles = [\n new Style({\n image: new CircleStyle({\n fill: fill,\n stroke: stroke,\n radius: 5\n }),\n fill: fill,\n stroke: stroke\n })\n ];\n }\n return defaultStyles;\n}\n/**\n * Default styles for editing features.\n * @return {Object<import(\"../geom/GeometryType.js\").default, Array<Style>>} Styles\n */\nexport function createEditingStyle() {\n /** @type {Object<import(\"../geom/GeometryType.js\").default, Array<Style>>} */\n var styles = {};\n var white = [255, 255, 255, 1];\n var blue = [0, 153, 255, 1];\n var width = 3;\n styles[GeometryType.POLYGON] = [\n new Style({\n fill: new Fill({\n color: [255, 255, 255, 0.5]\n })\n })\n ];\n styles[GeometryType.MULTI_POLYGON] =\n styles[GeometryType.POLYGON];\n styles[GeometryType.LINE_STRING] = [\n new Style({\n stroke: new Stroke({\n color: white,\n width: width + 2\n })\n }),\n new Style({\n stroke: new Stroke({\n color: blue,\n width: width\n })\n })\n ];\n styles[GeometryType.MULTI_LINE_STRING] =\n styles[GeometryType.LINE_STRING];\n styles[GeometryType.CIRCLE] =\n styles[GeometryType.POLYGON].concat(styles[GeometryType.LINE_STRING]);\n styles[GeometryType.POINT] = [\n new Style({\n image: new CircleStyle({\n radius: width * 2,\n fill: new Fill({\n color: blue\n }),\n stroke: new Stroke({\n color: white,\n width: width / 2\n })\n }),\n zIndex: Infinity\n })\n ];\n styles[GeometryType.MULTI_POINT] =\n styles[GeometryType.POINT];\n styles[GeometryType.GEOMETRY_COLLECTION] =\n styles[GeometryType.POLYGON].concat(styles[GeometryType.LINE_STRING], styles[GeometryType.POINT]);\n return styles;\n}\n/**\n * Function that is called with a feature and returns its default geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature to get the geometry for.\n * @return {import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default|undefined} Geometry to render.\n */\nfunction defaultGeometryFunction(feature) {\n return feature.getGeometry();\n}\nexport default Style;\n//# sourceMappingURL=Style.js.map","/**\n * @module ol/style/TextPlacement\n */\n/**\n * Text placement. One of `'point'`, `'line'`. Default is `'point'`. Note that\n * `'line'` requires the underlying geometry to be a {@link module:ol/geom/LineString~LineString},\n * {@link module:ol/geom/Polygon~Polygon}, {@link module:ol/geom/MultiLineString~MultiLineString} or\n * {@link module:ol/geom/MultiPolygon~MultiPolygon}.\n * @enum {string}\n */\nexport default {\n POINT: 'point',\n LINE: 'line'\n};\n//# sourceMappingURL=TextPlacement.js.map","/**\n * @module ol/style/Text\n */\nimport Fill from './Fill.js';\nimport TextPlacement from './TextPlacement.js';\n/**\n * The default fill color to use if no fill was set at construction time; a\n * blackish `#333`.\n *\n * @const {string}\n */\nvar DEFAULT_FILL_COLOR = '#333';\n/**\n * @typedef {Object} Options\n * @property {string} [font] Font style as CSS 'font' value, see:\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font. Default is '10px sans-serif'\n * @property {number} [maxAngle=Math.PI/4] When `placement` is set to `'line'`, allow a maximum angle between adjacent characters.\n * The expected value is in radians, and the default is 45° (`Math.PI / 4`).\n * @property {number} [offsetX=0] Horizontal text offset in pixels. A positive will shift the text right.\n * @property {number} [offsetY=0] Vertical text offset in pixels. A positive will shift the text down.\n * @property {boolean} [overflow=false] For polygon labels or when `placement` is set to `'line'`, allow text to exceed\n * the width of the polygon at the label position or the length of the path that it follows.\n * @property {import(\"./TextPlacement.js\").default|string} [placement='point'] Text placement.\n * @property {number} [scale] Scale.\n * @property {boolean} [rotateWithView=false] Whether to rotate the text with the view.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {string} [text] Text content.\n * @property {string} [textAlign] Text alignment. Possible values: 'left', 'right', 'center', 'end' or 'start'.\n * Default is 'center' for `placement: 'point'`. For `placement: 'line'`, the default is to let the renderer choose a\n * placement where `maxAngle` is not exceeded.\n * @property {string} [textBaseline='middle'] Text base line. Possible values: 'bottom', 'top', 'middle', 'alphabetic',\n * 'hanging', 'ideographic'.\n * @property {import(\"./Fill.js\").default} [fill] Fill style. If none is provided, we'll use a dark fill-style (#333).\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {import(\"./Fill.js\").default} [backgroundFill] Fill style for the text background when `placement` is\n * `'point'`. Default is no fill.\n * @property {import(\"./Stroke.js\").default} [backgroundStroke] Stroke style for the text background when `placement`\n * is `'point'`. Default is no stroke.\n * @property {Array<number>} [padding=[0, 0, 0, 0]] Padding in pixels around the text for decluttering and background. The order of\n * values in the array is `[top, right, bottom, left]`.\n */\n/**\n * @classdesc\n * Set text style for vector features.\n * @api\n */\nvar Text = /** @class */ (function () {\n /**\n * @param {Options=} opt_options Options.\n */\n function Text(opt_options) {\n var options = opt_options || {};\n /**\n * @private\n * @type {string|undefined}\n */\n this.font_ = options.font;\n /**\n * @private\n * @type {number|undefined}\n */\n this.rotation_ = options.rotation;\n /**\n * @private\n * @type {boolean|undefined}\n */\n this.rotateWithView_ = options.rotateWithView;\n /**\n * @private\n * @type {number|undefined}\n */\n this.scale_ = options.scale;\n /**\n * @private\n * @type {string|undefined}\n */\n this.text_ = options.text;\n /**\n * @private\n * @type {string|undefined}\n */\n this.textAlign_ = options.textAlign;\n /**\n * @private\n * @type {string|undefined}\n */\n this.textBaseline_ = options.textBaseline;\n /**\n * @private\n * @type {import(\"./Fill.js\").default}\n */\n this.fill_ = options.fill !== undefined ? options.fill :\n new Fill({ color: DEFAULT_FILL_COLOR });\n /**\n * @private\n * @type {number}\n */\n this.maxAngle_ = options.maxAngle !== undefined ? options.maxAngle : Math.PI / 4;\n /**\n * @private\n * @type {import(\"./TextPlacement.js\").default|string}\n */\n this.placement_ = options.placement !== undefined ? options.placement : TextPlacement.POINT;\n /**\n * @private\n * @type {boolean}\n */\n this.overflow_ = !!options.overflow;\n /**\n * @private\n * @type {import(\"./Stroke.js\").default}\n */\n this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n /**\n * @private\n * @type {number}\n */\n this.offsetX_ = options.offsetX !== undefined ? options.offsetX : 0;\n /**\n * @private\n * @type {number}\n */\n this.offsetY_ = options.offsetY !== undefined ? options.offsetY : 0;\n /**\n * @private\n * @type {import(\"./Fill.js\").default}\n */\n this.backgroundFill_ = options.backgroundFill ? options.backgroundFill : null;\n /**\n * @private\n * @type {import(\"./Stroke.js\").default}\n */\n this.backgroundStroke_ = options.backgroundStroke ? options.backgroundStroke : null;\n /**\n * @private\n * @type {Array<number>}\n */\n this.padding_ = options.padding === undefined ? null : options.padding;\n }\n /**\n * Clones the style.\n * @return {Text} The cloned style.\n * @api\n */\n Text.prototype.clone = function () {\n return new Text({\n font: this.getFont(),\n placement: this.getPlacement(),\n maxAngle: this.getMaxAngle(),\n overflow: this.getOverflow(),\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n scale: this.getScale(),\n text: this.getText(),\n textAlign: this.getTextAlign(),\n textBaseline: this.getTextBaseline(),\n fill: this.getFill() ? this.getFill().clone() : undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n offsetX: this.getOffsetX(),\n offsetY: this.getOffsetY(),\n backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : undefined,\n backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : undefined,\n padding: this.getPadding()\n });\n };\n /**\n * Get the `overflow` configuration.\n * @return {boolean} Let text overflow the length of the path they follow.\n * @api\n */\n Text.prototype.getOverflow = function () {\n return this.overflow_;\n };\n /**\n * Get the font name.\n * @return {string|undefined} Font.\n * @api\n */\n Text.prototype.getFont = function () {\n return this.font_;\n };\n /**\n * Get the maximum angle between adjacent characters.\n * @return {number} Angle in radians.\n * @api\n */\n Text.prototype.getMaxAngle = function () {\n return this.maxAngle_;\n };\n /**\n * Get the label placement.\n * @return {import(\"./TextPlacement.js\").default|string} Text placement.\n * @api\n */\n Text.prototype.getPlacement = function () {\n return this.placement_;\n };\n /**\n * Get the x-offset for the text.\n * @return {number} Horizontal text offset.\n * @api\n */\n Text.prototype.getOffsetX = function () {\n return this.offsetX_;\n };\n /**\n * Get the y-offset for the text.\n * @return {number} Vertical text offset.\n * @api\n */\n Text.prototype.getOffsetY = function () {\n return this.offsetY_;\n };\n /**\n * Get the fill style for the text.\n * @return {import(\"./Fill.js\").default} Fill style.\n * @api\n */\n Text.prototype.getFill = function () {\n return this.fill_;\n };\n /**\n * Determine whether the text rotates with the map.\n * @return {boolean|undefined} Rotate with map.\n * @api\n */\n Text.prototype.getRotateWithView = function () {\n return this.rotateWithView_;\n };\n /**\n * Get the text rotation.\n * @return {number|undefined} Rotation.\n * @api\n */\n Text.prototype.getRotation = function () {\n return this.rotation_;\n };\n /**\n * Get the text scale.\n * @return {number|undefined} Scale.\n * @api\n */\n Text.prototype.getScale = function () {\n return this.scale_;\n };\n /**\n * Get the stroke style for the text.\n * @return {import(\"./Stroke.js\").default} Stroke style.\n * @api\n */\n Text.prototype.getStroke = function () {\n return this.stroke_;\n };\n /**\n * Get the text to be rendered.\n * @return {string|undefined} Text.\n * @api\n */\n Text.prototype.getText = function () {\n return this.text_;\n };\n /**\n * Get the text alignment.\n * @return {string|undefined} Text align.\n * @api\n */\n Text.prototype.getTextAlign = function () {\n return this.textAlign_;\n };\n /**\n * Get the text baseline.\n * @return {string|undefined} Text baseline.\n * @api\n */\n Text.prototype.getTextBaseline = function () {\n return this.textBaseline_;\n };\n /**\n * Get the background fill style for the text.\n * @return {import(\"./Fill.js\").default} Fill style.\n * @api\n */\n Text.prototype.getBackgroundFill = function () {\n return this.backgroundFill_;\n };\n /**\n * Get the background stroke style for the text.\n * @return {import(\"./Stroke.js\").default} Stroke style.\n * @api\n */\n Text.prototype.getBackgroundStroke = function () {\n return this.backgroundStroke_;\n };\n /**\n * Get the padding for the text.\n * @return {Array<number>} Padding.\n * @api\n */\n Text.prototype.getPadding = function () {\n return this.padding_;\n };\n /**\n * Set the `overflow` property.\n *\n * @param {boolean} overflow Let text overflow the path that it follows.\n * @api\n */\n Text.prototype.setOverflow = function (overflow) {\n this.overflow_ = overflow;\n };\n /**\n * Set the font.\n *\n * @param {string|undefined} font Font.\n * @api\n */\n Text.prototype.setFont = function (font) {\n this.font_ = font;\n };\n /**\n * Set the maximum angle between adjacent characters.\n *\n * @param {number} maxAngle Angle in radians.\n * @api\n */\n Text.prototype.setMaxAngle = function (maxAngle) {\n this.maxAngle_ = maxAngle;\n };\n /**\n * Set the x offset.\n *\n * @param {number} offsetX Horizontal text offset.\n * @api\n */\n Text.prototype.setOffsetX = function (offsetX) {\n this.offsetX_ = offsetX;\n };\n /**\n * Set the y offset.\n *\n * @param {number} offsetY Vertical text offset.\n * @api\n */\n Text.prototype.setOffsetY = function (offsetY) {\n this.offsetY_ = offsetY;\n };\n /**\n * Set the text placement.\n *\n * @param {import(\"./TextPlacement.js\").default|string} placement Placement.\n * @api\n */\n Text.prototype.setPlacement = function (placement) {\n this.placement_ = placement;\n };\n /**\n * Set whether to rotate the text with the view.\n *\n * @param {boolean} rotateWithView Rotate with map.\n * @api\n */\n Text.prototype.setRotateWithView = function (rotateWithView) {\n this.rotateWithView_ = rotateWithView;\n };\n /**\n * Set the fill.\n *\n * @param {import(\"./Fill.js\").default} fill Fill style.\n * @api\n */\n Text.prototype.setFill = function (fill) {\n this.fill_ = fill;\n };\n /**\n * Set the rotation.\n *\n * @param {number|undefined} rotation Rotation.\n * @api\n */\n Text.prototype.setRotation = function (rotation) {\n this.rotation_ = rotation;\n };\n /**\n * Set the scale.\n *\n * @param {number|undefined} scale Scale.\n * @api\n */\n Text.prototype.setScale = function (scale) {\n this.scale_ = scale;\n };\n /**\n * Set the stroke.\n *\n * @param {import(\"./Stroke.js\").default} stroke Stroke style.\n * @api\n */\n Text.prototype.setStroke = function (stroke) {\n this.stroke_ = stroke;\n };\n /**\n * Set the text.\n *\n * @param {string|undefined} text Text.\n * @api\n */\n Text.prototype.setText = function (text) {\n this.text_ = text;\n };\n /**\n * Set the text alignment.\n *\n * @param {string|undefined} textAlign Text align.\n * @api\n */\n Text.prototype.setTextAlign = function (textAlign) {\n this.textAlign_ = textAlign;\n };\n /**\n * Set the text baseline.\n *\n * @param {string|undefined} textBaseline Text baseline.\n * @api\n */\n Text.prototype.setTextBaseline = function (textBaseline) {\n this.textBaseline_ = textBaseline;\n };\n /**\n * Set the background fill.\n *\n * @param {import(\"./Fill.js\").default} fill Fill style.\n * @api\n */\n Text.prototype.setBackgroundFill = function (fill) {\n this.backgroundFill_ = fill;\n };\n /**\n * Set the background stroke.\n *\n * @param {import(\"./Stroke.js\").default} stroke Stroke style.\n * @api\n */\n Text.prototype.setBackgroundStroke = function (stroke) {\n this.backgroundStroke_ = stroke;\n };\n /**\n * Set the padding (`[top, right, bottom, left]`).\n *\n * @param {!Array<number>} padding Padding.\n * @api\n */\n Text.prototype.setPadding = function (padding) {\n this.padding_ = padding;\n };\n return Text;\n}());\nexport default Text;\n//# sourceMappingURL=Text.js.map","/**\n * @module ol/tileurlfunction\n */\nimport { assert } from './asserts.js';\nimport { modulo } from './math.js';\nimport { hash as tileCoordHash } from './tilecoord.js';\n/**\n * @param {string} template Template.\n * @param {import(\"./tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @return {import(\"./Tile.js\").UrlFunction} Tile URL function.\n */\nexport function createFromTemplate(template, tileGrid) {\n var zRegEx = /\\{z\\}/g;\n var xRegEx = /\\{x\\}/g;\n var yRegEx = /\\{y\\}/g;\n var dashYRegEx = /\\{-y\\}/g;\n return (\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile Coordinate.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {string|undefined} Tile URL.\n */\n function (tileCoord, pixelRatio, projection) {\n if (!tileCoord) {\n return undefined;\n }\n else {\n return template.replace(zRegEx, tileCoord[0].toString())\n .replace(xRegEx, tileCoord[1].toString())\n .replace(yRegEx, tileCoord[2].toString())\n .replace(dashYRegEx, function () {\n var z = tileCoord[0];\n var range = tileGrid.getFullTileRange(z);\n assert(range, 55); // The {-y} placeholder requires a tile grid with extent\n var y = range.getHeight() - tileCoord[2] - 1;\n return y.toString();\n });\n }\n });\n}\n/**\n * @param {Array<string>} templates Templates.\n * @param {import(\"./tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @return {import(\"./Tile.js\").UrlFunction} Tile URL function.\n */\nexport function createFromTemplates(templates, tileGrid) {\n var len = templates.length;\n var tileUrlFunctions = new Array(len);\n for (var i = 0; i < len; ++i) {\n tileUrlFunctions[i] = createFromTemplate(templates[i], tileGrid);\n }\n return createFromTileUrlFunctions(tileUrlFunctions);\n}\n/**\n * @param {Array<import(\"./Tile.js\").UrlFunction>} tileUrlFunctions Tile URL Functions.\n * @return {import(\"./Tile.js\").UrlFunction} Tile URL function.\n */\nexport function createFromTileUrlFunctions(tileUrlFunctions) {\n if (tileUrlFunctions.length === 1) {\n return tileUrlFunctions[0];\n }\n return (\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile Coordinate.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {string|undefined} Tile URL.\n */\n function (tileCoord, pixelRatio, projection) {\n if (!tileCoord) {\n return undefined;\n }\n else {\n var h = tileCoordHash(tileCoord);\n var index = modulo(h, tileUrlFunctions.length);\n return tileUrlFunctions[index](tileCoord, pixelRatio, projection);\n }\n });\n}\n/**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {string|undefined} Tile URL.\n */\nexport function nullTileUrlFunction(tileCoord, pixelRatio, projection) {\n return undefined;\n}\n/**\n * @param {string} url URL.\n * @return {Array<string>} Array of urls.\n */\nexport function expandUrl(url) {\n var urls = [];\n var match = /\\{([a-z])-([a-z])\\}/.exec(url);\n if (match) {\n // char range\n var startCharCode = match[1].charCodeAt(0);\n var stopCharCode = match[2].charCodeAt(0);\n var charCode = void 0;\n for (charCode = startCharCode; charCode <= stopCharCode; ++charCode) {\n urls.push(url.replace(match[0], String.fromCharCode(charCode)));\n }\n return urls;\n }\n match = /\\{(\\d+)-(\\d+)\\}/.exec(url);\n if (match) {\n // number range\n var stop_1 = parseInt(match[2], 10);\n for (var i = parseInt(match[1], 10); i <= stop_1; i++) {\n urls.push(url.replace(match[0], i.toString()));\n }\n return urls;\n }\n urls.push(url);\n return urls;\n}\n//# sourceMappingURL=tileurlfunction.js.map","/**\n * @module ol/net\n */\nimport { getUid } from './util.js';\n/**\n * Simple JSONP helper. Supports error callbacks and a custom callback param.\n * The error callback will be called when no JSONP is executed after 10 seconds.\n *\n * @param {string} url Request url. A 'callback' query parameter will be\n * appended.\n * @param {Function} callback Callback on success.\n * @param {function()=} opt_errback Callback on error.\n * @param {string=} opt_callbackParam Custom query parameter for the JSONP\n * callback. Default is 'callback'.\n */\nexport function jsonp(url, callback, opt_errback, opt_callbackParam) {\n var script = document.createElement('script');\n var key = 'olc_' + getUid(callback);\n function cleanup() {\n delete window[key];\n script.parentNode.removeChild(script);\n }\n script.async = true;\n script.src = url + (url.indexOf('?') == -1 ? '?' : '&') +\n (opt_callbackParam || 'callback') + '=' + key;\n var timer = setTimeout(function () {\n cleanup();\n if (opt_errback) {\n opt_errback();\n }\n }, 10000);\n window[key] = function (data) {\n clearTimeout(timer);\n cleanup();\n callback(data);\n };\n document.getElementsByTagName('head')[0].appendChild(script);\n}\n//# sourceMappingURL=net.js.map","/**\n * @module ol/reproj/common\n */\n/**\n * Default maximum allowed threshold (in pixels) for reprojection\n * triangulation.\n * @type {number}\n */\nexport var ERROR_THRESHOLD = 0.5;\n/**\n * Enable automatic reprojection of raster sources. Default is `true`.\n * TODO: decide if we want to expose this as a build flag or remove it\n * @type {boolean}\n */\nexport var ENABLE_RASTER_REPROJECTION = true;\n//# sourceMappingURL=common.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Tile\n */\nimport TileState from './TileState.js';\nimport { easeIn } from './easing.js';\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport { abstract } from './util.js';\n/**\n * A function that takes an {@link module:ol/Tile} for the tile and a\n * `{string}` for the url as arguments. The default is\n * ```js\n * source.setTileLoadFunction(function(tile, src) {\n * tile.getImage().src = src;\n * });\n * ```\n * For more fine grained control, the load function can use fetch or XMLHttpRequest and involve\n * error handling:\n *\n * ```js\n * import TileState from 'ol/TileState';\n *\n * source.setTileLoadFunction(function(tile, src) {\n * var xhr = new XMLHttpRequest();\n * xhr.responseType = 'blob';\n * xhr.addEventListener('loadend', function (evt) {\n * var data = this.response;\n * if (data !== undefined) {\n * tile.getImage().src = URL.createObjectURL(data);\n * } else {\n * tile.setState(TileState.ERROR);\n * }\n * });\n * xhr.addEventListener('error', function () {\n * tile.setState(TileState.ERROR);\n * });\n * xhr.open('GET', src);\n * xhr.send();\n * });\n * ```\n *\n * @typedef {function(Tile, string): void} LoadFunction\n * @api\n */\n/**\n * {@link module:ol/source/Tile~Tile} sources use a function of this type to get\n * the url that provides a tile for a given tile coordinate.\n *\n * This function takes an {@link module:ol/tilecoord~TileCoord} for the tile\n * coordinate, a `{number}` representing the pixel ratio and a\n * {@link module:ol/proj/Projection} for the projection as arguments\n * and returns a `{string}` representing the tile URL, or undefined if no tile\n * should be requested for the passed tile coordinate.\n *\n * @typedef {function(import(\"./tilecoord.js\").TileCoord, number,\n * import(\"./proj/Projection.js\").default): (string|undefined)} UrlFunction\n * @api\n */\n/**\n * @typedef {Object} Options\n * @property {number} [transition=250] A duration for tile opacity\n * transitions in milliseconds. A duration of 0 disables the opacity transition.\n * @api\n */\n/**\n * @classdesc\n * Base class for tiles.\n *\n * @abstract\n */\nvar Tile = /** @class */ (function (_super) {\n __extends(Tile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {TileState} state State.\n * @param {Options=} opt_options Tile options.\n */\n function Tile(tileCoord, state, opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @type {import(\"./tilecoord.js\").TileCoord}\n */\n _this.tileCoord = tileCoord;\n /**\n * @protected\n * @type {TileState}\n */\n _this.state = state;\n /**\n * An \"interim\" tile for this tile. The interim tile may be used while this\n * one is loading, for \"smooth\" transitions when changing params/dimensions\n * on the source.\n * @type {Tile}\n */\n _this.interimTile = null;\n /**\n * The tile is available at the highest possible resolution. Subclasses can\n * set this to `false` initially. Tile load listeners will not be\n * unregistered before this is set to `true` and a `#changed()` is called.\n * @type {boolean}\n */\n _this.hifi = true;\n /**\n * A key assigned to the tile. This is used by the tile source to determine\n * if this tile can effectively be used, or if a new tile should be created\n * and this one be used as an interim tile for this new tile.\n * @type {string}\n */\n _this.key = '';\n /**\n * The duration for the opacity transition.\n * @type {number}\n */\n _this.transition_ = options.transition === undefined ? 250 : options.transition;\n /**\n * Lookup of start times for rendering transitions. If the start time is\n * equal to -1, the transition is complete.\n * @type {Object<string, number>}\n */\n _this.transitionStarts_ = {};\n return _this;\n }\n /**\n * @protected\n */\n Tile.prototype.changed = function () {\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * @inheritDoc\n */\n Tile.prototype.disposeInternal = function () {\n this.setState(TileState.ABORT);\n };\n /**\n * @return {string} Key.\n */\n Tile.prototype.getKey = function () {\n return this.key + '/' + this.tileCoord;\n };\n /**\n * Get the interim tile most suitable for rendering using the chain of interim\n * tiles. This corresponds to the most recent tile that has been loaded, if no\n * such tile exists, the original tile is returned.\n * @return {!Tile} Best tile for rendering.\n */\n Tile.prototype.getInterimTile = function () {\n if (!this.interimTile) {\n //empty chain\n return this;\n }\n var tile = this.interimTile;\n // find the first loaded tile and return it. Since the chain is sorted in\n // decreasing order of creation time, there is no need to search the remainder\n // of the list (all those tiles correspond to older requests and will be\n // cleaned up by refreshInterimChain)\n do {\n if (tile.getState() == TileState.LOADED) {\n // Show tile immediately instead of fading it in after loading, because\n // the interim tile is in place already\n this.transition_ = 0;\n return tile;\n }\n tile = tile.interimTile;\n } while (tile);\n // we can not find a better tile\n return this;\n };\n /**\n * Goes through the chain of interim tiles and discards sections of the chain\n * that are no longer relevant.\n */\n Tile.prototype.refreshInterimChain = function () {\n if (!this.interimTile) {\n return;\n }\n var tile = this.interimTile;\n var prev = /** @type {Tile} */ (this);\n do {\n if (tile.getState() == TileState.LOADED) {\n //we have a loaded tile, we can discard the rest of the list\n //we would could abort any LOADING tile request\n //older than this tile (i.e. any LOADING tile following this entry in the chain)\n tile.interimTile = null;\n break;\n }\n else if (tile.getState() == TileState.LOADING) {\n //keep this LOADING tile any loaded tiles later in the chain are\n //older than this tile, so we're still interested in the request\n prev = tile;\n }\n else if (tile.getState() == TileState.IDLE) {\n //the head of the list is the most current tile, we don't need\n //to start any other requests for this chain\n prev.interimTile = tile.interimTile;\n }\n else {\n prev = tile;\n }\n tile = prev.interimTile;\n } while (tile);\n };\n /**\n * Get the tile coordinate for this tile.\n * @return {import(\"./tilecoord.js\").TileCoord} The tile coordinate.\n * @api\n */\n Tile.prototype.getTileCoord = function () {\n return this.tileCoord;\n };\n /**\n * @return {TileState} State.\n */\n Tile.prototype.getState = function () {\n return this.state;\n };\n /**\n * Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,\n * it is important to set the state correctly to {@link module:ol/TileState~ERROR}\n * when the tile cannot be loaded. Otherwise the tile cannot be removed from\n * the tile queue and will block other requests.\n * @param {TileState} state State.\n * @api\n */\n Tile.prototype.setState = function (state) {\n if (this.state !== TileState.ERROR && this.state > state) {\n throw new Error('Tile load sequence violation');\n }\n this.state = state;\n this.changed();\n };\n /**\n * Load the image or retry if loading previously failed.\n * Loading is taken care of by the tile queue, and calling this method is\n * only needed for preloading or for reloading in case of an error.\n * @abstract\n * @api\n */\n Tile.prototype.load = function () {\n abstract();\n };\n /**\n * Get the alpha value for rendering.\n * @param {string} id An id for the renderer.\n * @param {number} time The render frame time.\n * @return {number} A number between 0 and 1.\n */\n Tile.prototype.getAlpha = function (id, time) {\n if (!this.transition_) {\n return 1;\n }\n var start = this.transitionStarts_[id];\n if (!start) {\n start = time;\n this.transitionStarts_[id] = start;\n }\n else if (start === -1) {\n return 1;\n }\n var delta = time - start + (1000 / 60); // avoid rendering at 0\n if (delta >= this.transition_) {\n return 1;\n }\n return easeIn(delta / this.transition_);\n };\n /**\n * Determine if a tile is in an alpha transition. A tile is considered in\n * transition if tile.getAlpha() has not yet been called or has been called\n * and returned 1.\n * @param {string} id An id for the renderer.\n * @return {boolean} The tile is in transition.\n */\n Tile.prototype.inTransition = function (id) {\n if (!this.transition_) {\n return false;\n }\n return this.transitionStarts_[id] !== -1;\n };\n /**\n * Mark a transition as complete.\n * @param {string} id An id for the renderer.\n */\n Tile.prototype.endTransition = function (id) {\n if (this.transition_) {\n this.transitionStarts_[id] = -1;\n }\n };\n return Tile;\n}(EventTarget));\nexport default Tile;\n//# sourceMappingURL=Tile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/ImageTile\n */\nimport Tile from './Tile.js';\nimport TileState from './TileState.js';\nimport { createCanvasContext2D } from './dom.js';\nimport { listenImage } from './Image.js';\nvar ImageTile = /** @class */ (function (_super) {\n __extends(ImageTile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {TileState} state State.\n * @param {string} src Image source URI.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"./Tile.js\").LoadFunction} tileLoadFunction Tile load function.\n * @param {import(\"./Tile.js\").Options=} opt_options Tile options.\n */\n function ImageTile(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {\n var _this = _super.call(this, tileCoord, state, opt_options) || this;\n /**\n * @private\n * @type {?string}\n */\n _this.crossOrigin_ = crossOrigin;\n /**\n * Image URI\n *\n * @private\n * @type {string}\n */\n _this.src_ = src;\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement}\n */\n _this.image_ = new Image();\n if (crossOrigin !== null) {\n _this.image_.crossOrigin = crossOrigin;\n }\n /**\n * @private\n * @type {?function():void}\n */\n _this.unlisten_ = null;\n /**\n * @private\n * @type {import(\"./Tile.js\").LoadFunction}\n */\n _this.tileLoadFunction_ = tileLoadFunction;\n return _this;\n }\n /**\n * @inheritDoc\n */\n ImageTile.prototype.disposeInternal = function () {\n if (this.state == TileState.LOADING) {\n this.unlistenImage_();\n this.image_ = getBlankImage();\n }\n if (this.interimTile) {\n this.interimTile.dispose();\n }\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Get the HTML image element for this tile (may be a Canvas, Image, or Video).\n * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.\n * @api\n */\n ImageTile.prototype.getImage = function () {\n return this.image_;\n };\n /**\n * @inheritDoc\n */\n ImageTile.prototype.getKey = function () {\n return this.src_;\n };\n /**\n * Tracks loading or read errors.\n *\n * @private\n */\n ImageTile.prototype.handleImageError_ = function () {\n this.state = TileState.ERROR;\n this.unlistenImage_();\n this.image_ = getBlankImage();\n this.changed();\n };\n /**\n * Tracks successful image load.\n *\n * @private\n */\n ImageTile.prototype.handleImageLoad_ = function () {\n var image = /** @type {HTMLImageElement} */ (this.image_);\n if (image.naturalWidth && image.naturalHeight) {\n this.state = TileState.LOADED;\n }\n else {\n this.state = TileState.EMPTY;\n }\n this.unlistenImage_();\n this.changed();\n };\n /**\n * @inheritDoc\n * @api\n */\n ImageTile.prototype.load = function () {\n if (this.state == TileState.ERROR) {\n this.state = TileState.IDLE;\n this.image_ = new Image();\n if (this.crossOrigin_ !== null) {\n this.image_.crossOrigin = this.crossOrigin_;\n }\n }\n if (this.state == TileState.IDLE) {\n this.state = TileState.LOADING;\n this.changed();\n this.tileLoadFunction_(this, this.src_);\n this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));\n }\n };\n /**\n * Discards event handlers which listen for load completion or errors.\n *\n * @private\n */\n ImageTile.prototype.unlistenImage_ = function () {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n };\n return ImageTile;\n}(Tile));\n/**\n * Get a 1-pixel blank image.\n * @return {HTMLCanvasElement} Blank image.\n */\nfunction getBlankImage() {\n var ctx = createCanvasContext2D(1, 1);\n ctx.fillStyle = 'rgba(0,0,0,0)';\n ctx.fillRect(0, 0, 1, 1);\n return ctx.canvas;\n}\nexport default ImageTile;\n//# sourceMappingURL=ImageTile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/TileCache\n */\nimport LRUCache from './structs/LRUCache.js';\nimport { fromKey, getKey } from './tilecoord.js';\nvar TileCache = /** @class */ (function (_super) {\n __extends(TileCache, _super);\n /**\n * @param {number=} opt_highWaterMark High water mark.\n */\n function TileCache(opt_highWaterMark) {\n return _super.call(this, opt_highWaterMark) || this;\n }\n /**\n * @param {!Object<string, import(\"./TileRange.js\").default>} usedTiles Used tiles.\n */\n TileCache.prototype.expireCache = function (usedTiles) {\n while (this.canExpireCache()) {\n var tile = this.peekLast();\n if (tile.getKey() in usedTiles) {\n break;\n }\n else {\n this.pop().dispose();\n }\n }\n };\n /**\n * Prune all tiles from the cache that don't have the same z as the newest tile.\n */\n TileCache.prototype.pruneExceptNewestZ = function () {\n if (this.getCount() === 0) {\n return;\n }\n var key = this.peekFirstKey();\n var tileCoord = fromKey(key);\n var z = tileCoord[0];\n this.forEach(function (tile) {\n if (tile.tileCoord[0] !== z) {\n this.remove(getKey(tile.tileCoord));\n tile.dispose();\n }\n }.bind(this));\n };\n return TileCache;\n}(LRUCache));\nexport default TileCache;\n//# sourceMappingURL=TileCache.js.map","/**\n * @module ol/reproj\n */\nimport { createCanvasContext2D } from './dom.js';\nimport { containsCoordinate, createEmpty, extend, getHeight, getTopLeft, getWidth } from './extent.js';\nimport { solveLinearSystem } from './math.js';\nimport { getPointResolution, transform } from './proj.js';\n/**\n * Calculates ideal resolution to use from the source in order to achieve\n * pixel mapping as close as possible to 1:1 during reprojection.\n * The resolution is calculated regardless of what resolutions\n * are actually available in the dataset (TileGrid, Image, ...).\n *\n * @param {import(\"./proj/Projection.js\").default} sourceProj Source projection.\n * @param {import(\"./proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"./coordinate.js\").Coordinate} targetCenter Target center.\n * @param {number} targetResolution Target resolution.\n * @return {number} The best resolution to use. Can be +-Infinity, NaN or 0.\n */\nexport function calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution) {\n var sourceCenter = transform(targetCenter, targetProj, sourceProj);\n // calculate the ideal resolution of the source data\n var sourceResolution = getPointResolution(targetProj, targetResolution, targetCenter);\n var targetMetersPerUnit = targetProj.getMetersPerUnit();\n if (targetMetersPerUnit !== undefined) {\n sourceResolution *= targetMetersPerUnit;\n }\n var sourceMetersPerUnit = sourceProj.getMetersPerUnit();\n if (sourceMetersPerUnit !== undefined) {\n sourceResolution /= sourceMetersPerUnit;\n }\n // Based on the projection properties, the point resolution at the specified\n // coordinates may be slightly different. We need to reverse-compensate this\n // in order to achieve optimal results.\n var sourceExtent = sourceProj.getExtent();\n if (!sourceExtent || containsCoordinate(sourceExtent, sourceCenter)) {\n var compensationFactor = getPointResolution(sourceProj, sourceResolution, sourceCenter) /\n sourceResolution;\n if (isFinite(compensationFactor) && compensationFactor > 0) {\n sourceResolution /= compensationFactor;\n }\n }\n return sourceResolution;\n}\n/**\n * Enlarge the clipping triangle point by 1 pixel to ensure the edges overlap\n * in order to mask gaps caused by antialiasing.\n *\n * @param {number} centroidX Centroid of the triangle (x coordinate in pixels).\n * @param {number} centroidY Centroid of the triangle (y coordinate in pixels).\n * @param {number} x X coordinate of the point (in pixels).\n * @param {number} y Y coordinate of the point (in pixels).\n * @return {import(\"./coordinate.js\").Coordinate} New point 1 px farther from the centroid.\n */\nfunction enlargeClipPoint(centroidX, centroidY, x, y) {\n var dX = x - centroidX;\n var dY = y - centroidY;\n var distance = Math.sqrt(dX * dX + dY * dY);\n return [Math.round(x + dX / distance), Math.round(y + dY / distance)];\n}\n/**\n * Renders the source data into new canvas based on the triangulation.\n *\n * @param {number} width Width of the canvas.\n * @param {number} height Height of the canvas.\n * @param {number} pixelRatio Pixel ratio.\n * @param {number} sourceResolution Source resolution.\n * @param {import(\"./extent.js\").Extent} sourceExtent Extent of the data source.\n * @param {number} targetResolution Target resolution.\n * @param {import(\"./extent.js\").Extent} targetExtent Target extent.\n * @param {import(\"./reproj/Triangulation.js\").default} triangulation\n * Calculated triangulation.\n * @param {Array<{extent: import(\"./extent.js\").Extent,\n * image: (HTMLCanvasElement|HTMLImageElement|HTMLVideoElement)}>} sources\n * Array of sources.\n * @param {number} gutter Gutter of the sources.\n * @param {boolean=} opt_renderEdges Render reprojection edges.\n * @return {HTMLCanvasElement} Canvas with reprojected data.\n */\nexport function render(width, height, pixelRatio, sourceResolution, sourceExtent, targetResolution, targetExtent, triangulation, sources, gutter, opt_renderEdges) {\n var context = createCanvasContext2D(Math.round(pixelRatio * width), Math.round(pixelRatio * height));\n if (sources.length === 0) {\n return context.canvas;\n }\n context.scale(pixelRatio, pixelRatio);\n var sourceDataExtent = createEmpty();\n sources.forEach(function (src, i, arr) {\n extend(sourceDataExtent, src.extent);\n });\n var canvasWidthInUnits = getWidth(sourceDataExtent);\n var canvasHeightInUnits = getHeight(sourceDataExtent);\n var stitchContext = createCanvasContext2D(Math.round(pixelRatio * canvasWidthInUnits / sourceResolution), Math.round(pixelRatio * canvasHeightInUnits / sourceResolution));\n var stitchScale = pixelRatio / sourceResolution;\n sources.forEach(function (src, i, arr) {\n var xPos = src.extent[0] - sourceDataExtent[0];\n var yPos = -(src.extent[3] - sourceDataExtent[3]);\n var srcWidth = getWidth(src.extent);\n var srcHeight = getHeight(src.extent);\n stitchContext.drawImage(src.image, gutter, gutter, src.image.width - 2 * gutter, src.image.height - 2 * gutter, xPos * stitchScale, yPos * stitchScale, srcWidth * stitchScale, srcHeight * stitchScale);\n });\n var targetTopLeft = getTopLeft(targetExtent);\n triangulation.getTriangles().forEach(function (triangle, i, arr) {\n /* Calculate affine transform (src -> dst)\n * Resulting matrix can be used to transform coordinate\n * from `sourceProjection` to destination pixels.\n *\n * To optimize number of context calls and increase numerical stability,\n * we also do the following operations:\n * trans(-topLeftExtentCorner), scale(1 / targetResolution), scale(1, -1)\n * here before solving the linear system so [ui, vi] are pixel coordinates.\n *\n * Src points: xi, yi\n * Dst points: ui, vi\n * Affine coefficients: aij\n *\n * | x0 y0 1 0 0 0 | |a00| |u0|\n * | x1 y1 1 0 0 0 | |a01| |u1|\n * | x2 y2 1 0 0 0 | x |a02| = |u2|\n * | 0 0 0 x0 y0 1 | |a10| |v0|\n * | 0 0 0 x1 y1 1 | |a11| |v1|\n * | 0 0 0 x2 y2 1 | |a12| |v2|\n */\n var source = triangle.source;\n var target = triangle.target;\n var x0 = source[0][0], y0 = source[0][1];\n var x1 = source[1][0], y1 = source[1][1];\n var x2 = source[2][0], y2 = source[2][1];\n var u0 = (target[0][0] - targetTopLeft[0]) / targetResolution;\n var v0 = -(target[0][1] - targetTopLeft[1]) / targetResolution;\n var u1 = (target[1][0] - targetTopLeft[0]) / targetResolution;\n var v1 = -(target[1][1] - targetTopLeft[1]) / targetResolution;\n var u2 = (target[2][0] - targetTopLeft[0]) / targetResolution;\n var v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution;\n // Shift all the source points to improve numerical stability\n // of all the subsequent calculations. The [x0, y0] is used here.\n // This is also used to simplify the linear system.\n var sourceNumericalShiftX = x0;\n var sourceNumericalShiftY = y0;\n x0 = 0;\n y0 = 0;\n x1 -= sourceNumericalShiftX;\n y1 -= sourceNumericalShiftY;\n x2 -= sourceNumericalShiftX;\n y2 -= sourceNumericalShiftY;\n var augmentedMatrix = [\n [x1, y1, 0, 0, u1 - u0],\n [x2, y2, 0, 0, u2 - u0],\n [0, 0, x1, y1, v1 - v0],\n [0, 0, x2, y2, v2 - v0]\n ];\n var affineCoefs = solveLinearSystem(augmentedMatrix);\n if (!affineCoefs) {\n return;\n }\n context.save();\n context.beginPath();\n var centroidX = (u0 + u1 + u2) / 3;\n var centroidY = (v0 + v1 + v2) / 3;\n var p0 = enlargeClipPoint(centroidX, centroidY, u0, v0);\n var p1 = enlargeClipPoint(centroidX, centroidY, u1, v1);\n var p2 = enlargeClipPoint(centroidX, centroidY, u2, v2);\n context.moveTo(p1[0], p1[1]);\n context.lineTo(p0[0], p0[1]);\n context.lineTo(p2[0], p2[1]);\n context.clip();\n context.transform(affineCoefs[0], affineCoefs[2], affineCoefs[1], affineCoefs[3], u0, v0);\n context.translate(sourceDataExtent[0] - sourceNumericalShiftX, sourceDataExtent[3] - sourceNumericalShiftY);\n context.scale(sourceResolution / pixelRatio, -sourceResolution / pixelRatio);\n context.drawImage(stitchContext.canvas, 0, 0);\n context.restore();\n });\n if (opt_renderEdges) {\n context.save();\n context.strokeStyle = 'black';\n context.lineWidth = 1;\n triangulation.getTriangles().forEach(function (triangle, i, arr) {\n var target = triangle.target;\n var u0 = (target[0][0] - targetTopLeft[0]) / targetResolution;\n var v0 = -(target[0][1] - targetTopLeft[1]) / targetResolution;\n var u1 = (target[1][0] - targetTopLeft[0]) / targetResolution;\n var v1 = -(target[1][1] - targetTopLeft[1]) / targetResolution;\n var u2 = (target[2][0] - targetTopLeft[0]) / targetResolution;\n var v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution;\n context.beginPath();\n context.moveTo(u1, v1);\n context.lineTo(u0, v0);\n context.lineTo(u2, v2);\n context.closePath();\n context.stroke();\n });\n context.restore();\n }\n return context.canvas;\n}\n//# sourceMappingURL=reproj.js.map","/**\n * @module ol/reproj/Triangulation\n */\nimport { boundingExtent, createEmpty, extendCoordinate, getBottomLeft, getBottomRight, getTopLeft, getTopRight, getWidth, intersects } from '../extent.js';\nimport { modulo } from '../math.js';\nimport { getTransform } from '../proj.js';\n/**\n * Single triangle; consists of 3 source points and 3 target points.\n * @typedef {Object} Triangle\n * @property {Array<import(\"../coordinate.js\").Coordinate>} source\n * @property {Array<import(\"../coordinate.js\").Coordinate>} target\n */\n/**\n * Maximum number of subdivision steps during raster reprojection triangulation.\n * Prevents high memory usage and large number of proj4 calls (for certain\n * transformations and areas). At most `2*(2^this)` triangles are created for\n * each triangulated extent (tile/image).\n * @type {number}\n */\nvar MAX_SUBDIVISION = 10;\n/**\n * Maximum allowed size of triangle relative to world width. When transforming\n * corners of world extent between certain projections, the resulting\n * triangulation seems to have zero error and no subdivision is performed. If\n * the triangle width is more than this (relative to world width; 0-1),\n * subdivison is forced (up to `MAX_SUBDIVISION`). Default is `0.25`.\n * @type {number}\n */\nvar MAX_TRIANGLE_WIDTH = 0.25;\n/**\n * @classdesc\n * Class containing triangulation of the given target extent.\n * Used for determining source data and the reprojection itself.\n */\nvar Triangulation = /** @class */ (function () {\n /**\n * @param {import(\"../proj/Projection.js\").default} sourceProj Source projection.\n * @param {import(\"../proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"../extent.js\").Extent} targetExtent Target extent to triangulate.\n * @param {import(\"../extent.js\").Extent} maxSourceExtent Maximal source extent that can be used.\n * @param {number} errorThreshold Acceptable error (in source units).\n */\n function Triangulation(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold) {\n /**\n * @type {import(\"../proj/Projection.js\").default}\n * @private\n */\n this.sourceProj_ = sourceProj;\n /**\n * @type {import(\"../proj/Projection.js\").default}\n * @private\n */\n this.targetProj_ = targetProj;\n /** @type {!Object<string, import(\"../coordinate.js\").Coordinate>} */\n var transformInvCache = {};\n var transformInv = getTransform(this.targetProj_, this.sourceProj_);\n /**\n * @param {import(\"../coordinate.js\").Coordinate} c A coordinate.\n * @return {import(\"../coordinate.js\").Coordinate} Transformed coordinate.\n * @private\n */\n this.transformInv_ = function (c) {\n var key = c[0] + '/' + c[1];\n if (!transformInvCache[key]) {\n transformInvCache[key] = transformInv(c);\n }\n return transformInvCache[key];\n };\n /**\n * @type {import(\"../extent.js\").Extent}\n * @private\n */\n this.maxSourceExtent_ = maxSourceExtent;\n /**\n * @type {number}\n * @private\n */\n this.errorThresholdSquared_ = errorThreshold * errorThreshold;\n /**\n * @type {Array<Triangle>}\n * @private\n */\n this.triangles_ = [];\n /**\n * Indicates that the triangulation crosses edge of the source projection.\n * @type {boolean}\n * @private\n */\n this.wrapsXInSource_ = false;\n /**\n * @type {boolean}\n * @private\n */\n this.canWrapXInSource_ = this.sourceProj_.canWrapX() &&\n !!maxSourceExtent &&\n !!this.sourceProj_.getExtent() &&\n (getWidth(maxSourceExtent) == getWidth(this.sourceProj_.getExtent()));\n /**\n * @type {?number}\n * @private\n */\n this.sourceWorldWidth_ = this.sourceProj_.getExtent() ?\n getWidth(this.sourceProj_.getExtent()) : null;\n /**\n * @type {?number}\n * @private\n */\n this.targetWorldWidth_ = this.targetProj_.getExtent() ?\n getWidth(this.targetProj_.getExtent()) : null;\n var destinationTopLeft = getTopLeft(targetExtent);\n var destinationTopRight = getTopRight(targetExtent);\n var destinationBottomRight = getBottomRight(targetExtent);\n var destinationBottomLeft = getBottomLeft(targetExtent);\n var sourceTopLeft = this.transformInv_(destinationTopLeft);\n var sourceTopRight = this.transformInv_(destinationTopRight);\n var sourceBottomRight = this.transformInv_(destinationBottomRight);\n var sourceBottomLeft = this.transformInv_(destinationBottomLeft);\n this.addQuad_(destinationTopLeft, destinationTopRight, destinationBottomRight, destinationBottomLeft, sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, MAX_SUBDIVISION);\n if (this.wrapsXInSource_) {\n var leftBound_1 = Infinity;\n this.triangles_.forEach(function (triangle, i, arr) {\n leftBound_1 = Math.min(leftBound_1, triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]);\n });\n // Shift triangles to be as close to `leftBound` as possible\n // (if the distance is more than `worldWidth / 2` it can be closer.\n this.triangles_.forEach(function (triangle) {\n if (Math.max(triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]) - leftBound_1 > this.sourceWorldWidth_ / 2) {\n var newTriangle = [[triangle.source[0][0], triangle.source[0][1]],\n [triangle.source[1][0], triangle.source[1][1]],\n [triangle.source[2][0], triangle.source[2][1]]];\n if ((newTriangle[0][0] - leftBound_1) > this.sourceWorldWidth_ / 2) {\n newTriangle[0][0] -= this.sourceWorldWidth_;\n }\n if ((newTriangle[1][0] - leftBound_1) > this.sourceWorldWidth_ / 2) {\n newTriangle[1][0] -= this.sourceWorldWidth_;\n }\n if ((newTriangle[2][0] - leftBound_1) > this.sourceWorldWidth_ / 2) {\n newTriangle[2][0] -= this.sourceWorldWidth_;\n }\n // Rarely (if the extent contains both the dateline and prime meridian)\n // the shift can in turn break some triangles.\n // Detect this here and don't shift in such cases.\n var minX = Math.min(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);\n var maxX = Math.max(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);\n if ((maxX - minX) < this.sourceWorldWidth_ / 2) {\n triangle.source = newTriangle;\n }\n }\n }.bind(this));\n }\n transformInvCache = {};\n }\n /**\n * Adds triangle to the triangulation.\n * @param {import(\"../coordinate.js\").Coordinate} a The target a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} b The target b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} c The target c coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} aSrc The source a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} bSrc The source b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} cSrc The source c coordinate.\n * @private\n */\n Triangulation.prototype.addTriangle_ = function (a, b, c, aSrc, bSrc, cSrc) {\n this.triangles_.push({\n source: [aSrc, bSrc, cSrc],\n target: [a, b, c]\n });\n };\n /**\n * Adds quad (points in clock-wise order) to the triangulation\n * (and reprojects the vertices) if valid.\n * Performs quad subdivision if needed to increase precision.\n *\n * @param {import(\"../coordinate.js\").Coordinate} a The target a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} b The target b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} c The target c coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} d The target d coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} aSrc The source a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} bSrc The source b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} cSrc The source c coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} dSrc The source d coordinate.\n * @param {number} maxSubdivision Maximal allowed subdivision of the quad.\n * @private\n */\n Triangulation.prototype.addQuad_ = function (a, b, c, d, aSrc, bSrc, cSrc, dSrc, maxSubdivision) {\n var sourceQuadExtent = boundingExtent([aSrc, bSrc, cSrc, dSrc]);\n var sourceCoverageX = this.sourceWorldWidth_ ?\n getWidth(sourceQuadExtent) / this.sourceWorldWidth_ : null;\n var sourceWorldWidth = /** @type {number} */ (this.sourceWorldWidth_);\n // when the quad is wrapped in the source projection\n // it covers most of the projection extent, but not fully\n var wrapsX = this.sourceProj_.canWrapX() &&\n sourceCoverageX > 0.5 && sourceCoverageX < 1;\n var needsSubdivision = false;\n if (maxSubdivision > 0) {\n if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {\n var targetQuadExtent = boundingExtent([a, b, c, d]);\n var targetCoverageX = getWidth(targetQuadExtent) / this.targetWorldWidth_;\n needsSubdivision = targetCoverageX > MAX_TRIANGLE_WIDTH ||\n needsSubdivision;\n }\n if (!wrapsX && this.sourceProj_.isGlobal() && sourceCoverageX) {\n needsSubdivision = sourceCoverageX > MAX_TRIANGLE_WIDTH ||\n needsSubdivision;\n }\n }\n if (!needsSubdivision && this.maxSourceExtent_) {\n if (!intersects(sourceQuadExtent, this.maxSourceExtent_)) {\n // whole quad outside source projection extent -> ignore\n return;\n }\n }\n if (!needsSubdivision) {\n if (!isFinite(aSrc[0]) || !isFinite(aSrc[1]) ||\n !isFinite(bSrc[0]) || !isFinite(bSrc[1]) ||\n !isFinite(cSrc[0]) || !isFinite(cSrc[1]) ||\n !isFinite(dSrc[0]) || !isFinite(dSrc[1])) {\n if (maxSubdivision > 0) {\n needsSubdivision = true;\n }\n else {\n return;\n }\n }\n }\n if (maxSubdivision > 0) {\n if (!needsSubdivision) {\n var center = [(a[0] + c[0]) / 2, (a[1] + c[1]) / 2];\n var centerSrc = this.transformInv_(center);\n var dx = void 0;\n if (wrapsX) {\n var centerSrcEstimX = (modulo(aSrc[0], sourceWorldWidth) +\n modulo(cSrc[0], sourceWorldWidth)) / 2;\n dx = centerSrcEstimX -\n modulo(centerSrc[0], sourceWorldWidth);\n }\n else {\n dx = (aSrc[0] + cSrc[0]) / 2 - centerSrc[0];\n }\n var dy = (aSrc[1] + cSrc[1]) / 2 - centerSrc[1];\n var centerSrcErrorSquared = dx * dx + dy * dy;\n needsSubdivision = centerSrcErrorSquared > this.errorThresholdSquared_;\n }\n if (needsSubdivision) {\n if (Math.abs(a[0] - c[0]) <= Math.abs(a[1] - c[1])) {\n // split horizontally (top & bottom)\n var bc = [(b[0] + c[0]) / 2, (b[1] + c[1]) / 2];\n var bcSrc = this.transformInv_(bc);\n var da = [(d[0] + a[0]) / 2, (d[1] + a[1]) / 2];\n var daSrc = this.transformInv_(da);\n this.addQuad_(a, b, bc, da, aSrc, bSrc, bcSrc, daSrc, maxSubdivision - 1);\n this.addQuad_(da, bc, c, d, daSrc, bcSrc, cSrc, dSrc, maxSubdivision - 1);\n }\n else {\n // split vertically (left & right)\n var ab = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];\n var abSrc = this.transformInv_(ab);\n var cd = [(c[0] + d[0]) / 2, (c[1] + d[1]) / 2];\n var cdSrc = this.transformInv_(cd);\n this.addQuad_(a, ab, cd, d, aSrc, abSrc, cdSrc, dSrc, maxSubdivision - 1);\n this.addQuad_(ab, b, c, cd, abSrc, bSrc, cSrc, cdSrc, maxSubdivision - 1);\n }\n return;\n }\n }\n if (wrapsX) {\n if (!this.canWrapXInSource_) {\n return;\n }\n this.wrapsXInSource_ = true;\n }\n this.addTriangle_(a, c, d, aSrc, cSrc, dSrc);\n this.addTriangle_(a, b, c, aSrc, bSrc, cSrc);\n };\n /**\n * Calculates extent of the 'source' coordinates from all the triangles.\n *\n * @return {import(\"../extent.js\").Extent} Calculated extent.\n */\n Triangulation.prototype.calculateSourceExtent = function () {\n var extent = createEmpty();\n this.triangles_.forEach(function (triangle, i, arr) {\n var src = triangle.source;\n extendCoordinate(extent, src[0]);\n extendCoordinate(extent, src[1]);\n extendCoordinate(extent, src[2]);\n });\n return extent;\n };\n /**\n * @return {Array<Triangle>} Array of the calculated triangles.\n */\n Triangulation.prototype.getTriangles = function () {\n return this.triangles_;\n };\n return Triangulation;\n}());\nexport default Triangulation;\n//# sourceMappingURL=Triangulation.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/reproj/Tile\n */\nimport { ERROR_THRESHOLD } from './common.js';\nimport Tile from '../Tile.js';\nimport TileState from '../TileState.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { getArea, getCenter, getIntersection } from '../extent.js';\nimport { clamp } from '../math.js';\nimport { calculateSourceResolution, render as renderReprojected } from '../reproj.js';\nimport Triangulation from './Triangulation.js';\n/**\n * @typedef {function(number, number, number, number) : import(\"../Tile.js\").default} FunctionType\n */\n/**\n * @classdesc\n * Class encapsulating single reprojected tile.\n * See {@link module:ol/source/TileImage~TileImage}.\n *\n */\nvar ReprojTile = /** @class */ (function (_super) {\n __extends(ReprojTile, _super);\n /**\n * @param {import(\"../proj/Projection.js\").default} sourceProj Source projection.\n * @param {import(\"../tilegrid/TileGrid.js\").default} sourceTileGrid Source tile grid.\n * @param {import(\"../proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"../tilegrid/TileGrid.js\").default} targetTileGrid Target tile grid.\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Coordinate of the tile.\n * @param {import(\"../tilecoord.js\").TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.\n * @param {number} pixelRatio Pixel ratio.\n * @param {number} gutter Gutter of the source tiles.\n * @param {FunctionType} getTileFunction\n * Function returning source tiles (z, x, y, pixelRatio).\n * @param {number=} opt_errorThreshold Acceptable reprojection error (in px).\n * @param {boolean=} opt_renderEdges Render reprojection edges.\n */\n function ReprojTile(sourceProj, sourceTileGrid, targetProj, targetTileGrid, tileCoord, wrappedTileCoord, pixelRatio, gutter, getTileFunction, opt_errorThreshold, opt_renderEdges) {\n var _this = _super.call(this, tileCoord, TileState.IDLE) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.renderEdges_ = opt_renderEdges !== undefined ? opt_renderEdges : false;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ = pixelRatio;\n /**\n * @private\n * @type {number}\n */\n _this.gutter_ = gutter;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = null;\n /**\n * @private\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n _this.sourceTileGrid_ = sourceTileGrid;\n /**\n * @private\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n _this.targetTileGrid_ = targetTileGrid;\n /**\n * @private\n * @type {import(\"../tilecoord.js\").TileCoord}\n */\n _this.wrappedTileCoord_ = wrappedTileCoord ? wrappedTileCoord : tileCoord;\n /**\n * @private\n * @type {!Array<import(\"../Tile.js\").default>}\n */\n _this.sourceTiles_ = [];\n /**\n * @private\n * @type {?Array<import(\"../events.js\").EventsKey>}\n */\n _this.sourcesListenerKeys_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.sourceZ_ = 0;\n var targetExtent = targetTileGrid.getTileCoordExtent(_this.wrappedTileCoord_);\n var maxTargetExtent = _this.targetTileGrid_.getExtent();\n var maxSourceExtent = _this.sourceTileGrid_.getExtent();\n var limitedTargetExtent = maxTargetExtent ?\n getIntersection(targetExtent, maxTargetExtent) : targetExtent;\n if (getArea(limitedTargetExtent) === 0) {\n // Tile is completely outside range -> EMPTY\n // TODO: is it actually correct that the source even creates the tile ?\n _this.state = TileState.EMPTY;\n return _this;\n }\n var sourceProjExtent = sourceProj.getExtent();\n if (sourceProjExtent) {\n if (!maxSourceExtent) {\n maxSourceExtent = sourceProjExtent;\n }\n else {\n maxSourceExtent = getIntersection(maxSourceExtent, sourceProjExtent);\n }\n }\n var targetResolution = targetTileGrid.getResolution(_this.wrappedTileCoord_[0]);\n var targetCenter = getCenter(limitedTargetExtent);\n var sourceResolution = calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution);\n if (!isFinite(sourceResolution) || sourceResolution <= 0) {\n // invalid sourceResolution -> EMPTY\n // probably edges of the projections when no extent is defined\n _this.state = TileState.EMPTY;\n return _this;\n }\n var errorThresholdInPixels = opt_errorThreshold !== undefined ?\n opt_errorThreshold : ERROR_THRESHOLD;\n /**\n * @private\n * @type {!import(\"./Triangulation.js\").default}\n */\n _this.triangulation_ = new Triangulation(sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, sourceResolution * errorThresholdInPixels);\n if (_this.triangulation_.getTriangles().length === 0) {\n // no valid triangles -> EMPTY\n _this.state = TileState.EMPTY;\n return _this;\n }\n _this.sourceZ_ = sourceTileGrid.getZForResolution(sourceResolution);\n var sourceExtent = _this.triangulation_.calculateSourceExtent();\n if (maxSourceExtent) {\n if (sourceProj.canWrapX()) {\n sourceExtent[1] = clamp(sourceExtent[1], maxSourceExtent[1], maxSourceExtent[3]);\n sourceExtent[3] = clamp(sourceExtent[3], maxSourceExtent[1], maxSourceExtent[3]);\n }\n else {\n sourceExtent = getIntersection(sourceExtent, maxSourceExtent);\n }\n }\n if (!getArea(sourceExtent)) {\n _this.state = TileState.EMPTY;\n }\n else {\n var sourceRange = sourceTileGrid.getTileRangeForExtentAndZ(sourceExtent, _this.sourceZ_);\n for (var srcX = sourceRange.minX; srcX <= sourceRange.maxX; srcX++) {\n for (var srcY = sourceRange.minY; srcY <= sourceRange.maxY; srcY++) {\n var tile = getTileFunction(_this.sourceZ_, srcX, srcY, pixelRatio);\n if (tile) {\n _this.sourceTiles_.push(tile);\n }\n }\n }\n if (_this.sourceTiles_.length === 0) {\n _this.state = TileState.EMPTY;\n }\n }\n return _this;\n }\n /**\n * @inheritDoc\n */\n ReprojTile.prototype.disposeInternal = function () {\n if (this.state == TileState.LOADING) {\n this.unlistenSources_();\n }\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Get the HTML Canvas element for this tile.\n * @return {HTMLCanvasElement} Canvas.\n */\n ReprojTile.prototype.getImage = function () {\n return this.canvas_;\n };\n /**\n * @private\n */\n ReprojTile.prototype.reproject_ = function () {\n var sources = [];\n this.sourceTiles_.forEach(function (tile, i, arr) {\n if (tile && tile.getState() == TileState.LOADED) {\n sources.push({\n extent: this.sourceTileGrid_.getTileCoordExtent(tile.tileCoord),\n image: tile.getImage()\n });\n }\n }.bind(this));\n this.sourceTiles_.length = 0;\n if (sources.length === 0) {\n this.state = TileState.ERROR;\n }\n else {\n var z = this.wrappedTileCoord_[0];\n var size = this.targetTileGrid_.getTileSize(z);\n var width = typeof size === 'number' ? size : size[0];\n var height = typeof size === 'number' ? size : size[1];\n var targetResolution = this.targetTileGrid_.getResolution(z);\n var sourceResolution = this.sourceTileGrid_.getResolution(this.sourceZ_);\n var targetExtent = this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);\n this.canvas_ = renderReprojected(width, height, this.pixelRatio_, sourceResolution, this.sourceTileGrid_.getExtent(), targetResolution, targetExtent, this.triangulation_, sources, this.gutter_, this.renderEdges_);\n this.state = TileState.LOADED;\n }\n this.changed();\n };\n /**\n * @inheritDoc\n */\n ReprojTile.prototype.load = function () {\n if (this.state == TileState.IDLE) {\n this.state = TileState.LOADING;\n this.changed();\n var leftToLoad_1 = 0;\n this.sourcesListenerKeys_ = [];\n this.sourceTiles_.forEach(function (tile, i, arr) {\n var state = tile.getState();\n if (state == TileState.IDLE || state == TileState.LOADING) {\n leftToLoad_1++;\n var sourceListenKey_1 = listen(tile, EventType.CHANGE, function (e) {\n var state = tile.getState();\n if (state == TileState.LOADED ||\n state == TileState.ERROR ||\n state == TileState.EMPTY) {\n unlistenByKey(sourceListenKey_1);\n leftToLoad_1--;\n if (leftToLoad_1 === 0) {\n this.unlistenSources_();\n this.reproject_();\n }\n }\n }, this);\n this.sourcesListenerKeys_.push(sourceListenKey_1);\n }\n }.bind(this));\n this.sourceTiles_.forEach(function (tile, i, arr) {\n var state = tile.getState();\n if (state == TileState.IDLE) {\n tile.load();\n }\n });\n if (leftToLoad_1 === 0) {\n setTimeout(this.reproject_.bind(this), 0);\n }\n }\n };\n /**\n * @private\n */\n ReprojTile.prototype.unlistenSources_ = function () {\n this.sourcesListenerKeys_.forEach(unlistenByKey);\n this.sourcesListenerKeys_ = null;\n };\n return ReprojTile;\n}(Tile));\nexport default ReprojTile;\n//# sourceMappingURL=Tile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/Source\n */\nimport { abstract } from '../util.js';\nimport BaseObject from '../Object.js';\nimport { get as getProjection } from '../proj.js';\nimport SourceState from './State.js';\n/**\n * A function that returns a string or an array of strings representing source\n * attributions.\n *\n * @typedef {function(import(\"../PluggableMap.js\").FrameState): (string|Array<string>)} Attribution\n */\n/**\n * A type that can be used to provide attribution information for data sources.\n *\n * It represents either\n * * a simple string (e.g. `'© Acme Inc.'`)\n * * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)\n * * a function that returns a string or array of strings ({@link module:ol/source/Source~Attribution})\n *\n * @typedef {string|Array<string>|Attribution} AttributionLike\n */\n/**\n * @typedef {Object} Options\n * @property {AttributionLike} [attributions]\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {SourceState} [state='ready']\n * @property {boolean} [wrapX=false]\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for {@link module:ol/layer/Layer~Layer} sources.\n *\n * A generic `change` event is triggered when the state of the source changes.\n * @abstract\n * @api\n */\nvar Source = /** @class */ (function (_super) {\n __extends(Source, _super);\n /**\n * @param {Options} options Source options.\n */\n function Source(options) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../proj/Projection.js\").default}\n */\n _this.projection_ = getProjection(options.projection);\n /**\n * @private\n * @type {?Attribution}\n */\n _this.attributions_ = adaptAttributions(options.attributions);\n /**\n * @private\n * @type {boolean}\n */\n _this.attributionsCollapsible_ = options.attributionsCollapsible !== undefined ?\n options.attributionsCollapsible : true;\n /**\n * This source is currently loading data. Sources that defer loading to the\n * map's tile queue never set this to `true`.\n * @type {boolean}\n */\n _this.loading = false;\n /**\n * @private\n * @type {SourceState}\n */\n _this.state_ = options.state !== undefined ?\n options.state : SourceState.READY;\n /**\n * @private\n * @type {boolean}\n */\n _this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;\n return _this;\n }\n /**\n * Get the attribution function for the source.\n * @return {?Attribution} Attribution function.\n */\n Source.prototype.getAttributions = function () {\n return this.attributions_;\n };\n /**\n * @return {boolean} Attributions are collapsible.\n */\n Source.prototype.getAttributionsCollapsible = function () {\n return this.attributionsCollapsible_;\n };\n /**\n * Get the projection of the source.\n * @return {import(\"../proj/Projection.js\").default} Projection.\n * @api\n */\n Source.prototype.getProjection = function () {\n return this.projection_;\n };\n /**\n * @abstract\n * @return {Array<number>|undefined} Resolutions.\n */\n Source.prototype.getResolutions = function () {\n return abstract();\n };\n /**\n * Get the state of the source, see {@link module:ol/source/State~State} for possible states.\n * @return {SourceState} State.\n * @api\n */\n Source.prototype.getState = function () {\n return this.state_;\n };\n /**\n * @return {boolean|undefined} Wrap X.\n */\n Source.prototype.getWrapX = function () {\n return this.wrapX_;\n };\n /**\n * Refreshes the source. The source will be cleared, and data from the server will be reloaded.\n * @api\n */\n Source.prototype.refresh = function () {\n this.changed();\n };\n /**\n * Set the attributions of the source.\n * @param {AttributionLike|undefined} attributions Attributions.\n * Can be passed as `string`, `Array<string>`, {@link module:ol/source/Source~Attribution},\n * or `undefined`.\n * @api\n */\n Source.prototype.setAttributions = function (attributions) {\n this.attributions_ = adaptAttributions(attributions);\n this.changed();\n };\n /**\n * Set the state of the source.\n * @param {SourceState} state State.\n * @protected\n */\n Source.prototype.setState = function (state) {\n this.state_ = state;\n this.changed();\n };\n return Source;\n}(BaseObject));\n/**\n * Turns the attributions option into an attributions function.\n * @param {AttributionLike|undefined} attributionLike The attribution option.\n * @return {?Attribution} An attribution function (or null).\n */\nfunction adaptAttributions(attributionLike) {\n if (!attributionLike) {\n return null;\n }\n if (Array.isArray(attributionLike)) {\n return function (frameState) {\n return attributionLike;\n };\n }\n if (typeof attributionLike === 'function') {\n return attributionLike;\n }\n return function (frameState) {\n return [attributionLike];\n };\n}\nexport default Source;\n//# sourceMappingURL=Source.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/Tile\n */\nimport { abstract } from '../util.js';\nimport TileCache from '../TileCache.js';\nimport TileState from '../TileState.js';\nimport Event from '../events/Event.js';\nimport { equivalent } from '../proj.js';\nimport { toSize, scale as scaleSize } from '../size.js';\nimport Source from './Source.js';\nimport { getKeyZXY, withinExtentAndZ } from '../tilecoord.js';\nimport { wrapX, getForProjection as getTileGridForProjection } from '../tilegrid.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions]\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {number} [cacheSize]\n * @property {boolean} [opaque]\n * @property {number} [tilePixelRatio]\n * @property {import(\"../proj.js\").ProjectionLike} [projection]\n * @property {import(\"./State.js\").default} [state]\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid]\n * @property {boolean} [wrapX=true]\n * @property {number} [transition]\n * @property {string} [key]\n * @property {number} [zDirection=0]\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for sources providing images divided into a tile grid.\n * @abstract\n * @api\n */\nvar TileSource = /** @class */ (function (_super) {\n __extends(TileSource, _super);\n /**\n * @param {Options} options SourceTile source options.\n */\n function TileSource(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n attributionsCollapsible: options.attributionsCollapsible,\n projection: options.projection,\n state: options.state,\n wrapX: options.wrapX\n }) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.opaque_ = options.opaque !== undefined ? options.opaque : false;\n /**\n * @private\n * @type {number}\n */\n _this.tilePixelRatio_ = options.tilePixelRatio !== undefined ?\n options.tilePixelRatio : 1;\n /**\n * @protected\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n _this.tileGrid = options.tileGrid !== undefined ? options.tileGrid : null;\n var cacheSize = options.cacheSize;\n if (cacheSize === undefined) {\n var tileSize = [256, 256];\n var tileGrid = options.tileGrid;\n if (tileGrid) {\n toSize(tileGrid.getTileSize(tileGrid.getMinZoom()), tileSize);\n }\n var canUseScreen = typeof screen !== 'undefined';\n var width = canUseScreen ? (screen.availWidth || screen.width) : 1920;\n var height = canUseScreen ? (screen.availHeight || screen.height) : 1080;\n cacheSize = 4 * Math.ceil(width / tileSize[0]) * Math.ceil(height / tileSize[1]);\n }\n /**\n * @protected\n * @type {import(\"../TileCache.js\").default}\n */\n _this.tileCache = new TileCache(cacheSize);\n /**\n * @protected\n * @type {import(\"../size.js\").Size}\n */\n _this.tmpSize = [0, 0];\n /**\n * @private\n * @type {string}\n */\n _this.key_ = options.key || '';\n /**\n * @protected\n * @type {import(\"../Tile.js\").Options}\n */\n _this.tileOptions = { transition: options.transition };\n /**\n * zDirection hint, read by the renderer. Indicates which resolution should be used\n * by a renderer if the views resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @type {number}\n */\n _this.zDirection = options.zDirection ? options.zDirection : 0;\n return _this;\n }\n /**\n * @return {boolean} Can expire cache.\n */\n TileSource.prototype.canExpireCache = function () {\n return this.tileCache.canExpireCache();\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {!Object<string, import(\"../TileRange.js\").default>} usedTiles Used tiles.\n */\n TileSource.prototype.expireCache = function (projection, usedTiles) {\n var tileCache = this.getTileCacheForProjection(projection);\n if (tileCache) {\n tileCache.expireCache(usedTiles);\n }\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {number} z Zoom level.\n * @param {import(\"../TileRange.js\").default} tileRange Tile range.\n * @param {function(import(\"../Tile.js\").default):(boolean|void)} callback Called with each\n * loaded tile. If the callback returns `false`, the tile will not be\n * considered loaded.\n * @return {boolean} The tile range is fully covered with loaded tiles.\n */\n TileSource.prototype.forEachLoadedTile = function (projection, z, tileRange, callback) {\n var tileCache = this.getTileCacheForProjection(projection);\n if (!tileCache) {\n return false;\n }\n var covered = true;\n var tile, tileCoordKey, loaded;\n for (var x = tileRange.minX; x <= tileRange.maxX; ++x) {\n for (var y = tileRange.minY; y <= tileRange.maxY; ++y) {\n tileCoordKey = getKeyZXY(z, x, y);\n loaded = false;\n if (tileCache.containsKey(tileCoordKey)) {\n tile = /** @type {!import(\"../Tile.js\").default} */ (tileCache.get(tileCoordKey));\n loaded = tile.getState() === TileState.LOADED;\n if (loaded) {\n loaded = (callback(tile) !== false);\n }\n }\n if (!loaded) {\n covered = false;\n }\n }\n }\n return covered;\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {number} Gutter.\n */\n TileSource.prototype.getGutterForProjection = function (projection) {\n return 0;\n };\n /**\n * Return the key to be used for all tiles in the source.\n * @return {string} The key for all tiles.\n * @protected\n */\n TileSource.prototype.getKey = function () {\n return this.key_;\n };\n /**\n * Set the value to be used as the key for all tiles in the source.\n * @param {string} key The key for tiles.\n * @protected\n */\n TileSource.prototype.setKey = function (key) {\n if (this.key_ !== key) {\n this.key_ = key;\n this.changed();\n }\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {boolean} Opaque.\n */\n TileSource.prototype.getOpaque = function (projection) {\n return this.opaque_;\n };\n /**\n * @inheritDoc\n */\n TileSource.prototype.getResolutions = function () {\n return this.tileGrid.getResolutions();\n };\n /**\n * @abstract\n * @param {number} z Tile coordinate z.\n * @param {number} x Tile coordinate x.\n * @param {number} y Tile coordinate y.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {!import(\"../Tile.js\").default} Tile.\n */\n TileSource.prototype.getTile = function (z, x, y, pixelRatio, projection) {\n return abstract();\n };\n /**\n * Return the tile grid of the tile source.\n * @return {import(\"../tilegrid/TileGrid.js\").default} Tile grid.\n * @api\n */\n TileSource.prototype.getTileGrid = function () {\n return this.tileGrid;\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {!import(\"../tilegrid/TileGrid.js\").default} Tile grid.\n */\n TileSource.prototype.getTileGridForProjection = function (projection) {\n if (!this.tileGrid) {\n return getTileGridForProjection(projection);\n }\n else {\n return this.tileGrid;\n }\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../TileCache.js\").default} Tile cache.\n * @protected\n */\n TileSource.prototype.getTileCacheForProjection = function (projection) {\n var thisProj = this.getProjection();\n if (thisProj && !equivalent(thisProj, projection)) {\n return null;\n }\n else {\n return this.tileCache;\n }\n };\n /**\n * Get the tile pixel ratio for this source. Subclasses may override this\n * method, which is meant to return a supported pixel ratio that matches the\n * provided `pixelRatio` as close as possible.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Tile pixel ratio.\n */\n TileSource.prototype.getTilePixelRatio = function (pixelRatio) {\n return this.tilePixelRatio_;\n };\n /**\n * @param {number} z Z.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../size.js\").Size} Tile size.\n */\n TileSource.prototype.getTilePixelSize = function (z, pixelRatio, projection) {\n var tileGrid = this.getTileGridForProjection(projection);\n var tilePixelRatio = this.getTilePixelRatio(pixelRatio);\n var tileSize = toSize(tileGrid.getTileSize(z), this.tmpSize);\n if (tilePixelRatio == 1) {\n return tileSize;\n }\n else {\n return scaleSize(tileSize, tilePixelRatio, this.tmpSize);\n }\n };\n /**\n * Returns a tile coordinate wrapped around the x-axis. When the tile coordinate\n * is outside the resolution and extent range of the tile grid, `null` will be\n * returned.\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"../proj/Projection.js\").default=} opt_projection Projection.\n * @return {import(\"../tilecoord.js\").TileCoord} Tile coordinate to be passed to the tileUrlFunction or\n * null if no tile URL should be created for the passed `tileCoord`.\n */\n TileSource.prototype.getTileCoordForTileUrlFunction = function (tileCoord, opt_projection) {\n var projection = opt_projection !== undefined ?\n opt_projection : this.getProjection();\n var tileGrid = this.getTileGridForProjection(projection);\n if (this.getWrapX() && projection.isGlobal()) {\n tileCoord = wrapX(tileGrid, tileCoord, projection);\n }\n return withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;\n };\n /**\n * Remove all cached tiles from the source. The next render cycle will fetch new tiles.\n * @api\n */\n TileSource.prototype.clear = function () {\n this.tileCache.clear();\n };\n /**\n * @inheritDoc\n */\n TileSource.prototype.refresh = function () {\n this.clear();\n _super.prototype.refresh.call(this);\n };\n /**\n * Marks a tile coord as being used, without triggering a load.\n * @abstract\n * @param {number} z Tile coordinate z.\n * @param {number} x Tile coordinate x.\n * @param {number} y Tile coordinate y.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n */\n TileSource.prototype.useTile = function (z, x, y, projection) { };\n return TileSource;\n}(Source));\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Tile~TileSource} instances are instances of this\n * type.\n */\nvar TileSourceEvent = /** @class */ (function (_super) {\n __extends(TileSourceEvent, _super);\n /**\n * @param {string} type Type.\n * @param {import(\"../Tile.js\").default} tile The tile.\n */\n function TileSourceEvent(type, tile) {\n var _this = _super.call(this, type) || this;\n /**\n * The tile related to the event.\n * @type {import(\"../Tile.js\").default}\n * @api\n */\n _this.tile = tile;\n return _this;\n }\n return TileSourceEvent;\n}(Event));\nexport { TileSourceEvent };\nexport default TileSource;\n//# sourceMappingURL=Tile.js.map","/**\n * @module ol/source/TileEventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a tile starts loading.\n * @event module:ol/source/Tile.TileSourceEvent#tileloadstart\n * @api\n */\n TILELOADSTART: 'tileloadstart',\n /**\n * Triggered when a tile finishes loading, either when its data is loaded,\n * or when loading was aborted because the tile is no longer needed.\n * @event module:ol/source/Tile.TileSourceEvent#tileloadend\n * @api\n */\n TILELOADEND: 'tileloadend',\n /**\n * Triggered if tile loading results in an error.\n * @event module:ol/source/Tile.TileSourceEvent#tileloaderror\n * @api\n */\n TILELOADERROR: 'tileloaderror'\n};\n//# sourceMappingURL=TileEventType.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/UrlTile\n */\nimport { getUid } from '../util.js';\nimport TileState from '../TileState.js';\nimport { expandUrl, createFromTemplates, nullTileUrlFunction } from '../tileurlfunction.js';\nimport TileSource, { TileSourceEvent } from './Tile.js';\nimport TileEventType from './TileEventType.js';\nimport { getKeyZXY } from '../tilecoord.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions]\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {number} [cacheSize]\n * @property {boolean} [opaque]\n * @property {import(\"../proj.js\").ProjectionLike} [projection]\n * @property {import(\"./State.js\").default} [state]\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid]\n * @property {import(\"../Tile.js\").LoadFunction} tileLoadFunction\n * @property {number} [tilePixelRatio]\n * @property {import(\"../Tile.js\").UrlFunction} [tileUrlFunction]\n * @property {string} [url]\n * @property {Array<string>} [urls]\n * @property {boolean} [wrapX=true]\n * @property {number} [transition]\n * @property {string} [key]\n * @property {number} [zDirection=0]\n */\n/**\n * @classdesc\n * Base class for sources providing tiles divided into a tile grid over http.\n *\n * @fires import(\"./Tile.js\").TileSourceEvent\n */\nvar UrlTile = /** @class */ (function (_super) {\n __extends(UrlTile, _super);\n /**\n * @param {Options} options Image tile options.\n */\n function UrlTile(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n opaque: options.opaque,\n projection: options.projection,\n state: options.state,\n tileGrid: options.tileGrid,\n tilePixelRatio: options.tilePixelRatio,\n wrapX: options.wrapX,\n transition: options.transition,\n key: options.key,\n attributionsCollapsible: options.attributionsCollapsible,\n zDirection: options.zDirection\n }) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.generateTileUrlFunction_ = !options.tileUrlFunction;\n /**\n * @protected\n * @type {import(\"../Tile.js\").LoadFunction}\n */\n _this.tileLoadFunction = options.tileLoadFunction;\n /**\n * @protected\n * @type {import(\"../Tile.js\").UrlFunction}\n */\n _this.tileUrlFunction = options.tileUrlFunction ? options.tileUrlFunction.bind(_this) : nullTileUrlFunction;\n /**\n * @protected\n * @type {!Array<string>|null}\n */\n _this.urls = null;\n if (options.urls) {\n _this.setUrls(options.urls);\n }\n else if (options.url) {\n _this.setUrl(options.url);\n }\n /**\n * @private\n * @type {!Object<string, boolean>}\n */\n _this.tileLoadingKeys_ = {};\n return _this;\n }\n /**\n * Return the tile load function of the source.\n * @return {import(\"../Tile.js\").LoadFunction} TileLoadFunction\n * @api\n */\n UrlTile.prototype.getTileLoadFunction = function () {\n return this.tileLoadFunction;\n };\n /**\n * Return the tile URL function of the source.\n * @return {import(\"../Tile.js\").UrlFunction} TileUrlFunction\n * @api\n */\n UrlTile.prototype.getTileUrlFunction = function () {\n return this.tileUrlFunction;\n };\n /**\n * Return the URLs used for this source.\n * When a tileUrlFunction is used instead of url or urls,\n * null will be returned.\n * @return {!Array<string>|null} URLs.\n * @api\n */\n UrlTile.prototype.getUrls = function () {\n return this.urls;\n };\n /**\n * Handle tile change events.\n * @param {import(\"../events/Event.js\").default} event Event.\n * @protected\n */\n UrlTile.prototype.handleTileChange = function (event) {\n var tile = /** @type {import(\"../Tile.js\").default} */ (event.target);\n var uid = getUid(tile);\n var tileState = tile.getState();\n var type;\n if (tileState == TileState.LOADING) {\n this.tileLoadingKeys_[uid] = true;\n type = TileEventType.TILELOADSTART;\n }\n else if (uid in this.tileLoadingKeys_) {\n delete this.tileLoadingKeys_[uid];\n type = tileState == TileState.ERROR ? TileEventType.TILELOADERROR :\n (tileState == TileState.LOADED || tileState == TileState.ABORT) ?\n TileEventType.TILELOADEND : undefined;\n }\n if (type != undefined) {\n this.dispatchEvent(new TileSourceEvent(type, tile));\n }\n };\n /**\n * Set the tile load function of the source.\n * @param {import(\"../Tile.js\").LoadFunction} tileLoadFunction Tile load function.\n * @api\n */\n UrlTile.prototype.setTileLoadFunction = function (tileLoadFunction) {\n this.tileCache.clear();\n this.tileLoadFunction = tileLoadFunction;\n this.changed();\n };\n /**\n * Set the tile URL function of the source.\n * @param {import(\"../Tile.js\").UrlFunction} tileUrlFunction Tile URL function.\n * @param {string=} key Optional new tile key for the source.\n * @api\n */\n UrlTile.prototype.setTileUrlFunction = function (tileUrlFunction, key) {\n this.tileUrlFunction = tileUrlFunction;\n this.tileCache.pruneExceptNewestZ();\n if (typeof key !== 'undefined') {\n this.setKey(key);\n }\n else {\n this.changed();\n }\n };\n /**\n * Set the URL to use for requests.\n * @param {string} url URL.\n * @api\n */\n UrlTile.prototype.setUrl = function (url) {\n var urls = expandUrl(url);\n this.urls = urls;\n this.setUrls(urls);\n };\n /**\n * Set the URLs to use for requests.\n * @param {Array<string>} urls URLs.\n * @api\n */\n UrlTile.prototype.setUrls = function (urls) {\n this.urls = urls;\n var key = urls.join('\\n');\n if (this.generateTileUrlFunction_) {\n this.setTileUrlFunction(createFromTemplates(urls, this.tileGrid), key);\n }\n else {\n this.setKey(key);\n }\n };\n /**\n * @inheritDoc\n */\n UrlTile.prototype.useTile = function (z, x, y) {\n var tileCoordKey = getKeyZXY(z, x, y);\n if (this.tileCache.containsKey(tileCoordKey)) {\n this.tileCache.get(tileCoordKey);\n }\n };\n return UrlTile;\n}(TileSource));\nexport default UrlTile;\n//# sourceMappingURL=UrlTile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/TileImage\n */\nimport { ENABLE_RASTER_REPROJECTION } from '../reproj/common.js';\nimport { getUid } from '../util.js';\nimport ImageTile from '../ImageTile.js';\nimport TileCache from '../TileCache.js';\nimport TileState from '../TileState.js';\nimport EventType from '../events/EventType.js';\nimport { equivalent, get as getProjection } from '../proj.js';\nimport ReprojTile from '../reproj/Tile.js';\nimport UrlTile from './UrlTile.js';\nimport { getKey, getKeyZXY } from '../tilecoord.js';\nimport { getForProjection as getTileGridForProjection } from '../tilegrid.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {boolean} [opaque=true] Whether the layer is opaque.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {import(\"./State.js\").default} [state] Source state.\n * @property {typeof import(\"../ImageTile.js\").default} [tileClass] Class used to instantiate image tiles.\n * Default is {@link module:ol/ImageTile~ImageTile}.\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid] Tile grid.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service. For example, if the tile\n * service advertizes 256px by 256px tiles but actually sends 512px\n * by 512px images (for retina/hidpi devices) then `tilePixelRatio`\n * should be set to `2`.\n * @property {import(\"../Tile.js\").UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.\n * @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.\n * A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be\n * used instead of defining each one separately in the `urls` option.\n * @property {Array<string>} [urls] An array of URL templates.\n * @property {boolean} [wrapX] Whether to wrap the world horizontally. The default, is to\n * request out-of-bounds tiles from the server. When set to `false`, only one\n * world will be rendered. When set to `true`, tiles will be requested for one\n * world only, but they will be wrapped horizontally to render multiple worlds.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n * @property {string} [key] Optional tile key for proper cache fetching\n * @property {number} [zDirection=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n */\n/**\n * @classdesc\n * Base class for sources providing images divided into a tile grid.\n *\n * @fires import(\"./Tile.js\").TileSourceEvent\n * @api\n */\nvar TileImage = /** @class */ (function (_super) {\n __extends(TileImage, _super);\n /**\n * @param {!Options} options Image tile options.\n */\n function TileImage(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n opaque: options.opaque,\n projection: options.projection,\n state: options.state,\n tileGrid: options.tileGrid,\n tileLoadFunction: options.tileLoadFunction ?\n options.tileLoadFunction : defaultTileLoadFunction,\n tilePixelRatio: options.tilePixelRatio,\n tileUrlFunction: options.tileUrlFunction,\n url: options.url,\n urls: options.urls,\n wrapX: options.wrapX,\n transition: options.transition,\n key: options.key,\n attributionsCollapsible: options.attributionsCollapsible,\n zDirection: options.zDirection\n }) || this;\n /**\n * @protected\n * @type {?string}\n */\n _this.crossOrigin =\n options.crossOrigin !== undefined ? options.crossOrigin : null;\n /**\n * @protected\n * @type {typeof ImageTile}\n */\n _this.tileClass = options.tileClass !== undefined ?\n options.tileClass : ImageTile;\n /**\n * @protected\n * @type {!Object<string, TileCache>}\n */\n _this.tileCacheForProjection = {};\n /**\n * @protected\n * @type {!Object<string, import(\"../tilegrid/TileGrid.js\").default>}\n */\n _this.tileGridForProjection = {};\n /**\n * @private\n * @type {number|undefined}\n */\n _this.reprojectionErrorThreshold_ = options.reprojectionErrorThreshold;\n /**\n * @private\n * @type {boolean}\n */\n _this.renderReprojectionEdges_ = false;\n return _this;\n }\n /**\n * @inheritDoc\n */\n TileImage.prototype.canExpireCache = function () {\n if (!ENABLE_RASTER_REPROJECTION) {\n return _super.prototype.canExpireCache.call(this);\n }\n if (this.tileCache.canExpireCache()) {\n return true;\n }\n else {\n for (var key in this.tileCacheForProjection) {\n if (this.tileCacheForProjection[key].canExpireCache()) {\n return true;\n }\n }\n }\n return false;\n };\n /**\n * @inheritDoc\n */\n TileImage.prototype.expireCache = function (projection, usedTiles) {\n if (!ENABLE_RASTER_REPROJECTION) {\n _super.prototype.expireCache.call(this, projection, usedTiles);\n return;\n }\n var usedTileCache = this.getTileCacheForProjection(projection);\n this.tileCache.expireCache(this.tileCache == usedTileCache ? usedTiles : {});\n for (var id in this.tileCacheForProjection) {\n var tileCache = this.tileCacheForProjection[id];\n tileCache.expireCache(tileCache == usedTileCache ? usedTiles : {});\n }\n };\n /**\n * @inheritDoc\n */\n TileImage.prototype.getGutterForProjection = function (projection) {\n if (ENABLE_RASTER_REPROJECTION &&\n this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {\n return 0;\n }\n else {\n return this.getGutter();\n }\n };\n /**\n * @return {number} Gutter.\n */\n TileImage.prototype.getGutter = function () {\n return 0;\n };\n /**\n * @inheritDoc\n */\n TileImage.prototype.getOpaque = function (projection) {\n if (ENABLE_RASTER_REPROJECTION &&\n this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {\n return false;\n }\n else {\n return _super.prototype.getOpaque.call(this, projection);\n }\n };\n /**\n * @inheritDoc\n */\n TileImage.prototype.getTileGridForProjection = function (projection) {\n if (!ENABLE_RASTER_REPROJECTION) {\n return _super.prototype.getTileGridForProjection.call(this, projection);\n }\n var thisProj = this.getProjection();\n if (this.tileGrid && (!thisProj || equivalent(thisProj, projection))) {\n return this.tileGrid;\n }\n else {\n var projKey = getUid(projection);\n if (!(projKey in this.tileGridForProjection)) {\n this.tileGridForProjection[projKey] = getTileGridForProjection(projection);\n }\n return (\n /** @type {!import(\"../tilegrid/TileGrid.js\").default} */ (this.tileGridForProjection[projKey]));\n }\n };\n /**\n * @inheritDoc\n */\n TileImage.prototype.getTileCacheForProjection = function (projection) {\n if (!ENABLE_RASTER_REPROJECTION) {\n return _super.prototype.getTileCacheForProjection.call(this, projection);\n }\n var thisProj = this.getProjection();\n if (!thisProj || equivalent(thisProj, projection)) {\n return this.tileCache;\n }\n else {\n var projKey = getUid(projection);\n if (!(projKey in this.tileCacheForProjection)) {\n this.tileCacheForProjection[projKey] = new TileCache(this.tileCache.highWaterMark);\n }\n return this.tileCacheForProjection[projKey];\n }\n };\n /**\n * @param {number} z Tile coordinate z.\n * @param {number} x Tile coordinate x.\n * @param {number} y Tile coordinate y.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {string} key The key set on the tile.\n * @return {!import(\"../Tile.js\").default} Tile.\n * @private\n */\n TileImage.prototype.createTile_ = function (z, x, y, pixelRatio, projection, key) {\n var tileCoord = [z, x, y];\n var urlTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);\n var tileUrl = urlTileCoord ?\n this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : undefined;\n var tile = new this.tileClass(tileCoord, tileUrl !== undefined ? TileState.IDLE : TileState.EMPTY, tileUrl !== undefined ? tileUrl : '', this.crossOrigin, this.tileLoadFunction, this.tileOptions);\n tile.key = key;\n tile.addEventListener(EventType.CHANGE, this.handleTileChange.bind(this));\n return tile;\n };\n /**\n * @inheritDoc\n */\n TileImage.prototype.getTile = function (z, x, y, pixelRatio, projection) {\n var sourceProjection = /** @type {!import(\"../proj/Projection.js\").default} */ (this.getProjection());\n if (!ENABLE_RASTER_REPROJECTION ||\n !sourceProjection || !projection || equivalent(sourceProjection, projection)) {\n return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection);\n }\n else {\n var cache = this.getTileCacheForProjection(projection);\n var tileCoord = [z, x, y];\n var tile = void 0;\n var tileCoordKey = getKey(tileCoord);\n if (cache.containsKey(tileCoordKey)) {\n tile = /** @type {!import(\"../Tile.js\").default} */ (cache.get(tileCoordKey));\n }\n var key = this.getKey();\n if (tile && tile.key == key) {\n return tile;\n }\n else {\n var sourceTileGrid = this.getTileGridForProjection(sourceProjection);\n var targetTileGrid = this.getTileGridForProjection(projection);\n var wrappedTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);\n var newTile = new ReprojTile(sourceProjection, sourceTileGrid, projection, targetTileGrid, tileCoord, wrappedTileCoord, this.getTilePixelRatio(pixelRatio), this.getGutter(), function (z, x, y, pixelRatio) {\n return this.getTileInternal(z, x, y, pixelRatio, sourceProjection);\n }.bind(this), this.reprojectionErrorThreshold_, this.renderReprojectionEdges_);\n newTile.key = key;\n if (tile) {\n newTile.interimTile = tile;\n newTile.refreshInterimChain();\n cache.replace(tileCoordKey, newTile);\n }\n else {\n cache.set(tileCoordKey, newTile);\n }\n return newTile;\n }\n }\n };\n /**\n * @param {number} z Tile coordinate z.\n * @param {number} x Tile coordinate x.\n * @param {number} y Tile coordinate y.\n * @param {number} pixelRatio Pixel ratio.\n * @param {!import(\"../proj/Projection.js\").default} projection Projection.\n * @return {!import(\"../Tile.js\").default} Tile.\n * @protected\n */\n TileImage.prototype.getTileInternal = function (z, x, y, pixelRatio, projection) {\n var tile = null;\n var tileCoordKey = getKeyZXY(z, x, y);\n var key = this.getKey();\n if (!this.tileCache.containsKey(tileCoordKey)) {\n tile = this.createTile_(z, x, y, pixelRatio, projection, key);\n this.tileCache.set(tileCoordKey, tile);\n }\n else {\n tile = this.tileCache.get(tileCoordKey);\n if (tile.key != key) {\n // The source's params changed. If the tile has an interim tile and if we\n // can use it then we use it. Otherwise we create a new tile. In both\n // cases we attempt to assign an interim tile to the new tile.\n var interimTile = tile;\n tile = this.createTile_(z, x, y, pixelRatio, projection, key);\n //make the new tile the head of the list,\n if (interimTile.getState() == TileState.IDLE) {\n //the old tile hasn't begun loading yet, and is now outdated, so we can simply discard it\n tile.interimTile = interimTile.interimTile;\n }\n else {\n tile.interimTile = interimTile;\n }\n tile.refreshInterimChain();\n this.tileCache.replace(tileCoordKey, tile);\n }\n }\n return tile;\n };\n /**\n * Sets whether to render reprojection edges or not (usually for debugging).\n * @param {boolean} render Render the edges.\n * @api\n */\n TileImage.prototype.setRenderReprojectionEdges = function (render) {\n if (!ENABLE_RASTER_REPROJECTION ||\n this.renderReprojectionEdges_ == render) {\n return;\n }\n this.renderReprojectionEdges_ = render;\n for (var id in this.tileCacheForProjection) {\n this.tileCacheForProjection[id].clear();\n }\n this.changed();\n };\n /**\n * Sets the tile grid to use when reprojecting the tiles to the given\n * projection instead of the default tile grid for the projection.\n *\n * This can be useful when the default tile grid cannot be created\n * (e.g. projection has no extent defined) or\n * for optimization reasons (custom tile size, resolutions, ...).\n *\n * @param {import(\"../proj.js\").ProjectionLike} projection Projection.\n * @param {import(\"../tilegrid/TileGrid.js\").default} tilegrid Tile grid to use for the projection.\n * @api\n */\n TileImage.prototype.setTileGridForProjection = function (projection, tilegrid) {\n if (ENABLE_RASTER_REPROJECTION) {\n var proj = getProjection(projection);\n if (proj) {\n var projKey = getUid(proj);\n if (!(projKey in this.tileGridForProjection)) {\n this.tileGridForProjection[projKey] = tilegrid;\n }\n }\n }\n };\n return TileImage;\n}(UrlTile));\n/**\n * @param {ImageTile} imageTile Image tile.\n * @param {string} src Source.\n */\nfunction defaultTileLoadFunction(imageTile, src) {\n /** @type {HTMLImageElement|HTMLVideoElement} */ (imageTile.getImage()).src = src;\n}\nexport default TileImage;\n//# sourceMappingURL=TileImage.js.map","/**\n * @module ol/source/BingMaps\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { createFromTileUrlFunctions } from '../tileurlfunction.js';\nimport { applyTransform, intersects } from '../extent.js';\nimport { jsonp as requestJSONP } from '../net.js';\nimport { get as getProjection, getTransformFromProjections } from '../proj.js';\nimport SourceState from './State.js';\nimport TileImage from './TileImage.js';\nimport { createOrUpdate } from '../tilecoord.js';\nimport { createXYZ, extentFromProjection } from '../tilegrid.js';\n/**\n * @param {import('../tilecoord.js').TileCoord} tileCoord Tile coord.\n * @return {string} Quad key.\n */\nexport function quadKey(tileCoord) {\n var z = tileCoord[0];\n var digits = new Array(z);\n var mask = 1 << (z - 1);\n var i, charCode;\n for (i = 0; i < z; ++i) {\n // 48 is charCode for 0 - '0'.charCodeAt(0)\n charCode = 48;\n if (tileCoord[1] & mask) {\n charCode += 1;\n }\n if (tileCoord[2] & mask) {\n charCode += 2;\n }\n digits[i] = String.fromCharCode(charCode);\n mask >>= 1;\n }\n return digits.join('');\n}\n/**\n * The attribution containing a link to the Microsoft® Bing™ Maps Platform APIs’\n * Terms Of Use.\n * @const\n * @type {string}\n */\nvar TOS_ATTRIBUTION = '<a class=\"ol-attribution-bing-tos\" ' +\n 'href=\"https://www.microsoft.com/maps/product/terms.html\" target=\"_blank\">' +\n 'Terms of Use</a>';\n/**\n * @typedef {Object} Options\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {boolean} [hidpi=false] If `true` hidpi tiles will be requested.\n * @property {string} [culture='en-us'] Culture code.\n * @property {string} key Bing Maps API key. Get yours at http://www.bingmapsportal.com/.\n * @property {string} imagerySet Type of imagery.\n * @property {number} [maxZoom=21] Max zoom. Default is what's advertized by the BingMaps service.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n */\n/**\n * @typedef {Object} BingMapsImageryMetadataResponse\n * @property {number} statusCode The response status code\n * @property {string} statusDescription The response status description\n * @property {string} authenticationResultCode The authentication result code\n * @property {Array<ResourceSet>} resourceSets The array of resource sets\n */\n/**\n * @typedef {Object} ResourceSet\n * @property {Array<Resource>} resources\n */\n/**\n * @typedef {Object} Resource\n * @property {number} imageHeight The image height\n * @property {number} imageWidth The image width\n * @property {number} zoomMin The minimum zoom level\n * @property {number} zoomMax The maximum zoom level\n * @property {string} imageUrl The image URL\n * @property {Array<string>} imageUrlSubdomains The image URL subdomains for rotation\n * @property {Array<ImageryProvider>} [imageryProviders] The array of ImageryProviders\n */\n/**\n * @typedef {Object} ImageryProvider\n * @property {Array<CoverageArea>} coverageAreas The coverage areas\n * @property {string} [attribution] The attribution\n */\n/**\n * @typedef {Object} CoverageArea\n * @property {number} zoomMin The minimum zoom\n * @property {number} zoomMax The maximum zoom\n * @property {Array<number>} bbox The coverage bounding box\n */\n/**\n * @classdesc\n * Layer source for Bing Maps tile data.\n * @api\n */\nvar BingMaps = /** @class */ (function (_super) {\n __extends(BingMaps, _super);\n /**\n * @param {Options} options Bing Maps options.\n */\n function BingMaps(options) {\n var _this = this;\n var hidpi = options.hidpi !== undefined ? options.hidpi : false;\n _this = _super.call(this, {\n cacheSize: options.cacheSize,\n crossOrigin: 'anonymous',\n opaque: true,\n projection: getProjection('EPSG:3857'),\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n state: SourceState.LOADING,\n tileLoadFunction: options.tileLoadFunction,\n tilePixelRatio: hidpi ? 2 : 1,\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n transition: options.transition\n }) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.hidpi_ = hidpi;\n /**\n * @private\n * @type {string}\n */\n _this.culture_ = options.culture !== undefined ? options.culture : 'en-us';\n /**\n * @private\n * @type {number}\n */\n _this.maxZoom_ = options.maxZoom !== undefined ? options.maxZoom : -1;\n /**\n * @private\n * @type {string}\n */\n _this.apiKey_ = options.key;\n /**\n * @private\n * @type {string}\n */\n _this.imagerySet_ = options.imagerySet;\n var url = 'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/' +\n _this.imagerySet_ +\n '?uriScheme=https&include=ImageryProviders&key=' + _this.apiKey_ +\n '&c=' + _this.culture_;\n requestJSONP(url, _this.handleImageryMetadataResponse.bind(_this), undefined, 'jsonp');\n return _this;\n }\n /**\n * Get the api key used for this source.\n *\n * @return {string} The api key.\n * @api\n */\n BingMaps.prototype.getApiKey = function () {\n return this.apiKey_;\n };\n /**\n * Get the imagery set associated with this source.\n *\n * @return {string} The imagery set.\n * @api\n */\n BingMaps.prototype.getImagerySet = function () {\n return this.imagerySet_;\n };\n /**\n * @param {BingMapsImageryMetadataResponse} response Response.\n */\n BingMaps.prototype.handleImageryMetadataResponse = function (response) {\n if (response.statusCode != 200 ||\n response.statusDescription != 'OK' ||\n response.authenticationResultCode != 'ValidCredentials' ||\n response.resourceSets.length != 1 ||\n response.resourceSets[0].resources.length != 1) {\n this.setState(SourceState.ERROR);\n return;\n }\n var resource = response.resourceSets[0].resources[0];\n var maxZoom = this.maxZoom_ == -1 ? resource.zoomMax : this.maxZoom_;\n var sourceProjection = this.getProjection();\n var extent = extentFromProjection(sourceProjection);\n var scale = this.hidpi_ ? 2 : 1;\n var tileSize = resource.imageWidth == resource.imageHeight ?\n resource.imageWidth / scale :\n [resource.imageWidth / scale, resource.imageHeight / scale];\n var tileGrid = createXYZ({\n extent: extent,\n minZoom: resource.zoomMin,\n maxZoom: maxZoom,\n tileSize: tileSize\n });\n this.tileGrid = tileGrid;\n var culture = this.culture_;\n var hidpi = this.hidpi_;\n this.tileUrlFunction = createFromTileUrlFunctions(resource.imageUrlSubdomains.map(function (subdomain) {\n /** @type {import('../tilecoord.js').TileCoord} */\n var quadKeyTileCoord = [0, 0, 0];\n var imageUrl = resource.imageUrl\n .replace('{subdomain}', subdomain)\n .replace('{culture}', culture);\n return (\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {string|undefined} Tile URL.\n */\n function (tileCoord, pixelRatio, projection) {\n if (!tileCoord) {\n return undefined;\n }\n else {\n createOrUpdate(tileCoord[0], tileCoord[1], tileCoord[2], quadKeyTileCoord);\n var url = imageUrl;\n if (hidpi) {\n url += '&dpi=d1&device=mobile';\n }\n return url.replace('{quadkey}', quadKey(quadKeyTileCoord));\n }\n });\n }));\n if (resource.imageryProviders) {\n var transform_1 = getTransformFromProjections(getProjection('EPSG:4326'), this.getProjection());\n this.setAttributions(function (frameState) {\n var attributions = [];\n var viewState = frameState.viewState;\n var tileGrid = this.getTileGrid();\n var z = tileGrid.getZForResolution(viewState.resolution, this.zDirection);\n var tileCoord = tileGrid.getTileCoordForCoordAndZ(viewState.center, z);\n var zoom = tileCoord[0];\n resource.imageryProviders.map(function (imageryProvider) {\n var intersecting = false;\n var coverageAreas = imageryProvider.coverageAreas;\n for (var i = 0, ii = coverageAreas.length; i < ii; ++i) {\n var coverageArea = coverageAreas[i];\n if (zoom >= coverageArea.zoomMin && zoom <= coverageArea.zoomMax) {\n var bbox = coverageArea.bbox;\n var epsg4326Extent = [bbox[1], bbox[0], bbox[3], bbox[2]];\n var extent_1 = applyTransform(epsg4326Extent, transform_1);\n if (intersects(extent_1, frameState.extent)) {\n intersecting = true;\n break;\n }\n }\n }\n if (intersecting) {\n attributions.push(imageryProvider.attribution);\n }\n });\n attributions.push(TOS_ATTRIBUTION);\n return attributions;\n }.bind(this));\n }\n this.setState(SourceState.READY);\n };\n return BingMaps;\n}(TileImage));\nexport default BingMaps;\n//# sourceMappingURL=BingMaps.js.map","/**\n * @module ol/source/XYZ\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport TileImage from './TileImage.js';\nimport { createXYZ, extentFromProjection } from '../tilegrid.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {boolean} [opaque=true] Whether the layer is opaque.\n * @property {import(\"../proj.js\").ProjectionLike} [projection='EPSG:3857'] Projection.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {number} [maxZoom=18] Optional max zoom level.\n * @property {number} [minZoom=0] Optional min zoom level.\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid] Tile grid.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service.\n * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px\n * by 512px images (for retina/hidpi devices) then `tilePixelRatio`\n * should be set to `2`.\n * @property {number|import(\"../size.js\").Size} [tileSize=[256, 256]] The tile size used by the tile service.\n * @property {import(\"../Tile.js\").UrlFunction} [tileUrlFunction] Optional function to get\n * tile URL given a tile coordinate and the projection.\n * Required if url or urls are not provided.\n * @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`,\n * and `{z}` placeholders. A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`,\n * may be used instead of defining each one separately in the `urls` option.\n * @property {Array<string>} [urls] An array of URL templates.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n * @property {number} [zDirection=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n */\n/**\n * @classdesc\n * Layer source for tile data with URLs in a set XYZ format that are\n * defined in a URL template. By default, this follows the widely-used\n * Google grid where `x` 0 and `y` 0 are in the top left. Grids like\n * TMS where `x` 0 and `y` 0 are in the bottom left can be used by\n * using the `{-y}` placeholder in the URL template, so long as the\n * source does not have a custom tile grid. In this case,\n * {@link module:ol/source/TileImage} can be used with a `tileUrlFunction`\n * such as:\n *\n * tileUrlFunction: function(coordinate) {\n * return 'http://mapserver.com/' + coordinate[0] + '/' +\n * coordinate[1] + '/' + coordinate[2] + '.png';\n * }\n *\n * @api\n */\nvar XYZ = /** @class */ (function (_super) {\n __extends(XYZ, _super);\n /**\n * @param {Options=} opt_options XYZ options.\n */\n function XYZ(opt_options) {\n var _this = this;\n var options = opt_options || {};\n var projection = options.projection !== undefined ?\n options.projection : 'EPSG:3857';\n var tileGrid = options.tileGrid !== undefined ? options.tileGrid :\n createXYZ({\n extent: extentFromProjection(projection),\n maxZoom: options.maxZoom,\n minZoom: options.minZoom,\n tileSize: options.tileSize\n });\n _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n opaque: options.opaque,\n projection: projection,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileGrid: tileGrid,\n tileLoadFunction: options.tileLoadFunction,\n tilePixelRatio: options.tilePixelRatio,\n tileUrlFunction: options.tileUrlFunction,\n url: options.url,\n urls: options.urls,\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n transition: options.transition,\n attributionsCollapsible: options.attributionsCollapsible,\n zDirection: options.zDirection\n }) || this;\n return _this;\n }\n return XYZ;\n}(TileImage));\nexport default XYZ;\n//# sourceMappingURL=XYZ.js.map","/**\n * @module ol/source/CartoDB\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { assign } from '../obj.js';\nimport SourceState from './State.js';\nimport XYZ from './XYZ.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {import(\"../proj.js\").ProjectionLike} [projection='EPSG:3857'] Projection.\n * @property {number} [maxZoom=18] Max zoom.\n * @property {number} [minZoom] Minimum zoom.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * @property {Object} [config] If using anonymous maps, the CartoDB config to use. See\n * http://docs.cartodb.com/cartodb-platform/maps-api/anonymous-maps/\n * for more detail.\n * If using named maps, a key-value lookup with the template parameters.\n * See http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/\n * for more detail.\n * @property {string} [map] If using named maps, this will be the name of the template to load.\n * See http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/\n * for more detail.\n * @property {string} account If using named maps, this will be the name of the template to load.\n */\n/**\n * @typedef {Object} CartoDBLayerInfo\n * @property {string} layergroupid The layer group ID\n * @property {{https: string}} cdn_url The CDN URL\n */\n/**\n * @classdesc\n * Layer source for the CartoDB Maps API.\n * @api\n */\nvar CartoDB = /** @class */ (function (_super) {\n __extends(CartoDB, _super);\n /**\n * @param {Options} options CartoDB options.\n */\n function CartoDB(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n maxZoom: options.maxZoom !== undefined ? options.maxZoom : 18,\n minZoom: options.minZoom,\n projection: options.projection,\n wrapX: options.wrapX\n }) || this;\n /**\n * @type {string}\n * @private\n */\n _this.account_ = options.account;\n /**\n * @type {string}\n * @private\n */\n _this.mapId_ = options.map || '';\n /**\n * @type {!Object}\n * @private\n */\n _this.config_ = options.config || {};\n /**\n * @type {!Object<string, CartoDBLayerInfo>}\n * @private\n */\n _this.templateCache_ = {};\n _this.initializeMap_();\n return _this;\n }\n /**\n * Returns the current config.\n * @return {!Object} The current configuration.\n * @api\n */\n CartoDB.prototype.getConfig = function () {\n return this.config_;\n };\n /**\n * Updates the carto db config.\n * @param {Object} config a key-value lookup. Values will replace current values\n * in the config.\n * @api\n */\n CartoDB.prototype.updateConfig = function (config) {\n assign(this.config_, config);\n this.initializeMap_();\n };\n /**\n * Sets the CartoDB config\n * @param {Object} config In the case of anonymous maps, a CartoDB configuration\n * object.\n * If using named maps, a key-value lookup with the template parameters.\n * @api\n */\n CartoDB.prototype.setConfig = function (config) {\n this.config_ = config || {};\n this.initializeMap_();\n };\n /**\n * Issue a request to initialize the CartoDB map.\n * @private\n */\n CartoDB.prototype.initializeMap_ = function () {\n var paramHash = JSON.stringify(this.config_);\n if (this.templateCache_[paramHash]) {\n this.applyTemplate_(this.templateCache_[paramHash]);\n return;\n }\n var mapUrl = 'https://' + this.account_ + '.carto.com/api/v1/map';\n if (this.mapId_) {\n mapUrl += '/named/' + this.mapId_;\n }\n var client = new XMLHttpRequest();\n client.addEventListener('load', this.handleInitResponse_.bind(this, paramHash));\n client.addEventListener('error', this.handleInitError_.bind(this));\n client.open('POST', mapUrl);\n client.setRequestHeader('Content-type', 'application/json');\n client.send(JSON.stringify(this.config_));\n };\n /**\n * Handle map initialization response.\n * @param {string} paramHash a hash representing the parameter set that was used\n * for the request\n * @param {Event} event Event.\n * @private\n */\n CartoDB.prototype.handleInitResponse_ = function (paramHash, event) {\n var client = /** @type {XMLHttpRequest} */ (event.target);\n // status will be 0 for file:// urls\n if (!client.status || client.status >= 200 && client.status < 300) {\n var response = void 0;\n try {\n response = /** @type {CartoDBLayerInfo} */ (JSON.parse(client.responseText));\n }\n catch (err) {\n this.setState(SourceState.ERROR);\n return;\n }\n this.applyTemplate_(response);\n this.templateCache_[paramHash] = response;\n this.setState(SourceState.READY);\n }\n else {\n this.setState(SourceState.ERROR);\n }\n };\n /**\n * @private\n * @param {Event} event Event.\n */\n CartoDB.prototype.handleInitError_ = function (event) {\n this.setState(SourceState.ERROR);\n };\n /**\n * Apply the new tile urls returned by carto db\n * @param {CartoDBLayerInfo} data Result of carto db call.\n * @private\n */\n CartoDB.prototype.applyTemplate_ = function (data) {\n var tilesUrl = 'https://' + data.cdn_url.https + '/' + this.account_ +\n '/api/v1/map/' + data.layergroupid + '/{z}/{x}/{y}.png';\n this.setUrl(tilesUrl);\n };\n return CartoDB;\n}(XYZ));\nexport default CartoDB;\n//# sourceMappingURL=CartoDB.js.map","/**\n * @module ol/source/VectorEventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a feature is added to the source.\n * @event module:ol/source/Vector.VectorSourceEvent#addfeature\n * @api\n */\n ADDFEATURE: 'addfeature',\n /**\n * Triggered when a feature is updated.\n * @event module:ol/source/Vector.VectorSourceEvent#changefeature\n * @api\n */\n CHANGEFEATURE: 'changefeature',\n /**\n * Triggered when the clear method is called on the source.\n * @event module:ol/source/Vector.VectorSourceEvent#clear\n * @api\n */\n CLEAR: 'clear',\n /**\n * Triggered when a feature is removed from the source.\n * See {@link module:ol/source/Vector#clear source.clear()} for exceptions.\n * @event module:ol/source/Vector.VectorSourceEvent#removefeature\n * @api\n */\n REMOVEFEATURE: 'removefeature'\n};\n//# sourceMappingURL=VectorEventType.js.map","/**\n * @module ol/structs/RBush\n */\nimport { getUid } from '../util.js';\nimport RBush_ from 'rbush';\nimport { createOrUpdate, equals } from '../extent.js';\nimport { isEmpty } from '../obj.js';\n/**\n * @typedef {Object} Entry\n * @property {number} minX\n * @property {number} minY\n * @property {number} maxX\n * @property {number} maxY\n * @property {Object} [value]\n */\n/**\n * @classdesc\n * Wrapper around the RBush by Vladimir Agafonkin.\n * See https://github.com/mourner/rbush.\n *\n * @template T\n */\nvar RBush = /** @class */ (function () {\n /**\n * @param {number=} opt_maxEntries Max entries.\n */\n function RBush(opt_maxEntries) {\n /**\n * @private\n */\n this.rbush_ = new RBush_(opt_maxEntries);\n /**\n * A mapping between the objects added to this rbush wrapper\n * and the objects that are actually added to the internal rbush.\n * @private\n * @type {Object<string, Entry>}\n */\n this.items_ = {};\n }\n /**\n * Insert a value into the RBush.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {T} value Value.\n */\n RBush.prototype.insert = function (extent, value) {\n /** @type {Entry} */\n var item = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n value: value\n };\n this.rbush_.insert(item);\n this.items_[getUid(value)] = item;\n };\n /**\n * Bulk-insert values into the RBush.\n * @param {Array<import(\"../extent.js\").Extent>} extents Extents.\n * @param {Array<T>} values Values.\n */\n RBush.prototype.load = function (extents, values) {\n var items = new Array(values.length);\n for (var i = 0, l = values.length; i < l; i++) {\n var extent = extents[i];\n var value = values[i];\n /** @type {Entry} */\n var item = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n value: value\n };\n items[i] = item;\n this.items_[getUid(value)] = item;\n }\n this.rbush_.load(items);\n };\n /**\n * Remove a value from the RBush.\n * @param {T} value Value.\n * @return {boolean} Removed.\n */\n RBush.prototype.remove = function (value) {\n var uid = getUid(value);\n // get the object in which the value was wrapped when adding to the\n // internal rbush. then use that object to do the removal.\n var item = this.items_[uid];\n delete this.items_[uid];\n return this.rbush_.remove(item) !== null;\n };\n /**\n * Update the extent of a value in the RBush.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {T} value Value.\n */\n RBush.prototype.update = function (extent, value) {\n var item = this.items_[getUid(value)];\n var bbox = [item.minX, item.minY, item.maxX, item.maxY];\n if (!equals(bbox, extent)) {\n this.remove(value);\n this.insert(extent, value);\n }\n };\n /**\n * Return all values in the RBush.\n * @return {Array<T>} All.\n */\n RBush.prototype.getAll = function () {\n var items = this.rbush_.all();\n return items.map(function (item) {\n return item.value;\n });\n };\n /**\n * Return all values in the given extent.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {Array<T>} All in extent.\n */\n RBush.prototype.getInExtent = function (extent) {\n /** @type {Entry} */\n var bbox = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3]\n };\n var items = this.rbush_.search(bbox);\n return items.map(function (item) {\n return item.value;\n });\n };\n /**\n * Calls a callback function with each value in the tree.\n * If the callback returns a truthy value, this value is returned without\n * checking the rest of the tree.\n * @param {function(T): *} callback Callback.\n * @return {*} Callback return value.\n */\n RBush.prototype.forEach = function (callback) {\n return this.forEach_(this.getAll(), callback);\n };\n /**\n * Calls a callback function with each value in the provided extent.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(T): *} callback Callback.\n * @return {*} Callback return value.\n */\n RBush.prototype.forEachInExtent = function (extent, callback) {\n return this.forEach_(this.getInExtent(extent), callback);\n };\n /**\n * @param {Array<T>} values Values.\n * @param {function(T): *} callback Callback.\n * @private\n * @return {*} Callback return value.\n */\n RBush.prototype.forEach_ = function (values, callback) {\n var result;\n for (var i = 0, l = values.length; i < l; i++) {\n result = callback(values[i]);\n if (result) {\n return result;\n }\n }\n return result;\n };\n /**\n * @return {boolean} Is empty.\n */\n RBush.prototype.isEmpty = function () {\n return isEmpty(this.items_);\n };\n /**\n * Remove all values from the RBush.\n */\n RBush.prototype.clear = function () {\n this.rbush_.clear();\n this.items_ = {};\n };\n /**\n * @param {import(\"../extent.js\").Extent=} opt_extent Extent.\n * @return {import(\"../extent.js\").Extent} Extent.\n */\n RBush.prototype.getExtent = function (opt_extent) {\n var data = this.rbush_.toJSON();\n return createOrUpdate(data.minX, data.minY, data.maxX, data.maxY, opt_extent);\n };\n /**\n * @param {RBush} rbush R-Tree.\n */\n RBush.prototype.concat = function (rbush) {\n this.rbush_.load(rbush.rbush_.all());\n for (var i in rbush.items_) {\n this.items_[i] = rbush.items_[i];\n }\n };\n return RBush;\n}());\nexport default RBush;\n//# sourceMappingURL=RBush.js.map","/**\n * @module ol/source/Vector\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { getUid } from '../util.js';\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport ObjectEventType from '../ObjectEventType.js';\nimport { extend } from '../array.js';\nimport { assert } from '../asserts.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport Event from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport { containsExtent, equals } from '../extent.js';\nimport { xhr } from '../featureloader.js';\nimport { TRUE, VOID } from '../functions.js';\nimport { all as allStrategy } from '../loadingstrategy.js';\nimport { isEmpty, getValues } from '../obj.js';\nimport Source from './Source.js';\nimport SourceState from './State.js';\nimport VectorEventType from './VectorEventType.js';\nimport RBush from '../structs/RBush.js';\n/**\n * A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and\n * returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this\n * is one of the standard {@link module:ol/loadingstrategy} strategies.\n *\n * @typedef {function(import(\"../extent.js\").Extent, number): Array<import(\"../extent.js\").Extent>} LoadingStrategy\n * @api\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Vector} instances are instances of this\n * type.\n * @template {import(\"../geom/Geometry.js\").default} Geometry\n */\nvar VectorSourceEvent = /** @class */ (function (_super) {\n __extends(VectorSourceEvent, _super);\n /**\n * @param {string} type Type.\n * @param {import(\"../Feature.js\").default<Geometry>=} opt_feature Feature.\n */\n function VectorSourceEvent(type, opt_feature) {\n var _this = _super.call(this, type) || this;\n /**\n * The feature being added or removed.\n * @type {import(\"../Feature.js\").default<Geometry>|undefined}\n * @api\n */\n _this.feature = opt_feature;\n return _this;\n }\n return VectorSourceEvent;\n}(Event));\nexport { VectorSourceEvent };\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {Array<import(\"../Feature.js\").default>|Collection<import(\"../Feature.js\").default>} [features]\n * Features. If provided as {@link module:ol/Collection}, the features in the source\n * and the collection will stay in sync.\n * @property {import(\"../format/Feature.js\").default} [format] The feature format used by the XHR\n * feature loader when `url` is set. Required if `url` is set, otherwise ignored.\n * @property {import(\"../featureloader.js\").FeatureLoader} [loader]\n * The loader function used to load features, from a remote source for example.\n * If this is not set and `url` is set, the source will create and use an XHR\n * feature loader.\n *\n * Example:\n *\n * ```js\n * import {Vector} from 'ol/source';\n * import {GeoJSON} from 'ol/format';\n * import {bbox} from 'ol/loadingstrategy';\n *\n * var vectorSource = new Vector({\n * format: new GeoJSON(),\n * loader: function(extent, resolution, projection) {\n * var proj = projection.getCode();\n * var url = 'https://ahocevar.com/geoserver/wfs?service=WFS&' +\n * 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' +\n * 'outputFormat=application/json&srsname=' + proj + '&' +\n * 'bbox=' + extent.join(',') + ',' + proj;\n * var xhr = new XMLHttpRequest();\n * xhr.open('GET', url);\n * var onError = function() {\n * vectorSource.removeLoadedExtent(extent);\n * }\n * xhr.onerror = onError;\n * xhr.onload = function() {\n * if (xhr.status == 200) {\n * vectorSource.addFeatures(\n * vectorSource.getFormat().readFeatures(xhr.responseText));\n * } else {\n * onError();\n * }\n * }\n * xhr.send();\n * },\n * strategy: bbox\n * });\n * ```\n * @property {boolean} [overlaps=true] This source may have overlapping geometries.\n * Setting this to `false` (e.g. for sources with polygons that represent administrative\n * boundaries or TopoJSON sources) allows the renderer to optimise fill and\n * stroke operations.\n * @property {LoadingStrategy} [strategy] The loading strategy to use.\n * By default an {@link module:ol/loadingstrategy~all}\n * strategy is used, a one-off strategy which loads all features at once.\n * @property {string|import(\"../featureloader.js\").FeatureUrlFunction} [url]\n * Setting this option instructs the source to load features using an XHR loader\n * (see {@link module:ol/featureloader~xhr}). Use a `string` and an\n * {@link module:ol/loadingstrategy~all} for a one-off download of all features from\n * the given URL. Use a {@link module:ol/featureloader~FeatureUrlFunction} to generate the url with\n * other loading strategies.\n * Requires `format` to be set as well.\n * When default XHR feature loader is provided, the features will\n * be transformed from the data projection to the view projection\n * during parsing. If your remote data source does not advertise its projection\n * properly, this transformation will be incorrect. For some formats, the\n * default projection (usually EPSG:4326) can be overridden by setting the\n * dataProjection constructor option on the format.\n * Note that if a source contains non-feature data, such as a GeoJSON geometry\n * or a KML NetworkLink, these will be ignored. Use a custom loader to load these.\n * @property {boolean} [useSpatialIndex=true]\n * By default, an RTree is used as spatial index. When features are removed and\n * added frequently, and the total number of features is low, setting this to\n * `false` may improve performance.\n *\n * Note that\n * {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent},\n * {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and\n * {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is\n * set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop\n * through all features.\n *\n * When set to `false`, the features will be maintained in an\n * {@link module:ol/Collection}, which can be retrieved through\n * {@link module:ol/source/Vector~VectorSource#getFeaturesCollection}.\n * @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the\n * -180° and 180° meridians to work properly, this should be set to `false`. The\n * resulting geometry coordinates will then exceed the world bounds.\n */\n/**\n * @classdesc\n * Provides a source of features for vector layers. Vector features provided\n * by this source are suitable for editing. See {@link module:ol/source/VectorTile~VectorTile} for\n * vector data that is optimized for rendering.\n *\n * @fires VectorSourceEvent\n * @api\n * @template {import(\"../geom/Geometry.js\").default} Geometry\n */\nvar VectorSource = /** @class */ (function (_super) {\n __extends(VectorSource, _super);\n /**\n * @param {Options=} opt_options Vector source options.\n */\n function VectorSource(opt_options) {\n var _this = this;\n var options = opt_options || {};\n _this = _super.call(this, {\n attributions: options.attributions,\n projection: undefined,\n state: SourceState.READY,\n wrapX: options.wrapX !== undefined ? options.wrapX : true\n }) || this;\n /**\n * @private\n * @type {import(\"../featureloader.js\").FeatureLoader}\n */\n _this.loader_ = VOID;\n /**\n * @private\n * @type {import(\"../format/Feature.js\").default|undefined}\n */\n _this.format_ = options.format;\n /**\n * @private\n * @type {boolean}\n */\n _this.overlaps_ = options.overlaps == undefined ? true : options.overlaps;\n /**\n * @private\n * @type {string|import(\"../featureloader.js\").FeatureUrlFunction|undefined}\n */\n _this.url_ = options.url;\n if (options.loader !== undefined) {\n _this.loader_ = options.loader;\n }\n else if (_this.url_ !== undefined) {\n assert(_this.format_, 7); // `format` must be set when `url` is set\n // create a XHR feature loader for \"url\" and \"format\"\n _this.loader_ = xhr(_this.url_, /** @type {import(\"../format/Feature.js\").default} */ (_this.format_));\n }\n /**\n * @private\n * @type {LoadingStrategy}\n */\n _this.strategy_ = options.strategy !== undefined ? options.strategy : allStrategy;\n var useSpatialIndex = options.useSpatialIndex !== undefined ? options.useSpatialIndex : true;\n /**\n * @private\n * @type {RBush<import(\"../Feature.js\").default<Geometry>>}\n */\n _this.featuresRtree_ = useSpatialIndex ? new RBush() : null;\n /**\n * @private\n * @type {RBush<{extent: import(\"../extent.js\").Extent}>}\n */\n _this.loadedExtentsRtree_ = new RBush();\n /**\n * @private\n * @type {!Object<string, import(\"../Feature.js\").default<Geometry>>}\n */\n _this.nullGeometryFeatures_ = {};\n /**\n * A lookup of features by id (the return from feature.getId()).\n * @private\n * @type {!Object<string, import(\"../Feature.js\").default<Geometry>>}\n */\n _this.idIndex_ = {};\n /**\n * A lookup of features by uid (using getUid(feature)).\n * @private\n * @type {!Object<string, import(\"../Feature.js\").default<Geometry>>}\n */\n _this.uidIndex_ = {};\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").EventsKey>>}\n */\n _this.featureChangeKeys_ = {};\n /**\n * @private\n * @type {Collection<import(\"../Feature.js\").default<Geometry>>}\n */\n _this.featuresCollection_ = null;\n var collection, features;\n if (Array.isArray(options.features)) {\n features = options.features;\n }\n else if (options.features) {\n collection = options.features;\n features = collection.getArray();\n }\n if (!useSpatialIndex && collection === undefined) {\n collection = new Collection(features);\n }\n if (features !== undefined) {\n _this.addFeaturesInternal(features);\n }\n if (collection !== undefined) {\n _this.bindFeaturesCollection_(collection);\n }\n return _this;\n }\n /**\n * Add a single feature to the source. If you want to add a batch of features\n * at once, call {@link module:ol/source/Vector~VectorSource#addFeatures #addFeatures()}\n * instead. A feature will not be added to the source if feature with\n * the same id is already there. The reason for this behavior is to avoid\n * feature duplication when using bbox or tile loading strategies.\n * Note: this also applies if an {@link module:ol/Collection} is used for features,\n * meaning that if a feature with a duplicate id is added in the collection, it will\n * be removed from it right away.\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature to add.\n * @api\n */\n VectorSource.prototype.addFeature = function (feature) {\n this.addFeatureInternal(feature);\n this.changed();\n };\n /**\n * Add a feature without firing a `change` event.\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature.\n * @protected\n */\n VectorSource.prototype.addFeatureInternal = function (feature) {\n var featureKey = getUid(feature);\n if (!this.addToIndex_(featureKey, feature)) {\n if (this.featuresCollection_) {\n this.featuresCollection_.remove(feature);\n }\n return;\n }\n this.setupChangeEvents_(featureKey, feature);\n var geometry = feature.getGeometry();\n if (geometry) {\n var extent = geometry.getExtent();\n if (this.featuresRtree_) {\n this.featuresRtree_.insert(extent, feature);\n }\n }\n else {\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n this.dispatchEvent(new VectorSourceEvent(VectorEventType.ADDFEATURE, feature));\n };\n /**\n * @param {string} featureKey Unique identifier for the feature.\n * @param {import(\"../Feature.js\").default<Geometry>} feature The feature.\n * @private\n */\n VectorSource.prototype.setupChangeEvents_ = function (featureKey, feature) {\n this.featureChangeKeys_[featureKey] = [\n listen(feature, EventType.CHANGE, this.handleFeatureChange_, this),\n listen(feature, ObjectEventType.PROPERTYCHANGE, this.handleFeatureChange_, this)\n ];\n };\n /**\n * @param {string} featureKey Unique identifier for the feature.\n * @param {import(\"../Feature.js\").default<Geometry>} feature The feature.\n * @return {boolean} The feature is \"valid\", in the sense that it is also a\n * candidate for insertion into the Rtree.\n * @private\n */\n VectorSource.prototype.addToIndex_ = function (featureKey, feature) {\n var valid = true;\n var id = feature.getId();\n if (id !== undefined) {\n if (!(id.toString() in this.idIndex_)) {\n this.idIndex_[id.toString()] = feature;\n }\n else {\n valid = false;\n }\n }\n if (valid) {\n assert(!(featureKey in this.uidIndex_), 30); // The passed `feature` was already added to the source\n this.uidIndex_[featureKey] = feature;\n }\n return valid;\n };\n /**\n * Add a batch of features to the source.\n * @param {Array<import(\"../Feature.js\").default<Geometry>>} features Features to add.\n * @api\n */\n VectorSource.prototype.addFeatures = function (features) {\n this.addFeaturesInternal(features);\n this.changed();\n };\n /**\n * Add features without firing a `change` event.\n * @param {Array<import(\"../Feature.js\").default<Geometry>>} features Features.\n * @protected\n */\n VectorSource.prototype.addFeaturesInternal = function (features) {\n var extents = [];\n var newFeatures = [];\n var geometryFeatures = [];\n for (var i = 0, length_1 = features.length; i < length_1; i++) {\n var feature = features[i];\n var featureKey = getUid(feature);\n if (this.addToIndex_(featureKey, feature)) {\n newFeatures.push(feature);\n }\n }\n for (var i = 0, length_2 = newFeatures.length; i < length_2; i++) {\n var feature = newFeatures[i];\n var featureKey = getUid(feature);\n this.setupChangeEvents_(featureKey, feature);\n var geometry = feature.getGeometry();\n if (geometry) {\n var extent = geometry.getExtent();\n extents.push(extent);\n geometryFeatures.push(feature);\n }\n else {\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n }\n if (this.featuresRtree_) {\n this.featuresRtree_.load(extents, geometryFeatures);\n }\n for (var i = 0, length_3 = newFeatures.length; i < length_3; i++) {\n this.dispatchEvent(new VectorSourceEvent(VectorEventType.ADDFEATURE, newFeatures[i]));\n }\n };\n /**\n * @param {!Collection<import(\"../Feature.js\").default<Geometry>>} collection Collection.\n * @private\n */\n VectorSource.prototype.bindFeaturesCollection_ = function (collection) {\n var modifyingCollection = false;\n this.addEventListener(VectorEventType.ADDFEATURE, \n /**\n * @param {VectorSourceEvent<Geometry>} evt The vector source event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n collection.push(evt.feature);\n modifyingCollection = false;\n }\n });\n this.addEventListener(VectorEventType.REMOVEFEATURE, \n /**\n * @param {VectorSourceEvent<Geometry>} evt The vector source event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n collection.remove(evt.feature);\n modifyingCollection = false;\n }\n });\n collection.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt The collection event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n this.addFeature(/** @type {import(\"../Feature.js\").default<Geometry>} */ (evt.element));\n modifyingCollection = false;\n }\n }.bind(this));\n collection.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt The collection event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n this.removeFeature(/** @type {import(\"../Feature.js\").default<Geometry>} */ (evt.element));\n modifyingCollection = false;\n }\n }.bind(this));\n this.featuresCollection_ = collection;\n };\n /**\n * Remove all features from the source.\n * @param {boolean=} opt_fast Skip dispatching of {@link module:ol/source/Vector.VectorSourceEvent#removefeature} events.\n * @api\n */\n VectorSource.prototype.clear = function (opt_fast) {\n if (opt_fast) {\n for (var featureId in this.featureChangeKeys_) {\n var keys = this.featureChangeKeys_[featureId];\n keys.forEach(unlistenByKey);\n }\n if (!this.featuresCollection_) {\n this.featureChangeKeys_ = {};\n this.idIndex_ = {};\n this.uidIndex_ = {};\n }\n }\n else {\n if (this.featuresRtree_) {\n this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this));\n for (var id in this.nullGeometryFeatures_) {\n this.removeFeatureInternal(this.nullGeometryFeatures_[id]);\n }\n }\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.clear();\n }\n if (this.featuresRtree_) {\n this.featuresRtree_.clear();\n }\n this.nullGeometryFeatures_ = {};\n var clearEvent = new VectorSourceEvent(VectorEventType.CLEAR);\n this.dispatchEvent(clearEvent);\n this.changed();\n };\n /**\n * Iterate through all features on the source, calling the provided callback\n * with each one. If the callback returns any \"truthy\" value, iteration will\n * stop and the function will return the same value.\n * Note: this function only iterate through the feature that have a defined geometry.\n *\n * @param {function(import(\"../Feature.js\").default<Geometry>): T} callback Called with each feature\n * on the source. Return a truthy value to stop iteration.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n VectorSource.prototype.forEachFeature = function (callback) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.forEach(callback);\n }\n else if (this.featuresCollection_) {\n this.featuresCollection_.forEach(callback);\n }\n };\n /**\n * Iterate through all features whose geometries contain the provided\n * coordinate, calling the callback with each feature. If the callback returns\n * a \"truthy\" value, iteration will stop and the function will return the same\n * value.\n *\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(import(\"../Feature.js\").default<Geometry>): T} callback Called with each feature\n * whose goemetry contains the provided coordinate.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n */\n VectorSource.prototype.forEachFeatureAtCoordinateDirect = function (coordinate, callback) {\n var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]];\n return this.forEachFeatureInExtent(extent, function (feature) {\n var geometry = feature.getGeometry();\n if (geometry.intersectsCoordinate(coordinate)) {\n return callback(feature);\n }\n else {\n return undefined;\n }\n });\n };\n /**\n * Iterate through all features whose bounding box intersects the provided\n * extent (note that the feature's geometry may not intersect the extent),\n * calling the callback with each feature. If the callback returns a \"truthy\"\n * value, iteration will stop and the function will return the same value.\n *\n * If you are interested in features whose geometry intersects an extent, call\n * the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent #forEachFeatureIntersectingExtent()} method instead.\n *\n * When `useSpatialIndex` is set to false, this method will loop through all\n * features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature #forEachFeature()}.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(import(\"../Feature.js\").default<Geometry>): T} callback Called with each feature\n * whose bounding box intersects the provided extent.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n VectorSource.prototype.forEachFeatureInExtent = function (extent, callback) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.forEachInExtent(extent, callback);\n }\n else if (this.featuresCollection_) {\n this.featuresCollection_.forEach(callback);\n }\n };\n /**\n * Iterate through all features whose geometry intersects the provided extent,\n * calling the callback with each feature. If the callback returns a \"truthy\"\n * value, iteration will stop and the function will return the same value.\n *\n * If you only want to test for bounding box intersection, call the\n * {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent #forEachFeatureInExtent()} method instead.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(import(\"../Feature.js\").default<Geometry>): T} callback Called with each feature\n * whose geometry intersects the provided extent.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n VectorSource.prototype.forEachFeatureIntersectingExtent = function (extent, callback) {\n return this.forEachFeatureInExtent(extent, \n /**\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature.\n * @return {T|undefined} The return value from the last call to the callback.\n */\n function (feature) {\n var geometry = feature.getGeometry();\n if (geometry.intersectsExtent(extent)) {\n var result = callback(feature);\n if (result) {\n return result;\n }\n }\n });\n };\n /**\n * Get the features collection associated with this source. Will be `null`\n * unless the source was configured with `useSpatialIndex` set to `false`, or\n * with an {@link module:ol/Collection} as `features`.\n * @return {Collection<import(\"../Feature.js\").default<Geometry>>} The collection of features.\n * @api\n */\n VectorSource.prototype.getFeaturesCollection = function () {\n return this.featuresCollection_;\n };\n /**\n * Get all features on the source in random order.\n * @return {Array<import(\"../Feature.js\").default<Geometry>>} Features.\n * @api\n */\n VectorSource.prototype.getFeatures = function () {\n var features;\n if (this.featuresCollection_) {\n features = this.featuresCollection_.getArray();\n }\n else if (this.featuresRtree_) {\n features = this.featuresRtree_.getAll();\n if (!isEmpty(this.nullGeometryFeatures_)) {\n extend(features, getValues(this.nullGeometryFeatures_));\n }\n }\n return (\n /** @type {Array<import(\"../Feature.js\").default<Geometry>>} */ (features));\n };\n /**\n * Get all features whose geometry intersects the provided coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {Array<import(\"../Feature.js\").default<Geometry>>} Features.\n * @api\n */\n VectorSource.prototype.getFeaturesAtCoordinate = function (coordinate) {\n var features = [];\n this.forEachFeatureAtCoordinateDirect(coordinate, function (feature) {\n features.push(feature);\n });\n return features;\n };\n /**\n * Get all features whose bounding box intersects the provided extent. Note that this returns an array of\n * all features intersecting the given extent in random order (so it may include\n * features whose geometries do not intersect the extent).\n *\n * When `useSpatialIndex` is set to false, this method will return all\n * features.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {Array<import(\"../Feature.js\").default<Geometry>>} Features.\n * @api\n */\n VectorSource.prototype.getFeaturesInExtent = function (extent) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.getInExtent(extent);\n }\n else if (this.featuresCollection_) {\n return this.featuresCollection_.getArray();\n }\n else {\n return [];\n }\n };\n /**\n * Get the closest feature to the provided coordinate.\n *\n * This method is not available when the source is configured with\n * `useSpatialIndex` set to `false`.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(import(\"../Feature.js\").default<Geometry>):boolean=} opt_filter Feature filter function.\n * The filter function will receive one argument, the {@link module:ol/Feature feature}\n * and it should return a boolean value. By default, no filtering is made.\n * @return {import(\"../Feature.js\").default<Geometry>} Closest feature.\n * @api\n */\n VectorSource.prototype.getClosestFeatureToCoordinate = function (coordinate, opt_filter) {\n // Find the closest feature using branch and bound. We start searching an\n // infinite extent, and find the distance from the first feature found. This\n // becomes the closest feature. We then compute a smaller extent which any\n // closer feature must intersect. We continue searching with this smaller\n // extent, trying to find a closer feature. Every time we find a closer\n // feature, we update the extent being searched so that any even closer\n // feature must intersect it. We continue until we run out of features.\n var x = coordinate[0];\n var y = coordinate[1];\n var closestFeature = null;\n var closestPoint = [NaN, NaN];\n var minSquaredDistance = Infinity;\n var extent = [-Infinity, -Infinity, Infinity, Infinity];\n var filter = opt_filter ? opt_filter : TRUE;\n this.featuresRtree_.forEachInExtent(extent, \n /**\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature.\n */\n function (feature) {\n if (filter(feature)) {\n var geometry = feature.getGeometry();\n var previousMinSquaredDistance = minSquaredDistance;\n minSquaredDistance = geometry.closestPointXY(x, y, closestPoint, minSquaredDistance);\n if (minSquaredDistance < previousMinSquaredDistance) {\n closestFeature = feature;\n // This is sneaky. Reduce the extent that it is currently being\n // searched while the R-Tree traversal using this same extent object\n // is still in progress. This is safe because the new extent is\n // strictly contained by the old extent.\n var minDistance = Math.sqrt(minSquaredDistance);\n extent[0] = x - minDistance;\n extent[1] = y - minDistance;\n extent[2] = x + minDistance;\n extent[3] = y + minDistance;\n }\n }\n });\n return closestFeature;\n };\n /**\n * Get the extent of the features currently in the source.\n *\n * This method is not available when the source is configured with\n * `useSpatialIndex` set to `false`.\n * @param {import(\"../extent.js\").Extent=} opt_extent Destination extent. If provided, no new extent\n * will be created. Instead, that extent's coordinates will be overwritten.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n VectorSource.prototype.getExtent = function (opt_extent) {\n return this.featuresRtree_.getExtent(opt_extent);\n };\n /**\n * Get a feature by its identifier (the value returned by feature.getId()).\n * Note that the index treats string and numeric identifiers as the same. So\n * `source.getFeatureById(2)` will return a feature with id `'2'` or `2`.\n *\n * @param {string|number} id Feature identifier.\n * @return {import(\"../Feature.js\").default<Geometry>} The feature (or `null` if not found).\n * @api\n */\n VectorSource.prototype.getFeatureById = function (id) {\n var feature = this.idIndex_[id.toString()];\n return feature !== undefined ? feature : null;\n };\n /**\n * Get a feature by its internal unique identifier (using `getUid`).\n *\n * @param {string} uid Feature identifier.\n * @return {import(\"../Feature.js\").default<Geometry>} The feature (or `null` if not found).\n */\n VectorSource.prototype.getFeatureByUid = function (uid) {\n var feature = this.uidIndex_[uid];\n return feature !== undefined ? feature : null;\n };\n /**\n * Get the format associated with this source.\n *\n * @return {import(\"../format/Feature.js\").default|undefined} The feature format.\n * @api\n */\n VectorSource.prototype.getFormat = function () {\n return this.format_;\n };\n /**\n * @return {boolean} The source can have overlapping geometries.\n */\n VectorSource.prototype.getOverlaps = function () {\n return this.overlaps_;\n };\n /**\n * Get the url associated with this source.\n *\n * @return {string|import(\"../featureloader.js\").FeatureUrlFunction|undefined} The url.\n * @api\n */\n VectorSource.prototype.getUrl = function () {\n return this.url_;\n };\n /**\n * @param {Event} event Event.\n * @private\n */\n VectorSource.prototype.handleFeatureChange_ = function (event) {\n var feature = /** @type {import(\"../Feature.js\").default<Geometry>} */ (event.target);\n var featureKey = getUid(feature);\n var geometry = feature.getGeometry();\n if (!geometry) {\n if (!(featureKey in this.nullGeometryFeatures_)) {\n if (this.featuresRtree_) {\n this.featuresRtree_.remove(feature);\n }\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n }\n else {\n var extent = geometry.getExtent();\n if (featureKey in this.nullGeometryFeatures_) {\n delete this.nullGeometryFeatures_[featureKey];\n if (this.featuresRtree_) {\n this.featuresRtree_.insert(extent, feature);\n }\n }\n else {\n if (this.featuresRtree_) {\n this.featuresRtree_.update(extent, feature);\n }\n }\n }\n var id = feature.getId();\n if (id !== undefined) {\n var sid = id.toString();\n if (this.idIndex_[sid] !== feature) {\n this.removeFromIdIndex_(feature);\n this.idIndex_[sid] = feature;\n }\n }\n else {\n this.removeFromIdIndex_(feature);\n this.uidIndex_[featureKey] = feature;\n }\n this.changed();\n this.dispatchEvent(new VectorSourceEvent(VectorEventType.CHANGEFEATURE, feature));\n };\n /**\n * Returns true if the feature is contained within the source.\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature.\n * @return {boolean} Has feature.\n * @api\n */\n VectorSource.prototype.hasFeature = function (feature) {\n var id = feature.getId();\n if (id !== undefined) {\n return id in this.idIndex_;\n }\n else {\n return getUid(feature) in this.uidIndex_;\n }\n };\n /**\n * @return {boolean} Is empty.\n */\n VectorSource.prototype.isEmpty = function () {\n return this.featuresRtree_.isEmpty() && isEmpty(this.nullGeometryFeatures_);\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n */\n VectorSource.prototype.loadFeatures = function (extent, resolution, projection) {\n var loadedExtentsRtree = this.loadedExtentsRtree_;\n var extentsToLoad = this.strategy_(extent, resolution);\n this.loading = false;\n var _loop_1 = function (i, ii) {\n var extentToLoad = extentsToLoad[i];\n var alreadyLoaded = loadedExtentsRtree.forEachInExtent(extentToLoad, \n /**\n * @param {{extent: import(\"../extent.js\").Extent}} object Object.\n * @return {boolean} Contains.\n */\n function (object) {\n return containsExtent(object.extent, extentToLoad);\n });\n if (!alreadyLoaded) {\n this_1.loader_.call(this_1, extentToLoad, resolution, projection);\n loadedExtentsRtree.insert(extentToLoad, { extent: extentToLoad.slice() });\n this_1.loading = this_1.loader_ !== VOID;\n }\n };\n var this_1 = this;\n for (var i = 0, ii = extentsToLoad.length; i < ii; ++i) {\n _loop_1(i, ii);\n }\n };\n /**\n * @inheritDoc\n */\n VectorSource.prototype.refresh = function () {\n this.clear(true);\n this.loadedExtentsRtree_.clear();\n _super.prototype.refresh.call(this);\n };\n /**\n * Remove an extent from the list of loaded extents.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n VectorSource.prototype.removeLoadedExtent = function (extent) {\n var loadedExtentsRtree = this.loadedExtentsRtree_;\n var obj;\n loadedExtentsRtree.forEachInExtent(extent, function (object) {\n if (equals(object.extent, extent)) {\n obj = object;\n return true;\n }\n });\n if (obj) {\n loadedExtentsRtree.remove(obj);\n }\n };\n /**\n * Remove a single feature from the source. If you want to remove all features\n * at once, use the {@link module:ol/source/Vector~VectorSource#clear #clear()} method\n * instead.\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature to remove.\n * @api\n */\n VectorSource.prototype.removeFeature = function (feature) {\n var featureKey = getUid(feature);\n if (featureKey in this.nullGeometryFeatures_) {\n delete this.nullGeometryFeatures_[featureKey];\n }\n else {\n if (this.featuresRtree_) {\n this.featuresRtree_.remove(feature);\n }\n }\n this.removeFeatureInternal(feature);\n this.changed();\n };\n /**\n * Remove feature without firing a `change` event.\n * @param {import(\"../Feature.js\").default<Geometry>} feature Feature.\n * @protected\n */\n VectorSource.prototype.removeFeatureInternal = function (feature) {\n var featureKey = getUid(feature);\n this.featureChangeKeys_[featureKey].forEach(unlistenByKey);\n delete this.featureChangeKeys_[featureKey];\n var id = feature.getId();\n if (id !== undefined) {\n delete this.idIndex_[id.toString()];\n }\n delete this.uidIndex_[featureKey];\n this.dispatchEvent(new VectorSourceEvent(VectorEventType.REMOVEFEATURE, feature));\n };\n /**\n * Remove a feature from the id index. Called internally when the feature id\n * may have changed.\n * @param {import(\"../Feature.js\").default<Geometry>} feature The feature.\n * @return {boolean} Removed the feature from the index.\n * @private\n */\n VectorSource.prototype.removeFromIdIndex_ = function (feature) {\n var removed = false;\n for (var id in this.idIndex_) {\n if (this.idIndex_[id] === feature) {\n delete this.idIndex_[id];\n removed = true;\n break;\n }\n }\n return removed;\n };\n /**\n * Set the new loader of the source. The next render cycle will use the\n * new loader.\n * @param {import(\"../featureloader.js\").FeatureLoader} loader The loader to set.\n * @api\n */\n VectorSource.prototype.setLoader = function (loader) {\n this.loader_ = loader;\n };\n /**\n * Points the source to a new url. The next render cycle will use the new url.\n * @param {string|import(\"../featureloader.js\").FeatureUrlFunction} url Url.\n * @api\n */\n VectorSource.prototype.setUrl = function (url) {\n assert(this.format_, 7); // `format` must be set when `url` is set\n this.setLoader(xhr(url, this.format_));\n };\n return VectorSource;\n}(Source));\nexport default VectorSource;\n//# sourceMappingURL=Vector.js.map","/**\n * @module ol/source/Cluster\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { getUid } from '../util.js';\nimport { assert } from '../asserts.js';\nimport Feature from '../Feature.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport { scale as scaleCoordinate, add as addCoordinate } from '../coordinate.js';\nimport EventType from '../events/EventType.js';\nimport { buffer, createEmpty, createOrUpdateFromCoordinate } from '../extent.js';\nimport Point from '../geom/Point.js';\nimport VectorSource from './Vector.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [distance=20] Minimum distance in pixels between clusters.\n * @property {function(Feature):Point} [geometryFunction]\n * Function that takes an {@link module:ol/Feature} as argument and returns an\n * {@link module:ol/geom/Point} as cluster calculation point for the feature. When a\n * feature should not be considered for clustering, the function should return\n * `null`. The default, which works when the underyling source contains point\n * features only, is\n * ```js\n * function(feature) {\n * return feature.getGeometry();\n * }\n * ```\n * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster\n * calculation point for polygons.\n * @property {VectorSource} source Source.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n */\n/**\n * @classdesc\n * Layer source to cluster vector data. Works out of the box with point\n * geometries. For other geometry types, or if not all geometries should be\n * considered for clustering, a custom `geometryFunction` can be defined.\n * @api\n */\nvar Cluster = /** @class */ (function (_super) {\n __extends(Cluster, _super);\n /**\n * @param {Options} options Cluster options.\n */\n function Cluster(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n wrapX: options.wrapX\n }) || this;\n /**\n * @type {number|undefined}\n * @protected\n */\n _this.resolution = undefined;\n /**\n * @type {number}\n * @protected\n */\n _this.distance = options.distance !== undefined ? options.distance : 20;\n /**\n * @type {Array<Feature>}\n * @protected\n */\n _this.features = [];\n /**\n * @param {Feature} feature Feature.\n * @return {Point} Cluster calculation point.\n * @protected\n */\n _this.geometryFunction = options.geometryFunction || function (feature) {\n var geometry = feature.getGeometry();\n assert(geometry.getType() == GeometryType.POINT, 10); // The default `geometryFunction` can only handle `Point` geometries\n return geometry;\n };\n /**\n * @type {VectorSource}\n * @protected\n */\n _this.source = options.source;\n _this.source.addEventListener(EventType.CHANGE, _this.refresh.bind(_this));\n return _this;\n }\n /**\n * Get the distance in pixels between clusters.\n * @return {number} Distance.\n * @api\n */\n Cluster.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get a reference to the wrapped source.\n * @return {VectorSource} Source.\n * @api\n */\n Cluster.prototype.getSource = function () {\n return this.source;\n };\n /**\n * @inheritDoc\n */\n Cluster.prototype.loadFeatures = function (extent, resolution, projection) {\n this.source.loadFeatures(extent, resolution, projection);\n if (resolution !== this.resolution) {\n this.clear();\n this.resolution = resolution;\n this.cluster();\n this.addFeatures(this.features);\n }\n };\n /**\n * Set the distance in pixels between clusters.\n * @param {number} distance The distance in pixels.\n * @api\n */\n Cluster.prototype.setDistance = function (distance) {\n this.distance = distance;\n this.refresh();\n };\n /**\n * handle the source changing\n * @override\n */\n Cluster.prototype.refresh = function () {\n this.clear();\n this.cluster();\n this.addFeatures(this.features);\n };\n /**\n * @protected\n */\n Cluster.prototype.cluster = function () {\n if (this.resolution === undefined) {\n return;\n }\n this.features.length = 0;\n var extent = createEmpty();\n var mapDistance = this.distance * this.resolution;\n var features = this.source.getFeatures();\n /**\n * @type {!Object<string, boolean>}\n */\n var clustered = {};\n for (var i = 0, ii = features.length; i < ii; i++) {\n var feature = features[i];\n if (!(getUid(feature) in clustered)) {\n var geometry = this.geometryFunction(feature);\n if (geometry) {\n var coordinates = geometry.getCoordinates();\n createOrUpdateFromCoordinate(coordinates, extent);\n buffer(extent, mapDistance, extent);\n var neighbors = this.source.getFeaturesInExtent(extent);\n neighbors = neighbors.filter(function (neighbor) {\n var uid = getUid(neighbor);\n if (!(uid in clustered)) {\n clustered[uid] = true;\n return true;\n }\n else {\n return false;\n }\n });\n this.features.push(this.createCluster(neighbors));\n }\n }\n }\n };\n /**\n * @param {Array<Feature>} features Features\n * @return {Feature} The cluster feature.\n * @protected\n */\n Cluster.prototype.createCluster = function (features) {\n var centroid = [0, 0];\n for (var i = features.length - 1; i >= 0; --i) {\n var geometry = this.geometryFunction(features[i]);\n if (geometry) {\n addCoordinate(centroid, geometry.getCoordinates());\n }\n else {\n features.splice(i, 1);\n }\n }\n scaleCoordinate(centroid, 1 / features.length);\n var cluster = new Feature(new Point(centroid));\n cluster.set('features', features);\n return cluster;\n };\n return Cluster;\n}(VectorSource));\nexport default Cluster;\n//# sourceMappingURL=Cluster.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/Zoomify\n */\nimport { DEFAULT_TILE_SIZE } from '../tilegrid/common.js';\nimport ImageTile from '../ImageTile.js';\nimport TileState from '../TileState.js';\nimport { expandUrl, createFromTileUrlFunctions } from '../tileurlfunction.js';\nimport { assert } from '../asserts.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport { getTopLeft } from '../extent.js';\nimport { toSize } from '../size.js';\nimport TileImage from './TileImage.js';\nimport TileGrid from '../tilegrid/TileGrid.js';\n/**\n * @enum {string}\n */\nvar TierSizeCalculation = {\n DEFAULT: 'default',\n TRUNCATED: 'truncated'\n};\nvar CustomTile = /** @class */ (function (_super) {\n __extends(CustomTile, _super);\n /**\n * @param {number} tilePixelRatio Tile pixel ratio to display the tile\n * @param {import(\"../tilegrid/TileGrid.js\").default} tileGrid TileGrid that the tile belongs to.\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {TileState} state State.\n * @param {string} src Image source URI.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../Tile.js\").LoadFunction} tileLoadFunction Tile load function.\n * @param {import(\"../Tile.js\").Options=} opt_options Tile options.\n */\n function CustomTile(tilePixelRatio, tileGrid, tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {\n var _this = _super.call(this, tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) || this;\n /**\n * @private\n * @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement}\n */\n _this.zoomifyImage_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.tileSize_ = toSize(tileGrid.getTileSize(tileCoord[0])).map(function (x) {\n return x * tilePixelRatio;\n });\n return _this;\n }\n /**\n * @inheritDoc\n */\n CustomTile.prototype.getImage = function () {\n if (this.zoomifyImage_) {\n return this.zoomifyImage_;\n }\n var image = _super.prototype.getImage.call(this);\n if (this.state == TileState.LOADED) {\n var tileSize = this.tileSize_;\n if (image.width == tileSize[0] && image.height == tileSize[1]) {\n this.zoomifyImage_ = image;\n return image;\n }\n else {\n var context = createCanvasContext2D(tileSize[0], tileSize[1]);\n context.drawImage(image, 0, 0);\n this.zoomifyImage_ = context.canvas;\n return context.canvas;\n }\n }\n else {\n return image;\n }\n };\n return CustomTile;\n}(ImageTile));\nexport { CustomTile };\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection.\n * @property {number} [tilePixelRatio] The pixel ratio used by the tile service. For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px by 512px images (for retina/hidpi devices) then `tilePixelRatio` should be set to `2`\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {string} [url] URL template or base URL of the Zoomify service.\n * A base URL is the fixed part\n * of the URL, excluding the tile group, z, x, and y folder structure, e.g.\n * `http://my.zoomify.info/IMAGE.TIF/`. A URL template must include\n * `{TileGroup}`, `{x}`, `{y}`, and `{z}` placeholders, e.g.\n * `http://my.zoomify.info/IMAGE.TIF/{TileGroup}/{z}-{x}-{y}.jpg`.\n * Internet Imaging Protocol (IIP) with JTL extension can be also used with\n * `{tileIndex}` and `{z}` placeholders, e.g.\n * `http://my.zoomify.info?FIF=IMAGE.TIF&JTL={z},{tileIndex}`.\n * A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be\n * used instead of defining each one separately in the `urls` option.\n * @property {string} [tierSizeCalculation] Tier size calculation method: `default` or `truncated`.\n * @property {import(\"../size.js\").Size} [size] Size of the image.\n * @property {import(\"../extent.js\").Extent} [extent] Extent for the TileGrid that is created.\n * Default sets the TileGrid in the\n * fourth quadrant, meaning extent is `[0, -height, width, 0]`. To change the\n * extent to the first quadrant (the default for OpenLayers 2) set the extent\n * as `[0, 0, width, height]`.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n * @property {number} [tileSize=256] Tile size. Same tile size is used for all zoom levels.\n * @property {number} [zDirection=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n */\n/**\n * @classdesc\n * Layer source for tile data in Zoomify format (both Zoomify and Internet\n * Imaging Protocol are supported).\n * @api\n */\nvar Zoomify = /** @class */ (function (_super) {\n __extends(Zoomify, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Zoomify(opt_options) {\n var _this = this;\n var options = opt_options || {};\n var size = options.size;\n var tierSizeCalculation = options.tierSizeCalculation !== undefined ?\n options.tierSizeCalculation :\n TierSizeCalculation.DEFAULT;\n var imageWidth = size[0];\n var imageHeight = size[1];\n var extent = options.extent || [0, -size[1], size[0], 0];\n var tierSizeInTiles = [];\n var tileSize = options.tileSize || DEFAULT_TILE_SIZE;\n var tilePixelRatio = options.tilePixelRatio || 1;\n var tileSizeForTierSizeCalculation = tileSize;\n switch (tierSizeCalculation) {\n case TierSizeCalculation.DEFAULT:\n while (imageWidth > tileSizeForTierSizeCalculation || imageHeight > tileSizeForTierSizeCalculation) {\n tierSizeInTiles.push([\n Math.ceil(imageWidth / tileSizeForTierSizeCalculation),\n Math.ceil(imageHeight / tileSizeForTierSizeCalculation)\n ]);\n tileSizeForTierSizeCalculation += tileSizeForTierSizeCalculation;\n }\n break;\n case TierSizeCalculation.TRUNCATED:\n var width = imageWidth;\n var height = imageHeight;\n while (width > tileSizeForTierSizeCalculation || height > tileSizeForTierSizeCalculation) {\n tierSizeInTiles.push([\n Math.ceil(width / tileSizeForTierSizeCalculation),\n Math.ceil(height / tileSizeForTierSizeCalculation)\n ]);\n width >>= 1;\n height >>= 1;\n }\n break;\n default:\n assert(false, 53); // Unknown `tierSizeCalculation` configured\n break;\n }\n tierSizeInTiles.push([1, 1]);\n tierSizeInTiles.reverse();\n var resolutions = [1];\n var tileCountUpToTier = [0];\n for (var i = 1, ii = tierSizeInTiles.length; i < ii; i++) {\n resolutions.push(1 << i);\n tileCountUpToTier.push(tierSizeInTiles[i - 1][0] * tierSizeInTiles[i - 1][1] +\n tileCountUpToTier[i - 1]);\n }\n resolutions.reverse();\n var tileGrid = new TileGrid({\n tileSize: tileSize,\n extent: extent,\n origin: getTopLeft(extent),\n resolutions: resolutions\n });\n var url = options.url;\n if (url && url.indexOf('{TileGroup}') == -1 && url.indexOf('{tileIndex}') == -1) {\n url += '{TileGroup}/{z}-{x}-{y}.jpg';\n }\n var urls = expandUrl(url);\n /**\n * @param {string} template Template.\n * @return {import(\"../Tile.js\").UrlFunction} Tile URL function.\n */\n function createFromTemplate(template) {\n return (\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile Coordinate.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {string|undefined} Tile URL.\n */\n function (tileCoord, pixelRatio, projection) {\n if (!tileCoord) {\n return undefined;\n }\n else {\n var tileCoordZ = tileCoord[0];\n var tileCoordX = tileCoord[1];\n var tileCoordY = tileCoord[2];\n var tileIndex = tileCoordX +\n tileCoordY * tierSizeInTiles[tileCoordZ][0];\n var tileSize_1 = tileGrid.getTileSize(tileCoordZ);\n var tileWidth = Array.isArray(tileSize_1) ? tileSize_1[0] : tileSize_1;\n var tileGroup = ((tileIndex + tileCountUpToTier[tileCoordZ]) / tileWidth) | 0;\n var localContext_1 = {\n 'z': tileCoordZ,\n 'x': tileCoordX,\n 'y': tileCoordY,\n 'tileIndex': tileIndex,\n 'TileGroup': 'TileGroup' + tileGroup\n };\n return template.replace(/\\{(\\w+?)\\}/g, function (m, p) {\n return localContext_1[p];\n });\n }\n });\n }\n var tileUrlFunction = createFromTileUrlFunctions(urls.map(createFromTemplate));\n var ZoomifyTileClass = CustomTile.bind(null, tilePixelRatio, tileGrid);\n _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n projection: options.projection,\n tilePixelRatio: tilePixelRatio,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileClass: ZoomifyTileClass,\n tileGrid: tileGrid,\n tileUrlFunction: tileUrlFunction,\n transition: options.transition\n }) || this;\n /**\n * @inheritDoc\n */\n _this.zDirection = options.zDirection;\n return _this;\n }\n return Zoomify;\n}(TileImage));\nexport default Zoomify;\n//# sourceMappingURL=Zoomify.js.map","/**\n * @module ol/format/IIIFInfo\n */\nimport { assert } from '../asserts.js';\n/**\n * @typedef {Object} PreferredOptions\n * @property {string} [format] Preferred image format. Will be used if the image information\n * indicates support for that format.\n * @property {string} [quality] IIIF image qualitiy. Will be used if the image information\n * indicates support for that quality.\n */\n/**\n * @typedef {Object} SupportedFeatures\n * @property {Array<string>} [supports] Supported IIIF image size and region\n * calculation features.\n * @property {Array<string>} [formats] Supported image formats.\n * @property {Array<string>} [qualities] Supported IIIF image qualities.\n */\n/**\n * @typedef {Object} TileInfo\n * @property {Array<number>} scaleFactors Supported resolution scaling factors.\n * @property {number} width Tile width in pixels.\n * @property {number} [height] Tile height in pixels. Same as tile width if height is\n * not given.\n */\n/**\n * @typedef {Object} IiifProfile\n * @property {Array<string>} [formats] Supported image formats for the image service.\n * @property {Array<string>} [qualities] Supported IIIF image qualities.\n * @property {Array<string>} [supports] Supported features.\n * @property {number} [maxArea] Maximum area (pixels) available for this image service.\n * @property {number} [maxHeight] Maximum height.\n * @property {number} [maxWidth] Maximum width.\n */\n/**\n * @typedef {Object<string,string|number|Array<number|string|IiifProfile>|Object<string, number>|TileInfo>}\n * ImageInformationResponse\n */\n/**\n * Enum representing the major IIIF Image API versions\n * @enum {string}\n */\nvar Versions = {\n VERSION1: 'version1',\n VERSION2: 'version2',\n VERSION3: 'version3'\n};\n/**\n * Supported image formats, qualities and supported region / size calculation features\n * for different image API versions and compliance levels\n * @const\n * @type {Object<string, Object<string, SupportedFeatures>>}\n */\nvar IIIF_PROFILE_VALUES = {};\nIIIF_PROFILE_VALUES[Versions.VERSION1] = {\n 'level0': {\n supports: [],\n formats: [],\n qualities: ['native']\n },\n 'level1': {\n supports: ['regionByPx', 'sizeByW', 'sizeByH', 'sizeByPct'],\n formats: ['jpg'],\n qualities: ['native']\n },\n 'level2': {\n supports: ['regionByPx', 'regionByPct', 'sizeByW', 'sizeByH', 'sizeByPct',\n 'sizeByConfinedWh', 'sizeByWh'],\n formats: ['jpg', 'png'],\n qualities: ['native', 'color', 'grey', 'bitonal']\n }\n};\nIIIF_PROFILE_VALUES[Versions.VERSION2] = {\n 'level0': {\n supports: [],\n formats: ['jpg'],\n qualities: ['default']\n },\n 'level1': {\n supports: ['regionByPx', 'sizeByW', 'sizeByH', 'sizeByPct'],\n formats: ['jpg'],\n qualities: ['default']\n },\n 'level2': {\n supports: ['regionByPx', 'regionByPct', 'sizeByW', 'sizeByH', 'sizeByPct',\n 'sizeByConfinedWh', 'sizeByDistortedWh', 'sizeByWh'],\n formats: ['jpg', 'png'],\n qualities: ['default', 'bitonal']\n }\n};\nIIIF_PROFILE_VALUES[Versions.VERSION3] = {\n 'level0': {\n supports: [],\n formats: ['jpg'],\n qualities: ['default']\n },\n 'level1': {\n supports: ['regionByPx', 'regionSquare', 'sizeByW', 'sizeByH', 'sizeByWh'],\n formats: ['jpg'],\n qualities: ['default']\n },\n 'level2': {\n supports: ['regionByPx', 'regionSquare', 'regionByPct',\n 'sizeByW', 'sizeByH', 'sizeByPct', 'sizeByConfinedWh', 'sizeByWh'],\n formats: ['jpg', 'png'],\n qualities: ['default']\n }\n};\nIIIF_PROFILE_VALUES['none'] = {\n 'none': {\n supports: [],\n formats: [],\n qualities: []\n }\n};\nvar COMPLIANCE_VERSION1 = new RegExp('^https?\\:\\/\\/library\\.stanford\\.edu\\/iiif\\/image-api\\/(1\\.1\\/)?compliance\\.html#level[0-2]$');\nvar COMPLIANCE_VERSION2 = new RegExp('^https?\\:\\/\\/iiif\\.io\\/api\\/image\\/2\\/level[0-2](\\.json)?$');\nvar COMPLIANCE_VERSION3 = new RegExp('(^https?\\:\\/\\/iiif\\.io\\/api\\/image\\/3\\/level[0-2](\\.json)?$)|(^level[0-2]$)');\nfunction generateVersion1Options(iiifInfo) {\n var levelProfile = iiifInfo.getComplianceLevelSupportedFeatures();\n // Version 1.0 and 1.1 do not require a profile.\n if (levelProfile === undefined) {\n levelProfile = IIIF_PROFILE_VALUES[Versions.VERSION1]['level0'];\n }\n return {\n url: iiifInfo.imageInfo['@id'] === undefined ? undefined : iiifInfo.imageInfo['@id'].replace(/\\/?(info.json)?$/g, ''),\n supports: levelProfile.supports,\n formats: levelProfile.formats.concat([iiifInfo.imageInfo.formats === undefined ?\n [] : iiifInfo.imageInfo.formats]),\n qualities: levelProfile.qualities.concat([iiifInfo.imageInfo.qualities === undefined ?\n [] : iiifInfo.imageInfo.qualities]),\n resolutions: iiifInfo.imageInfo.scale_factors,\n tileSize: iiifInfo.imageInfo.tile_width !== undefined ? (iiifInfo.imageInfo.tile_height !== undefined ?\n [iiifInfo.imageInfo.tile_width, iiifInfo.imageInfo.tile_height] : [iiifInfo.imageInfo.tile_width, iiifInfo.imageInfo.tile_width]) :\n (iiifInfo.imageInfo.tile_height != undefined ? [iiifInfo.imageInfo.tile_height, iiifInfo.imageInfo.tile_height] : undefined)\n };\n}\nfunction generateVersion2Options(iiifInfo) {\n var levelProfile = iiifInfo.getComplianceLevelSupportedFeatures(), additionalProfile = Array.isArray(iiifInfo.imageInfo.profile) && iiifInfo.imageInfo.profile.length > 1, profileSupports = additionalProfile && iiifInfo.imageInfo.profile[1].supports ? iiifInfo.imageInfo.profile[1].supports : [], profileFormats = additionalProfile && iiifInfo.imageInfo.profile[1].formats ? iiifInfo.imageInfo.profile[1].formats : [], profileQualities = additionalProfile && iiifInfo.imageInfo.profile[1].qualities ? iiifInfo.imageInfo.profile[1].qualities : [];\n return {\n url: iiifInfo.imageInfo['@id'].replace(/\\/?(info.json)?$/g, ''),\n sizes: iiifInfo.imageInfo.sizes === undefined ? undefined : iiifInfo.imageInfo.sizes.map(function (size) {\n return [size.width, size.height];\n }),\n tileSize: iiifInfo.imageInfo.tiles === undefined ? undefined : [\n iiifInfo.imageInfo.tiles.map(function (tile) {\n return tile.width;\n })[0],\n iiifInfo.imageInfo.tiles.map(function (tile) {\n return tile.height === undefined ? tile.width : tile.height;\n })[0]\n ],\n resolutions: iiifInfo.imageInfo.tiles === undefined ? undefined :\n iiifInfo.imageInfo.tiles.map(function (tile) {\n return tile.scaleFactors;\n })[0],\n supports: levelProfile.supports.concat(profileSupports),\n formats: levelProfile.formats.concat(profileFormats),\n qualities: levelProfile.qualities.concat(profileQualities)\n };\n}\nfunction generateVersion3Options(iiifInfo) {\n var levelProfile = iiifInfo.getComplianceLevelSupportedFeatures(), formats = iiifInfo.imageInfo.extraFormats === undefined ? levelProfile.formats : levelProfile.formats.concat(iiifInfo.imageInfo.extraFormats), preferredFormat = iiifInfo.imageInfo.preferredFormats !== undefined && Array.isArray(iiifInfo.imageInfo.preferredFormats) &&\n iiifInfo.imageInfo.preferredFormats.length > 0 ?\n iiifInfo.imageInfo.preferredFormats.filter(function (format) {\n return ['jpg', 'png', 'gif'].includes(format);\n }).reduce(function (acc, format) {\n return acc === undefined && formats.includes(format) ? format : acc;\n }, undefined) : undefined;\n return {\n url: iiifInfo.imageInfo['id'],\n sizes: iiifInfo.imageInfo.sizes === undefined ? undefined : iiifInfo.imageInfo.sizes.map(function (size) {\n return [size.width, size.height];\n }),\n tileSize: iiifInfo.imageInfo.tiles === undefined ? undefined : [\n iiifInfo.imageInfo.tiles.map(function (tile) {\n return tile.width;\n })[0],\n iiifInfo.imageInfo.tiles.map(function (tile) {\n return tile.height;\n })[0]\n ],\n resolutions: iiifInfo.imageInfo.tiles === undefined ? undefined :\n iiifInfo.imageInfo.tiles.map(function (tile) {\n return tile.scaleFactors;\n })[0],\n supports: iiifInfo.imageInfo.extraFeatures === undefined ? levelProfile.supports : levelProfile.supports.concat(iiifInfo.imageInfo.extraFeatures),\n formats: formats,\n qualities: iiifInfo.imageInfo.extraQualities === undefined ? levelProfile.qualities : levelProfile.qualities.concat(iiifInfo.imageInfo.extraQualities),\n preferredFormat: preferredFormat\n };\n}\nvar versionFunctions = {};\nversionFunctions[Versions.VERSION1] = generateVersion1Options;\nversionFunctions[Versions.VERSION2] = generateVersion2Options;\nversionFunctions[Versions.VERSION3] = generateVersion3Options;\n/**\n * @classdesc\n * Format for transforming IIIF Image API image information responses into\n * IIIF tile source ready options\n *\n * @api\n */\nvar IIIFInfo = /** @class */ (function () {\n /**\n * @param {string|ImageInformationResponse} imageInfo\n * Deserialized image information JSON response object or JSON response as string\n */\n function IIIFInfo(imageInfo) {\n this.setImageInfo(imageInfo);\n }\n /**\n * @param {string|ImageInformationResponse} imageInfo\n * Deserialized image information JSON response object or JSON response as string\n * @api\n */\n IIIFInfo.prototype.setImageInfo = function (imageInfo) {\n if (typeof imageInfo == 'string') {\n this.imageInfo = JSON.parse(imageInfo);\n }\n else {\n this.imageInfo = imageInfo;\n }\n };\n /**\n * @returns {Versions} Major IIIF version.\n * @api\n */\n IIIFInfo.prototype.getImageApiVersion = function () {\n if (this.imageInfo === undefined) {\n return;\n }\n var context = this.imageInfo['@context'] || 'ol-no-context';\n if (typeof context == 'string') {\n context = [context];\n }\n for (var i = 0; i < context.length; i++) {\n switch (context[i]) {\n case 'http://library.stanford.edu/iiif/image-api/1.1/context.json':\n case 'http://iiif.io/api/image/1/context.json':\n return Versions.VERSION1;\n case 'http://iiif.io/api/image/2/context.json':\n return Versions.VERSION2;\n case 'http://iiif.io/api/image/3/context.json':\n return Versions.VERSION3;\n case 'ol-no-context':\n // Image API 1.0 has no '@context'\n if (this.getComplianceLevelEntryFromProfile(Versions.VERSION1) && this.imageInfo.identifier) {\n return Versions.VERSION1;\n }\n break;\n default:\n }\n }\n assert(false, 61);\n };\n /**\n * @param {Versions} version Optional IIIF image API version\n * @returns {string} Compliance level as it appears in the IIIF image information\n * response.\n */\n IIIFInfo.prototype.getComplianceLevelEntryFromProfile = function (version) {\n if (this.imageInfo === undefined || this.imageInfo.profile === undefined) {\n return;\n }\n if (version === undefined) {\n version = this.getImageApiVersion();\n }\n switch (version) {\n case Versions.VERSION1:\n if (COMPLIANCE_VERSION1.test(this.imageInfo.profile)) {\n return this.imageInfo.profile;\n }\n break;\n case Versions.VERSION3:\n if (COMPLIANCE_VERSION3.test(this.imageInfo.profile)) {\n return this.imageInfo.profile;\n }\n break;\n case Versions.VERSION2:\n if (typeof this.imageInfo.profile === 'string' && COMPLIANCE_VERSION2.test(this.imageInfo.profile)) {\n return this.imageInfo.profile;\n }\n if (Array.isArray(this.imageInfo.profile) && this.imageInfo.profile.length > 0\n && typeof this.imageInfo.profile[0] === 'string' && COMPLIANCE_VERSION2.test(this.imageInfo.profile[0])) {\n return this.imageInfo.profile[0];\n }\n break;\n default:\n }\n };\n /**\n * @param {Versions} version Optional IIIF image API version\n * @returns {string} Compliance level, on of 'level0', 'level1' or 'level2' or undefined\n */\n IIIFInfo.prototype.getComplianceLevelFromProfile = function (version) {\n var complianceLevel = this.getComplianceLevelEntryFromProfile(version);\n if (complianceLevel === undefined) {\n return undefined;\n }\n var level = complianceLevel.match(/level[0-2](\\.json)?$/g);\n return Array.isArray(level) ? level[0].replace('.json', '') : undefined;\n };\n /**\n * @returns {SupportedFeatures} Image formats, qualities and region / size calculation\n * methods that are supported by the IIIF service.\n */\n IIIFInfo.prototype.getComplianceLevelSupportedFeatures = function () {\n if (this.imageInfo === undefined) {\n return;\n }\n var version = this.getImageApiVersion();\n var level = this.getComplianceLevelFromProfile(version);\n if (level === undefined) {\n return IIIF_PROFILE_VALUES['none']['none'];\n }\n return IIIF_PROFILE_VALUES[version][level];\n };\n /**\n * @param {PreferredOptions} opt_preferredOptions Optional options for preferred format and quality.\n * @returns {import(\"../source/IIIF.js\").Options} IIIF tile source ready constructor options.\n * @api\n */\n IIIFInfo.prototype.getTileSourceOptions = function (opt_preferredOptions) {\n var options = opt_preferredOptions || {}, version = this.getImageApiVersion();\n if (version === undefined) {\n return;\n }\n var imageOptions = version === undefined ? undefined : versionFunctions[version](this);\n if (imageOptions === undefined) {\n return;\n }\n return {\n url: imageOptions.url,\n version: version,\n size: [this.imageInfo.width, this.imageInfo.height],\n sizes: imageOptions.sizes,\n format: options.format !== undefined && imageOptions.formats.includes(options.format) ? options.format :\n imageOptions.preferredFormat !== undefined ? imageOptions.preferredFormat : 'jpg',\n supports: imageOptions.supports,\n quality: options.quality && imageOptions.qualities.includes(options.quality) ?\n options.quality : imageOptions.qualities.includes('native') ? 'native' : 'default',\n resolutions: Array.isArray(imageOptions.resolutions) ? imageOptions.resolutions.sort(function (a, b) {\n return b - a;\n }) : undefined,\n tileSize: imageOptions.tileSize\n };\n };\n return IIIFInfo;\n}());\nexport default IIIFInfo;\nexport { Versions };\n//# sourceMappingURL=IIIFInfo.js.map","/**\n * @module ol/source/IIIF\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DEFAULT_TILE_SIZE } from '../tilegrid/common.js';\nimport { getTopLeft } from '../extent.js';\nimport { CustomTile } from './Zoomify.js';\nimport { Versions } from '../format/IIIFInfo.js';\nimport { assert } from '../asserts.js';\nimport TileGrid from '../tilegrid/TileGrid.js';\nimport TileImage from './TileImage.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {number} [cacheSize]\n * @property {null|string} [crossOrigin]\n * @property {import(\"../extent.js\").Extent} [extent=[0, -height, width, 0]]\n * @property {string} [format='jpg'] Requested image format.\n * @property {import(\"../proj.js\").ProjectionLike} [projection]\n * @property {string} [quality] Requested IIIF image quality. Default is 'native'\n * for version 1, 'default' for versions 2 and 3.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {Array<number>} [resolutions] Supported resolutions as given in IIIF 'scaleFactors'\n * @property {import(\"../size.js\").Size} size Size of the image [width, height].\n * @property {Array<import(\"../size.js\").Size>} [sizes] Supported scaled image sizes.\n * Content of the IIIF info.json 'sizes' property, but as array of Size objects.\n * @property {import(\"./State.js\").default} [state] Source state.\n * @property {Array<string>} [supports=[]] Supported IIIF region and size calculation\n * features.\n * @property {number} [tilePixelRatio]\n * @property {number|import(\"../size.js\").Size} [tileSize] Tile size.\n * Same tile size is used for all zoom levels. If tile size is a number,\n * a square tile is assumed. If the IIIF image service supports arbitrary\n * tiling (sizeByH, sizeByW, sizeByWh or sizeByPct as well as regionByPx or regionByPct\n * are supported), the default tilesize is 256.\n * @property {number} [transition]\n * @property {string} [url] Base URL of the IIIF Image service.\n * This should be the same as the IIIF Image ID.\n * @property {Versions} [version=Versions.VERSION2] Service's IIIF Image API version.\n * @property {number} [zDirection=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n */\nfunction formatPercentage(percentage) {\n return percentage.toLocaleString('en', { maximumFractionDigits: 10 });\n}\n/**\n * @classdesc\n * Layer source for IIIF Image API services.\n * @api\n */\nvar IIIF = /** @class */ (function (_super) {\n __extends(IIIF, _super);\n /**\n * @param {Options} opt_options Tile source options. Use {@link import(\"../format/IIIFInfo.js\").IIIFInfo}\n * to parse Image API service information responses into constructor options.\n * @api\n */\n function IIIF(opt_options) {\n var _this = this;\n /**\n * @type {Partial<Options>}\n */\n var options = opt_options || {};\n var baseUrl = options.url || '';\n baseUrl = baseUrl + (baseUrl.lastIndexOf('/') === baseUrl.length - 1 || baseUrl === '' ? '' : '/');\n var version = options.version || Versions.VERSION2;\n var sizes = options.sizes || [];\n var size = options.size;\n assert(size != undefined && Array.isArray(size) && size.length == 2 &&\n !isNaN(size[0]) && size[0] > 0 && !isNaN(size[1]) && size[1] > 0, 60);\n var width = size[0];\n var height = size[1];\n var tileSize = options.tileSize;\n var tilePixelRatio = options.tilePixelRatio || 1;\n var format = options.format || 'jpg';\n var quality = options.quality || (options.version == Versions.VERSION1 ? 'native' : 'default');\n var resolutions = options.resolutions || [];\n var supports = options.supports || [];\n var extent = options.extent || [0, -height, width, 0];\n var supportsListedSizes = sizes != undefined && Array.isArray(sizes) && sizes.length > 0;\n var supportsListedTiles = tileSize != undefined && (typeof tileSize === 'number' && Number.isInteger(tileSize) && tileSize > 0 || Array.isArray(tileSize) && tileSize.length > 0);\n var supportsArbitraryTiling = supports != undefined && Array.isArray(supports) &&\n (supports.includes('regionByPx') || supports.includes('regionByPct')) &&\n (supports.includes('sizeByWh') || supports.includes('sizeByH') ||\n supports.includes('sizeByW') || supports.includes('sizeByPct'));\n var tileWidth, tileHeight, maxZoom;\n resolutions.sort(function (a, b) {\n return b - a;\n });\n if (supportsListedTiles || supportsArbitraryTiling) {\n if (tileSize != undefined) {\n if (typeof tileSize === 'number' && Number.isInteger(tileSize) && tileSize > 0) {\n tileWidth = tileSize;\n tileHeight = tileSize;\n }\n else if (Array.isArray(tileSize) && tileSize.length > 0) {\n if (tileSize.length == 1 || tileSize[1] == undefined && Number.isInteger(tileSize[0])) {\n tileWidth = tileSize[0];\n tileHeight = tileSize[0];\n }\n if (tileSize.length == 2) {\n if (Number.isInteger(tileSize[0]) && Number.isInteger(tileSize[1])) {\n tileWidth = tileSize[0];\n tileHeight = tileSize[1];\n }\n else if (tileSize[0] == undefined && Number.isInteger(tileSize[1])) {\n tileWidth = tileSize[1];\n tileHeight = tileSize[1];\n }\n }\n }\n }\n if (tileWidth === undefined || tileHeight === undefined) {\n tileWidth = DEFAULT_TILE_SIZE;\n tileHeight = DEFAULT_TILE_SIZE;\n }\n if (resolutions.length == 0) {\n maxZoom = Math.max(Math.ceil(Math.log(width / tileWidth) / Math.LN2), Math.ceil(Math.log(height / tileHeight) / Math.LN2));\n for (var i = maxZoom; i >= 0; i--) {\n resolutions.push(Math.pow(2, i));\n }\n }\n else {\n var maxScaleFactor = Math.max.apply(Math, resolutions);\n // TODO maxScaleFactor might not be a power to 2\n maxZoom = Math.round(Math.log(maxScaleFactor) / Math.LN2);\n }\n }\n else {\n // No tile support.\n tileWidth = width;\n tileHeight = height;\n resolutions = [];\n if (supportsListedSizes) {\n /*\n * 'sizes' provided. Use full region in different resolutions. Every\n * resolution has only one tile.\n */\n sizes.sort(function (a, b) {\n return a[0] - b[0];\n });\n maxZoom = -1;\n var ignoredSizesIndex = [];\n for (var i = 0; i < sizes.length; i++) {\n var resolution = width / sizes[i][0];\n if (resolutions.length > 0 && resolutions[resolutions.length - 1] == resolution) {\n ignoredSizesIndex.push(i);\n continue;\n }\n resolutions.push(resolution);\n maxZoom++;\n }\n if (ignoredSizesIndex.length > 0) {\n for (var i = 0; i < ignoredSizesIndex.length; i++) {\n sizes.splice(ignoredSizesIndex[i] - i, 1);\n }\n }\n }\n else {\n // No useful image information at all. Try pseudo tile with full image.\n resolutions.push(1);\n sizes.push([width, height]);\n maxZoom = 0;\n }\n }\n var tileGrid = new TileGrid({\n tileSize: [tileWidth, tileHeight],\n extent: extent,\n origin: getTopLeft(extent),\n resolutions: resolutions\n });\n var tileUrlFunction = function (tileCoord, pixelRatio, projection) {\n var regionParam, sizeParam;\n var zoom = tileCoord[0];\n if (zoom > maxZoom) {\n return;\n }\n var tileX = tileCoord[1], tileY = tileCoord[2], scale = resolutions[zoom];\n if (tileX === undefined || tileY === undefined || scale === undefined ||\n tileX < 0 || Math.ceil(width / scale / tileWidth) <= tileX ||\n tileY < 0 || Math.ceil(height / scale / tileHeight) <= tileY) {\n return;\n }\n if (supportsArbitraryTiling || supportsListedTiles) {\n var regionX = tileX * tileWidth * scale, regionY = tileY * tileHeight * scale;\n var regionW = tileWidth * scale, regionH = tileHeight * scale, sizeW = tileWidth, sizeH = tileHeight;\n if (regionX + regionW > width) {\n regionW = width - regionX;\n }\n if (regionY + regionH > height) {\n regionH = height - regionY;\n }\n if (regionX + tileWidth * scale > width) {\n sizeW = Math.floor((width - regionX + scale - 1) / scale);\n }\n if (regionY + tileHeight * scale > height) {\n sizeH = Math.floor((height - regionY + scale - 1) / scale);\n }\n if (regionX == 0 && regionW == width && regionY == 0 && regionH == height) {\n // canonical full image region parameter is 'full', not 'x,y,w,h'\n regionParam = 'full';\n }\n else if (!supportsArbitraryTiling || supports.includes('regionByPx')) {\n regionParam = regionX + ',' + regionY + ',' + regionW + ',' + regionH;\n }\n else if (supports.includes('regionByPct')) {\n var pctX = formatPercentage(regionX / width * 100), pctY = formatPercentage(regionY / height * 100), pctW = formatPercentage(regionW / width * 100), pctH = formatPercentage(regionH / height * 100);\n regionParam = 'pct:' + pctX + ',' + pctY + ',' + pctW + ',' + pctH;\n }\n if (version == Versions.VERSION3 && (!supportsArbitraryTiling || supports.includes('sizeByWh'))) {\n sizeParam = sizeW + ',' + sizeH;\n }\n else if (!supportsArbitraryTiling || supports.includes('sizeByW')) {\n sizeParam = sizeW + ',';\n }\n else if (supports.includes('sizeByH')) {\n sizeParam = ',' + sizeH;\n }\n else if (supports.includes('sizeByWh')) {\n sizeParam = sizeW + ',' + sizeH;\n }\n else if (supports.includes('sizeByPct')) {\n sizeParam = 'pct:' + formatPercentage(100 / scale);\n }\n }\n else {\n regionParam = 'full';\n if (supportsListedSizes) {\n var regionWidth = sizes[zoom][0], regionHeight = sizes[zoom][1];\n if (version == Versions.VERSION3) {\n if (regionWidth == width && regionHeight == height) {\n sizeParam = 'max';\n }\n else {\n sizeParam = regionWidth + ',' + regionHeight;\n }\n }\n else {\n if (regionWidth == width) {\n sizeParam = 'full';\n }\n else {\n sizeParam = regionWidth + ',';\n }\n }\n }\n else {\n sizeParam = version == Versions.VERSION3 ? 'max' : 'full';\n }\n }\n return baseUrl + regionParam + '/' + sizeParam + '/0/' + quality + '.' + format;\n };\n var IiifTileClass = CustomTile.bind(null, tilePixelRatio, tileGrid);\n _this = _super.call(this, {\n attributions: options.attributions,\n attributionsCollapsible: options.attributionsCollapsible,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n projection: options.projection,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n state: options.state,\n tileClass: IiifTileClass,\n tileGrid: tileGrid,\n tilePixelRatio: options.tilePixelRatio,\n tileUrlFunction: tileUrlFunction,\n transition: options.transition\n }) || this;\n /**\n * @inheritDoc\n */\n _this.zDirection = options.zDirection;\n return _this;\n }\n return IIIF;\n}(TileImage));\nexport default IIIF;\n//# sourceMappingURL=IIIF.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/reproj/Image\n */\nimport { ERROR_THRESHOLD } from './common.js';\nimport ImageBase from '../ImageBase.js';\nimport ImageState from '../ImageState.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { getCenter, getIntersection, getHeight, getWidth } from '../extent.js';\nimport { calculateSourceResolution, render as renderReprojected } from '../reproj.js';\nimport Triangulation from './Triangulation.js';\n/**\n * @typedef {function(import(\"../extent.js\").Extent, number, number) : import(\"../ImageBase.js\").default} FunctionType\n */\n/**\n * @classdesc\n * Class encapsulating single reprojected image.\n * See {@link module:ol/source/Image~ImageSource}.\n */\nvar ReprojImage = /** @class */ (function (_super) {\n __extends(ReprojImage, _super);\n /**\n * @param {import(\"../proj/Projection.js\").default} sourceProj Source projection (of the data).\n * @param {import(\"../proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"../extent.js\").Extent} targetExtent Target extent.\n * @param {number} targetResolution Target resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {FunctionType} getImageFunction\n * Function returning source images (extent, resolution, pixelRatio).\n */\n function ReprojImage(sourceProj, targetProj, targetExtent, targetResolution, pixelRatio, getImageFunction) {\n var _this = this;\n var maxSourceExtent = sourceProj.getExtent();\n var maxTargetExtent = targetProj.getExtent();\n var limitedTargetExtent = maxTargetExtent ?\n getIntersection(targetExtent, maxTargetExtent) : targetExtent;\n var targetCenter = getCenter(limitedTargetExtent);\n var sourceResolution = calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution);\n var errorThresholdInPixels = ERROR_THRESHOLD;\n var triangulation = new Triangulation(sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, sourceResolution * errorThresholdInPixels);\n var sourceExtent = triangulation.calculateSourceExtent();\n var sourceImage = getImageFunction(sourceExtent, sourceResolution, pixelRatio);\n var state = sourceImage ? ImageState.IDLE : ImageState.EMPTY;\n var sourcePixelRatio = sourceImage ? sourceImage.getPixelRatio() : 1;\n _this = _super.call(this, targetExtent, targetResolution, sourcePixelRatio, state) || this;\n /**\n * @private\n * @type {import(\"../proj/Projection.js\").default}\n */\n _this.targetProj_ = targetProj;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.maxSourceExtent_ = maxSourceExtent;\n /**\n * @private\n * @type {!import(\"./Triangulation.js\").default}\n */\n _this.triangulation_ = triangulation;\n /**\n * @private\n * @type {number}\n */\n _this.targetResolution_ = targetResolution;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.targetExtent_ = targetExtent;\n /**\n * @private\n * @type {import(\"../ImageBase.js\").default}\n */\n _this.sourceImage_ = sourceImage;\n /**\n * @private\n * @type {number}\n */\n _this.sourcePixelRatio_ = sourcePixelRatio;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = null;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.sourceListenerKey_ = null;\n return _this;\n }\n /**\n * @inheritDoc\n */\n ReprojImage.prototype.disposeInternal = function () {\n if (this.state == ImageState.LOADING) {\n this.unlistenSource_();\n }\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @inheritDoc\n */\n ReprojImage.prototype.getImage = function () {\n return this.canvas_;\n };\n /**\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n ReprojImage.prototype.getProjection = function () {\n return this.targetProj_;\n };\n /**\n * @private\n */\n ReprojImage.prototype.reproject_ = function () {\n var sourceState = this.sourceImage_.getState();\n if (sourceState == ImageState.LOADED) {\n var width = getWidth(this.targetExtent_) / this.targetResolution_;\n var height = getHeight(this.targetExtent_) / this.targetResolution_;\n this.canvas_ = renderReprojected(width, height, this.sourcePixelRatio_, this.sourceImage_.getResolution(), this.maxSourceExtent_, this.targetResolution_, this.targetExtent_, this.triangulation_, [{\n extent: this.sourceImage_.getExtent(),\n image: this.sourceImage_.getImage()\n }], 0);\n }\n this.state = sourceState;\n this.changed();\n };\n /**\n * @inheritDoc\n */\n ReprojImage.prototype.load = function () {\n if (this.state == ImageState.IDLE) {\n this.state = ImageState.LOADING;\n this.changed();\n var sourceState = this.sourceImage_.getState();\n if (sourceState == ImageState.LOADED || sourceState == ImageState.ERROR) {\n this.reproject_();\n }\n else {\n this.sourceListenerKey_ = listen(this.sourceImage_, EventType.CHANGE, function (e) {\n var sourceState = this.sourceImage_.getState();\n if (sourceState == ImageState.LOADED || sourceState == ImageState.ERROR) {\n this.unlistenSource_();\n this.reproject_();\n }\n }, this);\n this.sourceImage_.load();\n }\n }\n };\n /**\n * @private\n */\n ReprojImage.prototype.unlistenSource_ = function () {\n unlistenByKey(/** @type {!import(\"../events.js\").EventsKey} */ (this.sourceListenerKey_));\n this.sourceListenerKey_ = null;\n };\n return ReprojImage;\n}(ImageBase));\nexport default ReprojImage;\n//# sourceMappingURL=Image.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/Image\n */\nimport { abstract } from '../util.js';\nimport { ENABLE_RASTER_REPROJECTION } from '../reproj/common.js';\nimport ImageState from '../ImageState.js';\nimport { linearFindNearest } from '../array.js';\nimport Event from '../events/Event.js';\nimport { equals } from '../extent.js';\nimport { equivalent } from '../proj.js';\nimport ReprojImage from '../reproj/Image.js';\nimport Source from './Source.js';\n/**\n * @enum {string}\n */\nvar ImageSourceEventType = {\n /**\n * Triggered when an image starts loading.\n * @event module:ol/source/Image.ImageSourceEvent#imageloadstart\n * @api\n */\n IMAGELOADSTART: 'imageloadstart',\n /**\n * Triggered when an image finishes loading.\n * @event module:ol/source/Image.ImageSourceEvent#imageloadend\n * @api\n */\n IMAGELOADEND: 'imageloadend',\n /**\n * Triggered if image loading results in an error.\n * @event module:ol/source/Image.ImageSourceEvent#imageloaderror\n * @api\n */\n IMAGELOADERROR: 'imageloaderror'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Image~ImageSource} instances are instances of this\n * type.\n */\nvar ImageSourceEvent = /** @class */ (function (_super) {\n __extends(ImageSourceEvent, _super);\n /**\n * @param {string} type Type.\n * @param {import(\"../Image.js\").default} image The image.\n */\n function ImageSourceEvent(type, image) {\n var _this = _super.call(this, type) || this;\n /**\n * The image related to the event.\n * @type {import(\"../Image.js\").default}\n * @api\n */\n _this.image = image;\n return _this;\n }\n return ImageSourceEvent;\n}(Event));\nexport { ImageSourceEvent };\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions]\n * @property {import(\"../proj.js\").ProjectionLike} [projection]\n * @property {Array<number>} [resolutions]\n * @property {import(\"./State.js\").default} [state]\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for sources providing a single image.\n * @abstract\n * @fires module:ol/source/Image.ImageSourceEvent\n * @api\n */\nvar ImageSource = /** @class */ (function (_super) {\n __extends(ImageSource, _super);\n /**\n * @param {Options} options Single image source options.\n */\n function ImageSource(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n projection: options.projection,\n state: options.state\n }) || this;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.resolutions_ = options.resolutions !== undefined ?\n options.resolutions : null;\n /**\n * @private\n * @type {import(\"../reproj/Image.js\").default}\n */\n _this.reprojectedImage_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.reprojectedRevision_ = 0;\n return _this;\n }\n /**\n * @return {Array<number>} Resolutions.\n * @override\n */\n ImageSource.prototype.getResolutions = function () {\n return this.resolutions_;\n };\n /**\n * @protected\n * @param {number} resolution Resolution.\n * @return {number} Resolution.\n */\n ImageSource.prototype.findNearestResolution = function (resolution) {\n if (this.resolutions_) {\n var idx = linearFindNearest(this.resolutions_, resolution, 0);\n resolution = this.resolutions_[idx];\n }\n return resolution;\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../ImageBase.js\").default} Single image.\n */\n ImageSource.prototype.getImage = function (extent, resolution, pixelRatio, projection) {\n var sourceProjection = this.getProjection();\n if (!ENABLE_RASTER_REPROJECTION ||\n !sourceProjection ||\n !projection ||\n equivalent(sourceProjection, projection)) {\n if (sourceProjection) {\n projection = sourceProjection;\n }\n return this.getImageInternal(extent, resolution, pixelRatio, projection);\n }\n else {\n if (this.reprojectedImage_) {\n if (this.reprojectedRevision_ == this.getRevision() &&\n equivalent(this.reprojectedImage_.getProjection(), projection) &&\n this.reprojectedImage_.getResolution() == resolution &&\n equals(this.reprojectedImage_.getExtent(), extent)) {\n return this.reprojectedImage_;\n }\n this.reprojectedImage_.dispose();\n this.reprojectedImage_ = null;\n }\n this.reprojectedImage_ = new ReprojImage(sourceProjection, projection, extent, resolution, pixelRatio, function (extent, resolution, pixelRatio) {\n return this.getImageInternal(extent, resolution, pixelRatio, sourceProjection);\n }.bind(this));\n this.reprojectedRevision_ = this.getRevision();\n return this.reprojectedImage_;\n }\n };\n /**\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../ImageBase.js\").default} Single image.\n * @protected\n */\n ImageSource.prototype.getImageInternal = function (extent, resolution, pixelRatio, projection) {\n return abstract();\n };\n /**\n * Handle image change events.\n * @param {import(\"../events/Event.js\").default} event Event.\n * @protected\n */\n ImageSource.prototype.handleImageChange = function (event) {\n var image = /** @type {import(\"../Image.js\").default} */ (event.target);\n switch (image.getState()) {\n case ImageState.LOADING:\n this.loading = true;\n this.dispatchEvent(new ImageSourceEvent(ImageSourceEventType.IMAGELOADSTART, image));\n break;\n case ImageState.LOADED:\n this.loading = false;\n this.dispatchEvent(new ImageSourceEvent(ImageSourceEventType.IMAGELOADEND, image));\n break;\n case ImageState.ERROR:\n this.loading = false;\n this.dispatchEvent(new ImageSourceEvent(ImageSourceEventType.IMAGELOADERROR, image));\n break;\n default:\n // pass\n }\n };\n return ImageSource;\n}(Source));\n/**\n * Default image load function for image sources that use import(\"../Image.js\").Image image\n * instances.\n * @param {import(\"../Image.js\").default} image Image.\n * @param {string} src Source.\n */\nexport function defaultImageLoadFunction(image, src) {\n /** @type {HTMLImageElement|HTMLVideoElement} */ (image.getImage()).src = src;\n}\nexport default ImageSource;\n//# sourceMappingURL=Image.js.map","/**\n * @module ol/uri\n */\n/**\n * Appends query parameters to a URI.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {!Object} params An object where keys are URI-encoded parameter keys,\n * and the values are arbitrary types or arrays.\n * @return {string} The new URI.\n */\nexport function appendParams(uri, params) {\n var keyParams = [];\n // Skip any null or undefined parameter values\n Object.keys(params).forEach(function (k) {\n if (params[k] !== null && params[k] !== undefined) {\n keyParams.push(k + '=' + encodeURIComponent(params[k]));\n }\n });\n var qs = keyParams.join('&');\n // remove any trailing ? or &\n uri = uri.replace(/[?&]$/, '');\n // append ? or & depending on whether uri has existing parameters\n uri = uri.indexOf('?') === -1 ? uri + '?' : uri + '&';\n return uri + qs;\n}\n//# sourceMappingURL=uri.js.map","/**\n * @module ol/source/ImageArcGISRest\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ImageWrapper from '../Image.js';\nimport { assert } from '../asserts.js';\nimport EventType from '../events/EventType.js';\nimport { containsExtent, getHeight, getWidth } from '../extent.js';\nimport { assign } from '../obj.js';\nimport ImageSource, { defaultImageLoadFunction } from './Image.js';\nimport { appendParams } from '../uri.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting the image from\n * the remote server.\n * @property {import(\"../Image.js\").LoadFunction} [imageLoadFunction] Optional function to load an image given\n * a URL.\n * @property {Object<string,*>} [params] ArcGIS Rest parameters. This field is optional. Service\n * defaults will be used for any fields not specified. `FORMAT` is `PNG32` by default. `F` is\n * `IMAGE` by default. `TRANSPARENT` is `true` by default. `BBOX`, `SIZE`, `BBOXSR`, and `IMAGESR`\n * will be set dynamically. Set `LAYERS` to override the default service layer visibility. See\n * {@link http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/}\n * for further reference.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport,\n * `2` means twice the size of the map viewport, and so on.\n * @property {Array<number>} [resolutions] Resolutions. If specified, requests will be made for\n * these resolutions only.\n * @property {string} [url] ArcGIS Rest service URL for a Map Service or Image Service. The url\n * should include /MapServer or /ImageServer.\n */\n/**\n * @classdesc\n * Source for data from ArcGIS Rest services providing single, untiled images.\n * Useful when underlying map service has labels.\n *\n * If underlying map service is not using labels,\n * take advantage of ol image caching and use\n * {@link module:ol/source/TileArcGISRest} data source.\n *\n * @fires module:ol/source/Image.ImageSourceEvent\n * @api\n */\nvar ImageArcGISRest = /** @class */ (function (_super) {\n __extends(ImageArcGISRest, _super);\n /**\n * @param {Options=} opt_options Image ArcGIS Rest Options.\n */\n function ImageArcGISRest(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n attributions: options.attributions,\n projection: options.projection,\n resolutions: options.resolutions\n }) || this;\n /**\n * @private\n * @type {?string}\n */\n _this.crossOrigin_ =\n options.crossOrigin !== undefined ? options.crossOrigin : null;\n /**\n * @private\n * @type {boolean}\n */\n _this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;\n /**\n * @private\n * @type {string|undefined}\n */\n _this.url_ = options.url;\n /**\n * @private\n * @type {import(\"../Image.js\").LoadFunction}\n */\n _this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?\n options.imageLoadFunction : defaultImageLoadFunction;\n /**\n * @private\n * @type {!Object}\n */\n _this.params_ = options.params || {};\n /**\n * @private\n * @type {import(\"../Image.js\").default}\n */\n _this.image_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.imageSize_ = [0, 0];\n /**\n * @private\n * @type {number}\n */\n _this.renderedRevision_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;\n return _this;\n }\n /**\n * Get the user-provided params, i.e. those passed to the constructor through\n * the \"params\" option, and possibly updated using the updateParams method.\n * @return {Object} Params.\n * @api\n */\n ImageArcGISRest.prototype.getParams = function () {\n return this.params_;\n };\n /**\n * @inheritDoc\n */\n ImageArcGISRest.prototype.getImageInternal = function (extent, resolution, pixelRatio, projection) {\n if (this.url_ === undefined) {\n return null;\n }\n resolution = this.findNearestResolution(resolution);\n pixelRatio = this.hidpi_ ? pixelRatio : 1;\n var image = this.image_;\n if (image &&\n this.renderedRevision_ == this.getRevision() &&\n image.getResolution() == resolution &&\n image.getPixelRatio() == pixelRatio &&\n containsExtent(image.getExtent(), extent)) {\n return image;\n }\n var params = {\n 'F': 'image',\n 'FORMAT': 'PNG32',\n 'TRANSPARENT': true\n };\n assign(params, this.params_);\n extent = extent.slice();\n var centerX = (extent[0] + extent[2]) / 2;\n var centerY = (extent[1] + extent[3]) / 2;\n if (this.ratio_ != 1) {\n var halfWidth = this.ratio_ * getWidth(extent) / 2;\n var halfHeight = this.ratio_ * getHeight(extent) / 2;\n extent[0] = centerX - halfWidth;\n extent[1] = centerY - halfHeight;\n extent[2] = centerX + halfWidth;\n extent[3] = centerY + halfHeight;\n }\n var imageResolution = resolution / pixelRatio;\n // Compute an integer width and height.\n var width = Math.ceil(getWidth(extent) / imageResolution);\n var height = Math.ceil(getHeight(extent) / imageResolution);\n // Modify the extent to match the integer width and height.\n extent[0] = centerX - imageResolution * width / 2;\n extent[2] = centerX + imageResolution * width / 2;\n extent[1] = centerY - imageResolution * height / 2;\n extent[3] = centerY + imageResolution * height / 2;\n this.imageSize_[0] = width;\n this.imageSize_[1] = height;\n var url = this.getRequestUrl_(extent, this.imageSize_, pixelRatio, projection, params);\n this.image_ = new ImageWrapper(extent, resolution, pixelRatio, url, this.crossOrigin_, this.imageLoadFunction_);\n this.renderedRevision_ = this.getRevision();\n this.image_.addEventListener(EventType.CHANGE, this.handleImageChange.bind(this));\n return this.image_;\n };\n /**\n * Return the image load function of the source.\n * @return {import(\"../Image.js\").LoadFunction} The image load function.\n * @api\n */\n ImageArcGISRest.prototype.getImageLoadFunction = function () {\n return this.imageLoadFunction_;\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {import(\"../size.js\").Size} size Size.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {Object} params Params.\n * @return {string} Request URL.\n * @private\n */\n ImageArcGISRest.prototype.getRequestUrl_ = function (extent, size, pixelRatio, projection, params) {\n // ArcGIS Server only wants the numeric portion of the projection ID.\n var srid = projection.getCode().split(':').pop();\n params['SIZE'] = size[0] + ',' + size[1];\n params['BBOX'] = extent.join(',');\n params['BBOXSR'] = srid;\n params['IMAGESR'] = srid;\n params['DPI'] = Math.round(90 * pixelRatio);\n var url = this.url_;\n var modifiedUrl = url\n .replace(/MapServer\\/?$/, 'MapServer/export')\n .replace(/ImageServer\\/?$/, 'ImageServer/exportImage');\n if (modifiedUrl == url) {\n assert(false, 50); // `options.featureTypes` should be an Array\n }\n return appendParams(modifiedUrl, params);\n };\n /**\n * Return the URL used for this ArcGIS source.\n * @return {string|undefined} URL.\n * @api\n */\n ImageArcGISRest.prototype.getUrl = function () {\n return this.url_;\n };\n /**\n * Set the image load function of the source.\n * @param {import(\"../Image.js\").LoadFunction} imageLoadFunction Image load function.\n * @api\n */\n ImageArcGISRest.prototype.setImageLoadFunction = function (imageLoadFunction) {\n this.image_ = null;\n this.imageLoadFunction_ = imageLoadFunction;\n this.changed();\n };\n /**\n * Set the URL to use for requests.\n * @param {string|undefined} url URL.\n * @api\n */\n ImageArcGISRest.prototype.setUrl = function (url) {\n if (url != this.url_) {\n this.url_ = url;\n this.image_ = null;\n this.changed();\n }\n };\n /**\n * Update the user-provided params.\n * @param {Object} params Params.\n * @api\n */\n ImageArcGISRest.prototype.updateParams = function (params) {\n assign(this.params_, params);\n this.image_ = null;\n this.changed();\n };\n return ImageArcGISRest;\n}(ImageSource));\nexport default ImageArcGISRest;\n//# sourceMappingURL=ImageArcGISRest.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/ImageCanvas\n */\nimport ImageBase from './ImageBase.js';\nimport ImageState from './ImageState.js';\n/**\n * A function that is called to trigger asynchronous canvas drawing. It is\n * called with a \"done\" callback that should be called when drawing is done.\n * If any error occurs during drawing, the \"done\" callback should be called with\n * that error.\n *\n * @typedef {function(function(Error=): void): void} Loader\n */\nvar ImageCanvas = /** @class */ (function (_super) {\n __extends(ImageCanvas, _super);\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {HTMLCanvasElement} canvas Canvas.\n * @param {Loader=} opt_loader Optional loader function to\n * support asynchronous canvas drawing.\n */\n function ImageCanvas(extent, resolution, pixelRatio, canvas, opt_loader) {\n var _this = this;\n var state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED;\n _this = _super.call(this, extent, resolution, pixelRatio, state) || this;\n /**\n * Optional canvas loader function.\n * @type {?Loader}\n * @private\n */\n _this.loader_ = opt_loader !== undefined ? opt_loader : null;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = canvas;\n /**\n * @private\n * @type {?Error}\n */\n _this.error_ = null;\n return _this;\n }\n /**\n * Get any error associated with asynchronous rendering.\n * @return {?Error} Any error that occurred during rendering.\n */\n ImageCanvas.prototype.getError = function () {\n return this.error_;\n };\n /**\n * Handle async drawing complete.\n * @param {Error=} err Any error during drawing.\n * @private\n */\n ImageCanvas.prototype.handleLoad_ = function (err) {\n if (err) {\n this.error_ = err;\n this.state = ImageState.ERROR;\n }\n else {\n this.state = ImageState.LOADED;\n }\n this.changed();\n };\n /**\n * @inheritDoc\n */\n ImageCanvas.prototype.load = function () {\n if (this.state == ImageState.IDLE) {\n this.state = ImageState.LOADING;\n this.changed();\n this.loader_(this.handleLoad_.bind(this));\n }\n };\n /**\n * @return {HTMLCanvasElement} Canvas element.\n */\n ImageCanvas.prototype.getImage = function () {\n return this.canvas_;\n };\n return ImageCanvas;\n}(ImageBase));\nexport default ImageCanvas;\n//# sourceMappingURL=ImageCanvas.js.map","/**\n * @module ol/source/ImageCanvas\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ImageCanvas from '../ImageCanvas.js';\nimport { containsExtent, getHeight, getWidth, scaleFromCenter } from '../extent.js';\nimport ImageSource from './Image.js';\n/**\n * A function returning the canvas element (`{HTMLCanvasElement}`)\n * used by the source as an image. The arguments passed to the function are:\n * {@link module:ol/extent~Extent} the image extent, `{number}` the image resolution,\n * `{number}` the device pixel ratio, {@link module:ol/size~Size} the image size, and\n * {@link module:ol/proj/Projection} the image projection. The canvas returned by\n * this function is cached by the source. The this keyword inside the function\n * references the {@link module:ol/source/ImageCanvas}.\n *\n * @typedef {function(this:import(\"../ImageCanvas.js\").default, import(\"../extent.js\").Extent, number,\n * number, import(\"../size.js\").Size, import(\"../proj/Projection.js\").default): HTMLCanvasElement} FunctionType\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {FunctionType} [canvasFunction] Canvas function.\n * The function returning the canvas element used by the source\n * as an image. The arguments passed to the function are: `{import(\"../extent.js\").Extent}` the\n * image extent, `{number}` the image resolution, `{number}` the device pixel\n * ratio, `{import(\"../size.js\").Size}` the image size, and `{import(\"../proj/Projection.js\").Projection}` the image\n * projection. The canvas returned by this function is cached by the source. If\n * the value returned by the function is later changed then\n * `changed` should be called on the source for the source to\n * invalidate the current cached image. See: {@link module:ol/Observable~Observable#changed}\n * @property {import(\"../proj.js\").ProjectionLike} projection Projection.\n * @property {number} [ratio=1.5] Ratio. 1 means canvases are the size of the map viewport, 2 means twice the\n * width and height of the map viewport, and so on. Must be `1` or higher.\n * @property {Array<number>} [resolutions] Resolutions.\n * If specified, new canvases will be created for these resolutions\n * @property {import(\"./State.js\").default} [state] Source state.\n */\n/**\n * @classdesc\n * Base class for image sources where a canvas element is the image.\n * @api\n */\nvar ImageCanvasSource = /** @class */ (function (_super) {\n __extends(ImageCanvasSource, _super);\n /**\n * @param {Options=} opt_options ImageCanvas options.\n */\n function ImageCanvasSource(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n attributions: options.attributions,\n projection: options.projection,\n resolutions: options.resolutions,\n state: options.state\n }) || this;\n /**\n * @private\n * @type {FunctionType}\n */\n _this.canvasFunction_ = options.canvasFunction;\n /**\n * @private\n * @type {import(\"../ImageCanvas.js\").default}\n */\n _this.canvas_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.renderedRevision_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.ratio_ = options.ratio !== undefined ?\n options.ratio : 1.5;\n return _this;\n }\n /**\n * @inheritDoc\n */\n ImageCanvasSource.prototype.getImageInternal = function (extent, resolution, pixelRatio, projection) {\n resolution = this.findNearestResolution(resolution);\n var canvas = this.canvas_;\n if (canvas &&\n this.renderedRevision_ == this.getRevision() &&\n canvas.getResolution() == resolution &&\n canvas.getPixelRatio() == pixelRatio &&\n containsExtent(canvas.getExtent(), extent)) {\n return canvas;\n }\n extent = extent.slice();\n scaleFromCenter(extent, this.ratio_);\n var width = getWidth(extent) / resolution;\n var height = getHeight(extent) / resolution;\n var size = [width * pixelRatio, height * pixelRatio];\n var canvasElement = this.canvasFunction_.call(this, extent, resolution, pixelRatio, size, projection);\n if (canvasElement) {\n canvas = new ImageCanvas(extent, resolution, pixelRatio, canvasElement);\n }\n this.canvas_ = canvas;\n this.renderedRevision_ = this.getRevision();\n return canvas;\n };\n return ImageCanvasSource;\n}(ImageSource));\nexport default ImageCanvasSource;\n//# sourceMappingURL=ImageCanvas.js.map","/**\n * @module ol/source/ImageMapGuide\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ImageWrapper from '../Image.js';\nimport EventType from '../events/EventType.js';\nimport { containsExtent, getCenter, getHeight, getWidth, scaleFromCenter } from '../extent.js';\nimport { assign } from '../obj.js';\nimport ImageSource, { defaultImageLoadFunction } from './Image.js';\nimport { appendParams } from '../uri.js';\n/**\n * @typedef {Object} Options\n * @property {string} [url] The mapagent url.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {number} [displayDpi=96] The display resolution.\n * @property {number} [metersPerUnit=1] The meters-per-unit value.\n * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting\n * the image from the remote server.\n * @property {boolean} [useOverlay] If `true`, will use `GETDYNAMICMAPOVERLAYIMAGE`.\n * @property {import(\"../proj.js\").ProjectionLike} projection Projection.\n * @property {number} [ratio=1] Ratio. `1` means image requests are the size of the map viewport, `2` means\n * twice the width and height of the map viewport, and so on. Must be `1` or higher.\n * @property {Array<number>} [resolutions] Resolutions.\n * If specified, requests will be made for these resolutions only.\n * @property {import(\"../Image.js\").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.\n * @property {Object} [params] Additional parameters.\n */\n/**\n * @classdesc\n * Source for images from Mapguide servers\n *\n * @fires module:ol/source/Image.ImageSourceEvent\n * @api\n */\nvar ImageMapGuide = /** @class */ (function (_super) {\n __extends(ImageMapGuide, _super);\n /**\n * @param {Options} options ImageMapGuide options.\n */\n function ImageMapGuide(options) {\n var _this = _super.call(this, {\n projection: options.projection,\n resolutions: options.resolutions\n }) || this;\n /**\n * @private\n * @type {?string}\n */\n _this.crossOrigin_ =\n options.crossOrigin !== undefined ? options.crossOrigin : null;\n /**\n * @private\n * @type {number}\n */\n _this.displayDpi_ = options.displayDpi !== undefined ?\n options.displayDpi : 96;\n /**\n * @private\n * @type {!Object}\n */\n _this.params_ = options.params || {};\n /**\n * @private\n * @type {string|undefined}\n */\n _this.url_ = options.url;\n /**\n * @private\n * @type {import(\"../Image.js\").LoadFunction}\n */\n _this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?\n options.imageLoadFunction : defaultImageLoadFunction;\n /**\n * @private\n * @type {boolean}\n */\n _this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;\n /**\n * @private\n * @type {number}\n */\n _this.metersPerUnit_ = options.metersPerUnit !== undefined ?\n options.metersPerUnit : 1;\n /**\n * @private\n * @type {number}\n */\n _this.ratio_ = options.ratio !== undefined ? options.ratio : 1;\n /**\n * @private\n * @type {boolean}\n */\n _this.useOverlay_ = options.useOverlay !== undefined ?\n options.useOverlay : false;\n /**\n * @private\n * @type {import(\"../Image.js\").default}\n */\n _this.image_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.renderedRevision_ = 0;\n return _this;\n }\n /**\n * Get the user-provided params, i.e. those passed to the constructor through\n * the \"params\" option, and possibly updated using the updateParams method.\n * @return {Object} Params.\n * @api\n */\n ImageMapGuide.prototype.getParams = function () {\n return this.params_;\n };\n /**\n * @inheritDoc\n */\n ImageMapGuide.prototype.getImageInternal = function (extent, resolution, pixelRatio, projection) {\n resolution = this.findNearestResolution(resolution);\n pixelRatio = this.hidpi_ ? pixelRatio : 1;\n var image = this.image_;\n if (image &&\n this.renderedRevision_ == this.getRevision() &&\n image.getResolution() == resolution &&\n image.getPixelRatio() == pixelRatio &&\n containsExtent(image.getExtent(), extent)) {\n return image;\n }\n if (this.ratio_ != 1) {\n extent = extent.slice();\n scaleFromCenter(extent, this.ratio_);\n }\n var width = getWidth(extent) / resolution;\n var height = getHeight(extent) / resolution;\n var size = [width * pixelRatio, height * pixelRatio];\n if (this.url_ !== undefined) {\n var imageUrl = this.getUrl(this.url_, this.params_, extent, size, projection);\n image = new ImageWrapper(extent, resolution, pixelRatio, imageUrl, this.crossOrigin_, this.imageLoadFunction_);\n image.addEventListener(EventType.CHANGE, this.handleImageChange.bind(this));\n }\n else {\n image = null;\n }\n this.image_ = image;\n this.renderedRevision_ = this.getRevision();\n return image;\n };\n /**\n * Return the image load function of the source.\n * @return {import(\"../Image.js\").LoadFunction} The image load function.\n * @api\n */\n ImageMapGuide.prototype.getImageLoadFunction = function () {\n return this.imageLoadFunction_;\n };\n /**\n * Update the user-provided params.\n * @param {Object} params Params.\n * @api\n */\n ImageMapGuide.prototype.updateParams = function (params) {\n assign(this.params_, params);\n this.changed();\n };\n /**\n * @param {string} baseUrl The mapagent url.\n * @param {Object<string, string|number>} params Request parameters.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {import(\"../size.js\").Size} size Size.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {string} The mapagent map image request URL.\n */\n ImageMapGuide.prototype.getUrl = function (baseUrl, params, extent, size, projection) {\n var scale = getScale(extent, size, this.metersPerUnit_, this.displayDpi_);\n var center = getCenter(extent);\n var baseParams = {\n 'OPERATION': this.useOverlay_ ? 'GETDYNAMICMAPOVERLAYIMAGE' : 'GETMAPIMAGE',\n 'VERSION': '2.0.0',\n 'LOCALE': 'en',\n 'CLIENTAGENT': 'ol/source/ImageMapGuide source',\n 'CLIP': '1',\n 'SETDISPLAYDPI': this.displayDpi_,\n 'SETDISPLAYWIDTH': Math.round(size[0]),\n 'SETDISPLAYHEIGHT': Math.round(size[1]),\n 'SETVIEWSCALE': scale,\n 'SETVIEWCENTERX': center[0],\n 'SETVIEWCENTERY': center[1]\n };\n assign(baseParams, params);\n return appendParams(baseUrl, baseParams);\n };\n /**\n * Set the image load function of the MapGuide source.\n * @param {import(\"../Image.js\").LoadFunction} imageLoadFunction Image load function.\n * @api\n */\n ImageMapGuide.prototype.setImageLoadFunction = function (imageLoadFunction) {\n this.image_ = null;\n this.imageLoadFunction_ = imageLoadFunction;\n this.changed();\n };\n return ImageMapGuide;\n}(ImageSource));\n/**\n * @param {import(\"../extent.js\").Extent} extent The map extents.\n * @param {import(\"../size.js\").Size} size The viewport size.\n * @param {number} metersPerUnit The meters-per-unit value.\n * @param {number} dpi The display resolution.\n * @return {number} The computed map scale.\n */\nfunction getScale(extent, size, metersPerUnit, dpi) {\n var mcsW = getWidth(extent);\n var mcsH = getHeight(extent);\n var devW = size[0];\n var devH = size[1];\n var mpp = 0.0254 / dpi;\n if (devH * mcsW > devW * mcsH) {\n return mcsW * metersPerUnit / (devW * mpp); // width limited\n }\n else {\n return mcsH * metersPerUnit / (devH * mpp); // height limited\n }\n}\nexport default ImageMapGuide;\n//# sourceMappingURL=ImageMapGuide.js.map","/**\n * @module ol/source/ImageStatic\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ImageWrapper from '../Image.js';\nimport ImageState from '../ImageState.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport EventType from '../events/EventType.js';\nimport { intersects, getHeight, getWidth } from '../extent.js';\nimport { get as getProjection } from '../proj.js';\nimport ImageSource, { defaultImageLoadFunction } from './Image.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {import(\"../extent.js\").Extent} [imageExtent] Extent of the image in map coordinates.\n * This is the [left, bottom, right, top] map coordinates of your image.\n * @property {import(\"../Image.js\").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.\n * @property {import(\"../proj.js\").ProjectionLike} projection Projection.\n * @property {import(\"../size.js\").Size} [imageSize] Size of the image in pixels. Usually the image size is auto-detected, so this\n * only needs to be set if auto-detection fails for some reason.\n * @property {string} url Image URL.\n */\n/**\n * @classdesc\n * A layer source for displaying a single, static image.\n * @api\n */\nvar Static = /** @class */ (function (_super) {\n __extends(Static, _super);\n /**\n * @param {Options} options ImageStatic options.\n */\n function Static(options) {\n var _this = this;\n var crossOrigin = options.crossOrigin !== undefined ?\n options.crossOrigin : null;\n var /** @type {import(\"../Image.js\").LoadFunction} */ imageLoadFunction = options.imageLoadFunction !== undefined ?\n options.imageLoadFunction : defaultImageLoadFunction;\n _this = _super.call(this, {\n attributions: options.attributions,\n projection: getProjection(options.projection)\n }) || this;\n /**\n * @private\n * @type {string}\n */\n _this.url_ = options.url;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.imageExtent_ = options.imageExtent;\n /**\n * @private\n * @type {import(\"../Image.js\").default}\n */\n _this.image_ = new ImageWrapper(_this.imageExtent_, undefined, 1, _this.url_, crossOrigin, imageLoadFunction);\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.imageSize_ = options.imageSize ? options.imageSize : null;\n _this.image_.addEventListener(EventType.CHANGE, _this.handleImageChange.bind(_this));\n return _this;\n }\n /**\n * Returns the image extent\n * @return {import(\"../extent.js\").Extent} image extent.\n * @api\n */\n Static.prototype.getImageExtent = function () {\n return this.imageExtent_;\n };\n /**\n * @inheritDoc\n */\n Static.prototype.getImageInternal = function (extent, resolution, pixelRatio, projection) {\n if (intersects(extent, this.image_.getExtent())) {\n return this.image_;\n }\n return null;\n };\n /**\n * Return the URL used for this image source.\n * @return {string} URL.\n * @api\n */\n Static.prototype.getUrl = function () {\n return this.url_;\n };\n /**\n * @inheritDoc\n */\n Static.prototype.handleImageChange = function (evt) {\n if (this.image_.getState() == ImageState.LOADED) {\n var imageExtent = this.image_.getExtent();\n var image = this.image_.getImage();\n var imageWidth = void 0, imageHeight = void 0;\n if (this.imageSize_) {\n imageWidth = this.imageSize_[0];\n imageHeight = this.imageSize_[1];\n }\n else {\n imageWidth = image.width;\n imageHeight = image.height;\n }\n var resolution = getHeight(imageExtent) / imageHeight;\n var targetWidth = Math.ceil(getWidth(imageExtent) / resolution);\n if (targetWidth != imageWidth) {\n var context = createCanvasContext2D(targetWidth, imageHeight);\n var canvas = context.canvas;\n context.drawImage(image, 0, 0, imageWidth, imageHeight, 0, 0, canvas.width, canvas.height);\n this.image_.setImage(canvas);\n }\n }\n _super.prototype.handleImageChange.call(this, evt);\n };\n return Static;\n}(ImageSource));\nexport default Static;\n//# sourceMappingURL=ImageStatic.js.map","/**\n * @module ol/source/common\n */\n/**\n * Default WMS version.\n * @type {string}\n */\nexport var DEFAULT_WMS_VERSION = '1.3.0';\n//# sourceMappingURL=common.js.map","/**\n * @module ol/source/WMSServerType\n */\n/**\n * Available server types: `'carmentaserver'`, `'geoserver'`, `'mapserver'`,\n * `'qgis'`. These are servers that have vendor parameters beyond the WMS\n * specification that OpenLayers can make use of.\n * @enum {string}\n */\nexport default {\n /**\n * HiDPI support for [Carmenta Server](https://www.carmenta.com/en/products/carmenta-server)\n * @api\n */\n CARMENTA_SERVER: 'carmentaserver',\n /**\n * HiDPI support for [GeoServer](https://geoserver.org/)\n * @api\n */\n GEOSERVER: 'geoserver',\n /**\n * HiDPI support for [MapServer](https://mapserver.org/)\n * @api\n */\n MAPSERVER: 'mapserver',\n /**\n * HiDPI support for [QGIS](https://qgis.org/)\n * @api\n */\n QGIS: 'qgis'\n};\n//# sourceMappingURL=WMSServerType.js.map","/**\n * @module ol/source/ImageWMS\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DEFAULT_WMS_VERSION } from './common.js';\nimport ImageWrapper from '../Image.js';\nimport { assert } from '../asserts.js';\nimport EventType from '../events/EventType.js';\nimport { containsExtent, getCenter, getForViewAndSize, getHeight, getWidth } from '../extent.js';\nimport { assign } from '../obj.js';\nimport { get as getProjection, transform } from '../proj.js';\nimport { calculateSourceResolution } from '../reproj.js';\nimport ImageSource, { defaultImageLoadFunction } from './Image.js';\nimport WMSServerType from './WMSServerType.js';\nimport { compareVersions } from '../string.js';\nimport { appendParams } from '../uri.js';\n/**\n * @const\n * @type {import(\"../size.js\").Size}\n */\nvar GETFEATUREINFO_IMAGE_SIZE = [101, 101];\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting\n * the image from the remote server.\n * @property {import(\"./WMSServerType.js\").default|string} [serverType] The type of\n * the remote WMS server: `mapserver`, `geoserver` or `qgis`. Only needed if `hidpi` is `true`.\n * @property {import(\"../Image.js\").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.\n * @property {Object<string,*>} params WMS request parameters.\n * At least a `LAYERS` param is required. `STYLES` is\n * `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX`\n * and `CRS` (`SRS` for WMS version < 1.3.0) will be set dynamically.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport, `2` means\n * twice the width and height of the map viewport, and so on. Must be `1` or\n * higher.\n * @property {Array<number>} [resolutions] Resolutions.\n * If specified, requests will be made for these resolutions only.\n * @property {string} url WMS service URL.\n */\n/**\n * @classdesc\n * Source for WMS servers providing single, untiled images.\n *\n * @fires module:ol/source/Image.ImageSourceEvent\n * @api\n */\nvar ImageWMS = /** @class */ (function (_super) {\n __extends(ImageWMS, _super);\n /**\n * @param {Options=} [opt_options] ImageWMS options.\n */\n function ImageWMS(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n attributions: options.attributions,\n projection: options.projection,\n resolutions: options.resolutions\n }) || this;\n /**\n * @private\n * @type {?string}\n */\n _this.crossOrigin_ =\n options.crossOrigin !== undefined ? options.crossOrigin : null;\n /**\n * @private\n * @type {string|undefined}\n */\n _this.url_ = options.url;\n /**\n * @private\n * @type {import(\"../Image.js\").LoadFunction}\n */\n _this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?\n options.imageLoadFunction : defaultImageLoadFunction;\n /**\n * @private\n * @type {!Object}\n */\n _this.params_ = options.params || {};\n /**\n * @private\n * @type {boolean}\n */\n _this.v13_ = true;\n _this.updateV13_();\n /**\n * @private\n * @type {import(\"./WMSServerType.js\").default|undefined}\n */\n _this.serverType_ = /** @type {import(\"./WMSServerType.js\").default|undefined} */ (options.serverType);\n /**\n * @private\n * @type {boolean}\n */\n _this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;\n /**\n * @private\n * @type {import(\"../Image.js\").default}\n */\n _this.image_ = null;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.imageSize_ = [0, 0];\n /**\n * @private\n * @type {number}\n */\n _this.renderedRevision_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;\n return _this;\n }\n /**\n * Return the GetFeatureInfo URL for the passed coordinate, resolution, and\n * projection. Return `undefined` if the GetFeatureInfo URL cannot be\n * constructed.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {import(\"../proj.js\").ProjectionLike} projection Projection.\n * @param {!Object} params GetFeatureInfo params. `INFO_FORMAT` at least should\n * be provided. If `QUERY_LAYERS` is not provided then the layers specified\n * in the `LAYERS` parameter will be used. `VERSION` should not be\n * specified here.\n * @return {string|undefined} GetFeatureInfo URL.\n * @api\n */\n ImageWMS.prototype.getFeatureInfoUrl = function (coordinate, resolution, projection, params) {\n if (this.url_ === undefined) {\n return undefined;\n }\n var projectionObj = getProjection(projection);\n var sourceProjectionObj = this.getProjection();\n if (sourceProjectionObj && sourceProjectionObj !== projectionObj) {\n resolution = calculateSourceResolution(sourceProjectionObj, projectionObj, coordinate, resolution);\n coordinate = transform(coordinate, projectionObj, sourceProjectionObj);\n }\n var extent = getForViewAndSize(coordinate, resolution, 0, GETFEATUREINFO_IMAGE_SIZE);\n var baseParams = {\n 'SERVICE': 'WMS',\n 'VERSION': DEFAULT_WMS_VERSION,\n 'REQUEST': 'GetFeatureInfo',\n 'FORMAT': 'image/png',\n 'TRANSPARENT': true,\n 'QUERY_LAYERS': this.params_['LAYERS']\n };\n assign(baseParams, this.params_, params);\n var x = Math.floor((coordinate[0] - extent[0]) / resolution);\n var y = Math.floor((extent[3] - coordinate[1]) / resolution);\n baseParams[this.v13_ ? 'I' : 'X'] = x;\n baseParams[this.v13_ ? 'J' : 'Y'] = y;\n return this.getRequestUrl_(extent, GETFEATUREINFO_IMAGE_SIZE, 1, sourceProjectionObj || projectionObj, baseParams);\n };\n /**\n * Return the GetLegendGraphic URL, optionally optimized for the passed\n * resolution and possibly including any passed specific parameters. Returns\n * `undefined` if the GetLegendGraphic URL cannot be constructed.\n *\n * @param {number} [resolution] Resolution. If set to undefined, `SCALE`\n * will not be calculated and included in URL.\n * @param {Object} [params] GetLegendGraphic params. If `LAYER` is set, the\n * request is generated for this wms layer, else it will try to use the\n * configured wms layer. Default `FORMAT` is `image/png`.\n * `VERSION` should not be specified here.\n * @return {string|undefined} GetLegendGraphic URL.\n * @api\n */\n ImageWMS.prototype.getLegendUrl = function (resolution, params) {\n if (this.url_ === undefined) {\n return undefined;\n }\n var baseParams = {\n 'SERVICE': 'WMS',\n 'VERSION': DEFAULT_WMS_VERSION,\n 'REQUEST': 'GetLegendGraphic',\n 'FORMAT': 'image/png'\n };\n if (params === undefined || params['LAYER'] === undefined) {\n var layers = this.params_.LAYERS;\n var isSingleLayer = !Array.isArray(layers) || layers.length === 1;\n if (!isSingleLayer) {\n return undefined;\n }\n baseParams['LAYER'] = layers;\n }\n if (resolution !== undefined) {\n var mpu = this.getProjection() ? this.getProjection().getMetersPerUnit() : 1;\n var dpi = 25.4 / 0.28;\n var inchesPerMeter = 39.37;\n baseParams['SCALE'] = resolution * mpu * inchesPerMeter * dpi;\n }\n assign(baseParams, params);\n return appendParams(/** @type {string} */ (this.url_), baseParams);\n };\n /**\n * Get the user-provided params, i.e. those passed to the constructor through\n * the \"params\" option, and possibly updated using the updateParams method.\n * @return {Object} Params.\n * @api\n */\n ImageWMS.prototype.getParams = function () {\n return this.params_;\n };\n /**\n * @inheritDoc\n */\n ImageWMS.prototype.getImageInternal = function (extent, resolution, pixelRatio, projection) {\n if (this.url_ === undefined) {\n return null;\n }\n resolution = this.findNearestResolution(resolution);\n if (pixelRatio != 1 && (!this.hidpi_ || this.serverType_ === undefined)) {\n pixelRatio = 1;\n }\n var imageResolution = resolution / pixelRatio;\n var center = getCenter(extent);\n var viewWidth = Math.ceil(getWidth(extent) / imageResolution);\n var viewHeight = Math.ceil(getHeight(extent) / imageResolution);\n var viewExtent = getForViewAndSize(center, imageResolution, 0, [viewWidth, viewHeight]);\n var requestWidth = Math.ceil(this.ratio_ * getWidth(extent) / imageResolution);\n var requestHeight = Math.ceil(this.ratio_ * getHeight(extent) / imageResolution);\n var requestExtent = getForViewAndSize(center, imageResolution, 0, [requestWidth, requestHeight]);\n var image = this.image_;\n if (image &&\n this.renderedRevision_ == this.getRevision() &&\n image.getResolution() == resolution &&\n image.getPixelRatio() == pixelRatio &&\n containsExtent(image.getExtent(), viewExtent)) {\n return image;\n }\n var params = {\n 'SERVICE': 'WMS',\n 'VERSION': DEFAULT_WMS_VERSION,\n 'REQUEST': 'GetMap',\n 'FORMAT': 'image/png',\n 'TRANSPARENT': true\n };\n assign(params, this.params_);\n this.imageSize_[0] = Math.round(getWidth(requestExtent) / imageResolution);\n this.imageSize_[1] = Math.round(getHeight(requestExtent) / imageResolution);\n var url = this.getRequestUrl_(requestExtent, this.imageSize_, pixelRatio, projection, params);\n this.image_ = new ImageWrapper(requestExtent, resolution, pixelRatio, url, this.crossOrigin_, this.imageLoadFunction_);\n this.renderedRevision_ = this.getRevision();\n this.image_.addEventListener(EventType.CHANGE, this.handleImageChange.bind(this));\n return this.image_;\n };\n /**\n * Return the image load function of the source.\n * @return {import(\"../Image.js\").LoadFunction} The image load function.\n * @api\n */\n ImageWMS.prototype.getImageLoadFunction = function () {\n return this.imageLoadFunction_;\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {import(\"../size.js\").Size} size Size.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {Object} params Params.\n * @return {string} Request URL.\n * @private\n */\n ImageWMS.prototype.getRequestUrl_ = function (extent, size, pixelRatio, projection, params) {\n assert(this.url_ !== undefined, 9); // `url` must be configured or set using `#setUrl()`\n params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();\n if (!('STYLES' in this.params_)) {\n params['STYLES'] = '';\n }\n if (pixelRatio != 1) {\n switch (this.serverType_) {\n case WMSServerType.GEOSERVER:\n var dpi = (90 * pixelRatio + 0.5) | 0;\n if ('FORMAT_OPTIONS' in params) {\n params['FORMAT_OPTIONS'] += ';dpi:' + dpi;\n }\n else {\n params['FORMAT_OPTIONS'] = 'dpi:' + dpi;\n }\n break;\n case WMSServerType.MAPSERVER:\n params['MAP_RESOLUTION'] = 90 * pixelRatio;\n break;\n case WMSServerType.CARMENTA_SERVER:\n case WMSServerType.QGIS:\n params['DPI'] = 90 * pixelRatio;\n break;\n default:\n assert(false, 8); // Unknown `serverType` configured\n break;\n }\n }\n params['WIDTH'] = size[0];\n params['HEIGHT'] = size[1];\n var axisOrientation = projection.getAxisOrientation();\n var bbox;\n if (this.v13_ && axisOrientation.substr(0, 2) == 'ne') {\n bbox = [extent[1], extent[0], extent[3], extent[2]];\n }\n else {\n bbox = extent;\n }\n params['BBOX'] = bbox.join(',');\n return appendParams(/** @type {string} */ (this.url_), params);\n };\n /**\n * Return the URL used for this WMS source.\n * @return {string|undefined} URL.\n * @api\n */\n ImageWMS.prototype.getUrl = function () {\n return this.url_;\n };\n /**\n * Set the image load function of the source.\n * @param {import(\"../Image.js\").LoadFunction} imageLoadFunction Image load function.\n * @api\n */\n ImageWMS.prototype.setImageLoadFunction = function (imageLoadFunction) {\n this.image_ = null;\n this.imageLoadFunction_ = imageLoadFunction;\n this.changed();\n };\n /**\n * Set the URL to use for requests.\n * @param {string|undefined} url URL.\n * @api\n */\n ImageWMS.prototype.setUrl = function (url) {\n if (url != this.url_) {\n this.url_ = url;\n this.image_ = null;\n this.changed();\n }\n };\n /**\n * Update the user-provided params.\n * @param {Object} params Params.\n * @api\n */\n ImageWMS.prototype.updateParams = function (params) {\n assign(this.params_, params);\n this.updateV13_();\n this.image_ = null;\n this.changed();\n };\n /**\n * @private\n */\n ImageWMS.prototype.updateV13_ = function () {\n var version = this.params_['VERSION'] || DEFAULT_WMS_VERSION;\n this.v13_ = compareVersions(version, '1.3') >= 0;\n };\n return ImageWMS;\n}(ImageSource));\nexport default ImageWMS;\n//# sourceMappingURL=ImageWMS.js.map","/**\n * @module ol/source/OSM\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport XYZ from './XYZ.js';\n/**\n * The attribution containing a link to the OpenStreetMap Copyright and License\n * page.\n * @const\n * @type {string}\n * @api\n */\nexport var ATTRIBUTION = '© ' +\n '<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> ' +\n 'contributors.';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin='anonymous'] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {number} [maxZoom=19] Max zoom.\n * @property {boolean} [opaque=true] Whether the layer is opaque.\n * @property {number} [reprojectionErrorThreshold=1.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {string} [url='https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'] URL template.\n * Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n */\n/**\n * @classdesc\n * Layer source for the OpenStreetMap tile server.\n * @api\n */\nvar OSM = /** @class */ (function (_super) {\n __extends(OSM, _super);\n /**\n * @param {Options=} [opt_options] Open Street Map options.\n */\n function OSM(opt_options) {\n var _this = this;\n var options = opt_options || {};\n var attributions;\n if (options.attributions !== undefined) {\n attributions = options.attributions;\n }\n else {\n attributions = [ATTRIBUTION];\n }\n var crossOrigin = options.crossOrigin !== undefined ?\n options.crossOrigin : 'anonymous';\n var url = options.url !== undefined ?\n options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';\n _this = _super.call(this, {\n attributions: attributions,\n cacheSize: options.cacheSize,\n crossOrigin: crossOrigin,\n opaque: options.opaque !== undefined ? options.opaque : true,\n maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileLoadFunction: options.tileLoadFunction,\n url: url,\n wrapX: options.wrapX,\n attributionsCollapsible: false\n }) || this;\n return _this;\n }\n return OSM;\n}(XYZ));\nexport default OSM;\n//# sourceMappingURL=OSM.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/BaseImage\n */\nimport Layer from './Layer.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {import(\"../PluggableMap.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use {@link module:ol/Map#addLayer}.\n * @property {import(\"../source/Image.js\").default} [source] Source for this layer.\n */\n/**\n * @classdesc\n * Server-rendered images that are available for arbitrary extents and\n * resolutions.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @extends {Layer<import(\"../source/Image.js\").default>}\n * @api\n */\nvar BaseImageLayer = /** @class */ (function (_super) {\n __extends(BaseImageLayer, _super);\n /**\n * @param {Options=} opt_options Layer options.\n */\n function BaseImageLayer(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, options) || this;\n return _this;\n }\n return BaseImageLayer;\n}(Layer));\nexport default BaseImageLayer;\n//# sourceMappingURL=BaseImage.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/Layer\n */\nimport { abstract } from '../util.js';\nimport ImageState from '../ImageState.js';\nimport Observable from '../Observable.js';\nimport EventType from '../events/EventType.js';\nimport SourceState from '../source/State.js';\n/**\n * @template {import(\"../layer/Layer.js\").default} LayerType\n */\nvar LayerRenderer = /** @class */ (function (_super) {\n __extends(LayerRenderer, _super);\n /**\n * @param {LayerType} layer Layer.\n */\n function LayerRenderer(layer) {\n var _this = _super.call(this) || this;\n /** @private */\n _this.boundHandleImageChange_ = _this.handleImageChange_.bind(_this);\n /**\n * @private\n * @type {LayerType}\n */\n _this.layer_ = layer;\n return _this;\n }\n /**\n * Asynchronous layer level hit detection.\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").default>>} Promise that resolves with\n * an array of features.\n */\n LayerRenderer.prototype.getFeatures = function (pixel) {\n return abstract();\n };\n /**\n * Determine whether render should be called.\n * @abstract\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @return {boolean} Layer is ready to be rendered.\n */\n LayerRenderer.prototype.prepareFrame = function (frameState) {\n return abstract();\n };\n /**\n * Render the layer.\n * @abstract\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {HTMLElement} target Target that may be used to render content to.\n * @return {HTMLElement} The rendered element.\n */\n LayerRenderer.prototype.renderFrame = function (frameState, target) {\n return abstract();\n };\n /**\n * @param {Object<number, Object<string, import(\"../Tile.js\").default>>} tiles Lookup of loaded tiles by zoom level.\n * @param {number} zoom Zoom level.\n * @param {import(\"../Tile.js\").default} tile Tile.\n */\n LayerRenderer.prototype.loadedTileCallback = function (tiles, zoom, tile) {\n if (!tiles[zoom]) {\n tiles[zoom] = {};\n }\n tiles[zoom][tile.tileCoord.toString()] = tile;\n };\n /**\n * Create a function that adds loaded tiles to the tile lookup.\n * @param {import(\"../source/Tile.js\").default} source Tile source.\n * @param {import(\"../proj/Projection.js\").default} projection Projection of the tiles.\n * @param {Object<number, Object<string, import(\"../Tile.js\").default>>} tiles Lookup of loaded tiles by zoom level.\n * @return {function(number, import(\"../TileRange.js\").default):boolean} A function that can be\n * called with a zoom level and a tile range to add loaded tiles to the lookup.\n * @protected\n */\n LayerRenderer.prototype.createLoadedTileFinder = function (source, projection, tiles) {\n return (\n /**\n * @param {number} zoom Zoom level.\n * @param {import(\"../TileRange.js\").default} tileRange Tile range.\n * @return {boolean} The tile range is fully loaded.\n * @this {LayerRenderer}\n */\n function (zoom, tileRange) {\n var callback = this.loadedTileCallback.bind(this, tiles, zoom);\n return source.forEachLoadedTile(projection, zoom, tileRange, callback);\n }).bind(this);\n };\n /**\n * @abstract\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default): T} callback Feature callback.\n * @param {Array<import(\"../Feature.js\").FeatureLike>} declutteredFeatures Decluttered features.\n * @return {T|void} Callback result.\n * @template T\n */\n LayerRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, callback, declutteredFeatures) { };\n /**\n * @abstract\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @return {Uint8ClampedArray|Uint8Array} The result. If there is no data at the pixel\n * location, null will be returned. If there is data, but pixel values cannot be\n * returned, and empty array will be returned.\n */\n LayerRenderer.prototype.getDataAtPixel = function (pixel, frameState, hitTolerance) {\n return abstract();\n };\n /**\n * @return {LayerType} Layer.\n */\n LayerRenderer.prototype.getLayer = function () {\n return this.layer_;\n };\n /**\n * Perform action necessary to get the layer rendered after new fonts have loaded\n * @abstract\n */\n LayerRenderer.prototype.handleFontsChanged = function () { };\n /**\n * Handle changes in image state.\n * @param {import(\"../events/Event.js\").default} event Image change event.\n * @private\n */\n LayerRenderer.prototype.handleImageChange_ = function (event) {\n var image = /** @type {import(\"../Image.js\").default} */ (event.target);\n if (image.getState() === ImageState.LOADED) {\n this.renderIfReadyAndVisible();\n }\n };\n /**\n * Load the image if not already loaded, and register the image change\n * listener if needed.\n * @param {import(\"../ImageBase.js\").default} image Image.\n * @return {boolean} `true` if the image is already loaded, `false` otherwise.\n * @protected\n */\n LayerRenderer.prototype.loadImage = function (image) {\n var imageState = image.getState();\n if (imageState != ImageState.LOADED && imageState != ImageState.ERROR) {\n image.addEventListener(EventType.CHANGE, this.boundHandleImageChange_);\n }\n if (imageState == ImageState.IDLE) {\n image.load();\n imageState = image.getState();\n }\n return imageState == ImageState.LOADED;\n };\n /**\n * @protected\n */\n LayerRenderer.prototype.renderIfReadyAndVisible = function () {\n var layer = this.getLayer();\n if (layer.getVisible() && layer.getSourceState() == SourceState.READY) {\n layer.changed();\n }\n };\n return LayerRenderer;\n}(Observable));\nexport default LayerRenderer;\n//# sourceMappingURL=Layer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/canvas/Layer\n */\nimport { getBottomLeft, getBottomRight, getTopLeft, getTopRight } from '../../extent.js';\nimport { createCanvasContext2D } from '../../dom.js';\nimport RenderEvent from '../../render/Event.js';\nimport RenderEventType from '../../render/EventType.js';\nimport { rotateAtOffset } from '../../render/canvas.js';\nimport LayerRenderer from '../Layer.js';\nimport { create as createTransform, apply as applyTransform, compose as composeTransform, toString } from '../../transform.js';\n/**\n * @abstract\n * @template {import(\"../../layer/Layer.js\").default} LayerType\n */\nvar CanvasLayerRenderer = /** @class */ (function (_super) {\n __extends(CanvasLayerRenderer, _super);\n /**\n * @param {LayerType} layer Layer.\n */\n function CanvasLayerRenderer(layer) {\n var _this = _super.call(this, layer) || this;\n /**\n * @protected\n * @type {HTMLElement}\n */\n _this.container = null;\n /**\n * @protected\n * @type {number}\n */\n _this.renderedResolution;\n /**\n * A temporary transform. The values in this transform should only be used in a\n * function that sets the values.\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.tempTransform_ = createTransform();\n /**\n * The transform for rendered pixels to viewport CSS pixels. This transform must\n * be set when rendering a frame and may be used by other functions after rendering.\n * @protected\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.pixelTransform = createTransform();\n /**\n * The transform for viewport CSS pixels to rendered pixels. This transform must\n * be set when rendering a frame and may be used by other functions after rendering.\n * @protected\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.inversePixelTransform = createTransform();\n /**\n * @protected\n * @type {CanvasRenderingContext2D}\n */\n _this.context = null;\n /**\n * @type {boolean}\n */\n _this.containerReused = false;\n /**\n * @type {HTMLCanvasElement}\n * @private\n */\n _this.createTransformStringCanvas_ = createCanvasContext2D(1, 1).canvas;\n return _this;\n }\n /**\n * Get a rendering container from an existing target, if compatible.\n * @param {HTMLElement} target Potential render target.\n * @param {string} transform CSS Transform.\n * @param {number} opacity Opacity.\n */\n CanvasLayerRenderer.prototype.useContainer = function (target, transform, opacity) {\n var layerClassName = this.getLayer().getClassName();\n var container, context;\n if (target && target.style.opacity === '' && target.className === layerClassName) {\n var canvas = target.firstElementChild;\n if (canvas instanceof HTMLCanvasElement) {\n context = canvas.getContext('2d');\n }\n }\n if (context && context.canvas.style.transform === transform) {\n // Container of the previous layer renderer can be used.\n this.container = target;\n this.context = context;\n this.containerReused = true;\n }\n else if (this.containerReused) {\n // Previously reused container cannot be used any more.\n this.container = null;\n this.context = null;\n this.containerReused = false;\n }\n if (!this.container) {\n container = document.createElement('div');\n container.className = layerClassName;\n var style = container.style;\n style.position = 'absolute';\n style.width = '100%';\n style.height = '100%';\n context = createCanvasContext2D();\n var canvas = context.canvas;\n container.appendChild(canvas);\n style = canvas.style;\n style.position = 'absolute';\n style.left = '0';\n style.transformOrigin = 'top left';\n this.container = container;\n this.context = context;\n }\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {import(\"../../extent.js\").Extent} extent Clip extent.\n * @protected\n */\n CanvasLayerRenderer.prototype.clip = function (context, frameState, extent) {\n var pixelRatio = frameState.pixelRatio;\n var halfWidth = (frameState.size[0] * pixelRatio) / 2;\n var halfHeight = (frameState.size[1] * pixelRatio) / 2;\n var rotation = frameState.viewState.rotation;\n var topLeft = getTopLeft(extent);\n var topRight = getTopRight(extent);\n var bottomRight = getBottomRight(extent);\n var bottomLeft = getBottomLeft(extent);\n applyTransform(frameState.coordinateToPixelTransform, topLeft);\n applyTransform(frameState.coordinateToPixelTransform, topRight);\n applyTransform(frameState.coordinateToPixelTransform, bottomRight);\n applyTransform(frameState.coordinateToPixelTransform, bottomLeft);\n context.save();\n rotateAtOffset(context, -rotation, halfWidth, halfHeight);\n context.beginPath();\n context.moveTo(topLeft[0] * pixelRatio, topLeft[1] * pixelRatio);\n context.lineTo(topRight[0] * pixelRatio, topRight[1] * pixelRatio);\n context.lineTo(bottomRight[0] * pixelRatio, bottomRight[1] * pixelRatio);\n context.lineTo(bottomLeft[0] * pixelRatio, bottomLeft[1] * pixelRatio);\n context.clip();\n rotateAtOffset(context, rotation, halfWidth, halfHeight);\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {import(\"../../extent.js\").Extent} extent Clip extent.\n * @protected\n */\n CanvasLayerRenderer.prototype.clipUnrotated = function (context, frameState, extent) {\n var topLeft = getTopLeft(extent);\n var topRight = getTopRight(extent);\n var bottomRight = getBottomRight(extent);\n var bottomLeft = getBottomLeft(extent);\n applyTransform(frameState.coordinateToPixelTransform, topLeft);\n applyTransform(frameState.coordinateToPixelTransform, topRight);\n applyTransform(frameState.coordinateToPixelTransform, bottomRight);\n applyTransform(frameState.coordinateToPixelTransform, bottomLeft);\n var inverted = this.inversePixelTransform;\n applyTransform(inverted, topLeft);\n applyTransform(inverted, topRight);\n applyTransform(inverted, bottomRight);\n applyTransform(inverted, bottomLeft);\n context.save();\n context.beginPath();\n context.moveTo(Math.round(topLeft[0]), Math.round(topLeft[1]));\n context.lineTo(Math.round(topRight[0]), Math.round(topRight[1]));\n context.lineTo(Math.round(bottomRight[0]), Math.round(bottomRight[1]));\n context.lineTo(Math.round(bottomLeft[0]), Math.round(bottomLeft[1]));\n context.clip();\n };\n /**\n * @param {import(\"../../render/EventType.js\").default} type Event type.\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @private\n */\n CanvasLayerRenderer.prototype.dispatchRenderEvent_ = function (type, context, frameState) {\n var layer = this.getLayer();\n if (layer.hasListener(type)) {\n var event_1 = new RenderEvent(type, this.inversePixelTransform, frameState, context);\n layer.dispatchEvent(event_1);\n }\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @protected\n */\n CanvasLayerRenderer.prototype.preRender = function (context, frameState) {\n this.dispatchRenderEvent_(RenderEventType.PRERENDER, context, frameState);\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @protected\n */\n CanvasLayerRenderer.prototype.postRender = function (context, frameState) {\n this.dispatchRenderEvent_(RenderEventType.POSTRENDER, context, frameState);\n };\n /**\n * Creates a transform for rendering to an element that will be rotated after rendering.\n * @param {import(\"../../coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {number} pixelRatio Pixel ratio.\n * @param {number} width Width of the rendered element (in pixels).\n * @param {number} height Height of the rendered element (in pixels).\n * @param {number} offsetX Offset on the x-axis in view coordinates.\n * @protected\n * @return {!import(\"../../transform.js\").Transform} Transform.\n */\n CanvasLayerRenderer.prototype.getRenderTransform = function (center, resolution, rotation, pixelRatio, width, height, offsetX) {\n var dx1 = width / 2;\n var dy1 = height / 2;\n var sx = pixelRatio / resolution;\n var sy = -sx;\n var dx2 = -center[0] + offsetX;\n var dy2 = -center[1];\n return composeTransform(this.tempTransform_, dx1, dy1, sx, sy, -rotation, dx2, dy2);\n };\n /**\n * @param {import(\"../../pixel.js\").Pixel} pixel Pixel.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @return {Uint8ClampedArray|Uint8Array} The result. If there is no data at the pixel\n * location, null will be returned. If there is data, but pixel values cannot be\n * returned, and empty array will be returned.\n */\n CanvasLayerRenderer.prototype.getDataAtPixel = function (pixel, frameState, hitTolerance) {\n var renderPixel = applyTransform(this.inversePixelTransform, pixel.slice());\n var context = this.context;\n var data;\n try {\n data = context.getImageData(Math.round(renderPixel[0]), Math.round(renderPixel[1]), 1, 1).data;\n }\n catch (err) {\n if (err.name === 'SecurityError') {\n // tainted canvas, we assume there is data at the given pixel (although there might not be)\n return new Uint8Array();\n }\n return data;\n }\n if (data[3] === 0) {\n return null;\n }\n return data;\n };\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @return {string} CSS transform.\n */\n CanvasLayerRenderer.prototype.createTransformString = function (transform) {\n this.createTransformStringCanvas_.style.transform = toString(transform);\n return this.createTransformStringCanvas_.style.transform;\n };\n return CanvasLayerRenderer;\n}(LayerRenderer));\nexport default CanvasLayerRenderer;\n//# sourceMappingURL=Layer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/canvas/ImageLayer\n */\nimport { ENABLE_RASTER_REPROJECTION } from '../../reproj/common.js';\nimport ViewHint from '../../ViewHint.js';\nimport { containsExtent, intersects } from '../../extent.js';\nimport { fromUserExtent } from '../../proj.js';\nimport { getIntersection, isEmpty } from '../../extent.js';\nimport CanvasLayerRenderer from './Layer.js';\nimport { compose as composeTransform, makeInverse } from '../../transform.js';\n/**\n * @classdesc\n * Canvas renderer for image layers.\n * @api\n */\nvar CanvasImageLayerRenderer = /** @class */ (function (_super) {\n __extends(CanvasImageLayerRenderer, _super);\n /**\n * @param {import(\"../../layer/Image.js\").default} imageLayer Image layer.\n */\n function CanvasImageLayerRenderer(imageLayer) {\n var _this = _super.call(this, imageLayer) || this;\n /**\n * @protected\n * @type {?import(\"../../ImageBase.js\").default}\n */\n _this.image_ = null;\n return _this;\n }\n /**\n * @inheritDoc\n */\n CanvasImageLayerRenderer.prototype.getImage = function () {\n return !this.image_ ? null : this.image_.getImage();\n };\n /**\n * @inheritDoc\n */\n CanvasImageLayerRenderer.prototype.prepareFrame = function (frameState) {\n var layerState = frameState.layerStatesArray[frameState.layerIndex];\n var pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var viewResolution = viewState.resolution;\n var imageSource = this.getLayer().getSource();\n var hints = frameState.viewHints;\n var renderedExtent = frameState.extent;\n if (layerState.extent !== undefined) {\n renderedExtent = getIntersection(renderedExtent, fromUserExtent(layerState.extent, viewState.projection));\n }\n if (!hints[ViewHint.ANIMATING] && !hints[ViewHint.INTERACTING] && !isEmpty(renderedExtent)) {\n var projection = viewState.projection;\n if (!ENABLE_RASTER_REPROJECTION) {\n var sourceProjection = imageSource.getProjection();\n if (sourceProjection) {\n projection = sourceProjection;\n }\n }\n var image = imageSource.getImage(renderedExtent, viewResolution, pixelRatio, projection);\n if (image && this.loadImage(image)) {\n this.image_ = image;\n }\n }\n return !!this.image_;\n };\n /**\n * @inheritDoc\n */\n CanvasImageLayerRenderer.prototype.renderFrame = function (frameState, target) {\n var image = this.image_;\n var imageExtent = image.getExtent();\n var imageResolution = image.getResolution();\n var imagePixelRatio = image.getPixelRatio();\n var layerState = frameState.layerStatesArray[frameState.layerIndex];\n var pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var viewCenter = viewState.center;\n var viewResolution = viewState.resolution;\n var size = frameState.size;\n var scale = pixelRatio * imageResolution / (viewResolution * imagePixelRatio);\n var width = Math.round(size[0] * pixelRatio);\n var height = Math.round(size[1] * pixelRatio);\n var rotation = viewState.rotation;\n if (rotation) {\n var size_1 = Math.round(Math.sqrt(width * width + height * height));\n width = size_1;\n height = size_1;\n }\n // set forward and inverse pixel transforms\n composeTransform(this.pixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / pixelRatio, 1 / pixelRatio, rotation, -width / 2, -height / 2);\n makeInverse(this.inversePixelTransform, this.pixelTransform);\n var canvasTransform = this.createTransformString(this.pixelTransform);\n this.useContainer(target, canvasTransform, layerState.opacity);\n var context = this.context;\n var canvas = context.canvas;\n if (canvas.width != width || canvas.height != height) {\n canvas.width = width;\n canvas.height = height;\n }\n else if (!this.containerReused) {\n context.clearRect(0, 0, width, height);\n }\n // clipped rendering if layer extent is set\n var clipped = false;\n if (layerState.extent) {\n var layerExtent = fromUserExtent(layerState.extent, viewState.projection);\n clipped = !containsExtent(layerExtent, frameState.extent) && intersects(layerExtent, frameState.extent);\n if (clipped) {\n this.clipUnrotated(context, frameState, layerExtent);\n }\n }\n var img = image.getImage();\n var transform = composeTransform(this.tempTransform_, width / 2, height / 2, scale, scale, 0, imagePixelRatio * (imageExtent[0] - viewCenter[0]) / imageResolution, imagePixelRatio * (viewCenter[1] - imageExtent[3]) / imageResolution);\n this.renderedResolution = imageResolution * pixelRatio / imagePixelRatio;\n var dx = transform[4];\n var dy = transform[5];\n var dw = img.width * transform[0];\n var dh = img.height * transform[3];\n this.preRender(context, frameState);\n if (dw >= 0.5 && dh >= 0.5) {\n var opacity = layerState.opacity;\n var previousAlpha = void 0;\n if (opacity !== 1) {\n previousAlpha = this.context.globalAlpha;\n this.context.globalAlpha = opacity;\n }\n this.context.drawImage(img, 0, 0, +img.width, +img.height, Math.round(dx), Math.round(dy), Math.round(dw), Math.round(dh));\n if (opacity !== 1) {\n this.context.globalAlpha = previousAlpha;\n }\n }\n this.postRender(context, frameState);\n if (clipped) {\n context.restore();\n }\n if (canvasTransform !== canvas.style.transform) {\n canvas.style.transform = canvasTransform;\n }\n return this.container;\n };\n return CanvasImageLayerRenderer;\n}(CanvasLayerRenderer));\nexport default CanvasImageLayerRenderer;\n//# sourceMappingURL=ImageLayer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Image\n */\nimport BaseImageLayer from './BaseImage.js';\nimport CanvasImageLayerRenderer from '../renderer/canvas/ImageLayer.js';\n/**\n * @classdesc\n * Server-rendered images that are available for arbitrary extents and\n * resolutions.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @api\n */\nvar ImageLayer = /** @class */ (function (_super) {\n __extends(ImageLayer, _super);\n /**\n * @param {import(\"./BaseImage.js\").Options=} opt_options Layer options.\n */\n function ImageLayer(opt_options) {\n return _super.call(this, opt_options) || this;\n }\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n ImageLayer.prototype.createRenderer = function () {\n return new CanvasImageLayerRenderer(this);\n };\n return ImageLayer;\n}(BaseImageLayer));\nexport default ImageLayer;\n//# sourceMappingURL=Image.js.map","/**\n * @module ol/layer/TileProperty\n */\n/**\n * @enum {string}\n */\nexport default {\n PRELOAD: 'preload',\n USE_INTERIM_TILES_ON_ERROR: 'useInterimTilesOnError'\n};\n//# sourceMappingURL=TileProperty.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/BaseTile\n */\nimport Layer from './Layer.js';\nimport TileProperty from './TileProperty.js';\nimport { assign } from '../obj.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`\n * means no preloading.\n * @property {import(\"../source/Tile.js\").default} [source] Source for this layer.\n * @property {import(\"../PluggableMap.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use {@link module:ol/Map#addLayer}.\n * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.\n */\n/**\n * @classdesc\n * For layer sources that provide pre-rendered, tiled images in grids that are\n * organized by zoom levels for specific resolutions.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @extends {Layer<import(\"../source/Tile.js\").default>}\n * @api\n */\nvar BaseTileLayer = /** @class */ (function (_super) {\n __extends(BaseTileLayer, _super);\n /**\n * @param {Options=} opt_options Tile layer options.\n */\n function BaseTileLayer(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var baseOptions = assign({}, options);\n delete baseOptions.preload;\n delete baseOptions.useInterimTilesOnError;\n _this = _super.call(this, baseOptions) || this;\n _this.setPreload(options.preload !== undefined ? options.preload : 0);\n _this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?\n options.useInterimTilesOnError : true);\n return _this;\n }\n /**\n * Return the level as number to which we will preload tiles up to.\n * @return {number} The level to preload tiles up to.\n * @observable\n * @api\n */\n BaseTileLayer.prototype.getPreload = function () {\n return /** @type {number} */ (this.get(TileProperty.PRELOAD));\n };\n /**\n * Set the level as number to which we will preload tiles up to.\n * @param {number} preload The level to preload tiles up to.\n * @observable\n * @api\n */\n BaseTileLayer.prototype.setPreload = function (preload) {\n this.set(TileProperty.PRELOAD, preload);\n };\n /**\n * Whether we use interim tiles on error.\n * @return {boolean} Use interim tiles on error.\n * @observable\n * @api\n */\n BaseTileLayer.prototype.getUseInterimTilesOnError = function () {\n return /** @type {boolean} */ (this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR));\n };\n /**\n * Set whether we use interim tiles on error.\n * @param {boolean} useInterimTilesOnError Use interim tiles on error.\n * @observable\n * @api\n */\n BaseTileLayer.prototype.setUseInterimTilesOnError = function (useInterimTilesOnError) {\n this.set(TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);\n };\n return BaseTileLayer;\n}(Layer));\nexport default BaseTileLayer;\n//# sourceMappingURL=BaseTile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/canvas/TileLayer\n */\nimport { getUid } from '../../util.js';\nimport { fromUserExtent } from '../../proj.js';\nimport TileRange from '../../TileRange.js';\nimport TileState from '../../TileState.js';\nimport { createEmpty, equals, getIntersection, getTopLeft } from '../../extent.js';\nimport CanvasLayerRenderer from './Layer.js';\nimport { apply as applyTransform, compose as composeTransform, makeInverse } from '../../transform.js';\nimport { numberSafeCompareFunction } from '../../array.js';\n/**\n * @classdesc\n * Canvas renderer for tile layers.\n * @api\n */\nvar CanvasTileLayerRenderer = /** @class */ (function (_super) {\n __extends(CanvasTileLayerRenderer, _super);\n /**\n * @param {import(\"../../layer/Tile.js\").default|import(\"../../layer/VectorTile.js\").default} tileLayer Tile layer.\n */\n function CanvasTileLayerRenderer(tileLayer) {\n var _this = _super.call(this, tileLayer) || this;\n /**\n * Rendered extent has changed since the previous `renderFrame()` call\n * @type {boolean}\n */\n _this.extentChanged = true;\n /**\n * @private\n * @type {?import(\"../../extent.js\").Extent}\n */\n _this.renderedExtent_ = null;\n /**\n * @protected\n * @type {number}\n */\n _this.renderedPixelRatio;\n /**\n * @protected\n * @type {import(\"../../proj/Projection.js\").default}\n */\n _this.renderedProjection = null;\n /**\n * @protected\n * @type {number}\n */\n _this.renderedRevision;\n /**\n * @protected\n * @type {!Array<import(\"../../Tile.js\").default>}\n */\n _this.renderedTiles = [];\n /**\n * @private\n * @type {boolean}\n */\n _this.newTiles_ = false;\n /**\n * @protected\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.tmpExtent = createEmpty();\n /**\n * @private\n * @type {import(\"../../TileRange.js\").default}\n */\n _this.tmpTileRange_ = new TileRange(0, 0, 0, 0);\n return _this;\n }\n /**\n * @protected\n * @param {import(\"../../Tile.js\").default} tile Tile.\n * @return {boolean} Tile is drawable.\n */\n CanvasTileLayerRenderer.prototype.isDrawableTile = function (tile) {\n var tileLayer = this.getLayer();\n var tileState = tile.getState();\n var useInterimTilesOnError = tileLayer.getUseInterimTilesOnError();\n return tileState == TileState.LOADED ||\n tileState == TileState.EMPTY ||\n tileState == TileState.ERROR && !useInterimTilesOnError;\n };\n /**\n * @param {number} z Tile coordinate z.\n * @param {number} x Tile coordinate x.\n * @param {number} y Tile coordinate y.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @return {!import(\"../../Tile.js\").default} Tile.\n */\n CanvasTileLayerRenderer.prototype.getTile = function (z, x, y, frameState) {\n var pixelRatio = frameState.pixelRatio;\n var projection = frameState.viewState.projection;\n var tileLayer = this.getLayer();\n var tileSource = tileLayer.getSource();\n var tile = tileSource.getTile(z, x, y, pixelRatio, projection);\n if (tile.getState() == TileState.ERROR) {\n if (!tileLayer.getUseInterimTilesOnError()) {\n // When useInterimTilesOnError is false, we consider the error tile as loaded.\n tile.setState(TileState.LOADED);\n }\n else if (tileLayer.getPreload() > 0) {\n // Preloaded tiles for lower resolutions might have finished loading.\n this.newTiles_ = true;\n }\n }\n if (!this.isDrawableTile(tile)) {\n tile = tile.getInterimTile();\n }\n return tile;\n };\n /**\n * @inheritDoc\n */\n CanvasTileLayerRenderer.prototype.loadedTileCallback = function (tiles, zoom, tile) {\n if (this.isDrawableTile(tile)) {\n return _super.prototype.loadedTileCallback.call(this, tiles, zoom, tile);\n }\n return false;\n };\n /**\n * @inheritDoc\n */\n CanvasTileLayerRenderer.prototype.prepareFrame = function (frameState) {\n return !!this.getLayer().getSource();\n };\n /**\n * TODO: File a TypeScript issue about inheritDoc not being followed\n * all the way. Without this explicit return type, the VectorTileLayer\n * renderFrame function does not pass.\n *\n * @inheritDoc\n * @returns {HTMLElement} The rendered element.\n */\n CanvasTileLayerRenderer.prototype.renderFrame = function (frameState, target) {\n var layerState = frameState.layerStatesArray[frameState.layerIndex];\n var viewState = frameState.viewState;\n var projection = viewState.projection;\n var viewResolution = viewState.resolution;\n var viewCenter = viewState.center;\n var rotation = viewState.rotation;\n var pixelRatio = frameState.pixelRatio;\n var tileLayer = this.getLayer();\n var tileSource = tileLayer.getSource();\n var sourceRevision = tileSource.getRevision();\n var tileGrid = tileSource.getTileGridForProjection(projection);\n var z = tileGrid.getZForResolution(viewResolution, tileSource.zDirection);\n var tileResolution = tileGrid.getResolution(z);\n var extent = frameState.extent;\n var layerExtent = layerState.extent && fromUserExtent(layerState.extent, projection);\n if (layerExtent) {\n extent = getIntersection(extent, fromUserExtent(layerState.extent, projection));\n }\n var tilePixelRatio = tileSource.getTilePixelRatio(pixelRatio);\n // desired dimensions of the canvas in pixels\n var width = Math.round(frameState.size[0] * tilePixelRatio);\n var height = Math.round(frameState.size[1] * tilePixelRatio);\n if (rotation) {\n var size = Math.round(Math.sqrt(width * width + height * height));\n width = size;\n height = size;\n }\n var dx = tileResolution * width / 2 / tilePixelRatio;\n var dy = tileResolution * height / 2 / tilePixelRatio;\n var canvasExtent = [\n viewCenter[0] - dx,\n viewCenter[1] - dy,\n viewCenter[0] + dx,\n viewCenter[1] + dy\n ];\n var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);\n /**\n * @type {Object<number, Object<string, import(\"../../Tile.js\").default>>}\n */\n var tilesToDrawByZ = {};\n tilesToDrawByZ[z] = {};\n var findLoadedTiles = this.createLoadedTileFinder(tileSource, projection, tilesToDrawByZ);\n var tmpExtent = this.tmpExtent;\n var tmpTileRange = this.tmpTileRange_;\n this.newTiles_ = false;\n for (var x = tileRange.minX; x <= tileRange.maxX; ++x) {\n for (var y = tileRange.minY; y <= tileRange.maxY; ++y) {\n var tile = this.getTile(z, x, y, frameState);\n if (this.isDrawableTile(tile)) {\n var uid = getUid(this);\n if (tile.getState() == TileState.LOADED) {\n tilesToDrawByZ[z][tile.tileCoord.toString()] = tile;\n var inTransition = tile.inTransition(uid);\n if (!this.newTiles_ && (inTransition || this.renderedTiles.indexOf(tile) === -1)) {\n this.newTiles_ = true;\n }\n }\n if (tile.getAlpha(uid, frameState.time) === 1) {\n // don't look for alt tiles if alpha is 1\n continue;\n }\n }\n var childTileRange = tileGrid.getTileCoordChildTileRange(tile.tileCoord, tmpTileRange, tmpExtent);\n var covered = false;\n if (childTileRange) {\n covered = findLoadedTiles(z + 1, childTileRange);\n }\n if (!covered) {\n tileGrid.forEachTileCoordParentTileRange(tile.tileCoord, findLoadedTiles, tmpTileRange, tmpExtent);\n }\n }\n }\n var canvasScale = tileResolution / viewResolution;\n // set forward and inverse pixel transforms\n composeTransform(this.pixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / tilePixelRatio, 1 / tilePixelRatio, rotation, -width / 2, -height / 2);\n var canvasTransform = this.createTransformString(this.pixelTransform);\n this.useContainer(target, canvasTransform, layerState.opacity);\n var context = this.context;\n var canvas = context.canvas;\n makeInverse(this.inversePixelTransform, this.pixelTransform);\n // set scale transform for calculating tile positions on the canvas\n composeTransform(this.tempTransform_, width / 2, height / 2, canvasScale, canvasScale, 0, -width / 2, -height / 2);\n if (canvas.width != width || canvas.height != height) {\n canvas.width = width;\n canvas.height = height;\n }\n else if (!this.containerReused) {\n context.clearRect(0, 0, width, height);\n }\n if (layerExtent) {\n this.clipUnrotated(context, frameState, layerExtent);\n }\n this.preRender(context, frameState);\n this.renderedTiles.length = 0;\n /** @type {Array<number>} */\n var zs = Object.keys(tilesToDrawByZ).map(Number);\n zs.sort(numberSafeCompareFunction);\n var clips, clipZs, currentClip;\n if (layerState.opacity === 1 && (!this.containerReused || tileSource.getOpaque(frameState.viewState.projection))) {\n zs = zs.reverse();\n }\n else {\n clips = [];\n clipZs = [];\n }\n for (var i = zs.length - 1; i >= 0; --i) {\n var currentZ = zs[i];\n var currentTilePixelSize = tileSource.getTilePixelSize(currentZ, pixelRatio, projection);\n var currentResolution = tileGrid.getResolution(currentZ);\n var currentScale = currentResolution / tileResolution;\n var dx_1 = currentTilePixelSize[0] * currentScale * canvasScale;\n var dy_1 = currentTilePixelSize[1] * currentScale * canvasScale;\n var originTileCoord = tileGrid.getTileCoordForCoordAndZ(getTopLeft(canvasExtent), currentZ);\n var originTileExtent = tileGrid.getTileCoordExtent(originTileCoord);\n var origin_1 = applyTransform(this.tempTransform_, [\n tilePixelRatio * (originTileExtent[0] - canvasExtent[0]) / tileResolution,\n tilePixelRatio * (canvasExtent[3] - originTileExtent[3]) / tileResolution\n ]);\n var tileGutter = tilePixelRatio * tileSource.getGutterForProjection(projection);\n var tilesToDraw = tilesToDrawByZ[currentZ];\n for (var tileCoordKey in tilesToDraw) {\n var tile = /** @type {import(\"../../ImageTile.js\").default} */ (tilesToDraw[tileCoordKey]);\n var tileCoord = tile.tileCoord;\n // Calculate integer positions and sizes so that tiles align\n var floatX = (origin_1[0] - (originTileCoord[1] - tileCoord[1]) * dx_1);\n var nextX = Math.round(floatX + dx_1);\n var floatY = (origin_1[1] - (originTileCoord[2] - tileCoord[2]) * dy_1);\n var nextY = Math.round(floatY + dy_1);\n var x = Math.round(floatX);\n var y = Math.round(floatY);\n var w = nextX - x;\n var h = nextY - y;\n var transition = z === currentZ;\n var inTransition = transition && tile.getAlpha(getUid(this), frameState.time) !== 1;\n if (!inTransition) {\n if (clips) {\n // Clip mask for regions in this tile that already filled by a higher z tile\n context.save();\n currentClip = [x, y, x + w, y, x + w, y + h, x, y + h];\n for (var i_1 = 0, ii = clips.length; i_1 < ii; ++i_1) {\n if (z !== currentZ && currentZ < clipZs[i_1]) {\n var clip = clips[i_1];\n context.beginPath();\n // counter-clockwise (outer ring) for current tile\n context.moveTo(currentClip[0], currentClip[1]);\n context.lineTo(currentClip[2], currentClip[3]);\n context.lineTo(currentClip[4], currentClip[5]);\n context.lineTo(currentClip[6], currentClip[7]);\n // clockwise (inner ring) for higher z tile\n context.moveTo(clip[6], clip[7]);\n context.lineTo(clip[4], clip[5]);\n context.lineTo(clip[2], clip[3]);\n context.lineTo(clip[0], clip[1]);\n context.clip();\n }\n }\n clips.push(currentClip);\n clipZs.push(currentZ);\n }\n else {\n context.clearRect(x, y, w, h);\n }\n }\n this.drawTileImage(tile, frameState, x, y, w, h, tileGutter, transition, layerState.opacity);\n if (clips && !inTransition) {\n context.restore();\n }\n this.renderedTiles.push(tile);\n this.updateUsedTiles(frameState.usedTiles, tileSource, tile);\n }\n }\n this.renderedRevision = sourceRevision;\n this.renderedResolution = tileResolution;\n this.extentChanged = !this.renderedExtent_ || !equals(this.renderedExtent_, canvasExtent);\n this.renderedExtent_ = canvasExtent;\n this.renderedPixelRatio = pixelRatio;\n this.renderedProjection = projection;\n this.manageTilePyramid(frameState, tileSource, tileGrid, pixelRatio, projection, extent, z, tileLayer.getPreload());\n this.updateCacheSize_(frameState, tileSource);\n this.scheduleExpireCache(frameState, tileSource);\n this.postRender(context, frameState);\n if (layerState.extent) {\n context.restore();\n }\n if (canvasTransform !== canvas.style.transform) {\n canvas.style.transform = canvasTransform;\n }\n return this.container;\n };\n /**\n * @param {import(\"../../ImageTile.js\").default} tile Tile.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {number} x Left of the tile.\n * @param {number} y Top of the tile.\n * @param {number} w Width of the tile.\n * @param {number} h Height of the tile.\n * @param {number} gutter Tile gutter.\n * @param {boolean} transition Apply an alpha transition.\n * @param {number} opacity Opacity.\n */\n CanvasTileLayerRenderer.prototype.drawTileImage = function (tile, frameState, x, y, w, h, gutter, transition, opacity) {\n var image = this.getTileImage(tile);\n if (!image) {\n return;\n }\n var uid = getUid(this);\n var tileAlpha = transition ? tile.getAlpha(uid, frameState.time) : 1;\n var alpha = opacity * tileAlpha;\n var alphaChanged = alpha !== this.context.globalAlpha;\n if (alphaChanged) {\n this.context.save();\n this.context.globalAlpha = alpha;\n }\n this.context.drawImage(image, gutter, gutter, image.width - 2 * gutter, image.height - 2 * gutter, x, y, w, h);\n if (alphaChanged) {\n this.context.restore();\n }\n if (tileAlpha !== 1) {\n frameState.animate = true;\n }\n else if (transition) {\n tile.endTransition(uid);\n }\n };\n /**\n * @inheritDoc\n */\n CanvasTileLayerRenderer.prototype.getImage = function () {\n var context = this.context;\n return context ? context.canvas : null;\n };\n /**\n * Get the image from a tile.\n * @param {import(\"../../ImageTile.js\").default} tile Tile.\n * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.\n * @protected\n */\n CanvasTileLayerRenderer.prototype.getTileImage = function (tile) {\n return tile.getImage();\n };\n /**\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {import(\"../../source/Tile.js\").default} tileSource Tile source.\n * @protected\n */\n CanvasTileLayerRenderer.prototype.scheduleExpireCache = function (frameState, tileSource) {\n if (tileSource.canExpireCache()) {\n /**\n * @param {import(\"../../source/Tile.js\").default} tileSource Tile source.\n * @param {import(\"../../PluggableMap.js\").default} map Map.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n */\n var postRenderFunction = function (tileSource, map, frameState) {\n var tileSourceKey = getUid(tileSource);\n if (tileSourceKey in frameState.usedTiles) {\n tileSource.expireCache(frameState.viewState.projection, frameState.usedTiles[tileSourceKey]);\n }\n }.bind(null, tileSource);\n frameState.postRenderFunctions.push(\n /** @type {import(\"../../PluggableMap.js\").PostRenderFunction} */ (postRenderFunction));\n }\n };\n /**\n * @param {!Object<string, !Object<string, boolean>>} usedTiles Used tiles.\n * @param {import(\"../../source/Tile.js\").default} tileSource Tile source.\n * @param {import('../../Tile.js').default} tile Tile.\n * @protected\n */\n CanvasTileLayerRenderer.prototype.updateUsedTiles = function (usedTiles, tileSource, tile) {\n // FIXME should we use tilesToDrawByZ instead?\n var tileSourceKey = getUid(tileSource);\n if (!(tileSourceKey in usedTiles)) {\n usedTiles[tileSourceKey] = {};\n }\n usedTiles[tileSourceKey][tile.getKey()] = true;\n };\n /**\n * Check if the cache is big enough, and increase its size if necessary.\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {import(\"../../source/Tile.js\").default} tileSource Tile source.\n * @private\n */\n CanvasTileLayerRenderer.prototype.updateCacheSize_ = function (frameState, tileSource) {\n var tileSourceKey = getUid(tileSource);\n var size = 0;\n if (tileSourceKey in frameState.usedTiles) {\n size += Object.keys(frameState.usedTiles[tileSourceKey]).length;\n }\n if (tileSourceKey in frameState.wantedTiles) {\n size += Object.keys(frameState.wantedTiles[tileSourceKey]).length;\n }\n var tileCache = tileSource.tileCache;\n if (tileCache.highWaterMark < size) {\n tileCache.highWaterMark = size;\n }\n };\n /**\n * Manage tile pyramid.\n * This function performs a number of functions related to the tiles at the\n * current zoom and lower zoom levels:\n * - registers idle tiles in frameState.wantedTiles so that they are not\n * discarded by the tile queue\n * - enqueues missing tiles\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {import(\"../../source/Tile.js\").default} tileSource Tile source.\n * @param {import(\"../../tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {number} currentZ Current Z.\n * @param {number} preload Load low resolution tiles up to 'preload' levels.\n * @param {function(import(\"../../Tile.js\").default)=} opt_tileCallback Tile callback.\n * @protected\n */\n CanvasTileLayerRenderer.prototype.manageTilePyramid = function (frameState, tileSource, tileGrid, pixelRatio, projection, extent, currentZ, preload, opt_tileCallback) {\n var tileSourceKey = getUid(tileSource);\n if (!(tileSourceKey in frameState.wantedTiles)) {\n frameState.wantedTiles[tileSourceKey] = {};\n }\n var wantedTiles = frameState.wantedTiles[tileSourceKey];\n var tileQueue = frameState.tileQueue;\n var minZoom = tileGrid.getMinZoom();\n var tile, tileRange, tileResolution, x, y, z;\n for (z = minZoom; z <= currentZ; ++z) {\n tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z, tileRange);\n tileResolution = tileGrid.getResolution(z);\n for (x = tileRange.minX; x <= tileRange.maxX; ++x) {\n for (y = tileRange.minY; y <= tileRange.maxY; ++y) {\n if (currentZ - z <= preload) {\n tile = tileSource.getTile(z, x, y, pixelRatio, projection);\n if (tile.getState() == TileState.IDLE) {\n wantedTiles[tile.getKey()] = true;\n if (!tileQueue.isKeyQueued(tile.getKey())) {\n tileQueue.enqueue([tile, tileSourceKey,\n tileGrid.getTileCoordCenter(tile.tileCoord), tileResolution]);\n }\n }\n if (opt_tileCallback !== undefined) {\n opt_tileCallback(tile);\n }\n }\n else {\n tileSource.useTile(z, x, y, projection);\n }\n }\n }\n }\n };\n return CanvasTileLayerRenderer;\n}(CanvasLayerRenderer));\n/**\n * @function\n * @return {import(\"../../layer/Tile.js\").default|import(\"../../layer/VectorTile.js\").default}\n */\nCanvasTileLayerRenderer.prototype.getLayer;\nexport default CanvasTileLayerRenderer;\n//# sourceMappingURL=TileLayer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Tile\n */\nimport BaseTileLayer from './BaseTile.js';\nimport CanvasTileLayerRenderer from '../renderer/canvas/TileLayer.js';\n/**\n * @classdesc\n * For layer sources that provide pre-rendered, tiled images in grids that are\n * organized by zoom levels for specific resolutions.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @api\n */\nvar TileLayer = /** @class */ (function (_super) {\n __extends(TileLayer, _super);\n /**\n * @param {import(\"./BaseTile.js\").Options=} opt_options Tile layer options.\n */\n function TileLayer(opt_options) {\n return _super.call(this, opt_options) || this;\n }\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n TileLayer.prototype.createRenderer = function () {\n return new CanvasTileLayerRenderer(this);\n };\n return TileLayer;\n}(BaseTileLayer));\nexport default TileLayer;\n//# sourceMappingURL=Tile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/source/Raster\n */\nimport ImageCanvas from '../ImageCanvas.js';\nimport TileQueue from '../TileQueue.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport Event from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport { Processor } from 'pixelworks/lib/index.js';\nimport { equals, getCenter, getHeight, getWidth } from '../extent.js';\nimport ImageLayer from '../layer/Image.js';\nimport TileLayer from '../layer/Tile.js';\nimport { assign } from '../obj.js';\nimport { create as createTransform } from '../transform.js';\nimport ImageSource from './Image.js';\nimport TileSource from './Tile.js';\nimport SourceState from './State.js';\nimport Source from './Source.js';\n/**\n * A function that takes an array of input data, performs some operation, and\n * returns an array of output data.\n * For `pixel` type operations, the function will be called with an array of\n * pixels, where each pixel is an array of four numbers (`[r, g, b, a]`) in the\n * range of 0 - 255. It should return a single pixel array.\n * For `'image'` type operations, functions will be called with an array of\n * {@link ImageData https://developer.mozilla.org/en-US/docs/Web/API/ImageData}\n * and should return a single {@link ImageData\n * https://developer.mozilla.org/en-US/docs/Web/API/ImageData}. The operations\n * are called with a second \"data\" argument, which can be used for storage. The\n * data object is accessible from raster events, where it can be initialized in\n * \"beforeoperations\" and accessed again in \"afteroperations\".\n *\n * @typedef {function((Array<Array<number>>|Array<ImageData>), Object):\n * (Array<number>|ImageData)} Operation\n */\n/**\n * @enum {string}\n */\nvar RasterEventType = {\n /**\n * Triggered before operations are run.\n * @event module:ol/source/Raster.RasterSourceEvent#beforeoperations\n * @api\n */\n BEFOREOPERATIONS: 'beforeoperations',\n /**\n * Triggered after operations are run.\n * @event module:ol/source/Raster.RasterSourceEvent#afteroperations\n * @api\n */\n AFTEROPERATIONS: 'afteroperations'\n};\n/**\n * Raster operation type. Supported values are `'pixel'` and `'image'`.\n * @enum {string}\n */\nvar RasterOperationType = {\n PIXEL: 'pixel',\n IMAGE: 'image'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Raster} instances are instances of this\n * type.\n */\nvar RasterSourceEvent = /** @class */ (function (_super) {\n __extends(RasterSourceEvent, _super);\n /**\n * @param {string} type Type.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState The frame state.\n * @param {Object} data An object made available to operations.\n */\n function RasterSourceEvent(type, frameState, data) {\n var _this = _super.call(this, type) || this;\n /**\n * The raster extent.\n * @type {import(\"../extent.js\").Extent}\n * @api\n */\n _this.extent = frameState.extent;\n /**\n * The pixel resolution (map units per pixel).\n * @type {number}\n * @api\n */\n _this.resolution = frameState.viewState.resolution / frameState.pixelRatio;\n /**\n * An object made available to all operations. This can be used by operations\n * as a storage object (e.g. for calculating statistics).\n * @type {Object}\n * @api\n */\n _this.data = data;\n return _this;\n }\n return RasterSourceEvent;\n}(Event));\nexport { RasterSourceEvent };\n/**\n * @typedef {Object} Options\n * @property {Array<import(\"./Source.js\").default|import(\"../layer/Layer.js\").default>} sources Input\n * sources or layers. For vector data, use an VectorImage layer.\n * @property {Operation} [operation] Raster operation.\n * The operation will be called with data from input sources\n * and the output will be assigned to the raster source.\n * @property {Object} [lib] Functions that will be made available to operations run in a worker.\n * @property {number} [threads] By default, operations will be run in a single worker thread.\n * To avoid using workers altogether, set `threads: 0`. For pixel operations, operations can\n * be run in multiple worker threads. Note that there is additional overhead in\n * transferring data to multiple workers, and that depending on the user's\n * system, it may not be possible to parallelize the work.\n * @property {RasterOperationType} [operationType='pixel'] Operation type.\n * Supported values are `'pixel'` and `'image'`. By default,\n * `'pixel'` operations are assumed, and operations will be called with an\n * array of pixels from input sources. If set to `'image'`, operations will\n * be called with an array of ImageData objects from input sources.\n */\n/**\n * @classdesc\n * A source that transforms data from any number of input sources using an\n * {@link module:ol/source/Raster~Operation} function to transform input pixel values into\n * output pixel values.\n *\n * @fires module:ol/source/Raster.RasterSourceEvent\n * @api\n */\nvar RasterSource = /** @class */ (function (_super) {\n __extends(RasterSource, _super);\n /**\n * @param {Options} options Options.\n */\n function RasterSource(options) {\n var _this = _super.call(this, {\n projection: null\n }) || this;\n /**\n * @private\n * @type {*}\n */\n _this.worker_ = null;\n /**\n * @private\n * @type {RasterOperationType}\n */\n _this.operationType_ = options.operationType !== undefined ?\n options.operationType : RasterOperationType.PIXEL;\n /**\n * @private\n * @type {number}\n */\n _this.threads_ = options.threads !== undefined ? options.threads : 1;\n /**\n * @private\n * @type {Array<import(\"../layer/Layer.js\").default>}\n */\n _this.layers_ = createLayers(options.sources);\n var changed = _this.changed.bind(_this);\n for (var i = 0, ii = _this.layers_.length; i < ii; ++i) {\n _this.layers_[i].addEventListener(EventType.CHANGE, changed);\n }\n /**\n * @private\n * @type {import(\"../TileQueue.js\").default}\n */\n _this.tileQueue_ = new TileQueue(function () {\n return 1;\n }, _this.changed.bind(_this));\n /**\n * The most recently requested frame state.\n * @type {import(\"../PluggableMap.js\").FrameState}\n * @private\n */\n _this.requestedFrameState_;\n /**\n * The most recently rendered image canvas.\n * @type {import(\"../ImageCanvas.js\").default}\n * @private\n */\n _this.renderedImageCanvas_ = null;\n /**\n * The most recently rendered revision.\n * @type {number}\n */\n _this.renderedRevision_;\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").FrameState}\n */\n _this.frameState_ = {\n animate: false,\n coordinateToPixelTransform: createTransform(),\n extent: null,\n index: 0,\n layerIndex: 0,\n layerStatesArray: getLayerStatesArray(_this.layers_),\n pixelRatio: 1,\n pixelToCoordinateTransform: createTransform(),\n postRenderFunctions: [],\n size: [0, 0],\n tileQueue: _this.tileQueue_,\n time: Date.now(),\n usedTiles: {},\n viewState: /** @type {import(\"../View.js\").State} */ ({\n rotation: 0\n }),\n viewHints: [],\n wantedTiles: {},\n declutterItems: []\n };\n _this.setAttributions(function (frameState) {\n var attributions = [];\n for (var index = 0, iMax = options.sources.length; index < iMax; ++index) {\n var sourceOrLayer = options.sources[index];\n var source = sourceOrLayer instanceof Source ? sourceOrLayer : sourceOrLayer.getSource();\n var attributionGetter = source.getAttributions();\n if (typeof attributionGetter === 'function') {\n var sourceAttribution = attributionGetter(frameState);\n attributions.push.apply(attributions, sourceAttribution);\n }\n }\n return attributions.length !== 0 ? attributions : null;\n });\n if (options.operation !== undefined) {\n _this.setOperation(options.operation, options.lib);\n }\n return _this;\n }\n /**\n * Set the operation.\n * @param {Operation} operation New operation.\n * @param {Object=} opt_lib Functions that will be available to operations run\n * in a worker.\n * @api\n */\n RasterSource.prototype.setOperation = function (operation, opt_lib) {\n this.worker_ = new Processor({\n operation: operation,\n imageOps: this.operationType_ === RasterOperationType.IMAGE,\n queue: 1,\n lib: opt_lib,\n threads: this.threads_\n });\n this.changed();\n };\n /**\n * Update the stored frame state.\n * @param {import(\"../extent.js\").Extent} extent The view extent (in map units).\n * @param {number} resolution The view resolution.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../PluggableMap.js\").FrameState} The updated frame state.\n * @private\n */\n RasterSource.prototype.updateFrameState_ = function (extent, resolution, projection) {\n var frameState = /** @type {import(\"../PluggableMap.js\").FrameState} */ (assign({}, this.frameState_));\n frameState.viewState = /** @type {import(\"../View.js\").State} */ (assign({}, frameState.viewState));\n var center = getCenter(extent);\n frameState.extent = extent.slice();\n frameState.size[0] = Math.round(getWidth(extent) / resolution);\n frameState.size[1] = Math.round(getHeight(extent) / resolution);\n frameState.time = Infinity;\n var viewState = frameState.viewState;\n viewState.center = center;\n viewState.projection = projection;\n viewState.resolution = resolution;\n return frameState;\n };\n /**\n * Determine if all sources are ready.\n * @return {boolean} All sources are ready.\n * @private\n */\n RasterSource.prototype.allSourcesReady_ = function () {\n var ready = true;\n var source;\n for (var i = 0, ii = this.layers_.length; i < ii; ++i) {\n source = this.layers_[i].getSource();\n if (source.getState() !== SourceState.READY) {\n ready = false;\n break;\n }\n }\n return ready;\n };\n /**\n * @inheritDoc\n */\n RasterSource.prototype.getImage = function (extent, resolution, pixelRatio, projection) {\n if (!this.allSourcesReady_()) {\n return null;\n }\n var frameState = this.updateFrameState_(extent, resolution, projection);\n this.requestedFrameState_ = frameState;\n // check if we can't reuse the existing ol/ImageCanvas\n if (this.renderedImageCanvas_) {\n var renderedResolution = this.renderedImageCanvas_.getResolution();\n var renderedExtent = this.renderedImageCanvas_.getExtent();\n if (resolution !== renderedResolution || !equals(extent, renderedExtent)) {\n this.renderedImageCanvas_ = null;\n }\n }\n if (!this.renderedImageCanvas_ || this.getRevision() !== this.renderedRevision_) {\n this.processSources_();\n }\n frameState.tileQueue.loadMoreTiles(16, 16);\n if (frameState.animate) {\n requestAnimationFrame(this.changed.bind(this));\n }\n return this.renderedImageCanvas_;\n };\n /**\n * Start processing source data.\n * @private\n */\n RasterSource.prototype.processSources_ = function () {\n var frameState = this.requestedFrameState_;\n var len = this.layers_.length;\n var imageDatas = new Array(len);\n for (var i = 0; i < len; ++i) {\n frameState.layerIndex = i;\n var imageData = getImageData(this.layers_[i], frameState);\n if (imageData) {\n imageDatas[i] = imageData;\n }\n else {\n return;\n }\n }\n var data = {};\n this.dispatchEvent(new RasterSourceEvent(RasterEventType.BEFOREOPERATIONS, frameState, data));\n this.worker_.process(imageDatas, data, this.onWorkerComplete_.bind(this, frameState));\n };\n /**\n * Called when pixel processing is complete.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState The frame state.\n * @param {Error} err Any error during processing.\n * @param {ImageData} output The output image data.\n * @param {Object} data The user data.\n * @private\n */\n RasterSource.prototype.onWorkerComplete_ = function (frameState, err, output, data) {\n if (err || !output) {\n return;\n }\n // do nothing if extent or resolution changed\n var extent = frameState.extent;\n var resolution = frameState.viewState.resolution;\n if (resolution !== this.requestedFrameState_.viewState.resolution ||\n !equals(extent, this.requestedFrameState_.extent)) {\n return;\n }\n var context;\n if (this.renderedImageCanvas_) {\n context = this.renderedImageCanvas_.getImage().getContext('2d');\n }\n else {\n var width = Math.round(getWidth(extent) / resolution);\n var height = Math.round(getHeight(extent) / resolution);\n context = createCanvasContext2D(width, height);\n this.renderedImageCanvas_ = new ImageCanvas(extent, resolution, 1, context.canvas);\n }\n context.putImageData(output, 0, 0);\n this.changed();\n this.renderedRevision_ = this.getRevision();\n this.dispatchEvent(new RasterSourceEvent(RasterEventType.AFTEROPERATIONS, frameState, data));\n };\n /**\n * @override\n */\n RasterSource.prototype.getImageInternal = function () {\n return null; // not implemented\n };\n return RasterSource;\n}(ImageSource));\n/**\n * A reusable canvas context.\n * @type {CanvasRenderingContext2D}\n * @private\n */\nvar sharedContext = null;\n/**\n * Get image data from a layer.\n * @param {import(\"../layer/Layer.js\").default} layer Layer to render.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState The frame state.\n * @return {ImageData} The image data.\n */\nfunction getImageData(layer, frameState) {\n var renderer = layer.getRenderer();\n if (!renderer) {\n throw new Error('Unsupported layer type: ' + layer);\n }\n if (!renderer.prepareFrame(frameState)) {\n return null;\n }\n var width = frameState.size[0];\n var height = frameState.size[1];\n var container = renderer.renderFrame(frameState, null);\n var element;\n if (container) {\n element = container.firstElementChild;\n }\n if (!(element instanceof HTMLCanvasElement)) {\n throw new Error('Unsupported rendered element: ' + element);\n }\n if (element.width === width && element.height === height) {\n var context = element.getContext('2d');\n return context.getImageData(0, 0, width, height);\n }\n if (!sharedContext) {\n sharedContext = createCanvasContext2D(width, height);\n }\n else {\n var canvas = sharedContext.canvas;\n if (canvas.width !== width || canvas.height !== height) {\n sharedContext = createCanvasContext2D(width, height);\n }\n else {\n sharedContext.clearRect(0, 0, width, height);\n }\n }\n sharedContext.drawImage(element, 0, 0, width, height);\n return sharedContext.getImageData(0, 0, width, height);\n}\n/**\n * Get a list of layer states from a list of layers.\n * @param {Array<import(\"../layer/Layer.js\").default>} layers Layers.\n * @return {Array<import(\"../layer/Layer.js\").State>} The layer states.\n */\nfunction getLayerStatesArray(layers) {\n return layers.map(function (layer) {\n return layer.getLayerState();\n });\n}\n/**\n * Create layers for all sources.\n * @param {Array<import(\"./Source.js\").default|import(\"../layer/Layer.js\").default>} sources The sources.\n * @return {Array<import(\"../layer/Layer.js\").default>} Array of layers.\n */\nfunction createLayers(sources) {\n var len = sources.length;\n var layers = new Array(len);\n for (var i = 0; i < len; ++i) {\n layers[i] = createLayer(sources[i]);\n }\n return layers;\n}\n/**\n * Create a layer for the provided source.\n * @param {import(\"./Source.js\").default|import(\"../layer/Layer.js\").default} layerOrSource The layer or source.\n * @return {import(\"../layer/Layer.js\").default} The layer.\n */\nfunction createLayer(layerOrSource) {\n // @type {import(\"../layer/Layer.js\").default}\n var layer;\n if (layerOrSource instanceof Source) {\n if (layerOrSource instanceof TileSource) {\n layer = new TileLayer({ source: layerOrSource });\n }\n else if (layerOrSource instanceof ImageSource) {\n layer = new ImageLayer({ source: layerOrSource });\n }\n }\n else {\n layer = layerOrSource;\n }\n return layer;\n}\nexport default RasterSource;\n//# sourceMappingURL=Raster.js.map","/**\n * @module ol/source/Stamen\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ATTRIBUTION as OSM_ATTRIBUTION } from './OSM.js';\nimport XYZ from './XYZ.js';\n/**\n * @const\n * @type {Array<string>}\n */\nvar ATTRIBUTIONS = [\n 'Map tiles by <a href=\"https://stamen.com/\" target=\"_blank\">Stamen Design</a>, ' +\n 'under <a href=\"https://creativecommons.org/licenses/by/3.0/\" target=\"_blank\">CC BY' +\n ' 3.0</a>.',\n OSM_ATTRIBUTION\n];\n/**\n * @type {Object<string, {extension: string, opaque: boolean}>}\n */\nvar LayerConfig = {\n 'terrain': {\n extension: 'jpg',\n opaque: true\n },\n 'terrain-background': {\n extension: 'jpg',\n opaque: true\n },\n 'terrain-labels': {\n extension: 'png',\n opaque: false\n },\n 'terrain-lines': {\n extension: 'png',\n opaque: false\n },\n 'toner-background': {\n extension: 'png',\n opaque: true\n },\n 'toner': {\n extension: 'png',\n opaque: true\n },\n 'toner-hybrid': {\n extension: 'png',\n opaque: false\n },\n 'toner-labels': {\n extension: 'png',\n opaque: false\n },\n 'toner-lines': {\n extension: 'png',\n opaque: false\n },\n 'toner-lite': {\n extension: 'png',\n opaque: true\n },\n 'watercolor': {\n extension: 'jpg',\n opaque: true\n }\n};\n/**\n * @type {Object<string, {minZoom: number, maxZoom: number}>}\n */\nvar ProviderConfig = {\n 'terrain': {\n minZoom: 0,\n maxZoom: 18\n },\n 'toner': {\n minZoom: 0,\n maxZoom: 20\n },\n 'watercolor': {\n minZoom: 0,\n maxZoom: 18\n }\n};\n/**\n * @typedef {Object} Options\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {string} layer Layer name.\n * @property {number} [minZoom] Minimum zoom.\n * @property {number} [maxZoom] Maximum zoom.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction]\n * Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n * @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n */\n/**\n * @classdesc\n * Layer source for the Stamen tile server.\n * @api\n */\nvar Stamen = /** @class */ (function (_super) {\n __extends(Stamen, _super);\n /**\n * @param {Options} options Stamen options.\n */\n function Stamen(options) {\n var _this = this;\n var i = options.layer.indexOf('-');\n var provider = i == -1 ? options.layer : options.layer.slice(0, i);\n var providerConfig = ProviderConfig[provider];\n var layerConfig = LayerConfig[options.layer];\n var url = options.url !== undefined ? options.url :\n 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer +\n '/{z}/{x}/{y}.' + layerConfig.extension;\n _this = _super.call(this, {\n attributions: ATTRIBUTIONS,\n cacheSize: options.cacheSize,\n crossOrigin: 'anonymous',\n maxZoom: options.maxZoom != undefined ? options.maxZoom : providerConfig.maxZoom,\n minZoom: options.minZoom != undefined ? options.minZoom : providerConfig.minZoom,\n opaque: layerConfig.opaque,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileLoadFunction: options.tileLoadFunction,\n transition: options.transition,\n url: url,\n wrapX: options.wrapX\n }) || this;\n return _this;\n }\n return Stamen;\n}(XYZ));\nexport default Stamen;\n//# sourceMappingURL=Stamen.js.map","/**\n * @module ol/source/TileArcGISRest\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { createEmpty } from '../extent.js';\nimport { modulo } from '../math.js';\nimport { assign } from '../obj.js';\nimport { toSize, scale as scaleSize } from '../size.js';\nimport TileImage from './TileImage.js';\nimport { hash as tileCoordHash } from '../tilecoord.js';\nimport { appendParams } from '../uri.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {Object<string,*>} [params] ArcGIS Rest parameters. This field is optional. Service defaults will be\n * used for any fields not specified. `FORMAT` is `PNG32` by default. `F` is `IMAGE` by\n * default. `TRANSPARENT` is `true` by default. `BBOX`, `SIZE`, `BBOXSR`,\n * and `IMAGESR` will be set dynamically. Set `LAYERS` to\n * override the default service layer visibility. See\n * http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/\n * for further reference.\n * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting\n * the image from the remote server.\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid] Tile grid. Base this on the resolutions,\n * tilesize and extent supported by the server.\n * If this is not defined, a default grid will be used: if there is a projection\n * extent, the grid will be based on that; if not, a grid based on a global\n * extent with origin at 0,0 will be used.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL.\n * The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {string} [url] ArcGIS Rest service URL for a Map Service or Image Service. The\n * url should include /MapServer or /ImageServer.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * @property {number} [transition] Duration of the opacity transition for rendering. To disable the opacity\n * transition, pass `transition: 0`.\n * @property {Array<string>} [urls] ArcGIS Rest service urls. Use this instead of `url` when the ArcGIS\n * Service supports multiple urls for export requests.\n */\n/**\n * @classdesc\n * Layer source for tile data from ArcGIS Rest services. Map and Image\n * Services are supported.\n *\n * For cached ArcGIS services, better performance is available using the\n * {@link module:ol/source/XYZ~XYZ} data source.\n * @api\n */\nvar TileArcGISRest = /** @class */ (function (_super) {\n __extends(TileArcGISRest, _super);\n /**\n * @param {Options=} opt_options Tile ArcGIS Rest options.\n */\n function TileArcGISRest(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n projection: options.projection,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileGrid: options.tileGrid,\n tileLoadFunction: options.tileLoadFunction,\n tileUrlFunction: tileUrlFunction,\n url: options.url,\n urls: options.urls,\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n transition: options.transition\n }) || this;\n /**\n * @private\n * @type {!Object}\n */\n _this.params_ = options.params || {};\n /**\n * @private\n * @type {boolean}\n */\n _this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.tmpExtent_ = createEmpty();\n _this.setKey(_this.getKeyForParams_());\n return _this;\n }\n /**\n * @private\n * @return {string} The key for the current params.\n */\n TileArcGISRest.prototype.getKeyForParams_ = function () {\n var i = 0;\n var res = [];\n for (var key in this.params_) {\n res[i++] = key + '-' + this.params_[key];\n }\n return res.join('/');\n };\n /**\n * Get the user-provided params, i.e. those passed to the constructor through\n * the \"params\" option, and possibly updated using the updateParams method.\n * @return {Object} Params.\n * @api\n */\n TileArcGISRest.prototype.getParams = function () {\n return this.params_;\n };\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"../size.js\").Size} tileSize Tile size.\n * @param {import(\"../extent.js\").Extent} tileExtent Tile extent.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {Object} params Params.\n * @return {string|undefined} Request URL.\n * @private\n */\n TileArcGISRest.prototype.getRequestUrl_ = function (tileCoord, tileSize, tileExtent, pixelRatio, projection, params) {\n var urls = this.urls;\n if (!urls) {\n return undefined;\n }\n // ArcGIS Server only wants the numeric portion of the projection ID.\n var srid = projection.getCode().split(':').pop();\n params['SIZE'] = tileSize[0] + ',' + tileSize[1];\n params['BBOX'] = tileExtent.join(',');\n params['BBOXSR'] = srid;\n params['IMAGESR'] = srid;\n params['DPI'] = Math.round(params['DPI'] ? params['DPI'] * pixelRatio : 90 * pixelRatio);\n var url;\n if (urls.length == 1) {\n url = urls[0];\n }\n else {\n var index = modulo(tileCoordHash(tileCoord), urls.length);\n url = urls[index];\n }\n var modifiedUrl = url\n .replace(/MapServer\\/?$/, 'MapServer/export')\n .replace(/ImageServer\\/?$/, 'ImageServer/exportImage');\n return appendParams(modifiedUrl, params);\n };\n /**\n * @inheritDoc\n */\n TileArcGISRest.prototype.getTilePixelRatio = function (pixelRatio) {\n return this.hidpi_ ? /** @type {number} */ (pixelRatio) : 1;\n };\n /**\n * Update the user-provided params.\n * @param {Object} params Params.\n * @api\n */\n TileArcGISRest.prototype.updateParams = function (params) {\n assign(this.params_, params);\n this.setKey(this.getKeyForParams_());\n };\n return TileArcGISRest;\n}(TileImage));\n/**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord The tile coordinate\n * @param {number} pixelRatio The pixel ratio\n * @param {import(\"../proj/Projection.js\").default} projection The projection\n * @return {string|undefined} The tile URL\n * @this {TileArcGISRest}\n */\nfunction tileUrlFunction(tileCoord, pixelRatio, projection) {\n var tileGrid = this.getTileGrid();\n if (!tileGrid) {\n tileGrid = this.getTileGridForProjection(projection);\n }\n if (tileGrid.getResolutions().length <= tileCoord[0]) {\n return undefined;\n }\n if (pixelRatio != 1 && !this.hidpi_) {\n pixelRatio = 1;\n }\n var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);\n var tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);\n if (pixelRatio != 1) {\n tileSize = scaleSize(tileSize, pixelRatio, this.tmpSize);\n }\n // Apply default params and override with user specified values.\n var baseParams = {\n 'F': 'image',\n 'FORMAT': 'PNG32',\n 'TRANSPARENT': true\n };\n assign(baseParams, this.params_);\n return this.getRequestUrl_(tileCoord, tileSize, tileExtent, pixelRatio, projection, baseParams);\n}\nexport default TileArcGISRest;\n//# sourceMappingURL=TileArcGISRest.js.map","/**\n * @module ol/source/TileDebug\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport Tile from '../Tile.js';\nimport TileState from '../TileState.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport { toSize } from '../size.js';\nimport XYZ from './XYZ.js';\nimport { getKeyZXY } from '../tilecoord.js';\nvar LabeledTile = /** @class */ (function (_super) {\n __extends(LabeledTile, _super);\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"../size.js\").Size} tileSize Tile size.\n * @param {string} text Text.\n */\n function LabeledTile(tileCoord, tileSize, text) {\n var _this = _super.call(this, tileCoord, TileState.LOADED) || this;\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n _this.tileSize_ = tileSize;\n /**\n * @private\n * @type {string}\n */\n _this.text_ = text;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = null;\n return _this;\n }\n /**\n * Get the image element for this tile.\n * @return {HTMLCanvasElement} Image.\n */\n LabeledTile.prototype.getImage = function () {\n if (this.canvas_) {\n return this.canvas_;\n }\n else {\n var tileSize = this.tileSize_;\n var context = createCanvasContext2D(tileSize[0], tileSize[1]);\n context.strokeStyle = 'grey';\n context.strokeRect(0.5, 0.5, tileSize[0] + 0.5, tileSize[1] + 0.5);\n context.fillStyle = 'grey';\n context.strokeStyle = 'white';\n context.textAlign = 'center';\n context.textBaseline = 'middle';\n context.font = '24px sans-serif';\n context.lineWidth = 4;\n context.strokeText(this.text_, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]);\n context.fillText(this.text_, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]);\n this.canvas_ = context.canvas;\n return context.canvas;\n }\n };\n /**\n * @override\n */\n LabeledTile.prototype.load = function () { };\n return LabeledTile;\n}(Tile));\n/**\n * @typedef {Object} Options\n * @property {import(\"../proj.js\").ProjectionLike} [projection='EPSG:3857'] Optional projection.\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid] Tile grid.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * @property {number} [zDirection=0] Set to `1` when debugging `VectorTile` sources with\n * a default configuration. Indicates which resolution should be used by a renderer if\n * the view resolution does not match any resolution of the tile source. If 0, the nearest\n * resolution will be used. If 1, the nearest lower resolution will be used. If -1, the\n * nearest higher resolution will be used.\n */\n/**\n * @classdesc\n * A pseudo tile source, which does not fetch tiles from a server, but renders\n * a grid outline for the tile grid/projection along with the coordinates for\n * each tile. See examples/canvas-tiles for an example.\n *\n * Uses Canvas context2d, so requires Canvas support.\n * @api\n */\nvar TileDebug = /** @class */ (function (_super) {\n __extends(TileDebug, _super);\n /**\n * @param {Options=} opt_options Debug tile options.\n */\n function TileDebug(opt_options) {\n var _this = this;\n /**\n * @type {Options}\n */\n var options = opt_options || {};\n _this = _super.call(this, {\n opaque: false,\n projection: options.projection,\n tileGrid: options.tileGrid,\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n zDirection: options.zDirection\n }) || this;\n return _this;\n }\n /**\n * @inheritDoc\n */\n TileDebug.prototype.getTile = function (z, x, y) {\n var tileCoordKey = getKeyZXY(z, x, y);\n if (this.tileCache.containsKey(tileCoordKey)) {\n return /** @type {!LabeledTile} */ (this.tileCache.get(tileCoordKey));\n }\n else {\n var tileSize = toSize(this.tileGrid.getTileSize(z));\n var tileCoord = [z, x, y];\n var textTileCoord = this.getTileCoordForTileUrlFunction(tileCoord);\n var text = void 0;\n if (textTileCoord) {\n text = 'z:' + textTileCoord[0] + ' x:' + textTileCoord[1] + ' y:' + textTileCoord[2];\n }\n else {\n text = 'none';\n }\n var tile = new LabeledTile(tileCoord, tileSize, text);\n this.tileCache.set(tileCoordKey, tile);\n return tile;\n }\n };\n return TileDebug;\n}(XYZ));\nexport default TileDebug;\n//# sourceMappingURL=TileDebug.js.map","/**\n * @module ol/source/TileJSON\n */\n// FIXME check order of async callbacks\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * See https://mapbox.com/developers/api/.\n */\nimport { createFromTemplates } from '../tileurlfunction.js';\nimport { assert } from '../asserts.js';\nimport { applyTransform, intersects } from '../extent.js';\nimport { jsonp as requestJSONP } from '../net.js';\nimport { get as getProjection, getTransformFromProjections } from '../proj.js';\nimport SourceState from './State.js';\nimport TileImage from './TileImage.js';\nimport { createXYZ, extentFromProjection } from '../tilegrid.js';\n/**\n * @typedef {Object} Config\n * @property {string} [name] The name.\n * @property {string} [description] The description.\n * @property {string} [version] The version.\n * @property {string} [attribution] The attribution.\n * @property {string} [template] The template.\n * @property {string} [legend] The legend.\n * @property {string} [scheme] The scheme.\n * @property {Array<string>} tiles The tile URL templates.\n * @property {Array<string>} [grids] Optional grids.\n * @property {number} [minzoom] Minimum zoom level.\n * @property {number} [maxzoom] Maximum zoom level.\n * @property {Array<number>} [bounds] Optional bounds.\n * @property {Array<number>} [center] Optional center.\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {boolean} [jsonp=false] Use JSONP with callback to load the TileJSON.\n * Useful when the server does not support CORS..\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {Config} [tileJSON] TileJSON configuration for this source.\n * If not provided, `url` must be configured.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {number|import(\"../size.js\").Size} [tileSize=[256, 256]] The tile size used by the tile service.\n * Note: `tileSize` and other non-standard TileJSON properties are currently ignored.\n * @property {string} [url] URL to the TileJSON file. If not provided, `tileJSON` must be configured.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n */\n/**\n * @classdesc\n * Layer source for tile data in TileJSON format.\n * @api\n */\nvar TileJSON = /** @class */ (function (_super) {\n __extends(TileJSON, _super);\n /**\n * @param {Options} options TileJSON options.\n */\n function TileJSON(options) {\n var _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n projection: getProjection('EPSG:3857'),\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n state: SourceState.LOADING,\n tileLoadFunction: options.tileLoadFunction,\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n transition: options.transition\n }) || this;\n /**\n * @type {Config}\n * @private\n */\n _this.tileJSON_ = null;\n /**\n * @type {number|import(\"../size.js\").Size}\n * @private\n */\n _this.tileSize_ = options.tileSize;\n if (options.url) {\n if (options.jsonp) {\n requestJSONP(options.url, _this.handleTileJSONResponse.bind(_this), _this.handleTileJSONError.bind(_this));\n }\n else {\n var client = new XMLHttpRequest();\n client.addEventListener('load', _this.onXHRLoad_.bind(_this));\n client.addEventListener('error', _this.onXHRError_.bind(_this));\n client.open('GET', options.url);\n client.send();\n }\n }\n else if (options.tileJSON) {\n _this.handleTileJSONResponse(options.tileJSON);\n }\n else {\n assert(false, 51); // Either `url` or `tileJSON` options must be provided\n }\n return _this;\n }\n /**\n * @private\n * @param {Event} event The load event.\n */\n TileJSON.prototype.onXHRLoad_ = function (event) {\n var client = /** @type {XMLHttpRequest} */ (event.target);\n // status will be 0 for file:// urls\n if (!client.status || client.status >= 200 && client.status < 300) {\n var response = void 0;\n try {\n response = /** @type {TileJSON} */ (JSON.parse(client.responseText));\n }\n catch (err) {\n this.handleTileJSONError();\n return;\n }\n this.handleTileJSONResponse(response);\n }\n else {\n this.handleTileJSONError();\n }\n };\n /**\n * @private\n * @param {Event} event The error event.\n */\n TileJSON.prototype.onXHRError_ = function (event) {\n this.handleTileJSONError();\n };\n /**\n * @return {Config} The tilejson object.\n * @api\n */\n TileJSON.prototype.getTileJSON = function () {\n return this.tileJSON_;\n };\n /**\n * @protected\n * @param {Config} tileJSON Tile JSON.\n */\n TileJSON.prototype.handleTileJSONResponse = function (tileJSON) {\n var epsg4326Projection = getProjection('EPSG:4326');\n var sourceProjection = this.getProjection();\n var extent;\n if (tileJSON['bounds'] !== undefined) {\n var transform = getTransformFromProjections(epsg4326Projection, sourceProjection);\n extent = applyTransform(tileJSON['bounds'], transform);\n }\n var minZoom = tileJSON['minzoom'] || 0;\n var maxZoom = tileJSON['maxzoom'] || 22;\n var tileGrid = createXYZ({\n extent: extentFromProjection(sourceProjection),\n maxZoom: maxZoom,\n minZoom: minZoom,\n tileSize: this.tileSize_\n });\n this.tileGrid = tileGrid;\n this.tileUrlFunction = createFromTemplates(tileJSON['tiles'], tileGrid);\n if (tileJSON['attribution'] !== undefined && !this.getAttributions()) {\n var attributionExtent_1 = extent !== undefined ?\n extent : epsg4326Projection.getExtent();\n this.setAttributions(function (frameState) {\n if (intersects(attributionExtent_1, frameState.extent)) {\n return [tileJSON['attribution']];\n }\n return null;\n });\n }\n this.tileJSON_ = tileJSON;\n this.setState(SourceState.READY);\n };\n /**\n * @protected\n */\n TileJSON.prototype.handleTileJSONError = function () {\n this.setState(SourceState.ERROR);\n };\n return TileJSON;\n}(TileImage));\nexport default TileJSON;\n//# sourceMappingURL=TileJSON.js.map","/**\n * @module ol/source/TileWMS\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DEFAULT_WMS_VERSION } from './common.js';\nimport { assert } from '../asserts.js';\nimport { buffer, createEmpty } from '../extent.js';\nimport { assign } from '../obj.js';\nimport { modulo } from '../math.js';\nimport { get as getProjection, transform, transformExtent } from '../proj.js';\nimport { calculateSourceResolution } from '../reproj.js';\nimport { toSize, buffer as bufferSize, scale as scaleSize } from '../size.js';\nimport TileImage from './TileImage.js';\nimport WMSServerType from './WMSServerType.js';\nimport { hash as tileCoordHash } from '../tilecoord.js';\nimport { compareVersions } from '../string.js';\nimport { appendParams } from '../uri.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {Object<string,*>} params WMS request parameters.\n * At least a `LAYERS` param is required. `STYLES` is\n * `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX`\n * and `CRS` (`SRS` for WMS version < 1.3.0) will be set dynamically.\n * @property {number} [gutter=0]\n * The size in pixels of the gutter around image tiles to ignore. By setting\n * this property to a non-zero value, images will be requested that are wider\n * and taller than the tile size by a value of `2 x gutter`.\n * Using a non-zero value allows artifacts of rendering at tile edges to be\n * ignored. If you control the WMS service it is recommended to address\n * \"artifacts at tile edges\" issues by properly configuring the WMS service. For\n * example, MapServer has a `tile_map_edge_buffer` configuration parameter for\n * this. See http://mapserver.org/output/tile_mode.html.\n * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting\n * the image from the remote server.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {typeof import(\"../ImageTile.js\").default} [tileClass] Class used to instantiate image tiles.\n * Default is {@link module:ol/ImageTile~ImageTile}.\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid] Tile grid. Base this on the resolutions,\n * tilesize and extent supported by the server.\n * If this is not defined, a default grid will be used: if there is a projection\n * extent, the grid will be based on that; if not, a grid based on a global\n * extent with origin at 0,0 will be used..\n * @property {import(\"./WMSServerType.js\").default|string} [serverType]\n * The type of the remote WMS server. Currently only used when `hidpi` is\n * `true`.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {string} [url] WMS service URL.\n * @property {Array<string>} [urls] WMS service urls.\n * Use this instead of `url` when the WMS supports multiple urls for GetMap requests.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * When set to `false`, only one world\n * will be rendered. When `true`, tiles will be requested for one world only,\n * but they will be wrapped horizontally to render multiple worlds.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n */\n/**\n * @classdesc\n * Layer source for tile data from WMS servers.\n * @api\n */\nvar TileWMS = /** @class */ (function (_super) {\n __extends(TileWMS, _super);\n /**\n * @param {Options=} [opt_options] Tile WMS options.\n */\n function TileWMS(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : /** @type {Options} */ ({});\n var params = options.params || {};\n var transparent = 'TRANSPARENT' in params ? params['TRANSPARENT'] : true;\n _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n opaque: !transparent,\n projection: options.projection,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileClass: options.tileClass,\n tileGrid: options.tileGrid,\n tileLoadFunction: options.tileLoadFunction,\n tileUrlFunction: tileUrlFunction,\n url: options.url,\n urls: options.urls,\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n transition: options.transition\n }) || this;\n /**\n * @private\n * @type {number}\n */\n _this.gutter_ = options.gutter !== undefined ? options.gutter : 0;\n /**\n * @private\n * @type {!Object}\n */\n _this.params_ = params;\n /**\n * @private\n * @type {boolean}\n */\n _this.v13_ = true;\n /**\n * @private\n * @type {import(\"./WMSServerType.js\").default|undefined}\n */\n _this.serverType_ = /** @type {import(\"./WMSServerType.js\").default|undefined} */ (options.serverType);\n /**\n * @private\n * @type {boolean}\n */\n _this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.tmpExtent_ = createEmpty();\n _this.updateV13_();\n _this.setKey(_this.getKeyForParams_());\n return _this;\n }\n /**\n * Return the GetFeatureInfo URL for the passed coordinate, resolution, and\n * projection. Return `undefined` if the GetFeatureInfo URL cannot be\n * constructed.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {import(\"../proj.js\").ProjectionLike} projection Projection.\n * @param {!Object} params GetFeatureInfo params. `INFO_FORMAT` at least should\n * be provided. If `QUERY_LAYERS` is not provided then the layers specified\n * in the `LAYERS` parameter will be used. `VERSION` should not be\n * specified here.\n * @return {string|undefined} GetFeatureInfo URL.\n * @api\n */\n TileWMS.prototype.getFeatureInfoUrl = function (coordinate, resolution, projection, params) {\n var projectionObj = getProjection(projection);\n var sourceProjectionObj = this.getProjection();\n var tileGrid = this.getTileGrid();\n if (!tileGrid) {\n tileGrid = this.getTileGridForProjection(projectionObj);\n }\n var z = tileGrid.getZForResolution(resolution, this.zDirection);\n var tileCoord = tileGrid.getTileCoordForCoordAndZ(coordinate, z);\n if (tileGrid.getResolutions().length <= tileCoord[0]) {\n return undefined;\n }\n var tileResolution = tileGrid.getResolution(tileCoord[0]);\n var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);\n var tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);\n var gutter = this.gutter_;\n if (gutter !== 0) {\n tileSize = bufferSize(tileSize, gutter, this.tmpSize);\n tileExtent = buffer(tileExtent, tileResolution * gutter, tileExtent);\n }\n if (sourceProjectionObj && sourceProjectionObj !== projectionObj) {\n tileResolution = calculateSourceResolution(sourceProjectionObj, projectionObj, coordinate, tileResolution);\n tileExtent = transformExtent(tileExtent, projectionObj, sourceProjectionObj);\n coordinate = transform(coordinate, projectionObj, sourceProjectionObj);\n }\n var baseParams = {\n 'SERVICE': 'WMS',\n 'VERSION': DEFAULT_WMS_VERSION,\n 'REQUEST': 'GetFeatureInfo',\n 'FORMAT': 'image/png',\n 'TRANSPARENT': true,\n 'QUERY_LAYERS': this.params_['LAYERS']\n };\n assign(baseParams, this.params_, params);\n var x = Math.floor((coordinate[0] - tileExtent[0]) / tileResolution);\n var y = Math.floor((tileExtent[3] - coordinate[1]) / tileResolution);\n baseParams[this.v13_ ? 'I' : 'X'] = x;\n baseParams[this.v13_ ? 'J' : 'Y'] = y;\n return this.getRequestUrl_(tileCoord, tileSize, tileExtent, 1, sourceProjectionObj || projectionObj, baseParams);\n };\n /**\n * Return the GetLegendGraphic URL, optionally optimized for the passed\n * resolution and possibly including any passed specific parameters. Returns\n * `undefined` if the GetLegendGraphic URL cannot be constructed.\n *\n * @param {number} [resolution] Resolution. If set to undefined, `SCALE`\n * will not be calculated and included in URL.\n * @param {Object} [params] GetLegendGraphic params. If `LAYER` is set, the\n * request is generated for this wms layer, else it will try to use the\n * configured wms layer. Default `FORMAT` is `image/png`.\n * `VERSION` should not be specified here.\n * @return {string|undefined} GetLegendGraphic URL.\n * @api\n */\n TileWMS.prototype.getLegendUrl = function (resolution, params) {\n if (this.urls[0] === undefined) {\n return undefined;\n }\n var baseParams = {\n 'SERVICE': 'WMS',\n 'VERSION': DEFAULT_WMS_VERSION,\n 'REQUEST': 'GetLegendGraphic',\n 'FORMAT': 'image/png'\n };\n if (params === undefined || params['LAYER'] === undefined) {\n var layers = this.params_.LAYERS;\n var isSingleLayer = !Array.isArray(layers) || layers.length === 1;\n if (!isSingleLayer) {\n return undefined;\n }\n baseParams['LAYER'] = layers;\n }\n if (resolution !== undefined) {\n var mpu = this.getProjection() ? this.getProjection().getMetersPerUnit() : 1;\n var dpi = 25.4 / 0.28;\n var inchesPerMeter = 39.37;\n baseParams['SCALE'] = resolution * mpu * inchesPerMeter * dpi;\n }\n assign(baseParams, params);\n return appendParams(/** @type {string} */ (this.urls[0]), baseParams);\n };\n /**\n * @inheritDoc\n */\n TileWMS.prototype.getGutter = function () {\n return this.gutter_;\n };\n /**\n * Get the user-provided params, i.e. those passed to the constructor through\n * the \"params\" option, and possibly updated using the updateParams method.\n * @return {Object} Params.\n * @api\n */\n TileWMS.prototype.getParams = function () {\n return this.params_;\n };\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"../size.js\").Size} tileSize Tile size.\n * @param {import(\"../extent.js\").Extent} tileExtent Tile extent.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {Object} params Params.\n * @return {string|undefined} Request URL.\n * @private\n */\n TileWMS.prototype.getRequestUrl_ = function (tileCoord, tileSize, tileExtent, pixelRatio, projection, params) {\n var urls = this.urls;\n if (!urls) {\n return undefined;\n }\n params['WIDTH'] = tileSize[0];\n params['HEIGHT'] = tileSize[1];\n params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();\n if (!('STYLES' in this.params_)) {\n params['STYLES'] = '';\n }\n if (pixelRatio != 1) {\n switch (this.serverType_) {\n case WMSServerType.GEOSERVER:\n var dpi = (90 * pixelRatio + 0.5) | 0;\n if ('FORMAT_OPTIONS' in params) {\n params['FORMAT_OPTIONS'] += ';dpi:' + dpi;\n }\n else {\n params['FORMAT_OPTIONS'] = 'dpi:' + dpi;\n }\n break;\n case WMSServerType.MAPSERVER:\n params['MAP_RESOLUTION'] = 90 * pixelRatio;\n break;\n case WMSServerType.CARMENTA_SERVER:\n case WMSServerType.QGIS:\n params['DPI'] = 90 * pixelRatio;\n break;\n default:\n assert(false, 52); // Unknown `serverType` configured\n break;\n }\n }\n var axisOrientation = projection.getAxisOrientation();\n var bbox = tileExtent;\n if (this.v13_ && axisOrientation.substr(0, 2) == 'ne') {\n var tmp = void 0;\n tmp = tileExtent[0];\n bbox[0] = tileExtent[1];\n bbox[1] = tmp;\n tmp = tileExtent[2];\n bbox[2] = tileExtent[3];\n bbox[3] = tmp;\n }\n params['BBOX'] = bbox.join(',');\n var url;\n if (urls.length == 1) {\n url = urls[0];\n }\n else {\n var index = modulo(tileCoordHash(tileCoord), urls.length);\n url = urls[index];\n }\n return appendParams(url, params);\n };\n /**\n * @inheritDoc\n */\n TileWMS.prototype.getTilePixelRatio = function (pixelRatio) {\n return (!this.hidpi_ || this.serverType_ === undefined) ? 1 :\n /** @type {number} */ (pixelRatio);\n };\n /**\n * @private\n * @return {string} The key for the current params.\n */\n TileWMS.prototype.getKeyForParams_ = function () {\n var i = 0;\n var res = [];\n for (var key in this.params_) {\n res[i++] = key + '-' + this.params_[key];\n }\n return res.join('/');\n };\n /**\n * Update the user-provided params.\n * @param {Object} params Params.\n * @api\n */\n TileWMS.prototype.updateParams = function (params) {\n assign(this.params_, params);\n this.updateV13_();\n this.setKey(this.getKeyForParams_());\n };\n /**\n * @private\n */\n TileWMS.prototype.updateV13_ = function () {\n var version = this.params_['VERSION'] || DEFAULT_WMS_VERSION;\n this.v13_ = compareVersions(version, '1.3') >= 0;\n };\n return TileWMS;\n}(TileImage));\n/**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord The tile coordinate\n * @param {number} pixelRatio The pixel ratio\n * @param {import(\"../proj/Projection.js\").default} projection The projection\n * @return {string|undefined} The tile URL\n * @this {TileWMS}\n */\nfunction tileUrlFunction(tileCoord, pixelRatio, projection) {\n var tileGrid = this.getTileGrid();\n if (!tileGrid) {\n tileGrid = this.getTileGridForProjection(projection);\n }\n if (tileGrid.getResolutions().length <= tileCoord[0]) {\n return undefined;\n }\n if (pixelRatio != 1 && (!this.hidpi_ || this.serverType_ === undefined)) {\n pixelRatio = 1;\n }\n var tileResolution = tileGrid.getResolution(tileCoord[0]);\n var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);\n var tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);\n var gutter = this.gutter_;\n if (gutter !== 0) {\n tileSize = bufferSize(tileSize, gutter, this.tmpSize);\n tileExtent = buffer(tileExtent, tileResolution * gutter, tileExtent);\n }\n if (pixelRatio != 1) {\n tileSize = scaleSize(tileSize, pixelRatio, this.tmpSize);\n }\n var baseParams = {\n 'SERVICE': 'WMS',\n 'VERSION': DEFAULT_WMS_VERSION,\n 'REQUEST': 'GetMap',\n 'FORMAT': 'image/png',\n 'TRANSPARENT': true\n };\n assign(baseParams, this.params_);\n return this.getRequestUrl_(tileCoord, tileSize, tileExtent, pixelRatio, projection, baseParams);\n}\nexport default TileWMS;\n//# sourceMappingURL=TileWMS.js.map","/**\n * @module ol/source/UTFGrid\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport Tile from '../Tile.js';\nimport TileState from '../TileState.js';\nimport { createFromTemplates, nullTileUrlFunction } from '../tileurlfunction.js';\nimport { assert } from '../asserts.js';\nimport { listenOnce } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { applyTransform, intersects } from '../extent.js';\nimport { jsonp as requestJSONP } from '../net.js';\nimport { get as getProjection, getTransformFromProjections } from '../proj.js';\nimport SourceState from './State.js';\nimport TileSource from './Tile.js';\nimport { getKeyZXY } from '../tilecoord.js';\nimport { createXYZ, extentFromProjection } from '../tilegrid.js';\n/**\n * @typedef {Object} UTFGridJSON\n * @property {Array<string>} grid The grid.\n * @property {Array<string>} keys The keys.\n * @property {Object<string, Object>} [data] Optional data.\n */\nvar CustomTile = /** @class */ (function (_super) {\n __extends(CustomTile, _super);\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {TileState} state State.\n * @param {string} src Image source URI.\n * @param {import(\"../extent.js\").Extent} extent Extent of the tile.\n * @param {boolean} preemptive Load the tile when visible (before it's needed).\n * @param {boolean} jsonp Load the tile as a script.\n */\n function CustomTile(tileCoord, state, src, extent, preemptive, jsonp) {\n var _this = _super.call(this, tileCoord, state) || this;\n /**\n * @private\n * @type {string}\n */\n _this.src_ = src;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.extent_ = extent;\n /**\n * @private\n * @type {boolean}\n */\n _this.preemptive_ = preemptive;\n /**\n * @private\n * @type {Array<string>}\n */\n _this.grid_ = null;\n /**\n * @private\n * @type {Array<string>}\n */\n _this.keys_ = null;\n /**\n * @private\n * @type {Object<string, Object>|undefined}\n */\n _this.data_ = null;\n /**\n * @private\n * @type {boolean}\n */\n _this.jsonp_ = jsonp;\n return _this;\n }\n /**\n * Get the image element for this tile.\n * @return {HTMLImageElement} Image.\n */\n CustomTile.prototype.getImage = function () {\n return null;\n };\n /**\n * Synchronously returns data at given coordinate (if available).\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {*} The data.\n */\n CustomTile.prototype.getData = function (coordinate) {\n if (!this.grid_ || !this.keys_) {\n return null;\n }\n var xRelative = (coordinate[0] - this.extent_[0]) /\n (this.extent_[2] - this.extent_[0]);\n var yRelative = (coordinate[1] - this.extent_[1]) /\n (this.extent_[3] - this.extent_[1]);\n var row = this.grid_[Math.floor((1 - yRelative) * this.grid_.length)];\n if (typeof row !== 'string') {\n return null;\n }\n var code = row.charCodeAt(Math.floor(xRelative * row.length));\n if (code >= 93) {\n code--;\n }\n if (code >= 35) {\n code--;\n }\n code -= 32;\n var data = null;\n if (code in this.keys_) {\n var id = this.keys_[code];\n if (this.data_ && id in this.data_) {\n data = this.data_[id];\n }\n else {\n data = id;\n }\n }\n return data;\n };\n /**\n * Calls the callback (synchronously by default) with the available data\n * for given coordinate (or `null` if not yet loaded).\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(*): void} callback Callback.\n * @param {boolean=} opt_request If `true` the callback is always async.\n * The tile data is requested if not yet loaded.\n */\n CustomTile.prototype.forDataAtCoordinate = function (coordinate, callback, opt_request) {\n if (this.state == TileState.IDLE && opt_request === true) {\n listenOnce(this, EventType.CHANGE, function (e) {\n callback(this.getData(coordinate));\n }, this);\n this.loadInternal_();\n }\n else {\n if (opt_request === true) {\n setTimeout(function () {\n callback(this.getData(coordinate));\n }.bind(this), 0);\n }\n else {\n callback(this.getData(coordinate));\n }\n }\n };\n /**\n * @inheritDoc\n */\n CustomTile.prototype.getKey = function () {\n return this.src_;\n };\n /**\n * @private\n */\n CustomTile.prototype.handleError_ = function () {\n this.state = TileState.ERROR;\n this.changed();\n };\n /**\n * @param {!UTFGridJSON} json UTFGrid data.\n * @private\n */\n CustomTile.prototype.handleLoad_ = function (json) {\n this.grid_ = json['grid'];\n this.keys_ = json['keys'];\n this.data_ = json['data'];\n this.state = TileState.EMPTY;\n this.changed();\n };\n /**\n * @private\n */\n CustomTile.prototype.loadInternal_ = function () {\n if (this.state == TileState.IDLE) {\n this.state = TileState.LOADING;\n if (this.jsonp_) {\n requestJSONP(this.src_, this.handleLoad_.bind(this), this.handleError_.bind(this));\n }\n else {\n var client = new XMLHttpRequest();\n client.addEventListener('load', this.onXHRLoad_.bind(this));\n client.addEventListener('error', this.onXHRError_.bind(this));\n client.open('GET', this.src_);\n client.send();\n }\n }\n };\n /**\n * @private\n * @param {Event} event The load event.\n */\n CustomTile.prototype.onXHRLoad_ = function (event) {\n var client = /** @type {XMLHttpRequest} */ (event.target);\n // status will be 0 for file:// urls\n if (!client.status || client.status >= 200 && client.status < 300) {\n var response = void 0;\n try {\n response = /** @type {!UTFGridJSON} */ (JSON.parse(client.responseText));\n }\n catch (err) {\n this.handleError_();\n return;\n }\n this.handleLoad_(response);\n }\n else {\n this.handleError_();\n }\n };\n /**\n * @private\n * @param {Event} event The error event.\n */\n CustomTile.prototype.onXHRError_ = function (event) {\n this.handleError_();\n };\n /**\n * @override\n */\n CustomTile.prototype.load = function () {\n if (this.preemptive_) {\n this.loadInternal_();\n }\n };\n return CustomTile;\n}(Tile));\nexport { CustomTile };\n/**\n * @typedef {Object} Options\n * @property {boolean} [preemptive=true]\n * If `true` the UTFGrid source loads the tiles based on their \"visibility\".\n * This improves the speed of response, but increases traffic.\n * Note that if set to `false`, you need to pass `true` as `opt_request`\n * to the `forDataAtCoordinateAndResolution` method otherwise no data\n * will ever be loaded.\n * @property {boolean} [jsonp=false] Use JSONP with callback to load the TileJSON.\n * Useful when the server does not support CORS..\n * @property {import(\"./TileJSON.js\").Config} [tileJSON] TileJSON configuration for this source.\n * If not provided, `url` must be configured.\n * @property {string} [url] TileJSON endpoint that provides the configuration for this source.\n * Request will be made through JSONP. If not provided, `tileJSON` must be configured.\n */\n/**\n * @classdesc\n * Layer source for UTFGrid interaction data loaded from TileJSON format.\n * @api\n */\nvar UTFGrid = /** @class */ (function (_super) {\n __extends(UTFGrid, _super);\n /**\n * @param {Options} options Source options.\n */\n function UTFGrid(options) {\n var _this = _super.call(this, {\n projection: getProjection('EPSG:3857'),\n state: SourceState.LOADING\n }) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.preemptive_ = options.preemptive !== undefined ?\n options.preemptive : true;\n /**\n * @private\n * @type {!import(\"../Tile.js\").UrlFunction}\n */\n _this.tileUrlFunction_ = nullTileUrlFunction;\n /**\n * @private\n * @type {string|undefined}\n */\n _this.template_ = undefined;\n /**\n * @private\n * @type {boolean}\n */\n _this.jsonp_ = options.jsonp || false;\n if (options.url) {\n if (_this.jsonp_) {\n requestJSONP(options.url, _this.handleTileJSONResponse.bind(_this), _this.handleTileJSONError.bind(_this));\n }\n else {\n var client = new XMLHttpRequest();\n client.addEventListener('load', _this.onXHRLoad_.bind(_this));\n client.addEventListener('error', _this.onXHRError_.bind(_this));\n client.open('GET', options.url);\n client.send();\n }\n }\n else if (options.tileJSON) {\n _this.handleTileJSONResponse(options.tileJSON);\n }\n else {\n assert(false, 51); // Either `url` or `tileJSON` options must be provided\n }\n return _this;\n }\n /**\n * @private\n * @param {Event} event The load event.\n */\n UTFGrid.prototype.onXHRLoad_ = function (event) {\n var client = /** @type {XMLHttpRequest} */ (event.target);\n // status will be 0 for file:// urls\n if (!client.status || client.status >= 200 && client.status < 300) {\n var response = void 0;\n try {\n response = /** @type {import(\"./TileJSON.js\").Config} */ (JSON.parse(client.responseText));\n }\n catch (err) {\n this.handleTileJSONError();\n return;\n }\n this.handleTileJSONResponse(response);\n }\n else {\n this.handleTileJSONError();\n }\n };\n /**\n * @private\n * @param {Event} event The error event.\n */\n UTFGrid.prototype.onXHRError_ = function (event) {\n this.handleTileJSONError();\n };\n /**\n * Return the template from TileJSON.\n * @return {string|undefined} The template from TileJSON.\n * @api\n */\n UTFGrid.prototype.getTemplate = function () {\n return this.template_;\n };\n /**\n * Calls the callback (synchronously by default) with the available data\n * for given coordinate and resolution (or `null` if not yet loaded or\n * in case of an error).\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {function(*): void} callback Callback.\n * @param {boolean=} opt_request If `true` the callback is always async.\n * The tile data is requested if not yet loaded.\n * @api\n */\n UTFGrid.prototype.forDataAtCoordinateAndResolution = function (coordinate, resolution, callback, opt_request) {\n if (this.tileGrid) {\n var z = this.tileGrid.getZForResolution(resolution, this.zDirection);\n var tileCoord = this.tileGrid.getTileCoordForCoordAndZ(coordinate, z);\n var tile = /** @type {!CustomTile} */ (this.getTile(tileCoord[0], tileCoord[1], tileCoord[2], 1, this.getProjection()));\n tile.forDataAtCoordinate(coordinate, callback, opt_request);\n }\n else {\n if (opt_request === true) {\n setTimeout(function () {\n callback(null);\n }, 0);\n }\n else {\n callback(null);\n }\n }\n };\n /**\n * @protected\n */\n UTFGrid.prototype.handleTileJSONError = function () {\n this.setState(SourceState.ERROR);\n };\n /**\n * TODO: very similar to ol/source/TileJSON#handleTileJSONResponse\n * @protected\n * @param {import(\"./TileJSON.js\").Config} tileJSON Tile JSON.\n */\n UTFGrid.prototype.handleTileJSONResponse = function (tileJSON) {\n var epsg4326Projection = getProjection('EPSG:4326');\n var sourceProjection = this.getProjection();\n var extent;\n if (tileJSON['bounds'] !== undefined) {\n var transform = getTransformFromProjections(epsg4326Projection, sourceProjection);\n extent = applyTransform(tileJSON['bounds'], transform);\n }\n var minZoom = tileJSON['minzoom'] || 0;\n var maxZoom = tileJSON['maxzoom'] || 22;\n var tileGrid = createXYZ({\n extent: extentFromProjection(sourceProjection),\n maxZoom: maxZoom,\n minZoom: minZoom\n });\n this.tileGrid = tileGrid;\n this.template_ = tileJSON['template'];\n var grids = tileJSON['grids'];\n if (!grids) {\n this.setState(SourceState.ERROR);\n return;\n }\n this.tileUrlFunction_ = createFromTemplates(grids, tileGrid);\n if (tileJSON['attribution'] !== undefined) {\n var attributionExtent_1 = extent !== undefined ?\n extent : epsg4326Projection.getExtent();\n this.setAttributions(function (frameState) {\n if (intersects(attributionExtent_1, frameState.extent)) {\n return [tileJSON['attribution']];\n }\n return null;\n });\n }\n this.setState(SourceState.READY);\n };\n /**\n * @inheritDoc\n */\n UTFGrid.prototype.getTile = function (z, x, y, pixelRatio, projection) {\n var tileCoordKey = getKeyZXY(z, x, y);\n if (this.tileCache.containsKey(tileCoordKey)) {\n return (\n /** @type {!import(\"../Tile.js\").default} */ (this.tileCache.get(tileCoordKey)));\n }\n else {\n var tileCoord = [z, x, y];\n var urlTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);\n var tileUrl = this.tileUrlFunction_(urlTileCoord, pixelRatio, projection);\n var tile = new CustomTile(tileCoord, tileUrl !== undefined ? TileState.IDLE : TileState.EMPTY, tileUrl !== undefined ? tileUrl : '', this.tileGrid.getTileCoordExtent(tileCoord), this.preemptive_, this.jsonp_);\n this.tileCache.set(tileCoordKey, tile);\n return tile;\n }\n };\n /**\n * @inheritDoc\n */\n UTFGrid.prototype.useTile = function (z, x, y) {\n var tileCoordKey = getKeyZXY(z, x, y);\n if (this.tileCache.containsKey(tileCoordKey)) {\n this.tileCache.get(tileCoordKey);\n }\n };\n return UTFGrid;\n}(TileSource));\nexport default UTFGrid;\n//# sourceMappingURL=UTFGrid.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/VectorRenderTile\n */\nimport { getUid } from './util.js';\nimport Tile from './Tile.js';\nimport { createCanvasContext2D } from './dom.js';\nimport { unlistenByKey } from './events.js';\n/**\n * @typedef {Object} ReplayState\n * @property {boolean} dirty\n * @property {null|import(\"./render.js\").OrderFunction} renderedRenderOrder\n * @property {number} renderedTileRevision\n * @property {number} renderedResolution\n * @property {number} renderedRevision\n * @property {number} renderedZ\n * @property {number} renderedTileResolution\n * @property {number} renderedTileZ\n */\nvar VectorRenderTile = /** @class */ (function (_super) {\n __extends(VectorRenderTile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./TileState.js\").default} state State.\n * @param {import(\"./tilecoord.js\").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.\n * @param {import(\"./tilegrid/TileGrid.js\").default} sourceTileGrid Tile grid of the source.\n * @param {function(VectorRenderTile):Array<import(\"./VectorTile\").default>} getSourceTiles Function\n * to get an source tiles for this tile.\n * @param {function(VectorRenderTile):void} removeSourceTiles Function to remove this tile from its\n * source tiles's consumer count.\n */\n function VectorRenderTile(tileCoord, state, urlTileCoord, sourceTileGrid, getSourceTiles, removeSourceTiles) {\n var _this = _super.call(this, tileCoord, state, { transition: 0 }) || this;\n /**\n * @private\n * @type {!Object<string, CanvasRenderingContext2D>}\n */\n _this.context_ = {};\n /**\n * Executor groups by layer uid. Entries are read/written by the renderer.\n * @type {Object<string, Array<import(\"./render/canvas/ExecutorGroup.js\").default>>}\n */\n _this.executorGroups = {};\n /**\n * Number of loading source tiles. Read/written by the source.\n * @type {number}\n */\n _this.loadingSourceTiles = 0;\n /**\n * Tile keys of error source tiles. Read/written by the source.\n * @type {Object<string, boolean>}\n */\n _this.errorSourceTileKeys = {};\n /**\n * @type {ImageData}\n */\n _this.hitDetectionImageData = null;\n /**\n * @private\n * @type {!Object<string, ReplayState>}\n */\n _this.replayState_ = {};\n /**\n * @type {number}\n */\n _this.wantedResolution;\n /**\n * @type {!function():Array<import(\"./VectorTile.js\").default>}\n */\n _this.getSourceTiles = getSourceTiles.bind(_this, _this);\n /**\n * @type {!function(import(\"./VectorRenderTile.js\").default):void}\n */\n _this.removeSourceTiles_ = removeSourceTiles;\n /**\n * @private\n * @type {import(\"./tilegrid/TileGrid.js\").default}\n */\n _this.sourceTileGrid_ = sourceTileGrid;\n /**\n * @type {Array<import(\"./events.js\").EventsKey>}\n */\n _this.sourceTileListenerKeys = [];\n /**\n * z of the source tiles of the last getSourceTiles call.\n * @type {number}\n */\n _this.sourceZ = -1;\n /**\n * True when all tiles for this tile's nominal resolution are available.\n * @type {boolean}\n */\n _this.hifi = false;\n /**\n * @type {import(\"./tilecoord.js\").TileCoord}\n */\n _this.wrappedTileCoord = urlTileCoord;\n return _this;\n }\n /**\n * @inheritDoc\n */\n VectorRenderTile.prototype.disposeInternal = function () {\n this.sourceTileListenerKeys.forEach(unlistenByKey);\n this.sourceTileListenerKeys.length = 0;\n this.removeSourceTiles_(this);\n for (var key in this.context_) {\n var canvas = this.context_[key].canvas;\n canvas.width = 0;\n canvas.height = 0;\n }\n for (var key in this.executorGroups) {\n var executorGroups = this.executorGroups[key];\n for (var i = 0, ii = executorGroups.length; i < ii; ++i) {\n executorGroups[i].disposeInternal();\n }\n }\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {CanvasRenderingContext2D} The rendering context.\n */\n VectorRenderTile.prototype.getContext = function (layer) {\n var key = getUid(layer);\n if (!(key in this.context_)) {\n this.context_[key] = createCanvasContext2D();\n }\n return this.context_[key];\n };\n /**\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {boolean} Tile has a rendering context for the given layer.\n */\n VectorRenderTile.prototype.hasContext = function (layer) {\n return getUid(layer) in this.context_;\n };\n /**\n * Get the Canvas for this tile.\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {HTMLCanvasElement} Canvas.\n */\n VectorRenderTile.prototype.getImage = function (layer) {\n return this.hasContext(layer) ? this.getContext(layer).canvas : null;\n };\n /**\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {ReplayState} The replay state.\n */\n VectorRenderTile.prototype.getReplayState = function (layer) {\n var key = getUid(layer);\n if (!(key in this.replayState_)) {\n this.replayState_[key] = {\n dirty: false,\n renderedRenderOrder: null,\n renderedResolution: NaN,\n renderedRevision: -1,\n renderedTileResolution: NaN,\n renderedTileRevision: -1,\n renderedZ: -1,\n renderedTileZ: -1\n };\n }\n return this.replayState_[key];\n };\n /**\n * @inheritDoc\n */\n VectorRenderTile.prototype.load = function () {\n this.getSourceTiles();\n };\n return VectorRenderTile;\n}(Tile));\nexport default VectorRenderTile;\n//# sourceMappingURL=VectorRenderTile.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/VectorTile\n */\nimport Tile from './Tile.js';\nimport TileState from './TileState.js';\nvar VectorTile = /** @class */ (function (_super) {\n __extends(VectorTile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {TileState} state State.\n * @param {string} src Data source url.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @param {import(\"./Tile.js\").LoadFunction} tileLoadFunction Tile load function.\n * @param {import(\"./Tile.js\").Options=} opt_options Tile options.\n */\n function VectorTile(tileCoord, state, src, format, tileLoadFunction, opt_options) {\n var _this = _super.call(this, tileCoord, state, opt_options) || this;\n /**\n * @type {number}\n */\n _this.consumers = 0;\n /**\n * Extent of this tile; set by the source.\n * @type {import(\"./extent.js\").Extent}\n */\n _this.extent = null;\n /**\n * @private\n * @type {import(\"./format/Feature.js\").default}\n */\n _this.format_ = format;\n /**\n * @private\n * @type {Array<import(\"./Feature.js\").default>}\n */\n _this.features_ = null;\n /**\n * @private\n * @type {import(\"./featureloader.js\").FeatureLoader}\n */\n _this.loader_;\n /**\n * Feature projection of this tile; set by the source.\n * @type {import(\"./proj/Projection.js\").default}\n */\n _this.projection = null;\n /**\n * Resolution of this tile; set by the source.\n * @type {number}\n */\n _this.resolution;\n /**\n * @private\n * @type {import(\"./Tile.js\").LoadFunction}\n */\n _this.tileLoadFunction_ = tileLoadFunction;\n /**\n * @private\n * @type {string}\n */\n _this.url_ = src;\n return _this;\n }\n /**\n * Get the feature format assigned for reading this tile's features.\n * @return {import(\"./format/Feature.js\").default} Feature format.\n * @api\n */\n VectorTile.prototype.getFormat = function () {\n return this.format_;\n };\n /**\n * Get the features for this tile. Geometries will be in the view projection.\n * @return {Array<import(\"./Feature.js\").FeatureLike>} Features.\n * @api\n */\n VectorTile.prototype.getFeatures = function () {\n return this.features_;\n };\n /**\n * @inheritDoc\n */\n VectorTile.prototype.getKey = function () {\n return this.url_;\n };\n /**\n * @inheritDoc\n */\n VectorTile.prototype.load = function () {\n if (this.state == TileState.IDLE) {\n this.setState(TileState.LOADING);\n this.tileLoadFunction_(this, this.url_);\n this.loader_(this.extent, this.resolution, this.projection);\n }\n };\n /**\n * Handler for successful tile load.\n * @param {Array<import(\"./Feature.js\").default>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data projection.\n */\n VectorTile.prototype.onLoad = function (features, dataProjection) {\n this.setFeatures(features);\n };\n /**\n * Handler for tile load errors.\n */\n VectorTile.prototype.onError = function () {\n this.setState(TileState.ERROR);\n };\n /**\n * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.\n * Sets the features for the tile.\n * @param {Array<import(\"./Feature.js\").default>} features Features.\n * @api\n */\n VectorTile.prototype.setFeatures = function (features) {\n this.features_ = features;\n this.setState(TileState.LOADED);\n };\n /**\n * Set the feature loader for reading this tile's features.\n * @param {import(\"./featureloader.js\").FeatureLoader} loader Feature loader.\n * @api\n */\n VectorTile.prototype.setLoader = function (loader) {\n this.loader_ = loader;\n };\n return VectorTile;\n}(Tile));\nexport default VectorTile;\n//# sourceMappingURL=VectorTile.js.map","/**\n * @module ol/source/VectorTile\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport TileState from '../TileState.js';\nimport VectorRenderTile from '../VectorRenderTile.js';\nimport Tile from '../VectorTile.js';\nimport { toSize } from '../size.js';\nimport UrlTile from './UrlTile.js';\nimport { getKeyZXY, getKey } from '../tilecoord.js';\nimport { createXYZ, extentFromProjection, createForProjection } from '../tilegrid.js';\nimport { buffer as bufferExtent, getIntersection, intersects } from '../extent.js';\nimport EventType from '../events/EventType.js';\nimport { loadFeaturesXhr } from '../featureloader.js';\nimport { equals, remove } from '../array.js';\nimport { listen, unlistenByKey } from '../events.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {number} [cacheSize=128] Cache size.\n * @property {import(\"../extent.js\").Extent} [extent]\n * @property {import(\"../format/Feature.js\").default} [format] Feature format for tiles. Used and required by the default.\n * @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this\n * to `false` (e.g. for sources with polygons that represent administrative\n * boundaries or TopoJSON sources) allows the renderer to optimise fill and\n * stroke operations.\n * @property {import(\"../proj.js\").ProjectionLike} [projection='EPSG:3857'] Projection of the tile grid.\n * @property {import(\"./State.js\").default} [state] Source state.\n * @property {typeof import(\"../VectorTile.js\").default} [tileClass] Class used to instantiate image tiles.\n * Default is {@link module:ol/VectorTile}.\n * @property {number} [maxZoom=22] Optional max zoom level.\n * @property {number} [minZoom] Optional min zoom level.\n * @property {number|import(\"../size.js\").Size} [tileSize=512] Optional tile size.\n * @property {import(\"../tilegrid/TileGrid.js\").default} [tileGrid] Tile grid.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction]\n * Optional function to load a tile given a URL. Could look like this for pbf tiles:\n * ```js\n * function(tile, url) {\n * tile.setLoader(function(extent, resolution, projection) {\n * fetch(url).then(function(response) {\n * response.arrayBuffer().then(function(data) {\n * const format = tile.getFormat() // ol/format/MVT configured as source format\n * const features = format.readFeatures(data, {\n * extent: extent,\n * featureProjection: projection\n * });\n * tile.setFeatures(features);\n * });\n * });\n * });\n * }\n * ```\n * @property {import(\"../Tile.js\").UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.\n * @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.\n * A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be\n * used instead of defining each one separately in the `urls` option.\n * @property {number} [transition] A duration for tile opacity\n * transitions in milliseconds. A duration of 0 disables the opacity transition.\n * @property {Array<string>} [urls] An array of URL templates.\n * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.\n * When set to `false`, only one world\n * will be rendered. When set to `true`, tiles will be wrapped horizontally to\n * render multiple worlds.\n * @property {number} [zDirection=1] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n */\n/**\n * @classdesc\n * Class for layer sources providing vector data divided into a tile grid, to be\n * used with {@link module:ol/layer/VectorTile~VectorTile}. Although this source receives tiles\n * with vector features from the server, it is not meant for feature editing.\n * Features are optimized for rendering, their geometries are clipped at or near\n * tile boundaries and simplified for a view resolution. See\n * {@link module:ol/source/Vector} for vector sources that are suitable for feature\n * editing.\n *\n * @fires import(\"./Tile.js\").TileSourceEvent\n * @api\n */\nvar VectorTile = /** @class */ (function (_super) {\n __extends(VectorTile, _super);\n /**\n * @param {!Options} options Vector tile options.\n */\n function VectorTile(options) {\n var _this = this;\n var projection = options.projection || 'EPSG:3857';\n var extent = options.extent || extentFromProjection(projection);\n var tileGrid = options.tileGrid || createXYZ({\n extent: extent,\n maxZoom: options.maxZoom !== undefined ? options.maxZoom : 22,\n minZoom: options.minZoom,\n tileSize: options.tileSize || 512\n });\n _this = _super.call(this, {\n attributions: options.attributions,\n attributionsCollapsible: options.attributionsCollapsible,\n cacheSize: options.cacheSize,\n opaque: false,\n projection: projection,\n state: options.state,\n tileGrid: tileGrid,\n tileLoadFunction: options.tileLoadFunction ? options.tileLoadFunction : defaultLoadFunction,\n tileUrlFunction: options.tileUrlFunction,\n url: options.url,\n urls: options.urls,\n wrapX: options.wrapX === undefined ? true : options.wrapX,\n transition: options.transition,\n zDirection: options.zDirection === undefined ? 1 : options.zDirection\n }) || this;\n /**\n * @private\n * @type {import(\"../format/Feature.js\").default}\n */\n _this.format_ = options.format ? options.format : null;\n /**\n * @type {Object<string, import(\"./VectorTile\").default>}\n */\n _this.loadingTiles_ = {};\n /**\n * @private\n * @type {Object<string, import(\"../VectorTile.js\").default>}\n */\n _this.sourceTileByCoordKey_ = {};\n /**\n * @private\n * @type {Object<string, Array<import(\"../VectorTile.js\").default>>}\n */\n _this.sourceTilesByTileKey_ = {};\n /**\n * @private\n * @type {boolean}\n */\n _this.overlaps_ = options.overlaps == undefined ? true : options.overlaps;\n /**\n * @protected\n * @type {typeof import(\"../VectorTile.js\").default}\n */\n _this.tileClass = options.tileClass ? options.tileClass : Tile;\n /**\n * @private\n * @type {Object<string, import(\"../tilegrid/TileGrid.js\").default>}\n */\n _this.tileGrids_ = {};\n return _this;\n }\n /**\n * @return {boolean} The source can have overlapping geometries.\n */\n VectorTile.prototype.getOverlaps = function () {\n return this.overlaps_;\n };\n /**\n * clear {@link module:ol/TileCache~TileCache} and delete all source tiles\n * @api\n */\n VectorTile.prototype.clear = function () {\n this.tileCache.clear();\n this.sourceTileByCoordKey_ = {};\n this.sourceTilesByTileKey_ = {};\n };\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection\").default} projection Projection.\n * @param {VectorRenderTile} tile Vector image tile.\n * @return {Array<import(\"../VectorTile\").default>} Tile keys.\n */\n VectorTile.prototype.getSourceTiles = function (pixelRatio, projection, tile) {\n var urlTileCoord = tile.wrappedTileCoord;\n var tileGrid = this.getTileGridForProjection(projection);\n var extent = tileGrid.getTileCoordExtent(urlTileCoord);\n var z = urlTileCoord[0];\n var resolution = tileGrid.getResolution(z);\n // make extent 1 pixel smaller so we don't load tiles for < 0.5 pixel render space\n bufferExtent(extent, -resolution, extent);\n var sourceTileGrid = this.tileGrid;\n var sourceExtent = sourceTileGrid.getExtent();\n if (sourceExtent) {\n getIntersection(extent, sourceExtent, extent);\n }\n var sourceZ = sourceTileGrid.getZForResolution(resolution, 1);\n var minZoom = sourceTileGrid.getMinZoom();\n var previousSourceTiles = this.sourceTilesByTileKey_[tile.getKey()];\n var sourceTiles, covered, loadedZ;\n if (previousSourceTiles && previousSourceTiles.length > 0 && previousSourceTiles[0].tileCoord[0] === sourceZ) {\n sourceTiles = previousSourceTiles;\n covered = true;\n loadedZ = sourceZ;\n }\n else {\n sourceTiles = [];\n loadedZ = sourceZ + 1;\n do {\n --loadedZ;\n covered = true;\n sourceTileGrid.forEachTileCoord(extent, loadedZ, function (sourceTileCoord) {\n var coordKey = getKey(sourceTileCoord);\n var sourceTile;\n if (coordKey in this.sourceTileByCoordKey_) {\n sourceTile = this.sourceTileByCoordKey_[coordKey];\n var state = sourceTile.getState();\n if (state === TileState.LOADED || state === TileState.ERROR || state === TileState.EMPTY) {\n sourceTiles.push(sourceTile);\n return;\n }\n }\n else if (loadedZ === sourceZ) {\n var tileUrl = this.tileUrlFunction(sourceTileCoord, pixelRatio, projection);\n if (tileUrl !== undefined) {\n sourceTile = new this.tileClass(sourceTileCoord, TileState.IDLE, tileUrl, this.format_, this.tileLoadFunction);\n sourceTile.extent = sourceTileGrid.getTileCoordExtent(sourceTileCoord);\n sourceTile.projection = projection;\n sourceTile.resolution = sourceTileGrid.getResolution(sourceTileCoord[0]);\n this.sourceTileByCoordKey_[coordKey] = sourceTile;\n sourceTile.addEventListener(EventType.CHANGE, this.handleTileChange.bind(this));\n sourceTile.load();\n }\n }\n covered = false;\n if (!sourceTile) {\n return;\n }\n if (sourceTile.getState() !== TileState.EMPTY && tile.getState() === TileState.IDLE) {\n tile.loadingSourceTiles++;\n var key_1 = listen(sourceTile, EventType.CHANGE, function () {\n var state = sourceTile.getState();\n var sourceTileKey = sourceTile.getKey();\n if (state === TileState.LOADED || state === TileState.ERROR) {\n if (state === TileState.LOADED) {\n remove(tile.sourceTileListenerKeys, key_1);\n unlistenByKey(key_1);\n tile.loadingSourceTiles--;\n delete tile.errorSourceTileKeys[sourceTileKey];\n }\n else if (state === TileState.ERROR) {\n tile.errorSourceTileKeys[sourceTileKey] = true;\n }\n var errorTileCount = Object.keys(tile.errorSourceTileKeys).length;\n if (tile.loadingSourceTiles - errorTileCount === 0) {\n tile.hifi = errorTileCount === 0;\n tile.sourceZ = sourceZ;\n tile.setState(TileState.LOADED);\n }\n }\n });\n tile.sourceTileListenerKeys.push(key_1);\n }\n }.bind(this));\n if (!covered) {\n sourceTiles.length = 0;\n }\n } while (!covered && loadedZ > minZoom);\n }\n if (tile.getState() === TileState.IDLE) {\n tile.setState(TileState.LOADING);\n }\n if (covered) {\n tile.hifi = sourceZ === loadedZ;\n tile.sourceZ = loadedZ;\n if (tile.getState() < TileState.LOADED) {\n tile.setState(TileState.LOADED);\n }\n else if (!previousSourceTiles || !equals(sourceTiles, previousSourceTiles)) {\n this.removeSourceTiles(tile);\n this.addSourceTiles(tile, sourceTiles);\n }\n }\n return sourceTiles;\n };\n /**\n * @param {VectorRenderTile} tile Tile.\n * @param {Array<import(\"../VectorTile\").default>} sourceTiles Source tiles.\n */\n VectorTile.prototype.addSourceTiles = function (tile, sourceTiles) {\n this.sourceTilesByTileKey_[tile.getKey()] = sourceTiles;\n for (var i = 0, ii = sourceTiles.length; i < ii; ++i) {\n sourceTiles[i].consumers++;\n }\n };\n /**\n * @param {VectorRenderTile} tile Tile.\n */\n VectorTile.prototype.removeSourceTiles = function (tile) {\n var tileKey = tile.getKey();\n if (tileKey in this.sourceTilesByTileKey_) {\n var sourceTiles = this.sourceTilesByTileKey_[tileKey];\n for (var i = 0, ii = sourceTiles.length; i < ii; ++i) {\n var sourceTile = sourceTiles[i];\n sourceTile.consumers--;\n if (sourceTile.consumers === 0) {\n sourceTile.dispose();\n delete this.sourceTileByCoordKey_[getKey(sourceTile.tileCoord)];\n }\n }\n }\n delete this.sourceTilesByTileKey_[tileKey];\n };\n /**\n * @inheritDoc\n */\n VectorTile.prototype.getTile = function (z, x, y, pixelRatio, projection) {\n var coordKey = getKeyZXY(z, x, y);\n var key = this.getKey();\n var tile;\n if (this.tileCache.containsKey(coordKey)) {\n tile = /** @type {!import(\"../Tile.js\").default} */ (this.tileCache.get(coordKey));\n if (tile.key === key) {\n return tile;\n }\n }\n var tileCoord = [z, x, y];\n var urlTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);\n var sourceExtent = this.getTileGrid().getExtent();\n var tileGrid = this.getTileGridForProjection(projection);\n if (urlTileCoord && sourceExtent) {\n var tileExtent = tileGrid.getTileCoordExtent(urlTileCoord);\n // make extent 1 pixel smaller so we don't load tiles for < 0.5 pixel render space\n bufferExtent(tileExtent, -tileGrid.getResolution(z), tileExtent);\n if (!intersects(sourceExtent, tileExtent)) {\n urlTileCoord = null;\n }\n }\n var empty = true;\n if (urlTileCoord !== null) {\n var sourceTileGrid = this.tileGrid;\n var resolution = tileGrid.getResolution(z);\n var sourceZ = sourceTileGrid.getZForResolution(resolution, 1);\n // make extent 1 pixel smaller so we don't load tiles for < 0.5 pixel render space\n var extent = tileGrid.getTileCoordExtent(urlTileCoord);\n bufferExtent(extent, -resolution, extent);\n sourceTileGrid.forEachTileCoord(extent, sourceZ, function (sourceTileCoord) {\n empty = empty && !this.tileUrlFunction(sourceTileCoord, pixelRatio, projection);\n }.bind(this));\n }\n var newTile = new VectorRenderTile(tileCoord, empty ? TileState.EMPTY : TileState.IDLE, urlTileCoord, this.tileGrid, this.getSourceTiles.bind(this, pixelRatio, projection), this.removeSourceTiles.bind(this));\n newTile.key = key;\n if (tile) {\n newTile.interimTile = tile;\n newTile.refreshInterimChain();\n this.tileCache.replace(coordKey, newTile);\n }\n else {\n this.tileCache.set(coordKey, newTile);\n }\n return newTile;\n };\n /**\n * @inheritDoc\n */\n VectorTile.prototype.getTileGridForProjection = function (projection) {\n var code = projection.getCode();\n var tileGrid = this.tileGrids_[code];\n if (!tileGrid) {\n // A tile grid that matches the tile size of the source tile grid is more\n // likely to have 1:1 relationships between source tiles and rendered tiles.\n var sourceTileGrid = this.tileGrid;\n tileGrid = createForProjection(projection, undefined, sourceTileGrid ? sourceTileGrid.getTileSize(sourceTileGrid.getMinZoom()) : undefined);\n this.tileGrids_[code] = tileGrid;\n }\n return tileGrid;\n };\n /**\n * @inheritDoc\n */\n VectorTile.prototype.getTilePixelRatio = function (pixelRatio) {\n return pixelRatio;\n };\n /**\n * @inheritDoc\n */\n VectorTile.prototype.getTilePixelSize = function (z, pixelRatio, projection) {\n var tileGrid = this.getTileGridForProjection(projection);\n var tileSize = toSize(tileGrid.getTileSize(z), this.tmpSize);\n return [Math.round(tileSize[0] * pixelRatio), Math.round(tileSize[1] * pixelRatio)];\n };\n return VectorTile;\n}(UrlTile));\nexport default VectorTile;\n/**\n * Sets the loader for a tile.\n * @param {import(\"../VectorTile.js\").default} tile Vector tile.\n * @param {string} url URL.\n */\nexport function defaultLoadFunction(tile, url) {\n var loader = loadFeaturesXhr(url, tile.getFormat(), tile.onLoad.bind(tile), tile.onError.bind(tile));\n tile.setLoader(loader);\n}\n//# sourceMappingURL=VectorTile.js.map","/**\n * @module ol/source/WMTSRequestEncoding\n */\n/**\n * Request encoding. One of 'KVP', 'REST'.\n * @enum {string}\n */\nexport default {\n KVP: 'KVP',\n REST: 'REST' // see spec §10\n};\n//# sourceMappingURL=WMTSRequestEncoding.js.map","/**\n * @module ol/source/WMTS\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { expandUrl, createFromTileUrlFunctions, nullTileUrlFunction } from '../tileurlfunction.js';\nimport { find, findIndex, includes } from '../array.js';\nimport { containsExtent } from '../extent.js';\nimport { assign } from '../obj.js';\nimport { get as getProjection, equivalent, transformExtent } from '../proj.js';\nimport TileImage from './TileImage.js';\nimport WMTSRequestEncoding from './WMTSRequestEncoding.js';\nimport { createFromCapabilitiesMatrixSet } from '../tilegrid/WMTS.js';\nimport { appendParams } from '../uri.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will increase if too small.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {import(\"../tilegrid/WMTS.js\").default} tileGrid Tile grid.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).\n * Higher values can increase reprojection performance, but decrease precision.\n * @property {import(\"./WMTSRequestEncoding.js\").default|string} [requestEncoding='KVP'] Request encoding.\n * @property {string} layer Layer name as advertised in the WMTS capabilities.\n * @property {string} style Style name as advertised in the WMTS capabilities.\n * @property {typeof import(\"../ImageTile.js\").default} [tileClass] Class used to instantiate image tiles. Default is {@link module:ol/ImageTile~ImageTile}.\n * @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service.\n * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px\n * by 512px images (for retina/hidpi devices) then `tilePixelRatio`\n * should be set to `2`.\n * @property {string} [format='image/jpeg'] Image format. Only used when `requestEncoding` is `'KVP'`.\n * @property {string} [version='1.0.0'] WMTS version.\n * @property {string} matrixSet Matrix set.\n * @property {!Object} [dimensions] Additional \"dimensions\" for tile requests.\n * This is an object with properties named like the advertised WMTS dimensions.\n * @property {string} [url] A URL for the service.\n * For the RESTful request encoding, this is a URL\n * template. For KVP encoding, it is normal URL. A `{?-?}` template pattern,\n * for example `subdomain{a-f}.domain.com`, may be used instead of defining\n * each one separately in the `urls` option.\n * @property {import(\"../Tile.js\").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is\n * ```js\n * function(imageTile, src) {\n * imageTile.getImage().src = src;\n * };\n * ```\n * @property {Array<string>} [urls] An array of URLs.\n * Requests will be distributed among the URLs in this array.\n * @property {boolean} [wrapX=false] Whether to wrap the world horizontally.\n * @property {number} [transition] Duration of the opacity transition for rendering.\n * To disable the opacity transition, pass `transition: 0`.\n */\n/**\n * @classdesc\n * Layer source for tile data from WMTS servers.\n * @api\n */\nvar WMTS = /** @class */ (function (_super) {\n __extends(WMTS, _super);\n /**\n * @param {Options} options WMTS options.\n */\n function WMTS(options) {\n // TODO: add support for TileMatrixLimits\n var _this = this;\n var requestEncoding = options.requestEncoding !== undefined ?\n /** @type {import(\"./WMTSRequestEncoding.js\").default} */ (options.requestEncoding) :\n WMTSRequestEncoding.KVP;\n // FIXME: should we create a default tileGrid?\n // we could issue a getCapabilities xhr to retrieve missing configuration\n var tileGrid = options.tileGrid;\n var urls = options.urls;\n if (urls === undefined && options.url !== undefined) {\n urls = expandUrl(options.url);\n }\n _this = _super.call(this, {\n attributions: options.attributions,\n cacheSize: options.cacheSize,\n crossOrigin: options.crossOrigin,\n projection: options.projection,\n reprojectionErrorThreshold: options.reprojectionErrorThreshold,\n tileClass: options.tileClass,\n tileGrid: tileGrid,\n tileLoadFunction: options.tileLoadFunction,\n tilePixelRatio: options.tilePixelRatio,\n tileUrlFunction: nullTileUrlFunction,\n urls: urls,\n wrapX: options.wrapX !== undefined ? options.wrapX : false,\n transition: options.transition\n }) || this;\n /**\n * @private\n * @type {string}\n */\n _this.version_ = options.version !== undefined ? options.version : '1.0.0';\n /**\n * @private\n * @type {string}\n */\n _this.format_ = options.format !== undefined ? options.format : 'image/jpeg';\n /**\n * @private\n * @type {!Object}\n */\n _this.dimensions_ = options.dimensions !== undefined ? options.dimensions : {};\n /**\n * @private\n * @type {string}\n */\n _this.layer_ = options.layer;\n /**\n * @private\n * @type {string}\n */\n _this.matrixSet_ = options.matrixSet;\n /**\n * @private\n * @type {string}\n */\n _this.style_ = options.style;\n // FIXME: should we guess this requestEncoding from options.url(s)\n // structure? that would mean KVP only if a template is not provided.\n /**\n * @private\n * @type {import(\"./WMTSRequestEncoding.js\").default}\n */\n _this.requestEncoding_ = requestEncoding;\n _this.setKey(_this.getKeyForDimensions_());\n if (urls && urls.length > 0) {\n _this.tileUrlFunction = createFromTileUrlFunctions(urls.map(createFromWMTSTemplate.bind(_this)));\n }\n return _this;\n }\n /**\n * Set the URLs to use for requests.\n * URLs may contain OCG conform URL Template Variables: {TileMatrix}, {TileRow}, {TileCol}.\n * @override\n */\n WMTS.prototype.setUrls = function (urls) {\n this.urls = urls;\n var key = urls.join('\\n');\n this.setTileUrlFunction(createFromTileUrlFunctions(urls.map(createFromWMTSTemplate.bind(this))), key);\n };\n /**\n * Get the dimensions, i.e. those passed to the constructor through the\n * \"dimensions\" option, and possibly updated using the updateDimensions\n * method.\n * @return {!Object} Dimensions.\n * @api\n */\n WMTS.prototype.getDimensions = function () {\n return this.dimensions_;\n };\n /**\n * Return the image format of the WMTS source.\n * @return {string} Format.\n * @api\n */\n WMTS.prototype.getFormat = function () {\n return this.format_;\n };\n /**\n * Return the layer of the WMTS source.\n * @return {string} Layer.\n * @api\n */\n WMTS.prototype.getLayer = function () {\n return this.layer_;\n };\n /**\n * Return the matrix set of the WMTS source.\n * @return {string} MatrixSet.\n * @api\n */\n WMTS.prototype.getMatrixSet = function () {\n return this.matrixSet_;\n };\n /**\n * Return the request encoding, either \"KVP\" or \"REST\".\n * @return {import(\"./WMTSRequestEncoding.js\").default} Request encoding.\n * @api\n */\n WMTS.prototype.getRequestEncoding = function () {\n return this.requestEncoding_;\n };\n /**\n * Return the style of the WMTS source.\n * @return {string} Style.\n * @api\n */\n WMTS.prototype.getStyle = function () {\n return this.style_;\n };\n /**\n * Return the version of the WMTS source.\n * @return {string} Version.\n * @api\n */\n WMTS.prototype.getVersion = function () {\n return this.version_;\n };\n /**\n * @private\n * @return {string} The key for the current dimensions.\n */\n WMTS.prototype.getKeyForDimensions_ = function () {\n var i = 0;\n var res = [];\n for (var key in this.dimensions_) {\n res[i++] = key + '-' + this.dimensions_[key];\n }\n return res.join('/');\n };\n /**\n * Update the dimensions.\n * @param {Object} dimensions Dimensions.\n * @api\n */\n WMTS.prototype.updateDimensions = function (dimensions) {\n assign(this.dimensions_, dimensions);\n this.setKey(this.getKeyForDimensions_());\n };\n return WMTS;\n}(TileImage));\nexport default WMTS;\n/**\n * Generate source options from a capabilities object.\n * @param {Object} wmtsCap An object representing the capabilities document.\n * @param {!Object} config Configuration properties for the layer. Defaults for\n * the layer will apply if not provided.\n *\n * Required config properties:\n * - layer - {string} The layer identifier.\n *\n * Optional config properties:\n * - matrixSet - {string} The matrix set identifier, required if there is\n * more than one matrix set in the layer capabilities.\n * - projection - {string} The desired CRS when no matrixSet is specified.\n * eg: \"EPSG:3857\". If the desired projection is not available,\n * an error is thrown.\n * - requestEncoding - {string} url encoding format for the layer. Default is\n * the first tile url format found in the GetCapabilities response.\n * - style - {string} The name of the style\n * - format - {string} Image format for the layer. Default is the first\n * format returned in the GetCapabilities response.\n * - crossOrigin - {string|null|undefined} Cross origin. Default is `undefined`.\n * @return {?Options} WMTS source options object or `null` if the layer was not found.\n * @api\n */\nexport function optionsFromCapabilities(wmtsCap, config) {\n var layers = wmtsCap['Contents']['Layer'];\n var l = find(layers, function (elt, index, array) {\n return elt['Identifier'] == config['layer'];\n });\n if (l === null) {\n return null;\n }\n var tileMatrixSets = wmtsCap['Contents']['TileMatrixSet'];\n var idx;\n if (l['TileMatrixSetLink'].length > 1) {\n if ('projection' in config) {\n idx = findIndex(l['TileMatrixSetLink'], function (elt, index, array) {\n var tileMatrixSet = find(tileMatrixSets, function (el) {\n return el['Identifier'] == elt['TileMatrixSet'];\n });\n var supportedCRS = tileMatrixSet['SupportedCRS'];\n var proj1 = getProjection(supportedCRS.replace(/urn:ogc:def:crs:(\\w+):(.*:)?(\\w+)$/, '$1:$3')) ||\n getProjection(supportedCRS);\n var proj2 = getProjection(config['projection']);\n if (proj1 && proj2) {\n return equivalent(proj1, proj2);\n }\n else {\n return supportedCRS == config['projection'];\n }\n });\n }\n else {\n idx = findIndex(l['TileMatrixSetLink'], function (elt, index, array) {\n return elt['TileMatrixSet'] == config['matrixSet'];\n });\n }\n }\n else {\n idx = 0;\n }\n if (idx < 0) {\n idx = 0;\n }\n var matrixSet = /** @type {string} */ (l['TileMatrixSetLink'][idx]['TileMatrixSet']);\n var matrixLimits = /** @type {Array<Object>} */ (l['TileMatrixSetLink'][idx]['TileMatrixSetLimits']);\n var format = /** @type {string} */ (l['Format'][0]);\n if ('format' in config) {\n format = config['format'];\n }\n idx = findIndex(l['Style'], function (elt, index, array) {\n if ('style' in config) {\n return elt['Title'] == config['style'];\n }\n else {\n return elt['isDefault'];\n }\n });\n if (idx < 0) {\n idx = 0;\n }\n var style = /** @type {string} */ (l['Style'][idx]['Identifier']);\n var dimensions = {};\n if ('Dimension' in l) {\n l['Dimension'].forEach(function (elt, index, array) {\n var key = elt['Identifier'];\n var value = elt['Default'];\n if (value === undefined) {\n value = elt['Value'][0];\n }\n dimensions[key] = value;\n });\n }\n var matrixSets = wmtsCap['Contents']['TileMatrixSet'];\n var matrixSetObj = find(matrixSets, function (elt, index, array) {\n return elt['Identifier'] == matrixSet;\n });\n var projection;\n var code = matrixSetObj['SupportedCRS'];\n if (code) {\n projection = getProjection(code.replace(/urn:ogc:def:crs:(\\w+):(.*:)?(\\w+)$/, '$1:$3')) ||\n getProjection(code);\n }\n if ('projection' in config) {\n var projConfig = getProjection(config['projection']);\n if (projConfig) {\n if (!projection || equivalent(projConfig, projection)) {\n projection = projConfig;\n }\n }\n }\n var wgs84BoundingBox = l['WGS84BoundingBox'];\n var extent, wrapX;\n if (wgs84BoundingBox !== undefined) {\n var wgs84ProjectionExtent = getProjection('EPSG:4326').getExtent();\n wrapX = (wgs84BoundingBox[0] == wgs84ProjectionExtent[0] &&\n wgs84BoundingBox[2] == wgs84ProjectionExtent[2]);\n extent = transformExtent(wgs84BoundingBox, 'EPSG:4326', projection);\n var projectionExtent = projection.getExtent();\n if (projectionExtent) {\n // If possible, do a sanity check on the extent - it should never be\n // bigger than the validity extent of the projection of a matrix set.\n if (!containsExtent(projectionExtent, extent)) {\n extent = undefined;\n }\n }\n }\n var tileGrid = createFromCapabilitiesMatrixSet(matrixSetObj, extent, matrixLimits);\n /** @type {!Array<string>} */\n var urls = [];\n var requestEncoding = config['requestEncoding'];\n requestEncoding = requestEncoding !== undefined ? requestEncoding : '';\n if ('OperationsMetadata' in wmtsCap && 'GetTile' in wmtsCap['OperationsMetadata']) {\n var gets = wmtsCap['OperationsMetadata']['GetTile']['DCP']['HTTP']['Get'];\n for (var i = 0, ii = gets.length; i < ii; ++i) {\n if (gets[i]['Constraint']) {\n var constraint = find(gets[i]['Constraint'], function (element) {\n return element['name'] == 'GetEncoding';\n });\n var encodings = constraint['AllowedValues']['Value'];\n if (requestEncoding === '') {\n // requestEncoding not provided, use the first encoding from the list\n requestEncoding = encodings[0];\n }\n if (requestEncoding === WMTSRequestEncoding.KVP) {\n if (includes(encodings, WMTSRequestEncoding.KVP)) {\n urls.push(/** @type {string} */ (gets[i]['href']));\n }\n }\n else {\n break;\n }\n }\n else if (gets[i]['href']) {\n requestEncoding = WMTSRequestEncoding.KVP;\n urls.push(/** @type {string} */ (gets[i]['href']));\n }\n }\n }\n if (urls.length === 0) {\n requestEncoding = WMTSRequestEncoding.REST;\n l['ResourceURL'].forEach(function (element) {\n if (element['resourceType'] === 'tile') {\n format = element['format'];\n urls.push(/** @type {string} */ (element['template']));\n }\n });\n }\n return {\n urls: urls,\n layer: config['layer'],\n matrixSet: matrixSet,\n format: format,\n projection: projection,\n requestEncoding: requestEncoding,\n tileGrid: tileGrid,\n style: style,\n dimensions: dimensions,\n wrapX: wrapX,\n crossOrigin: config['crossOrigin']\n };\n}\n/**\n * @param {string} template Template.\n * @return {import(\"../Tile.js\").UrlFunction} Tile URL function.\n * @this {WMTS}\n */\nfunction createFromWMTSTemplate(template) {\n var requestEncoding = this.requestEncoding_;\n // context property names are lower case to allow for a case insensitive\n // replacement as some services use different naming conventions\n var context = {\n 'layer': this.layer_,\n 'style': this.style_,\n 'tilematrixset': this.matrixSet_\n };\n if (requestEncoding == WMTSRequestEncoding.KVP) {\n assign(context, {\n 'Service': 'WMTS',\n 'Request': 'GetTile',\n 'Version': this.version_,\n 'Format': this.format_\n });\n }\n // TODO: we may want to create our own appendParams function so that params\n // order conforms to wmts spec guidance, and so that we can avoid to escape\n // special template params\n template = (requestEncoding == WMTSRequestEncoding.KVP) ?\n appendParams(template, context) :\n template.replace(/\\{(\\w+?)\\}/g, function (m, p) {\n return (p.toLowerCase() in context) ? context[p.toLowerCase()] : m;\n });\n var tileGrid = /** @type {import(\"../tilegrid/WMTS.js\").default} */ (this.tileGrid);\n var dimensions = this.dimensions_;\n return (\n /**\n * @param {import(\"../tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {string|undefined} Tile URL.\n */\n function (tileCoord, pixelRatio, projection) {\n if (!tileCoord) {\n return undefined;\n }\n else {\n var localContext_1 = {\n 'TileMatrix': tileGrid.getMatrixId(tileCoord[0]),\n 'TileCol': tileCoord[1],\n 'TileRow': tileCoord[2]\n };\n assign(localContext_1, dimensions);\n var url = template;\n if (requestEncoding == WMTSRequestEncoding.KVP) {\n url = appendParams(url, localContext_1);\n }\n else {\n url = url.replace(/\\{(\\w+?)\\}/g, function (m, p) {\n return localContext_1[p];\n });\n }\n return url;\n }\n });\n}\n//# sourceMappingURL=WMTS.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/webgl/Layer\n */\nimport LayerRenderer from '../Layer.js';\nimport WebGLHelper from '../../webgl/Helper.js';\n/**\n * @enum {string}\n */\nexport var WebGLWorkerMessageType = {\n GENERATE_BUFFERS: 'GENERATE_BUFFERS'\n};\n/**\n * @typedef {Object} WebGLWorkerGenerateBuffersMessage\n * This message will trigger the generation of a vertex and an index buffer based on the given render instructions.\n * When the buffers are generated, the worked will send a message of the same type to the main thread, with\n * the generated buffers in it.\n * Note that any addition properties present in the message *will* be sent back to the main thread.\n * @property {WebGLWorkerMessageType} type Message type\n * @property {ArrayBuffer} renderInstructions Render instructions raw binary buffer.\n * @property {ArrayBuffer} [vertexBuffer] Vertices array raw binary buffer (sent by the worker).\n * @property {ArrayBuffer} [indexBuffer] Indices array raw binary buffer (sent by the worker).\n * @property {number} [customAttributesCount] Amount of custom attributes count in the render instructions.\n */\n/**\n * @typedef {Object} PostProcessesOptions\n * @property {number} [scaleRatio] Scale ratio; if < 1, the post process will render to a texture smaller than\n * the main canvas that will then be sampled up (useful for saving resource on blur steps).\n * @property {string} [vertexShader] Vertex shader source\n * @property {string} [fragmentShader] Fragment shader source\n * @property {Object.<string,import(\"../../webgl/Helper\").UniformValue>} [uniforms] Uniform definitions for the post process step\n */\n/**\n * @typedef {Object} Options\n * @property {Object.<string,import(\"../../webgl/Helper\").UniformValue>} [uniforms] Uniform definitions for the post process steps\n * @property {Array<PostProcessesOptions>} [postProcesses] Post-processes definitions\n */\n/**\n * @classdesc\n * Base WebGL renderer class.\n * Holds all logic related to data manipulation & some common rendering logic\n * @template {import(\"../../layer/Layer.js\").default} LayerType\n */\nvar WebGLLayerRenderer = /** @class */ (function (_super) {\n __extends(WebGLLayerRenderer, _super);\n /**\n * @param {LayerType} layer Layer.\n * @param {Options=} [opt_options] Options.\n */\n function WebGLLayerRenderer(layer, opt_options) {\n var _this = _super.call(this, layer) || this;\n var options = opt_options || {};\n /**\n * @type {WebGLHelper}\n * @protected\n */\n _this.helper = new WebGLHelper({\n postProcesses: options.postProcesses,\n uniforms: options.uniforms\n });\n return _this;\n }\n /**\n * @inheritDoc\n */\n WebGLLayerRenderer.prototype.disposeInternal = function () {\n this.helper.dispose();\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Will return the last shader compilation errors. If no error happened, will return null;\n * @return {string|null} Errors, or null if last compilation was successful\n * @api\n */\n WebGLLayerRenderer.prototype.getShaderCompileErrors = function () {\n return this.helper.getShaderCompileErrors();\n };\n return WebGLLayerRenderer;\n}(LayerRenderer));\nvar tmpArray_ = [];\nvar bufferPositions_ = { vertexPosition: 0, indexPosition: 0 };\nfunction writePointVertex(buffer, pos, x, y, index) {\n buffer[pos + 0] = x;\n buffer[pos + 1] = y;\n buffer[pos + 2] = index;\n}\n/**\n * An object holding positions both in an index and a vertex buffer.\n * @typedef {Object} BufferPositions\n * @property {number} vertexPosition Position in the vertex buffer\n * @property {number} indexPosition Position in the index buffer\n */\n/**\n * Pushes a quad (two triangles) based on a point geometry\n * @param {Float32Array} instructions Array of render instructions for points.\n * @param {number} elementIndex Index from which render instructions will be read.\n * @param {Float32Array} vertexBuffer Buffer in the form of a typed array.\n * @param {Uint32Array} indexBuffer Buffer in the form of a typed array.\n * @param {number} customAttributesCount Amount of custom attributes for each element.\n * @param {BufferPositions} [bufferPositions] Buffer write positions; if not specified, positions will be set at 0.\n * @return {BufferPositions} New buffer positions where to write next\n * @property {number} vertexPosition New position in the vertex buffer where future writes should start.\n * @property {number} indexPosition New position in the index buffer where future writes should start.\n * @private\n */\nexport function writePointFeatureToBuffers(instructions, elementIndex, vertexBuffer, indexBuffer, customAttributesCount, bufferPositions) {\n // This is for x, y and index\n var baseVertexAttrsCount = 3;\n var baseInstructionsCount = 2;\n var stride = baseVertexAttrsCount + customAttributesCount;\n var x = instructions[elementIndex + 0];\n var y = instructions[elementIndex + 1];\n // read custom numerical attributes on the feature\n var customAttrs = tmpArray_;\n customAttrs.length = customAttributesCount;\n for (var i = 0; i < customAttrs.length; i++) {\n customAttrs[i] = instructions[elementIndex + baseInstructionsCount + i];\n }\n var vPos = bufferPositions ? bufferPositions.vertexPosition : 0;\n var iPos = bufferPositions ? bufferPositions.indexPosition : 0;\n var baseIndex = vPos / stride;\n // push vertices for each of the four quad corners (first standard then custom attributes)\n writePointVertex(vertexBuffer, vPos, x, y, 0);\n customAttrs.length && vertexBuffer.set(customAttrs, vPos + baseVertexAttrsCount);\n vPos += stride;\n writePointVertex(vertexBuffer, vPos, x, y, 1);\n customAttrs.length && vertexBuffer.set(customAttrs, vPos + baseVertexAttrsCount);\n vPos += stride;\n writePointVertex(vertexBuffer, vPos, x, y, 2);\n customAttrs.length && vertexBuffer.set(customAttrs, vPos + baseVertexAttrsCount);\n vPos += stride;\n writePointVertex(vertexBuffer, vPos, x, y, 3);\n customAttrs.length && vertexBuffer.set(customAttrs, vPos + baseVertexAttrsCount);\n vPos += stride;\n indexBuffer[iPos++] = baseIndex;\n indexBuffer[iPos++] = baseIndex + 1;\n indexBuffer[iPos++] = baseIndex + 3;\n indexBuffer[iPos++] = baseIndex + 1;\n indexBuffer[iPos++] = baseIndex + 2;\n indexBuffer[iPos++] = baseIndex + 3;\n bufferPositions_.vertexPosition = vPos;\n bufferPositions_.indexPosition = iPos;\n return bufferPositions_;\n}\n/**\n * Returns a texture of 1x1 pixel, white\n * @private\n * @return {ImageData} Image data.\n */\nexport function getBlankImageData() {\n var canvas = document.createElement('canvas');\n var image = canvas.getContext('2d').createImageData(1, 1);\n image.data[0] = 255;\n image.data[1] = 255;\n image.data[2] = 255;\n image.data[3] = 255;\n return image;\n}\n/**\n * Generates a color array based on a numerical id\n * Note: the range for each component is 0 to 1 with 256 steps\n * @param {number} id Id\n * @param {Array<number>} [opt_array] Reusable array\n * @return {Array<number>} Color array containing the encoded id\n */\nexport function colorEncodeId(id, opt_array) {\n var array = opt_array || [];\n var radix = 256;\n var divide = radix - 1;\n array[0] = Math.floor(id / radix / radix / radix) / divide;\n array[1] = (Math.floor(id / radix / radix) % radix) / divide;\n array[2] = (Math.floor(id / radix) % radix) / divide;\n array[3] = (id % radix) / divide;\n return array;\n}\n/**\n * Reads an id from a color-encoded array\n * Note: the expected range for each component is 0 to 1 with 256 steps.\n * @param {Array<number>} color Color array containing the encoded id\n * @return {number} Decoded id\n */\nexport function colorDecodeId(color) {\n var id = 0;\n var radix = 256;\n var mult = radix - 1;\n id += Math.round(color[0] * radix * radix * radix * mult);\n id += Math.round(color[1] * radix * radix * mult);\n id += Math.round(color[2] * radix * mult);\n id += Math.round(color[3] * mult);\n return id;\n}\nexport default WebGLLayerRenderer;\n//# sourceMappingURL=Layer.js.map","var source = \"var e=\\\"function\\\"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError(\\\"Cannot convert undefined or null to object\\\");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n=\\\"GENERATE_BUFFERS\\\",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};\";\nvar blob = new Blob([source], { type: 'application/javascript' });\nvar url = URL.createObjectURL(blob);\nexport function create() {\n return new Worker(url);\n}\n//# sourceMappingURL=webgl.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/BaseVector\n */\nimport Layer from './Layer.js';\nimport { assign } from '../obj.js';\nimport { createDefaultStyle, toFunction as toStyleFunction } from '../style/Style.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {import(\"../render.js\").OrderFunction} [renderOrder] Render order. Function to be used when sorting\n * features before rendering. By default features are drawn in the order that they are created. Use\n * `null` to avoid the sort, but get an undefined draw order.\n * @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the\n * renderer when getting features from the vector source for the rendering or hit-detection.\n * Recommended value: the size of the largest symbol, line width or label.\n * @property {import(\"../source/Vector.js\").default} [source] Source.\n * @property {import(\"../PluggableMap.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use {@link module:ol/Map#addLayer}.\n * @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all\n * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority\n * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.\n * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has\n * higher priority.\n * @property {import(\"../style/Style.js\").StyleLike} [style] Layer style. See\n * {@link module:ol/style} for default style which will be used if this is not defined.\n * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will\n * be recreated during animations. This means that no vectors will be shown clipped, but the\n * setting will have a performance impact for large amounts of vector data. When set to `false`,\n * batches will be recreated when no animation is active.\n * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will\n * be recreated during interactions. See also `updateWhileAnimating`.\n */\n/**\n * @enum {string}\n * @private\n */\nvar Property = {\n RENDER_ORDER: 'renderOrder'\n};\n/**\n * @classdesc\n * Vector data that is rendered client-side.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @template {import(\"../source/Vector.js\").default|import(\"../source/VectorTile.js\").default} VectorSourceType\n * @extends {Layer<VectorSourceType>}\n * @api\n */\nvar BaseVectorLayer = /** @class */ (function (_super) {\n __extends(BaseVectorLayer, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function BaseVectorLayer(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var baseOptions = assign({}, options);\n delete baseOptions.style;\n delete baseOptions.renderBuffer;\n delete baseOptions.updateWhileAnimating;\n delete baseOptions.updateWhileInteracting;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.declutter_ = options.declutter !== undefined ? options.declutter : false;\n /**\n * @type {number}\n * @private\n */\n _this.renderBuffer_ = options.renderBuffer !== undefined ?\n options.renderBuffer : 100;\n /**\n * User provided style.\n * @type {import(\"../style/Style.js\").StyleLike}\n * @private\n */\n _this.style_ = null;\n /**\n * Style function for use within the library.\n * @type {import(\"../style/Style.js\").StyleFunction|undefined}\n * @private\n */\n _this.styleFunction_ = undefined;\n _this.setStyle(options.style);\n /**\n * @type {boolean}\n * @private\n */\n _this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ?\n options.updateWhileAnimating : false;\n /**\n * @type {boolean}\n * @private\n */\n _this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ?\n options.updateWhileInteracting : false;\n return _this;\n }\n /**\n * @return {boolean} Declutter.\n */\n BaseVectorLayer.prototype.getDeclutter = function () {\n return this.declutter_;\n };\n /**\n * Get the topmost feature that intersects the given pixel on the viewport. Returns a promise\n * that resolves with an array of features. The array will either contain the topmost feature\n * when a hit was detected, or it will be empty.\n *\n * The hit detection algorithm used for this method is optimized for performance, but is less\n * accurate than the one used in {@link import(\"../PluggableMap.js\").default#getFeaturesAtPixel}: Text\n * is not considered, and icons are only represented by their bounding box instead of the exact\n * image.\n *\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").default>>} Promise that resolves with an array of features.\n * @api\n */\n BaseVectorLayer.prototype.getFeatures = function (pixel) {\n return _super.prototype.getFeatures.call(this, pixel);\n };\n /**\n * @return {number|undefined} Render buffer.\n */\n BaseVectorLayer.prototype.getRenderBuffer = function () {\n return this.renderBuffer_;\n };\n /**\n * @return {function(import(\"../Feature.js\").default, import(\"../Feature.js\").default): number|null|undefined} Render\n * order.\n */\n BaseVectorLayer.prototype.getRenderOrder = function () {\n return (\n /** @type {import(\"../render.js\").OrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER)));\n };\n /**\n * Get the style for features. This returns whatever was passed to the `style`\n * option at construction or to the `setStyle` method.\n * @return {import(\"../style/Style.js\").StyleLike}\n * Layer style.\n * @api\n */\n BaseVectorLayer.prototype.getStyle = function () {\n return this.style_;\n };\n /**\n * Get the style function.\n * @return {import(\"../style/Style.js\").StyleFunction|undefined} Layer style function.\n * @api\n */\n BaseVectorLayer.prototype.getStyleFunction = function () {\n return this.styleFunction_;\n };\n /**\n * @return {boolean} Whether the rendered layer should be updated while\n * animating.\n */\n BaseVectorLayer.prototype.getUpdateWhileAnimating = function () {\n return this.updateWhileAnimating_;\n };\n /**\n * @return {boolean} Whether the rendered layer should be updated while\n * interacting.\n */\n BaseVectorLayer.prototype.getUpdateWhileInteracting = function () {\n return this.updateWhileInteracting_;\n };\n /**\n * @param {import(\"../render.js\").OrderFunction|null|undefined} renderOrder\n * Render order.\n */\n BaseVectorLayer.prototype.setRenderOrder = function (renderOrder) {\n this.set(Property.RENDER_ORDER, renderOrder);\n };\n /**\n * Set the style for features. This can be a single style object, an array\n * of styles, or a function that takes a feature and resolution and returns\n * an array of styles. If it is `undefined` the default style is used. If\n * it is `null` the layer has no style (a `null` style), so only features\n * that have their own styles will be rendered in the layer. See\n * {@link module:ol/style} for information on the default style.\n * @param {import(\"../style/Style.js\").default|Array<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction|null|undefined} style Layer style.\n * @api\n */\n BaseVectorLayer.prototype.setStyle = function (style) {\n this.style_ = style !== undefined ? style : createDefaultStyle;\n this.styleFunction_ = style === null ?\n undefined : toStyleFunction(this.style_);\n this.changed();\n };\n return BaseVectorLayer;\n}(Layer));\nexport default BaseVectorLayer;\n//# sourceMappingURL=BaseVector.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/webgl/PointsLayer\n */\nimport WebGLArrayBuffer from '../../webgl/Buffer.js';\nimport { ARRAY_BUFFER, DYNAMIC_DRAW, ELEMENT_ARRAY_BUFFER } from '../../webgl.js';\nimport { AttributeType, DefaultUniform } from '../../webgl/Helper.js';\nimport GeometryType from '../../geom/GeometryType.js';\nimport WebGLLayerRenderer, { colorDecodeId, colorEncodeId, WebGLWorkerMessageType } from './Layer.js';\nimport ViewHint from '../../ViewHint.js';\nimport { buffer, createEmpty, equals } from '../../extent.js';\nimport { apply as applyTransform, create as createTransform, makeInverse as makeInverseTransform, multiply as multiplyTransform } from '../../transform.js';\nimport { create as createWebGLWorker } from '../../worker/webgl.js';\nimport { getUid } from '../../util.js';\nimport WebGLRenderTarget from '../../webgl/RenderTarget.js';\nimport { assert } from '../../asserts.js';\nimport BaseVector from '../../layer/BaseVector.js';\nimport { listen, unlistenByKey } from '../../events.js';\nimport VectorEventType from '../../source/VectorEventType.js';\n/**\n * @typedef {Object} CustomAttribute A description of a custom attribute to be passed on to the GPU, with a value different\n * for each feature.\n * @property {string} name Attribute name.\n * @property {function(import(\"../../Feature\").default, Object<string, *>):number} callback This callback computes the numerical value of the\n * attribute for a given feature (properties are available as 2nd arg for quicker access).\n */\n/**\n * @typedef {Object} FeatureCacheItem Object that holds a reference to a feature, its geometry and properties. Used to optimize\n * rebuildBuffers by accessing these objects quicker.\n * @property {import(\"../../Feature\").default} feature Feature\n * @property {Object<string, *>} properties Feature properties\n * @property {import(\"../../geom\").Geometry} geometry Feature geometry\n */\n/**\n * @typedef {Object} Options\n * @property {Array<CustomAttribute>} [attributes] These attributes will be read from the features in the source and then\n * passed to the GPU. The `name` property of each attribute will serve as its identifier:\n * * In the vertex shader as an `attribute` by prefixing it with `a_`\n * * In the fragment shader as a `varying` by prefixing it with `v_`\n * Please note that these can only be numerical values.\n * @property {string} vertexShader Vertex shader source, mandatory.\n * @property {string} fragmentShader Fragment shader source, mandatory.\n * @property {string} [hitVertexShader] Vertex shader source for hit detection rendering.\n * @property {string} [hitFragmentShader] Fragment shader source for hit detection rendering.\n * @property {Object.<string,import(\"../../webgl/Helper\").UniformValue>} [uniforms] Uniform definitions for the post process steps\n * Please note that `u_texture` is reserved for the main texture slot.\n * @property {Array<import(\"./Layer\").PostProcessesOptions>} [postProcesses] Post-processes definitions\n */\n/**\n * @classdesc\n * WebGL vector renderer optimized for points.\n * All features will be rendered as quads (two triangles forming a square). New data will be flushed to the GPU\n * every time the vector source changes.\n *\n * You need to provide vertex and fragment shaders for rendering. This can be done using\n * {@link module:ol/webgl/ShaderBuilder} utilities. These shaders shall expect a `a_position` attribute\n * containing the screen-space projected center of the quad, as well as a `a_index` attribute\n * whose value (0, 1, 2 or 3) indicates which quad vertex is currently getting processed (see structure below).\n *\n * To include variable attributes in the shaders, you need to declare them using the `attributes` property of\n * the options object like so:\n * ```js\n * new WebGLPointsLayerRenderer(layer, {\n * attributes: [\n * {\n * name: 'size',\n * callback: function(feature) {\n * // compute something with the feature\n * }\n * },\n * {\n * name: 'weight',\n * callback: function(feature) {\n * // compute something with the feature\n * }\n * },\n * ],\n * vertexShader:\n * // shader using attribute a_weight and a_size\n * fragmentShader:\n * // shader using varying v_weight and v_size\n * ```\n *\n * To enable hit detection, you must as well provide dedicated shaders using the `hitVertexShader`\n * and `hitFragmentShader` properties. These shall expect the `a_hitColor` attribute to contain\n * the final color that will have to be output for hit detection to work.\n *\n * The following uniform is used for the main texture: `u_texture`.\n *\n * Please note that the main shader output should have premultiplied alpha, otherwise visual anomalies may occur.\n *\n * Points are rendered as quads with the following structure:\n *\n * ```\n * (u0, v1) (u1, v1)\n * [3]----------[2]\n * |` |\n * | ` |\n * | ` |\n * | ` |\n * | ` |\n * | ` |\n * [0]----------[1]\n * (u0, v0) (u1, v0)\n * ```\n *\n * This uses {@link module:ol/webgl/Helper~WebGLHelper} internally.\n *\n * @api\n */\nvar WebGLPointsLayerRenderer = /** @class */ (function (_super) {\n __extends(WebGLPointsLayerRenderer, _super);\n /**\n * @param {import(\"../../layer/Layer.js\").default} layer Layer.\n * @param {Options} options Options.\n */\n function WebGLPointsLayerRenderer(layer, options) {\n var _this = this;\n var uniforms = options.uniforms || {};\n var projectionMatrixTransform = createTransform();\n uniforms[DefaultUniform.PROJECTION_MATRIX] = projectionMatrixTransform;\n _this = _super.call(this, layer, {\n uniforms: uniforms,\n postProcesses: options.postProcesses\n }) || this;\n _this.sourceRevision_ = -1;\n _this.verticesBuffer_ = new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW);\n _this.hitVerticesBuffer_ = new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW);\n _this.indicesBuffer_ = new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW);\n _this.program_ = _this.helper.getProgram(options.fragmentShader, options.vertexShader);\n if (_this.getShaderCompileErrors()) {\n throw new Error(_this.getShaderCompileErrors());\n }\n /**\n * @type {boolean}\n * @private\n */\n _this.hitDetectionEnabled_ = options.hitFragmentShader && options.hitVertexShader ? true : false;\n _this.hitProgram_ = _this.hitDetectionEnabled_ && _this.helper.getProgram(options.hitFragmentShader, options.hitVertexShader);\n if (_this.getShaderCompileErrors()) {\n throw new Error(_this.getShaderCompileErrors());\n }\n var customAttributes = options.attributes ?\n options.attributes.map(function (attribute) {\n return {\n name: 'a_' + attribute.name,\n size: 1,\n type: AttributeType.FLOAT\n };\n }) : [];\n /**\n * A list of attributes used by the renderer. By default only the position and\n * index of the vertex (0 to 3) are required.\n * @type {Array<import('../../webgl/Helper.js').AttributeDescription>}\n */\n _this.attributes = [{\n name: 'a_position',\n size: 2,\n type: AttributeType.FLOAT\n }, {\n name: 'a_index',\n size: 1,\n type: AttributeType.FLOAT\n }].concat(customAttributes);\n /**\n * A list of attributes used for hit detection.\n * @type {Array<import('../../webgl/Helper.js').AttributeDescription>}\n */\n _this.hitDetectionAttributes = [{\n name: 'a_position',\n size: 2,\n type: AttributeType.FLOAT\n }, {\n name: 'a_index',\n size: 1,\n type: AttributeType.FLOAT\n }, {\n name: 'a_hitColor',\n size: 4,\n type: AttributeType.FLOAT\n }, {\n name: 'a_featureUid',\n size: 1,\n type: AttributeType.FLOAT\n }].concat(customAttributes);\n _this.customAttributes = options.attributes ? options.attributes : [];\n _this.previousExtent_ = createEmpty();\n /**\n * This transform is updated on every frame and is the composition of:\n * - invert of the world->screen transform that was used when rebuilding buffers (see `this.renderTransform_`)\n * - current world->screen transform\n * @type {import(\"../../transform.js\").Transform}\n * @private\n */\n _this.currentTransform_ = projectionMatrixTransform;\n /**\n * This transform is updated when buffers are rebuilt and converts world space coordinates to screen space\n * @type {import(\"../../transform.js\").Transform}\n * @private\n */\n _this.renderTransform_ = createTransform();\n /**\n * @type {import(\"../../transform.js\").Transform}\n * @private\n */\n _this.invertRenderTransform_ = createTransform();\n /**\n * @type {Float32Array}\n * @private\n */\n _this.renderInstructions_ = new Float32Array(0);\n /**\n * These instructions are used for hit detection\n * @type {Float32Array}\n * @private\n */\n _this.hitRenderInstructions_ = new Float32Array(0);\n /**\n * @type {WebGLRenderTarget}\n * @private\n */\n _this.hitRenderTarget_ = _this.hitDetectionEnabled_ && new WebGLRenderTarget(_this.helper);\n _this.worker_ = createWebGLWorker();\n _this.worker_.addEventListener('message', function (event) {\n var received = event.data;\n if (received.type === WebGLWorkerMessageType.GENERATE_BUFFERS) {\n var projectionTransform = received.projectionTransform;\n if (received.hitDetection) {\n this.hitVerticesBuffer_.fromArrayBuffer(received.vertexBuffer);\n this.helper.flushBufferData(this.hitVerticesBuffer_);\n }\n else {\n this.verticesBuffer_.fromArrayBuffer(received.vertexBuffer);\n this.helper.flushBufferData(this.verticesBuffer_);\n }\n this.indicesBuffer_.fromArrayBuffer(received.indexBuffer);\n this.helper.flushBufferData(this.indicesBuffer_);\n this.renderTransform_ = projectionTransform;\n makeInverseTransform(this.invertRenderTransform_, this.renderTransform_);\n if (received.hitDetection) {\n this.hitRenderInstructions_ = new Float32Array(event.data.renderInstructions);\n }\n else {\n this.renderInstructions_ = new Float32Array(event.data.renderInstructions);\n }\n this.getLayer().changed();\n }\n }.bind(_this));\n /**\n * This object will be updated when the source changes. Key is uid.\n * @type {Object<string, FeatureCacheItem>}\n * @private\n */\n _this.featureCache_ = {};\n /**\n * Amount of features in the cache.\n * @type {number}\n * @private\n */\n _this.featureCount_ = 0;\n var source = _this.getLayer().getSource();\n _this.sourceListenKeys_ = [\n listen(source, VectorEventType.ADDFEATURE, _this.handleSourceFeatureAdded_, _this),\n listen(source, VectorEventType.CHANGEFEATURE, _this.handleSourceFeatureChanged_, _this),\n listen(source, VectorEventType.REMOVEFEATURE, _this.handleSourceFeatureDelete_, _this)\n ];\n source.forEachFeature(function (feature) {\n this.featureCache_[getUid(feature)] = {\n feature: feature,\n properties: feature.getProperties(),\n geometry: feature.getGeometry()\n };\n this.featureCount_++;\n }.bind(_this));\n return _this;\n }\n /**\n * @param {import(\"../../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n WebGLPointsLayerRenderer.prototype.handleSourceFeatureAdded_ = function (event) {\n var feature = event.feature;\n this.featureCache_[getUid(feature)] = {\n feature: feature,\n properties: feature.getProperties(),\n geometry: feature.getGeometry()\n };\n this.featureCount_++;\n };\n /**\n * @param {import(\"../../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n WebGLPointsLayerRenderer.prototype.handleSourceFeatureChanged_ = function (event) {\n var feature = event.feature;\n this.featureCache_[getUid(feature)] = {\n feature: feature,\n properties: feature.getProperties(),\n geometry: feature.getGeometry()\n };\n };\n /**\n * @param {import(\"../../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n WebGLPointsLayerRenderer.prototype.handleSourceFeatureDelete_ = function (event) {\n var feature = event.feature;\n delete this.featureCache_[getUid(feature)];\n this.featureCount_--;\n };\n /**\n * @inheritDoc\n */\n WebGLPointsLayerRenderer.prototype.renderFrame = function (frameState) {\n var renderCount = this.indicesBuffer_.getSize();\n this.helper.drawElements(0, renderCount);\n this.helper.finalizeDraw(frameState);\n var canvas = this.helper.getCanvas();\n var layerState = frameState.layerStatesArray[frameState.layerIndex];\n var opacity = layerState.opacity;\n if (opacity !== parseFloat(canvas.style.opacity)) {\n canvas.style.opacity = opacity;\n }\n if (this.hitDetectionEnabled_) {\n this.renderHitDetection(frameState);\n this.hitRenderTarget_.clearCachedData();\n }\n return canvas;\n };\n /**\n * @inheritDoc\n */\n WebGLPointsLayerRenderer.prototype.prepareFrame = function (frameState) {\n var layer = this.getLayer();\n var vectorSource = layer.getSource();\n var viewState = frameState.viewState;\n var viewNotMoving = !frameState.viewHints[ViewHint.ANIMATING] && !frameState.viewHints[ViewHint.INTERACTING];\n var extentChanged = !equals(this.previousExtent_, frameState.extent);\n var sourceChanged = this.sourceRevision_ < vectorSource.getRevision();\n if (sourceChanged) {\n this.sourceRevision_ = vectorSource.getRevision();\n }\n if (viewNotMoving && (extentChanged || sourceChanged)) {\n var projection = viewState.projection;\n var resolution = viewState.resolution;\n var renderBuffer = layer instanceof BaseVector ? layer.getRenderBuffer() : 0;\n var extent = buffer(frameState.extent, renderBuffer * resolution);\n vectorSource.loadFeatures(extent, resolution, projection);\n this.rebuildBuffers_(frameState);\n this.previousExtent_ = frameState.extent.slice();\n }\n // apply the current projection transform with the invert of the one used to fill buffers\n this.helper.makeProjectionTransform(frameState, this.currentTransform_);\n multiplyTransform(this.currentTransform_, this.invertRenderTransform_);\n this.helper.useProgram(this.program_);\n this.helper.prepareDraw(frameState);\n // write new data\n this.helper.bindBuffer(this.verticesBuffer_);\n this.helper.bindBuffer(this.indicesBuffer_);\n this.helper.enableAttributes(this.attributes);\n return true;\n };\n /**\n * Rebuild internal webgl buffers based on current view extent; costly, should not be called too much\n * @param {import(\"../../PluggableMap\").FrameState} frameState Frame state.\n * @private\n */\n WebGLPointsLayerRenderer.prototype.rebuildBuffers_ = function (frameState) {\n // saves the projection transform for the current frame state\n var projectionTransform = createTransform();\n this.helper.makeProjectionTransform(frameState, projectionTransform);\n // here we anticipate the amount of render instructions that we well generate\n // this can be done since we know that for normal render we only have x, y as base instructions,\n // and x, y, r, g, b, a and featureUid for hit render instructions\n // and we also know the amount of custom attributes to append to these\n var totalInstructionsCount = (2 + this.customAttributes.length) * this.featureCount_;\n if (!this.renderInstructions_ || this.renderInstructions_.length !== totalInstructionsCount) {\n this.renderInstructions_ = new Float32Array(totalInstructionsCount);\n }\n if (this.hitDetectionEnabled_) {\n var totalHitInstructionsCount = (7 + this.customAttributes.length) * this.featureCount_;\n if (!this.hitRenderInstructions_ || this.hitRenderInstructions_.length !== totalHitInstructionsCount) {\n this.hitRenderInstructions_ = new Float32Array(totalHitInstructionsCount);\n }\n }\n // loop on features to fill the buffer\n var featureCache, geometry;\n var tmpCoords = [];\n var tmpColor = [];\n var renderIndex = 0;\n var hitIndex = 0;\n var hitColor;\n for (var featureUid in this.featureCache_) {\n featureCache = this.featureCache_[featureUid];\n geometry = /** @type {import(\"../../geom\").Point} */ (featureCache.geometry);\n if (!geometry || geometry.getType() !== GeometryType.POINT) {\n continue;\n }\n tmpCoords[0] = geometry.getFlatCoordinates()[0];\n tmpCoords[1] = geometry.getFlatCoordinates()[1];\n applyTransform(projectionTransform, tmpCoords);\n hitColor = colorEncodeId(hitIndex + 6, tmpColor);\n this.renderInstructions_[renderIndex++] = tmpCoords[0];\n this.renderInstructions_[renderIndex++] = tmpCoords[1];\n // for hit detection, the feature uid is saved in the opacity value\n // and the index of the opacity value is encoded in the color values\n if (this.hitDetectionEnabled_) {\n this.hitRenderInstructions_[hitIndex++] = tmpCoords[0];\n this.hitRenderInstructions_[hitIndex++] = tmpCoords[1];\n this.hitRenderInstructions_[hitIndex++] = hitColor[0];\n this.hitRenderInstructions_[hitIndex++] = hitColor[1];\n this.hitRenderInstructions_[hitIndex++] = hitColor[2];\n this.hitRenderInstructions_[hitIndex++] = hitColor[3];\n this.hitRenderInstructions_[hitIndex++] = Number(featureUid);\n }\n // pushing custom attributes\n var value = void 0;\n for (var j = 0; j < this.customAttributes.length; j++) {\n value = this.customAttributes[j].callback(featureCache.feature, featureCache.properties);\n this.renderInstructions_[renderIndex++] = value;\n if (this.hitDetectionEnabled_) {\n this.hitRenderInstructions_[hitIndex++] = value;\n }\n }\n }\n /** @type {import('./Layer').WebGLWorkerGenerateBuffersMessage} */\n var message = {\n type: WebGLWorkerMessageType.GENERATE_BUFFERS,\n renderInstructions: this.renderInstructions_.buffer,\n customAttributesCount: this.customAttributes.length\n };\n // additional properties will be sent back as-is by the worker\n message['projectionTransform'] = projectionTransform;\n this.worker_.postMessage(message, [this.renderInstructions_.buffer]);\n this.renderInstructions_ = null;\n /** @type {import('./Layer').WebGLWorkerGenerateBuffersMessage} */\n if (this.hitDetectionEnabled_) {\n var hitMessage = {\n type: WebGLWorkerMessageType.GENERATE_BUFFERS,\n renderInstructions: this.hitRenderInstructions_.buffer,\n customAttributesCount: 5 + this.customAttributes.length\n };\n hitMessage['projectionTransform'] = projectionTransform;\n hitMessage['hitDetection'] = true;\n this.worker_.postMessage(hitMessage, [this.hitRenderInstructions_.buffer]);\n this.hitRenderInstructions_ = null;\n }\n };\n /**\n * @inheritDoc\n */\n WebGLPointsLayerRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, callback, declutteredFeatures) {\n assert(this.hitDetectionEnabled_, 66);\n if (!this.hitRenderInstructions_) {\n return;\n }\n var pixel = applyTransform(frameState.coordinateToPixelTransform, coordinate.slice());\n var data = this.hitRenderTarget_.readPixel(pixel[0] / 2, pixel[1] / 2);\n var color = [\n data[0] / 255,\n data[1] / 255,\n data[2] / 255,\n data[3] / 255\n ];\n var index = colorDecodeId(color);\n var opacity = this.hitRenderInstructions_[index];\n var uid = Math.floor(opacity).toString();\n var source = this.getLayer().getSource();\n var feature = source.getFeatureByUid(uid);\n if (feature) {\n return callback(feature, this.getLayer());\n }\n };\n /**\n * Render the hit detection data to the corresponding render target\n * @param {import(\"../../PluggableMap.js\").FrameState} frameState current frame state\n */\n WebGLPointsLayerRenderer.prototype.renderHitDetection = function (frameState) {\n // skip render entirely if vertex buffers not ready/generated yet\n if (!this.hitVerticesBuffer_.getSize()) {\n return;\n }\n this.hitRenderTarget_.setSize([\n Math.floor(frameState.size[0] / 2),\n Math.floor(frameState.size[1] / 2)\n ]);\n this.helper.useProgram(this.hitProgram_);\n this.helper.prepareDrawToRenderTarget(frameState, this.hitRenderTarget_, true);\n this.helper.bindBuffer(this.hitVerticesBuffer_);\n this.helper.bindBuffer(this.indicesBuffer_);\n this.helper.enableAttributes(this.hitDetectionAttributes);\n var renderCount = this.indicesBuffer_.getSize();\n this.helper.drawElements(0, renderCount);\n };\n /**\n * @inheritDoc\n */\n WebGLPointsLayerRenderer.prototype.disposeInternal = function () {\n this.worker_.terminate();\n this.layer_ = null;\n this.sourceListenKeys_.forEach(function (key) {\n unlistenByKey(key);\n });\n this.sourceListenKeys_ = null;\n _super.prototype.disposeInternal.call(this);\n };\n return WebGLPointsLayerRenderer;\n}(WebGLLayerRenderer));\nexport default WebGLPointsLayerRenderer;\n//# sourceMappingURL=PointsLayer.js.map","/**\n * @module ol/render/canvas/Instruction\n */\n/**\n * @enum {number}\n */\nvar Instruction = {\n BEGIN_GEOMETRY: 0,\n BEGIN_PATH: 1,\n CIRCLE: 2,\n CLOSE_PATH: 3,\n CUSTOM: 4,\n DRAW_CHARS: 5,\n DRAW_IMAGE: 6,\n END_GEOMETRY: 7,\n FILL: 8,\n MOVE_TO_LINE_TO: 9,\n SET_FILL_STYLE: 10,\n SET_STROKE_STYLE: 11,\n STROKE: 12\n};\n/**\n * @type {Array<Instruction>}\n */\nexport var fillInstruction = [Instruction.FILL];\n/**\n * @type {Array<Instruction>}\n */\nexport var strokeInstruction = [Instruction.STROKE];\n/**\n * @type {Array<Instruction>}\n */\nexport var beginPathInstruction = [Instruction.BEGIN_PATH];\n/**\n * @type {Array<Instruction>}\n */\nexport var closePathInstruction = [Instruction.CLOSE_PATH];\nexport default Instruction;\n//# sourceMappingURL=Instruction.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/render/canvas/Builder\n */\nimport { equals, reverseSubArray } from '../../array.js';\nimport { asColorLike } from '../../colorlike.js';\nimport { buffer, clone, coordinateRelationship } from '../../extent.js';\nimport Relationship from '../../extent/Relationship.js';\nimport GeometryType from '../../geom/GeometryType.js';\nimport { inflateCoordinates, inflateCoordinatesArray, inflateMultiCoordinatesArray } from '../../geom/flat/inflate.js';\nimport VectorContext from '../VectorContext.js';\nimport { defaultFillStyle, defaultStrokeStyle, defaultMiterLimit, defaultLineWidth, defaultLineJoin, defaultLineDashOffset, defaultLineDash, defaultLineCap } from '../canvas.js';\nimport CanvasInstruction from './Instruction.js';\n/**\n * @typedef {Object} SerializableInstructions\n * @property {Array<*>} instructions The rendering instructions.\n * @property {Array<*>} hitDetectionInstructions The rendering hit detection instructions.\n * @property {Array<number>} coordinates The array of all coordinates.\n * @property {!Object<string, import(\"../canvas.js\").TextState>} [textStates] The text states (decluttering).\n * @property {!Object<string, import(\"../canvas.js\").FillState>} [fillStates] The fill states (decluttering).\n * @property {!Object<string, import(\"../canvas.js\").StrokeState>} [strokeStates] The stroke states (decluttering).\n */\nvar CanvasBuilder = /** @class */ (function (_super) {\n __extends(CanvasBuilder, _super);\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n function CanvasBuilder(tolerance, maxExtent, resolution, pixelRatio) {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {number}\n */\n _this.tolerance = tolerance;\n /**\n * @protected\n * @const\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.maxExtent = maxExtent;\n /**\n * @protected\n * @type {number}\n */\n _this.pixelRatio = pixelRatio;\n /**\n * @protected\n * @type {number}\n */\n _this.maxLineWidth = 0;\n /**\n * @protected\n * @const\n * @type {number}\n */\n _this.resolution = resolution;\n /**\n * @private\n * @type {Array<*>}\n */\n _this.beginGeometryInstruction1_ = null;\n /**\n * @private\n * @type {Array<*>}\n */\n _this.beginGeometryInstruction2_ = null;\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.bufferedMaxExtent_ = null;\n /**\n * @protected\n * @type {Array<*>}\n */\n _this.instructions = [];\n /**\n * @protected\n * @type {Array<number>}\n */\n _this.coordinates = [];\n /**\n * @private\n * @type {import(\"../../coordinate.js\").Coordinate}\n */\n _this.tmpCoordinate_ = [];\n /**\n * @protected\n * @type {Array<*>}\n */\n _this.hitDetectionInstructions = [];\n /**\n * @protected\n * @type {import(\"../canvas.js\").FillStrokeState}\n */\n _this.state = /** @type {import(\"../canvas.js\").FillStrokeState} */ ({});\n return _this;\n }\n /**\n * @protected\n * @param {Array<number>} dashArray Dash array.\n * @return {Array<number>} Dash array with pixel ratio applied\n */\n CanvasBuilder.prototype.applyPixelRatio = function (dashArray) {\n var pixelRatio = this.pixelRatio;\n return pixelRatio == 1 ? dashArray : dashArray.map(function (dash) {\n return dash * pixelRatio;\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 {boolean} closed Last input coordinate equals first.\n * @param {boolean} skipFirst Skip first coordinate.\n * @protected\n * @return {number} My end.\n */\n CanvasBuilder.prototype.appendFlatCoordinates = function (flatCoordinates, offset, end, stride, closed, skipFirst) {\n var myEnd = this.coordinates.length;\n var extent = this.getBufferedMaxExtent();\n if (skipFirst) {\n offset += stride;\n }\n var lastXCoord = flatCoordinates[offset];\n var lastYCoord = flatCoordinates[offset + 1];\n var nextCoord = this.tmpCoordinate_;\n var skipped = true;\n var i, lastRel, nextRel;\n for (i = offset + stride; i < end; i += stride) {\n nextCoord[0] = flatCoordinates[i];\n nextCoord[1] = flatCoordinates[i + 1];\n nextRel = coordinateRelationship(extent, nextCoord);\n if (nextRel !== lastRel) {\n if (skipped) {\n this.coordinates[myEnd++] = lastXCoord;\n this.coordinates[myEnd++] = lastYCoord;\n }\n this.coordinates[myEnd++] = nextCoord[0];\n this.coordinates[myEnd++] = nextCoord[1];\n skipped = false;\n }\n else if (nextRel === Relationship.INTERSECTING) {\n this.coordinates[myEnd++] = nextCoord[0];\n this.coordinates[myEnd++] = nextCoord[1];\n skipped = false;\n }\n else {\n skipped = true;\n }\n lastXCoord = nextCoord[0];\n lastYCoord = nextCoord[1];\n lastRel = nextRel;\n }\n // Last coordinate equals first or only one point to append:\n if ((closed && skipped) || i === offset + stride) {\n this.coordinates[myEnd++] = lastXCoord;\n this.coordinates[myEnd++] = lastYCoord;\n }\n return myEnd;\n };\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<number>} builderEnds Builder ends.\n * @return {number} Offset.\n */\n CanvasBuilder.prototype.drawCustomCoordinates_ = function (flatCoordinates, offset, ends, stride, builderEnds) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var builderEnd = this.appendFlatCoordinates(flatCoordinates, offset, end, stride, false, false);\n builderEnds.push(builderEnd);\n offset = end;\n }\n return offset;\n };\n /**\n * @inheritDoc.\n */\n CanvasBuilder.prototype.drawCustom = function (geometry, feature, renderer) {\n this.beginGeometry(geometry, feature);\n var type = geometry.getType();\n var stride = geometry.getStride();\n var builderBegin = this.coordinates.length;\n var flatCoordinates, builderEnd, builderEnds, builderEndss;\n var offset;\n if (type == GeometryType.MULTI_POLYGON) {\n geometry = /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (geometry);\n flatCoordinates = geometry.getOrientedFlatCoordinates();\n builderEndss = [];\n var endss = geometry.getEndss();\n offset = 0;\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var myEnds = [];\n offset = this.drawCustomCoordinates_(flatCoordinates, offset, endss[i], stride, myEnds);\n builderEndss.push(myEnds);\n }\n this.instructions.push([CanvasInstruction.CUSTOM,\n builderBegin, builderEndss, geometry, renderer, inflateMultiCoordinatesArray]);\n }\n else if (type == GeometryType.POLYGON || type == GeometryType.MULTI_LINE_STRING) {\n builderEnds = [];\n flatCoordinates = (type == GeometryType.POLYGON) ?\n /** @type {import(\"../../geom/Polygon.js\").default} */ (geometry).getOrientedFlatCoordinates() :\n geometry.getFlatCoordinates();\n offset = this.drawCustomCoordinates_(flatCoordinates, 0, \n /** @type {import(\"../../geom/Polygon.js\").default|import(\"../../geom/MultiLineString.js\").default} */ (geometry).getEnds(), stride, builderEnds);\n this.instructions.push([CanvasInstruction.CUSTOM,\n builderBegin, builderEnds, geometry, renderer, inflateCoordinatesArray]);\n }\n else if (type == GeometryType.LINE_STRING || type == GeometryType.MULTI_POINT) {\n flatCoordinates = geometry.getFlatCoordinates();\n builderEnd = this.appendFlatCoordinates(flatCoordinates, 0, flatCoordinates.length, stride, false, false);\n this.instructions.push([CanvasInstruction.CUSTOM,\n builderBegin, builderEnd, geometry, renderer, inflateCoordinates]);\n }\n else if (type == GeometryType.POINT) {\n flatCoordinates = geometry.getFlatCoordinates();\n this.coordinates.push(flatCoordinates[0], flatCoordinates[1]);\n builderEnd = this.coordinates.length;\n this.instructions.push([CanvasInstruction.CUSTOM,\n builderBegin, builderEnd, geometry, renderer]);\n }\n this.endGeometry(feature);\n };\n /**\n * @protected\n * @param {import(\"../../geom/Geometry\").default|import(\"../Feature.js\").default} geometry The geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n CanvasBuilder.prototype.beginGeometry = function (geometry, feature) {\n var extent = geometry.getExtent();\n this.beginGeometryInstruction1_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0, extent];\n this.instructions.push(this.beginGeometryInstruction1_);\n this.beginGeometryInstruction2_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0, extent];\n this.hitDetectionInstructions.push(this.beginGeometryInstruction2_);\n };\n /**\n * @return {SerializableInstructions} the serializable instructions.\n */\n CanvasBuilder.prototype.finish = function () {\n return {\n instructions: this.instructions,\n hitDetectionInstructions: this.hitDetectionInstructions,\n coordinates: this.coordinates\n };\n };\n /**\n * Reverse the hit detection instructions.\n */\n CanvasBuilder.prototype.reverseHitDetectionInstructions = function () {\n var hitDetectionInstructions = this.hitDetectionInstructions;\n // step 1 - reverse array\n hitDetectionInstructions.reverse();\n // step 2 - reverse instructions within geometry blocks\n var i;\n var n = hitDetectionInstructions.length;\n var instruction;\n var type;\n var begin = -1;\n for (i = 0; i < n; ++i) {\n instruction = hitDetectionInstructions[i];\n type = /** @type {CanvasInstruction} */ (instruction[0]);\n if (type == CanvasInstruction.END_GEOMETRY) {\n begin = i;\n }\n else if (type == CanvasInstruction.BEGIN_GEOMETRY) {\n instruction[2] = i;\n reverseSubArray(this.hitDetectionInstructions, begin, i);\n begin = -1;\n }\n }\n };\n /**\n * @inheritDoc\n */\n CanvasBuilder.prototype.setFillStrokeStyle = function (fillStyle, strokeStyle) {\n var state = this.state;\n if (fillStyle) {\n var fillStyleColor = fillStyle.getColor();\n state.fillStyle = asColorLike(fillStyleColor ?\n fillStyleColor : defaultFillStyle);\n }\n else {\n state.fillStyle = undefined;\n }\n if (strokeStyle) {\n var strokeStyleColor = strokeStyle.getColor();\n state.strokeStyle = asColorLike(strokeStyleColor ?\n strokeStyleColor : defaultStrokeStyle);\n var strokeStyleLineCap = strokeStyle.getLineCap();\n state.lineCap = strokeStyleLineCap !== undefined ?\n strokeStyleLineCap : defaultLineCap;\n var strokeStyleLineDash = strokeStyle.getLineDash();\n state.lineDash = strokeStyleLineDash ?\n strokeStyleLineDash.slice() : defaultLineDash;\n var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();\n state.lineDashOffset = strokeStyleLineDashOffset ?\n strokeStyleLineDashOffset : defaultLineDashOffset;\n var strokeStyleLineJoin = strokeStyle.getLineJoin();\n state.lineJoin = strokeStyleLineJoin !== undefined ?\n strokeStyleLineJoin : defaultLineJoin;\n var strokeStyleWidth = strokeStyle.getWidth();\n state.lineWidth = strokeStyleWidth !== undefined ?\n strokeStyleWidth : defaultLineWidth;\n var strokeStyleMiterLimit = strokeStyle.getMiterLimit();\n state.miterLimit = strokeStyleMiterLimit !== undefined ?\n strokeStyleMiterLimit : defaultMiterLimit;\n if (state.lineWidth > this.maxLineWidth) {\n this.maxLineWidth = state.lineWidth;\n // invalidate the buffered max extent cache\n this.bufferedMaxExtent_ = null;\n }\n }\n else {\n state.strokeStyle = undefined;\n state.lineCap = undefined;\n state.lineDash = null;\n state.lineDashOffset = undefined;\n state.lineJoin = undefined;\n state.lineWidth = undefined;\n state.miterLimit = undefined;\n }\n };\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {Array<*>} Fill instruction.\n */\n CanvasBuilder.prototype.createFill = function (state) {\n var fillStyle = state.fillStyle;\n /** @type {Array<*>} */\n var fillInstruction = [CanvasInstruction.SET_FILL_STYLE, fillStyle];\n if (typeof fillStyle !== 'string') {\n // Fill is a pattern or gradient - align it!\n fillInstruction.push(true);\n }\n return fillInstruction;\n };\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n */\n CanvasBuilder.prototype.applyStroke = function (state) {\n this.instructions.push(this.createStroke(state));\n };\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {Array<*>} Stroke instruction.\n */\n CanvasBuilder.prototype.createStroke = function (state) {\n return [\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle, state.lineWidth * this.pixelRatio, state.lineCap,\n state.lineJoin, state.miterLimit,\n this.applyPixelRatio(state.lineDash), state.lineDashOffset * this.pixelRatio\n ];\n };\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @param {function(this:CanvasBuilder, import(\"../canvas.js\").FillStrokeState):Array<*>} createFill Create fill.\n */\n CanvasBuilder.prototype.updateFillStyle = function (state, createFill) {\n var fillStyle = state.fillStyle;\n if (typeof fillStyle !== 'string' || state.currentFillStyle != fillStyle) {\n if (fillStyle !== undefined) {\n this.instructions.push(createFill.call(this, state));\n }\n state.currentFillStyle = fillStyle;\n }\n };\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @param {function(this:CanvasBuilder, import(\"../canvas.js\").FillStrokeState): void} applyStroke Apply stroke.\n */\n CanvasBuilder.prototype.updateStrokeStyle = function (state, applyStroke) {\n var strokeStyle = state.strokeStyle;\n var lineCap = state.lineCap;\n var lineDash = state.lineDash;\n var lineDashOffset = state.lineDashOffset;\n var lineJoin = state.lineJoin;\n var lineWidth = state.lineWidth;\n var miterLimit = state.miterLimit;\n if (state.currentStrokeStyle != strokeStyle ||\n state.currentLineCap != lineCap ||\n (lineDash != state.currentLineDash && !equals(state.currentLineDash, lineDash)) ||\n state.currentLineDashOffset != lineDashOffset ||\n state.currentLineJoin != lineJoin ||\n state.currentLineWidth != lineWidth ||\n state.currentMiterLimit != miterLimit) {\n if (strokeStyle !== undefined) {\n applyStroke.call(this, state);\n }\n state.currentStrokeStyle = strokeStyle;\n state.currentLineCap = lineCap;\n state.currentLineDash = lineDash;\n state.currentLineDashOffset = lineDashOffset;\n state.currentLineJoin = lineJoin;\n state.currentLineWidth = lineWidth;\n state.currentMiterLimit = miterLimit;\n }\n };\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n CanvasBuilder.prototype.endGeometry = function (feature) {\n this.beginGeometryInstruction1_[2] = this.instructions.length;\n this.beginGeometryInstruction1_ = null;\n this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;\n this.beginGeometryInstruction2_ = null;\n var endGeometryInstruction = [CanvasInstruction.END_GEOMETRY, feature];\n this.instructions.push(endGeometryInstruction);\n this.hitDetectionInstructions.push(endGeometryInstruction);\n };\n /**\n * Get the buffered rendering extent. Rendering will be clipped to the extent\n * provided to the constructor. To account for symbolizers that may intersect\n * this extent, we calculate a buffered extent (e.g. based on stroke width).\n * @return {import(\"../../extent.js\").Extent} The buffered rendering extent.\n * @protected\n */\n CanvasBuilder.prototype.getBufferedMaxExtent = function () {\n if (!this.bufferedMaxExtent_) {\n this.bufferedMaxExtent_ = clone(this.maxExtent);\n if (this.maxLineWidth > 0) {\n var width = this.resolution * (this.maxLineWidth + 1) / 2;\n buffer(this.bufferedMaxExtent_, width, this.bufferedMaxExtent_);\n }\n }\n return this.bufferedMaxExtent_;\n };\n return CanvasBuilder;\n}(VectorContext));\nexport default CanvasBuilder;\n//# sourceMappingURL=Builder.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/render/canvas/ImageBuilder\n */\nimport CanvasInstruction from './Instruction.js';\nimport CanvasBuilder from './Builder.js';\nvar CanvasImageBuilder = /** @class */ (function (_super) {\n __extends(CanvasImageBuilder, _super);\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n function CanvasImageBuilder(tolerance, maxExtent, resolution, pixelRatio) {\n var _this = _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;\n /**\n * @private\n * @type {import(\"../canvas.js\").DeclutterGroups}\n */\n _this.declutterGroups_ = null;\n /**\n * @private\n * @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement}\n */\n _this.hitDetectionImage_ = null;\n /**\n * @private\n * @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement}\n */\n _this.image_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.anchorX_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.anchorY_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.height_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.opacity_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.originX_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.originY_ = undefined;\n /**\n * @private\n * @type {boolean|undefined}\n */\n _this.rotateWithView_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.rotation_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.scale_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.width_ = undefined;\n return _this;\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 * @private\n * @return {number} My end.\n */\n CanvasImageBuilder.prototype.drawCoordinates_ = function (flatCoordinates, offset, end, stride) {\n return this.appendFlatCoordinates(flatCoordinates, offset, end, stride, false, false);\n };\n /**\n * @inheritDoc\n */\n CanvasImageBuilder.prototype.drawPoint = function (pointGeometry, feature) {\n if (!this.image_) {\n return;\n }\n this.beginGeometry(pointGeometry, feature);\n var flatCoordinates = pointGeometry.getFlatCoordinates();\n var stride = pointGeometry.getStride();\n var myBegin = this.coordinates.length;\n var myEnd = this.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, stride);\n this.instructions.push([\n CanvasInstruction.DRAW_IMAGE, myBegin, myEnd, this.image_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_, this.anchorY_, this.declutterGroups_, this.height_, this.opacity_,\n this.originX_, this.originY_, this.rotateWithView_, this.rotation_,\n this.scale_ * this.pixelRatio, this.width_\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.DRAW_IMAGE, myBegin, myEnd, this.hitDetectionImage_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_, this.anchorY_, this.declutterGroups_, this.height_, this.opacity_,\n this.originX_, this.originY_, this.rotateWithView_, this.rotation_,\n this.scale_, this.width_\n ]);\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasImageBuilder.prototype.drawMultiPoint = function (multiPointGeometry, feature) {\n if (!this.image_) {\n return;\n }\n this.beginGeometry(multiPointGeometry, feature);\n var flatCoordinates = multiPointGeometry.getFlatCoordinates();\n var stride = multiPointGeometry.getStride();\n var myBegin = this.coordinates.length;\n var myEnd = this.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, stride);\n this.instructions.push([\n CanvasInstruction.DRAW_IMAGE, myBegin, myEnd, this.image_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_, this.anchorY_, this.declutterGroups_, this.height_, this.opacity_,\n this.originX_, this.originY_, this.rotateWithView_, this.rotation_,\n this.scale_ * this.pixelRatio, this.width_\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.DRAW_IMAGE, myBegin, myEnd, this.hitDetectionImage_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_, this.anchorY_, this.declutterGroups_, this.height_, this.opacity_,\n this.originX_, this.originY_, this.rotateWithView_, this.rotation_,\n this.scale_, this.width_\n ]);\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasImageBuilder.prototype.finish = function () {\n this.reverseHitDetectionInstructions();\n // FIXME this doesn't really protect us against further calls to draw*Geometry\n this.anchorX_ = undefined;\n this.anchorY_ = undefined;\n this.hitDetectionImage_ = null;\n this.image_ = null;\n this.height_ = undefined;\n this.scale_ = undefined;\n this.opacity_ = undefined;\n this.originX_ = undefined;\n this.originY_ = undefined;\n this.rotateWithView_ = undefined;\n this.rotation_ = undefined;\n this.width_ = undefined;\n return _super.prototype.finish.call(this);\n };\n /**\n * @inheritDoc\n */\n CanvasImageBuilder.prototype.setImageStyle = function (imageStyle, declutterGroups) {\n var anchor = imageStyle.getAnchor();\n var size = imageStyle.getSize();\n var hitDetectionImage = imageStyle.getHitDetectionImage(1);\n var image = imageStyle.getImage(1);\n var origin = imageStyle.getOrigin();\n this.anchorX_ = anchor[0];\n this.anchorY_ = anchor[1];\n this.declutterGroups_ = /** @type {import(\"../canvas.js\").DeclutterGroups} */ (declutterGroups);\n this.hitDetectionImage_ = hitDetectionImage;\n this.image_ = image;\n this.height_ = size[1];\n this.opacity_ = imageStyle.getOpacity();\n this.originX_ = origin[0];\n this.originY_ = origin[1];\n this.rotateWithView_ = imageStyle.getRotateWithView();\n this.rotation_ = imageStyle.getRotation();\n this.scale_ = imageStyle.getScale();\n this.width_ = size[0];\n };\n return CanvasImageBuilder;\n}(CanvasBuilder));\nexport default CanvasImageBuilder;\n//# sourceMappingURL=ImageBuilder.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/render/canvas/LineStringBuilder\n */\nimport CanvasInstruction, { strokeInstruction, beginPathInstruction } from './Instruction.js';\nimport CanvasBuilder from './Builder.js';\nvar CanvasLineStringBuilder = /** @class */ (function (_super) {\n __extends(CanvasLineStringBuilder, _super);\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n function CanvasLineStringBuilder(tolerance, maxExtent, resolution, pixelRatio) {\n return _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;\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 * @private\n * @return {number} end.\n */\n CanvasLineStringBuilder.prototype.drawFlatCoordinates_ = function (flatCoordinates, offset, end, stride) {\n var myBegin = this.coordinates.length;\n var myEnd = this.appendFlatCoordinates(flatCoordinates, offset, end, stride, false, false);\n var moveToLineToInstruction = [CanvasInstruction.MOVE_TO_LINE_TO, myBegin, myEnd];\n this.instructions.push(moveToLineToInstruction);\n this.hitDetectionInstructions.push(moveToLineToInstruction);\n return end;\n };\n /**\n * @inheritDoc\n */\n CanvasLineStringBuilder.prototype.drawLineString = function (lineStringGeometry, feature) {\n var state = this.state;\n var strokeStyle = state.strokeStyle;\n var lineWidth = state.lineWidth;\n if (strokeStyle === undefined || lineWidth === undefined) {\n return;\n }\n this.updateStrokeStyle(state, this.applyStroke);\n this.beginGeometry(lineStringGeometry, feature);\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,\n state.miterLimit, state.lineDash, state.lineDashOffset\n ], beginPathInstruction);\n var flatCoordinates = lineStringGeometry.getFlatCoordinates();\n var stride = lineStringGeometry.getStride();\n this.drawFlatCoordinates_(flatCoordinates, 0, flatCoordinates.length, stride);\n this.hitDetectionInstructions.push(strokeInstruction);\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasLineStringBuilder.prototype.drawMultiLineString = function (multiLineStringGeometry, feature) {\n var state = this.state;\n var strokeStyle = state.strokeStyle;\n var lineWidth = state.lineWidth;\n if (strokeStyle === undefined || lineWidth === undefined) {\n return;\n }\n this.updateStrokeStyle(state, this.applyStroke);\n this.beginGeometry(multiLineStringGeometry, feature);\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,\n state.miterLimit, state.lineDash, state.lineDashOffset\n ], beginPathInstruction);\n var ends = multiLineStringGeometry.getEnds();\n var flatCoordinates = multiLineStringGeometry.getFlatCoordinates();\n var stride = multiLineStringGeometry.getStride();\n var offset = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.drawFlatCoordinates_(flatCoordinates, offset, ends[i], stride);\n }\n this.hitDetectionInstructions.push(strokeInstruction);\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasLineStringBuilder.prototype.finish = function () {\n var state = this.state;\n if (state.lastStroke != undefined && state.lastStroke != this.coordinates.length) {\n this.instructions.push(strokeInstruction);\n }\n this.reverseHitDetectionInstructions();\n this.state = null;\n return _super.prototype.finish.call(this);\n };\n /**\n * @inheritDoc.\n */\n CanvasLineStringBuilder.prototype.applyStroke = function (state) {\n if (state.lastStroke != undefined && state.lastStroke != this.coordinates.length) {\n this.instructions.push(strokeInstruction);\n state.lastStroke = this.coordinates.length;\n }\n state.lastStroke = 0;\n _super.prototype.applyStroke.call(this, state);\n this.instructions.push(beginPathInstruction);\n };\n return CanvasLineStringBuilder;\n}(CanvasBuilder));\nexport default CanvasLineStringBuilder;\n//# sourceMappingURL=LineStringBuilder.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/render/canvas/PolygonBuilder\n */\nimport { snap } from '../../geom/flat/simplify.js';\nimport { defaultFillStyle } from '../canvas.js';\nimport CanvasInstruction, { fillInstruction, strokeInstruction, beginPathInstruction, closePathInstruction } from './Instruction.js';\nimport CanvasBuilder from './Builder.js';\nvar CanvasPolygonBuilder = /** @class */ (function (_super) {\n __extends(CanvasPolygonBuilder, _super);\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n function CanvasPolygonBuilder(tolerance, maxExtent, resolution, pixelRatio) {\n return _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;\n }\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @private\n * @return {number} End.\n */\n CanvasPolygonBuilder.prototype.drawFlatCoordinatess_ = function (flatCoordinates, offset, ends, stride) {\n var state = this.state;\n var fill = state.fillStyle !== undefined;\n var stroke = state.strokeStyle !== undefined;\n var numEnds = ends.length;\n this.instructions.push(beginPathInstruction);\n this.hitDetectionInstructions.push(beginPathInstruction);\n for (var i = 0; i < numEnds; ++i) {\n var end = ends[i];\n var myBegin = this.coordinates.length;\n var myEnd = this.appendFlatCoordinates(flatCoordinates, offset, end, stride, true, !stroke);\n var moveToLineToInstruction = [CanvasInstruction.MOVE_TO_LINE_TO, myBegin, myEnd];\n this.instructions.push(moveToLineToInstruction);\n this.hitDetectionInstructions.push(moveToLineToInstruction);\n if (stroke) {\n // Performance optimization: only call closePath() when we have a stroke.\n // Otherwise the ring is closed already (see appendFlatCoordinates above).\n this.instructions.push(closePathInstruction);\n this.hitDetectionInstructions.push(closePathInstruction);\n }\n offset = end;\n }\n if (fill) {\n this.instructions.push(fillInstruction);\n this.hitDetectionInstructions.push(fillInstruction);\n }\n if (stroke) {\n this.instructions.push(strokeInstruction);\n this.hitDetectionInstructions.push(strokeInstruction);\n }\n return offset;\n };\n /**\n * @inheritDoc\n */\n CanvasPolygonBuilder.prototype.drawCircle = function (circleGeometry, feature) {\n var state = this.state;\n var fillStyle = state.fillStyle;\n var strokeStyle = state.strokeStyle;\n if (fillStyle === undefined && strokeStyle === undefined) {\n return;\n }\n this.setFillStrokeStyles_();\n this.beginGeometry(circleGeometry, feature);\n if (state.fillStyle !== undefined) {\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_FILL_STYLE,\n defaultFillStyle\n ]);\n }\n if (state.strokeStyle !== undefined) {\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,\n state.miterLimit, state.lineDash, state.lineDashOffset\n ]);\n }\n var flatCoordinates = circleGeometry.getFlatCoordinates();\n var stride = circleGeometry.getStride();\n var myBegin = this.coordinates.length;\n this.appendFlatCoordinates(flatCoordinates, 0, flatCoordinates.length, stride, false, false);\n var circleInstruction = [CanvasInstruction.CIRCLE, myBegin];\n this.instructions.push(beginPathInstruction, circleInstruction);\n this.hitDetectionInstructions.push(beginPathInstruction, circleInstruction);\n if (state.fillStyle !== undefined) {\n this.instructions.push(fillInstruction);\n this.hitDetectionInstructions.push(fillInstruction);\n }\n if (state.strokeStyle !== undefined) {\n this.instructions.push(strokeInstruction);\n this.hitDetectionInstructions.push(strokeInstruction);\n }\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasPolygonBuilder.prototype.drawPolygon = function (polygonGeometry, feature) {\n var state = this.state;\n var fillStyle = state.fillStyle;\n var strokeStyle = state.strokeStyle;\n if (fillStyle === undefined && strokeStyle === undefined) {\n return;\n }\n this.setFillStrokeStyles_();\n this.beginGeometry(polygonGeometry, feature);\n if (state.fillStyle !== undefined) {\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_FILL_STYLE,\n defaultFillStyle\n ]);\n }\n if (state.strokeStyle !== undefined) {\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,\n state.miterLimit, state.lineDash, state.lineDashOffset\n ]);\n }\n var ends = polygonGeometry.getEnds();\n var flatCoordinates = polygonGeometry.getOrientedFlatCoordinates();\n var stride = polygonGeometry.getStride();\n this.drawFlatCoordinatess_(flatCoordinates, 0, ends, stride);\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasPolygonBuilder.prototype.drawMultiPolygon = function (multiPolygonGeometry, feature) {\n var state = this.state;\n var fillStyle = state.fillStyle;\n var strokeStyle = state.strokeStyle;\n if (fillStyle === undefined && strokeStyle === undefined) {\n return;\n }\n this.setFillStrokeStyles_();\n this.beginGeometry(multiPolygonGeometry, feature);\n if (state.fillStyle !== undefined) {\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_FILL_STYLE,\n defaultFillStyle\n ]);\n }\n if (state.strokeStyle !== undefined) {\n this.hitDetectionInstructions.push([\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,\n state.miterLimit, state.lineDash, state.lineDashOffset\n ]);\n }\n var endss = multiPolygonGeometry.getEndss();\n var flatCoordinates = multiPolygonGeometry.getOrientedFlatCoordinates();\n var stride = multiPolygonGeometry.getStride();\n var offset = 0;\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n offset = this.drawFlatCoordinatess_(flatCoordinates, offset, endss[i], stride);\n }\n this.endGeometry(feature);\n };\n /**\n * @inheritDoc\n */\n CanvasPolygonBuilder.prototype.finish = function () {\n this.reverseHitDetectionInstructions();\n this.state = null;\n // We want to preserve topology when drawing polygons. Polygons are\n // simplified using quantization and point elimination. However, we might\n // have received a mix of quantized and non-quantized geometries, so ensure\n // that all are quantized by quantizing all coordinates in the batch.\n var tolerance = this.tolerance;\n if (tolerance !== 0) {\n var coordinates = this.coordinates;\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n coordinates[i] = snap(coordinates[i], tolerance);\n }\n }\n return _super.prototype.finish.call(this);\n };\n /**\n * @private\n */\n CanvasPolygonBuilder.prototype.setFillStrokeStyles_ = function () {\n var state = this.state;\n var fillStyle = state.fillStyle;\n if (fillStyle !== undefined) {\n this.updateFillStyle(state, this.createFill);\n }\n if (state.strokeStyle !== undefined) {\n this.updateStrokeStyle(state, this.applyStroke);\n }\n };\n return CanvasPolygonBuilder;\n}(CanvasBuilder));\nexport default CanvasPolygonBuilder;\n//# sourceMappingURL=PolygonBuilder.js.map","/**\n * @module ol/geom/flat/straightchunk\n */\n/**\n * @param {number} maxAngle Maximum acceptable angle delta between segments.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Array<number>} Start and end of the first suitable chunk of the\n * given `flatCoordinates`.\n */\nexport function matchingChunk(maxAngle, flatCoordinates, offset, end, stride) {\n var chunkStart = offset;\n var chunkEnd = offset;\n var chunkM = 0;\n var m = 0;\n var start = offset;\n var acos, i, m12, m23, x1, y1, x12, y12, x23, y23;\n for (i = offset; i < end; i += stride) {\n var x2 = flatCoordinates[i];\n var y2 = flatCoordinates[i + 1];\n if (x1 !== undefined) {\n x23 = x2 - x1;\n y23 = y2 - y1;\n m23 = Math.sqrt(x23 * x23 + y23 * y23);\n if (x12 !== undefined) {\n m += m12;\n acos = Math.acos((x12 * x23 + y12 * y23) / (m12 * m23));\n if (acos > maxAngle) {\n if (m > chunkM) {\n chunkM = m;\n chunkStart = start;\n chunkEnd = i;\n }\n m = 0;\n start = i - stride;\n }\n }\n m12 = m23;\n x12 = x23;\n y12 = y23;\n }\n x1 = x2;\n y1 = y2;\n }\n m += m23;\n return m > chunkM ? [start, i] : [chunkStart, chunkEnd];\n}\n//# sourceMappingURL=straightchunk.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/render/canvas/TextBuilder\n */\nimport { getUid } from '../../util.js';\nimport { asColorLike } from '../../colorlike.js';\nimport { intersects } from '../../extent.js';\nimport { matchingChunk } from '../../geom/flat/straightchunk.js';\nimport GeometryType from '../../geom/GeometryType.js';\nimport { labelCache, defaultTextAlign, defaultPadding, defaultLineCap, defaultLineDashOffset, defaultLineDash, defaultLineJoin, defaultFillStyle, checkFont, defaultFont, defaultLineWidth, defaultMiterLimit, defaultStrokeStyle, defaultTextBaseline } from '../canvas.js';\nimport CanvasInstruction from './Instruction.js';\nimport CanvasBuilder from './Builder.js';\nimport TextPlacement from '../../style/TextPlacement.js';\n/**\n * @const\n * @enum {number}\n */\nexport var TEXT_ALIGN = {\n 'left': 0,\n 'end': 0,\n 'center': 0.5,\n 'right': 1,\n 'start': 1,\n 'top': 0,\n 'middle': 0.5,\n 'hanging': 0.2,\n 'alphabetic': 0.8,\n 'ideographic': 0.8,\n 'bottom': 1\n};\nvar CanvasTextBuilder = /** @class */ (function (_super) {\n __extends(CanvasTextBuilder, _super);\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n function CanvasTextBuilder(tolerance, maxExtent, resolution, pixelRatio) {\n var _this = _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;\n /**\n * @private\n * @type {import(\"../canvas.js\").DeclutterGroups}\n */\n _this.declutterGroups_;\n /**\n * @private\n * @type {Array<HTMLCanvasElement>}\n */\n _this.labels_ = null;\n /**\n * @private\n * @type {string}\n */\n _this.text_ = '';\n /**\n * @private\n * @type {number}\n */\n _this.textOffsetX_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.textOffsetY_ = 0;\n /**\n * @private\n * @type {boolean|undefined}\n */\n _this.textRotateWithView_ = undefined;\n /**\n * @private\n * @type {number}\n */\n _this.textRotation_ = 0;\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n _this.textFillState_ = null;\n /**\n * @type {!Object<string, import(\"../canvas.js\").FillState>}\n */\n _this.fillStates = {};\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n _this.textStrokeState_ = null;\n /**\n * @type {!Object<string, import(\"../canvas.js\").StrokeState>}\n */\n _this.strokeStates = {};\n /**\n * @private\n * @type {import(\"../canvas.js\").TextState}\n */\n _this.textState_ = /** @type {import(\"../canvas.js\").TextState} */ ({});\n /**\n * @type {!Object<string, import(\"../canvas.js\").TextState>}\n */\n _this.textStates = {};\n /**\n * @private\n * @type {string}\n */\n _this.textKey_ = '';\n /**\n * @private\n * @type {string}\n */\n _this.fillKey_ = '';\n /**\n * @private\n * @type {string}\n */\n _this.strokeKey_ = '';\n labelCache.prune();\n return _this;\n }\n /**\n * @inheritDoc\n */\n CanvasTextBuilder.prototype.finish = function () {\n var instructions = _super.prototype.finish.call(this);\n instructions.textStates = this.textStates;\n instructions.fillStates = this.fillStates;\n instructions.strokeStates = this.strokeStates;\n return instructions;\n };\n /**\n * @inheritDoc\n */\n CanvasTextBuilder.prototype.drawText = function (geometry, feature) {\n var fillState = this.textFillState_;\n var strokeState = this.textStrokeState_;\n var textState = this.textState_;\n if (this.text_ === '' || !textState || (!fillState && !strokeState)) {\n return;\n }\n var begin = this.coordinates.length;\n var geometryType = geometry.getType();\n var flatCoordinates = null;\n var end = 2;\n var stride = 2;\n var i, ii;\n if (textState.placement === TextPlacement.LINE) {\n if (!intersects(this.getBufferedMaxExtent(), geometry.getExtent())) {\n return;\n }\n var ends = void 0;\n flatCoordinates = geometry.getFlatCoordinates();\n stride = geometry.getStride();\n if (geometryType == GeometryType.LINE_STRING) {\n ends = [flatCoordinates.length];\n }\n else if (geometryType == GeometryType.MULTI_LINE_STRING) {\n ends = geometry.getEnds();\n }\n else if (geometryType == GeometryType.POLYGON) {\n ends = geometry.getEnds().slice(0, 1);\n }\n else if (geometryType == GeometryType.MULTI_POLYGON) {\n var endss = geometry.getEndss();\n ends = [];\n for (i = 0, ii = endss.length; i < ii; ++i) {\n ends.push(endss[i][0]);\n }\n }\n this.beginGeometry(geometry, feature);\n var textAlign = textState.textAlign;\n var flatOffset = 0;\n var flatEnd = void 0;\n for (var o = 0, oo = ends.length; o < oo; ++o) {\n if (textAlign == undefined) {\n var range = matchingChunk(textState.maxAngle, flatCoordinates, flatOffset, ends[o], stride);\n flatOffset = range[0];\n flatEnd = range[1];\n }\n else {\n flatEnd = ends[o];\n }\n for (i = flatOffset; i < flatEnd; i += stride) {\n this.coordinates.push(flatCoordinates[i], flatCoordinates[i + 1]);\n }\n end = this.coordinates.length;\n flatOffset = ends[o];\n var declutterGroup = this.declutterGroups_ ?\n (o === 0 ? this.declutterGroups_[0] : [].concat(this.declutterGroups_[0])) :\n null;\n this.drawChars_(begin, end, declutterGroup);\n begin = end;\n }\n this.endGeometry(feature);\n }\n else {\n var geometryWidths = null;\n if (!textState.overflow) {\n geometryWidths = [];\n }\n switch (geometryType) {\n case GeometryType.POINT:\n case GeometryType.MULTI_POINT:\n flatCoordinates = geometry.getFlatCoordinates();\n end = flatCoordinates.length;\n break;\n case GeometryType.LINE_STRING:\n flatCoordinates = /** @type {import(\"../../geom/LineString.js\").default} */ (geometry).getFlatMidpoint();\n break;\n case GeometryType.CIRCLE:\n flatCoordinates = /** @type {import(\"../../geom/Circle.js\").default} */ (geometry).getCenter();\n break;\n case GeometryType.MULTI_LINE_STRING:\n flatCoordinates = /** @type {import(\"../../geom/MultiLineString.js\").default} */ (geometry).getFlatMidpoints();\n end = flatCoordinates.length;\n break;\n case GeometryType.POLYGON:\n flatCoordinates = /** @type {import(\"../../geom/Polygon.js\").default} */ (geometry).getFlatInteriorPoint();\n if (!textState.overflow) {\n geometryWidths.push(flatCoordinates[2] / this.resolution);\n }\n stride = 3;\n break;\n case GeometryType.MULTI_POLYGON:\n var interiorPoints = /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (geometry).getFlatInteriorPoints();\n flatCoordinates = [];\n for (i = 0, ii = interiorPoints.length; i < ii; i += 3) {\n if (!textState.overflow) {\n geometryWidths.push(interiorPoints[i + 2] / this.resolution);\n }\n flatCoordinates.push(interiorPoints[i], interiorPoints[i + 1]);\n }\n end = flatCoordinates.length;\n if (end == 0) {\n return;\n }\n break;\n default:\n }\n end = this.appendFlatCoordinates(flatCoordinates, 0, end, stride, false, false);\n this.saveTextStates_();\n if (textState.backgroundFill || textState.backgroundStroke) {\n this.setFillStrokeStyle(textState.backgroundFill, textState.backgroundStroke);\n if (textState.backgroundFill) {\n this.updateFillStyle(this.state, this.createFill);\n this.hitDetectionInstructions.push(this.createFill(this.state));\n }\n if (textState.backgroundStroke) {\n this.updateStrokeStyle(this.state, this.applyStroke);\n this.hitDetectionInstructions.push(this.createStroke(this.state));\n }\n }\n this.beginGeometry(geometry, feature);\n // The image is unknown at this stage so we pass null; it will be computed at render time.\n // For clarity, we pass NaN for offsetX, offsetY, width and height, which will be computed at\n // render time.\n var pixelRatio_1 = this.pixelRatio;\n this.instructions.push([CanvasInstruction.DRAW_IMAGE, begin, end,\n null, NaN, NaN, this.declutterGroups_, NaN, 1, 0, 0,\n this.textRotateWithView_, this.textRotation_, 1, NaN,\n textState.padding == defaultPadding ?\n defaultPadding : textState.padding.map(function (p) {\n return p * pixelRatio_1;\n }),\n !!textState.backgroundFill, !!textState.backgroundStroke,\n this.text_, this.textKey_, this.strokeKey_, this.fillKey_,\n this.textOffsetX_, this.textOffsetY_, geometryWidths\n ]);\n this.hitDetectionInstructions.push([CanvasInstruction.DRAW_IMAGE, begin, end,\n null, NaN, NaN, this.declutterGroups_, NaN, 1, 0, 0,\n this.textRotateWithView_, this.textRotation_, 1 / this.pixelRatio, NaN,\n textState.padding,\n !!textState.backgroundFill, !!textState.backgroundStroke,\n this.text_, this.textKey_, this.strokeKey_, this.fillKey_,\n this.textOffsetX_, this.textOffsetY_, geometryWidths\n ]);\n this.endGeometry(feature);\n }\n };\n /**\n * @private\n */\n CanvasTextBuilder.prototype.saveTextStates_ = function () {\n var strokeState = this.textStrokeState_;\n var textState = this.textState_;\n var fillState = this.textFillState_;\n var strokeKey = this.strokeKey_;\n if (strokeState) {\n if (!(strokeKey in this.strokeStates)) {\n this.strokeStates[strokeKey] = {\n strokeStyle: strokeState.strokeStyle,\n lineCap: strokeState.lineCap,\n lineDashOffset: strokeState.lineDashOffset,\n lineWidth: strokeState.lineWidth,\n lineJoin: strokeState.lineJoin,\n miterLimit: strokeState.miterLimit,\n lineDash: strokeState.lineDash\n };\n }\n }\n var textKey = this.textKey_;\n if (!(textKey in this.textStates)) {\n this.textStates[textKey] = {\n font: textState.font,\n textAlign: textState.textAlign || defaultTextAlign,\n textBaseline: textState.textBaseline || defaultTextBaseline,\n scale: textState.scale\n };\n }\n var fillKey = this.fillKey_;\n if (fillState) {\n if (!(fillKey in this.fillStates)) {\n this.fillStates[fillKey] = {\n fillStyle: fillState.fillStyle\n };\n }\n }\n };\n /**\n * @private\n * @param {number} begin Begin.\n * @param {number} end End.\n * @param {import(\"../canvas.js\").DeclutterGroup} declutterGroup Declutter group.\n */\n CanvasTextBuilder.prototype.drawChars_ = function (begin, end, declutterGroup) {\n var strokeState = this.textStrokeState_;\n var textState = this.textState_;\n var strokeKey = this.strokeKey_;\n var textKey = this.textKey_;\n var fillKey = this.fillKey_;\n this.saveTextStates_();\n var pixelRatio = this.pixelRatio;\n var baseline = TEXT_ALIGN[textState.textBaseline];\n var offsetY = this.textOffsetY_ * pixelRatio;\n var text = this.text_;\n var textScale = textState.scale;\n var strokeWidth = strokeState ? strokeState.lineWidth * textScale / 2 : 0;\n this.instructions.push([CanvasInstruction.DRAW_CHARS,\n begin, end, baseline, declutterGroup,\n textState.overflow, fillKey, textState.maxAngle,\n pixelRatio,\n offsetY, strokeKey, strokeWidth * pixelRatio, text, textKey, 1\n ]);\n this.hitDetectionInstructions.push([CanvasInstruction.DRAW_CHARS,\n begin, end, baseline, declutterGroup,\n textState.overflow, fillKey, textState.maxAngle,\n 1,\n offsetY, strokeKey, strokeWidth, text, textKey, 1 / pixelRatio\n ]);\n };\n /**\n * @inheritDoc\n */\n CanvasTextBuilder.prototype.setTextStyle = function (textStyle, declutterGroups) {\n var textState, fillState, strokeState;\n if (!textStyle) {\n this.text_ = '';\n }\n else {\n this.declutterGroups_ = /** @type {import(\"../canvas.js\").DeclutterGroups} */ (declutterGroups);\n var textFillStyle = textStyle.getFill();\n if (!textFillStyle) {\n fillState = null;\n this.textFillState_ = fillState;\n }\n else {\n fillState = this.textFillState_;\n if (!fillState) {\n fillState = /** @type {import(\"../canvas.js\").FillState} */ ({});\n this.textFillState_ = fillState;\n }\n fillState.fillStyle = asColorLike(textFillStyle.getColor() || defaultFillStyle);\n }\n var textStrokeStyle = textStyle.getStroke();\n if (!textStrokeStyle) {\n strokeState = null;\n this.textStrokeState_ = strokeState;\n }\n else {\n strokeState = this.textStrokeState_;\n if (!strokeState) {\n strokeState = /** @type {import(\"../canvas.js\").StrokeState} */ ({});\n this.textStrokeState_ = strokeState;\n }\n var lineDash = textStrokeStyle.getLineDash();\n var lineDashOffset = textStrokeStyle.getLineDashOffset();\n var lineWidth = textStrokeStyle.getWidth();\n var miterLimit = textStrokeStyle.getMiterLimit();\n strokeState.lineCap = textStrokeStyle.getLineCap() || defaultLineCap;\n strokeState.lineDash = lineDash ? lineDash.slice() : defaultLineDash;\n strokeState.lineDashOffset =\n lineDashOffset === undefined ? defaultLineDashOffset : lineDashOffset;\n strokeState.lineJoin = textStrokeStyle.getLineJoin() || defaultLineJoin;\n strokeState.lineWidth =\n lineWidth === undefined ? defaultLineWidth : lineWidth;\n strokeState.miterLimit =\n miterLimit === undefined ? defaultMiterLimit : miterLimit;\n strokeState.strokeStyle = asColorLike(textStrokeStyle.getColor() || defaultStrokeStyle);\n }\n textState = this.textState_;\n var font = textStyle.getFont() || defaultFont;\n checkFont(font);\n var textScale = textStyle.getScale();\n textState.overflow = textStyle.getOverflow();\n textState.font = font;\n textState.maxAngle = textStyle.getMaxAngle();\n textState.placement = textStyle.getPlacement();\n textState.textAlign = textStyle.getTextAlign();\n textState.textBaseline = textStyle.getTextBaseline() || defaultTextBaseline;\n textState.backgroundFill = textStyle.getBackgroundFill();\n textState.backgroundStroke = textStyle.getBackgroundStroke();\n textState.padding = textStyle.getPadding() || defaultPadding;\n textState.scale = textScale === undefined ? 1 : textScale;\n var textOffsetX = textStyle.getOffsetX();\n var textOffsetY = textStyle.getOffsetY();\n var textRotateWithView = textStyle.getRotateWithView();\n var textRotation = textStyle.getRotation();\n this.text_ = textStyle.getText() || '';\n this.textOffsetX_ = textOffsetX === undefined ? 0 : textOffsetX;\n this.textOffsetY_ = textOffsetY === undefined ? 0 : textOffsetY;\n this.textRotateWithView_ = textRotateWithView === undefined ? false : textRotateWithView;\n this.textRotation_ = textRotation === undefined ? 0 : textRotation;\n this.strokeKey_ = strokeState ?\n (typeof strokeState.strokeStyle == 'string' ? strokeState.strokeStyle : getUid(strokeState.strokeStyle)) +\n strokeState.lineCap + strokeState.lineDashOffset + '|' + strokeState.lineWidth +\n strokeState.lineJoin + strokeState.miterLimit + '[' + strokeState.lineDash.join() + ']' :\n '';\n this.textKey_ = textState.font + textState.scale + (textState.textAlign || '?');\n this.fillKey_ = fillState ?\n (typeof fillState.fillStyle == 'string' ? fillState.fillStyle : ('|' + getUid(fillState.fillStyle))) :\n '';\n }\n };\n return CanvasTextBuilder;\n}(CanvasBuilder));\nexport default CanvasTextBuilder;\n//# sourceMappingURL=TextBuilder.js.map","/**\n * @module ol/render/canvas/BuilderGroup\n */\nimport { createEmpty } from '../../extent.js';\nimport Builder from './Builder.js';\nimport ImageBuilder from './ImageBuilder.js';\nimport LineStringBuilder from './LineStringBuilder.js';\nimport PolygonBuilder from './PolygonBuilder.js';\nimport TextBuilder from './TextBuilder.js';\n/**\n * @type {Object<import(\"./BuilderType\").default, typeof Builder>}\n */\nvar BATCH_CONSTRUCTORS = {\n 'Circle': PolygonBuilder,\n 'Default': Builder,\n 'Image': ImageBuilder,\n 'LineString': LineStringBuilder,\n 'Polygon': PolygonBuilder,\n 'Text': TextBuilder\n};\nvar BuilderGroup = /** @class */ (function () {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Max extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {boolean} declutter Decluttering enabled.\n */\n function BuilderGroup(tolerance, maxExtent, resolution, pixelRatio, declutter) {\n /**\n * @type {boolean}\n * @private\n */\n this.declutter_ = declutter;\n /**\n * @type {import(\"../canvas.js\").DeclutterGroups}\n * @private\n */\n this.declutterGroups_ = null;\n /**\n * @private\n * @type {number}\n */\n this.tolerance_ = tolerance;\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.maxExtent_ = maxExtent;\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n /**\n * @private\n * @type {number}\n */\n this.resolution_ = resolution;\n /**\n * @private\n * @type {!Object<string, !Object<import(\"./BuilderType\").default, Builder>>}\n */\n this.buildersByZIndex_ = {};\n }\n /**\n * @param {boolean} group Group with previous builder.\n * @return {import(\"../canvas\").DeclutterGroups} The resulting instruction groups.\n */\n BuilderGroup.prototype.addDeclutter = function (group) {\n var declutter = null;\n if (this.declutter_) {\n if (group) {\n declutter = this.declutterGroups_;\n /** @type {number} */ (declutter[0][4])++;\n }\n else {\n declutter = [createEmpty()];\n this.declutterGroups_ = declutter;\n declutter[0].push(1);\n }\n }\n return declutter;\n };\n /**\n * @return {!Object<string, !Object<import(\"./BuilderType\").default, import(\"./Builder.js\").SerializableInstructions>>} The serializable instructions\n */\n BuilderGroup.prototype.finish = function () {\n var builderInstructions = {};\n for (var zKey in this.buildersByZIndex_) {\n builderInstructions[zKey] = builderInstructions[zKey] || {};\n var builders = this.buildersByZIndex_[zKey];\n for (var builderKey in builders) {\n var builderInstruction = builders[builderKey].finish();\n builderInstructions[zKey][builderKey] = builderInstruction;\n }\n }\n return builderInstructions;\n };\n /**\n * @param {number|undefined} zIndex Z index.\n * @param {import(\"./BuilderType.js\").default} builderType Replay type.\n * @return {import(\"../VectorContext.js\").default} Replay.\n */\n BuilderGroup.prototype.getBuilder = function (zIndex, builderType) {\n var zIndexKey = zIndex !== undefined ? zIndex.toString() : '0';\n var replays = this.buildersByZIndex_[zIndexKey];\n if (replays === undefined) {\n replays = {};\n this.buildersByZIndex_[zIndexKey] = replays;\n }\n var replay = replays[builderType];\n if (replay === undefined) {\n var Constructor = BATCH_CONSTRUCTORS[builderType];\n replay = new Constructor(this.tolerance_, this.maxExtent_, this.resolution_, this.pixelRatio_);\n replays[builderType] = replay;\n }\n return replay;\n };\n return BuilderGroup;\n}());\nexport default BuilderGroup;\n//# sourceMappingURL=BuilderGroup.js.map","/**\n * @module ol/geom/flat/length\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 * @return {number} Length.\n */\nexport function lineStringLength(flatCoordinates, offset, end, stride) {\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n var length = 0;\n for (var i = offset + stride; i < end; i += stride) {\n var x2 = flatCoordinates[i];\n var y2 = flatCoordinates[i + 1];\n length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n x1 = x2;\n y1 = y2;\n }\n return length;\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 * @return {number} Perimeter.\n */\nexport function linearRingLength(flatCoordinates, offset, end, stride) {\n var perimeter = lineStringLength(flatCoordinates, offset, end, stride);\n var dx = flatCoordinates[end - stride] - flatCoordinates[offset];\n var dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1];\n perimeter += Math.sqrt(dx * dx + dy * dy);\n return perimeter;\n}\n//# sourceMappingURL=length.js.map","/**\n * @module ol/geom/flat/textpath\n */\nimport { lerp } from '../../math.js';\n/**\n * @param {Array<number>} flatCoordinates Path to put text on.\n * @param {number} offset Start offset of the `flatCoordinates`.\n * @param {number} end End offset of the `flatCoordinates`.\n * @param {number} stride Stride.\n * @param {string} text Text to place on the path.\n * @param {number} startM m along the path where the text starts.\n * @param {number} maxAngle Max angle between adjacent chars in radians.\n * @param {number} scale The product of the text scale and the device pixel ratio.\n * @param {function(string, string, Object<string, number>):number} measureAndCacheTextWidth Measure and cache text width.\n * @param {string} font The font.\n * @param {Object<string, number>} cache A cache of measured widths.\n * @return {Array<Array<*>>} The result array (or null if `maxAngle` was\n * exceeded). Entries of the array are x, y, anchorX, angle, chunk.\n */\nexport function drawTextOnPath(flatCoordinates, offset, end, stride, text, startM, maxAngle, scale, measureAndCacheTextWidth, font, cache) {\n var result = [];\n // Keep text upright\n var reverse = flatCoordinates[offset] > flatCoordinates[end - stride];\n var numChars = text.length;\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n offset += stride;\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n var segmentM = 0;\n var segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n var angleChanged = false;\n var index, previousAngle;\n for (var i = 0; i < numChars; ++i) {\n index = reverse ? numChars - i - 1 : i;\n var char = text[index];\n var charLength = scale * measureAndCacheTextWidth(font, char, cache);\n var charM = startM + charLength / 2;\n while (offset < end - stride && segmentM + segmentLength < charM) {\n x1 = x2;\n y1 = y2;\n offset += stride;\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n segmentM += segmentLength;\n segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n }\n var segmentPos = charM - segmentM;\n var angle = Math.atan2(y2 - y1, x2 - x1);\n if (reverse) {\n angle += angle > 0 ? -Math.PI : Math.PI;\n }\n if (previousAngle !== undefined) {\n var delta = angle - previousAngle;\n angleChanged = angleChanged || delta !== 0;\n delta += (delta > Math.PI) ? -2 * Math.PI : (delta < -Math.PI) ? 2 * Math.PI : 0;\n if (Math.abs(delta) > maxAngle) {\n return null;\n }\n }\n previousAngle = angle;\n var interpolate = segmentPos / segmentLength;\n var x = lerp(x1, x2, interpolate);\n var y = lerp(y1, y2, interpolate);\n result[index] = [x, y, charLength / 2, angle, char];\n startM += charLength;\n }\n return angleChanged ? result : [[result[0][0], result[0][1], result[0][2], result[0][3], text]];\n}\n//# sourceMappingURL=textpath.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/render/canvas/Executor\n */\nimport { equals } from '../../array.js';\nimport { createEmpty, createOrUpdate, createOrUpdateEmpty, extend, intersects } from '../../extent.js';\nimport { lineStringLength } from '../../geom/flat/length.js';\nimport { drawTextOnPath } from '../../geom/flat/textpath.js';\nimport { transform2D } from '../../geom/flat/transform.js';\nimport { drawImage, defaultPadding, defaultTextBaseline } from '../canvas.js';\nimport CanvasInstruction from './Instruction.js';\nimport { TEXT_ALIGN } from './TextBuilder.js';\nimport { create as createTransform, compose as composeTransform, apply as applyTransform, setFromArray as transformSetFromArray } from '../../transform.js';\nimport { createCanvasContext2D } from '../../dom.js';\nimport { labelCache, defaultTextAlign, measureTextHeight, measureAndCacheTextWidth, measureTextWidths } from '../canvas.js';\nimport Disposable from '../../Disposable.js';\nimport RBush from 'rbush';\n/**\n * @typedef {Object} SerializableInstructions\n * @property {Array<*>} instructions The rendering instructions.\n * @property {Array<*>} hitDetectionInstructions The rendering hit detection instructions.\n * @property {Array<number>} coordinates The array of all coordinates.\n * @property {!Object<string, import(\"../canvas.js\").TextState>} textStates The text states (decluttering).\n * @property {!Object<string, import(\"../canvas.js\").FillState>} fillStates The fill states (decluttering).\n * @property {!Object<string, import(\"../canvas.js\").StrokeState>} strokeStates The stroke states (decluttering).\n */\n/**\n * @type {import(\"../../extent.js\").Extent}\n */\nvar tmpExtent = createEmpty();\n/**\n * @type {!import(\"../../transform.js\").Transform}\n */\nvar tmpTransform = createTransform();\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nvar p1 = [];\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nvar p2 = [];\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nvar p3 = [];\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nvar p4 = [];\nvar Executor = /** @class */ (function (_super) {\n __extends(Executor, _super);\n /**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {boolean} overlaps The replay can have overlapping geometries.\n * @param {SerializableInstructions} instructions The serializable instructions\n */\n function Executor(resolution, pixelRatio, overlaps, instructions) {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {boolean}\n */\n _this.overlaps = overlaps;\n /**\n * @protected\n * @type {number}\n */\n _this.pixelRatio = pixelRatio;\n /**\n * @protected\n * @const\n * @type {number}\n */\n _this.resolution = resolution;\n /**\n * @private\n * @type {boolean}\n */\n _this.alignFill_;\n /**\n * @type {Array<*>}\n */\n _this.declutterItems = [];\n /**\n * @protected\n * @type {Array<*>}\n */\n _this.instructions = instructions.instructions;\n /**\n * @protected\n * @type {Array<number>}\n */\n _this.coordinates = instructions.coordinates;\n /**\n * @private\n * @type {!Object<number,import(\"../../coordinate.js\").Coordinate|Array<import(\"../../coordinate.js\").Coordinate>|Array<Array<import(\"../../coordinate.js\").Coordinate>>>}\n */\n _this.coordinateCache_ = {};\n /**\n * @private\n * @type {!import(\"../../transform.js\").Transform}\n */\n _this.renderedTransform_ = createTransform();\n /**\n * @protected\n * @type {Array<*>}\n */\n _this.hitDetectionInstructions = instructions.hitDetectionInstructions;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.pixelCoordinates_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.viewRotation_ = 0;\n /**\n * @type {!Object<string, import(\"../canvas.js\").FillState>}\n */\n _this.fillStates = instructions.fillStates || {};\n /**\n * @type {!Object<string, import(\"../canvas.js\").StrokeState>}\n */\n _this.strokeStates = instructions.strokeStates || {};\n /**\n * @type {!Object<string, import(\"../canvas.js\").TextState>}\n */\n _this.textStates = instructions.textStates || {};\n /**\n * @private\n * @type {Object<string, Object<string, number>>}\n */\n _this.widths_ = {};\n return _this;\n }\n /**\n * @inheritDoc\n */\n Executor.prototype.disposeInternal = function () {\n labelCache.release(this);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @param {string} text Text.\n * @param {string} textKey Text style key.\n * @param {string} fillKey Fill style key.\n * @param {string} strokeKey Stroke style key.\n * @return {HTMLCanvasElement} Image.\n */\n Executor.prototype.getTextImage = function (text, textKey, fillKey, strokeKey) {\n var label;\n var key = strokeKey + textKey + text + fillKey + this.pixelRatio;\n if (!labelCache.containsKey(key)) {\n var strokeState = strokeKey ? this.strokeStates[strokeKey] : null;\n var fillState = fillKey ? this.fillStates[fillKey] : null;\n var textState = this.textStates[textKey];\n var pixelRatio = this.pixelRatio;\n var scale = textState.scale * pixelRatio;\n var align = TEXT_ALIGN[textState.textAlign || defaultTextAlign];\n var strokeWidth = strokeKey && strokeState.lineWidth ? strokeState.lineWidth : 0;\n var lines = text.split('\\n');\n var numLines = lines.length;\n var widths = [];\n var width = measureTextWidths(textState.font, lines, widths);\n var lineHeight = measureTextHeight(textState.font);\n var height = lineHeight * numLines;\n var renderWidth = width + strokeWidth;\n var context = createCanvasContext2D(\n // make canvas 2 pixels wider to account for italic text width measurement errors\n Math.ceil((renderWidth + 2) * scale), Math.ceil((height + strokeWidth) * scale));\n label = context.canvas;\n labelCache.set(key, label);\n if (scale != 1) {\n context.scale(scale, scale);\n }\n context.font = textState.font;\n if (strokeKey) {\n context.strokeStyle = strokeState.strokeStyle;\n context.lineWidth = strokeWidth;\n context.lineCap = strokeState.lineCap;\n context.lineJoin = strokeState.lineJoin;\n context.miterLimit = strokeState.miterLimit;\n if (context.setLineDash && strokeState.lineDash.length) {\n context.setLineDash(strokeState.lineDash);\n context.lineDashOffset = strokeState.lineDashOffset;\n }\n }\n if (fillKey) {\n context.fillStyle = fillState.fillStyle;\n }\n context.textBaseline = 'middle';\n context.textAlign = 'center';\n var leftRight = (0.5 - align);\n var x = align * renderWidth + leftRight * strokeWidth;\n var i = void 0;\n if (strokeKey) {\n for (i = 0; i < numLines; ++i) {\n context.strokeText(lines[i], x + leftRight * widths[i], 0.5 * (strokeWidth + lineHeight) + i * lineHeight);\n }\n }\n if (fillKey) {\n for (i = 0; i < numLines; ++i) {\n context.fillText(lines[i], x + leftRight * widths[i], 0.5 * (strokeWidth + lineHeight) + i * lineHeight);\n }\n }\n }\n return labelCache.get(key, this);\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../coordinate.js\").Coordinate} p1 1st point of the background box.\n * @param {import(\"../../coordinate.js\").Coordinate} p2 2nd point of the background box.\n * @param {import(\"../../coordinate.js\").Coordinate} p3 3rd point of the background box.\n * @param {import(\"../../coordinate.js\").Coordinate} p4 4th point of the background box.\n * @param {Array<*>} fillInstruction Fill instruction.\n * @param {Array<*>} strokeInstruction Stroke instruction.\n */\n Executor.prototype.replayTextBackground_ = function (context, p1, p2, p3, p4, fillInstruction, strokeInstruction) {\n context.beginPath();\n context.moveTo.apply(context, p1);\n context.lineTo.apply(context, p2);\n context.lineTo.apply(context, p3);\n context.lineTo.apply(context, p4);\n context.lineTo.apply(context, p1);\n if (fillInstruction) {\n this.alignFill_ = /** @type {boolean} */ (fillInstruction[2]);\n this.fill_(context);\n }\n if (strokeInstruction) {\n this.setStrokeStyle_(context, /** @type {Array<*>} */ (strokeInstruction));\n context.stroke();\n }\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image Image.\n * @param {number} anchorX Anchor X.\n * @param {number} anchorY Anchor Y.\n * @param {import(\"../canvas.js\").DeclutterGroup} declutterGroup Declutter group.\n * @param {number} height Height.\n * @param {number} opacity Opacity.\n * @param {number} originX Origin X.\n * @param {number} originY Origin Y.\n * @param {number} rotation Rotation.\n * @param {number} scale Scale.\n * @param {boolean} snapToPixel Snap to pixel.\n * @param {number} width Width.\n * @param {Array<number>} padding Padding.\n * @param {Array<*>} fillInstruction Fill instruction.\n * @param {Array<*>} strokeInstruction Stroke instruction.\n */\n Executor.prototype.replayImage_ = function (context, x, y, image, anchorX, anchorY, declutterGroup, height, opacity, originX, originY, rotation, scale, snapToPixel, width, padding, fillInstruction, strokeInstruction) {\n var fillStroke = fillInstruction || strokeInstruction;\n anchorX *= scale;\n anchorY *= scale;\n x -= anchorX;\n y -= anchorY;\n var w = (width + originX > image.width) ? image.width - originX : width;\n var h = (height + originY > image.height) ? image.height - originY : height;\n var boxW = padding[3] + w * scale + padding[1];\n var boxH = padding[0] + h * scale + padding[2];\n var boxX = x - padding[3];\n var boxY = y - padding[0];\n if (fillStroke || rotation !== 0) {\n p1[0] = boxX;\n p4[0] = boxX;\n p1[1] = boxY;\n p2[1] = boxY;\n p2[0] = boxX + boxW;\n p3[0] = p2[0];\n p3[1] = boxY + boxH;\n p4[1] = p3[1];\n }\n var transform = null;\n if (rotation !== 0) {\n var centerX = x + anchorX;\n var centerY = y + anchorY;\n transform = composeTransform(tmpTransform, centerX, centerY, 1, 1, rotation, -centerX, -centerY);\n applyTransform(tmpTransform, p1);\n applyTransform(tmpTransform, p2);\n applyTransform(tmpTransform, p3);\n applyTransform(tmpTransform, p4);\n createOrUpdate(Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1]), tmpExtent);\n }\n else {\n createOrUpdate(boxX, boxY, boxX + boxW, boxY + boxH, tmpExtent);\n }\n var canvas = context.canvas;\n var strokePadding = strokeInstruction ? (strokeInstruction[2] * scale / 2) : 0;\n var intersects = tmpExtent[0] - strokePadding <= canvas.width && tmpExtent[2] + strokePadding >= 0 &&\n tmpExtent[1] - strokePadding <= canvas.height && tmpExtent[3] + strokePadding >= 0;\n if (snapToPixel) {\n x = Math.round(x);\n y = Math.round(y);\n }\n if (declutterGroup) {\n if (!intersects && declutterGroup[4] == 1) {\n return;\n }\n extend(declutterGroup, tmpExtent);\n var declutterArgs = intersects ?\n [context, transform ? transform.slice(0) : null, opacity, image, originX, originY, w, h, x, y, scale] :\n null;\n if (declutterArgs) {\n if (fillStroke) {\n declutterArgs.push(fillInstruction, strokeInstruction, p1, p2, p3, p4);\n }\n declutterGroup.push(declutterArgs);\n }\n }\n else if (intersects) {\n if (fillStroke) {\n this.replayTextBackground_(context, p1, p2, p3, p4, \n /** @type {Array<*>} */ (fillInstruction), \n /** @type {Array<*>} */ (strokeInstruction));\n }\n drawImage(context, transform, opacity, image, originX, originY, w, h, x, y, scale);\n }\n };\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n */\n Executor.prototype.fill_ = function (context) {\n if (this.alignFill_) {\n var origin_1 = applyTransform(this.renderedTransform_, [0, 0]);\n var repeatSize = 512 * this.pixelRatio;\n context.save();\n context.translate(origin_1[0] % repeatSize, origin_1[1] % repeatSize);\n context.rotate(this.viewRotation_);\n }\n context.fill();\n if (this.alignFill_) {\n context.restore();\n }\n };\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n * @param {Array<*>} instruction Instruction.\n */\n Executor.prototype.setStrokeStyle_ = function (context, instruction) {\n context.strokeStyle = /** @type {import(\"../../colorlike.js\").ColorLike} */ (instruction[1]);\n context.lineWidth = /** @type {number} */ (instruction[2]);\n context.lineCap = /** @type {CanvasLineCap} */ (instruction[3]);\n context.lineJoin = /** @type {CanvasLineJoin} */ (instruction[4]);\n context.miterLimit = /** @type {number} */ (instruction[5]);\n if (context.setLineDash) {\n context.lineDashOffset = /** @type {number} */ (instruction[7]);\n context.setLineDash(/** @type {Array<number>} */ (instruction[6]));\n }\n };\n /**\n * @param {import(\"../canvas.js\").DeclutterGroup} declutterGroup Declutter group.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {number} opacity Layer opacity.\n * @param {?} declutterTree Declutter tree.\n * @return {?} Declutter tree.\n */\n Executor.prototype.renderDeclutter = function (declutterGroup, feature, opacity, declutterTree) {\n if (declutterGroup && declutterGroup.length > 5) {\n var groupCount = declutterGroup[4];\n if (groupCount == 1 || groupCount == declutterGroup.length - 5) {\n /** @type {import(\"../../structs/RBush.js\").Entry} */\n var box = {\n minX: /** @type {number} */ (declutterGroup[0]),\n minY: /** @type {number} */ (declutterGroup[1]),\n maxX: /** @type {number} */ (declutterGroup[2]),\n maxY: /** @type {number} */ (declutterGroup[3]),\n value: feature\n };\n if (!declutterTree) {\n declutterTree = new RBush(9);\n }\n if (!declutterTree.collides(box)) {\n declutterTree.insert(box);\n for (var j = 5, jj = declutterGroup.length; j < jj; ++j) {\n var declutterData = /** @type {Array} */ (declutterGroup[j]);\n var context = declutterData[0];\n var currentAlpha = context.globalAlpha;\n if (currentAlpha !== opacity) {\n context.globalAlpha = opacity;\n }\n if (declutterData.length > 11) {\n this.replayTextBackground_(declutterData[0], declutterData[13], declutterData[14], declutterData[15], declutterData[16], declutterData[11], declutterData[12]);\n }\n drawImage.apply(undefined, declutterData);\n if (currentAlpha !== opacity) {\n context.globalAlpha = currentAlpha;\n }\n }\n }\n declutterGroup.length = 5;\n createOrUpdateEmpty(declutterGroup);\n }\n }\n return declutterTree;\n };\n /**\n * @private\n * @param {string} text The text to draw.\n * @param {string} textKey The key of the text state.\n * @param {string} strokeKey The key for the stroke state.\n * @param {string} fillKey The key for the fill state.\n * @return {{label: HTMLCanvasElement, anchorX: number, anchorY: number}} The text image and its anchor.\n */\n Executor.prototype.drawTextImageWithPointPlacement_ = function (text, textKey, strokeKey, fillKey) {\n var textState = this.textStates[textKey];\n var label = this.getTextImage(text, textKey, fillKey, strokeKey);\n var strokeState = this.strokeStates[strokeKey];\n var pixelRatio = this.pixelRatio;\n var align = TEXT_ALIGN[textState.textAlign || defaultTextAlign];\n var baseline = TEXT_ALIGN[textState.textBaseline || defaultTextBaseline];\n var strokeWidth = strokeState && strokeState.lineWidth ? strokeState.lineWidth : 0;\n // Remove the 2 pixels we added in getTextImage() for the anchor\n var width = label.width / pixelRatio - 2 * textState.scale;\n var anchorX = align * width + 2 * (0.5 - align) * strokeWidth;\n var anchorY = baseline * label.height / pixelRatio + 2 * (0.5 - baseline) * strokeWidth;\n return {\n label: label,\n anchorX: anchorX,\n anchorY: anchorY\n };\n };\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {Array<*>} instructions Instructions array.\n * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.\n * @param {function(import(\"../../Feature.js\").FeatureLike): T|undefined} featureCallback Feature callback.\n * @param {import(\"../../extent.js\").Extent=} opt_hitExtent Only check features that intersect this\n * extent.\n * @return {T|undefined} Callback result.\n * @template T\n */\n Executor.prototype.execute_ = function (context, transform, instructions, snapToPixel, featureCallback, opt_hitExtent) {\n this.declutterItems.length = 0;\n /** @type {Array<number>} */\n var pixelCoordinates;\n if (this.pixelCoordinates_ && equals(transform, this.renderedTransform_)) {\n pixelCoordinates = this.pixelCoordinates_;\n }\n else {\n if (!this.pixelCoordinates_) {\n this.pixelCoordinates_ = [];\n }\n pixelCoordinates = transform2D(this.coordinates, 0, this.coordinates.length, 2, transform, this.pixelCoordinates_);\n transformSetFromArray(this.renderedTransform_, transform);\n }\n var i = 0; // instruction index\n var ii = instructions.length; // end of instructions\n var d = 0; // data index\n var dd; // end of per-instruction data\n var anchorX, anchorY, prevX, prevY, roundX, roundY, declutterGroup, declutterGroups, image, text, textKey;\n var strokeKey, fillKey;\n var pendingFill = 0;\n var pendingStroke = 0;\n var lastFillInstruction = null;\n var lastStrokeInstruction = null;\n var coordinateCache = this.coordinateCache_;\n var viewRotation = this.viewRotation_;\n var viewRotationFromTransform = Math.round(Math.atan2(-transform[1], transform[0]) * 1e12) / 1e12;\n var state = /** @type {import(\"../../render.js\").State} */ ({\n context: context,\n pixelRatio: this.pixelRatio,\n resolution: this.resolution,\n rotation: viewRotation\n });\n // When the batch size gets too big, performance decreases. 200 is a good\n // balance between batch size and number of fill/stroke instructions.\n var batchSize = this.instructions != instructions || this.overlaps ? 0 : 200;\n var /** @type {import(\"../../Feature.js\").FeatureLike} */ feature;\n var x, y;\n while (i < ii) {\n var instruction = instructions[i];\n var type = /** @type {CanvasInstruction} */ (instruction[0]);\n switch (type) {\n case CanvasInstruction.BEGIN_GEOMETRY:\n feature = /** @type {import(\"../../Feature.js\").FeatureLike} */ (instruction[1]);\n if (!feature.getGeometry()) {\n i = /** @type {number} */ (instruction[2]);\n }\n else if (opt_hitExtent !== undefined && !intersects(opt_hitExtent, instruction[3])) {\n i = /** @type {number} */ (instruction[2]) + 1;\n }\n else {\n ++i;\n }\n break;\n case CanvasInstruction.BEGIN_PATH:\n if (pendingFill > batchSize) {\n this.fill_(context);\n pendingFill = 0;\n }\n if (pendingStroke > batchSize) {\n context.stroke();\n pendingStroke = 0;\n }\n if (!pendingFill && !pendingStroke) {\n context.beginPath();\n prevX = NaN;\n prevY = NaN;\n }\n ++i;\n break;\n case CanvasInstruction.CIRCLE:\n d = /** @type {number} */ (instruction[1]);\n var x1 = pixelCoordinates[d];\n var y1 = pixelCoordinates[d + 1];\n var x2 = pixelCoordinates[d + 2];\n var y2 = pixelCoordinates[d + 3];\n var dx = x2 - x1;\n var dy = y2 - y1;\n var r = Math.sqrt(dx * dx + dy * dy);\n context.moveTo(x1 + r, y1);\n context.arc(x1, y1, r, 0, 2 * Math.PI, true);\n ++i;\n break;\n case CanvasInstruction.CLOSE_PATH:\n context.closePath();\n ++i;\n break;\n case CanvasInstruction.CUSTOM:\n d = /** @type {number} */ (instruction[1]);\n dd = instruction[2];\n var geometry = /** @type {import(\"../../geom/SimpleGeometry.js\").default} */ (instruction[3]);\n var renderer = instruction[4];\n var fn = instruction.length == 6 ? instruction[5] : undefined;\n state.geometry = geometry;\n state.feature = feature;\n if (!(i in coordinateCache)) {\n coordinateCache[i] = [];\n }\n var coords = coordinateCache[i];\n if (fn) {\n fn(pixelCoordinates, d, dd, 2, coords);\n }\n else {\n coords[0] = pixelCoordinates[d];\n coords[1] = pixelCoordinates[d + 1];\n coords.length = 2;\n }\n renderer(coords, state);\n ++i;\n break;\n case CanvasInstruction.DRAW_IMAGE:\n d = /** @type {number} */ (instruction[1]);\n dd = /** @type {number} */ (instruction[2]);\n image = /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */ (instruction[3]);\n // Remaining arguments in DRAW_IMAGE are in alphabetical order\n anchorX = /** @type {number} */ (instruction[4]);\n anchorY = /** @type {number} */ (instruction[5]);\n declutterGroups = featureCallback ? null : instruction[6];\n var height = /** @type {number} */ (instruction[7]);\n var opacity = /** @type {number} */ (instruction[8]);\n var originX = /** @type {number} */ (instruction[9]);\n var originY = /** @type {number} */ (instruction[10]);\n var rotateWithView = /** @type {boolean} */ (instruction[11]);\n var rotation = /** @type {number} */ (instruction[12]);\n var scale = /** @type {number} */ (instruction[13]);\n var width = /** @type {number} */ (instruction[14]);\n if (!image && instruction.length >= 19) {\n // create label images\n text = /** @type {string} */ (instruction[18]);\n textKey = /** @type {string} */ (instruction[19]);\n strokeKey = /** @type {string} */ (instruction[20]);\n fillKey = /** @type {string} */ (instruction[21]);\n var labelWithAnchor = this.drawTextImageWithPointPlacement_(text, textKey, strokeKey, fillKey);\n image = labelWithAnchor.label;\n instruction[3] = image;\n var textOffsetX = /** @type {number} */ (instruction[22]);\n anchorX = (labelWithAnchor.anchorX - textOffsetX) * this.pixelRatio;\n instruction[4] = anchorX;\n var textOffsetY = /** @type {number} */ (instruction[23]);\n anchorY = (labelWithAnchor.anchorY - textOffsetY) * this.pixelRatio;\n instruction[5] = anchorY;\n height = image.height;\n instruction[7] = height;\n width = image.width;\n instruction[14] = width;\n }\n var geometryWidths = void 0;\n if (instruction.length > 24) {\n geometryWidths = /** @type {number} */ (instruction[24]);\n }\n var padding = void 0, backgroundFill = void 0, backgroundStroke = void 0;\n if (instruction.length > 16) {\n padding = /** @type {Array<number>} */ (instruction[15]);\n backgroundFill = /** @type {boolean} */ (instruction[16]);\n backgroundStroke = /** @type {boolean} */ (instruction[17]);\n }\n else {\n padding = defaultPadding;\n backgroundFill = false;\n backgroundStroke = false;\n }\n if (rotateWithView && viewRotationFromTransform) {\n // Canvas is expected to be rotated to reverse view rotation.\n rotation += viewRotation;\n }\n else if (!rotateWithView && !viewRotationFromTransform) {\n // Canvas is not rotated, images need to be rotated back to be north-up.\n rotation -= viewRotation;\n }\n var widthIndex = 0;\n var declutterGroupIndex = 0;\n for (; d < dd; d += 2) {\n if (geometryWidths && geometryWidths[widthIndex++] < width / this.pixelRatio) {\n continue;\n }\n if (declutterGroups) {\n var index = Math.floor(declutterGroupIndex);\n if (declutterGroups.length < index + 1) {\n declutterGroup = createEmpty();\n declutterGroup.push(declutterGroups[0][4]);\n declutterGroups.push(declutterGroup);\n }\n declutterGroup = declutterGroups[index];\n }\n this.replayImage_(context, pixelCoordinates[d], pixelCoordinates[d + 1], image, anchorX, anchorY, declutterGroup, height, opacity, originX, originY, rotation, scale, snapToPixel, width, padding, backgroundFill ? /** @type {Array<*>} */ (lastFillInstruction) : null, backgroundStroke ? /** @type {Array<*>} */ (lastStrokeInstruction) : null);\n if (declutterGroup) {\n if (declutterGroupIndex === Math.floor(declutterGroupIndex)) {\n this.declutterItems.push(this, declutterGroup, feature);\n }\n declutterGroupIndex += 1 / declutterGroup[4];\n }\n }\n ++i;\n break;\n case CanvasInstruction.DRAW_CHARS:\n var begin = /** @type {number} */ (instruction[1]);\n var end = /** @type {number} */ (instruction[2]);\n var baseline = /** @type {number} */ (instruction[3]);\n declutterGroup = featureCallback ? null : instruction[4];\n var overflow = /** @type {number} */ (instruction[5]);\n fillKey = /** @type {string} */ (instruction[6]);\n var maxAngle = /** @type {number} */ (instruction[7]);\n var measurePixelRatio = /** @type {number} */ (instruction[8]);\n var offsetY = /** @type {number} */ (instruction[9]);\n strokeKey = /** @type {string} */ (instruction[10]);\n var strokeWidth = /** @type {number} */ (instruction[11]);\n text = /** @type {string} */ (instruction[12]);\n textKey = /** @type {string} */ (instruction[13]);\n var pixelRatioScale = /** @type {number} */ (instruction[14]);\n var textState = this.textStates[textKey];\n var font = textState.font;\n var textScale = textState.scale * measurePixelRatio;\n var cachedWidths = void 0;\n if (font in this.widths_) {\n cachedWidths = this.widths_[font];\n }\n else {\n cachedWidths = {};\n this.widths_[font] = cachedWidths;\n }\n var pathLength = lineStringLength(pixelCoordinates, begin, end, 2);\n var textLength = textScale * measureAndCacheTextWidth(font, text, cachedWidths);\n if (overflow || textLength <= pathLength) {\n var textAlign = this.textStates[textKey].textAlign;\n var startM = (pathLength - textLength) * TEXT_ALIGN[textAlign];\n var parts = drawTextOnPath(pixelCoordinates, begin, end, 2, text, startM, maxAngle, textScale, measureAndCacheTextWidth, font, cachedWidths);\n if (parts) {\n var c = void 0, cc = void 0, chars = void 0, label = void 0, part = void 0;\n if (strokeKey) {\n for (c = 0, cc = parts.length; c < cc; ++c) {\n part = parts[c]; // x, y, anchorX, rotation, chunk\n chars = /** @type {string} */ (part[4]);\n label = this.getTextImage(chars, textKey, '', strokeKey);\n anchorX = /** @type {number} */ (part[2]) + strokeWidth;\n anchorY = baseline * label.height + (0.5 - baseline) * 2 * strokeWidth - offsetY;\n this.replayImage_(context, \n /** @type {number} */ (part[0]), /** @type {number} */ (part[1]), label, anchorX, anchorY, declutterGroup, label.height, 1, 0, 0, \n /** @type {number} */ (part[3]), pixelRatioScale, false, label.width, defaultPadding, null, null);\n }\n }\n if (fillKey) {\n for (c = 0, cc = parts.length; c < cc; ++c) {\n part = parts[c]; // x, y, anchorX, rotation, chunk\n chars = /** @type {string} */ (part[4]);\n label = this.getTextImage(chars, textKey, fillKey, '');\n anchorX = /** @type {number} */ (part[2]);\n anchorY = baseline * label.height - offsetY;\n this.replayImage_(context, \n /** @type {number} */ (part[0]), /** @type {number} */ (part[1]), label, anchorX, anchorY, declutterGroup, label.height, 1, 0, 0, \n /** @type {number} */ (part[3]), pixelRatioScale, false, label.width, defaultPadding, null, null);\n }\n }\n }\n }\n this.declutterItems.push(this, declutterGroup, feature);\n ++i;\n break;\n case CanvasInstruction.END_GEOMETRY:\n if (featureCallback !== undefined) {\n feature = /** @type {import(\"../../Feature.js\").FeatureLike} */ (instruction[1]);\n var result = featureCallback(feature);\n if (result) {\n return result;\n }\n }\n ++i;\n break;\n case CanvasInstruction.FILL:\n if (batchSize) {\n pendingFill++;\n }\n else {\n this.fill_(context);\n }\n ++i;\n break;\n case CanvasInstruction.MOVE_TO_LINE_TO:\n d = /** @type {number} */ (instruction[1]);\n dd = /** @type {number} */ (instruction[2]);\n x = pixelCoordinates[d];\n y = pixelCoordinates[d + 1];\n roundX = (x + 0.5) | 0;\n roundY = (y + 0.5) | 0;\n if (roundX !== prevX || roundY !== prevY) {\n context.moveTo(x, y);\n prevX = roundX;\n prevY = roundY;\n }\n for (d += 2; d < dd; d += 2) {\n x = pixelCoordinates[d];\n y = pixelCoordinates[d + 1];\n roundX = (x + 0.5) | 0;\n roundY = (y + 0.5) | 0;\n if (d == dd - 2 || roundX !== prevX || roundY !== prevY) {\n context.lineTo(x, y);\n prevX = roundX;\n prevY = roundY;\n }\n }\n ++i;\n break;\n case CanvasInstruction.SET_FILL_STYLE:\n lastFillInstruction = instruction;\n this.alignFill_ = instruction[2];\n if (pendingFill) {\n this.fill_(context);\n pendingFill = 0;\n if (pendingStroke) {\n context.stroke();\n pendingStroke = 0;\n }\n }\n context.fillStyle = /** @type {import(\"../../colorlike.js\").ColorLike} */ (instruction[1]);\n ++i;\n break;\n case CanvasInstruction.SET_STROKE_STYLE:\n lastStrokeInstruction = instruction;\n if (pendingStroke) {\n context.stroke();\n pendingStroke = 0;\n }\n this.setStrokeStyle_(context, /** @type {Array<*>} */ (instruction));\n ++i;\n break;\n case CanvasInstruction.STROKE:\n if (batchSize) {\n pendingStroke++;\n }\n else {\n context.stroke();\n }\n ++i;\n break;\n default:\n ++i; // consume the instruction anyway, to avoid an infinite loop\n break;\n }\n }\n if (pendingFill) {\n this.fill_(context);\n }\n if (pendingStroke) {\n context.stroke();\n }\n return undefined;\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.\n */\n Executor.prototype.execute = function (context, transform, viewRotation, snapToPixel) {\n this.viewRotation_ = viewRotation;\n this.execute_(context, transform, this.instructions, snapToPixel, undefined, undefined);\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {function(import(\"../../Feature.js\").FeatureLike): T=} opt_featureCallback\n * Feature callback.\n * @param {import(\"../../extent.js\").Extent=} opt_hitExtent Only check features that intersect this\n * extent.\n * @return {T|undefined} Callback result.\n * @template T\n */\n Executor.prototype.executeHitDetection = function (context, transform, viewRotation, opt_featureCallback, opt_hitExtent) {\n this.viewRotation_ = viewRotation;\n return this.execute_(context, transform, this.hitDetectionInstructions, true, opt_featureCallback, opt_hitExtent);\n };\n return Executor;\n}(Disposable));\nexport default Executor;\n//# sourceMappingURL=Executor.js.map","/**\n * @module ol/render/canvas/ExecutorGroup\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { numberSafeCompareFunction } from '../../array.js';\nimport { createCanvasContext2D } from '../../dom.js';\nimport { buffer, createEmpty, extendCoordinate } from '../../extent.js';\nimport { transform2D } from '../../geom/flat/transform.js';\nimport { isEmpty } from '../../obj.js';\nimport BuilderType from './BuilderType.js';\nimport { create as createTransform, compose as composeTransform } from '../../transform.js';\nimport Executor from './Executor.js';\nimport Disposable from '../../Disposable.js';\n/**\n * @const\n * @type {Array<BuilderType>}\n */\nvar ORDER = [\n BuilderType.POLYGON,\n BuilderType.CIRCLE,\n BuilderType.LINE_STRING,\n BuilderType.IMAGE,\n BuilderType.TEXT,\n BuilderType.DEFAULT\n];\nvar ExecutorGroup = /** @class */ (function (_super) {\n __extends(ExecutorGroup, _super);\n /**\n * @param {import(\"../../extent.js\").Extent} maxExtent Max extent for clipping. When a\n * `maxExtent` was set on the Buillder for this executor group, the same `maxExtent`\n * should be set here, unless the target context does not exceet that extent (which\n * can be the case when rendering to tiles).\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {boolean} overlaps The executor group can have overlapping geometries.\n * @param {!Object<string, !Object<BuilderType, import(\"./Builder.js\").SerializableInstructions>>} allInstructions\n * The serializable instructions.\n * @param {number=} opt_renderBuffer Optional rendering buffer.\n */\n function ExecutorGroup(maxExtent, resolution, pixelRatio, overlaps, allInstructions, opt_renderBuffer) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.maxExtent_ = maxExtent;\n /**\n * @private\n * @type {boolean}\n */\n _this.overlaps_ = overlaps;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ = pixelRatio;\n /**\n * @private\n * @type {number}\n */\n _this.resolution_ = resolution;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.renderBuffer_ = opt_renderBuffer;\n /**\n * @private\n * @type {!Object<string, !Object<BuilderType, import(\"./Executor\").default>>}\n */\n _this.executorsByZIndex_ = {};\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n _this.hitDetectionContext_ = null;\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.hitDetectionTransform_ = createTransform();\n _this.createExecutors_(allInstructions);\n return _this;\n }\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n */\n ExecutorGroup.prototype.clip = function (context, transform) {\n var flatClipCoords = this.getClipCoords(transform);\n context.beginPath();\n context.moveTo(flatClipCoords[0], flatClipCoords[1]);\n context.lineTo(flatClipCoords[2], flatClipCoords[3]);\n context.lineTo(flatClipCoords[4], flatClipCoords[5]);\n context.lineTo(flatClipCoords[6], flatClipCoords[7]);\n context.clip();\n };\n /**\n * Create executors and populate them using the provided instructions.\n * @private\n * @param {!Object<string, !Object<BuilderType, import(\"./Builder.js\").SerializableInstructions>>} allInstructions The serializable instructions\n */\n ExecutorGroup.prototype.createExecutors_ = function (allInstructions) {\n for (var zIndex in allInstructions) {\n var executors = this.executorsByZIndex_[zIndex];\n if (executors === undefined) {\n executors = {};\n this.executorsByZIndex_[zIndex] = executors;\n }\n var instructionByZindex = allInstructions[zIndex];\n for (var builderType in instructionByZindex) {\n var instructions = instructionByZindex[builderType];\n executors[builderType] = new Executor(this.resolution_, this.pixelRatio_, this.overlaps_, instructions);\n }\n }\n };\n /**\n * @inheritDoc\n */\n ExecutorGroup.prototype.disposeInternal = function () {\n for (var z in this.executorsByZIndex_) {\n var executors = this.executorsByZIndex_[z];\n for (var key in executors) {\n executors[key].disposeInternal();\n }\n }\n if (this.hitDetectionContext_) {\n var canvas = this.hitDetectionContext_.canvas;\n canvas.width = 0;\n canvas.height = 0;\n }\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @param {Array<BuilderType>} executors Executors.\n * @return {boolean} Has executors of the provided types.\n */\n ExecutorGroup.prototype.hasExecutors = function (executors) {\n for (var zIndex in this.executorsByZIndex_) {\n var candidates = this.executorsByZIndex_[zIndex];\n for (var i = 0, ii = executors.length; i < ii; ++i) {\n if (executors[i] in candidates) {\n return true;\n }\n }\n }\n return false;\n };\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(import(\"../../Feature.js\").FeatureLike): T} callback Feature callback.\n * @param {Array<import(\"../../Feature.js\").FeatureLike>} declutteredFeatures Decluttered features.\n * @return {T|undefined} Callback result.\n * @template T\n */\n ExecutorGroup.prototype.forEachFeatureAtCoordinate = function (coordinate, resolution, rotation, hitTolerance, callback, declutteredFeatures) {\n hitTolerance = Math.round(hitTolerance);\n var contextSize = hitTolerance * 2 + 1;\n var transform = composeTransform(this.hitDetectionTransform_, hitTolerance + 0.5, hitTolerance + 0.5, 1 / resolution, -1 / resolution, -rotation, -coordinate[0], -coordinate[1]);\n if (!this.hitDetectionContext_) {\n this.hitDetectionContext_ = createCanvasContext2D(contextSize, contextSize);\n }\n var context = this.hitDetectionContext_;\n if (context.canvas.width !== contextSize || context.canvas.height !== contextSize) {\n context.canvas.width = contextSize;\n context.canvas.height = contextSize;\n }\n else {\n context.clearRect(0, 0, contextSize, contextSize);\n }\n /**\n * @type {import(\"../../extent.js\").Extent}\n */\n var hitExtent;\n if (this.renderBuffer_ !== undefined) {\n hitExtent = createEmpty();\n extendCoordinate(hitExtent, coordinate);\n buffer(hitExtent, resolution * (this.renderBuffer_ + hitTolerance), hitExtent);\n }\n var mask = getCircleArray(hitTolerance);\n var builderType;\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @return {?} Callback result.\n */\n function featureCallback(feature) {\n var imageData = context.getImageData(0, 0, contextSize, contextSize).data;\n for (var i_1 = 0; i_1 < contextSize; i_1++) {\n for (var j_1 = 0; j_1 < contextSize; j_1++) {\n if (mask[i_1][j_1]) {\n if (imageData[(j_1 * contextSize + i_1) * 4 + 3] > 0) {\n var result_1 = void 0;\n if (!(declutteredFeatures && (builderType == BuilderType.IMAGE || builderType == BuilderType.TEXT)) ||\n declutteredFeatures.indexOf(feature) !== -1) {\n result_1 = callback(feature);\n }\n if (result_1) {\n return result_1;\n }\n else {\n context.clearRect(0, 0, contextSize, contextSize);\n return undefined;\n }\n }\n }\n }\n }\n }\n /** @type {Array<number>} */\n var zs = Object.keys(this.executorsByZIndex_).map(Number);\n zs.sort(numberSafeCompareFunction);\n var i, j, executors, executor, result;\n for (i = zs.length - 1; i >= 0; --i) {\n var zIndexKey = zs[i].toString();\n executors = this.executorsByZIndex_[zIndexKey];\n for (j = ORDER.length - 1; j >= 0; --j) {\n builderType = ORDER[j];\n executor = executors[builderType];\n if (executor !== undefined) {\n result = executor.executeHitDetection(context, transform, rotation, featureCallback, hitExtent);\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n };\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @return {Array<number>} Clip coordinates.\n */\n ExecutorGroup.prototype.getClipCoords = function (transform) {\n var maxExtent = this.maxExtent_;\n if (!maxExtent) {\n return null;\n }\n var minX = maxExtent[0];\n var minY = maxExtent[1];\n var maxX = maxExtent[2];\n var maxY = maxExtent[3];\n var flatClipCoords = [minX, minY, minX, maxY, maxX, maxY, maxX, minY];\n transform2D(flatClipCoords, 0, 8, 2, transform, flatClipCoords);\n return flatClipCoords;\n };\n /**\n * @return {boolean} Is empty.\n */\n ExecutorGroup.prototype.isEmpty = function () {\n return isEmpty(this.executorsByZIndex_);\n };\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {boolean} snapToPixel Snap point symbols and test to integer pixel.\n * @param {Array<BuilderType>=} opt_builderTypes Ordered replay types to replay.\n * Default is {@link module:ol/render/replay~ORDER}\n * @param {Object<string, import(\"../canvas.js\").DeclutterGroup>=} opt_declutterReplays Declutter replays.\n */\n ExecutorGroup.prototype.execute = function (context, transform, viewRotation, snapToPixel, opt_builderTypes, opt_declutterReplays) {\n /** @type {Array<number>} */\n var zs = Object.keys(this.executorsByZIndex_).map(Number);\n zs.sort(numberSafeCompareFunction);\n // setup clipping so that the parts of over-simplified geometries are not\n // visible outside the current extent when panning\n if (this.maxExtent_) {\n context.save();\n this.clip(context, transform);\n }\n var builderTypes = opt_builderTypes ? opt_builderTypes : ORDER;\n var i, ii, j, jj, replays, replay;\n for (i = 0, ii = zs.length; i < ii; ++i) {\n var zIndexKey = zs[i].toString();\n replays = this.executorsByZIndex_[zIndexKey];\n for (j = 0, jj = builderTypes.length; j < jj; ++j) {\n var builderType = builderTypes[j];\n replay = replays[builderType];\n if (replay !== undefined) {\n if (opt_declutterReplays &&\n (builderType == BuilderType.IMAGE || builderType == BuilderType.TEXT)) {\n var declutter = opt_declutterReplays[zIndexKey];\n if (!declutter) {\n opt_declutterReplays[zIndexKey] = [replay, transform.slice(0)];\n }\n else {\n declutter.push(replay, transform.slice(0));\n }\n }\n else {\n replay.execute(context, transform, viewRotation, snapToPixel);\n }\n }\n }\n }\n if (this.maxExtent_) {\n context.restore();\n }\n };\n return ExecutorGroup;\n}(Disposable));\n/**\n * This cache is used for storing calculated pixel circles for increasing performance.\n * It is a static property to allow each Replaygroup to access it.\n * @type {Object<number, Array<Array<(boolean|undefined)>>>}\n */\nvar circleArrayCache = {\n 0: [[true]]\n};\n/**\n * This method fills a row in the array from the given coordinate to the\n * middle with `true`.\n * @param {Array<Array<(boolean|undefined)>>} array The array that will be altered.\n * @param {number} x X coordinate.\n * @param {number} y Y coordinate.\n */\nfunction fillCircleArrayRowToMiddle(array, x, y) {\n var i;\n var radius = Math.floor(array.length / 2);\n if (x >= radius) {\n for (i = radius; i < x; i++) {\n array[i][y] = true;\n }\n }\n else if (x < radius) {\n for (i = x + 1; i < radius; i++) {\n array[i][y] = true;\n }\n }\n}\n/**\n * This methods creates a circle inside a fitting array. Points inside the\n * circle are marked by true, points on the outside are undefined.\n * It uses the midpoint circle algorithm.\n * A cache is used to increase performance.\n * @param {number} radius Radius.\n * @returns {Array<Array<(boolean|undefined)>>} An array with marked circle points.\n */\nexport function getCircleArray(radius) {\n if (circleArrayCache[radius] !== undefined) {\n return circleArrayCache[radius];\n }\n var arraySize = radius * 2 + 1;\n var arr = new Array(arraySize);\n for (var i = 0; i < arraySize; i++) {\n arr[i] = new Array(arraySize);\n }\n var x = radius;\n var y = 0;\n var error = 0;\n while (x >= y) {\n fillCircleArrayRowToMiddle(arr, radius + x, radius + y);\n fillCircleArrayRowToMiddle(arr, radius + y, radius + x);\n fillCircleArrayRowToMiddle(arr, radius - y, radius + x);\n fillCircleArrayRowToMiddle(arr, radius - x, radius + y);\n fillCircleArrayRowToMiddle(arr, radius - x, radius - y);\n fillCircleArrayRowToMiddle(arr, radius - y, radius - x);\n fillCircleArrayRowToMiddle(arr, radius + y, radius - x);\n fillCircleArrayRowToMiddle(arr, radius + x, radius - y);\n y++;\n error += 1 + 2 * y;\n if (2 * (error - x) + 1 > 0) {\n x -= 1;\n error += 1 - 2 * x;\n }\n }\n circleArrayCache[radius] = arr;\n return arr;\n}\n/**\n * @param {!Object<string, Array<*>>} declutterReplays Declutter replays.\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} rotation Rotation.\n * @param {number} opacity Opacity.\n * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.\n * @param {Array<import(\"../../PluggableMap.js\").DeclutterItems>} declutterItems Declutter items.\n */\nexport function replayDeclutter(declutterReplays, context, rotation, opacity, snapToPixel, declutterItems) {\n var zs = Object.keys(declutterReplays).map(Number).sort(numberSafeCompareFunction);\n for (var z = 0, zz = zs.length; z < zz; ++z) {\n var executorData = declutterReplays[zs[z].toString()];\n var currentExecutor = void 0;\n for (var i = 0, ii = executorData.length; i < ii;) {\n var executor = executorData[i++];\n if (executor !== currentExecutor) {\n currentExecutor = executor;\n declutterItems.push({\n items: executor.declutterItems,\n opacity: opacity\n });\n }\n var transform = executorData[i++];\n executor.execute(context, transform, rotation, snapToPixel);\n }\n }\n}\nexport default ExecutorGroup;\n//# sourceMappingURL=ExecutorGroup.js.map","/**\n * @module ol/render/canvas/hitdetet\n */\nimport CanvasImmediateRenderer from './Immediate.js';\nimport { createCanvasContext2D } from '../../dom.js';\nimport { Icon } from '../../style.js';\nimport IconAnchorUnits from '../../style/IconAnchorUnits.js';\nimport GeometryType from '../../geom/GeometryType.js';\nimport { intersects } from '../../extent.js';\nimport { numberSafeCompareFunction } from '../../array.js';\n/**\n * @param {import(\"../../size.js\").Size} size Canvas size in css pixels.\n * @param {Array<import(\"../../transform.js\").Transform>} transforms Transforms\n * for rendering features to all worlds of the viewport, from coordinates to css\n * pixels.\n * @param {Array<import(\"../../Feature.js\").FeatureLike>} features\n * Features to consider for hit detection.\n * @param {import(\"../../style/Style.js\").StyleFunction|undefined} styleFunction\n * Layer style function.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @return {ImageData} Hit detection image data.\n */\nexport function createHitDetectionImageData(size, transforms, features, styleFunction, extent, resolution, rotation) {\n var width = size[0] / 2;\n var height = size[1] / 2;\n var context = createCanvasContext2D(width, height);\n context.imageSmoothingEnabled = false;\n var canvas = context.canvas;\n var renderer = new CanvasImmediateRenderer(context, 0.5, extent, null, rotation);\n var featureCount = features.length;\n // Stretch hit detection index to use the whole available color range\n var indexFactor = Math.ceil((256 * 256 * 256) / featureCount);\n var featuresByZIndex = {};\n for (var i = 0; i < featureCount; ++i) {\n var feature = features[i];\n var featureStyleFunction = feature.getStyleFunction() || styleFunction;\n if (!styleFunction) {\n continue;\n }\n var styles = featureStyleFunction(feature, resolution);\n if (!Array.isArray(styles)) {\n styles = [styles];\n }\n var index = i * indexFactor;\n var color = '#' + ('000000' + index.toString(16)).slice(-6);\n for (var j = 0, jj = styles.length; j < jj; ++j) {\n var originalStyle = styles[j];\n var style = originalStyle.clone();\n var fill = style.getFill();\n if (fill) {\n fill.setColor(color);\n }\n var stroke = style.getStroke();\n if (stroke) {\n stroke.setColor(color);\n }\n style.setText(undefined);\n var image = originalStyle.getImage();\n if (image) {\n var imgSize = image.getImageSize();\n var canvas_1 = document.createElement('canvas');\n canvas_1.width = imgSize[0];\n canvas_1.height = imgSize[1];\n var imgContext = canvas_1.getContext('2d', { alpha: false });\n imgContext.fillStyle = color;\n var img = imgContext.canvas;\n imgContext.fillRect(0, 0, img.width, img.height);\n var width_1 = imgSize ? imgSize[0] : img.width;\n var height_1 = imgSize ? imgSize[1] : img.height;\n var iconContext = createCanvasContext2D(width_1, height_1);\n iconContext.drawImage(img, 0, 0);\n style.setImage(new Icon({\n img: img,\n imgSize: imgSize,\n anchor: image.getAnchor(),\n anchorXUnits: IconAnchorUnits.PIXELS,\n anchorYUnits: IconAnchorUnits.PIXELS,\n offset: image.getOrigin(),\n size: image.getSize(),\n opacity: image.getOpacity(),\n scale: image.getScale(),\n rotation: image.getRotation(),\n rotateWithView: image.getRotateWithView()\n }));\n }\n var zIndex = Number(style.getZIndex());\n var byGeometryType = featuresByZIndex[zIndex];\n if (!byGeometryType) {\n byGeometryType = {};\n featuresByZIndex[zIndex] = byGeometryType;\n byGeometryType[GeometryType.POLYGON] = [];\n byGeometryType[GeometryType.CIRCLE] = [];\n byGeometryType[GeometryType.LINE_STRING] = [];\n byGeometryType[GeometryType.POINT] = [];\n }\n var geometry = style.getGeometryFunction()(feature);\n if (geometry && intersects(extent, geometry.getExtent())) {\n byGeometryType[geometry.getType().replace('Multi', '')].push(geometry, style);\n }\n }\n }\n var zIndexKeys = Object.keys(featuresByZIndex).map(Number).sort(numberSafeCompareFunction);\n for (var i = 0, ii = zIndexKeys.length; i < ii; ++i) {\n var byGeometryType = featuresByZIndex[zIndexKeys[i]];\n for (var type in byGeometryType) {\n var geomAndStyle = byGeometryType[type];\n for (var j = 0, jj = geomAndStyle.length; j < jj; j += 2) {\n renderer.setStyle(geomAndStyle[j + 1]);\n for (var k = 0, kk = transforms.length; k < kk; ++k) {\n renderer.setTransform(transforms[k]);\n renderer.drawGeometry(geomAndStyle[j]);\n }\n }\n }\n }\n return context.getImageData(0, 0, canvas.width, canvas.height);\n}\n/**\n * @param {import(\"../../pixel\").Pixel} pixel Pixel coordinate on the hit\n * detection canvas in css pixels.\n * @param {Array<import(\"../../Feature\").FeatureLike>} features Features. Has to\n * match the `features` array that was passed to `createHitDetectionImageData()`.\n * @param {ImageData} imageData Hit detection image data generated by\n * `createHitDetectionImageData()`.\n * @return {Array<import(\"../../Feature\").FeatureLike>} features Features.\n */\nexport function hitDetect(pixel, features, imageData) {\n var resultFeatures = [];\n if (imageData) {\n var index = (Math.round(pixel[0] / 2) + Math.round(pixel[1] / 2) * imageData.width) * 4;\n var r = imageData.data[index];\n var g = imageData.data[index + 1];\n var b = imageData.data[index + 2];\n var i = b + (256 * (g + (256 * r)));\n var indexFactor = Math.ceil((256 * 256 * 256) / features.length);\n if (i % indexFactor === 0) {\n resultFeatures.push(features[i / indexFactor]);\n }\n }\n return resultFeatures;\n}\n//# sourceMappingURL=hitdetect.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/canvas/VectorLayer\n */\nimport { getUid } from '../../util.js';\nimport ViewHint from '../../ViewHint.js';\nimport { buffer, createEmpty, containsExtent, getWidth, intersects as intersectsExtent } from '../../extent.js';\nimport { fromUserExtent, toUserExtent, getUserProjection, getTransformFromProjections } from '../../proj.js';\nimport CanvasBuilderGroup from '../../render/canvas/BuilderGroup.js';\nimport ExecutorGroup, { replayDeclutter } from '../../render/canvas/ExecutorGroup.js';\nimport CanvasLayerRenderer from './Layer.js';\nimport { defaultOrder as defaultRenderOrder, getTolerance as getRenderTolerance, getSquaredTolerance as getSquaredRenderTolerance, renderFeature } from '../vector.js';\nimport { toString as transformToString, makeScale, makeInverse, apply } from '../../transform.js';\nimport { createHitDetectionImageData, hitDetect } from '../../render/canvas/hitdetect.js';\n/**\n * @classdesc\n * Canvas renderer for vector layers.\n * @api\n */\nvar CanvasVectorLayerRenderer = /** @class */ (function (_super) {\n __extends(CanvasVectorLayerRenderer, _super);\n /**\n * @param {import(\"../../layer/Vector.js\").default} vectorLayer Vector layer.\n */\n function CanvasVectorLayerRenderer(vectorLayer) {\n var _this = _super.call(this, vectorLayer) || this;\n /** @private */\n _this.boundHandleStyleImageChange_ = _this.handleStyleImageChange_.bind(_this);\n /**\n * @type {boolean}\n */\n _this.animatingOrInteracting_;\n /**\n * @private\n * @type {boolean}\n */\n _this.dirty_ = false;\n /**\n * @type {ImageData}\n */\n _this.hitDetectionImageData_ = null;\n /**\n * @type {Array<import(\"../../Feature.js\").default>}\n */\n _this.renderedFeatures_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.renderedRevision_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.renderedResolution_ = NaN;\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.renderedExtent_ = createEmpty();\n /**\n * @private\n * @type {number}\n */\n _this.renderedRotation_;\n /**\n * @private\n * @type {import(\"../../coordinate\").Coordinate}\n */\n _this.renderedCenter_ = null;\n /**\n * @private\n * @type {import(\"../../proj/Projection\").default}\n */\n _this.renderedProjection_ = null;\n /**\n * @private\n * @type {function(import(\"../../Feature.js\").default, import(\"../../Feature.js\").default): number|null}\n */\n _this.renderedRenderOrder_ = null;\n /**\n * @private\n * @type {import(\"../../render/canvas/ExecutorGroup\").default}\n */\n _this.replayGroup_ = null;\n /**\n * A new replay group had to be created by `prepareFrame()`\n * @type {boolean}\n */\n _this.replayGroupChanged = true;\n return _this;\n }\n /**\n * @inheritDoc\n */\n CanvasVectorLayerRenderer.prototype.useContainer = function (target, transform, opacity) {\n if (opacity < 1) {\n target = null;\n }\n _super.prototype.useContainer.call(this, target, transform, opacity);\n };\n /**\n * @inheritDoc\n */\n CanvasVectorLayerRenderer.prototype.renderFrame = function (frameState, target) {\n var pixelRatio = frameState.pixelRatio;\n var layerState = frameState.layerStatesArray[frameState.layerIndex];\n // set forward and inverse pixel transforms\n makeScale(this.pixelTransform, 1 / pixelRatio, 1 / pixelRatio);\n makeInverse(this.inversePixelTransform, this.pixelTransform);\n var canvasTransform = transformToString(this.pixelTransform);\n this.useContainer(target, canvasTransform, layerState.opacity);\n var context = this.context;\n var canvas = context.canvas;\n var replayGroup = this.replayGroup_;\n if (!replayGroup || replayGroup.isEmpty()) {\n if (!this.containerReused && canvas.width > 0) {\n canvas.width = 0;\n }\n return this.container;\n }\n // resize and clear\n var width = Math.round(frameState.size[0] * pixelRatio);\n var height = Math.round(frameState.size[1] * pixelRatio);\n if (canvas.width != width || canvas.height != height) {\n canvas.width = width;\n canvas.height = height;\n if (canvas.style.transform !== canvasTransform) {\n canvas.style.transform = canvasTransform;\n }\n }\n else if (!this.containerReused) {\n context.clearRect(0, 0, width, height);\n }\n this.preRender(context, frameState);\n var extent = frameState.extent;\n var viewState = frameState.viewState;\n var center = viewState.center;\n var resolution = viewState.resolution;\n var projection = viewState.projection;\n var rotation = viewState.rotation;\n var projectionExtent = projection.getExtent();\n var vectorSource = this.getLayer().getSource();\n // clipped rendering if layer extent is set\n var clipped = false;\n if (layerState.extent) {\n var layerExtent = fromUserExtent(layerState.extent, projection);\n clipped = !containsExtent(layerExtent, frameState.extent) && intersectsExtent(layerExtent, frameState.extent);\n if (clipped) {\n this.clip(context, frameState, layerExtent);\n }\n }\n var viewHints = frameState.viewHints;\n var snapToPixel = !(viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]);\n var transform = this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, 0);\n var declutterReplays = this.getLayer().getDeclutter() ? {} : null;\n replayGroup.execute(context, transform, rotation, snapToPixel, undefined, declutterReplays);\n if (vectorSource.getWrapX() && projection.canWrapX() && !containsExtent(projectionExtent, extent)) {\n var startX = extent[0];\n var worldWidth = getWidth(projectionExtent);\n var world = 0;\n var offsetX = void 0;\n while (startX < projectionExtent[0]) {\n --world;\n offsetX = worldWidth * world;\n var transform_1 = this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, offsetX);\n replayGroup.execute(context, transform_1, rotation, snapToPixel, undefined, declutterReplays);\n startX += worldWidth;\n }\n world = 0;\n startX = extent[2];\n while (startX > projectionExtent[2]) {\n ++world;\n offsetX = worldWidth * world;\n var transform_2 = this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, offsetX);\n replayGroup.execute(context, transform_2, rotation, snapToPixel, undefined, declutterReplays);\n startX -= worldWidth;\n }\n }\n if (declutterReplays) {\n var viewHints_1 = frameState.viewHints;\n var hifi = !(viewHints_1[ViewHint.ANIMATING] || viewHints_1[ViewHint.INTERACTING]);\n replayDeclutter(declutterReplays, context, rotation, 1, hifi, frameState.declutterItems);\n }\n if (clipped) {\n context.restore();\n }\n this.postRender(context, frameState);\n var opacity = layerState.opacity;\n var container = this.container;\n if (opacity !== parseFloat(container.style.opacity)) {\n container.style.opacity = opacity === 1 ? '' : opacity;\n }\n return this.container;\n };\n /**\n * @inheritDoc\n */\n CanvasVectorLayerRenderer.prototype.getFeatures = function (pixel) {\n return new Promise(function (resolve, reject) {\n if (!this.hitDetectionImageData_ && !this.animatingOrInteracting_) {\n requestAnimationFrame(function () {\n var size = [this.context.canvas.width, this.context.canvas.height];\n apply(this.pixelTransform, size);\n var center = this.renderedCenter_;\n var resolution = this.renderedResolution_;\n var rotation = this.renderedRotation_;\n var projection = this.renderedProjection_;\n var extent = this.renderedExtent_;\n var layer = this.getLayer();\n var transforms = [];\n var width = size[0] / 2;\n var height = size[1] / 2;\n transforms.push(this.getRenderTransform(center, resolution, rotation, 0.5, width, height, 0).slice());\n var source = layer.getSource();\n var projectionExtent = projection.getExtent();\n if (source.getWrapX() && projection.canWrapX() && !containsExtent(projectionExtent, extent)) {\n var startX = extent[0];\n var worldWidth = getWidth(projectionExtent);\n var world = 0;\n var offsetX = void 0;\n while (startX < projectionExtent[0]) {\n --world;\n offsetX = worldWidth * world;\n transforms.push(this.getRenderTransform(center, resolution, rotation, 0.5, width, height, offsetX).slice());\n startX += worldWidth;\n }\n world = 0;\n startX = extent[2];\n while (startX > projectionExtent[2]) {\n ++world;\n offsetX = worldWidth * world;\n transforms.push(this.getRenderTransform(center, resolution, rotation, 0.5, width, height, offsetX).slice());\n startX -= worldWidth;\n }\n }\n this.hitDetectionImageData_ = createHitDetectionImageData(size, transforms, this.renderedFeatures_, layer.getStyleFunction(), extent, resolution, rotation);\n resolve(hitDetect(pixel, this.renderedFeatures_, this.hitDetectionImageData_));\n }.bind(this));\n }\n else {\n resolve(hitDetect(pixel, this.renderedFeatures_, this.hitDetectionImageData_));\n }\n }.bind(this));\n };\n /**\n * @inheritDoc\n */\n CanvasVectorLayerRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, callback, declutteredFeatures) {\n if (!this.replayGroup_) {\n return undefined;\n }\n else {\n var resolution = frameState.viewState.resolution;\n var rotation = frameState.viewState.rotation;\n var layer_1 = this.getLayer();\n /** @type {!Object<string, boolean>} */\n var features_1 = {};\n var result = this.replayGroup_.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, \n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @return {?} Callback result.\n */\n function (feature) {\n var key = getUid(feature);\n if (!(key in features_1)) {\n features_1[key] = true;\n return callback(feature, layer_1);\n }\n }, layer_1.getDeclutter() ? declutteredFeatures : null);\n return result;\n }\n };\n /**\n * @inheritDoc\n */\n CanvasVectorLayerRenderer.prototype.handleFontsChanged = function () {\n var layer = this.getLayer();\n if (layer.getVisible() && this.replayGroup_) {\n layer.changed();\n }\n };\n /**\n * Handle changes in image style state.\n * @param {import(\"../../events/Event.js\").default} event Image style change event.\n * @private\n */\n CanvasVectorLayerRenderer.prototype.handleStyleImageChange_ = function (event) {\n this.renderIfReadyAndVisible();\n };\n /**\n * @inheritDoc\n */\n CanvasVectorLayerRenderer.prototype.prepareFrame = function (frameState) {\n var vectorLayer = this.getLayer();\n var vectorSource = vectorLayer.getSource();\n var animating = frameState.viewHints[ViewHint.ANIMATING];\n var interacting = frameState.viewHints[ViewHint.INTERACTING];\n var updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();\n var updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();\n if (!this.dirty_ && (!updateWhileAnimating && animating) ||\n (!updateWhileInteracting && interacting)) {\n this.animatingOrInteracting_ = true;\n return true;\n }\n this.animatingOrInteracting_ = false;\n var frameStateExtent = frameState.extent;\n var viewState = frameState.viewState;\n var projection = viewState.projection;\n var resolution = viewState.resolution;\n var pixelRatio = frameState.pixelRatio;\n var vectorLayerRevision = vectorLayer.getRevision();\n var vectorLayerRenderBuffer = vectorLayer.getRenderBuffer();\n var vectorLayerRenderOrder = vectorLayer.getRenderOrder();\n if (vectorLayerRenderOrder === undefined) {\n vectorLayerRenderOrder = defaultRenderOrder;\n }\n var center = viewState.center.slice();\n var extent = buffer(frameStateExtent, vectorLayerRenderBuffer * resolution);\n var projectionExtent = viewState.projection.getExtent();\n if (vectorSource.getWrapX() && viewState.projection.canWrapX() &&\n !containsExtent(projectionExtent, frameState.extent)) {\n // For the replay group, we need an extent that intersects the real world\n // (-180° to +180°). To support geometries in a coordinate range from -540°\n // to +540°, we add at least 1 world width on each side of the projection\n // extent. If the viewport is wider than the world, we need to add half of\n // the viewport width to make sure we cover the whole viewport.\n var worldWidth = getWidth(projectionExtent);\n var gutter = Math.max(getWidth(extent) / 2, worldWidth);\n extent[0] = projectionExtent[0] - gutter;\n extent[2] = projectionExtent[2] + gutter;\n var worldsAway = Math.floor((center[0] - projectionExtent[0]) / worldWidth);\n center[0] -= (worldsAway * worldWidth);\n }\n if (!this.dirty_ &&\n this.renderedResolution_ == resolution &&\n this.renderedRevision_ == vectorLayerRevision &&\n this.renderedRenderOrder_ == vectorLayerRenderOrder &&\n containsExtent(this.renderedExtent_, extent)) {\n this.replayGroupChanged = false;\n return true;\n }\n if (this.replayGroup_) {\n this.replayGroup_.dispose();\n }\n this.replayGroup_ = null;\n this.dirty_ = false;\n var replayGroup = new CanvasBuilderGroup(getRenderTolerance(resolution, pixelRatio), extent, resolution, pixelRatio, vectorLayer.getDeclutter());\n var userProjection = getUserProjection();\n var userTransform;\n if (userProjection) {\n vectorSource.loadFeatures(toUserExtent(extent, projection), resolution, userProjection);\n userTransform = getTransformFromProjections(userProjection, projection);\n }\n else {\n vectorSource.loadFeatures(extent, resolution, projection);\n }\n var squaredTolerance = getSquaredRenderTolerance(resolution, pixelRatio);\n /**\n * @param {import(\"../../Feature.js\").default} feature Feature.\n * @this {CanvasVectorLayerRenderer}\n */\n var render = function (feature) {\n var styles;\n var styleFunction = feature.getStyleFunction() || vectorLayer.getStyleFunction();\n if (styleFunction) {\n styles = styleFunction(feature, resolution);\n }\n if (styles) {\n var dirty = this.renderFeature(feature, squaredTolerance, styles, replayGroup, userTransform);\n this.dirty_ = this.dirty_ || dirty;\n }\n }.bind(this);\n var userExtent = toUserExtent(extent, projection);\n /** @type {Array<import(\"../../Feature.js\").default>} */\n var features = vectorSource.getFeaturesInExtent(userExtent);\n if (vectorLayerRenderOrder) {\n features.sort(vectorLayerRenderOrder);\n }\n for (var i = 0, ii = features.length; i < ii; ++i) {\n render(features[i]);\n }\n this.renderedFeatures_ = features;\n var replayGroupInstructions = replayGroup.finish();\n var executorGroup = new ExecutorGroup(extent, resolution, pixelRatio, vectorSource.getOverlaps(), replayGroupInstructions, vectorLayer.getRenderBuffer());\n this.renderedResolution_ = resolution;\n this.renderedRevision_ = vectorLayerRevision;\n this.renderedRenderOrder_ = vectorLayerRenderOrder;\n this.renderedExtent_ = extent;\n this.renderedRotation_ = viewState.rotation;\n this.renderedCenter_ = center;\n this.renderedProjection_ = projection;\n this.replayGroup_ = executorGroup;\n this.hitDetectionImageData_ = null;\n this.replayGroupChanged = true;\n return true;\n };\n /**\n * @param {import(\"../../Feature.js\").default} feature Feature.\n * @param {number} squaredTolerance Squared render tolerance.\n * @param {import(\"../../style/Style.js\").default|Array<import(\"../../style/Style.js\").default>} styles The style or array of styles.\n * @param {import(\"../../render/canvas/BuilderGroup.js\").default} builderGroup Builder group.\n * @param {import(\"../../proj.js\").TransformFunction} opt_transform Transform from user to view projection.\n * @return {boolean} `true` if an image is loading.\n */\n CanvasVectorLayerRenderer.prototype.renderFeature = function (feature, squaredTolerance, styles, builderGroup, opt_transform) {\n if (!styles) {\n return false;\n }\n var loading = false;\n if (Array.isArray(styles)) {\n for (var i = 0, ii = styles.length; i < ii; ++i) {\n loading = renderFeature(builderGroup, feature, styles[i], squaredTolerance, this.boundHandleStyleImageChange_, opt_transform) || loading;\n }\n }\n else {\n loading = renderFeature(builderGroup, feature, styles, squaredTolerance, this.boundHandleStyleImageChange_, opt_transform);\n }\n return loading;\n };\n return CanvasVectorLayerRenderer;\n}(CanvasLayerRenderer));\nexport default CanvasVectorLayerRenderer;\n//# sourceMappingURL=VectorLayer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/canvas/VectorImageLayer\n */\nimport ImageCanvas from '../../ImageCanvas.js';\nimport ViewHint from '../../ViewHint.js';\nimport { getHeight, getWidth, isEmpty, scaleFromCenter } from '../../extent.js';\nimport { assign } from '../../obj.js';\nimport CanvasImageLayerRenderer from './ImageLayer.js';\nimport CanvasVectorLayerRenderer from './VectorLayer.js';\nimport EventType from '../../events/EventType.js';\nimport ImageState from '../../ImageState.js';\nimport { renderDeclutterItems } from '../../render.js';\nimport { apply, compose, create } from '../../transform.js';\n/**\n * @classdesc\n * Canvas renderer for image layers.\n * @api\n */\nvar CanvasVectorImageLayerRenderer = /** @class */ (function (_super) {\n __extends(CanvasVectorImageLayerRenderer, _super);\n /**\n * @param {import(\"../../layer/VectorImage.js\").default} layer Vector image layer.\n */\n function CanvasVectorImageLayerRenderer(layer) {\n var _this = _super.call(this, layer) || this;\n /**\n * @private\n * @type {import(\"./VectorLayer.js\").default}\n */\n _this.vectorRenderer_ = new CanvasVectorLayerRenderer(layer);\n /**\n * @private\n * @type {number}\n */\n _this.layerImageRatio_ = layer.getImageRatio();\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.coordinateToVectorPixelTransform_ = create();\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.renderedPixelToCoordinateTransform_ = null;\n return _this;\n }\n /**\n * @inheritDoc\n */\n CanvasVectorImageLayerRenderer.prototype.disposeInternal = function () {\n this.vectorRenderer_.dispose();\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @inheritDoc\n */\n CanvasVectorImageLayerRenderer.prototype.getFeatures = function (pixel) {\n if (this.vectorRenderer_) {\n var vectorPixel = apply(this.coordinateToVectorPixelTransform_, apply(this.renderedPixelToCoordinateTransform_, pixel.slice()));\n return this.vectorRenderer_.getFeatures(vectorPixel);\n }\n else {\n var promise = new Promise(function (resolve, reject) {\n resolve([]);\n });\n return promise;\n }\n };\n /**\n * @inheritDoc\n */\n CanvasVectorImageLayerRenderer.prototype.handleFontsChanged = function () {\n this.vectorRenderer_.handleFontsChanged();\n };\n /**\n * @inheritDoc\n */\n CanvasVectorImageLayerRenderer.prototype.prepareFrame = function (frameState) {\n var pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var viewResolution = viewState.resolution;\n var hints = frameState.viewHints;\n var vectorRenderer = this.vectorRenderer_;\n var renderedExtent = frameState.extent;\n if (this.layerImageRatio_ !== 1) {\n renderedExtent = renderedExtent.slice(0);\n scaleFromCenter(renderedExtent, this.layerImageRatio_);\n }\n var width = getWidth(renderedExtent) / viewResolution;\n var height = getHeight(renderedExtent) / viewResolution;\n if (!hints[ViewHint.ANIMATING] && !hints[ViewHint.INTERACTING] && !isEmpty(renderedExtent)) {\n vectorRenderer.useContainer(null, null, 1);\n var context = vectorRenderer.context;\n var imageFrameState_1 = /** @type {import(\"../../PluggableMap.js\").FrameState} */ (assign({}, frameState, {\n declutterItems: [],\n size: [width, height],\n viewState: /** @type {import(\"../../View.js\").State} */ (assign({}, frameState.viewState, {\n rotation: 0\n }))\n }));\n var image_1 = new ImageCanvas(renderedExtent, viewResolution, pixelRatio, context.canvas, function (callback) {\n if (vectorRenderer.prepareFrame(imageFrameState_1) && vectorRenderer.replayGroupChanged) {\n vectorRenderer.renderFrame(imageFrameState_1, null);\n renderDeclutterItems(imageFrameState_1, null);\n callback();\n }\n });\n image_1.addEventListener(EventType.CHANGE, function () {\n if (image_1.getState() === ImageState.LOADED) {\n this.image_ = image_1;\n }\n }.bind(this));\n image_1.load();\n }\n if (this.image_) {\n var image = this.image_;\n var imageResolution = image.getResolution();\n var imagePixelRatio = image.getPixelRatio();\n var renderedResolution = imageResolution * pixelRatio / imagePixelRatio;\n this.renderedResolution = renderedResolution;\n this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();\n this.coordinateToVectorPixelTransform_ = compose(this.coordinateToVectorPixelTransform_, width / 2, height / 2, 1 / renderedResolution, -1 / renderedResolution, 0, -viewState.center[0], -viewState.center[1]);\n }\n return !!this.image_;\n };\n /**\n * @override\n */\n CanvasVectorImageLayerRenderer.prototype.preRender = function () { };\n /**\n * @override\n */\n CanvasVectorImageLayerRenderer.prototype.postRender = function () { };\n /**\n * @inheritDoc\n */\n CanvasVectorImageLayerRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, callback, declutteredFeatures) {\n if (this.vectorRenderer_) {\n return this.vectorRenderer_.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, declutteredFeatures);\n }\n else {\n return _super.prototype.forEachFeatureAtCoordinate.call(this, coordinate, frameState, hitTolerance, callback, declutteredFeatures);\n }\n };\n return CanvasVectorImageLayerRenderer;\n}(CanvasImageLayerRenderer));\nexport default CanvasVectorImageLayerRenderer;\n//# sourceMappingURL=VectorImageLayer.js.map","/**\n * @module ol/layer/VectorTileRenderType\n */\n/**\n * @enum {string}\n * Render mode for vector tiles:\n * * `'image'`: Vector tiles are rendered as images. Great performance, but\n * point symbols and texts are always rotated with the view and pixels are\n * scaled during zoom animations.\n * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels\n * are scaled during zoom animations. Point symbols and texts are accurately\n * rendered as vectors and can stay upright on rotated views.\n * @api\n */\nexport default {\n IMAGE: 'image',\n HYBRID: 'hybrid'\n};\n//# sourceMappingURL=VectorTileRenderType.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/canvas/VectorTileLayer\n */\nimport { getUid } from '../../util.js';\nimport TileState from '../../TileState.js';\nimport ViewHint from '../../ViewHint.js';\nimport { listen, unlistenByKey } from '../../events.js';\nimport EventType from '../../events/EventType.js';\nimport { buffer, containsCoordinate, equals, getIntersection, intersects, containsExtent, getWidth, getTopLeft } from '../../extent.js';\nimport VectorTileRenderType from '../../layer/VectorTileRenderType.js';\nimport ReplayType from '../../render/canvas/BuilderType.js';\nimport CanvasBuilderGroup from '../../render/canvas/BuilderGroup.js';\nimport CanvasTileLayerRenderer from './TileLayer.js';\nimport { toSize } from '../../size.js';\nimport { getSquaredTolerance as getSquaredRenderTolerance, renderFeature } from '../vector.js';\nimport { apply as applyTransform, create as createTransform, reset as resetTransform, scale as scaleTransform, translate as translateTransform, multiply, scale } from '../../transform.js';\nimport CanvasExecutorGroup, { replayDeclutter } from '../../render/canvas/ExecutorGroup.js';\nimport { clear } from '../../obj.js';\nimport { createHitDetectionImageData, hitDetect } from '../../render/canvas/hitdetect.js';\n/**\n * @type {!Object<string, Array<import(\"../../render/canvas/BuilderType.js\").default>>}\n */\nvar IMAGE_REPLAYS = {\n 'image': [ReplayType.POLYGON, ReplayType.CIRCLE,\n ReplayType.LINE_STRING, ReplayType.IMAGE, ReplayType.TEXT],\n 'hybrid': [ReplayType.POLYGON, ReplayType.LINE_STRING]\n};\n/**\n * @type {!Object<string, Array<import(\"../../render/canvas/BuilderType.js\").default>>}\n */\nvar VECTOR_REPLAYS = {\n 'image': [ReplayType.DEFAULT],\n 'hybrid': [ReplayType.IMAGE, ReplayType.TEXT, ReplayType.DEFAULT]\n};\n/**\n * @classdesc\n * Canvas renderer for vector tile layers.\n * @api\n */\nvar CanvasVectorTileLayerRenderer = /** @class */ (function (_super) {\n __extends(CanvasVectorTileLayerRenderer, _super);\n /**\n * @param {import(\"../../layer/VectorTile.js\").default} layer VectorTile layer.\n */\n function CanvasVectorTileLayerRenderer(layer) {\n var _this = _super.call(this, layer) || this;\n /** @private */\n _this.boundHandleStyleImageChange_ = _this.handleStyleImageChange_.bind(_this);\n /**\n * @private\n * @type {boolean}\n */\n _this.dirty_ = false;\n /**\n * @private\n * @type {number}\n */\n _this.renderedLayerRevision_;\n /**\n * @private\n * @type {import(\"../../transform\").Transform}\n */\n _this.renderedPixelToCoordinateTransform_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.renderedRotation_;\n /**\n * @private\n * @type {!Object<string, import(\"../../VectorRenderTile.js\").default>}\n */\n _this.renderTileImageQueue_ = {};\n /**\n * @type {Object<string, import(\"../../events.js\").EventsKey>}\n */\n _this.tileListenerKeys_ = {};\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n _this.tmpTransform_ = createTransform();\n return _this;\n }\n /**\n * @param {import(\"../../VectorRenderTile.js\").default} tile Tile.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../proj/Projection\").default} projection Projection.\n * @param {boolean} queue Queue tile for rendering.\n * @return {boolean|undefined} Tile needs to be rendered.\n */\n CanvasVectorTileLayerRenderer.prototype.prepareTile = function (tile, pixelRatio, projection, queue) {\n var render;\n var tileUid = getUid(tile);\n var state = tile.getState();\n if (((state === TileState.LOADED && tile.hifi) ||\n state === TileState.ERROR || state === TileState.ABORT) &&\n tileUid in this.tileListenerKeys_) {\n unlistenByKey(this.tileListenerKeys_[tileUid]);\n delete this.tileListenerKeys_[tileUid];\n }\n if (state === TileState.LOADED || state === TileState.ERROR) {\n this.updateExecutorGroup_(tile, pixelRatio, projection);\n if (this.tileImageNeedsRender_(tile, pixelRatio, projection)) {\n render = true;\n if (queue) {\n this.renderTileImageQueue_[tileUid] = tile;\n }\n }\n }\n return render;\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.getTile = function (z, x, y, frameState) {\n var tile = /** @type {import(\"../../VectorRenderTile.js\").default} */ (_super.prototype.getTile.call(this, z, x, y, frameState));\n var pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var resolution = viewState.resolution;\n var projection = viewState.projection;\n if (tile.getState() < TileState.LOADED) {\n tile.wantedResolution = resolution;\n var tileUid = getUid(tile);\n if (!(tileUid in this.tileListenerKeys_)) {\n var listenerKey = listen(tile, EventType.CHANGE, this.prepareTile.bind(this, tile, pixelRatio, projection, true));\n this.tileListenerKeys_[tileUid] = listenerKey;\n }\n }\n else {\n var viewHints = frameState.viewHints;\n var hifi = !(viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]);\n if (hifi || !tile.wantedResolution) {\n tile.wantedResolution = resolution;\n }\n var render = this.prepareTile(tile, pixelRatio, projection, false);\n if (render) {\n this.renderTileImage_(tile, frameState);\n }\n }\n return tile;\n };\n /**\n * @inheritdoc\n */\n CanvasVectorTileLayerRenderer.prototype.isDrawableTile = function (tile) {\n return _super.prototype.isDrawableTile.call(this, tile) && tile.hasContext(this.getLayer());\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.getTileImage = function (tile) {\n return tile.getImage(this.getLayer());\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.prepareFrame = function (frameState) {\n var layerRevision = this.getLayer().getRevision();\n if (this.renderedLayerRevision_ != layerRevision) {\n this.renderedTiles.length = 0;\n }\n this.renderedLayerRevision_ = layerRevision;\n return _super.prototype.prepareFrame.call(this, frameState);\n };\n /**\n * @param {import(\"../../VectorRenderTile.js\").default} tile Tile.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @private\n */\n CanvasVectorTileLayerRenderer.prototype.updateExecutorGroup_ = function (tile, pixelRatio, projection) {\n var layer = /** @type {import(\"../../layer/VectorTile.js\").default} */ (this.getLayer());\n var revision = layer.getRevision();\n var renderOrder = layer.getRenderOrder() || null;\n var resolution = tile.wantedResolution;\n var builderState = tile.getReplayState(layer);\n if (!builderState.dirty && builderState.renderedResolution === resolution &&\n builderState.renderedRevision == revision &&\n builderState.renderedRenderOrder == renderOrder && builderState.renderedZ === tile.sourceZ) {\n return;\n }\n var source = layer.getSource();\n var sourceTileGrid = source.getTileGrid();\n var tileGrid = source.getTileGridForProjection(projection);\n var tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);\n var sourceTiles = source.getSourceTiles(pixelRatio, projection, tile);\n var layerUid = getUid(layer);\n var executorGroups = tile.executorGroups[layerUid];\n if (executorGroups) {\n for (var i = 0, ii = executorGroups.length; i < ii; ++i) {\n executorGroups[i].dispose();\n }\n }\n tile.hitDetectionImageData = null;\n tile.executorGroups[layerUid] = [];\n var _loop_1 = function (t, tt) {\n var sourceTile = sourceTiles[t];\n if (sourceTile.getState() != TileState.LOADED) {\n return \"continue\";\n }\n var sourceTileCoord = sourceTile.tileCoord;\n var sourceTileExtent = sourceTileGrid.getTileCoordExtent(sourceTileCoord);\n var sharedExtent = getIntersection(tileExtent, sourceTileExtent);\n var bufferedExtent = equals(sourceTileExtent, sharedExtent) ? null :\n buffer(sharedExtent, layer.getRenderBuffer() * resolution, this_1.tmpExtent);\n builderState.dirty = false;\n var builderGroup = new CanvasBuilderGroup(0, sharedExtent, resolution, pixelRatio, layer.getDeclutter());\n var squaredTolerance = getSquaredRenderTolerance(resolution, pixelRatio);\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @this {CanvasVectorTileLayerRenderer}\n */\n var render = function (feature) {\n var styles;\n var styleFunction = feature.getStyleFunction() || layer.getStyleFunction();\n if (styleFunction) {\n styles = styleFunction(feature, resolution);\n }\n if (styles) {\n var dirty = this.renderFeature(feature, squaredTolerance, styles, builderGroup);\n this.dirty_ = this.dirty_ || dirty;\n builderState.dirty = builderState.dirty || dirty;\n }\n };\n var features = sourceTile.getFeatures();\n if (renderOrder && renderOrder !== builderState.renderedRenderOrder) {\n features.sort(renderOrder);\n }\n for (var i = 0, ii = features.length; i < ii; ++i) {\n var feature = features[i];\n if (!bufferedExtent || intersects(bufferedExtent, feature.getGeometry().getExtent())) {\n render.call(this_1, feature);\n }\n }\n var executorGroupInstructions = builderGroup.finish();\n // no need to clip when the render tile is covered by a single source tile\n var replayExtent = layer.getDeclutter() && sourceTiles.length === 1 ?\n null :\n sharedExtent;\n var renderingReplayGroup = new CanvasExecutorGroup(replayExtent, resolution, pixelRatio, source.getOverlaps(), executorGroupInstructions, layer.getRenderBuffer());\n tile.executorGroups[layerUid].push(renderingReplayGroup);\n };\n var this_1 = this;\n for (var t = 0, tt = sourceTiles.length; t < tt; ++t) {\n _loop_1(t, tt);\n }\n builderState.renderedRevision = revision;\n builderState.renderedZ = tile.sourceZ;\n builderState.renderedRenderOrder = renderOrder;\n builderState.renderedResolution = resolution;\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, callback, declutteredFeatures) {\n var resolution = frameState.viewState.resolution;\n var rotation = frameState.viewState.rotation;\n hitTolerance = hitTolerance == undefined ? 0 : hitTolerance;\n var layer = /** @type {import(\"../../layer/VectorTile.js\").default} */ (this.getLayer());\n var declutter = layer.getDeclutter();\n var source = layer.getSource();\n var tileGrid = source.getTileGridForProjection(frameState.viewState.projection);\n /** @type {!Object<string, boolean>} */\n var features = {};\n var renderedTiles = /** @type {Array<import(\"../../VectorRenderTile.js\").default>} */ (this.renderedTiles);\n var found;\n var i, ii;\n var _loop_2 = function () {\n var tile = renderedTiles[i];\n var tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);\n var tileContainsCoordinate = containsCoordinate(tileExtent, coordinate);\n if (!declutter) {\n // When not decluttering, we only need to consider the tile that contains the given\n // coordinate, because each feature will be rendered for each tile that contains it.\n if (!tileContainsCoordinate) {\n return \"continue\";\n }\n }\n var executorGroups = tile.executorGroups[getUid(layer)];\n for (var t = 0, tt = executorGroups.length; t < tt; ++t) {\n var executorGroup = executorGroups[t];\n found = found || executorGroup.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, \n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @return {?} Callback result.\n */\n function (feature) {\n if (tileContainsCoordinate || (declutteredFeatures && declutteredFeatures.indexOf(feature) !== -1)) {\n var key = feature.getId();\n if (key === undefined) {\n key = getUid(feature);\n }\n if (!(key in features)) {\n features[key] = true;\n return callback(feature, layer);\n }\n }\n }, layer.getDeclutter() ? declutteredFeatures : null);\n }\n };\n for (i = 0, ii = renderedTiles.length; i < ii; ++i) {\n _loop_2();\n }\n return found;\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.getFeatures = function (pixel) {\n return new Promise(function (resolve, reject) {\n var layer = /** @type {import(\"../../layer/VectorTile.js\").default} */ (this.getLayer());\n var source = layer.getSource();\n var projection = this.renderedProjection;\n var projectionExtent = projection.getExtent();\n var resolution = this.renderedResolution;\n var tileGrid = source.getTileGridForProjection(projection);\n var coordinate = applyTransform(this.renderedPixelToCoordinateTransform_, pixel.slice());\n var tileCoord = tileGrid.getTileCoordForCoordAndResolution(coordinate, resolution);\n var tile;\n for (var i = 0, ii = this.renderedTiles.length; i < ii; ++i) {\n if (tileCoord.toString() === this.renderedTiles[i].tileCoord.toString()) {\n tile = this.renderedTiles[i];\n if (tile.getState() === TileState.LOADED && tile.hifi) {\n var extent_1 = tileGrid.getTileCoordExtent(tile.tileCoord);\n if (source.getWrapX() && projection.canWrapX() && !containsExtent(projectionExtent, extent_1)) {\n var worldWidth = getWidth(projectionExtent);\n var worldsAway = Math.floor((coordinate[0] - projectionExtent[0]) / worldWidth);\n coordinate[0] -= (worldsAway * worldWidth);\n }\n break;\n }\n tile = undefined;\n }\n }\n if (!tile) {\n resolve([]);\n return;\n }\n var extent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);\n var corner = getTopLeft(extent);\n var tilePixel = [\n (coordinate[0] - corner[0]) / resolution,\n (corner[1] - coordinate[1]) / resolution\n ];\n var features = tile.getSourceTiles().reduce(function (accumulator, sourceTile) {\n return accumulator.concat(sourceTile.getFeatures());\n }, []);\n if (!tile.hitDetectionImageData) {\n var tileSize_1 = toSize(tileGrid.getTileSize(tileGrid.getZForResolution(resolution)));\n var size = [tileSize_1[0] / 2, tileSize_1[1] / 2];\n var rotation_1 = this.renderedRotation_;\n var transforms_1 = [\n this.getRenderTransform(tileGrid.getTileCoordCenter(tile.wrappedTileCoord), resolution, 0, 0.5, size[0], size[1], 0)\n ];\n requestAnimationFrame(function () {\n tile.hitDetectionImageData = createHitDetectionImageData(tileSize_1, transforms_1, features, layer.getStyleFunction(), tileGrid.getTileCoordExtent(tile.wrappedTileCoord), tile.getReplayState(layer).renderedResolution, rotation_1);\n resolve(hitDetect(tilePixel, features, tile.hitDetectionImageData));\n });\n }\n else {\n resolve(hitDetect(tilePixel, features, tile.hitDetectionImageData));\n }\n }.bind(this));\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.handleFontsChanged = function () {\n clear(this.renderTileImageQueue_);\n var layer = this.getLayer();\n if (layer.getVisible() && this.renderedLayerRevision_ !== undefined) {\n layer.changed();\n }\n };\n /**\n * Handle changes in image style state.\n * @param {import(\"../../events/Event.js\").default} event Image style change event.\n * @private\n */\n CanvasVectorTileLayerRenderer.prototype.handleStyleImageChange_ = function (event) {\n this.renderIfReadyAndVisible();\n };\n /**\n * @inheritDoc\n */\n CanvasVectorTileLayerRenderer.prototype.renderFrame = function (frameState, target) {\n var viewHints = frameState.viewHints;\n var hifi = !(viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]);\n this.renderQueuedTileImages_(hifi, frameState);\n _super.prototype.renderFrame.call(this, frameState, target);\n this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();\n this.renderedRotation_ = frameState.viewState.rotation;\n var layer = /** @type {import(\"../../layer/VectorTile.js\").default} */ (this.getLayer());\n var renderMode = layer.getRenderMode();\n if (renderMode === VectorTileRenderType.IMAGE) {\n return this.container;\n }\n var source = layer.getSource();\n // Unqueue tiles from the image queue when we don't need any more\n var usedTiles = frameState.usedTiles[getUid(source)];\n for (var tileUid in this.renderTileImageQueue_) {\n if (!usedTiles || !(tileUid in usedTiles)) {\n delete this.renderTileImageQueue_[tileUid];\n }\n }\n var context = this.context;\n var declutterReplays = layer.getDeclutter() ? {} : null;\n var replayTypes = VECTOR_REPLAYS[renderMode];\n var pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var center = viewState.center;\n var resolution = viewState.resolution;\n var rotation = viewState.rotation;\n var size = frameState.size;\n var width = Math.round(size[0] * pixelRatio);\n var height = Math.round(size[1] * pixelRatio);\n var tiles = this.renderedTiles;\n var tileGrid = source.getTileGridForProjection(frameState.viewState.projection);\n var clips = [];\n var clipZs = [];\n for (var i = tiles.length - 1; i >= 0; --i) {\n var tile = /** @type {import(\"../../VectorRenderTile.js\").default} */ (tiles[i]);\n if (tile.getState() == TileState.ABORT) {\n continue;\n }\n var tileCoord = tile.tileCoord;\n var tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);\n var worldOffset = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent)[0] - tileExtent[0];\n var transform = multiply(scale(this.inversePixelTransform.slice(), 1 / pixelRatio, 1 / pixelRatio), this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, worldOffset));\n var executorGroups = tile.executorGroups[getUid(layer)];\n var clipped = false;\n for (var t = 0, tt = executorGroups.length; t < tt; ++t) {\n var executorGroup = executorGroups[t];\n if (!executorGroup.hasExecutors(replayTypes)) {\n // sourceTile has no instructions of the types we want to render\n continue;\n }\n var currentZ = tile.tileCoord[0];\n var currentClip = void 0;\n if (!declutterReplays && !clipped) {\n currentClip = executorGroup.getClipCoords(transform);\n context.save();\n // Create a clip mask for regions in this low resolution tile that are\n // already filled by a higher resolution tile\n for (var j = 0, jj = clips.length; j < jj; ++j) {\n var clip = clips[j];\n if (currentZ < clipZs[j]) {\n context.beginPath();\n // counter-clockwise (outer ring) for current tile\n context.moveTo(currentClip[0], currentClip[1]);\n context.lineTo(currentClip[2], currentClip[3]);\n context.lineTo(currentClip[4], currentClip[5]);\n context.lineTo(currentClip[6], currentClip[7]);\n // clockwise (inner ring) for higher resolution tile\n context.moveTo(clip[6], clip[7]);\n context.lineTo(clip[4], clip[5]);\n context.lineTo(clip[2], clip[3]);\n context.lineTo(clip[0], clip[1]);\n context.clip();\n }\n }\n }\n executorGroup.execute(context, transform, rotation, hifi, replayTypes, declutterReplays);\n if (!declutterReplays && !clipped) {\n context.restore();\n clips.push(currentClip);\n clipZs.push(currentZ);\n clipped = true;\n }\n }\n }\n if (declutterReplays) {\n var layerState = frameState.layerStatesArray[frameState.layerIndex];\n replayDeclutter(declutterReplays, context, rotation, layerState.opacity, hifi, frameState.declutterItems);\n }\n return this.container;\n };\n /**\n * @param {boolean} hifi We have time to render a high fidelity map image.\n * @param {import('../../PluggableMap.js').FrameState} frameState Frame state.\n */\n CanvasVectorTileLayerRenderer.prototype.renderQueuedTileImages_ = function (hifi, frameState) {\n // When we don't have time to render hifi, only render tiles until we have used up\n // half of the frame budget of 16 ms\n for (var uid in this.renderTileImageQueue_) {\n if (!hifi && Date.now() - frameState.time > 8) {\n frameState.animate = true;\n break;\n }\n var tile = this.renderTileImageQueue_[uid];\n delete this.renderTileImageQueue_[uid];\n this.renderTileImage_(tile, frameState);\n }\n };\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../../style/Style.js\").default|Array<import(\"../../style/Style.js\").default>} styles The style or array of styles.\n * @param {import(\"../../render/canvas/BuilderGroup.js\").default} executorGroup Replay group.\n * @return {boolean} `true` if an image is loading.\n */\n CanvasVectorTileLayerRenderer.prototype.renderFeature = function (feature, squaredTolerance, styles, executorGroup) {\n if (!styles) {\n return false;\n }\n var loading = false;\n if (Array.isArray(styles)) {\n for (var i = 0, ii = styles.length; i < ii; ++i) {\n loading = renderFeature(executorGroup, feature, styles[i], squaredTolerance, this.boundHandleStyleImageChange_) || loading;\n }\n }\n else {\n loading = renderFeature(executorGroup, feature, styles, squaredTolerance, this.boundHandleStyleImageChange_);\n }\n return loading;\n };\n /**\n * @param {import(\"../../VectorRenderTile.js\").default} tile Tile.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @return {boolean} A new tile image was rendered.\n * @private\n */\n CanvasVectorTileLayerRenderer.prototype.tileImageNeedsRender_ = function (tile, pixelRatio, projection) {\n var layer = /** @type {import(\"../../layer/VectorTile.js\").default} */ (this.getLayer());\n var replayState = tile.getReplayState(layer);\n var revision = layer.getRevision();\n var sourceZ = tile.sourceZ;\n var resolution = tile.wantedResolution;\n return replayState.renderedTileResolution !== resolution || replayState.renderedTileRevision !== revision || replayState.renderedTileZ !== sourceZ;\n };\n /**\n * @param {import(\"../../VectorRenderTile.js\").default} tile Tile.\n * @param {import(\"../../PluggableMap\").FrameState} frameState Frame state.\n * @private\n */\n CanvasVectorTileLayerRenderer.prototype.renderTileImage_ = function (tile, frameState) {\n var layer = /** @type {import(\"../../layer/VectorTile.js\").default} */ (this.getLayer());\n var replayState = tile.getReplayState(layer);\n var revision = layer.getRevision();\n var executorGroups = tile.executorGroups[getUid(layer)];\n replayState.renderedTileRevision = revision;\n replayState.renderedTileZ = tile.sourceZ;\n var tileCoord = tile.wrappedTileCoord;\n var z = tileCoord[0];\n var source = layer.getSource();\n var pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var projection = viewState.projection;\n var tileGrid = source.getTileGridForProjection(projection);\n var tileResolution = tileGrid.getResolution(tile.tileCoord[0]);\n var renderPixelRatio = frameState.pixelRatio / tile.wantedResolution * tileResolution;\n var resolution = tileGrid.getResolution(z);\n var context = tile.getContext(layer);\n // Increase tile size when overzooming for low pixel ratio, to avoid blurry tiles\n pixelRatio = Math.max(pixelRatio, renderPixelRatio / pixelRatio);\n var size = source.getTilePixelSize(z, pixelRatio, projection);\n context.canvas.width = size[0];\n context.canvas.height = size[1];\n var renderScale = pixelRatio / renderPixelRatio;\n if (renderScale !== 1) {\n var canvasTransform = resetTransform(this.tmpTransform_);\n scaleTransform(canvasTransform, renderScale, renderScale);\n context.setTransform.apply(context, canvasTransform);\n }\n var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent);\n var pixelScale = renderPixelRatio / resolution;\n var transform = resetTransform(this.tmpTransform_);\n scaleTransform(transform, pixelScale, -pixelScale);\n translateTransform(transform, -tileExtent[0], -tileExtent[3]);\n for (var i = 0, ii = executorGroups.length; i < ii; ++i) {\n var executorGroup = executorGroups[i];\n executorGroup.execute(context, transform, 0, true, IMAGE_REPLAYS[layer.getRenderMode()]);\n }\n replayState.renderedTileResolution = tile.wantedResolution;\n };\n return CanvasVectorTileLayerRenderer;\n}(CanvasTileLayerRenderer));\nexport default CanvasVectorTileLayerRenderer;\n//# sourceMappingURL=VectorTileLayer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Vector\n */\nimport BaseVectorLayer from './BaseVector.js';\nimport CanvasVectorLayerRenderer from '../renderer/canvas/VectorLayer.js';\n/**\n * @classdesc\n * Vector data that is rendered client-side.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @extends {BaseVectorLayer<import(\"../source/Vector.js\").default>}\n * @api\n */\nvar VectorLayer = /** @class */ (function (_super) {\n __extends(VectorLayer, _super);\n /**\n * @param {import(\"./BaseVector.js\").Options=} opt_options Options.\n */\n function VectorLayer(opt_options) {\n return _super.call(this, opt_options) || this;\n }\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n VectorLayer.prototype.createRenderer = function () {\n return new CanvasVectorLayerRenderer(this);\n };\n return VectorLayer;\n}(BaseVectorLayer));\nexport default VectorLayer;\n//# sourceMappingURL=Vector.js.map","/**\n * @module ol/geom/flat/interpolate\n */\nimport { binarySearch } from '../../array.js';\nimport { lerp } from '../../math.js';\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 {number} fraction Fraction.\n * @param {Array<number>=} opt_dest Destination.\n * @return {Array<number>} Destination.\n */\nexport function interpolatePoint(flatCoordinates, offset, end, stride, fraction, opt_dest) {\n var pointX = NaN;\n var pointY = NaN;\n var n = (end - offset) / stride;\n if (n === 1) {\n pointX = flatCoordinates[offset];\n pointY = flatCoordinates[offset + 1];\n }\n else if (n == 2) {\n pointX = (1 - fraction) * flatCoordinates[offset] +\n fraction * flatCoordinates[offset + stride];\n pointY = (1 - fraction) * flatCoordinates[offset + 1] +\n fraction * flatCoordinates[offset + stride + 1];\n }\n else if (n !== 0) {\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n var length_1 = 0;\n var cumulativeLengths = [0];\n for (var i = offset + stride; i < end; i += stride) {\n var x2 = flatCoordinates[i];\n var y2 = flatCoordinates[i + 1];\n length_1 += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n cumulativeLengths.push(length_1);\n x1 = x2;\n y1 = y2;\n }\n var target = fraction * length_1;\n var index = binarySearch(cumulativeLengths, target);\n if (index < 0) {\n var t = (target - cumulativeLengths[-index - 2]) /\n (cumulativeLengths[-index - 1] - cumulativeLengths[-index - 2]);\n var o = offset + (-index - 2) * stride;\n pointX = lerp(flatCoordinates[o], flatCoordinates[o + stride], t);\n pointY = lerp(flatCoordinates[o + 1], flatCoordinates[o + stride + 1], t);\n }\n else {\n pointX = flatCoordinates[offset + index * stride];\n pointY = flatCoordinates[offset + index * stride + 1];\n }\n }\n if (opt_dest) {\n opt_dest[0] = pointX;\n opt_dest[1] = pointY;\n return opt_dest;\n }\n else {\n return [pointX, pointY];\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 {number} m M.\n * @param {boolean} extrapolate Extrapolate.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\nexport function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, extrapolate) {\n if (end == offset) {\n return null;\n }\n var coordinate;\n if (m < flatCoordinates[offset + stride - 1]) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(offset, offset + stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n else {\n return null;\n }\n }\n else if (flatCoordinates[end - 1] < m) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(end - stride, end);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n else {\n return null;\n }\n }\n // FIXME use O(1) search\n if (m == flatCoordinates[offset + stride - 1]) {\n return flatCoordinates.slice(offset, offset + stride);\n }\n var lo = offset / stride;\n var hi = end / stride;\n while (lo < hi) {\n var mid = (lo + hi) >> 1;\n if (m < flatCoordinates[(mid + 1) * stride - 1]) {\n hi = mid;\n }\n else {\n lo = mid + 1;\n }\n }\n var m0 = flatCoordinates[lo * stride - 1];\n if (m == m0) {\n return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride);\n }\n var m1 = flatCoordinates[(lo + 1) * stride - 1];\n var t = (m - m0) / (m1 - m0);\n coordinate = [];\n for (var i = 0; i < stride - 1; ++i) {\n coordinate.push(lerp(flatCoordinates[(lo - 1) * stride + i], flatCoordinates[lo * stride + i], t));\n }\n coordinate.push(m);\n return coordinate;\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} m M.\n * @param {boolean} extrapolate Extrapolate.\n * @param {boolean} interpolate Interpolate.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\nexport function lineStringsCoordinateAtM(flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {\n if (interpolate) {\n return lineStringCoordinateAtM(flatCoordinates, offset, ends[ends.length - 1], stride, m, extrapolate);\n }\n var coordinate;\n if (m < flatCoordinates[stride - 1]) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(0, stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n else {\n return null;\n }\n }\n if (flatCoordinates[flatCoordinates.length - 1] < m) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(flatCoordinates.length - stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n else {\n return null;\n }\n }\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n if (offset == end) {\n continue;\n }\n if (m < flatCoordinates[offset + stride - 1]) {\n return null;\n }\n else if (m <= flatCoordinates[end - 1]) {\n return lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, false);\n }\n offset = end;\n }\n return null;\n}\n//# sourceMappingURL=interpolate.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/LineString\n */\nimport { extend } from '../array.js';\nimport { closestSquaredDistanceXY } from '../extent.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { assignClosestPoint, maxSquaredDelta } from './flat/closest.js';\nimport { deflateCoordinates } from './flat/deflate.js';\nimport { inflateCoordinates } from './flat/inflate.js';\nimport { interpolatePoint, lineStringCoordinateAtM } from './flat/interpolate.js';\nimport { intersectsLineString } from './flat/intersectsextent.js';\nimport { lineStringLength } from './flat/length.js';\nimport { forEach as forEachSegment } from './flat/segments.js';\nimport { douglasPeucker } from './flat/simplify.js';\n/**\n * @classdesc\n * Linestring geometry.\n *\n * @api\n */\nvar LineString = /** @class */ (function (_super) {\n __extends(LineString, _super);\n /**\n * @param {Array<import(\"../coordinate.js\").Coordinate>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `opt_layout` are also accepted.\n * @param {GeometryLayout=} opt_layout Layout.\n */\n function LineString(coordinates, opt_layout) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.flatMidpoint_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.flatMidpointRevision_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {\n _this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));\n }\n else {\n _this.setCoordinates(/** @type {Array<import(\"../coordinate.js\").Coordinate>} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Append the passed coordinate to the coordinates of the linestring.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @api\n */\n LineString.prototype.appendCoordinate = function (coordinate) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = coordinate.slice();\n }\n else {\n extend(this.flatCoordinates, coordinate);\n }\n this.changed();\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!LineString} Clone.\n * @override\n * @api\n */\n LineString.prototype.clone = function () {\n return new LineString(this.flatCoordinates.slice(), this.layout);\n };\n /**\n * @inheritDoc\n */\n LineString.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(maxSquaredDelta(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestPoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * Iterate over each segment, calling the provided callback.\n * If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n *\n * @param {function(this: S, import(\"../coordinate.js\").Coordinate, import(\"../coordinate.js\").Coordinate): T} callback Function\n * called for each segment. The function will receive two arguments, the start and end coordinates of the segment.\n * @return {T|boolean} Value.\n * @template T,S\n * @api\n */\n LineString.prototype.forEachSegment = function (callback) {\n return forEachSegment(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, callback);\n };\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `opt_extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `opt_extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * @param {number} m M.\n * @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinate.\n * @api\n */\n LineString.prototype.getCoordinateAtM = function (m, opt_extrapolate) {\n if (this.layout != GeometryLayout.XYM &&\n this.layout != GeometryLayout.XYZM) {\n return null;\n }\n var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;\n return lineStringCoordinateAtM(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, m, extrapolate);\n };\n /**\n * Return the coordinates of the linestring.\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates.\n * @override\n * @api\n */\n LineString.prototype.getCoordinates = function () {\n return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * Return the coordinate at the provided fraction along the linestring.\n * The `fraction` is a number between 0 and 1, where 0 is the start of the\n * linestring and 1 is the end.\n * @param {number} fraction Fraction.\n * @param {import(\"../coordinate.js\").Coordinate=} opt_dest Optional coordinate whose values will\n * be modified. If not provided, a new coordinate will be returned.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinate of the interpolated point.\n * @api\n */\n LineString.prototype.getCoordinateAt = function (fraction, opt_dest) {\n return interpolatePoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, fraction, opt_dest);\n };\n /**\n * Return the length of the linestring on projected plane.\n * @return {number} Length (on projected plane).\n * @api\n */\n LineString.prototype.getLength = function () {\n return lineStringLength(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * @return {Array<number>} Flat midpoint.\n */\n LineString.prototype.getFlatMidpoint = function () {\n if (this.flatMidpointRevision_ != this.getRevision()) {\n this.flatMidpoint_ = this.getCoordinateAt(0.5, this.flatMidpoint_);\n this.flatMidpointRevision_ = this.getRevision();\n }\n return this.flatMidpoint_;\n };\n /**\n * @inheritDoc\n */\n LineString.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = douglasPeucker(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return new LineString(simplifiedFlatCoordinates, GeometryLayout.XY);\n };\n /**\n * @inheritDoc\n * @api\n */\n LineString.prototype.getType = function () {\n return GeometryType.LINE_STRING;\n };\n /**\n * @inheritDoc\n * @api\n */\n LineString.prototype.intersectsExtent = function (extent) {\n return intersectsLineString(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);\n };\n /**\n * Set the coordinates of the linestring.\n * @param {!Array<import(\"../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {GeometryLayout=} opt_layout Layout.\n * @override\n * @api\n */\n LineString.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n };\n return LineString;\n}(SimpleGeometry));\nexport default LineString;\n//# sourceMappingURL=LineString.js.map","/**\n * @module ol/geom/flat/geodesic\n */\nimport { squaredSegmentDistance, toRadians, toDegrees } from '../../math.js';\nimport { get as getProjection, getTransform } from '../../proj.js';\n/**\n * @param {function(number): import(\"../../coordinate.js\").Coordinate} interpolate Interpolate function.\n * @param {import(\"../../proj.js\").TransformFunction} transform Transform from longitude/latitude to\n * projected coordinates.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nfunction line(interpolate, transform, squaredTolerance) {\n // FIXME reduce garbage generation\n // FIXME optimize stack operations\n /** @type {Array<number>} */\n var flatCoordinates = [];\n var geoA = interpolate(0);\n var geoB = interpolate(1);\n var a = transform(geoA);\n var b = transform(geoB);\n /** @type {Array<import(\"../../coordinate.js\").Coordinate>} */\n var geoStack = [geoB, geoA];\n /** @type {Array<import(\"../../coordinate.js\").Coordinate>} */\n var stack = [b, a];\n /** @type {Array<number>} */\n var fractionStack = [1, 0];\n /** @type {!Object<string, boolean>} */\n var fractions = {};\n var maxIterations = 1e5;\n var geoM, m, fracA, fracB, fracM, key;\n while (--maxIterations > 0 && fractionStack.length > 0) {\n // Pop the a coordinate off the stack\n fracA = fractionStack.pop();\n geoA = geoStack.pop();\n a = stack.pop();\n // Add the a coordinate if it has not been added yet\n key = fracA.toString();\n if (!(key in fractions)) {\n flatCoordinates.push(a[0], a[1]);\n fractions[key] = true;\n }\n // Pop the b coordinate off the stack\n fracB = fractionStack.pop();\n geoB = geoStack.pop();\n b = stack.pop();\n // Find the m point between the a and b coordinates\n fracM = (fracA + fracB) / 2;\n geoM = interpolate(fracM);\n m = transform(geoM);\n if (squaredSegmentDistance(m[0], m[1], a[0], a[1], b[0], b[1]) < squaredTolerance) {\n // If the m point is sufficiently close to the straight line, then we\n // discard it. Just use the b coordinate and move on to the next line\n // segment.\n flatCoordinates.push(b[0], b[1]);\n key = fracB.toString();\n fractions[key] = true;\n }\n else {\n // Otherwise, we need to subdivide the current line segment. Split it\n // into two and push the two line segments onto the stack.\n fractionStack.push(fracB, fracM, fracM, fracA);\n stack.push(b, m, m, a);\n geoStack.push(geoB, geoM, geoM, geoA);\n }\n }\n return flatCoordinates;\n}\n/**\n * Generate a great-circle arcs between two lat/lon points.\n * @param {number} lon1 Longitude 1 in degrees.\n * @param {number} lat1 Latitude 1 in degrees.\n * @param {number} lon2 Longitude 2 in degrees.\n * @param {number} lat2 Latitude 2 in degrees.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nexport function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolerance) {\n var geoProjection = getProjection('EPSG:4326');\n var cosLat1 = Math.cos(toRadians(lat1));\n var sinLat1 = Math.sin(toRadians(lat1));\n var cosLat2 = Math.cos(toRadians(lat2));\n var sinLat2 = Math.sin(toRadians(lat2));\n var cosDeltaLon = Math.cos(toRadians(lon2 - lon1));\n var sinDeltaLon = Math.sin(toRadians(lon2 - lon1));\n var d = sinLat1 * sinLat2 + cosLat1 * cosLat2 * cosDeltaLon;\n return line(\n /**\n * @param {number} frac Fraction.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\n function (frac) {\n if (1 <= d) {\n return [lon2, lat2];\n }\n var D = frac * Math.acos(d);\n var cosD = Math.cos(D);\n var sinD = Math.sin(D);\n var y = sinDeltaLon * cosLat2;\n var x = cosLat1 * sinLat2 - sinLat1 * cosLat2 * cosDeltaLon;\n var theta = Math.atan2(y, x);\n var lat = Math.asin(sinLat1 * cosD + cosLat1 * sinD * Math.cos(theta));\n var lon = toRadians(lon1) +\n Math.atan2(Math.sin(theta) * sinD * cosLat1, cosD - sinLat1 * Math.sin(lat));\n return [toDegrees(lon), toDegrees(lat)];\n }, getTransform(geoProjection, projection), squaredTolerance);\n}\n/**\n * Generate a meridian (line at constant longitude).\n * @param {number} lon Longitude.\n * @param {number} lat1 Latitude 1.\n * @param {number} lat2 Latitude 2.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nexport function meridian(lon, lat1, lat2, projection, squaredTolerance) {\n var epsg4326Projection = getProjection('EPSG:4326');\n return line(\n /**\n * @param {number} frac Fraction.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\n function (frac) {\n return [lon, lat1 + ((lat2 - lat1) * frac)];\n }, getTransform(epsg4326Projection, projection), squaredTolerance);\n}\n/**\n * Generate a parallel (line at constant latitude).\n * @param {number} lat Latitude.\n * @param {number} lon1 Longitude 1.\n * @param {number} lon2 Longitude 2.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nexport function parallel(lat, lon1, lon2, projection, squaredTolerance) {\n var epsg4326Projection = getProjection('EPSG:4326');\n return line(\n /**\n * @param {number} frac Fraction.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\n function (frac) {\n return [lon1 + ((lon2 - lon1) * frac), lat];\n }, getTransform(epsg4326Projection, projection), squaredTolerance);\n}\n//# sourceMappingURL=geodesic.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Graticule\n */\nimport VectorLayer from './Vector.js';\nimport { assign } from '../obj.js';\nimport { degreesToStringHDMS } from '../coordinate.js';\nimport Text from '../style/Text.js';\nimport Fill from '../style/Fill.js';\nimport Stroke from '../style/Stroke.js';\nimport LineString from '../geom/LineString.js';\nimport VectorSource from '../source/Vector.js';\nimport { equivalent as equivalentProjection, get as getProjection, getTransform, transformExtent } from '../proj.js';\nimport { getCenter, intersects, equals, getIntersection, isEmpty } from '../extent.js';\nimport { clamp } from '../math.js';\nimport Style from '../style/Style.js';\nimport Feature from '../Feature.js';\nimport { bbox } from '../loadingstrategy.js';\nimport { meridian, parallel } from '../geom/flat/geodesic.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport Point from '../geom/Point.js';\nimport Collection from '../Collection.js';\n/**\n * @type {Stroke}\n * @private\n * @const\n */\nvar DEFAULT_STROKE_STYLE = new Stroke({\n color: 'rgba(0,0,0,0.2)'\n});\n/**\n * @type {Array<number>}\n * @private\n */\nvar INTERVALS = [\n 90, 45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01, 0.005, 0.002, 0.001\n];\n/**\n * @typedef {Object} GraticuleLabelDataType\n * @property {Point} geom\n * @property {string} text\n */\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [maxLines=100] The maximum number of meridians and\n * parallels from the center of the map. The default value of 100 means that at\n * most 200 meridians and 200 parallels will be displayed. The default value is\n * appropriate for conformal projections like Spherical Mercator. If you\n * increase the value, more lines will be drawn and the drawing performance will\n * decrease.\n * @property {Stroke} [strokeStyle='rgba(0,0,0,0.2)'] The\n * stroke style to use for drawing the graticule. If not provided, a not fully\n * opaque black will be used.\n * @property {number} [targetSize=100] The target size of the graticule cells,\n * in pixels.\n * @property {boolean} [showLabels=false] Render a label with the respective\n * latitude/longitude for each graticule line.\n * @property {function(number):string} [lonLabelFormatter] Label formatter for\n * longitudes. This function is called with the longitude as argument, and\n * should return a formatted string representing the longitude. By default,\n * labels are formatted as degrees, minutes, seconds and hemisphere.\n * @property {function(number):string} [latLabelFormatter] Label formatter for\n * latitudes. This function is called with the latitude as argument, and\n * should return a formatted string representing the latitude. By default,\n * labels are formatted as degrees, minutes, seconds and hemisphere.\n * @property {number} [lonLabelPosition=0] Longitude label position in fractions\n * (0..1) of view extent. 0 means at the bottom of the viewport, 1 means at the\n * top.\n * @property {number} [latLabelPosition=1] Latitude label position in fractions\n * (0..1) of view extent. 0 means at the left of the viewport, 1 means at the\n * right.\n * @property {Text} [lonLabelStyle] Longitude label text\n * style. If not provided, the following style will be used:\n * ```js\n * new Text({\n * font: '12px Calibri,sans-serif',\n * textBaseline: 'bottom',\n * fill: new Fill({\n * color: 'rgba(0,0,0,1)'\n * }),\n * stroke: new Stroke({\n * color: 'rgba(255,255,255,1)',\n * width: 3\n * })\n * });\n * ```\n * Note that the default's `textBaseline` configuration will not work well for\n * `lonLabelPosition` configurations that position labels close to the top of\n * the viewport.\n * @property {Text} [latLabelStyle] Latitude label text style.\n * If not provided, the following style will be used:\n * ```js\n * new Text({\n * font: '12px Calibri,sans-serif',\n * textAlign: 'end',\n * fill: new Fill({\n * color: 'rgba(0,0,0,1)'\n * }),\n * stroke: Stroke({\n * color: 'rgba(255,255,255,1)',\n * width: 3\n * })\n * });\n * ```\n * Note that the default's `textAlign` configuration will not work well for\n * `latLabelPosition` configurations that position labels close to the left of\n * the viewport.\n * @property {Array<number>} [intervals=[90, 45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01, 0.005, 0.002, 0.001]]\n * Intervals (in degrees) for the graticule. Example to limit graticules to 30 and 10 degrees intervals:\n * ```js\n * [30, 10]\n * ```\n * @property {boolean} [wrapX=true] Whether to repeat the graticule horizontally.\n */\n/**\n * @classdesc\n * Layer that renders a grid for a coordinate system.\n *\n * @fires import(\"../render/Event.js\").RenderEvent\n * @api\n */\nvar Graticule = /** @class */ (function (_super) {\n __extends(Graticule, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Graticule(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var baseOptions = assign({\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n renderBuffer: 0\n }, options);\n delete baseOptions.maxLines;\n delete baseOptions.strokeStyle;\n delete baseOptions.targetSize;\n delete baseOptions.showLabels;\n delete baseOptions.lonLabelFormatter;\n delete baseOptions.latLabelFormatter;\n delete baseOptions.lonLabelPosition;\n delete baseOptions.latLabelPosition;\n delete baseOptions.lonLabelStyle;\n delete baseOptions.latLabelStyle;\n delete baseOptions.intervals;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @type {import(\"../proj/Projection.js\").default}\n */\n _this.projection_ = null;\n /**\n * @type {number}\n * @private\n */\n _this.maxLat_ = Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.maxLon_ = Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.minLat_ = -Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.minLon_ = -Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.maxLatP_ = Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.maxLonP_ = Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.minLatP_ = -Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.minLonP_ = -Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.targetSize_ = options.targetSize !== undefined ? options.targetSize : 100;\n /**\n * @type {number}\n * @private\n */\n _this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;\n /**\n * @type {Array<LineString>}\n * @private\n */\n _this.meridians_ = [];\n /**\n * @type {Array<LineString>}\n * @private\n */\n _this.parallels_ = [];\n /**\n * @type {Stroke}\n * @private\n */\n _this.strokeStyle_ = options.strokeStyle !== undefined ? options.strokeStyle : DEFAULT_STROKE_STYLE;\n /**\n * @type {import(\"../proj.js\").TransformFunction|undefined}\n * @private\n */\n _this.fromLonLatTransform_ = undefined;\n /**\n * @type {import(\"../proj.js\").TransformFunction|undefined}\n * @private\n */\n _this.toLonLatTransform_ = undefined;\n /**\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.projectionCenterLonLat_ = null;\n /**\n * @type {Array<GraticuleLabelDataType>}\n * @private\n */\n _this.meridiansLabels_ = null;\n /**\n * @type {Array<GraticuleLabelDataType>}\n * @private\n */\n _this.parallelsLabels_ = null;\n if (options.showLabels) {\n /**\n * @type {null|function(number):string}\n * @private\n */\n _this.lonLabelFormatter_ = options.lonLabelFormatter == undefined ?\n degreesToStringHDMS.bind(_this, 'EW') : options.lonLabelFormatter;\n /**\n * @type {function(number):string}\n * @private\n */\n _this.latLabelFormatter_ = options.latLabelFormatter == undefined ?\n degreesToStringHDMS.bind(_this, 'NS') : options.latLabelFormatter;\n /**\n * Longitude label position in fractions (0..1) of view extent. 0 means\n * bottom, 1 means top.\n * @type {number}\n * @private\n */\n _this.lonLabelPosition_ = options.lonLabelPosition == undefined ? 0 :\n options.lonLabelPosition;\n /**\n * Latitude Label position in fractions (0..1) of view extent. 0 means left, 1\n * means right.\n * @type {number}\n * @private\n */\n _this.latLabelPosition_ = options.latLabelPosition == undefined ? 1 :\n options.latLabelPosition;\n /**\n * @type {Style}\n * @private\n */\n _this.lonLabelStyleBase_ = new Style({\n text: options.lonLabelStyle !== undefined ? options.lonLabelStyle.clone() :\n new Text({\n font: '12px Calibri,sans-serif',\n textBaseline: 'bottom',\n fill: new Fill({\n color: 'rgba(0,0,0,1)'\n }),\n stroke: new Stroke({\n color: 'rgba(255,255,255,1)',\n width: 3\n })\n })\n });\n /**\n * @private\n * @param {import(\"../Feature\").default} feature Feature\n * @return {Style} style\n */\n _this.lonLabelStyle_ = function (feature) {\n var label = feature.get('graticule_label');\n this.lonLabelStyleBase_.getText().setText(label);\n return this.lonLabelStyleBase_;\n }.bind(_this);\n /**\n * @type {Style}\n * @private\n */\n _this.latLabelStyleBase_ = new Style({\n text: options.latLabelStyle !== undefined ? options.latLabelStyle.clone() :\n new Text({\n font: '12px Calibri,sans-serif',\n textAlign: 'right',\n fill: new Fill({\n color: 'rgba(0,0,0,1)'\n }),\n stroke: new Stroke({\n color: 'rgba(255,255,255,1)',\n width: 3\n })\n })\n });\n /**\n * @private\n * @param {import(\"../Feature\").default} feature Feature\n * @return {Style} style\n */\n _this.latLabelStyle_ = function (feature) {\n var label = feature.get('graticule_label');\n this.latLabelStyleBase_.getText().setText(label);\n return this.latLabelStyleBase_;\n }.bind(_this);\n _this.meridiansLabels_ = [];\n _this.parallelsLabels_ = [];\n }\n /**\n * @type {Array<number>}\n * @private\n */\n _this.intervals_ = options.intervals !== undefined ? options.intervals : INTERVALS;\n // use a source with a custom loader for lines & text\n _this.setSource(new VectorSource({\n loader: _this.loaderFunction.bind(_this),\n strategy: bbox,\n features: new Collection(),\n overlaps: false,\n useSpatialIndex: false,\n wrapX: options.wrapX\n }));\n /**\n * feature pool to use when updating graticule\n * @type {Array<Feature>}\n * @private\n */\n _this.featurePool_ = [];\n /**\n * @type {Style}\n * @private\n */\n _this.lineStyle_ = new Style({\n stroke: _this.strokeStyle_\n });\n /**\n * @type {?import(\"../extent.js\").Extent}\n */\n _this.renderedExtent_ = null;\n _this.setRenderOrder(null);\n _this.tmpExtent_ = null;\n return _this;\n }\n /**\n * Update geometries in the source based on current view\n * @param {import(\"../extent\").Extent} extent Extent\n * @param {number} resolution Resolution\n * @param {import(\"../proj/Projection.js\").default} projection Projection\n */\n Graticule.prototype.loaderFunction = function (extent, resolution, projection) {\n var source = this.getSource();\n // only consider the intersection between our own extent & the requested one\n var layerExtent = this.getExtent() || [-Infinity, -Infinity, Infinity, Infinity];\n var renderExtent = getIntersection(layerExtent, extent, this.tmpExtent_);\n // we should not keep track of loaded extents\n setTimeout(function () {\n source.removeLoadedExtent(extent);\n }, 0);\n if (this.renderedExtent_ && equals(this.renderedExtent_, renderExtent)) {\n return;\n }\n this.renderedExtent_ = renderExtent;\n // bail out if nothing to render\n if (isEmpty(renderExtent)) {\n return;\n }\n // update projection info\n var center = getCenter(renderExtent);\n var squaredTolerance = resolution * resolution / 4;\n var updateProjectionInfo = !this.projection_ ||\n !equivalentProjection(this.projection_, projection);\n if (updateProjectionInfo) {\n this.updateProjectionInfo_(projection);\n }\n this.createGraticule_(renderExtent, center, resolution, squaredTolerance);\n // first make sure we have enough features in the pool\n var featureCount = this.meridians_.length + this.parallels_.length;\n if (this.meridiansLabels_) {\n featureCount += this.meridiansLabels_.length;\n }\n if (this.parallelsLabels_) {\n featureCount += this.parallelsLabels_.length;\n }\n var feature;\n while (featureCount > this.featurePool_.length) {\n feature = new Feature();\n this.featurePool_.push(feature);\n }\n var featuresColl = source.getFeaturesCollection();\n featuresColl.clear();\n var poolIndex = 0;\n // add features for the lines & labels\n var i, l;\n for (i = 0, l = this.meridians_.length; i < l; ++i) {\n feature = this.featurePool_[poolIndex++];\n feature.setGeometry(this.meridians_[i]);\n feature.setStyle(this.lineStyle_);\n featuresColl.push(feature);\n }\n for (i = 0, l = this.parallels_.length; i < l; ++i) {\n feature = this.featurePool_[poolIndex++];\n feature.setGeometry(this.parallels_[i]);\n feature.setStyle(this.lineStyle_);\n featuresColl.push(feature);\n }\n var labelData;\n if (this.meridiansLabels_) {\n for (i = 0, l = this.meridiansLabels_.length; i < l; ++i) {\n labelData = this.meridiansLabels_[i];\n feature = this.featurePool_[poolIndex++];\n feature.setGeometry(labelData.geom);\n feature.setStyle(this.lonLabelStyle_);\n feature.set('graticule_label', labelData.text);\n featuresColl.push(feature);\n }\n }\n if (this.parallelsLabels_) {\n for (i = 0, l = this.parallelsLabels_.length; i < l; ++i) {\n labelData = this.parallelsLabels_[i];\n feature = this.featurePool_[poolIndex++];\n feature.setGeometry(labelData.geom);\n feature.setStyle(this.latLabelStyle_);\n feature.set('graticule_label', labelData.text);\n featuresColl.push(feature);\n }\n }\n };\n /**\n * @param {number} lon Longitude.\n * @param {number} minLat Minimal latitude.\n * @param {number} maxLat Maximal latitude.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} index Index.\n * @return {number} Index.\n * @private\n */\n Graticule.prototype.addMeridian_ = function (lon, minLat, maxLat, squaredTolerance, extent, index) {\n var lineString = this.getMeridian_(lon, minLat, maxLat, squaredTolerance, index);\n if (intersects(lineString.getExtent(), extent)) {\n if (this.meridiansLabels_) {\n var textPoint = this.getMeridianPoint_(lineString, extent, index);\n this.meridiansLabels_[index] = {\n geom: textPoint,\n text: this.lonLabelFormatter_(lon)\n };\n }\n this.meridians_[index++] = lineString;\n }\n return index;\n };\n /**\n * @param {number} lat Latitude.\n * @param {number} minLon Minimal longitude.\n * @param {number} maxLon Maximal longitude.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} index Index.\n * @return {number} Index.\n * @private\n */\n Graticule.prototype.addParallel_ = function (lat, minLon, maxLon, squaredTolerance, extent, index) {\n var lineString = this.getParallel_(lat, minLon, maxLon, squaredTolerance, index);\n if (intersects(lineString.getExtent(), extent)) {\n if (this.parallelsLabels_) {\n var textPoint = this.getParallelPoint_(lineString, extent, index);\n this.parallelsLabels_[index] = {\n geom: textPoint,\n text: this.latLabelFormatter_(lat)\n };\n }\n this.parallels_[index++] = lineString;\n }\n return index;\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {import(\"../coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} squaredTolerance Squared tolerance.\n * @private\n */\n Graticule.prototype.createGraticule_ = function (extent, center, resolution, squaredTolerance) {\n var interval = this.getInterval_(resolution);\n if (interval == -1) {\n this.meridians_.length = 0;\n this.parallels_.length = 0;\n if (this.meridiansLabels_) {\n this.meridiansLabels_.length = 0;\n }\n if (this.parallelsLabels_) {\n this.parallelsLabels_.length = 0;\n }\n return;\n }\n var centerLonLat = this.toLonLatTransform_(center);\n var centerLon = centerLonLat[0];\n var centerLat = centerLonLat[1];\n var maxLines = this.maxLines_;\n var cnt, idx, lat, lon;\n var validExtent = [\n Math.max(extent[0], this.minLonP_),\n Math.max(extent[1], this.minLatP_),\n Math.min(extent[2], this.maxLonP_),\n Math.min(extent[3], this.maxLatP_)\n ];\n validExtent = transformExtent(validExtent, this.projection_, 'EPSG:4326');\n var maxLat = validExtent[3];\n var maxLon = validExtent[2];\n var minLat = validExtent[1];\n var minLon = validExtent[0];\n // Create meridians\n centerLon = Math.floor(centerLon / interval) * interval;\n lon = clamp(centerLon, this.minLon_, this.maxLon_);\n idx = this.addMeridian_(lon, minLat, maxLat, squaredTolerance, extent, 0);\n cnt = 0;\n while (lon != this.minLon_ && cnt++ < maxLines) {\n lon = Math.max(lon - interval, this.minLon_);\n idx = this.addMeridian_(lon, minLat, maxLat, squaredTolerance, extent, idx);\n }\n lon = clamp(centerLon, this.minLon_, this.maxLon_);\n cnt = 0;\n while (lon != this.maxLon_ && cnt++ < maxLines) {\n lon = Math.min(lon + interval, this.maxLon_);\n idx = this.addMeridian_(lon, minLat, maxLat, squaredTolerance, extent, idx);\n }\n this.meridians_.length = idx;\n if (this.meridiansLabels_) {\n this.meridiansLabels_.length = idx;\n }\n // Create parallels\n centerLat = Math.floor(centerLat / interval) * interval;\n lat = clamp(centerLat, this.minLat_, this.maxLat_);\n idx = this.addParallel_(lat, minLon, maxLon, squaredTolerance, extent, 0);\n cnt = 0;\n while (lat != this.minLat_ && cnt++ < maxLines) {\n lat = Math.max(lat - interval, this.minLat_);\n idx = this.addParallel_(lat, minLon, maxLon, squaredTolerance, extent, idx);\n }\n lat = clamp(centerLat, this.minLat_, this.maxLat_);\n cnt = 0;\n while (lat != this.maxLat_ && cnt++ < maxLines) {\n lat = Math.min(lat + interval, this.maxLat_);\n idx = this.addParallel_(lat, minLon, maxLon, squaredTolerance, extent, idx);\n }\n this.parallels_.length = idx;\n if (this.parallelsLabels_) {\n this.parallelsLabels_.length = idx;\n }\n };\n /**\n * @param {number} resolution Resolution.\n * @return {number} The interval in degrees.\n * @private\n */\n Graticule.prototype.getInterval_ = function (resolution) {\n var centerLon = this.projectionCenterLonLat_[0];\n var centerLat = this.projectionCenterLonLat_[1];\n var interval = -1;\n var target = Math.pow(this.targetSize_ * resolution, 2);\n /** @type {Array<number>} **/\n var p1 = [];\n /** @type {Array<number>} **/\n var p2 = [];\n for (var i = 0, ii = this.intervals_.length; i < ii; ++i) {\n var delta = this.intervals_[i] / 2;\n p1[0] = centerLon - delta;\n p1[1] = centerLat - delta;\n p2[0] = centerLon + delta;\n p2[1] = centerLat + delta;\n this.fromLonLatTransform_(p1, p1);\n this.fromLonLatTransform_(p2, p2);\n var dist = Math.pow(p2[0] - p1[0], 2) + Math.pow(p2[1] - p1[1], 2);\n if (dist <= target) {\n break;\n }\n interval = this.intervals_[i];\n }\n return interval;\n };\n /**\n * @param {number} lon Longitude.\n * @param {number} minLat Minimal latitude.\n * @param {number} maxLat Maximal latitude.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LineString} The meridian line string.\n * @param {number} index Index.\n * @private\n */\n Graticule.prototype.getMeridian_ = function (lon, minLat, maxLat, squaredTolerance, index) {\n var flatCoordinates = meridian(lon, minLat, maxLat, this.projection_, squaredTolerance);\n var lineString = this.meridians_[index];\n if (!lineString) {\n lineString = new LineString(flatCoordinates, GeometryLayout.XY);\n this.meridians_[index] = lineString;\n }\n else {\n lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);\n lineString.changed();\n }\n return lineString;\n };\n /**\n * @param {LineString} lineString Meridian\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} index Index.\n * @return {Point} Meridian point.\n * @private\n */\n Graticule.prototype.getMeridianPoint_ = function (lineString, extent, index) {\n var flatCoordinates = lineString.getFlatCoordinates();\n var clampedBottom = Math.max(extent[1], flatCoordinates[1]);\n var clampedTop = Math.min(extent[3], flatCoordinates[flatCoordinates.length - 1]);\n var lat = clamp(extent[1] + Math.abs(extent[1] - extent[3]) * this.lonLabelPosition_, clampedBottom, clampedTop);\n var coordinate = [flatCoordinates[0], lat];\n var point;\n if (index in this.meridiansLabels_) {\n point = this.meridiansLabels_[index].geom;\n point.setCoordinates(coordinate);\n }\n else {\n point = new Point(coordinate);\n }\n return point;\n };\n /**\n * Get the list of meridians. Meridians are lines of equal longitude.\n * @return {Array<LineString>} The meridians.\n * @api\n */\n Graticule.prototype.getMeridians = function () {\n return this.meridians_;\n };\n /**\n * @param {number} lat Latitude.\n * @param {number} minLon Minimal longitude.\n * @param {number} maxLon Maximal longitude.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LineString} The parallel line string.\n * @param {number} index Index.\n * @private\n */\n Graticule.prototype.getParallel_ = function (lat, minLon, maxLon, squaredTolerance, index) {\n var flatCoordinates = parallel(lat, minLon, maxLon, this.projection_, squaredTolerance);\n var lineString = this.parallels_[index];\n if (!lineString) {\n lineString = new LineString(flatCoordinates, GeometryLayout.XY);\n }\n else {\n lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);\n lineString.changed();\n }\n return lineString;\n };\n /**\n * @param {LineString} lineString Parallels.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} index Index.\n * @return {Point} Parallel point.\n * @private\n */\n Graticule.prototype.getParallelPoint_ = function (lineString, extent, index) {\n var flatCoordinates = lineString.getFlatCoordinates();\n var clampedLeft = Math.max(extent[0], flatCoordinates[0]);\n var clampedRight = Math.min(extent[2], flatCoordinates[flatCoordinates.length - 2]);\n var lon = clamp(extent[0] + Math.abs(extent[0] - extent[2]) * this.latLabelPosition_, clampedLeft, clampedRight);\n var coordinate = [lon, flatCoordinates[1]];\n var point;\n if (index in this.parallelsLabels_) {\n point = this.parallelsLabels_[index].geom;\n point.setCoordinates(coordinate);\n }\n else {\n point = new Point(coordinate);\n }\n return point;\n };\n /**\n * Get the list of parallels. Parallels are lines of equal latitude.\n * @return {Array<LineString>} The parallels.\n * @api\n */\n Graticule.prototype.getParallels = function () {\n return this.parallels_;\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @private\n */\n Graticule.prototype.updateProjectionInfo_ = function (projection) {\n var epsg4326Projection = getProjection('EPSG:4326');\n var worldExtent = projection.getWorldExtent();\n var worldExtentP = transformExtent(worldExtent, epsg4326Projection, projection);\n this.maxLat_ = worldExtent[3];\n this.maxLon_ = worldExtent[2];\n this.minLat_ = worldExtent[1];\n this.minLon_ = worldExtent[0];\n this.maxLatP_ = worldExtentP[3];\n this.maxLonP_ = worldExtentP[2];\n this.minLatP_ = worldExtentP[1];\n this.minLonP_ = worldExtentP[0];\n this.fromLonLatTransform_ = getTransform(epsg4326Projection, projection);\n this.toLonLatTransform_ = getTransform(projection, epsg4326Projection);\n this.projectionCenterLonLat_ = this.toLonLatTransform_(getCenter(projection.getExtent()));\n this.projection_ = projection;\n };\n return Graticule;\n}(VectorLayer));\nexport default Graticule;\n//# sourceMappingURL=Graticule.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Heatmap\n */\nimport { getChangeEventType } from '../Object.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport VectorLayer from './Vector.js';\nimport { clamp } from '../math.js';\nimport { assign } from '../obj.js';\nimport WebGLPointsLayerRenderer from '../renderer/webgl/PointsLayer.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {Array<string>} [gradient=['#00f', '#0ff', '#0f0', '#ff0', '#f00']] The color gradient\n * of the heatmap, specified as an array of CSS color strings.\n * @property {number} [radius=8] Radius size in pixels.\n * @property {number} [blur=15] Blur size in pixels.\n * @property {string|function(import(\"../Feature.js\").default):number} [weight='weight'] The feature\n * attribute to use for the weight or a function that returns a weight from a feature. Weight values\n * should range from 0 to 1 (and values outside will be clamped to that range).\n * @property {import(\"../source/Vector.js\").default} [source] Source.\n */\n/**\n * @enum {string}\n * @private\n */\nvar Property = {\n BLUR: 'blur',\n GRADIENT: 'gradient',\n RADIUS: 'radius'\n};\n/**\n * @const\n * @type {Array<string>}\n */\nvar DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];\n/**\n * @classdesc\n * Layer for rendering vector data as a heatmap.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @fires import(\"../render/Event.js\").RenderEvent\n * @api\n */\nvar Heatmap = /** @class */ (function (_super) {\n __extends(Heatmap, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Heatmap(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var baseOptions = assign({}, options);\n delete baseOptions.gradient;\n delete baseOptions.radius;\n delete baseOptions.blur;\n delete baseOptions.weight;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.gradient_ = null;\n _this.addEventListener(getChangeEventType(Property.GRADIENT), _this.handleGradientChanged_);\n _this.setGradient(options.gradient ? options.gradient : DEFAULT_GRADIENT);\n _this.setBlur(options.blur !== undefined ? options.blur : 15);\n _this.setRadius(options.radius !== undefined ? options.radius : 8);\n var weight = options.weight ? options.weight : 'weight';\n if (typeof weight === 'string') {\n _this.weightFunction_ = function (feature) {\n return feature.get(weight);\n };\n }\n else {\n _this.weightFunction_ = weight;\n }\n // For performance reasons, don't sort the features before rendering.\n // The render order is not relevant for a heatmap representation.\n _this.setRenderOrder(null);\n return _this;\n }\n /**\n * Return the blur size in pixels.\n * @return {number} Blur size in pixels.\n * @api\n * @observable\n */\n Heatmap.prototype.getBlur = function () {\n return /** @type {number} */ (this.get(Property.BLUR));\n };\n /**\n * Return the gradient colors as array of strings.\n * @return {Array<string>} Colors.\n * @api\n * @observable\n */\n Heatmap.prototype.getGradient = function () {\n return /** @type {Array<string>} */ (this.get(Property.GRADIENT));\n };\n /**\n * Return the size of the radius in pixels.\n * @return {number} Radius size in pixel.\n * @api\n * @observable\n */\n Heatmap.prototype.getRadius = function () {\n return /** @type {number} */ (this.get(Property.RADIUS));\n };\n /**\n * @private\n */\n Heatmap.prototype.handleGradientChanged_ = function () {\n this.gradient_ = createGradient(this.getGradient());\n };\n /**\n * Set the blur size in pixels.\n * @param {number} blur Blur size in pixels.\n * @api\n * @observable\n */\n Heatmap.prototype.setBlur = function (blur) {\n this.set(Property.BLUR, blur);\n };\n /**\n * Set the gradient colors as array of strings.\n * @param {Array<string>} colors Gradient.\n * @api\n * @observable\n */\n Heatmap.prototype.setGradient = function (colors) {\n this.set(Property.GRADIENT, colors);\n };\n /**\n * Set the size of the radius in pixels.\n * @param {number} radius Radius size in pixel.\n * @api\n * @observable\n */\n Heatmap.prototype.setRadius = function (radius) {\n this.set(Property.RADIUS, radius);\n };\n /**\n * @inheritDoc\n */\n Heatmap.prototype.createRenderer = function () {\n return new WebGLPointsLayerRenderer(this, {\n attributes: [\n {\n name: 'weight',\n callback: function (feature) {\n var weight = this.weightFunction_(feature);\n return weight !== undefined ? clamp(weight, 0, 1) : 1;\n }.bind(this)\n }\n ],\n vertexShader: \"\\n precision mediump float;\\n uniform mat4 u_projectionMatrix;\\n uniform mat4 u_offsetScaleMatrix;\\n uniform float u_size;\\n attribute vec2 a_position;\\n attribute float a_index;\\n attribute float a_weight;\\n\\n varying vec2 v_texCoord;\\n varying float v_weight;\\n\\n void main(void) {\\n mat4 offsetMatrix = u_offsetScaleMatrix;\\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\\n v_texCoord = vec2(u, v);\\n v_weight = a_weight;\\n }\",\n fragmentShader: \"\\n precision mediump float;\\n uniform float u_blurSlope;\\n\\n varying vec2 v_texCoord;\\n varying float v_weight;\\n\\n void main(void) {\\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\\n }\",\n hitVertexShader: \"\\n precision mediump float;\\n uniform mat4 u_projectionMatrix;\\n uniform mat4 u_offsetScaleMatrix;\\n uniform float u_size;\\n attribute vec2 a_position;\\n attribute float a_index;\\n attribute float a_weight;\\n attribute vec4 a_hitColor;\\n\\n varying vec2 v_texCoord;\\n varying float v_weight;\\n varying vec4 v_hitColor;\\n\\n void main(void) {\\n mat4 offsetMatrix = u_offsetScaleMatrix;\\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\\n v_texCoord = vec2(u, v);\\n v_hitColor = a_hitColor;\\n v_weight = a_weight;\\n }\",\n hitFragmentShader: \"\\n precision mediump float;\\n uniform float u_blurSlope;\\n\\n varying vec2 v_texCoord;\\n varying float v_weight;\\n varying vec4 v_hitColor;\\n\\n void main(void) {\\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\\n if (alpha < 0.05) {\\n discard;\\n }\\n\\n gl_FragColor = v_hitColor;\\n }\",\n uniforms: {\n u_size: function () {\n return (this.get(Property.RADIUS) + this.get(Property.BLUR)) * 2;\n }.bind(this),\n u_blurSlope: function () {\n return this.get(Property.RADIUS) / Math.max(1, this.get(Property.BLUR));\n }.bind(this)\n },\n postProcesses: [\n {\n fragmentShader: \"\\n precision mediump float;\\n\\n uniform sampler2D u_image;\\n uniform sampler2D u_gradientTexture;\\n\\n varying vec2 v_texCoord;\\n\\n void main() {\\n vec4 color = texture2D(u_image, v_texCoord);\\n gl_FragColor.a = color.a;\\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\\n gl_FragColor.rgb *= gl_FragColor.a;\\n }\",\n uniforms: {\n u_gradientTexture: this.gradient_\n }\n }\n ]\n });\n };\n return Heatmap;\n}(VectorLayer));\n/**\n * @param {Array<string>} colors A list of colored.\n * @return {HTMLCanvasElement} canvas with gradient texture.\n */\nfunction createGradient(colors) {\n var width = 1;\n var height = 256;\n var context = createCanvasContext2D(width, height);\n var gradient = context.createLinearGradient(0, 0, width, height);\n var step = 1 / (colors.length - 1);\n for (var i = 0, ii = colors.length; i < ii; ++i) {\n gradient.addColorStop(i * step, colors[i]);\n }\n context.fillStyle = gradient;\n context.fillRect(0, 0, width, height);\n return context.canvas;\n}\nexport default Heatmap;\n//# sourceMappingURL=Heatmap.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/VectorImage\n */\nimport BaseVectorLayer from './BaseVector.js';\nimport { assign } from '../obj.js';\nimport CanvasVectorImageLayerRenderer from '../renderer/canvas/VectorImageLayer.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {import(\"../render.js\").OrderFunction} [renderOrder] Render order. Function to be used when sorting\n * features before rendering. By default features are drawn in the order that they are created. Use\n * `null` to avoid the sort, but get an undefined draw order.\n * @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the\n * renderer when getting features from the vector source for the rendering or hit-detection.\n * Recommended value: the size of the largest symbol, line width or label.\n * @property {import(\"../source/Vector.js\").default} [source] Source.\n * @property {import(\"../PluggableMap.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use {@link module:ol/Map#addLayer}.\n * @property {boolean} [declutter=false] Declutter images and text on this layer. The priority is defined\n * by the `zIndex` of the style and the render order of features. Higher z-index means higher priority.\n * Within the same z-index, a feature rendered before another has higher priority.\n * @property {import(\"../style/Style.js\").StyleLike} [style] Layer style. See\n * {@link module:ol/style} for default style which will be used if this is not defined.\n * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will\n * be recreated during animations. This means that no vectors will be shown clipped, but the\n * setting will have a performance impact for large amounts of vector data. When set to `false`,\n * batches will be recreated when no animation is active.\n * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will\n * be recreated during interactions. See also `updateWhileAnimating`.\n * @property {number} [imageRatio=1] Ratio by which the rendered extent should be larger than the\n * viewport extent. A larger ratio avoids cut images during panning, but will cause a decrease in performance.\n */\n/**\n * @classdesc\n * Vector data that is rendered client-side.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @api\n */\nvar VectorImageLayer = /** @class */ (function (_super) {\n __extends(VectorImageLayer, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function VectorImageLayer(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var baseOptions = assign({}, options);\n delete baseOptions.imageRatio;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @type {number}\n * @private\n */\n _this.imageRatio_ = options.imageRatio !== undefined ? options.imageRatio : 1;\n return _this;\n }\n /**\n * @return {number} Ratio between rendered extent size and viewport extent size.\n */\n VectorImageLayer.prototype.getImageRatio = function () {\n return this.imageRatio_;\n };\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n VectorImageLayer.prototype.createRenderer = function () {\n return new CanvasVectorImageLayerRenderer(this);\n };\n return VectorImageLayer;\n}(BaseVectorLayer));\nexport default VectorImageLayer;\n//# sourceMappingURL=VectorImage.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/VectorTile\n */\nimport { assert } from '../asserts.js';\nimport TileProperty from './TileProperty.js';\nimport BaseVectorLayer from './BaseVector.js';\nimport VectorTileRenderType from './VectorTileRenderType.js';\nimport CanvasVectorTileLayerRenderer from '../renderer/canvas/VectorTileLayer.js';\nimport { assign } from '../obj.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {import(\"../render.js\").OrderFunction} [renderOrder] Render order. Function to be used when sorting\n * features before rendering. By default features are drawn in the order that they are created. Use\n * `null` to avoid the sort, but get an undefined draw order.\n * @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the\n * renderer when getting features from the vector tile for the rendering or hit-detection.\n * Recommended value: Vector tiles are usually generated with a buffer, so this value should match\n * the largest possible buffer of the used tiles. It should be at least the size of the largest\n * point symbol or line width.\n * @property {import(\"./VectorTileRenderType.js\").default|string} [renderMode='hybrid'] Render mode for vector tiles:\n * * `'image'`: Vector tiles are rendered as images. Great performance, but point symbols and texts\n * are always rotated with the view and pixels are scaled during zoom animations. When `declutter`\n * is set to `true`, the decluttering is done per tile resulting in labels and point symbols getting\n * cut off at tile boundaries.\n * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom\n * animations. Point symbols and texts are accurately rendered as vectors and can stay upright on\n * rotated views.\n *\n * @property {import(\"../source/VectorTile.js\").default} [source] Source.\n * @property {import(\"../PluggableMap.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use {@link module:ol/Map#addLayer}.\n * @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all\n * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority\n * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.\n * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has\n * higher priority.\n * @property {import(\"../style/Style.js\").StyleLike} [style] Layer style. See\n * {@link module:ol/style} for default style which will be used if this is not defined.\n * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be\n * recreated during animations. This means that no vectors will be shown clipped, but the setting\n * will have a performance impact for large amounts of vector data. When set to `false`, batches\n * will be recreated when no animation is active.\n * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will be\n * recreated during interactions. See also `updateWhileAnimating`.\n * @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`\n * means no preloading.\n * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.\n */\n/**\n * @classdesc\n * Layer for vector tile data that is rendered client-side.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @param {Options=} opt_options Options.\n * @extends {BaseVectorLayer<import(\"../source/VectorTile.js\").default>}\n * @api\n */\nvar VectorTileLayer = /** @class */ (function (_super) {\n __extends(VectorTileLayer, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function VectorTileLayer(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var baseOptions = /** @type {Object} */ (assign({}, options));\n delete baseOptions.preload;\n delete baseOptions.useInterimTilesOnError;\n _this = _super.call(this, /** @type {import(\"./BaseVector.js\").Options} */ (baseOptions)) || this;\n var renderMode = options.renderMode || VectorTileRenderType.HYBRID;\n assert(renderMode == undefined ||\n renderMode == VectorTileRenderType.IMAGE ||\n renderMode == VectorTileRenderType.HYBRID, 28); // `renderMode` must be `'image'` or `'hybrid'`\n /**\n * @private\n * @type {VectorTileRenderType}\n */\n _this.renderMode_ = renderMode;\n _this.setPreload(options.preload ? options.preload : 0);\n _this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?\n options.useInterimTilesOnError : true);\n return _this;\n }\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n VectorTileLayer.prototype.createRenderer = function () {\n return new CanvasVectorTileLayerRenderer(this);\n };\n /**\n * Get the topmost feature that intersects the given pixel on the viewport. Returns a promise\n * that resolves with an array of features. The array will either contain the topmost feature\n * when a hit was detected, or it will be empty.\n *\n * The hit detection algorithm used for this method is optimized for performance, but is less\n * accurate than the one used in {@link import(\"../PluggableMap.js\").default#getFeaturesAtPixel}: Text\n * is not considered, and icons are only represented by their bounding box instead of the exact\n * image.\n *\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").default>>} Promise that resolves with an array of features.\n * @api\n */\n VectorTileLayer.prototype.getFeatures = function (pixel) {\n return _super.prototype.getFeatures.call(this, pixel);\n };\n /**\n * @return {VectorTileRenderType} The render mode.\n */\n VectorTileLayer.prototype.getRenderMode = function () {\n return this.renderMode_;\n };\n /**\n * Return the level as number to which we will preload tiles up to.\n * @return {number} The level to preload tiles up to.\n * @observable\n * @api\n */\n VectorTileLayer.prototype.getPreload = function () {\n return /** @type {number} */ (this.get(TileProperty.PRELOAD));\n };\n /**\n * Whether we use interim tiles on error.\n * @return {boolean} Use interim tiles on error.\n * @observable\n * @api\n */\n VectorTileLayer.prototype.getUseInterimTilesOnError = function () {\n return /** @type {boolean} */ (this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR));\n };\n /**\n * Set the level as number to which we will preload tiles up to.\n * @param {number} preload The level to preload tiles up to.\n * @observable\n * @api\n */\n VectorTileLayer.prototype.setPreload = function (preload) {\n this.set(TileProperty.PRELOAD, preload);\n };\n /**\n * Set whether we use interim tiles on error.\n * @param {boolean} useInterimTilesOnError Use interim tiles on error.\n * @observable\n * @api\n */\n VectorTileLayer.prototype.setUseInterimTilesOnError = function (useInterimTilesOnError) {\n this.set(TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);\n };\n return VectorTileLayer;\n}(BaseVectorLayer));\nexport default VectorTileLayer;\n//# sourceMappingURL=VectorTile.js.map","/**\n * @module ol/interaction/DragAndDrop\n */\n// FIXME should handle all geo-referenced data, not just vector data\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { TRUE } from '../functions.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport Event from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport Interaction from './Interaction.js';\nimport { get as getProjection } from '../proj.js';\n/**\n * @typedef {Object} Options\n * @property {Array<typeof import(\"../format/Feature.js\").default>} [formatConstructors] Format constructors.\n * @property {import(\"../source/Vector.js\").default} [source] Optional vector source where features will be added. If a source is provided\n * all existing features will be removed and new features will be added when\n * they are dropped on the target. If you want to add features to a vector\n * source without removing the existing features (append only), instead of\n * providing the source option listen for the \"addfeatures\" event.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Target projection. By default, the map's view's projection is used.\n * @property {HTMLElement} [target] The element that is used as the drop target, default is the viewport element.\n */\n/**\n * @enum {string}\n */\nvar DragAndDropEventType = {\n /**\n * Triggered when features are added\n * @event DragAndDropEvent#addfeatures\n * @api\n */\n ADD_FEATURES: 'addfeatures'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/DragAndDrop~DragAndDrop} instances are instances\n * of this type.\n */\nvar DragAndDropEvent = /** @class */ (function (_super) {\n __extends(DragAndDropEvent, _super);\n /**\n * @param {DragAndDropEventType} type Type.\n * @param {File} file File.\n * @param {Array<import(\"../Feature.js\").default>=} opt_features Features.\n * @param {import(\"../proj/Projection.js\").default=} opt_projection Projection.\n */\n function DragAndDropEvent(type, file, opt_features, opt_projection) {\n var _this = _super.call(this, type) || this;\n /**\n * The features parsed from dropped data.\n * @type {Array<import(\"../Feature.js\").FeatureLike>|undefined}\n * @api\n */\n _this.features = opt_features;\n /**\n * The dropped file.\n * @type {File}\n * @api\n */\n _this.file = file;\n /**\n * The feature projection.\n * @type {import(\"../proj/Projection.js\").default|undefined}\n * @api\n */\n _this.projection = opt_projection;\n return _this;\n }\n return DragAndDropEvent;\n}(Event));\n/**\n * @classdesc\n * Handles input of vector data by drag and drop.\n * @api\n *\n * @fires DragAndDropEvent\n */\nvar DragAndDrop = /** @class */ (function (_super) {\n __extends(DragAndDrop, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DragAndDrop(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n handleEvent: TRUE\n }) || this;\n /**\n * @private\n * @type {Array<typeof import(\"../format/Feature.js\").default>}\n */\n _this.formatConstructors_ = options.formatConstructors ?\n options.formatConstructors : [];\n /**\n * @private\n * @type {import(\"../proj/Projection.js\").default}\n */\n _this.projection_ = options.projection ?\n getProjection(options.projection) : null;\n /**\n * @private\n * @type {?Array<import(\"../events.js\").EventsKey>}\n */\n _this.dropListenKeys_ = null;\n /**\n * @private\n * @type {import(\"../source/Vector.js\").default}\n */\n _this.source_ = options.source || null;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.target = options.target ? options.target : null;\n return _this;\n }\n /**\n * @param {File} file File.\n * @param {Event} event Load event.\n * @private\n */\n DragAndDrop.prototype.handleResult_ = function (file, event) {\n var result = event.target.result;\n var map = this.getMap();\n var projection = this.projection_;\n if (!projection) {\n var view = map.getView();\n projection = view.getProjection();\n }\n var formatConstructors = this.formatConstructors_;\n var features = [];\n for (var i = 0, ii = formatConstructors.length; i < ii; ++i) {\n var format = new formatConstructors[i]();\n features = this.tryReadFeatures_(format, result, {\n featureProjection: projection\n });\n if (features && features.length > 0) {\n break;\n }\n }\n if (this.source_) {\n this.source_.clear();\n this.source_.addFeatures(features);\n }\n this.dispatchEvent(new DragAndDropEvent(DragAndDropEventType.ADD_FEATURES, file, features, projection));\n };\n /**\n * @private\n */\n DragAndDrop.prototype.registerListeners_ = function () {\n var map = this.getMap();\n if (map) {\n var dropArea = this.target ? this.target : map.getViewport();\n this.dropListenKeys_ = [\n listen(dropArea, EventType.DROP, handleDrop, this),\n listen(dropArea, EventType.DRAGENTER, handleStop, this),\n listen(dropArea, EventType.DRAGOVER, handleStop, this),\n listen(dropArea, EventType.DROP, handleStop, this)\n ];\n }\n };\n /**\n * @inheritDoc\n */\n DragAndDrop.prototype.setActive = function (active) {\n if (!this.getActive() && active) {\n this.registerListeners_();\n }\n if (this.getActive() && !active) {\n this.unregisterListeners_();\n }\n _super.prototype.setActive.call(this, active);\n };\n /**\n * @inheritDoc\n */\n DragAndDrop.prototype.setMap = function (map) {\n this.unregisterListeners_();\n _super.prototype.setMap.call(this, map);\n if (this.getActive()) {\n this.registerListeners_();\n }\n };\n /**\n * @param {import(\"../format/Feature.js\").default} format Format.\n * @param {string} text Text.\n * @param {import(\"../format/Feature.js\").ReadOptions} options Read options.\n * @private\n * @return {Array<import(\"../Feature.js\").FeatureLike>} Features.\n */\n DragAndDrop.prototype.tryReadFeatures_ = function (format, text, options) {\n try {\n return format.readFeatures(text, options);\n }\n catch (e) {\n return null;\n }\n };\n /**\n * @private\n */\n DragAndDrop.prototype.unregisterListeners_ = function () {\n if (this.dropListenKeys_) {\n this.dropListenKeys_.forEach(unlistenByKey);\n this.dropListenKeys_ = null;\n }\n };\n return DragAndDrop;\n}(Interaction));\n/**\n * @param {DragEvent} event Event.\n * @this {DragAndDrop}\n */\nfunction handleDrop(event) {\n var files = event.dataTransfer.files;\n for (var i = 0, ii = files.length; i < ii; ++i) {\n var file = files.item(i);\n var reader = new FileReader();\n reader.addEventListener(EventType.LOAD, this.handleResult_.bind(this, file));\n reader.readAsText(file);\n }\n}\n/**\n * @param {DragEvent} event Event.\n */\nfunction handleStop(event) {\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = 'copy';\n}\nexport default DragAndDrop;\n//# sourceMappingURL=DragAndDrop.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DragRotateAndZoom\n */\nimport { shiftKeyOnly, mouseOnly } from '../events/condition.js';\nimport PointerInteraction from './Pointer.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition~shiftKeyOnly}.\n * @property {number} [duration=400] Animation duration in milliseconds.\n */\n/**\n * @classdesc\n * Allows the user to zoom and rotate the map by clicking and dragging\n * on the map. By default, this interaction is limited to when the shift\n * key is held down.\n *\n * This interaction is only supported for mouse devices.\n *\n * And this interaction is not included in the default interactions.\n * @api\n */\nvar DragRotateAndZoom = /** @class */ (function (_super) {\n __extends(DragRotateAndZoom, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function DragRotateAndZoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : shiftKeyOnly;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastAngle_ = undefined;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastMagnitude_ = undefined;\n /**\n * @private\n * @type {number}\n */\n _this.lastScaleDelta_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 400;\n return _this;\n }\n /**\n * @inheritDoc\n */\n DragRotateAndZoom.prototype.handleDragEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return;\n }\n var map = mapBrowserEvent.map;\n var size = map.getSize();\n var offset = mapBrowserEvent.pixel;\n var deltaX = offset[0] - size[0] / 2;\n var deltaY = size[1] / 2 - offset[1];\n var theta = Math.atan2(deltaY, deltaX);\n var magnitude = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n var view = map.getView();\n if (this.lastAngle_ !== undefined) {\n var angleDelta = this.lastAngle_ - theta;\n view.adjustRotationInternal(angleDelta);\n }\n this.lastAngle_ = theta;\n if (this.lastMagnitude_ !== undefined) {\n view.adjustResolutionInternal(this.lastMagnitude_ / magnitude);\n }\n if (this.lastMagnitude_ !== undefined) {\n this.lastScaleDelta_ = this.lastMagnitude_ / magnitude;\n }\n this.lastMagnitude_ = magnitude;\n };\n /**\n * @inheritDoc\n */\n DragRotateAndZoom.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return true;\n }\n var map = mapBrowserEvent.map;\n var view = map.getView();\n var direction = this.lastScaleDelta_ > 1 ? 1 : -1;\n view.endInteraction(this.duration_, direction);\n this.lastScaleDelta_ = 0;\n return false;\n };\n /**\n * @inheritDoc\n */\n DragRotateAndZoom.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (!mouseOnly(mapBrowserEvent)) {\n return false;\n }\n if (this.condition_(mapBrowserEvent)) {\n mapBrowserEvent.map.getView().beginInteraction();\n this.lastAngle_ = undefined;\n this.lastMagnitude_ = undefined;\n return true;\n }\n else {\n return false;\n }\n };\n return DragRotateAndZoom;\n}(PointerInteraction));\nexport default DragRotateAndZoom;\n//# sourceMappingURL=DragRotateAndZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Circle\n */\nimport { createOrUpdate, forEachCorner, intersects } from '../extent.js';\nimport GeometryType from './GeometryType.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { deflateCoordinate } from './flat/deflate.js';\nimport { rotate, translate } from './flat/transform.js';\n/**\n * @classdesc\n * Circle geometry.\n *\n * @api\n */\nvar Circle = /** @class */ (function (_super) {\n __extends(Circle, _super);\n /**\n * @param {!import(\"../coordinate.js\").Coordinate} center Center.\n * For internal use, flat coordinates in combination with `opt_layout` and no\n * `opt_radius` are also accepted.\n * @param {number=} opt_radius Radius.\n * @param {import(\"./GeometryLayout.js\").default=} opt_layout Layout.\n */\n function Circle(center, opt_radius, opt_layout) {\n var _this = _super.call(this) || this;\n if (opt_layout !== undefined && opt_radius === undefined) {\n _this.setFlatCoordinates(opt_layout, center);\n }\n else {\n var radius = opt_radius ? opt_radius : 0;\n _this.setCenterAndRadius(center, radius, opt_layout);\n }\n return _this;\n }\n /**\n * Make a complete copy of the geometry.\n * @return {!Circle} Clone.\n * @override\n * @api\n */\n Circle.prototype.clone = function () {\n return new Circle(this.flatCoordinates.slice(), undefined, this.layout);\n };\n /**\n * @inheritDoc\n */\n Circle.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n var flatCoordinates = this.flatCoordinates;\n var dx = x - flatCoordinates[0];\n var dy = y - flatCoordinates[1];\n var squaredDistance = dx * dx + dy * dy;\n if (squaredDistance < minSquaredDistance) {\n if (squaredDistance === 0) {\n for (var i = 0; i < this.stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n }\n else {\n var delta = this.getRadius() / Math.sqrt(squaredDistance);\n closestPoint[0] = flatCoordinates[0] + delta * dx;\n closestPoint[1] = flatCoordinates[1] + delta * dy;\n for (var i = 2; i < this.stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n }\n closestPoint.length = this.stride;\n return squaredDistance;\n }\n else {\n return minSquaredDistance;\n }\n };\n /**\n * @inheritDoc\n */\n Circle.prototype.containsXY = function (x, y) {\n var flatCoordinates = this.flatCoordinates;\n var dx = x - flatCoordinates[0];\n var dy = y - flatCoordinates[1];\n return dx * dx + dy * dy <= this.getRadiusSquared_();\n };\n /**\n * Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.\n * @return {import(\"../coordinate.js\").Coordinate} Center.\n * @api\n */\n Circle.prototype.getCenter = function () {\n return this.flatCoordinates.slice(0, this.stride);\n };\n /**\n * @inheritDoc\n */\n Circle.prototype.computeExtent = function (extent) {\n var flatCoordinates = this.flatCoordinates;\n var radius = flatCoordinates[this.stride] - flatCoordinates[0];\n return createOrUpdate(flatCoordinates[0] - radius, flatCoordinates[1] - radius, flatCoordinates[0] + radius, flatCoordinates[1] + radius, extent);\n };\n /**\n * Return the radius of the circle.\n * @return {number} Radius.\n * @api\n */\n Circle.prototype.getRadius = function () {\n return Math.sqrt(this.getRadiusSquared_());\n };\n /**\n * @private\n * @return {number} Radius squared.\n */\n Circle.prototype.getRadiusSquared_ = function () {\n var dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0];\n var dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];\n return dx * dx + dy * dy;\n };\n /**\n * @inheritDoc\n * @api\n */\n Circle.prototype.getType = function () {\n return GeometryType.CIRCLE;\n };\n /**\n * @inheritDoc\n * @api\n */\n Circle.prototype.intersectsExtent = function (extent) {\n var circleExtent = this.getExtent();\n if (intersects(extent, circleExtent)) {\n var center = this.getCenter();\n if (extent[0] <= center[0] && extent[2] >= center[0]) {\n return true;\n }\n if (extent[1] <= center[1] && extent[3] >= center[1]) {\n return true;\n }\n return forEachCorner(extent, this.intersectsCoordinate.bind(this));\n }\n return false;\n };\n /**\n * Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} center Center.\n * @api\n */\n Circle.prototype.setCenter = function (center) {\n var stride = this.stride;\n var radius = this.flatCoordinates[stride] - this.flatCoordinates[0];\n var flatCoordinates = center.slice();\n flatCoordinates[stride] = flatCoordinates[0] + radius;\n for (var i = 1; i < stride; ++i) {\n flatCoordinates[stride + i] = center[i];\n }\n this.setFlatCoordinates(this.layout, flatCoordinates);\n this.changed();\n };\n /**\n * Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as\n * number) of the circle.\n * @param {!import(\"../coordinate.js\").Coordinate} center Center.\n * @param {number} radius Radius.\n * @param {import(\"./GeometryLayout.js\").default=} opt_layout Layout.\n * @api\n */\n Circle.prototype.setCenterAndRadius = function (center, radius, opt_layout) {\n this.setLayout(opt_layout, center, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n /** @type {Array<number>} */\n var flatCoordinates = this.flatCoordinates;\n var offset = deflateCoordinate(flatCoordinates, 0, center, this.stride);\n flatCoordinates[offset++] = flatCoordinates[0] + radius;\n for (var i = 1, ii = this.stride; i < ii; ++i) {\n flatCoordinates[offset++] = flatCoordinates[i];\n }\n flatCoordinates.length = offset;\n this.changed();\n };\n /**\n * @inheritDoc\n */\n Circle.prototype.getCoordinates = function () {\n return null;\n };\n /**\n * @inheritDoc\n */\n Circle.prototype.setCoordinates = function (coordinates, opt_layout) { };\n /**\n * Set the radius of the circle. The radius is in the units of the projection.\n * @param {number} radius Radius.\n * @api\n */\n Circle.prototype.setRadius = function (radius) {\n this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;\n this.changed();\n };\n /**\n * @inheritDoc\n * @api\n */\n Circle.prototype.rotate = function (angle, anchor) {\n var center = this.getCenter();\n var stride = this.getStride();\n this.setCenter(rotate(center, 0, center.length, stride, angle, anchor, center));\n this.changed();\n };\n /**\n * @inheritDoc\n * @api\n */\n Circle.prototype.translate = function (deltaX, deltaY) {\n var center = this.getCenter();\n var stride = this.getStride();\n this.setCenter(translate(center, 0, center.length, stride, deltaX, deltaY, center));\n this.changed();\n };\n return Circle;\n}(SimpleGeometry));\n/**\n * Transform each coordinate of the circle from one coordinate reference system\n * to another. The geometry is modified in place.\n * If you do not want the geometry modified in place, first clone() it and\n * then use this function on the clone.\n *\n * Internally a circle is currently represented by two points: the center of\n * the circle `[cx, cy]`, and the point to the right of the circle\n * `[cx + r, cy]`. This `transform` function just transforms these two points.\n * So the resulting geometry is also a circle, and that circle does not\n * correspond to the shape that would be obtained by transforming every point\n * of the original circle.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {Circle} This geometry. Note that original geometry is\n * modified in place.\n * @function\n * @api\n */\nCircle.prototype.transform;\nexport default Circle;\n//# sourceMappingURL=Circle.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/MultiLineString\n */\nimport { extend } from '../array.js';\nimport { closestSquaredDistanceXY } from '../extent.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport LineString from './LineString.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { assignClosestArrayPoint, arrayMaxSquaredDelta } from './flat/closest.js';\nimport { deflateCoordinatesArray } from './flat/deflate.js';\nimport { inflateCoordinatesArray } from './flat/inflate.js';\nimport { interpolatePoint, lineStringsCoordinateAtM } from './flat/interpolate.js';\nimport { intersectsLineStringArray } from './flat/intersectsextent.js';\nimport { douglasPeuckerArray } from './flat/simplify.js';\n/**\n * @classdesc\n * Multi-linestring geometry.\n *\n * @api\n */\nvar MultiLineString = /** @class */ (function (_super) {\n __extends(MultiLineString, _super);\n /**\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>|LineString>|Array<number>} coordinates\n * Coordinates or LineString geometries. (For internal use, flat coordinates in\n * combination with `opt_layout` and `opt_ends` are also accepted.)\n * @param {GeometryLayout=} opt_layout Layout.\n * @param {Array<number>=} opt_ends Flat coordinate ends for internal use.\n */\n function MultiLineString(coordinates, opt_layout, opt_ends) {\n var _this = _super.call(this) || this;\n /**\n * @type {Array<number>}\n * @private\n */\n _this.ends_ = [];\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n if (Array.isArray(coordinates[0])) {\n _this.setCoordinates(/** @type {Array<Array<import(\"../coordinate.js\").Coordinate>>} */ (coordinates), opt_layout);\n }\n else if (opt_layout !== undefined && opt_ends) {\n _this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));\n _this.ends_ = opt_ends;\n }\n else {\n var layout = _this.getLayout();\n var lineStrings = /** @type {Array<LineString>} */ (coordinates);\n var flatCoordinates = [];\n var ends = [];\n for (var i = 0, ii = lineStrings.length; i < ii; ++i) {\n var lineString = lineStrings[i];\n if (i === 0) {\n layout = lineString.getLayout();\n }\n extend(flatCoordinates, lineString.getFlatCoordinates());\n ends.push(flatCoordinates.length);\n }\n _this.setFlatCoordinates(layout, flatCoordinates);\n _this.ends_ = ends;\n }\n return _this;\n }\n /**\n * Append the passed linestring to the multilinestring.\n * @param {LineString} lineString LineString.\n * @api\n */\n MultiLineString.prototype.appendLineString = function (lineString) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = lineString.getFlatCoordinates().slice();\n }\n else {\n extend(this.flatCoordinates, lineString.getFlatCoordinates().slice());\n }\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiLineString} Clone.\n * @override\n * @api\n */\n MultiLineString.prototype.clone = function () {\n return new MultiLineString(this.flatCoordinates.slice(), this.layout, this.ends_.slice());\n };\n /**\n * @inheritDoc\n */\n MultiLineString.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates, 0, this.ends_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestArrayPoint(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `opt_extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `opt_extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * `opt_interpolate` controls interpolation between consecutive LineStrings\n * within the MultiLineString. If `opt_interpolate` is `true` the coordinates\n * will be linearly interpolated between the last coordinate of one LineString\n * and the first coordinate of the next LineString. If `opt_interpolate` is\n * `false` then the function will return `null` for Ms falling between\n * LineStrings.\n *\n * @param {number} m M.\n * @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.\n * @param {boolean=} opt_interpolate Interpolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinate.\n * @api\n */\n MultiLineString.prototype.getCoordinateAtM = function (m, opt_extrapolate, opt_interpolate) {\n if ((this.layout != GeometryLayout.XYM &&\n this.layout != GeometryLayout.XYZM) ||\n this.flatCoordinates.length === 0) {\n return null;\n }\n var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;\n var interpolate = opt_interpolate !== undefined ? opt_interpolate : false;\n return lineStringsCoordinateAtM(this.flatCoordinates, 0, this.ends_, this.stride, m, extrapolate, interpolate);\n };\n /**\n * Return the coordinates of the multilinestring.\n * @return {Array<Array<import(\"../coordinate.js\").Coordinate>>} Coordinates.\n * @override\n * @api\n */\n MultiLineString.prototype.getCoordinates = function () {\n return inflateCoordinatesArray(this.flatCoordinates, 0, this.ends_, this.stride);\n };\n /**\n * @return {Array<number>} Ends.\n */\n MultiLineString.prototype.getEnds = function () {\n return this.ends_;\n };\n /**\n * Return the linestring at the specified index.\n * @param {number} index Index.\n * @return {LineString} LineString.\n * @api\n */\n MultiLineString.prototype.getLineString = function (index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new LineString(this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);\n };\n /**\n * Return the linestrings of this multilinestring.\n * @return {Array<LineString>} LineStrings.\n * @api\n */\n MultiLineString.prototype.getLineStrings = function () {\n var flatCoordinates = this.flatCoordinates;\n var ends = this.ends_;\n var layout = this.layout;\n /** @type {Array<LineString>} */\n var lineStrings = [];\n var offset = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var lineString = new LineString(flatCoordinates.slice(offset, end), layout);\n lineStrings.push(lineString);\n offset = end;\n }\n return lineStrings;\n };\n /**\n * @return {Array<number>} Flat midpoints.\n */\n MultiLineString.prototype.getFlatMidpoints = function () {\n var midpoints = [];\n var flatCoordinates = this.flatCoordinates;\n var offset = 0;\n var ends = this.ends_;\n var stride = this.stride;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var midpoint = interpolatePoint(flatCoordinates, offset, end, stride, 0.5);\n extend(midpoints, midpoint);\n offset = end;\n }\n return midpoints;\n };\n /**\n * @inheritDoc\n */\n MultiLineString.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n var simplifiedEnds = [];\n simplifiedFlatCoordinates.length = douglasPeuckerArray(this.flatCoordinates, 0, this.ends_, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0, simplifiedEnds);\n return new MultiLineString(simplifiedFlatCoordinates, GeometryLayout.XY, simplifiedEnds);\n };\n /**\n * @inheritDoc\n * @api\n */\n MultiLineString.prototype.getType = function () {\n return GeometryType.MULTI_LINE_STRING;\n };\n /**\n * @inheritDoc\n * @api\n */\n MultiLineString.prototype.intersectsExtent = function (extent) {\n return intersectsLineStringArray(this.flatCoordinates, 0, this.ends_, this.stride, extent);\n };\n /**\n * Set the coordinates of the multilinestring.\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>} coordinates Coordinates.\n * @param {GeometryLayout=} opt_layout Layout.\n * @override\n * @api\n */\n MultiLineString.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n var ends = deflateCoordinatesArray(this.flatCoordinates, 0, coordinates, this.stride, this.ends_);\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n };\n return MultiLineString;\n}(SimpleGeometry));\nexport default MultiLineString;\n//# sourceMappingURL=MultiLineString.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/MultiPoint\n */\nimport { extend } from '../array.js';\nimport { closestSquaredDistanceXY, containsXY } from '../extent.js';\nimport GeometryType from './GeometryType.js';\nimport Point from './Point.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { deflateCoordinates } from './flat/deflate.js';\nimport { inflateCoordinates } from './flat/inflate.js';\nimport { squaredDistance as squaredDx } from '../math.js';\n/**\n * @classdesc\n * Multi-point geometry.\n *\n * @api\n */\nvar MultiPoint = /** @class */ (function (_super) {\n __extends(MultiPoint, _super);\n /**\n * @param {Array<import(\"../coordinate.js\").Coordinate>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `opt_layout` are also accepted.\n * @param {import(\"./GeometryLayout.js\").default=} opt_layout Layout.\n */\n function MultiPoint(coordinates, opt_layout) {\n var _this = _super.call(this) || this;\n if (opt_layout && !Array.isArray(coordinates[0])) {\n _this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));\n }\n else {\n _this.setCoordinates(/** @type {Array<import(\"../coordinate.js\").Coordinate>} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Append the passed point to this multipoint.\n * @param {Point} point Point.\n * @api\n */\n MultiPoint.prototype.appendPoint = function (point) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = point.getFlatCoordinates().slice();\n }\n else {\n extend(this.flatCoordinates, point.getFlatCoordinates());\n }\n this.changed();\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiPoint} Clone.\n * @override\n * @api\n */\n MultiPoint.prototype.clone = function () {\n var multiPoint = new MultiPoint(this.flatCoordinates.slice(), this.layout);\n return multiPoint;\n };\n /**\n * @inheritDoc\n */\n MultiPoint.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n var flatCoordinates = this.flatCoordinates;\n var stride = this.stride;\n for (var i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n var squaredDistance = squaredDx(x, y, flatCoordinates[i], flatCoordinates[i + 1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (var j = 0; j < stride; ++j) {\n closestPoint[j] = flatCoordinates[i + j];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n };\n /**\n * Return the coordinates of the multipoint.\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates.\n * @override\n * @api\n */\n MultiPoint.prototype.getCoordinates = function () {\n return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * Return the point at the specified index.\n * @param {number} index Index.\n * @return {Point} Point.\n * @api\n */\n MultiPoint.prototype.getPoint = function (index) {\n var n = !this.flatCoordinates ? 0 : this.flatCoordinates.length / this.stride;\n if (index < 0 || n <= index) {\n return null;\n }\n return new Point(this.flatCoordinates.slice(index * this.stride, (index + 1) * this.stride), this.layout);\n };\n /**\n * Return the points of this multipoint.\n * @return {Array<Point>} Points.\n * @api\n */\n MultiPoint.prototype.getPoints = function () {\n var flatCoordinates = this.flatCoordinates;\n var layout = this.layout;\n var stride = this.stride;\n /** @type {Array<Point>} */\n var points = [];\n for (var i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n var point = new Point(flatCoordinates.slice(i, i + stride), layout);\n points.push(point);\n }\n return points;\n };\n /**\n * @inheritDoc\n * @api\n */\n MultiPoint.prototype.getType = function () {\n return GeometryType.MULTI_POINT;\n };\n /**\n * @inheritDoc\n * @api\n */\n MultiPoint.prototype.intersectsExtent = function (extent) {\n var flatCoordinates = this.flatCoordinates;\n var stride = this.stride;\n for (var i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n var x = flatCoordinates[i];\n var y = flatCoordinates[i + 1];\n if (containsXY(extent, x, y)) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set the coordinates of the multipoint.\n * @param {!Array<import(\"../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default=} opt_layout Layout.\n * @override\n * @api\n */\n MultiPoint.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n };\n return MultiPoint;\n}(SimpleGeometry));\nexport default MultiPoint;\n//# sourceMappingURL=MultiPoint.js.map","/**\n * @module ol/geom/flat/center\n */\nimport { createEmpty, createOrUpdateFromFlatCoordinates } from '../../extent.js';\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @return {Array<number>} Flat centers.\n */\nexport function linearRingss(flatCoordinates, offset, endss, stride) {\n var flatCenters = [];\n var extent = createEmpty();\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n extent = createOrUpdateFromFlatCoordinates(flatCoordinates, offset, ends[0], stride);\n flatCenters.push((extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2);\n offset = ends[ends.length - 1];\n }\n return flatCenters;\n}\n//# sourceMappingURL=center.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/MultiPolygon\n */\nimport { extend } from '../array.js';\nimport { closestSquaredDistanceXY } from '../extent.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport MultiPoint from './MultiPoint.js';\nimport Polygon from './Polygon.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { linearRingss as linearRingssArea } from './flat/area.js';\nimport { linearRingss as linearRingssCenter } from './flat/center.js';\nimport { assignClosestMultiArrayPoint, multiArrayMaxSquaredDelta } from './flat/closest.js';\nimport { linearRingssContainsXY } from './flat/contains.js';\nimport { deflateMultiCoordinatesArray } from './flat/deflate.js';\nimport { inflateMultiCoordinatesArray } from './flat/inflate.js';\nimport { getInteriorPointsOfMultiArray } from './flat/interiorpoint.js';\nimport { intersectsLinearRingMultiArray } from './flat/intersectsextent.js';\nimport { linearRingssAreOriented, orientLinearRingsArray } from './flat/orient.js';\nimport { quantizeMultiArray } from './flat/simplify.js';\n/**\n * @classdesc\n * Multi-polygon geometry.\n *\n * @api\n */\nvar MultiPolygon = /** @class */ (function (_super) {\n __extends(MultiPolygon, _super);\n /**\n * @param {Array<Array<Array<import(\"../coordinate.js\").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `opt_layout` and `opt_endss` are also accepted.\n * @param {GeometryLayout=} opt_layout Layout.\n * @param {Array<Array<number>>=} opt_endss Array of ends for internal use with flat coordinates.\n */\n function MultiPolygon(coordinates, opt_layout, opt_endss) {\n var _this = _super.call(this) || this;\n /**\n * @type {Array<Array<number>>}\n * @private\n */\n _this.endss_ = [];\n /**\n * @private\n * @type {number}\n */\n _this.flatInteriorPointsRevision_ = -1;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.flatInteriorPoints_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.orientedRevision_ = -1;\n /**\n * @private\n * @type {Array<number>}\n */\n _this.orientedFlatCoordinates_ = null;\n if (!opt_endss && !Array.isArray(coordinates[0])) {\n var layout = _this.getLayout();\n var polygons = /** @type {Array<Polygon>} */ (coordinates);\n var flatCoordinates = [];\n var endss = [];\n for (var i = 0, ii = polygons.length; i < ii; ++i) {\n var polygon = polygons[i];\n if (i === 0) {\n layout = polygon.getLayout();\n }\n var offset = flatCoordinates.length;\n var ends = polygon.getEnds();\n for (var j = 0, jj = ends.length; j < jj; ++j) {\n ends[j] += offset;\n }\n extend(flatCoordinates, polygon.getFlatCoordinates());\n endss.push(ends);\n }\n opt_layout = layout;\n coordinates = flatCoordinates;\n opt_endss = endss;\n }\n if (opt_layout !== undefined && opt_endss) {\n _this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));\n _this.endss_ = opt_endss;\n }\n else {\n _this.setCoordinates(/** @type {Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Append the passed polygon to this multipolygon.\n * @param {Polygon} polygon Polygon.\n * @api\n */\n MultiPolygon.prototype.appendPolygon = function (polygon) {\n /** @type {Array<number>} */\n var ends;\n if (!this.flatCoordinates) {\n this.flatCoordinates = polygon.getFlatCoordinates().slice();\n ends = polygon.getEnds().slice();\n this.endss_.push();\n }\n else {\n var offset = this.flatCoordinates.length;\n extend(this.flatCoordinates, polygon.getFlatCoordinates());\n ends = polygon.getEnds().slice();\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n ends[i] += offset;\n }\n }\n this.endss_.push(ends);\n this.changed();\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiPolygon} Clone.\n * @override\n * @api\n */\n MultiPolygon.prototype.clone = function () {\n var len = this.endss_.length;\n var newEndss = new Array(len);\n for (var i = 0; i < len; ++i) {\n newEndss[i] = this.endss_[i].slice();\n }\n return new MultiPolygon(this.flatCoordinates.slice(), this.layout, newEndss);\n };\n /**\n * @inheritDoc\n */\n MultiPolygon.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(multiArrayMaxSquaredDelta(this.flatCoordinates, 0, this.endss_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestMultiArrayPoint(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * @inheritDoc\n */\n MultiPolygon.prototype.containsXY = function (x, y) {\n return linearRingssContainsXY(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, x, y);\n };\n /**\n * Return the area of the multipolygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n MultiPolygon.prototype.getArea = function () {\n return linearRingssArea(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride);\n };\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for multi-polygons.\n *\n * @param {boolean=} opt_right Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>} Coordinates.\n * @override\n * @api\n */\n MultiPolygon.prototype.getCoordinates = function (opt_right) {\n var flatCoordinates;\n if (opt_right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n orientLinearRingsArray(flatCoordinates, 0, this.endss_, this.stride, opt_right);\n }\n else {\n flatCoordinates = this.flatCoordinates;\n }\n return inflateMultiCoordinatesArray(flatCoordinates, 0, this.endss_, this.stride);\n };\n /**\n * @return {Array<Array<number>>} Endss.\n */\n MultiPolygon.prototype.getEndss = function () {\n return this.endss_;\n };\n /**\n * @return {Array<number>} Flat interior points.\n */\n MultiPolygon.prototype.getFlatInteriorPoints = function () {\n if (this.flatInteriorPointsRevision_ != this.getRevision()) {\n var flatCenters = linearRingssCenter(this.flatCoordinates, 0, this.endss_, this.stride);\n this.flatInteriorPoints_ = getInteriorPointsOfMultiArray(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, flatCenters);\n this.flatInteriorPointsRevision_ = this.getRevision();\n }\n return this.flatInteriorPoints_;\n };\n /**\n * Return the interior points as {@link module:ol/geom/MultiPoint multipoint}.\n * @return {MultiPoint} Interior points as XYM coordinates, where M is\n * the length of the horizontal intersection that the point belongs to.\n * @api\n */\n MultiPolygon.prototype.getInteriorPoints = function () {\n return new MultiPoint(this.getFlatInteriorPoints().slice(), GeometryLayout.XYM);\n };\n /**\n * @return {Array<number>} Oriented flat coordinates.\n */\n MultiPolygon.prototype.getOrientedFlatCoordinates = function () {\n if (this.orientedRevision_ != this.getRevision()) {\n var flatCoordinates = this.flatCoordinates;\n if (linearRingssAreOriented(flatCoordinates, 0, this.endss_, this.stride)) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n }\n else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length =\n orientLinearRingsArray(this.orientedFlatCoordinates_, 0, this.endss_, this.stride);\n }\n this.orientedRevision_ = this.getRevision();\n }\n return this.orientedFlatCoordinates_;\n };\n /**\n * @inheritDoc\n */\n MultiPolygon.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n var simplifiedEndss = [];\n simplifiedFlatCoordinates.length = quantizeMultiArray(this.flatCoordinates, 0, this.endss_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEndss);\n return new MultiPolygon(simplifiedFlatCoordinates, GeometryLayout.XY, simplifiedEndss);\n };\n /**\n * Return the polygon at the specified index.\n * @param {number} index Index.\n * @return {Polygon} Polygon.\n * @api\n */\n MultiPolygon.prototype.getPolygon = function (index) {\n if (index < 0 || this.endss_.length <= index) {\n return null;\n }\n var offset;\n if (index === 0) {\n offset = 0;\n }\n else {\n var prevEnds = this.endss_[index - 1];\n offset = prevEnds[prevEnds.length - 1];\n }\n var ends = this.endss_[index].slice();\n var end = ends[ends.length - 1];\n if (offset !== 0) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n ends[i] -= offset;\n }\n }\n return new Polygon(this.flatCoordinates.slice(offset, end), this.layout, ends);\n };\n /**\n * Return the polygons of this multipolygon.\n * @return {Array<Polygon>} Polygons.\n * @api\n */\n MultiPolygon.prototype.getPolygons = function () {\n var layout = this.layout;\n var flatCoordinates = this.flatCoordinates;\n var endss = this.endss_;\n var polygons = [];\n var offset = 0;\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i].slice();\n var end = ends[ends.length - 1];\n if (offset !== 0) {\n for (var j = 0, jj = ends.length; j < jj; ++j) {\n ends[j] -= offset;\n }\n }\n var polygon = new Polygon(flatCoordinates.slice(offset, end), layout, ends);\n polygons.push(polygon);\n offset = end;\n }\n return polygons;\n };\n /**\n * @inheritDoc\n * @api\n */\n MultiPolygon.prototype.getType = function () {\n return GeometryType.MULTI_POLYGON;\n };\n /**\n * @inheritDoc\n * @api\n */\n MultiPolygon.prototype.intersectsExtent = function (extent) {\n return intersectsLinearRingMultiArray(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, extent);\n };\n /**\n * Set the coordinates of the multipolygon.\n * @param {!Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>} coordinates Coordinates.\n * @param {GeometryLayout=} opt_layout Layout.\n * @override\n * @api\n */\n MultiPolygon.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 3);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n var endss = deflateMultiCoordinatesArray(this.flatCoordinates, 0, coordinates, this.stride, this.endss_);\n if (endss.length === 0) {\n this.flatCoordinates.length = 0;\n }\n else {\n var lastEnds = endss[endss.length - 1];\n this.flatCoordinates.length = lastEnds.length === 0 ?\n 0 : lastEnds[lastEnds.length - 1];\n }\n this.changed();\n };\n return MultiPolygon;\n}(SimpleGeometry));\nexport default MultiPolygon;\n//# sourceMappingURL=MultiPolygon.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Draw\n */\nimport EventType from '../events/EventType.js';\nimport Feature from '../Feature.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport MapBrowserPointerEvent from '../MapBrowserPointerEvent.js';\nimport { getChangeEventType } from '../Object.js';\nimport { squaredDistance as squaredCoordinateDistance } from '../coordinate.js';\nimport Event from '../events/Event.js';\nimport { noModifierKeys, always, shiftKeyOnly } from '../events/condition.js';\nimport { boundingExtent, getBottomLeft, getBottomRight, getTopLeft, getTopRight } from '../extent.js';\nimport { TRUE, FALSE } from '../functions.js';\nimport Circle from '../geom/Circle.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon, { fromCircle, makeRegular } from '../geom/Polygon.js';\nimport PointerInteraction from './Pointer.js';\nimport InteractionProperty from './Property.js';\nimport VectorLayer from '../layer/Vector.js';\nimport VectorSource from '../source/Vector.js';\nimport { createEditingStyle } from '../style/Style.js';\n/**\n * @typedef {Object} Options\n * @property {GeometryType} type Geometry type of\n * the geometries being drawn with this instance.\n * @property {number} [clickTolerance=6] The maximum distance in pixels between\n * \"down\" and \"up\" for a \"up\" event to be considered a \"click\" event and\n * actually add a point/vertex to the geometry being drawn. The default of `6`\n * was chosen for the draw interaction to behave correctly on mouse as well as\n * on touch devices.\n * @property {import(\"../Collection.js\").default<Feature>} [features]\n * Destination collection for the drawn features.\n * @property {VectorSource} [source] Destination source for\n * the drawn features.\n * @property {number} [dragVertexDelay=500] Delay in milliseconds after pointerdown\n * before the current vertex can be dragged to its exact position.\n * @property {number} [snapTolerance=12] Pixel distance for snapping to the\n * drawing finish.\n * @property {boolean} [stopClick=false] Stop click, singleclick, and\n * doubleclick events from firing during drawing.\n * @property {number} [maxPoints] The number of points that can be drawn before\n * a polygon ring or line string is finished. By default there is no\n * restriction.\n * @property {number} [minPoints] The number of points that must be drawn\n * before a polygon ring or line string can be finished. Default is `3` for\n * polygon rings and `2` for line strings.\n * @property {import(\"../events/condition.js\").Condition} [finishCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether the drawing can be finished.\n * @property {import(\"../style/Style.js\").StyleLike} [style]\n * Style for sketch features.\n * @property {GeometryFunction} [geometryFunction]\n * Function that is called when a geometry's coordinates are updated.\n * @property {string} [geometryName] Geometry name to use for features created\n * by the draw interaction.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default {@link module:ol/events/condition~noModifierKeys}, i.e. a click,\n * adds a vertex or deactivates freehand drawing.\n * @property {boolean} [freehand=false] Operate in freehand mode for lines,\n * polygons, and circles. This makes the interaction always operate in freehand\n * mode and takes precedence over any `freehandCondition` option.\n * @property {import(\"../events/condition.js\").Condition} [freehandCondition]\n * Condition that activates freehand drawing for lines and polygons. This\n * function takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and\n * returns a boolean to indicate whether that event should be handled. The\n * default is {@link module:ol/events/condition~shiftKeyOnly}, meaning that the\n * Shift key activates freehand drawing.\n * @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch\n * overlay.\n */\n/**\n * Coordinate type when drawing points.\n * @typedef {import(\"../coordinate.js\").Coordinate} PointCoordType\n */\n/**\n * Coordinate type when drawing lines.\n * @typedef {Array<import(\"../coordinate.js\").Coordinate>} LineCoordType\n */\n/**\n * Coordinate type when drawing polygons.\n * @typedef {Array<Array<import(\"../coordinate.js\").Coordinate>>} PolyCoordType\n */\n/**\n * Types used for drawing coordinates.\n * @typedef {PointCoordType|LineCoordType|PolyCoordType} SketchCoordType\n */\n/**\n * Function that takes an array of coordinates and an optional existing geometry as\n * arguments, and returns a geometry. The optional existing geometry is the\n * geometry that is returned when the function is called without a second\n * argument.\n * @typedef {function(!SketchCoordType, import(\"../geom/SimpleGeometry.js\").default=):\n * import(\"../geom/SimpleGeometry.js\").default} GeometryFunction\n */\n/**\n * Draw mode. This collapses multi-part geometry types with their single-part\n * cousins.\n * @enum {string}\n */\nvar Mode = {\n POINT: 'Point',\n LINE_STRING: 'LineString',\n POLYGON: 'Polygon',\n CIRCLE: 'Circle'\n};\n/**\n * @enum {string}\n */\nvar DrawEventType = {\n /**\n * Triggered upon feature draw start\n * @event DrawEvent#drawstart\n * @api\n */\n DRAWSTART: 'drawstart',\n /**\n * Triggered upon feature draw end\n * @event DrawEvent#drawend\n * @api\n */\n DRAWEND: 'drawend'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Draw~Draw} instances are\n * instances of this type.\n */\nvar DrawEvent = /** @class */ (function (_super) {\n __extends(DrawEvent, _super);\n /**\n * @param {DrawEventType} type Type.\n * @param {Feature} feature The feature drawn.\n */\n function DrawEvent(type, feature) {\n var _this = _super.call(this, type) || this;\n /**\n * The feature being drawn.\n * @type {Feature}\n * @api\n */\n _this.feature = feature;\n return _this;\n }\n return DrawEvent;\n}(Event));\n/**\n * @classdesc\n * Interaction for drawing feature geometries.\n *\n * @fires DrawEvent\n * @api\n */\nvar Draw = /** @class */ (function (_super) {\n __extends(Draw, _super);\n /**\n * @param {Options} options Options.\n */\n function Draw(options) {\n var _this = this;\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @type {boolean}\n * @private\n */\n _this.shouldHandle_ = false;\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n _this.downPx_ = null;\n /**\n * @type {?}\n * @private\n */\n _this.downTimeout_;\n /**\n * @type {number|undefined}\n * @private\n */\n _this.lastDragTime_;\n /**\n * @type {boolean}\n * @private\n */\n _this.freehand_ = false;\n /**\n * Target source for drawn features.\n * @type {VectorSource}\n * @private\n */\n _this.source_ = options.source ? options.source : null;\n /**\n * Target collection for drawn features.\n * @type {import(\"../Collection.js\").default<Feature>}\n * @private\n */\n _this.features_ = options.features ? options.features : null;\n /**\n * Pixel distance for snapping.\n * @type {number}\n * @private\n */\n _this.snapTolerance_ = options.snapTolerance ? options.snapTolerance : 12;\n /**\n * Geometry type.\n * @type {GeometryType}\n * @private\n */\n _this.type_ = /** @type {GeometryType} */ (options.type);\n /**\n * Drawing mode (derived from geometry type.\n * @type {Mode}\n * @private\n */\n _this.mode_ = getMode(_this.type_);\n /**\n * Stop click, singleclick, and doubleclick events from firing during drawing.\n * Default is `false`.\n * @type {boolean}\n * @private\n */\n _this.stopClick_ = !!options.stopClick;\n /**\n * The number of points that must be drawn before a polygon ring or line\n * string can be finished. The default is 3 for polygon rings and 2 for\n * line strings.\n * @type {number}\n * @private\n */\n _this.minPoints_ = options.minPoints ?\n options.minPoints :\n (_this.mode_ === Mode.POLYGON ? 3 : 2);\n /**\n * The number of points that can be drawn before a polygon ring or line string\n * is finished. The default is no restriction.\n * @type {number}\n * @private\n */\n _this.maxPoints_ = options.maxPoints ? options.maxPoints : Infinity;\n /**\n * A function to decide if a potential finish coordinate is permissible\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.finishCondition_ = options.finishCondition ? options.finishCondition : TRUE;\n var geometryFunction = options.geometryFunction;\n if (!geometryFunction) {\n if (_this.type_ === GeometryType.CIRCLE) {\n /**\n * @param {!LineCoordType} coordinates The coordinates.\n * @param {import(\"../geom/SimpleGeometry.js\").default=} opt_geometry Optional geometry.\n * @return {import(\"../geom/SimpleGeometry.js\").default} A geometry.\n */\n geometryFunction = function (coordinates, opt_geometry) {\n var circle = opt_geometry ? /** @type {Circle} */ (opt_geometry) :\n new Circle([NaN, NaN]);\n var squaredLength = squaredCoordinateDistance(coordinates[0], coordinates[1]);\n circle.setCenterAndRadius(coordinates[0], Math.sqrt(squaredLength));\n return circle;\n };\n }\n else {\n var Constructor_1;\n var mode_1 = _this.mode_;\n if (mode_1 === Mode.POINT) {\n Constructor_1 = Point;\n }\n else if (mode_1 === Mode.LINE_STRING) {\n Constructor_1 = LineString;\n }\n else if (mode_1 === Mode.POLYGON) {\n Constructor_1 = Polygon;\n }\n /**\n * @param {!LineCoordType} coordinates The coordinates.\n * @param {import(\"../geom/SimpleGeometry.js\").default=} opt_geometry Optional geometry.\n * @return {import(\"../geom/SimpleGeometry.js\").default} A geometry.\n */\n geometryFunction = function (coordinates, opt_geometry) {\n var geometry = opt_geometry;\n if (geometry) {\n if (mode_1 === Mode.POLYGON) {\n if (coordinates[0].length) {\n // Add a closing coordinate to match the first\n geometry.setCoordinates([coordinates[0].concat([coordinates[0][0]])]);\n }\n else {\n geometry.setCoordinates([]);\n }\n }\n else {\n geometry.setCoordinates(coordinates);\n }\n }\n else {\n geometry = new Constructor_1(coordinates);\n }\n return geometry;\n };\n }\n }\n /**\n * @type {GeometryFunction}\n * @private\n */\n _this.geometryFunction_ = geometryFunction;\n /**\n * @type {number}\n * @private\n */\n _this.dragVertexDelay_ = options.dragVertexDelay !== undefined ? options.dragVertexDelay : 500;\n /**\n * Finish coordinate for the feature (first point for polygons, last point for\n * linestrings).\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.finishCoordinate_ = null;\n /**\n * Sketch feature.\n * @type {Feature}\n * @private\n */\n _this.sketchFeature_ = null;\n /**\n * Sketch point.\n * @type {Feature<Point>}\n * @private\n */\n _this.sketchPoint_ = null;\n /**\n * Sketch coordinates. Used when drawing a line or polygon.\n * @type {SketchCoordType}\n * @private\n */\n _this.sketchCoords_ = null;\n /**\n * Sketch line. Used when drawing polygon.\n * @type {Feature<LineString>}\n * @private\n */\n _this.sketchLine_ = null;\n /**\n * Sketch line coordinates. Used when drawing a polygon or circle.\n * @type {LineCoordType}\n * @private\n */\n _this.sketchLineCoords_ = null;\n /**\n * Squared tolerance for handling up events. If the squared distance\n * between a down and up event is greater than this tolerance, up events\n * will not be handled.\n * @type {number}\n * @private\n */\n _this.squaredClickTolerance_ = options.clickTolerance ?\n options.clickTolerance * options.clickTolerance : 36;\n /**\n * Draw overlay where our sketch features are drawn.\n * @type {VectorLayer}\n * @private\n */\n _this.overlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: options.wrapX ? options.wrapX : false\n }),\n style: options.style ? options.style : getDefaultStyleFunction(),\n updateWhileInteracting: true\n });\n /**\n * Name of the geometry attribute for newly created features.\n * @type {string|undefined}\n * @private\n */\n _this.geometryName_ = options.geometryName;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : noModifierKeys;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.freehandCondition_;\n if (options.freehand) {\n _this.freehandCondition_ = always;\n }\n else {\n _this.freehandCondition_ = options.freehandCondition ? options.freehandCondition : shiftKeyOnly;\n }\n _this.addEventListener(getChangeEventType(InteractionProperty.ACTIVE), _this.updateState_);\n return _this;\n }\n /**\n * @inheritDoc\n */\n Draw.prototype.setMap = function (map) {\n _super.prototype.setMap.call(this, map);\n this.updateState_();\n };\n /**\n * Get the overlay layer that this interaction renders sketch features to.\n * @return {VectorLayer} Overlay layer.\n * @api\n */\n Draw.prototype.getOverlay = function () {\n return this.overlay_;\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} and may actually draw or finish the drawing.\n * @override\n * @api\n */\n Draw.prototype.handleEvent = function (event) {\n if (event.originalEvent.type === EventType.CONTEXTMENU) {\n // Avoid context menu for long taps when drawing on mobile\n event.preventDefault();\n }\n this.freehand_ = this.mode_ !== Mode.POINT && this.freehandCondition_(event);\n var move = event.type === MapBrowserEventType.POINTERMOVE;\n var pass = true;\n if (!this.freehand_ && this.lastDragTime_ && event.type === MapBrowserEventType.POINTERDRAG) {\n var now = Date.now();\n if (now - this.lastDragTime_ >= this.dragVertexDelay_) {\n this.downPx_ = event.pixel;\n this.shouldHandle_ = !this.freehand_;\n move = true;\n }\n else {\n this.lastDragTime_ = undefined;\n }\n if (this.shouldHandle_ && this.downTimeout_ !== undefined) {\n clearTimeout(this.downTimeout_);\n this.downTimeout_ = undefined;\n }\n }\n if (this.freehand_ &&\n event.type === MapBrowserEventType.POINTERDRAG &&\n this.sketchFeature_ !== null) {\n this.addToDrawing_(event);\n pass = false;\n }\n else if (this.freehand_ &&\n event.type === MapBrowserEventType.POINTERDOWN) {\n pass = false;\n }\n else if (move) {\n pass = event.type === MapBrowserEventType.POINTERMOVE;\n if (pass && this.freehand_) {\n pass = this.handlePointerMove_(event);\n }\n else if ( /** @type {MapBrowserPointerEvent} */(event).pointerEvent.pointerType == 'mouse' ||\n (event.type === MapBrowserEventType.POINTERDRAG && this.downTimeout_ === undefined)) {\n this.handlePointerMove_(event);\n }\n }\n else if (event.type === MapBrowserEventType.DBLCLICK) {\n pass = false;\n }\n return _super.prototype.handleEvent.call(this, event) && pass;\n };\n /**\n * @inheritDoc\n */\n Draw.prototype.handleDownEvent = function (event) {\n this.shouldHandle_ = !this.freehand_;\n if (this.freehand_) {\n this.downPx_ = event.pixel;\n if (!this.finishCoordinate_) {\n this.startDrawing_(event);\n }\n return true;\n }\n else if (this.condition_(event)) {\n this.lastDragTime_ = Date.now();\n this.downTimeout_ = setTimeout(function () {\n this.handlePointerMove_(new MapBrowserPointerEvent(MapBrowserEventType.POINTERMOVE, event.map, event.pointerEvent, false, event.frameState));\n }.bind(this), this.dragVertexDelay_);\n this.downPx_ = event.pixel;\n return true;\n }\n else {\n this.lastDragTime_ = undefined;\n return false;\n }\n };\n /**\n * @inheritDoc\n */\n Draw.prototype.handleUpEvent = function (event) {\n var pass = true;\n if (this.downTimeout_) {\n clearTimeout(this.downTimeout_);\n this.downTimeout_ = undefined;\n }\n this.handlePointerMove_(event);\n var circleMode = this.mode_ === Mode.CIRCLE;\n if (this.shouldHandle_) {\n if (!this.finishCoordinate_) {\n this.startDrawing_(event);\n if (this.mode_ === Mode.POINT) {\n this.finishDrawing();\n }\n }\n else if (this.freehand_ || circleMode) {\n this.finishDrawing();\n }\n else if (this.atFinish_(event)) {\n if (this.finishCondition_(event)) {\n this.finishDrawing();\n }\n }\n else {\n this.addToDrawing_(event);\n }\n pass = false;\n }\n else if (this.freehand_) {\n this.finishCoordinate_ = null;\n this.abortDrawing_();\n }\n if (!pass && this.stopClick_) {\n event.stopPropagation();\n }\n return pass;\n };\n /**\n * Handle move events.\n * @param {import(\"../MapBrowserEvent.js\").default} event A move event.\n * @return {boolean} Pass the event to other interactions.\n * @private\n */\n Draw.prototype.handlePointerMove_ = function (event) {\n if (this.downPx_ &&\n ((!this.freehand_ && this.shouldHandle_) ||\n (this.freehand_ && !this.shouldHandle_))) {\n var downPx = this.downPx_;\n var clickPx = event.pixel;\n var dx = downPx[0] - clickPx[0];\n var dy = downPx[1] - clickPx[1];\n var squaredDistance = dx * dx + dy * dy;\n this.shouldHandle_ = this.freehand_ ?\n squaredDistance > this.squaredClickTolerance_ :\n squaredDistance <= this.squaredClickTolerance_;\n if (!this.shouldHandle_) {\n return true;\n }\n }\n if (this.finishCoordinate_) {\n this.modifyDrawing_(event);\n }\n else {\n this.createOrUpdateSketchPoint_(event);\n }\n return true;\n };\n /**\n * Determine if an event is within the snapping tolerance of the start coord.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} The event is within the snapping tolerance of the start.\n * @private\n */\n Draw.prototype.atFinish_ = function (event) {\n var at = false;\n if (this.sketchFeature_) {\n var potentiallyDone = false;\n var potentiallyFinishCoordinates = [this.finishCoordinate_];\n if (this.mode_ === Mode.LINE_STRING) {\n potentiallyDone = this.sketchCoords_.length > this.minPoints_;\n }\n else if (this.mode_ === Mode.POLYGON) {\n var sketchCoords = /** @type {PolyCoordType} */ (this.sketchCoords_);\n potentiallyDone = sketchCoords[0].length > this.minPoints_;\n potentiallyFinishCoordinates = [sketchCoords[0][0], sketchCoords[0][sketchCoords[0].length - 2]];\n }\n if (potentiallyDone) {\n var map = event.map;\n for (var i = 0, ii = potentiallyFinishCoordinates.length; i < ii; i++) {\n var finishCoordinate = potentiallyFinishCoordinates[i];\n var finishPixel = map.getPixelFromCoordinate(finishCoordinate);\n var pixel = event.pixel;\n var dx = pixel[0] - finishPixel[0];\n var dy = pixel[1] - finishPixel[1];\n var snapTolerance = this.freehand_ ? 1 : this.snapTolerance_;\n at = Math.sqrt(dx * dx + dy * dy) <= snapTolerance;\n if (at) {\n this.finishCoordinate_ = finishCoordinate;\n break;\n }\n }\n }\n }\n return at;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @private\n */\n Draw.prototype.createOrUpdateSketchPoint_ = function (event) {\n var coordinates = event.coordinate.slice();\n if (!this.sketchPoint_) {\n this.sketchPoint_ = new Feature(new Point(coordinates));\n this.updateSketchFeatures_();\n }\n else {\n var sketchPointGeom = this.sketchPoint_.getGeometry();\n sketchPointGeom.setCoordinates(coordinates);\n }\n };\n /**\n * Start the drawing.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @private\n */\n Draw.prototype.startDrawing_ = function (event) {\n var start = event.coordinate;\n this.finishCoordinate_ = start;\n if (this.mode_ === Mode.POINT) {\n this.sketchCoords_ = start.slice();\n }\n else if (this.mode_ === Mode.POLYGON) {\n this.sketchCoords_ = [[start.slice(), start.slice()]];\n this.sketchLineCoords_ = this.sketchCoords_[0];\n }\n else {\n this.sketchCoords_ = [start.slice(), start.slice()];\n }\n if (this.sketchLineCoords_) {\n this.sketchLine_ = new Feature(new LineString(this.sketchLineCoords_));\n }\n var geometry = this.geometryFunction_(this.sketchCoords_);\n this.sketchFeature_ = new Feature();\n if (this.geometryName_) {\n this.sketchFeature_.setGeometryName(this.geometryName_);\n }\n this.sketchFeature_.setGeometry(geometry);\n this.updateSketchFeatures_();\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART, this.sketchFeature_));\n };\n /**\n * Modify the drawing.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @private\n */\n Draw.prototype.modifyDrawing_ = function (event) {\n var coordinate = event.coordinate;\n var geometry = this.sketchFeature_.getGeometry();\n var coordinates, last;\n if (this.mode_ === Mode.POINT) {\n last = this.sketchCoords_;\n }\n else if (this.mode_ === Mode.POLYGON) {\n coordinates = /** @type {PolyCoordType} */ (this.sketchCoords_)[0];\n last = coordinates[coordinates.length - 1];\n if (this.atFinish_(event)) {\n // snap to finish\n coordinate = this.finishCoordinate_.slice();\n }\n }\n else {\n coordinates = this.sketchCoords_;\n last = coordinates[coordinates.length - 1];\n }\n last[0] = coordinate[0];\n last[1] = coordinate[1];\n this.geometryFunction_(/** @type {!LineCoordType} */ (this.sketchCoords_), geometry);\n if (this.sketchPoint_) {\n var sketchPointGeom = this.sketchPoint_.getGeometry();\n sketchPointGeom.setCoordinates(coordinate);\n }\n /** @type {LineString} */\n var sketchLineGeom;\n if (geometry.getType() == GeometryType.POLYGON &&\n this.mode_ !== Mode.POLYGON) {\n if (!this.sketchLine_) {\n this.sketchLine_ = new Feature();\n }\n var ring = geometry.getLinearRing(0);\n sketchLineGeom = this.sketchLine_.getGeometry();\n if (!sketchLineGeom) {\n sketchLineGeom = new LineString(ring.getFlatCoordinates(), ring.getLayout());\n this.sketchLine_.setGeometry(sketchLineGeom);\n }\n else {\n sketchLineGeom.setFlatCoordinates(ring.getLayout(), ring.getFlatCoordinates());\n sketchLineGeom.changed();\n }\n }\n else if (this.sketchLineCoords_) {\n sketchLineGeom = this.sketchLine_.getGeometry();\n sketchLineGeom.setCoordinates(this.sketchLineCoords_);\n }\n this.updateSketchFeatures_();\n };\n /**\n * Add a new coordinate to the drawing.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @private\n */\n Draw.prototype.addToDrawing_ = function (event) {\n var coordinate = event.coordinate;\n var geometry = this.sketchFeature_.getGeometry();\n var done;\n var coordinates;\n if (this.mode_ === Mode.LINE_STRING) {\n this.finishCoordinate_ = coordinate.slice();\n coordinates = /** @type {LineCoordType} */ (this.sketchCoords_);\n if (coordinates.length >= this.maxPoints_) {\n if (this.freehand_) {\n coordinates.pop();\n }\n else {\n done = true;\n }\n }\n coordinates.push(coordinate.slice());\n this.geometryFunction_(coordinates, geometry);\n }\n else if (this.mode_ === Mode.POLYGON) {\n coordinates = /** @type {PolyCoordType} */ (this.sketchCoords_)[0];\n if (coordinates.length >= this.maxPoints_) {\n if (this.freehand_) {\n coordinates.pop();\n }\n else {\n done = true;\n }\n }\n coordinates.push(coordinate.slice());\n if (done) {\n this.finishCoordinate_ = coordinates[0];\n }\n this.geometryFunction_(this.sketchCoords_, geometry);\n }\n this.updateSketchFeatures_();\n if (done) {\n this.finishDrawing();\n }\n };\n /**\n * Remove last point of the feature currently being drawn.\n * @api\n */\n Draw.prototype.removeLastPoint = function () {\n if (!this.sketchFeature_) {\n return;\n }\n var geometry = this.sketchFeature_.getGeometry();\n var coordinates;\n /** @type {LineString} */\n var sketchLineGeom;\n if (this.mode_ === Mode.LINE_STRING) {\n coordinates = /** @type {LineCoordType} */ (this.sketchCoords_);\n coordinates.splice(-2, 1);\n this.geometryFunction_(coordinates, geometry);\n if (coordinates.length >= 2) {\n this.finishCoordinate_ = coordinates[coordinates.length - 2].slice();\n }\n }\n else if (this.mode_ === Mode.POLYGON) {\n coordinates = /** @type {PolyCoordType} */ (this.sketchCoords_)[0];\n coordinates.splice(-2, 1);\n sketchLineGeom = this.sketchLine_.getGeometry();\n sketchLineGeom.setCoordinates(coordinates);\n this.geometryFunction_(this.sketchCoords_, geometry);\n }\n if (coordinates.length === 0) {\n this.finishCoordinate_ = null;\n }\n this.updateSketchFeatures_();\n };\n /**\n * Stop drawing and add the sketch feature to the target layer.\n * The {@link module:ol/interaction/Draw~DrawEventType.DRAWEND} event is\n * dispatched before inserting the feature.\n * @api\n */\n Draw.prototype.finishDrawing = function () {\n var sketchFeature = this.abortDrawing_();\n if (!sketchFeature) {\n return;\n }\n var coordinates = this.sketchCoords_;\n var geometry = sketchFeature.getGeometry();\n if (this.mode_ === Mode.LINE_STRING) {\n // remove the redundant last point\n coordinates.pop();\n this.geometryFunction_(coordinates, geometry);\n }\n else if (this.mode_ === Mode.POLYGON) {\n // remove the redundant last point in ring\n /** @type {PolyCoordType} */ (coordinates)[0].pop();\n this.geometryFunction_(coordinates, geometry);\n coordinates = geometry.getCoordinates();\n }\n // cast multi-part geometries\n if (this.type_ === GeometryType.MULTI_POINT) {\n sketchFeature.setGeometry(new MultiPoint([/** @type {PointCoordType} */ (coordinates)]));\n }\n else if (this.type_ === GeometryType.MULTI_LINE_STRING) {\n sketchFeature.setGeometry(new MultiLineString([/** @type {LineCoordType} */ (coordinates)]));\n }\n else if (this.type_ === GeometryType.MULTI_POLYGON) {\n sketchFeature.setGeometry(new MultiPolygon([/** @type {PolyCoordType} */ (coordinates)]));\n }\n // First dispatch event to allow full set up of feature\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWEND, sketchFeature));\n // Then insert feature\n if (this.features_) {\n this.features_.push(sketchFeature);\n }\n if (this.source_) {\n this.source_.addFeature(sketchFeature);\n }\n };\n /**\n * Stop drawing without adding the sketch feature to the target layer.\n * @return {Feature} The sketch feature (or null if none).\n * @private\n */\n Draw.prototype.abortDrawing_ = function () {\n this.finishCoordinate_ = null;\n var sketchFeature = this.sketchFeature_;\n if (sketchFeature) {\n this.sketchFeature_ = null;\n this.sketchPoint_ = null;\n this.sketchLine_ = null;\n this.overlay_.getSource().clear(true);\n }\n return sketchFeature;\n };\n /**\n * Extend an existing geometry by adding additional points. This only works\n * on features with `LineString` geometries, where the interaction will\n * extend lines by adding points to the end of the coordinates array.\n * @param {!Feature<LineString>} feature Feature to be extended.\n * @api\n */\n Draw.prototype.extend = function (feature) {\n var geometry = feature.getGeometry();\n var lineString = geometry;\n this.sketchFeature_ = feature;\n this.sketchCoords_ = lineString.getCoordinates();\n var last = this.sketchCoords_[this.sketchCoords_.length - 1];\n this.finishCoordinate_ = last.slice();\n this.sketchCoords_.push(last.slice());\n this.updateSketchFeatures_();\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART, this.sketchFeature_));\n };\n /**\n * Redraw the sketch features.\n * @private\n */\n Draw.prototype.updateSketchFeatures_ = function () {\n var sketchFeatures = [];\n if (this.sketchFeature_) {\n sketchFeatures.push(this.sketchFeature_);\n }\n if (this.sketchLine_) {\n sketchFeatures.push(this.sketchLine_);\n }\n if (this.sketchPoint_) {\n sketchFeatures.push(this.sketchPoint_);\n }\n var overlaySource = this.overlay_.getSource();\n overlaySource.clear(true);\n overlaySource.addFeatures(sketchFeatures);\n };\n /**\n * @private\n */\n Draw.prototype.updateState_ = function () {\n var map = this.getMap();\n var active = this.getActive();\n if (!map || !active) {\n this.abortDrawing_();\n }\n this.overlay_.setMap(active ? map : null);\n };\n return Draw;\n}(PointerInteraction));\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n var styles = createEditingStyle();\n return function (feature, resolution) {\n return styles[feature.getGeometry().getType()];\n };\n}\n/**\n * Create a `geometryFunction` for `type: 'Circle'` that will create a regular\n * polygon with a user specified number of sides and start angle instead of an\n * `import(\"../geom/Circle.js\").Circle` geometry.\n * @param {number=} opt_sides Number of sides of the regular polygon. Default is\n * 32.\n * @param {number=} opt_angle Angle of the first point in radians. 0 means East.\n * Default is the angle defined by the heading from the center of the\n * regular polygon to the current pointer position.\n * @return {GeometryFunction} Function that draws a\n * polygon.\n * @api\n */\nexport function createRegularPolygon(opt_sides, opt_angle) {\n return function (coordinates, opt_geometry) {\n var center = /** @type {LineCoordType} */ (coordinates)[0];\n var end = /** @type {LineCoordType} */ (coordinates)[1];\n var radius = Math.sqrt(squaredCoordinateDistance(center, end));\n var geometry = opt_geometry ? /** @type {Polygon} */ (opt_geometry) :\n fromCircle(new Circle(center), opt_sides);\n var angle = opt_angle;\n if (!opt_angle) {\n var x = end[0] - center[0];\n var y = end[1] - center[1];\n angle = Math.atan(y / x) - (x < 0 ? Math.PI : 0);\n }\n makeRegular(geometry, center, radius, angle);\n return geometry;\n };\n}\n/**\n * Create a `geometryFunction` that will create a box-shaped polygon (aligned\n * with the coordinate system axes). Use this with the draw interaction and\n * `type: 'Circle'` to return a box instead of a circle geometry.\n * @return {GeometryFunction} Function that draws a box-shaped polygon.\n * @api\n */\nexport function createBox() {\n return (function (coordinates, opt_geometry) {\n var extent = boundingExtent(/** @type {LineCoordType} */ (coordinates));\n var boxCoordinates = [[\n getBottomLeft(extent),\n getBottomRight(extent),\n getTopRight(extent),\n getTopLeft(extent),\n getBottomLeft(extent)\n ]];\n var geometry = opt_geometry;\n if (geometry) {\n geometry.setCoordinates(boxCoordinates);\n }\n else {\n geometry = new Polygon(boxCoordinates);\n }\n return geometry;\n });\n}\n/**\n * Get the drawing mode. The mode for mult-part geometries is the same as for\n * their single-part cousins.\n * @param {GeometryType} type Geometry type.\n * @return {Mode} Drawing mode.\n */\nfunction getMode(type) {\n var mode;\n if (type === GeometryType.POINT ||\n type === GeometryType.MULTI_POINT) {\n mode = Mode.POINT;\n }\n else if (type === GeometryType.LINE_STRING ||\n type === GeometryType.MULTI_LINE_STRING) {\n mode = Mode.LINE_STRING;\n }\n else if (type === GeometryType.POLYGON ||\n type === GeometryType.MULTI_POLYGON) {\n mode = Mode.POLYGON;\n }\n else if (type === GeometryType.CIRCLE) {\n mode = Mode.CIRCLE;\n }\n return (\n /** @type {!Mode} */ (mode));\n}\nexport default Draw;\n//# sourceMappingURL=Draw.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Extent\n */\nimport Feature from '../Feature.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport { squaredDistanceToSegment, closestOnSegment, distance as coordinateDistance, squaredDistance as squaredCoordinateDistance } from '../coordinate.js';\nimport Event from '../events/Event.js';\nimport { boundingExtent, getArea } from '../extent.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport Point from '../geom/Point.js';\nimport { fromExtent as polygonFromExtent } from '../geom/Polygon.js';\nimport PointerInteraction from './Pointer.js';\nimport VectorLayer from '../layer/Vector.js';\nimport VectorSource from '../source/Vector.js';\nimport { createEditingStyle } from '../style/Style.js';\nimport { toUserExtent } from '../proj.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../extent.js\").Extent} [extent] Initial extent. Defaults to no\n * initial extent.\n * @property {import(\"../style/Style.js\").StyleLike} [boxStyle]\n * Style for the drawn extent box. Defaults to\n * {@link module:ol/style/Style~createEditing()['Polygon']}\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the\n * pointer close enough to a segment or vertex for editing.\n * @property {import(\"../style/Style.js\").StyleLike} [pointerStyle]\n * Style for the cursor used to draw the extent. Defaults to\n * {@link module:ol/style/Style~createEditing()['Point']}\n * @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps\n * in the X direction? Only affects visuals, not functionality.\n */\n/**\n * @enum {string}\n */\nvar ExtentEventType = {\n /**\n * Triggered after the extent is changed\n * @event ExtentEvent#extentchanged\n * @api\n */\n EXTENTCHANGED: 'extentchanged'\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Extent~Extent} instances are\n * instances of this type.\n */\nvar ExtentEvent = /** @class */ (function (_super) {\n __extends(ExtentEvent, _super);\n /**\n * @param {import(\"../extent.js\").Extent} extent the new extent\n */\n function ExtentEvent(extent) {\n var _this = _super.call(this, ExtentEventType.EXTENTCHANGED) || this;\n /**\n * The current extent.\n * @type {import(\"../extent.js\").Extent}\n * @api\n */\n _this.extent = extent;\n return _this;\n }\n return ExtentEvent;\n}(Event));\n/**\n * @classdesc\n * Allows the user to draw a vector box by clicking and dragging on the map.\n * Once drawn, the vector box can be modified by dragging its vertices or edges.\n * This interaction is only supported for mouse devices.\n *\n * @fires ExtentEvent\n * @api\n */\nvar Extent = /** @class */ (function (_super) {\n __extends(Extent, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Extent(opt_options) {\n var _this = this;\n var options = opt_options || {};\n _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /**\n * Extent of the drawn box\n * @type {import(\"../extent.js\").Extent}\n * @private\n */\n _this.extent_ = null;\n /**\n * Handler for pointer move events\n * @type {function (import(\"../coordinate.js\").Coordinate): import(\"../extent.js\").Extent|null}\n * @private\n */\n _this.pointerHandler_ = null;\n /**\n * Pixel threshold to snap to extent\n * @type {number}\n * @private\n */\n _this.pixelTolerance_ = options.pixelTolerance !== undefined ?\n options.pixelTolerance : 10;\n /**\n * Is the pointer snapped to an extent vertex\n * @type {boolean}\n * @private\n */\n _this.snappedToVertex_ = false;\n /**\n * Feature for displaying the visible extent\n * @type {Feature}\n * @private\n */\n _this.extentFeature_ = null;\n /**\n * Feature for displaying the visible pointer\n * @type {Feature<Point>}\n * @private\n */\n _this.vertexFeature_ = null;\n if (!opt_options) {\n opt_options = {};\n }\n /**\n * Layer for the extentFeature\n * @type {VectorLayer}\n * @private\n */\n _this.extentOverlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: !!opt_options.wrapX\n }),\n style: opt_options.boxStyle ? opt_options.boxStyle : getDefaultExtentStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true\n });\n /**\n * Layer for the vertexFeature\n * @type {VectorLayer}\n * @private\n */\n _this.vertexOverlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: !!opt_options.wrapX\n }),\n style: opt_options.pointerStyle ? opt_options.pointerStyle : getDefaultPointerStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true\n });\n if (opt_options.extent) {\n _this.setExtent(opt_options.extent);\n }\n return _this;\n }\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel cursor location\n * @param {import(\"../PluggableMap.js\").default} map map\n * @returns {import(\"../coordinate.js\").Coordinate|null} snapped vertex on extent\n * @private\n */\n Extent.prototype.snapToVertex_ = function (pixel, map) {\n var pixelCoordinate = map.getCoordinateFromPixelInternal(pixel);\n var sortByDistance = function (a, b) {\n return squaredDistanceToSegment(pixelCoordinate, a) -\n squaredDistanceToSegment(pixelCoordinate, b);\n };\n var extent = this.getExtentInternal();\n if (extent) {\n //convert extents to line segments and find the segment closest to pixelCoordinate\n var segments = getSegments(extent);\n segments.sort(sortByDistance);\n var closestSegment = segments[0];\n var vertex = (closestOnSegment(pixelCoordinate, closestSegment));\n var vertexPixel = map.getPixelFromCoordinateInternal(vertex);\n //if the distance is within tolerance, snap to the segment\n if (coordinateDistance(pixel, vertexPixel) <= this.pixelTolerance_) {\n //test if we should further snap to a vertex\n var pixel1 = map.getPixelFromCoordinateInternal(closestSegment[0]);\n var pixel2 = map.getPixelFromCoordinateInternal(closestSegment[1]);\n var squaredDist1 = squaredCoordinateDistance(vertexPixel, pixel1);\n var squaredDist2 = squaredCoordinateDistance(vertexPixel, pixel2);\n var dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n this.snappedToVertex_ = dist <= this.pixelTolerance_;\n if (this.snappedToVertex_) {\n vertex = squaredDist1 > squaredDist2 ?\n closestSegment[1] : closestSegment[0];\n }\n return vertex;\n }\n }\n return null;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent pointer move event\n * @private\n */\n Extent.prototype.handlePointerMove_ = function (mapBrowserEvent) {\n var pixel = mapBrowserEvent.pixel;\n var map = mapBrowserEvent.map;\n var vertex = this.snapToVertex_(pixel, map);\n if (!vertex) {\n vertex = map.getCoordinateFromPixelInternal(pixel);\n }\n this.createOrUpdatePointerFeature_(vertex);\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent extent\n * @returns {Feature} extent as featrue\n * @private\n */\n Extent.prototype.createOrUpdateExtentFeature_ = function (extent) {\n var extentFeature = this.extentFeature_;\n if (!extentFeature) {\n if (!extent) {\n extentFeature = new Feature({});\n }\n else {\n extentFeature = new Feature(polygonFromExtent(extent));\n }\n this.extentFeature_ = extentFeature;\n this.extentOverlay_.getSource().addFeature(extentFeature);\n }\n else {\n if (!extent) {\n extentFeature.setGeometry(undefined);\n }\n else {\n extentFeature.setGeometry(polygonFromExtent(extent));\n }\n }\n return extentFeature;\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} vertex location of feature\n * @returns {Feature} vertex as feature\n * @private\n */\n Extent.prototype.createOrUpdatePointerFeature_ = function (vertex) {\n var vertexFeature = this.vertexFeature_;\n if (!vertexFeature) {\n vertexFeature = new Feature(new Point(vertex));\n this.vertexFeature_ = vertexFeature;\n this.vertexOverlay_.getSource().addFeature(vertexFeature);\n }\n else {\n var geometry = vertexFeature.getGeometry();\n geometry.setCoordinates(vertex);\n }\n return vertexFeature;\n };\n /**\n * @inheritDoc\n */\n Extent.prototype.handleEvent = function (mapBrowserEvent) {\n if (!( /** @type {import(\"../MapBrowserPointerEvent.js\").default} */(mapBrowserEvent).pointerEvent)) {\n return true;\n }\n //display pointer (if not dragging)\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE && !this.handlingDownUpSequence) {\n this.handlePointerMove_(mapBrowserEvent);\n }\n //call pointer to determine up/down/drag\n _super.prototype.handleEvent.call(this, mapBrowserEvent);\n //return false to stop propagation\n return false;\n };\n /**\n * @inheritDoc\n */\n Extent.prototype.handleDownEvent = function (mapBrowserEvent) {\n var pixel = mapBrowserEvent.pixel;\n var map = mapBrowserEvent.map;\n var extent = this.getExtentInternal();\n var vertex = this.snapToVertex_(pixel, map);\n //find the extent corner opposite the passed corner\n var getOpposingPoint = function (point) {\n var x_ = null;\n var y_ = null;\n if (point[0] == extent[0]) {\n x_ = extent[2];\n }\n else if (point[0] == extent[2]) {\n x_ = extent[0];\n }\n if (point[1] == extent[1]) {\n y_ = extent[3];\n }\n else if (point[1] == extent[3]) {\n y_ = extent[1];\n }\n if (x_ !== null && y_ !== null) {\n return [x_, y_];\n }\n return null;\n };\n if (vertex && extent) {\n var x = (vertex[0] == extent[0] || vertex[0] == extent[2]) ? vertex[0] : null;\n var y = (vertex[1] == extent[1] || vertex[1] == extent[3]) ? vertex[1] : null;\n //snap to point\n if (x !== null && y !== null) {\n this.pointerHandler_ = getPointHandler(getOpposingPoint(vertex));\n //snap to edge\n }\n else if (x !== null) {\n this.pointerHandler_ = getEdgeHandler(getOpposingPoint([x, extent[1]]), getOpposingPoint([x, extent[3]]));\n }\n else if (y !== null) {\n this.pointerHandler_ = getEdgeHandler(getOpposingPoint([extent[0], y]), getOpposingPoint([extent[2], y]));\n }\n //no snap - new bbox\n }\n else {\n vertex = map.getCoordinateFromPixelInternal(pixel);\n this.setExtent([vertex[0], vertex[1], vertex[0], vertex[1]]);\n this.pointerHandler_ = getPointHandler(vertex);\n }\n return true; //event handled; start downup sequence\n };\n /**\n * @inheritDoc\n */\n Extent.prototype.handleDragEvent = function (mapBrowserEvent) {\n if (this.pointerHandler_) {\n var pixelCoordinate = mapBrowserEvent.coordinate;\n this.setExtent(this.pointerHandler_(pixelCoordinate));\n this.createOrUpdatePointerFeature_(pixelCoordinate);\n }\n return true;\n };\n /**\n * @inheritDoc\n */\n Extent.prototype.handleUpEvent = function (mapBrowserEvent) {\n this.pointerHandler_ = null;\n //If bbox is zero area, set to null;\n var extent = this.getExtentInternal();\n if (!extent || getArea(extent) === 0) {\n this.setExtent(null);\n }\n return false; //Stop handling downup sequence\n };\n /**\n * @inheritDoc\n */\n Extent.prototype.setMap = function (map) {\n this.extentOverlay_.setMap(map);\n this.vertexOverlay_.setMap(map);\n _super.prototype.setMap.call(this, map);\n };\n /**\n * Returns the current drawn extent in the view projection (or user projection if set)\n *\n * @return {import(\"../extent.js\").Extent} Drawn extent in the view projection.\n * @api\n */\n Extent.prototype.getExtent = function () {\n return toUserExtent(this.getExtentInternal(), this.getMap().getView().getProjection());\n };\n /**\n * Returns the current drawn extent in the view projection\n *\n * @return {import(\"../extent.js\").Extent} Drawn extent in the view projection.\n * @api\n */\n Extent.prototype.getExtentInternal = function () {\n return this.extent_;\n };\n /**\n * Manually sets the drawn extent, using the view projection.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent\n * @api\n */\n Extent.prototype.setExtent = function (extent) {\n //Null extent means no bbox\n this.extent_ = extent ? extent : null;\n this.createOrUpdateExtentFeature_(extent);\n this.dispatchEvent(new ExtentEvent(this.extent_));\n };\n return Extent;\n}(PointerInteraction));\n/**\n * Returns the default style for the drawn bbox\n *\n * @return {import(\"../style/Style.js\").StyleFunction} Default Extent style\n */\nfunction getDefaultExtentStyleFunction() {\n var style = createEditingStyle();\n return function (feature, resolution) {\n return style[GeometryType.POLYGON];\n };\n}\n/**\n * Returns the default style for the pointer\n *\n * @return {import(\"../style/Style.js\").StyleFunction} Default pointer style\n */\nfunction getDefaultPointerStyleFunction() {\n var style = createEditingStyle();\n return function (feature, resolution) {\n return style[GeometryType.POINT];\n };\n}\n/**\n * @param {import(\"../coordinate.js\").Coordinate} fixedPoint corner that will be unchanged in the new extent\n * @returns {function (import(\"../coordinate.js\").Coordinate): import(\"../extent.js\").Extent} event handler\n */\nfunction getPointHandler(fixedPoint) {\n return function (point) {\n return boundingExtent([fixedPoint, point]);\n };\n}\n/**\n * @param {import(\"../coordinate.js\").Coordinate} fixedP1 first corner that will be unchanged in the new extent\n * @param {import(\"../coordinate.js\").Coordinate} fixedP2 second corner that will be unchanged in the new extent\n * @returns {function (import(\"../coordinate.js\").Coordinate): import(\"../extent.js\").Extent|null} event handler\n */\nfunction getEdgeHandler(fixedP1, fixedP2) {\n if (fixedP1[0] == fixedP2[0]) {\n return function (point) {\n return boundingExtent([fixedP1, [point[0], fixedP2[1]]]);\n };\n }\n else if (fixedP1[1] == fixedP2[1]) {\n return function (point) {\n return boundingExtent([fixedP1, [fixedP2[0], point[1]]]);\n };\n }\n else {\n return null;\n }\n}\n/**\n * @param {import(\"../extent.js\").Extent} extent extent\n * @returns {Array<Array<import(\"../coordinate.js\").Coordinate>>} extent line segments\n */\nfunction getSegments(extent) {\n return [\n [[extent[0], extent[1]], [extent[0], extent[3]]],\n [[extent[0], extent[3]], [extent[2], extent[3]]],\n [[extent[2], extent[3]], [extent[2], extent[1]]],\n [[extent[2], extent[1]], [extent[0], extent[1]]]\n ];\n}\nexport default Extent;\n//# sourceMappingURL=Extent.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Modify\n */\nimport { getUid } from '../util.js';\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport Feature from '../Feature.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport { equals } from '../array.js';\nimport { equals as coordinatesEqual, distance as coordinateDistance, squaredDistance as squaredCoordinateDistance, squaredDistanceToSegment, closestOnSegment } from '../coordinate.js';\nimport Event from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport { always, primaryAction, altKeyOnly, singleClick } from '../events/condition.js';\nimport { boundingExtent, buffer as bufferExtent, createOrUpdateFromCoordinate as createExtent } from '../extent.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport Point from '../geom/Point.js';\nimport PointerInteraction from './Pointer.js';\nimport VectorLayer from '../layer/Vector.js';\nimport VectorSource from '../source/Vector.js';\nimport VectorEventType from '../source/VectorEventType.js';\nimport RBush from '../structs/RBush.js';\nimport { createEditingStyle } from '../style/Style.js';\nimport { fromUserExtent, toUserExtent, fromUserCoordinate, toUserCoordinate } from '../proj.js';\n/**\n * The segment index assigned to a circle's center when\n * breaking up a circle into ModifySegmentDataType segments.\n * @type {number}\n */\nvar CIRCLE_CENTER_INDEX = 0;\n/**\n * The segment index assigned to a circle's circumference when\n * breaking up a circle into ModifySegmentDataType segments.\n * @type {number}\n */\nvar CIRCLE_CIRCUMFERENCE_INDEX = 1;\nvar tempExtent = [0, 0, 0, 0];\nvar tempSegment = [];\n/**\n * @enum {string}\n */\nvar ModifyEventType = {\n /**\n * Triggered upon feature modification start\n * @event ModifyEvent#modifystart\n * @api\n */\n MODIFYSTART: 'modifystart',\n /**\n * Triggered upon feature modification end\n * @event ModifyEvent#modifyend\n * @api\n */\n MODIFYEND: 'modifyend'\n};\n/**\n * @typedef {Object} SegmentData\n * @property {Array<number>} [depth]\n * @property {Feature} feature\n * @property {import(\"../geom/SimpleGeometry.js\").default} geometry\n * @property {number} [index]\n * @property {Array<import(\"../extent.js\").Extent>} segment\n * @property {Array<SegmentData>} [featureSegments]\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event will be considered to add or move a\n * vertex to the sketch. Default is\n * {@link module:ol/events/condition~primaryAction}.\n * @property {import(\"../events/condition.js\").Condition} [deleteCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. By default,\n * {@link module:ol/events/condition~singleClick} with\n * {@link module:ol/events/condition~altKeyOnly} results in a vertex deletion.\n * @property {import(\"../events/condition.js\").Condition} [insertVertexCondition] A\n * function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and\n * returns a boolean to indicate whether a new vertex should be added to the sketch\n * features. Default is {@link module:ol/events/condition~always}.\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the\n * pointer close enough to a segment or vertex for editing.\n * @property {import(\"../style/Style.js\").StyleLike} [style]\n * Style used for the features being modified. By default the default edit\n * style is used (see {@link module:ol/style}).\n * @property {VectorSource} [source] The vector source with\n * features to modify. If a vector source is not provided, a feature collection\n * must be provided with the features option.\n * @property {Collection<Feature>} [features]\n * The features the interaction works on. If a feature collection is not\n * provided, a vector source must be provided with the source option.\n * @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch\n * overlay.\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Modify~Modify} instances are\n * instances of this type.\n */\nvar ModifyEvent = /** @class */ (function (_super) {\n __extends(ModifyEvent, _super);\n /**\n * @param {ModifyEventType} type Type.\n * @param {Collection<Feature>} features\n * The features modified.\n * @param {import(\"../MapBrowserPointerEvent.js\").default} mapBrowserPointerEvent\n * Associated {@link module:ol/MapBrowserPointerEvent}.\n */\n function ModifyEvent(type, features, mapBrowserPointerEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * The features being modified.\n * @type {Collection<Feature>}\n * @api\n */\n _this.features = features;\n /**\n * Associated {@link module:ol/MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserPointerEvent;\n return _this;\n }\n return ModifyEvent;\n}(Event));\nexport { ModifyEvent };\n/**\n * @classdesc\n * Interaction for modifying feature geometries. To modify features that have\n * been added to an existing source, construct the modify interaction with the\n * `source` option. If you want to modify features in a collection (for example,\n * the collection used by a select interaction), construct the interaction with\n * the `features` option. The interaction must be constructed with either a\n * `source` or `features` option.\n *\n * By default, the interaction will allow deletion of vertices when the `alt`\n * key is pressed. To configure the interaction with a different condition\n * for deletion, use the `deleteCondition` option.\n * @fires ModifyEvent\n * @api\n */\nvar Modify = /** @class */ (function (_super) {\n __extends(Modify, _super);\n /**\n * @param {Options} options Options.\n */\n function Modify(options) {\n var _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /** @private */\n _this.boundHandleFeatureChange_ = _this.handleFeatureChange_.bind(_this);\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : primaryAction;\n /**\n * @private\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\n _this.defaultDeleteCondition_ = function (mapBrowserEvent) {\n return altKeyOnly(mapBrowserEvent) && singleClick(mapBrowserEvent);\n };\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n _this.deleteCondition_ = options.deleteCondition ?\n options.deleteCondition : _this.defaultDeleteCondition_;\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n _this.insertVertexCondition_ = options.insertVertexCondition ?\n options.insertVertexCondition : always;\n /**\n * Editing vertex.\n * @type {Feature}\n * @private\n */\n _this.vertexFeature_ = null;\n /**\n * Segments intersecting {@link this.vertexFeature_} by segment uid.\n * @type {Object<string, boolean>}\n * @private\n */\n _this.vertexSegments_ = null;\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n _this.lastPixel_ = [0, 0];\n /**\n * Tracks if the next `singleclick` event should be ignored to prevent\n * accidental deletion right after vertex creation.\n * @type {boolean}\n * @private\n */\n _this.ignoreNextSingleClick_ = false;\n /**\n * @type {boolean}\n * @private\n */\n _this.modified_ = false;\n /**\n * Segment RTree for each layer\n * @type {RBush<SegmentData>}\n * @private\n */\n _this.rBush_ = new RBush();\n /**\n * @type {number}\n * @private\n */\n _this.pixelTolerance_ = options.pixelTolerance !== undefined ?\n options.pixelTolerance : 10;\n /**\n * @type {boolean}\n * @private\n */\n _this.snappedToVertex_ = false;\n /**\n * Indicate whether the interaction is currently changing a feature's\n * coordinates.\n * @type {boolean}\n * @private\n */\n _this.changingFeature_ = false;\n /**\n * @type {Array}\n * @private\n */\n _this.dragSegments_ = [];\n /**\n * Draw overlay where sketch features are drawn.\n * @type {VectorLayer}\n * @private\n */\n _this.overlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: !!options.wrapX\n }),\n style: options.style ? options.style : getDefaultStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true\n });\n /**\n * @const\n * @private\n * @type {!Object<string, function(Feature, import(\"../geom/Geometry.js\").default): void>}\n */\n _this.SEGMENT_WRITERS_ = {\n 'Point': _this.writePointGeometry_.bind(_this),\n 'LineString': _this.writeLineStringGeometry_.bind(_this),\n 'LinearRing': _this.writeLineStringGeometry_.bind(_this),\n 'Polygon': _this.writePolygonGeometry_.bind(_this),\n 'MultiPoint': _this.writeMultiPointGeometry_.bind(_this),\n 'MultiLineString': _this.writeMultiLineStringGeometry_.bind(_this),\n 'MultiPolygon': _this.writeMultiPolygonGeometry_.bind(_this),\n 'Circle': _this.writeCircleGeometry_.bind(_this),\n 'GeometryCollection': _this.writeGeometryCollectionGeometry_.bind(_this)\n };\n /**\n * @type {VectorSource}\n * @private\n */\n _this.source_ = null;\n var features;\n if (options.source) {\n _this.source_ = options.source;\n features = new Collection(_this.source_.getFeatures());\n _this.source_.addEventListener(VectorEventType.ADDFEATURE, _this.handleSourceAdd_.bind(_this));\n _this.source_.addEventListener(VectorEventType.REMOVEFEATURE, _this.handleSourceRemove_.bind(_this));\n }\n else {\n features = options.features;\n }\n if (!features) {\n throw new Error('The modify interaction requires features or a source');\n }\n /**\n * @type {Collection<Feature>}\n * @private\n */\n _this.features_ = features;\n _this.features_.forEach(_this.addFeature_.bind(_this));\n _this.features_.addEventListener(CollectionEventType.ADD, _this.handleFeatureAdd_.bind(_this));\n _this.features_.addEventListener(CollectionEventType.REMOVE, _this.handleFeatureRemove_.bind(_this));\n /**\n * @type {import(\"../MapBrowserPointerEvent.js\").default}\n * @private\n */\n _this.lastPointerEvent_ = null;\n return _this;\n }\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n Modify.prototype.addFeature_ = function (feature) {\n var geometry = feature.getGeometry();\n if (geometry) {\n var writer = this.SEGMENT_WRITERS_[geometry.getType()];\n if (writer) {\n writer(feature, geometry);\n }\n }\n var map = this.getMap();\n if (map && map.isRendered() && this.getActive()) {\n this.handlePointerAtPixel_(this.lastPixel_, map);\n }\n feature.addEventListener(EventType.CHANGE, this.boundHandleFeatureChange_);\n };\n /**\n * @param {import(\"../MapBrowserPointerEvent.js\").default} evt Map browser event\n * @private\n */\n Modify.prototype.willModifyFeatures_ = function (evt) {\n if (!this.modified_) {\n this.modified_ = true;\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYSTART, this.features_, evt));\n }\n };\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n Modify.prototype.removeFeature_ = function (feature) {\n this.removeFeatureSegmentData_(feature);\n // Remove the vertex feature if the collection of canditate features is empty.\n if (this.vertexFeature_ && this.features_.getLength() === 0) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n feature.removeEventListener(EventType.CHANGE, this.boundHandleFeatureChange_);\n };\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n Modify.prototype.removeFeatureSegmentData_ = function (feature) {\n var rBush = this.rBush_;\n /** @type {Array<SegmentData>} */\n var nodesToRemove = [];\n rBush.forEach(\n /**\n * @param {SegmentData} node RTree node.\n */\n function (node) {\n if (feature === node.feature) {\n nodesToRemove.push(node);\n }\n });\n for (var i = nodesToRemove.length - 1; i >= 0; --i) {\n var nodeToRemove = nodesToRemove[i];\n for (var j = this.dragSegments_.length - 1; j >= 0; --j) {\n if (this.dragSegments_[j][0] === nodeToRemove) {\n this.dragSegments_.splice(j, 1);\n }\n }\n rBush.remove(nodeToRemove);\n }\n };\n /**\n * @inheritDoc\n */\n Modify.prototype.setActive = function (active) {\n if (this.vertexFeature_ && !active) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n _super.prototype.setActive.call(this, active);\n };\n /**\n * @inheritDoc\n */\n Modify.prototype.setMap = function (map) {\n this.overlay_.setMap(map);\n _super.prototype.setMap.call(this, map);\n };\n /**\n * Get the overlay layer that this interaction renders sketch features to.\n * @return {VectorLayer} Overlay layer.\n * @api\n */\n Modify.prototype.getOverlay = function () {\n return this.overlay_;\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n Modify.prototype.handleSourceAdd_ = function (event) {\n if (event.feature) {\n this.features_.push(event.feature);\n }\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n Modify.prototype.handleSourceRemove_ = function (event) {\n if (event.feature) {\n this.features_.remove(event.feature);\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Modify.prototype.handleFeatureAdd_ = function (evt) {\n this.addFeature_(/** @type {Feature} */ (evt.element));\n };\n /**\n * @param {import(\"../events/Event.js\").default} evt Event.\n * @private\n */\n Modify.prototype.handleFeatureChange_ = function (evt) {\n if (!this.changingFeature_) {\n var feature = /** @type {Feature} */ (evt.target);\n this.removeFeature_(feature);\n this.addFeature_(feature);\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Modify.prototype.handleFeatureRemove_ = function (evt) {\n var feature = /** @type {Feature} */ (evt.element);\n this.removeFeature_(feature);\n };\n /**\n * @param {Feature} feature Feature\n * @param {Point} geometry Geometry.\n * @private\n */\n Modify.prototype.writePointGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCoordinates();\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n segment: [coordinates, coordinates]\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiPoint.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeMultiPointGeometry_ = function (feature, geometry) {\n var points = geometry.getCoordinates();\n for (var i = 0, ii = points.length; i < ii; ++i) {\n var coordinates = points[i];\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [i],\n index: i,\n segment: [coordinates, coordinates]\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/LineString.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeLineStringGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCoordinates();\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n index: i,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiLineString.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeMultiLineStringGeometry_ = function (feature, geometry) {\n var lines = geometry.getCoordinates();\n for (var j = 0, jj = lines.length; j < jj; ++j) {\n var coordinates = lines[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j],\n index: i,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/Polygon.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writePolygonGeometry_ = function (feature, geometry) {\n var rings = geometry.getCoordinates();\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j],\n index: i,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeMultiPolygonGeometry_ = function (feature, geometry) {\n var polygons = geometry.getCoordinates();\n for (var k = 0, kk = polygons.length; k < kk; ++k) {\n var rings = polygons[k];\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j, k],\n index: i,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n }\n };\n /**\n * We convert a circle into two segments. The segment at index\n * {@link CIRCLE_CENTER_INDEX} is the\n * circle's center (a point). The segment at index\n * {@link CIRCLE_CIRCUMFERENCE_INDEX} is\n * the circumference, and is not a line segment.\n *\n * @param {Feature} feature Feature.\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeCircleGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCenter();\n /** @type {SegmentData} */\n var centerSegmentData = {\n feature: feature,\n geometry: geometry,\n index: CIRCLE_CENTER_INDEX,\n segment: [coordinates, coordinates]\n };\n /** @type {SegmentData} */\n var circumferenceSegmentData = {\n feature: feature,\n geometry: geometry,\n index: CIRCLE_CIRCUMFERENCE_INDEX,\n segment: [coordinates, coordinates]\n };\n var featureSegments = [centerSegmentData, circumferenceSegmentData];\n centerSegmentData.featureSegments = featureSegments;\n circumferenceSegmentData.featureSegments = featureSegments;\n this.rBush_.insert(createExtent(coordinates), centerSegmentData);\n this.rBush_.insert(geometry.getExtent(), circumferenceSegmentData);\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeGeometryCollectionGeometry_ = function (feature, geometry) {\n var geometries = geometry.getGeometriesArray();\n for (var i = 0; i < geometries.length; ++i) {\n var geometry_1 = geometries[i];\n var writer = this.SEGMENT_WRITERS_[geometry_1.getType()];\n writer(feature, geometry_1);\n }\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @return {Feature} Vertex feature.\n * @private\n */\n Modify.prototype.createOrUpdateVertexFeature_ = function (coordinates) {\n var vertexFeature = this.vertexFeature_;\n if (!vertexFeature) {\n vertexFeature = new Feature(new Point(coordinates));\n this.vertexFeature_ = vertexFeature;\n this.overlay_.getSource().addFeature(vertexFeature);\n }\n else {\n var geometry = vertexFeature.getGeometry();\n geometry.setCoordinates(coordinates);\n }\n return vertexFeature;\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} and may modify the geometry.\n * @override\n */\n Modify.prototype.handleEvent = function (mapBrowserEvent) {\n if (!( /** @type {import(\"../MapBrowserPointerEvent.js\").default} */(mapBrowserEvent).pointerEvent)) {\n return true;\n }\n this.lastPointerEvent_ = mapBrowserEvent;\n var handled;\n if (!mapBrowserEvent.map.getView().getInteracting() &&\n mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE &&\n !this.handlingDownUpSequence) {\n this.handlePointerMove_(mapBrowserEvent);\n }\n if (this.vertexFeature_ && this.deleteCondition_(mapBrowserEvent)) {\n if (mapBrowserEvent.type != MapBrowserEventType.SINGLECLICK || !this.ignoreNextSingleClick_) {\n handled = this.removePoint();\n }\n else {\n handled = true;\n }\n }\n if (mapBrowserEvent.type == MapBrowserEventType.SINGLECLICK) {\n this.ignoreNextSingleClick_ = false;\n }\n return _super.prototype.handleEvent.call(this, mapBrowserEvent) && !handled;\n };\n /**\n * @inheritDoc\n */\n Modify.prototype.handleDragEvent = function (evt) {\n this.ignoreNextSingleClick_ = false;\n this.willModifyFeatures_(evt);\n var vertex = evt.coordinate;\n for (var i = 0, ii = this.dragSegments_.length; i < ii; ++i) {\n var dragSegment = this.dragSegments_[i];\n var segmentData = dragSegment[0];\n var depth = segmentData.depth;\n var geometry = segmentData.geometry;\n var coordinates = void 0;\n var segment = segmentData.segment;\n var index = dragSegment[1];\n while (vertex.length < geometry.getStride()) {\n vertex.push(segment[index][vertex.length]);\n }\n switch (geometry.getType()) {\n case GeometryType.POINT:\n coordinates = vertex;\n segment[0] = vertex;\n segment[1] = vertex;\n break;\n case GeometryType.MULTI_POINT:\n coordinates = geometry.getCoordinates();\n coordinates[segmentData.index] = vertex;\n segment[0] = vertex;\n segment[1] = vertex;\n break;\n case GeometryType.LINE_STRING:\n coordinates = geometry.getCoordinates();\n coordinates[segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case GeometryType.MULTI_LINE_STRING:\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case GeometryType.POLYGON:\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case GeometryType.MULTI_POLYGON:\n coordinates = geometry.getCoordinates();\n coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case GeometryType.CIRCLE:\n segment[0] = vertex;\n segment[1] = vertex;\n if (segmentData.index === CIRCLE_CENTER_INDEX) {\n this.changingFeature_ = true;\n geometry.setCenter(vertex);\n this.changingFeature_ = false;\n }\n else { // We're dragging the circle's circumference:\n this.changingFeature_ = true;\n geometry.setRadius(coordinateDistance(geometry.getCenter(), vertex));\n this.changingFeature_ = false;\n }\n break;\n default:\n // pass\n }\n if (coordinates) {\n this.setGeometryCoordinates_(geometry, coordinates);\n }\n }\n this.createOrUpdateVertexFeature_(vertex);\n };\n /**\n * @inheritDoc\n */\n Modify.prototype.handleDownEvent = function (evt) {\n if (!this.condition_(evt)) {\n return false;\n }\n this.handlePointerAtPixel_(evt.pixel, evt.map);\n var pixelCoordinate = evt.coordinate;\n this.dragSegments_.length = 0;\n this.modified_ = false;\n var vertexFeature = this.vertexFeature_;\n if (vertexFeature) {\n var projection = evt.map.getView().getProjection();\n var insertVertices = [];\n var vertex = vertexFeature.getGeometry().getCoordinates();\n var vertexExtent = boundingExtent([vertex]);\n var segmentDataMatches = this.rBush_.getInExtent(vertexExtent);\n var componentSegments = {};\n segmentDataMatches.sort(compareIndexes);\n for (var i = 0, ii = segmentDataMatches.length; i < ii; ++i) {\n var segmentDataMatch = segmentDataMatches[i];\n var segment = segmentDataMatch.segment;\n var uid = getUid(segmentDataMatch.feature);\n var depth = segmentDataMatch.depth;\n if (depth) {\n uid += '-' + depth.join('-'); // separate feature components\n }\n if (!componentSegments[uid]) {\n componentSegments[uid] = new Array(2);\n }\n if (segmentDataMatch.geometry.getType() === GeometryType.CIRCLE && segmentDataMatch.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n var closestVertex = closestOnSegmentData(pixelCoordinate, segmentDataMatch, projection);\n if (coordinatesEqual(closestVertex, vertex) && !componentSegments[uid][0]) {\n this.dragSegments_.push([segmentDataMatch, 0]);\n componentSegments[uid][0] = segmentDataMatch;\n }\n continue;\n }\n if (coordinatesEqual(segment[0], vertex) && !componentSegments[uid][0]) {\n this.dragSegments_.push([segmentDataMatch, 0]);\n componentSegments[uid][0] = segmentDataMatch;\n continue;\n }\n if (coordinatesEqual(segment[1], vertex) && !componentSegments[uid][1]) {\n // prevent dragging closed linestrings by the connecting node\n if ((segmentDataMatch.geometry.getType() ===\n GeometryType.LINE_STRING ||\n segmentDataMatch.geometry.getType() ===\n GeometryType.MULTI_LINE_STRING) &&\n componentSegments[uid][0] &&\n componentSegments[uid][0].index === 0) {\n continue;\n }\n this.dragSegments_.push([segmentDataMatch, 1]);\n componentSegments[uid][1] = segmentDataMatch;\n continue;\n }\n if (getUid(segment) in this.vertexSegments_ &&\n (!componentSegments[uid][0] && !componentSegments[uid][1]) &&\n this.insertVertexCondition_(evt)) {\n insertVertices.push([segmentDataMatch, vertex]);\n }\n }\n if (insertVertices.length) {\n this.willModifyFeatures_(evt);\n }\n for (var j = insertVertices.length - 1; j >= 0; --j) {\n this.insertVertex_.apply(this, insertVertices[j]);\n }\n }\n return !!this.vertexFeature_;\n };\n /**\n * @inheritDoc\n */\n Modify.prototype.handleUpEvent = function (evt) {\n for (var i = this.dragSegments_.length - 1; i >= 0; --i) {\n var segmentData = this.dragSegments_[i][0];\n var geometry = segmentData.geometry;\n if (geometry.getType() === GeometryType.CIRCLE) {\n // Update a circle object in the R* bush:\n var coordinates = geometry.getCenter();\n var centerSegmentData = segmentData.featureSegments[0];\n var circumferenceSegmentData = segmentData.featureSegments[1];\n centerSegmentData.segment[0] = coordinates;\n centerSegmentData.segment[1] = coordinates;\n circumferenceSegmentData.segment[0] = coordinates;\n circumferenceSegmentData.segment[1] = coordinates;\n this.rBush_.update(createExtent(coordinates), centerSegmentData);\n this.rBush_.update(geometry.getExtent(), circumferenceSegmentData);\n }\n else {\n this.rBush_.update(boundingExtent(segmentData.segment), segmentData);\n }\n }\n if (this.modified_) {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.features_, evt));\n this.modified_ = false;\n }\n return false;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @private\n */\n Modify.prototype.handlePointerMove_ = function (evt) {\n this.lastPixel_ = evt.pixel;\n this.handlePointerAtPixel_(evt.pixel, evt.map);\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @private\n */\n Modify.prototype.handlePointerAtPixel_ = function (pixel, map) {\n var pixelCoordinate = map.getCoordinateFromPixel(pixel);\n var projection = map.getView().getProjection();\n var sortByDistance = function (a, b) {\n return projectedDistanceToSegmentDataSquared(pixelCoordinate, a, projection) -\n projectedDistanceToSegmentDataSquared(pixelCoordinate, b, projection);\n };\n var viewExtent = fromUserExtent(createExtent(pixelCoordinate, tempExtent), projection);\n var buffer = map.getView().getResolution() * this.pixelTolerance_;\n var box = toUserExtent(bufferExtent(viewExtent, buffer, tempExtent), projection);\n var rBush = this.rBush_;\n var nodes = rBush.getInExtent(box);\n if (nodes.length > 0) {\n nodes.sort(sortByDistance);\n var node = nodes[0];\n var closestSegment = node.segment;\n var vertex = closestOnSegmentData(pixelCoordinate, node, projection);\n var vertexPixel = map.getPixelFromCoordinate(vertex);\n var dist = coordinateDistance(pixel, vertexPixel);\n if (dist <= this.pixelTolerance_) {\n /** @type {Object<string, boolean>} */\n var vertexSegments = {};\n if (node.geometry.getType() === GeometryType.CIRCLE && node.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n this.snappedToVertex_ = true;\n this.createOrUpdateVertexFeature_(vertex);\n }\n else {\n var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);\n var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);\n var squaredDist1 = squaredCoordinateDistance(vertexPixel, pixel1);\n var squaredDist2 = squaredCoordinateDistance(vertexPixel, pixel2);\n dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n this.snappedToVertex_ = dist <= this.pixelTolerance_;\n if (this.snappedToVertex_) {\n vertex = squaredDist1 > squaredDist2 ? closestSegment[1] : closestSegment[0];\n }\n this.createOrUpdateVertexFeature_(vertex);\n for (var i = 1, ii = nodes.length; i < ii; ++i) {\n var segment = nodes[i].segment;\n if ((coordinatesEqual(closestSegment[0], segment[0]) &&\n coordinatesEqual(closestSegment[1], segment[1]) ||\n (coordinatesEqual(closestSegment[0], segment[1]) &&\n coordinatesEqual(closestSegment[1], segment[0])))) {\n vertexSegments[getUid(segment)] = true;\n }\n else {\n break;\n }\n }\n }\n vertexSegments[getUid(closestSegment)] = true;\n this.vertexSegments_ = vertexSegments;\n return;\n }\n }\n if (this.vertexFeature_) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n };\n /**\n * @param {SegmentData} segmentData Segment data.\n * @param {import(\"../coordinate.js\").Coordinate} vertex Vertex.\n * @private\n */\n Modify.prototype.insertVertex_ = function (segmentData, vertex) {\n var segment = segmentData.segment;\n var feature = segmentData.feature;\n var geometry = segmentData.geometry;\n var depth = segmentData.depth;\n var index = segmentData.index;\n var coordinates;\n while (vertex.length < geometry.getStride()) {\n vertex.push(0);\n }\n switch (geometry.getType()) {\n case GeometryType.MULTI_LINE_STRING:\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]].splice(index + 1, 0, vertex);\n break;\n case GeometryType.POLYGON:\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]].splice(index + 1, 0, vertex);\n break;\n case GeometryType.MULTI_POLYGON:\n coordinates = geometry.getCoordinates();\n coordinates[depth[1]][depth[0]].splice(index + 1, 0, vertex);\n break;\n case GeometryType.LINE_STRING:\n coordinates = geometry.getCoordinates();\n coordinates.splice(index + 1, 0, vertex);\n break;\n default:\n return;\n }\n this.setGeometryCoordinates_(geometry, coordinates);\n var rTree = this.rBush_;\n rTree.remove(segmentData);\n this.updateSegmentIndices_(geometry, index, depth, 1);\n /** @type {SegmentData} */\n var newSegmentData = {\n segment: [segment[0], vertex],\n feature: feature,\n geometry: geometry,\n depth: depth,\n index: index\n };\n rTree.insert(boundingExtent(newSegmentData.segment), newSegmentData);\n this.dragSegments_.push([newSegmentData, 1]);\n /** @type {SegmentData} */\n var newSegmentData2 = {\n segment: [vertex, segment[1]],\n feature: feature,\n geometry: geometry,\n depth: depth,\n index: index + 1\n };\n rTree.insert(boundingExtent(newSegmentData2.segment), newSegmentData2);\n this.dragSegments_.push([newSegmentData2, 0]);\n this.ignoreNextSingleClick_ = true;\n };\n /**\n * Removes the vertex currently being pointed.\n * @return {boolean} True when a vertex was removed.\n * @api\n */\n Modify.prototype.removePoint = function () {\n if (this.lastPointerEvent_ && this.lastPointerEvent_.type != MapBrowserEventType.POINTERDRAG) {\n var evt = this.lastPointerEvent_;\n this.willModifyFeatures_(evt);\n var removed = this.removeVertex_();\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.features_, evt));\n this.modified_ = false;\n return removed;\n }\n return false;\n };\n /**\n * Removes a vertex from all matching features.\n * @return {boolean} True when a vertex was removed.\n * @private\n */\n Modify.prototype.removeVertex_ = function () {\n var dragSegments = this.dragSegments_;\n var segmentsByFeature = {};\n var deleted = false;\n var component, coordinates, dragSegment, geometry, i, index, left;\n var newIndex, right, segmentData, uid;\n for (i = dragSegments.length - 1; i >= 0; --i) {\n dragSegment = dragSegments[i];\n segmentData = dragSegment[0];\n uid = getUid(segmentData.feature);\n if (segmentData.depth) {\n // separate feature components\n uid += '-' + segmentData.depth.join('-');\n }\n if (!(uid in segmentsByFeature)) {\n segmentsByFeature[uid] = {};\n }\n if (dragSegment[1] === 0) {\n segmentsByFeature[uid].right = segmentData;\n segmentsByFeature[uid].index = segmentData.index;\n }\n else if (dragSegment[1] == 1) {\n segmentsByFeature[uid].left = segmentData;\n segmentsByFeature[uid].index = segmentData.index + 1;\n }\n }\n for (uid in segmentsByFeature) {\n right = segmentsByFeature[uid].right;\n left = segmentsByFeature[uid].left;\n index = segmentsByFeature[uid].index;\n newIndex = index - 1;\n if (left !== undefined) {\n segmentData = left;\n }\n else {\n segmentData = right;\n }\n if (newIndex < 0) {\n newIndex = 0;\n }\n geometry = segmentData.geometry;\n coordinates = geometry.getCoordinates();\n component = coordinates;\n deleted = false;\n switch (geometry.getType()) {\n case GeometryType.MULTI_LINE_STRING:\n if (coordinates[segmentData.depth[0]].length > 2) {\n coordinates[segmentData.depth[0]].splice(index, 1);\n deleted = true;\n }\n break;\n case GeometryType.LINE_STRING:\n if (coordinates.length > 2) {\n coordinates.splice(index, 1);\n deleted = true;\n }\n break;\n case GeometryType.MULTI_POLYGON:\n component = component[segmentData.depth[1]];\n /* falls through */\n case GeometryType.POLYGON:\n component = component[segmentData.depth[0]];\n if (component.length > 4) {\n if (index == component.length - 1) {\n index = 0;\n }\n component.splice(index, 1);\n deleted = true;\n if (index === 0) {\n // close the ring again\n component.pop();\n component.push(component[0]);\n newIndex = component.length - 1;\n }\n }\n break;\n default:\n // pass\n }\n if (deleted) {\n this.setGeometryCoordinates_(geometry, coordinates);\n var segments = [];\n if (left !== undefined) {\n this.rBush_.remove(left);\n segments.push(left.segment[0]);\n }\n if (right !== undefined) {\n this.rBush_.remove(right);\n segments.push(right.segment[1]);\n }\n if (left !== undefined && right !== undefined) {\n /** @type {SegmentData} */\n var newSegmentData = {\n depth: segmentData.depth,\n feature: segmentData.feature,\n geometry: segmentData.geometry,\n index: newIndex,\n segment: segments\n };\n this.rBush_.insert(boundingExtent(newSegmentData.segment), newSegmentData);\n }\n this.updateSegmentIndices_(geometry, index, segmentData.depth, -1);\n if (this.vertexFeature_) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n dragSegments.length = 0;\n }\n }\n return deleted;\n };\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {Array} coordinates Coordinates.\n * @private\n */\n Modify.prototype.setGeometryCoordinates_ = function (geometry, coordinates) {\n this.changingFeature_ = true;\n geometry.setCoordinates(coordinates);\n this.changingFeature_ = false;\n };\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {number} index Index.\n * @param {Array<number>|undefined} depth Depth.\n * @param {number} delta Delta (1 or -1).\n * @private\n */\n Modify.prototype.updateSegmentIndices_ = function (geometry, index, depth, delta) {\n this.rBush_.forEachInExtent(geometry.getExtent(), function (segmentDataMatch) {\n if (segmentDataMatch.geometry === geometry &&\n (depth === undefined || segmentDataMatch.depth === undefined ||\n equals(segmentDataMatch.depth, depth)) &&\n segmentDataMatch.index > index) {\n segmentDataMatch.index += delta;\n }\n });\n };\n return Modify;\n}(PointerInteraction));\n/**\n * @param {SegmentData} a The first segment data.\n * @param {SegmentData} b The second segment data.\n * @return {number} The difference in indexes.\n */\nfunction compareIndexes(a, b) {\n return a.index - b.index;\n}\n/**\n * Returns the distance from a point to a line segment.\n *\n * @param {import(\"../coordinate.js\").Coordinate} pointCoordinates The coordinates of the point from\n * which to calculate the distance.\n * @param {SegmentData} segmentData The object describing the line\n * segment we are calculating the distance to.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {number} The square of the distance between a point and a line segment.\n */\nfunction projectedDistanceToSegmentDataSquared(pointCoordinates, segmentData, projection) {\n var geometry = segmentData.geometry;\n if (geometry.getType() === GeometryType.CIRCLE) {\n var circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (geometry);\n if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n var distanceToCenterSquared = squaredCoordinateDistance(circleGeometry.getCenter(), pointCoordinates);\n var distanceToCircumference = Math.sqrt(distanceToCenterSquared) - circleGeometry.getRadius();\n return distanceToCircumference * distanceToCircumference;\n }\n }\n var coordinate = fromUserCoordinate(pointCoordinates, projection);\n tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);\n tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);\n return squaredDistanceToSegment(coordinate, tempSegment);\n}\n/**\n * Returns the point closest to a given line segment.\n *\n * @param {import(\"../coordinate.js\").Coordinate} pointCoordinates The point to which a closest point\n * should be found.\n * @param {SegmentData} segmentData The object describing the line\n * segment which should contain the closest point.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../coordinate.js\").Coordinate} The point closest to the specified line segment.\n */\nfunction closestOnSegmentData(pointCoordinates, segmentData, projection) {\n var geometry = segmentData.geometry;\n if (geometry.getType() === GeometryType.CIRCLE && segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n return geometry.getClosestPoint(pointCoordinates);\n }\n var coordinate = fromUserCoordinate(pointCoordinates, projection);\n tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);\n tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);\n return toUserCoordinate(closestOnSegment(coordinate, tempSegment), projection);\n}\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n var style = createEditingStyle();\n return function (feature, resolution) {\n return style[GeometryType.POINT];\n };\n}\nexport default Modify;\n//# sourceMappingURL=Modify.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Select\n */\nimport { getUid } from '../util.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport { extend, includes } from '../array.js';\nimport Event from '../events/Event.js';\nimport { singleClick, never, shiftKeyOnly } from '../events/condition.js';\nimport { TRUE } from '../functions.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport Interaction from './Interaction.js';\nimport { clear } from '../obj.js';\nimport { createEditingStyle } from '../style/Style.js';\nimport Collection from '../Collection.js';\n/**\n * @enum {string}\n */\nvar SelectEventType = {\n /**\n * Triggered when feature(s) has been (de)selected.\n * @event SelectEvent#select\n * @api\n */\n SELECT: 'select'\n};\n/**\n * A function that takes an {@link module:ol/Feature} or\n * {@link module:ol/render/Feature} and an\n * {@link module:ol/layer/Layer} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @typedef {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default):boolean} FilterFunction\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [addCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition~never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is the event\n * for the selected features as a whole. By default, this is\n * {@link module:ol/events/condition~singleClick}. Clicking on a feature selects that\n * feature and removes any that were in the selection. Clicking outside any\n * feature removes all from the selection.\n * See `toggle`, `add`, `remove` options for adding/removing extra features to/\n * from the selection.\n * @property {Array<import(\"../layer/Layer.js\").default>|function(import(\"../layer/Layer.js\").default): boolean} [layers]\n * A list of layers from which features should be selected. Alternatively, a\n * filter function can be provided. The function will be called for each layer\n * in the map and should return `true` for layers that you want to be\n * selectable. If the option is absent, all visible layers will be considered\n * selectable.\n * @property {import(\"../style/Style.js\").StyleLike} [style]\n * Style for the selected features. By default the default edit style is used\n * (see {@link module:ol/style}).\n * If set to `false` the selected feature's style will not change.\n * @property {import(\"../events/condition.js\").Condition} [removeCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition~never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [toggleCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is in addition\n * to the `condition` event. By default,\n * {@link module:ol/events/condition~shiftKeyOnly}, i.e. pressing `shift` as\n * well as the `condition` event, adds that feature to the current selection if\n * it is not currently selected, and removes it if it is. See `add` and `remove`\n * if you want to use different events instead of a toggle.\n * @property {boolean} [multi=false] A boolean that determines if the default\n * behaviour should select only single features or all (overlapping) features at\n * the clicked map position. The default of `false` means single select.\n * @property {import(\"../Collection.js\").default<import(\"../Feature.js\").default>} [features]\n * Collection where the interaction will place selected features. Optional. If\n * not set the interaction will create a collection. In any case the collection\n * used by the interaction is returned by\n * {@link module:ol/interaction/Select~Select#getFeatures}.\n * @property {FilterFunction} [filter] A function\n * that takes an {@link module:ol/Feature} and an\n * {@link module:ol/layer/Layer} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside\n * the radius around the given position will be checked for features.\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Select~Select} instances are instances of\n * this type.\n */\nvar SelectEvent = /** @class */ (function (_super) {\n __extends(SelectEvent, _super);\n /**\n * @param {SelectEventType} type The event type.\n * @param {Array<import(\"../Feature.js\").default>} selected Selected features.\n * @param {Array<import(\"../Feature.js\").default>} deselected Deselected features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Associated\n * {@link module:ol/MapBrowserEvent}.\n */\n function SelectEvent(type, selected, deselected, mapBrowserEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * Selected features array.\n * @type {Array<import(\"../Feature.js\").default>}\n * @api\n */\n _this.selected = selected;\n /**\n * Deselected features array.\n * @type {Array<import(\"../Feature.js\").default>}\n * @api\n */\n _this.deselected = deselected;\n /**\n * Associated {@link module:ol/MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserEvent;\n return _this;\n }\n return SelectEvent;\n}(Event));\n/**\n * @classdesc\n * Interaction for selecting vector features. By default, selected features are\n * styled differently, so this interaction can be used for visual highlighting,\n * as well as selecting features for other actions, such as modification or\n * output. There are three ways of controlling which features are selected:\n * using the browser event as defined by the `condition` and optionally the\n * `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a\n * further feature filter using the `filter` option.\n *\n * Selected features are added to an internal unmanaged layer.\n *\n * @fires SelectEvent\n * @api\n */\nvar Select = /** @class */ (function (_super) {\n __extends(Select, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Select(opt_options) {\n var _this = _super.call(this, {\n handleEvent: handleEvent\n }) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : singleClick;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.addCondition_ = options.addCondition ? options.addCondition : never;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.removeCondition_ = options.removeCondition ? options.removeCondition : never;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.toggleCondition_ = options.toggleCondition ? options.toggleCondition : shiftKeyOnly;\n /**\n * @private\n * @type {boolean}\n */\n _this.multi_ = options.multi ? options.multi : false;\n /**\n * @private\n * @type {FilterFunction}\n */\n _this.filter_ = options.filter ? options.filter : TRUE;\n /**\n * @private\n * @type {number}\n */\n _this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;\n /**\n * @private\n * @type {import(\"../style/Style.js\").default|Array.<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction|null}\n */\n _this.style_ = options.style !== undefined ? options.style : getDefaultStyleFunction();\n /**\n * An association between selected feature (key)\n * and original style (value)\n * @private\n * @type {Object.<number, import(\"../style/Style.js\").default|Array.<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction>}\n */\n _this.featureStyleAssociation_ = {};\n /**\n * @private\n * @type {import(\"../Collection.js\").default}\n */\n _this.features_ = options.features || new Collection();\n /** @type {function(import(\"../layer/Layer.js\").default): boolean} */\n var layerFilter;\n if (options.layers) {\n if (typeof options.layers === 'function') {\n layerFilter = options.layers;\n }\n else {\n var layers_1 = options.layers;\n layerFilter = function (layer) {\n return includes(layers_1, layer);\n };\n }\n }\n else {\n layerFilter = TRUE;\n }\n /**\n * @private\n * @type {function(import(\"../layer/Layer.js\").default): boolean}\n */\n _this.layerFilter_ = layerFilter;\n /**\n * An association between selected feature (key)\n * and layer (value)\n * @private\n * @type {Object<string, import(\"../layer/Layer.js\").default>}\n */\n _this.featureLayerAssociation_ = {};\n var features = _this.getFeatures();\n features.addEventListener(CollectionEventType.ADD, _this.addFeature_.bind(_this));\n features.addEventListener(CollectionEventType.REMOVE, _this.removeFeature_.bind(_this));\n return _this;\n }\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @private\n */\n Select.prototype.addFeatureLayerAssociation_ = function (feature, layer) {\n this.featureLayerAssociation_[getUid(feature)] = layer;\n };\n /**\n * Get the selected features.\n * @return {import(\"../Collection.js\").default<import(\"../Feature.js\").default>} Features collection.\n * @api\n */\n Select.prototype.getFeatures = function () {\n return this.features_;\n };\n /**\n * Returns the Hit-detection tolerance.\n * @returns {number} Hit tolerance in pixels.\n * @api\n */\n Select.prototype.getHitTolerance = function () {\n return this.hitTolerance_;\n };\n /**\n * Returns the associated {@link module:ol/layer/Vector~Vector vectorlayer} of\n * the (last) selected feature. Note that this will not work with any\n * programmatic method like pushing features to\n * {@link module:ol/interaction/Select~Select#getFeatures collection}.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature\n * @return {import('../layer/Vector.js').default} Layer.\n * @api\n */\n Select.prototype.getLayer = function (feature) {\n return (\n /** @type {import('../layer/Vector.js').default} */ (this.featureLayerAssociation_[getUid(feature)]));\n };\n /**\n * Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @api\n */\n Select.prototype.setHitTolerance = function (hitTolerance) {\n this.hitTolerance_ = hitTolerance;\n };\n /**\n * Remove the interaction from its current map, if any, and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @override\n * @api\n */\n Select.prototype.setMap = function (map) {\n var currentMap = this.getMap();\n if (currentMap && this.style_) {\n this.features_.forEach(this.removeSelectedStyle_.bind(this));\n }\n _super.prototype.setMap.call(this, map);\n if (map && this.style_) {\n this.features_.forEach(this.giveSelectedStyle_.bind(this));\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Select.prototype.addFeature_ = function (evt) {\n var feature = evt.element;\n if (this.style_) {\n this.giveSelectedStyle_(feature);\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Select.prototype.removeFeature_ = function (evt) {\n var feature = evt.element;\n if (this.style_) {\n this.removeSelectedStyle_(feature);\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Select.prototype.giveSelectedStyle_ = function (feature) {\n var key = getUid(feature);\n this.featureStyleAssociation_[key] = feature.getStyle();\n feature.setStyle(this.style_);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Select.prototype.removeSelectedStyle_ = function (feature) {\n var key = getUid(feature);\n feature.setStyle(this.featureStyleAssociation_[key]);\n delete this.featureStyleAssociation_[key];\n };\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @private\n */\n Select.prototype.removeFeatureLayerAssociation_ = function (feature) {\n delete this.featureLayerAssociation_[getUid(feature)];\n };\n return Select;\n}(Interaction));\n/**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} and may change the\n * selected state of features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {Select}\n */\nfunction handleEvent(mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n var add = this.addCondition_(mapBrowserEvent);\n var remove = this.removeCondition_(mapBrowserEvent);\n var toggle = this.toggleCondition_(mapBrowserEvent);\n var set = !add && !remove && !toggle;\n var map = mapBrowserEvent.map;\n var features = this.getFeatures();\n var deselected = [];\n var selected = [];\n if (set) {\n // Replace the currently selected feature(s) with the feature(s) at the\n // pixel, or clear the selected feature(s) if there is no feature at\n // the pixel.\n clear(this.featureLayerAssociation_);\n map.forEachFeatureAtPixel(mapBrowserEvent.pixel, (\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n function (feature, layer) {\n if (this.filter_(feature, layer)) {\n selected.push(feature);\n this.addFeatureLayerAssociation_(feature, layer);\n return !this.multi_;\n }\n }).bind(this), {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_\n });\n for (var i = features.getLength() - 1; i >= 0; --i) {\n var feature = features.item(i);\n var index = selected.indexOf(feature);\n if (index > -1) {\n // feature is already selected\n selected.splice(index, 1);\n }\n else {\n features.remove(feature);\n deselected.push(feature);\n }\n }\n if (selected.length !== 0) {\n features.extend(selected);\n }\n }\n else {\n // Modify the currently selected feature(s).\n map.forEachFeatureAtPixel(mapBrowserEvent.pixel, (\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n function (feature, layer) {\n if (this.filter_(feature, layer)) {\n if ((add || toggle) && !includes(features.getArray(), feature)) {\n selected.push(feature);\n this.addFeatureLayerAssociation_(feature, layer);\n }\n else if ((remove || toggle) && includes(features.getArray(), feature)) {\n deselected.push(feature);\n this.removeFeatureLayerAssociation_(feature);\n }\n return !this.multi_;\n }\n }).bind(this), {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_\n });\n for (var j = deselected.length - 1; j >= 0; --j) {\n features.remove(deselected[j]);\n }\n features.extend(selected);\n }\n if (selected.length > 0 || deselected.length > 0) {\n this.dispatchEvent(new SelectEvent(SelectEventType.SELECT, selected, deselected, mapBrowserEvent));\n }\n return true;\n}\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n var styles = createEditingStyle();\n extend(styles[GeometryType.POLYGON], styles[GeometryType.LINE_STRING]);\n extend(styles[GeometryType.GEOMETRY_COLLECTION], styles[GeometryType.LINE_STRING]);\n return function (feature) {\n if (!feature.getGeometry()) {\n return null;\n }\n return styles[feature.getGeometry().getType()];\n };\n}\nexport default Select;\n//# sourceMappingURL=Select.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Snap\n */\nimport { getUid } from '../util.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport { distance as coordinateDistance, squaredDistance as squaredCoordinateDistance, closestOnCircle, closestOnSegment, squaredDistanceToSegment } from '../coordinate.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { boundingExtent, createEmpty } from '../extent.js';\nimport { TRUE, FALSE } from '../functions.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport { fromCircle } from '../geom/Polygon.js';\nimport PointerInteraction from './Pointer.js';\nimport { getValues } from '../obj.js';\nimport VectorEventType from '../source/VectorEventType.js';\nimport RBush from '../structs/RBush.js';\nimport { fromUserCoordinate, toUserCoordinate } from '../proj.js';\n/**\n * @typedef {Object} Result\n * @property {boolean} snapped\n * @property {import(\"../coordinate.js\").Coordinate|null} vertex\n * @property {import(\"../pixel.js\").Pixel|null} vertexPixel\n */\n/**\n * @typedef {Object} SegmentData\n * @property {import(\"../Feature.js\").default} feature\n * @property {Array<import(\"../coordinate.js\").Coordinate>} segment\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../Collection.js\").default<import(\"../Feature.js\").default>} [features] Snap to these features. Either this option or source should be provided.\n * @property {boolean} [edge=true] Snap to edges.\n * @property {boolean} [vertex=true] Snap to vertices.\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the pointer close enough to a segment or\n * vertex for snapping.\n * @property {import(\"../source/Vector.js\").default} [source] Snap to features from this source. Either this option or features should be provided\n */\n/**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent} evt Event.\n * @return {import(\"../Feature.js\").default} Feature.\n */\nfunction getFeatureFromEvent(evt) {\n if ( /** @type {import(\"../source/Vector.js\").VectorSourceEvent} */(evt).feature) {\n return /** @type {import(\"../source/Vector.js\").VectorSourceEvent} */ (evt).feature;\n }\n else if ( /** @type {import(\"../Collection.js\").CollectionEvent} */(evt).element) {\n return /** @type {import(\"../Feature.js\").default} */ ( /** @type {import(\"../Collection.js\").CollectionEvent} */(evt).element);\n }\n}\nvar tempSegment = [];\n/**\n * @classdesc\n * Handles snapping of vector features while modifying or drawing them. The\n * features can come from a {@link module:ol/source/Vector} or {@link module:ol/Collection~Collection}\n * Any interaction object that allows the user to interact\n * with the features using the mouse can benefit from the snapping, as long\n * as it is added before.\n *\n * The snap interaction modifies map browser event `coordinate` and `pixel`\n * properties to force the snap to occur to any interaction that them.\n *\n * Example:\n *\n * import Snap from 'ol/interaction/Snap';\n *\n * const snap = new Snap({\n * source: source\n * });\n *\n * map.addInteraction(snap);\n *\n * @api\n */\nvar Snap = /** @class */ (function (_super) {\n __extends(Snap, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Snap(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.handleDownEvent) {\n pointerOptions.handleDownEvent = TRUE;\n }\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @type {import(\"../source/Vector.js\").default}\n * @private\n */\n _this.source_ = options.source ? options.source : null;\n /**\n * @private\n * @type {boolean}\n */\n _this.vertex_ = options.vertex !== undefined ? options.vertex : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.edge_ = options.edge !== undefined ? options.edge : true;\n /**\n * @type {import(\"../Collection.js\").default<import(\"../Feature.js\").default>}\n * @private\n */\n _this.features_ = options.features ? options.features : null;\n /**\n * @type {Array<import(\"../events.js\").EventsKey>}\n * @private\n */\n _this.featuresListenerKeys_ = [];\n /**\n * @type {Object<string, import(\"../events.js\").EventsKey>}\n * @private\n */\n _this.featureChangeListenerKeys_ = {};\n /**\n * Extents are preserved so indexed segment can be quickly removed\n * when its feature geometry changes\n * @type {Object<string, import(\"../extent.js\").Extent>}\n * @private\n */\n _this.indexedFeaturesExtents_ = {};\n /**\n * If a feature geometry changes while a pointer drag|move event occurs, the\n * feature doesn't get updated right away. It will be at the next 'pointerup'\n * event fired.\n * @type {!Object<string, import(\"../Feature.js\").default>}\n * @private\n */\n _this.pendingFeatures_ = {};\n /**\n * @type {number}\n * @private\n */\n _this.pixelTolerance_ = options.pixelTolerance !== undefined ?\n options.pixelTolerance : 10;\n /**\n * Segment RTree for each layer\n * @type {import(\"../structs/RBush.js\").default<SegmentData>}\n * @private\n */\n _this.rBush_ = new RBush();\n /**\n * @const\n * @private\n * @type {Object<string, function(import(\"../Feature.js\").default, import(\"../geom/Geometry.js\").default): void>}\n */\n _this.SEGMENT_WRITERS_ = {\n 'Point': _this.writePointGeometry_.bind(_this),\n 'LineString': _this.writeLineStringGeometry_.bind(_this),\n 'LinearRing': _this.writeLineStringGeometry_.bind(_this),\n 'Polygon': _this.writePolygonGeometry_.bind(_this),\n 'MultiPoint': _this.writeMultiPointGeometry_.bind(_this),\n 'MultiLineString': _this.writeMultiLineStringGeometry_.bind(_this),\n 'MultiPolygon': _this.writeMultiPolygonGeometry_.bind(_this),\n 'GeometryCollection': _this.writeGeometryCollectionGeometry_.bind(_this),\n 'Circle': _this.writeCircleGeometry_.bind(_this)\n };\n return _this;\n }\n /**\n * Add a feature to the collection of features that we may snap to.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {boolean=} opt_listen Whether to listen to the feature change or not\n * Defaults to `true`.\n * @api\n */\n Snap.prototype.addFeature = function (feature, opt_listen) {\n var register = opt_listen !== undefined ? opt_listen : true;\n var feature_uid = getUid(feature);\n var geometry = feature.getGeometry();\n if (geometry) {\n var segmentWriter = this.SEGMENT_WRITERS_[geometry.getType()];\n if (segmentWriter) {\n this.indexedFeaturesExtents_[feature_uid] = geometry.getExtent(createEmpty());\n segmentWriter(feature, geometry);\n }\n }\n if (register) {\n this.featureChangeListenerKeys_[feature_uid] = listen(feature, EventType.CHANGE, this.handleFeatureChange_, this);\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @private\n */\n Snap.prototype.forEachFeatureAdd_ = function (feature) {\n this.addFeature(feature);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @private\n */\n Snap.prototype.forEachFeatureRemove_ = function (feature) {\n this.removeFeature(feature);\n };\n /**\n * @return {import(\"../Collection.js\").default<import(\"../Feature.js\").default>|Array<import(\"../Feature.js\").default>} Features.\n * @private\n */\n Snap.prototype.getFeatures_ = function () {\n var features;\n if (this.features_) {\n features = this.features_;\n }\n else if (this.source_) {\n features = this.source_.getFeatures();\n }\n return features;\n };\n /**\n * @inheritDoc\n */\n Snap.prototype.handleEvent = function (evt) {\n var result = this.snapTo(evt.pixel, evt.coordinate, evt.map);\n if (result.snapped) {\n evt.coordinate = result.vertex.slice(0, 2);\n evt.pixel = result.vertexPixel;\n }\n return _super.prototype.handleEvent.call(this, evt);\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Snap.prototype.handleFeatureAdd_ = function (evt) {\n var feature = getFeatureFromEvent(evt);\n this.addFeature(feature);\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Snap.prototype.handleFeatureRemove_ = function (evt) {\n var feature = getFeatureFromEvent(evt);\n this.removeFeature(feature);\n };\n /**\n * @param {import(\"../events/Event.js\").default} evt Event.\n * @private\n */\n Snap.prototype.handleFeatureChange_ = function (evt) {\n var feature = /** @type {import(\"../Feature.js\").default} */ (evt.target);\n if (this.handlingDownUpSequence) {\n var uid = getUid(feature);\n if (!(uid in this.pendingFeatures_)) {\n this.pendingFeatures_[uid] = feature;\n }\n }\n else {\n this.updateFeature_(feature);\n }\n };\n /**\n * @inheritDoc\n */\n Snap.prototype.handleUpEvent = function (evt) {\n var featuresToUpdate = getValues(this.pendingFeatures_);\n if (featuresToUpdate.length) {\n featuresToUpdate.forEach(this.updateFeature_.bind(this));\n this.pendingFeatures_ = {};\n }\n return false;\n };\n /**\n * Remove a feature from the collection of features that we may snap to.\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {boolean=} opt_unlisten Whether to unlisten to the feature change\n * or not. Defaults to `true`.\n * @api\n */\n Snap.prototype.removeFeature = function (feature, opt_unlisten) {\n var unregister = opt_unlisten !== undefined ? opt_unlisten : true;\n var feature_uid = getUid(feature);\n var extent = this.indexedFeaturesExtents_[feature_uid];\n if (extent) {\n var rBush = this.rBush_;\n var nodesToRemove_1 = [];\n rBush.forEachInExtent(extent, function (node) {\n if (feature === node.feature) {\n nodesToRemove_1.push(node);\n }\n });\n for (var i = nodesToRemove_1.length - 1; i >= 0; --i) {\n rBush.remove(nodesToRemove_1[i]);\n }\n }\n if (unregister) {\n unlistenByKey(this.featureChangeListenerKeys_[feature_uid]);\n delete this.featureChangeListenerKeys_[feature_uid];\n }\n };\n /**\n * @inheritDoc\n */\n Snap.prototype.setMap = function (map) {\n var currentMap = this.getMap();\n var keys = this.featuresListenerKeys_;\n var features = /** @type {Array<import(\"../Feature.js\").default>} */ (this.getFeatures_());\n if (currentMap) {\n keys.forEach(unlistenByKey);\n keys.length = 0;\n features.forEach(this.forEachFeatureRemove_.bind(this));\n }\n _super.prototype.setMap.call(this, map);\n if (map) {\n if (this.features_) {\n keys.push(listen(this.features_, CollectionEventType.ADD, this.handleFeatureAdd_, this), listen(this.features_, CollectionEventType.REMOVE, this.handleFeatureRemove_, this));\n }\n else if (this.source_) {\n keys.push(listen(this.source_, VectorEventType.ADDFEATURE, this.handleFeatureAdd_, this), listen(this.source_, VectorEventType.REMOVEFEATURE, this.handleFeatureRemove_, this));\n }\n features.forEach(this.forEachFeatureAdd_.bind(this));\n }\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../coordinate.js\").Coordinate} pixelCoordinate Coordinate\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @return {Result} Snap result\n */\n Snap.prototype.snapTo = function (pixel, pixelCoordinate, map) {\n var lowerLeft = map.getCoordinateFromPixel([pixel[0] - this.pixelTolerance_, pixel[1] + this.pixelTolerance_]);\n var upperRight = map.getCoordinateFromPixel([pixel[0] + this.pixelTolerance_, pixel[1] - this.pixelTolerance_]);\n var box = boundingExtent([lowerLeft, upperRight]);\n var segments = this.rBush_.getInExtent(box);\n // If snapping on vertices only, don't consider circles\n if (this.vertex_ && !this.edge_) {\n segments = segments.filter(function (segment) {\n return segment.feature.getGeometry().getType() !==\n GeometryType.CIRCLE;\n });\n }\n var snapped = false;\n var vertex = null;\n var vertexPixel = null;\n if (segments.length === 0) {\n return {\n snapped: snapped,\n vertex: vertex,\n vertexPixel: vertexPixel\n };\n }\n var projection = map.getView().getProjection();\n var projectedCoordinate = fromUserCoordinate(pixelCoordinate, projection);\n var closestSegmentData;\n var minSquaredDistance = Infinity;\n for (var i = 0; i < segments.length; ++i) {\n var segmentData = segments[i];\n tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);\n tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);\n var delta = squaredDistanceToSegment(projectedCoordinate, tempSegment);\n if (delta < minSquaredDistance) {\n closestSegmentData = segmentData;\n minSquaredDistance = delta;\n }\n }\n var closestSegment = closestSegmentData.segment;\n if (this.vertex_ && !this.edge_) {\n var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);\n var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);\n var squaredDist1 = squaredCoordinateDistance(pixel, pixel1);\n var squaredDist2 = squaredCoordinateDistance(pixel, pixel2);\n var dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n if (dist <= this.pixelTolerance_) {\n snapped = true;\n vertex = squaredDist1 > squaredDist2 ? closestSegment[1] : closestSegment[0];\n vertexPixel = map.getPixelFromCoordinate(vertex);\n }\n }\n else if (this.edge_) {\n var isCircle = closestSegmentData.feature.getGeometry().getType() === GeometryType.CIRCLE;\n if (isCircle) {\n vertex = closestOnCircle(pixelCoordinate, \n /** @type {import(\"../geom/Circle.js\").default} */ (closestSegmentData.feature.getGeometry()));\n }\n else {\n tempSegment[0] = fromUserCoordinate(closestSegment[0], projection);\n tempSegment[1] = fromUserCoordinate(closestSegment[1], projection);\n vertex = toUserCoordinate(closestOnSegment(projectedCoordinate, tempSegment), projection);\n }\n vertexPixel = map.getPixelFromCoordinate(vertex);\n if (coordinateDistance(pixel, vertexPixel) <= this.pixelTolerance_) {\n snapped = true;\n if (this.vertex_ && !isCircle) {\n var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);\n var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);\n var squaredDist1 = squaredCoordinateDistance(vertexPixel, pixel1);\n var squaredDist2 = squaredCoordinateDistance(vertexPixel, pixel2);\n var dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n if (dist <= this.pixelTolerance_) {\n vertex = squaredDist1 > squaredDist2 ? closestSegment[1] : closestSegment[0];\n vertexPixel = map.getPixelFromCoordinate(vertex);\n }\n }\n }\n }\n if (snapped) {\n vertexPixel = [Math.round(vertexPixel[0]), Math.round(vertexPixel[1])];\n }\n return {\n snapped: snapped,\n vertex: vertex,\n vertexPixel: vertexPixel\n };\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Snap.prototype.updateFeature_ = function (feature) {\n this.removeFeature(feature, false);\n this.addFeature(feature, false);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writeCircleGeometry_ = function (feature, geometry) {\n var polygon = fromCircle(geometry);\n var coordinates = polygon.getCoordinates()[0];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n var segmentData = {\n feature: feature,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writeGeometryCollectionGeometry_ = function (feature, geometry) {\n var geometries = geometry.getGeometriesArray();\n for (var i = 0; i < geometries.length; ++i) {\n var segmentWriter = this.SEGMENT_WRITERS_[geometries[i].getType()];\n if (segmentWriter) {\n segmentWriter(feature, geometries[i]);\n }\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/LineString.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writeLineStringGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCoordinates();\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n var segmentData = {\n feature: feature,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/MultiLineString.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writeMultiLineStringGeometry_ = function (feature, geometry) {\n var lines = geometry.getCoordinates();\n for (var j = 0, jj = lines.length; j < jj; ++j) {\n var coordinates = lines[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n var segmentData = {\n feature: feature,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/MultiPoint.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writeMultiPointGeometry_ = function (feature, geometry) {\n var points = geometry.getCoordinates();\n for (var i = 0, ii = points.length; i < ii; ++i) {\n var coordinates = points[i];\n var segmentData = {\n feature: feature,\n segment: [coordinates, coordinates]\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writeMultiPolygonGeometry_ = function (feature, geometry) {\n var polygons = geometry.getCoordinates();\n for (var k = 0, kk = polygons.length; k < kk; ++k) {\n var rings = polygons[k];\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n var segmentData = {\n feature: feature,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/Point.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writePointGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCoordinates();\n var segmentData = {\n feature: feature,\n segment: [coordinates, coordinates]\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {import(\"../geom/Polygon.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.writePolygonGeometry_ = function (feature, geometry) {\n var rings = geometry.getCoordinates();\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n var segmentData = {\n feature: feature,\n segment: segment\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n };\n return Snap;\n}(PointerInteraction));\nexport default Snap;\n//# sourceMappingURL=Snap.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Translate\n */\nimport Collection from '../Collection.js';\nimport { getChangeEventType } from '../Object.js';\nimport Event from '../events/Event.js';\nimport { TRUE } from '../functions.js';\nimport { includes } from '../array.js';\nimport PointerInteraction from './Pointer.js';\nimport InteractionProperty from './Property.js';\n/**\n * @enum {string}\n */\nvar TranslateEventType = {\n /**\n * Triggered upon feature translation start.\n * @event TranslateEvent#translatestart\n * @api\n */\n TRANSLATESTART: 'translatestart',\n /**\n * Triggered upon feature translation.\n * @event TranslateEvent#translating\n * @api\n */\n TRANSLATING: 'translating',\n /**\n * Triggered upon feature translation end.\n * @event TranslateEvent#translateend\n * @api\n */\n TRANSLATEEND: 'translateend'\n};\n/**\n * A function that takes an {@link module:ol/Feature} or\n * {@link module:ol/render/Feature} and an\n * {@link module:ol/layer/Layer} and returns `true` if the feature may be\n * translated or `false` otherwise.\n * @typedef {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default):boolean} FilterFunction\n */\n/**\n * @typedef {Object} Options\n * @property {Collection<import(\"../Feature.js\").default>} [features] Only features contained in this collection will be able to be translated. If\n * not specified, all features on the map will be able to be translated.\n * @property {Array<import(\"../layer/Layer.js\").default>|function(import(\"../layer/Layer.js\").default): boolean} [layers] A list of layers from which features should be\n * translated. Alternatively, a filter function can be provided. The\n * function will be called for each layer in the map and should return\n * `true` for layers that you want to be translatable. If the option is\n * absent, all visible layers will be considered translatable.\n * @property {FilterFunction} [filter] A function\n * that takes an {@link module:ol/Feature} and an\n * {@link module:ol/layer/Layer} and returns `true` if the feature may be\n * translated or `false` otherwise.\n * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Translate~Translate} instances\n * are instances of this type.\n */\nvar TranslateEvent = /** @class */ (function (_super) {\n __extends(TranslateEvent, _super);\n /**\n * @param {TranslateEventType} type Type.\n * @param {Collection<import(\"../Feature.js\").default>} features The features translated.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The event coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} startCoordinate The original coordinates before.translation started\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n */\n function TranslateEvent(type, features, coordinate, startCoordinate, mapBrowserEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * The features being translated.\n * @type {Collection<import(\"../Feature.js\").default>}\n * @api\n */\n _this.features = features;\n /**\n * The coordinate of the drag event.\n * @const\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n _this.coordinate = coordinate;\n /**\n * The coordinate of the start position before translation started.\n * @const\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n _this.startCoordinate = startCoordinate;\n /**\n * Associated {@link module:ol/MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserEvent;\n return _this;\n }\n return TranslateEvent;\n}(Event));\nexport { TranslateEvent };\n/**\n * @classdesc\n * Interaction for translating (moving) features.\n *\n * @fires TranslateEvent\n * @api\n */\nvar Translate = /** @class */ (function (_super) {\n __extends(Translate, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function Translate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /**\n * The last position we translated to.\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.lastCoordinate_ = null;\n /**\n * The start position before translation started.\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.startCoordinate_ = null;\n /**\n * @type {Collection<import(\"../Feature.js\").default>}\n * @private\n */\n _this.features_ = options.features !== undefined ? options.features : null;\n /** @type {function(import(\"../layer/Layer.js\").default): boolean} */\n var layerFilter;\n if (options.layers) {\n if (typeof options.layers === 'function') {\n layerFilter = options.layers;\n }\n else {\n var layers_1 = options.layers;\n layerFilter = function (layer) {\n return includes(layers_1, layer);\n };\n }\n }\n else {\n layerFilter = TRUE;\n }\n /**\n * @private\n * @type {function(import(\"../layer/Layer.js\").default): boolean}\n */\n _this.layerFilter_ = layerFilter;\n /**\n * @private\n * @type {FilterFunction}\n */\n _this.filter_ = options.filter ? options.filter : TRUE;\n /**\n * @private\n * @type {number}\n */\n _this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;\n /**\n * @type {import(\"../Feature.js\").default}\n * @private\n */\n _this.lastFeature_ = null;\n _this.addEventListener(getChangeEventType(InteractionProperty.ACTIVE), _this.handleActiveChanged_);\n return _this;\n }\n /**\n * @inheritDoc\n */\n Translate.prototype.handleDownEvent = function (event) {\n this.lastFeature_ = this.featuresAtPixel_(event.pixel, event.map);\n if (!this.lastCoordinate_ && this.lastFeature_) {\n this.startCoordinate_ = event.coordinate;\n this.lastCoordinate_ = event.coordinate;\n this.handleMoveEvent(event);\n var features = this.features_ || new Collection([this.lastFeature_]);\n this.dispatchEvent(new TranslateEvent(TranslateEventType.TRANSLATESTART, features, event.coordinate, this.startCoordinate_, event));\n return true;\n }\n return false;\n };\n /**\n * @inheritDoc\n */\n Translate.prototype.handleUpEvent = function (event) {\n if (this.lastCoordinate_) {\n this.lastCoordinate_ = null;\n this.handleMoveEvent(event);\n var features = this.features_ || new Collection([this.lastFeature_]);\n this.dispatchEvent(new TranslateEvent(TranslateEventType.TRANSLATEEND, features, event.coordinate, this.startCoordinate_, event));\n // cleanup\n this.startCoordinate_ = null;\n return true;\n }\n return false;\n };\n /**\n * @inheritDoc\n */\n Translate.prototype.handleDragEvent = function (event) {\n if (this.lastCoordinate_) {\n var newCoordinate = event.coordinate;\n var deltaX_1 = newCoordinate[0] - this.lastCoordinate_[0];\n var deltaY_1 = newCoordinate[1] - this.lastCoordinate_[1];\n var features = this.features_ || new Collection([this.lastFeature_]);\n features.forEach(function (feature) {\n var geom = feature.getGeometry();\n geom.translate(deltaX_1, deltaY_1);\n feature.setGeometry(geom);\n });\n this.lastCoordinate_ = newCoordinate;\n this.dispatchEvent(new TranslateEvent(TranslateEventType.TRANSLATING, features, newCoordinate, this.startCoordinate_, event));\n }\n };\n /**\n * @inheritDoc\n */\n Translate.prototype.handleMoveEvent = function (event) {\n var elem = event.map.getViewport();\n // Change the cursor to grab/grabbing if hovering any of the features managed\n // by the interaction\n if (this.featuresAtPixel_(event.pixel, event.map)) {\n elem.classList.remove(this.lastCoordinate_ ? 'ol-grab' : 'ol-grabbing');\n elem.classList.add(this.lastCoordinate_ ? 'ol-grabbing' : 'ol-grab');\n }\n else {\n elem.classList.remove('ol-grab', 'ol-grabbing');\n }\n };\n /**\n * Tests to see if the given coordinates intersects any of our selected\n * features.\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel coordinate to test for intersection.\n * @param {import(\"../PluggableMap.js\").default} map Map to test the intersection on.\n * @return {import(\"../Feature.js\").default} Returns the feature found at the specified pixel\n * coordinates.\n * @private\n */\n Translate.prototype.featuresAtPixel_ = function (pixel, map) {\n return map.forEachFeatureAtPixel(pixel, function (feature, layer) {\n if (this.filter_(feature, layer)) {\n if (!this.features_ || includes(this.features_.getArray(), feature)) {\n return feature;\n }\n }\n }.bind(this), {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_\n });\n };\n /**\n * Returns the Hit-detection tolerance.\n * @returns {number} Hit tolerance in pixels.\n * @api\n */\n Translate.prototype.getHitTolerance = function () {\n return this.hitTolerance_;\n };\n /**\n * Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @api\n */\n Translate.prototype.setHitTolerance = function (hitTolerance) {\n this.hitTolerance_ = hitTolerance;\n };\n /**\n * @inheritDoc\n */\n Translate.prototype.setMap = function (map) {\n var oldMap = this.getMap();\n _super.prototype.setMap.call(this, map);\n this.updateState_(oldMap);\n };\n /**\n * @private\n */\n Translate.prototype.handleActiveChanged_ = function () {\n this.updateState_(null);\n };\n /**\n * @param {import(\"../PluggableMap.js\").default} oldMap Old map.\n * @private\n */\n Translate.prototype.updateState_ = function (oldMap) {\n var map = this.getMap();\n var active = this.getActive();\n if (!map || !active) {\n map = map || oldMap;\n if (map) {\n var elem = map.getViewport();\n elem.classList.remove('ol-grab', 'ol-grabbing');\n }\n }\n };\n return Translate;\n}(PointerInteraction));\nexport default Translate;\n//# sourceMappingURL=Translate.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/GeometryCollection\n */\nimport { listen, unlistenByKey } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { createOrUpdateEmpty, closestSquaredDistanceXY, extend, getCenter } from '../extent.js';\nimport Geometry from './Geometry.js';\nimport GeometryType from './GeometryType.js';\n/**\n * @classdesc\n * An array of {@link module:ol/geom/Geometry} objects.\n *\n * @api\n */\nvar GeometryCollection = /** @class */ (function (_super) {\n __extends(GeometryCollection, _super);\n /**\n * @param {Array<Geometry>=} opt_geometries Geometries.\n */\n function GeometryCollection(opt_geometries) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {Array<Geometry>}\n */\n _this.geometries_ = opt_geometries ? opt_geometries : null;\n /**\n * @type {Array<import(\"../events.js\").EventsKey>}\n */\n _this.changeEventsKeys_ = [];\n _this.listenGeometriesChange_();\n return _this;\n }\n /**\n * @private\n */\n GeometryCollection.prototype.unlistenGeometriesChange_ = function () {\n this.changeEventsKeys_.forEach(unlistenByKey);\n this.changeEventsKeys_.length = 0;\n };\n /**\n * @private\n */\n GeometryCollection.prototype.listenGeometriesChange_ = function () {\n if (!this.geometries_) {\n return;\n }\n for (var i = 0, ii = this.geometries_.length; i < ii; ++i) {\n this.changeEventsKeys_.push(listen(this.geometries_[i], EventType.CHANGE, this.changed, this));\n }\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!GeometryCollection} Clone.\n * @override\n * @api\n */\n GeometryCollection.prototype.clone = function () {\n var geometryCollection = new GeometryCollection(null);\n geometryCollection.setGeometries(this.geometries_);\n return geometryCollection;\n };\n /**\n * @inheritDoc\n */\n GeometryCollection.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n minSquaredDistance = geometries[i].closestPointXY(x, y, closestPoint, minSquaredDistance);\n }\n return minSquaredDistance;\n };\n /**\n * @inheritDoc\n */\n GeometryCollection.prototype.containsXY = function (x, y) {\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].containsXY(x, y)) {\n return true;\n }\n }\n return false;\n };\n /**\n * @inheritDoc\n */\n GeometryCollection.prototype.computeExtent = function (extent) {\n createOrUpdateEmpty(extent);\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n extend(extent, geometries[i].getExtent());\n }\n return extent;\n };\n /**\n * Return the geometries that make up this geometry collection.\n * @return {Array<Geometry>} Geometries.\n * @api\n */\n GeometryCollection.prototype.getGeometries = function () {\n return cloneGeometries(this.geometries_);\n };\n /**\n * @return {Array<Geometry>} Geometries.\n */\n GeometryCollection.prototype.getGeometriesArray = function () {\n return this.geometries_;\n };\n /**\n * @inheritDoc\n */\n GeometryCollection.prototype.getSimplifiedGeometry = function (squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n if (squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance < this.simplifiedGeometryMaxMinSquaredTolerance)) {\n return this;\n }\n var simplifiedGeometries = [];\n var geometries = this.geometries_;\n var simplified = false;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n var geometry = geometries[i];\n var simplifiedGeometry = geometry.getSimplifiedGeometry(squaredTolerance);\n simplifiedGeometries.push(simplifiedGeometry);\n if (simplifiedGeometry !== geometry) {\n simplified = true;\n }\n }\n if (simplified) {\n var simplifiedGeometryCollection = new GeometryCollection(null);\n simplifiedGeometryCollection.setGeometriesArray(simplifiedGeometries);\n return simplifiedGeometryCollection;\n }\n else {\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n };\n /**\n * @inheritDoc\n * @api\n */\n GeometryCollection.prototype.getType = function () {\n return GeometryType.GEOMETRY_COLLECTION;\n };\n /**\n * @inheritDoc\n * @api\n */\n GeometryCollection.prototype.intersectsExtent = function (extent) {\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].intersectsExtent(extent)) {\n return true;\n }\n }\n return false;\n };\n /**\n * @return {boolean} Is empty.\n */\n GeometryCollection.prototype.isEmpty = function () {\n return this.geometries_.length === 0;\n };\n /**\n * @inheritDoc\n * @api\n */\n GeometryCollection.prototype.rotate = function (angle, anchor) {\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].rotate(angle, anchor);\n }\n this.changed();\n };\n /**\n * @inheritDoc\n * @api\n */\n GeometryCollection.prototype.scale = function (sx, opt_sy, opt_anchor) {\n var anchor = opt_anchor;\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].scale(sx, opt_sy, anchor);\n }\n this.changed();\n };\n /**\n * Set the geometries that make up this geometry collection.\n * @param {Array<Geometry>} geometries Geometries.\n * @api\n */\n GeometryCollection.prototype.setGeometries = function (geometries) {\n this.setGeometriesArray(cloneGeometries(geometries));\n };\n /**\n * @param {Array<Geometry>} geometries Geometries.\n */\n GeometryCollection.prototype.setGeometriesArray = function (geometries) {\n this.unlistenGeometriesChange_();\n this.geometries_ = geometries;\n this.listenGeometriesChange_();\n this.changed();\n };\n /**\n * @inheritDoc\n * @api\n */\n GeometryCollection.prototype.applyTransform = function (transformFn) {\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].applyTransform(transformFn);\n }\n this.changed();\n };\n /**\n * @inheritDoc\n * @api\n */\n GeometryCollection.prototype.translate = function (deltaX, deltaY) {\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].translate(deltaX, deltaY);\n }\n this.changed();\n };\n /**\n * @inheritDoc\n */\n GeometryCollection.prototype.disposeInternal = function () {\n this.unlistenGeometriesChange_();\n _super.prototype.disposeInternal.call(this);\n };\n return GeometryCollection;\n}(Geometry));\n/**\n * @param {Array<Geometry>} geometries Geometries.\n * @return {Array<Geometry>} Cloned geometries.\n */\nfunction cloneGeometries(geometries) {\n var clonedGeometries = [];\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n clonedGeometries.push(geometries[i].clone());\n }\n return clonedGeometries;\n}\nexport default GeometryCollection;\n//# sourceMappingURL=GeometryCollection.js.map","/**\n * @module ol/format/Feature\n */\nimport { assign } from '../obj.js';\nimport { abstract } from '../util.js';\nimport { get as getProjection, equivalent as equivalentProjection, transformExtent } from '../proj.js';\nimport Units from '../proj/Units.js';\n/**\n * @typedef {Object} ReadOptions\n * @property {import(\"../proj.js\").ProjectionLike} [dataProjection] Projection of the data we are reading.\n * If not provided, the projection will be derived from the data (where possible) or\n * the `dataProjection` of the format is assigned (where set). If the projection\n * can not be derived from the data and if no `dataProjection` is set for a format,\n * the features will not be reprojected.\n * @property {import(\"../extent.js\").Extent} [extent] Tile extent in map units of the tile being read.\n * This is only required when reading data with tile pixels as geometry units. When configured,\n * a `dataProjection` with `TILE_PIXELS` as `units` and the tile's pixel extent as `extent` needs to be\n * provided.\n * @property {import(\"../proj.js\").ProjectionLike} [featureProjection] Projection of the feature geometries\n * created by the format reader. If not provided, features will be returned in the\n * `dataProjection`.\n */\n/**\n * @typedef {Object} WriteOptions\n * @property {import(\"../proj.js\").ProjectionLike} [dataProjection] Projection of the data we are writing.\n * If not provided, the `dataProjection` of the format is assigned (where set).\n * If no `dataProjection` is set for a format, the features will be returned\n * in the `featureProjection`.\n * @property {import(\"../proj.js\").ProjectionLike} [featureProjection] Projection of the feature geometries\n * that will be serialized by the format writer. If not provided, geometries are assumed\n * to be in the `dataProjection` if that is set; in other words, they are not transformed.\n * @property {boolean} [rightHanded] When writing geometries, follow the right-hand\n * rule for linear ring orientation. This means that polygons will have counter-clockwise\n * exterior rings and clockwise interior rings. By default, coordinates are serialized\n * as they are provided at construction. If `true`, the right-hand rule will\n * be applied. If `false`, the left-hand rule will be applied (clockwise for\n * exterior and counter-clockwise for interior rings). Note that not all\n * formats support this. The GeoJSON format does use this property when writing\n * geometries.\n * @property {number} [decimals] Maximum number of decimal places for coordinates.\n * Coordinates are stored internally as floats, but floating-point arithmetic can create\n * coordinates with a large number of decimal places, not generally wanted on output.\n * Set a number here to round coordinates. Can also be used to ensure that\n * coordinates read in can be written back out with the same number of decimals.\n * Default is no rounding.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for feature formats.\n * {@link module:ol/format/Feature~FeatureFormat} subclasses provide the ability to decode and encode\n * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial\n * file formats. See the documentation for each format for more details.\n *\n * @abstract\n * @api\n */\nvar FeatureFormat = /** @class */ (function () {\n function FeatureFormat() {\n /**\n * @protected\n * @type {import(\"../proj/Projection.js\").default}\n */\n this.dataProjection = null;\n /**\n * @protected\n * @type {import(\"../proj/Projection.js\").default}\n */\n this.defaultFeatureProjection = null;\n }\n /**\n * Adds the data projection to the read options.\n * @param {Document|Node|Object|string} source Source.\n * @param {ReadOptions=} opt_options Options.\n * @return {ReadOptions|undefined} Options.\n * @protected\n */\n FeatureFormat.prototype.getReadOptions = function (source, opt_options) {\n var options;\n if (opt_options) {\n var dataProjection = opt_options.dataProjection ?\n getProjection(opt_options.dataProjection) : this.readProjection(source);\n if (opt_options.extent &&\n dataProjection && dataProjection.getUnits() === Units.TILE_PIXELS) {\n dataProjection = getProjection(dataProjection);\n dataProjection.setWorldExtent(opt_options.extent);\n }\n options = {\n dataProjection: dataProjection,\n featureProjection: opt_options.featureProjection\n };\n }\n return this.adaptOptions(options);\n };\n /**\n * Sets the `dataProjection` on the options, if no `dataProjection`\n * is set.\n * @param {WriteOptions|ReadOptions|undefined} options\n * Options.\n * @protected\n * @return {WriteOptions|ReadOptions|undefined}\n * Updated options.\n */\n FeatureFormat.prototype.adaptOptions = function (options) {\n return assign({\n dataProjection: this.dataProjection,\n featureProjection: this.defaultFeatureProjection\n }, options);\n };\n /**\n * @abstract\n * @return {import(\"./FormatType.js\").default} Format.\n */\n FeatureFormat.prototype.getType = function () {\n return abstract();\n };\n /**\n * Read a single feature from a source.\n *\n * @abstract\n * @param {Document|Node|Object|string} source Source.\n * @param {ReadOptions=} opt_options Read options.\n * @return {import(\"../Feature.js\").FeatureLike} Feature.\n */\n FeatureFormat.prototype.readFeature = function (source, opt_options) {\n return abstract();\n };\n /**\n * Read all features from a source.\n *\n * @abstract\n * @param {Document|Node|ArrayBuffer|Object|string} source Source.\n * @param {ReadOptions=} opt_options Read options.\n * @return {Array<import(\"../Feature.js\").FeatureLike>} Features.\n */\n FeatureFormat.prototype.readFeatures = function (source, opt_options) {\n return abstract();\n };\n /**\n * Read a single geometry from a source.\n *\n * @abstract\n * @param {Document|Node|Object|string} source Source.\n * @param {ReadOptions=} opt_options Read options.\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\n FeatureFormat.prototype.readGeometry = function (source, opt_options) {\n return abstract();\n };\n /**\n * Read the projection from a source.\n *\n * @abstract\n * @param {Document|Node|Object|string} source Source.\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n FeatureFormat.prototype.readProjection = function (source) {\n return abstract();\n };\n /**\n * Encode a feature in this format.\n *\n * @abstract\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {WriteOptions=} opt_options Write options.\n * @return {string} Result.\n */\n FeatureFormat.prototype.writeFeature = function (feature, opt_options) {\n return abstract();\n };\n /**\n * Encode an array of features in this format.\n *\n * @abstract\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {WriteOptions=} opt_options Write options.\n * @return {string} Result.\n */\n FeatureFormat.prototype.writeFeatures = function (features, opt_options) {\n return abstract();\n };\n /**\n * Write a single geometry in this format.\n *\n * @abstract\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {WriteOptions=} opt_options Write options.\n * @return {string} Result.\n */\n FeatureFormat.prototype.writeGeometry = function (geometry, opt_options) {\n return abstract();\n };\n return FeatureFormat;\n}());\nexport default FeatureFormat;\n/**\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {boolean} write Set to true for writing, false for reading.\n * @param {(WriteOptions|ReadOptions)=} opt_options Options.\n * @return {import(\"../geom/Geometry.js\").default} Transformed geometry.\n */\nexport function transformGeometryWithOptions(geometry, write, opt_options) {\n var featureProjection = opt_options ? getProjection(opt_options.featureProjection) : null;\n var dataProjection = opt_options ? getProjection(opt_options.dataProjection) : null;\n var transformed;\n if (featureProjection && dataProjection && !equivalentProjection(featureProjection, dataProjection)) {\n transformed = (write ? geometry.clone() : geometry).transform(write ? featureProjection : dataProjection, write ? dataProjection : featureProjection);\n }\n else {\n transformed = geometry;\n }\n if (write && opt_options && /** @type {WriteOptions} */ (opt_options).decimals !== undefined) {\n var power_1 = Math.pow(10, /** @type {WriteOptions} */ (opt_options).decimals);\n // if decimals option on write, round each coordinate appropriately\n /**\n * @param {Array<number>} coordinates Coordinates.\n * @return {Array<number>} Transformed coordinates.\n */\n var transform = function (coordinates) {\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n coordinates[i] = Math.round(coordinates[i] * power_1) / power_1;\n }\n return coordinates;\n };\n if (transformed === geometry) {\n transformed = geometry.clone();\n }\n transformed.applyTransform(transform);\n }\n return transformed;\n}\n/**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {ReadOptions=} opt_options Read options.\n * @return {import(\"../extent.js\").Extent} Transformed extent.\n */\nexport function transformExtentWithOptions(extent, opt_options) {\n var featureProjection = opt_options ? getProjection(opt_options.featureProjection) : null;\n var dataProjection = opt_options ? getProjection(opt_options.dataProjection) : null;\n if (featureProjection && dataProjection && !equivalentProjection(featureProjection, dataProjection)) {\n return transformExtent(extent, dataProjection, featureProjection);\n }\n else {\n return extent;\n }\n}\n//# sourceMappingURL=Feature.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/JSONFeature\n */\nimport { abstract } from '../util.js';\nimport FeatureFormat from './Feature.js';\nimport FormatType from './FormatType.js';\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for JSON feature formats.\n *\n * @abstract\n */\nvar JSONFeature = /** @class */ (function (_super) {\n __extends(JSONFeature, _super);\n function JSONFeature() {\n return _super.call(this) || this;\n }\n /**\n * @inheritDoc\n */\n JSONFeature.prototype.getType = function () {\n return FormatType.JSON;\n };\n /**\n * Read a feature. Only works for a single feature. Use `readFeatures` to\n * read a feature collection.\n *\n * @param {ArrayBuffer|Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../Feature.js\").default} Feature.\n * @api\n */\n JSONFeature.prototype.readFeature = function (source, opt_options) {\n return this.readFeatureFromObject(getObject(source), this.getReadOptions(source, opt_options));\n };\n /**\n * Read all features. Works with both a single feature and a feature\n * collection.\n *\n * @param {ArrayBuffer|Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {Array<import(\"../Feature.js\").default>} Features.\n * @api\n */\n JSONFeature.prototype.readFeatures = function (source, opt_options) {\n return this.readFeaturesFromObject(getObject(source), this.getReadOptions(source, opt_options));\n };\n /**\n * @abstract\n * @param {Object} object Object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @protected\n * @return {import(\"../Feature.js\").default} Feature.\n */\n JSONFeature.prototype.readFeatureFromObject = function (object, opt_options) {\n return abstract();\n };\n /**\n * @abstract\n * @param {Object} object Object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @protected\n * @return {Array<import(\"../Feature.js\").default>} Features.\n */\n JSONFeature.prototype.readFeaturesFromObject = function (object, opt_options) {\n return abstract();\n };\n /**\n * Read a geometry.\n *\n * @param {ArrayBuffer|Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n * @api\n */\n JSONFeature.prototype.readGeometry = function (source, opt_options) {\n return this.readGeometryFromObject(getObject(source), this.getReadOptions(source, opt_options));\n };\n /**\n * @abstract\n * @param {Object} object Object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @protected\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\n JSONFeature.prototype.readGeometryFromObject = function (object, opt_options) {\n return abstract();\n };\n /**\n * Read the projection.\n *\n * @param {ArrayBuffer|Document|Node|Object|string} source Source.\n * @return {import(\"../proj/Projection.js\").default} Projection.\n * @api\n */\n JSONFeature.prototype.readProjection = function (source) {\n return this.readProjectionFromObject(getObject(source));\n };\n /**\n * @abstract\n * @param {Object} object Object.\n * @protected\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n JSONFeature.prototype.readProjectionFromObject = function (object) {\n return abstract();\n };\n /**\n * Encode a feature as string.\n *\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Encoded feature.\n * @api\n */\n JSONFeature.prototype.writeFeature = function (feature, opt_options) {\n return JSON.stringify(this.writeFeatureObject(feature, opt_options));\n };\n /**\n * @abstract\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {Object} Object.\n */\n JSONFeature.prototype.writeFeatureObject = function (feature, opt_options) {\n return abstract();\n };\n /**\n * Encode an array of features as string.\n *\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Encoded features.\n * @api\n */\n JSONFeature.prototype.writeFeatures = function (features, opt_options) {\n return JSON.stringify(this.writeFeaturesObject(features, opt_options));\n };\n /**\n * @abstract\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {Object} Object.\n */\n JSONFeature.prototype.writeFeaturesObject = function (features, opt_options) {\n return abstract();\n };\n /**\n * Encode a geometry as string.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Encoded geometry.\n * @api\n */\n JSONFeature.prototype.writeGeometry = function (geometry, opt_options) {\n return JSON.stringify(this.writeGeometryObject(geometry, opt_options));\n };\n /**\n * @abstract\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {Object} Object.\n */\n JSONFeature.prototype.writeGeometryObject = function (geometry, opt_options) {\n return abstract();\n };\n return JSONFeature;\n}(FeatureFormat));\n/**\n * @param {Document|Node|Object|string} source Source.\n * @return {Object} Object.\n */\nfunction getObject(source) {\n if (typeof source === 'string') {\n var object = JSON.parse(source);\n return object ? /** @type {Object} */ (object) : null;\n }\n else if (source !== null) {\n return source;\n }\n else {\n return null;\n }\n}\nexport default JSONFeature;\n//# sourceMappingURL=JSONFeature.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/EsriJSON\n */\nimport Feature from '../Feature.js';\nimport { assert } from '../asserts.js';\nimport { containsExtent } from '../extent.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport JSONFeature from './JSONFeature.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport LineString from '../geom/LineString.js';\nimport LinearRing from '../geom/LinearRing.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { deflateCoordinates } from '../geom/flat/deflate.js';\nimport { linearRingIsClockwise } from '../geom/flat/orient.js';\nimport { isEmpty } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\n/**\n * @typedef {import(\"arcgis-rest-api\").Feature} EsriJSONFeature\n * @typedef {import(\"arcgis-rest-api\").FeatureSet} EsriJSONFeatureSet\n * @typedef {import(\"arcgis-rest-api\").Geometry} EsriJSONGeometry\n * @typedef {import(\"arcgis-rest-api\").Point} EsriJSONPoint\n * @typedef {import(\"arcgis-rest-api\").Polyline} EsriJSONPolyline\n * @typedef {import(\"arcgis-rest-api\").Polygon} EsriJSONPolygon\n * @typedef {import(\"arcgis-rest-api\").Multipoint} EsriJSONMultipoint\n * @typedef {import(\"arcgis-rest-api\").HasZM} EsriJSONHasZM\n * @typedef {import(\"arcgis-rest-api\").Position} EsriJSONPosition\n * @typedef {import(\"arcgis-rest-api\").SpatialReferenceWkid} EsriJSONSpatialReferenceWkid\n */\n/**\n * @typedef {Object} EsriJSONMultiPolygon\n * @property {Array<Array<Array<Array<number>>>>} rings Rings for the MultiPolygon.\n * @property {boolean} [hasM] If the polygon coordinates have an M value.\n * @property {boolean} [hasZ] If the polygon coordinates have a Z value.\n * @property {EsriJSONSpatialReferenceWkid} [spatialReference] The coordinate reference system.\n */\n/**\n * @const\n * @type {Object<import(\"../geom/GeometryType.js\").default, function(EsriJSONGeometry): import(\"../geom/Geometry.js\").default>}\n */\nvar GEOMETRY_READERS = {};\nGEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;\nGEOMETRY_READERS[GeometryType.LINE_STRING] = readLineStringGeometry;\nGEOMETRY_READERS[GeometryType.POLYGON] = readPolygonGeometry;\nGEOMETRY_READERS[GeometryType.MULTI_POINT] = readMultiPointGeometry;\nGEOMETRY_READERS[GeometryType.MULTI_LINE_STRING] = readMultiLineStringGeometry;\nGEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;\n/**\n * @const\n * @type {Object<string, function(import(\"../geom/Geometry.js\").default, import(\"./Feature.js\").WriteOptions=): (EsriJSONGeometry)>}\n */\nvar GEOMETRY_WRITERS = {};\nGEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;\nGEOMETRY_WRITERS[GeometryType.LINE_STRING] = writeLineStringGeometry;\nGEOMETRY_WRITERS[GeometryType.POLYGON] = writePolygonGeometry;\nGEOMETRY_WRITERS[GeometryType.MULTI_POINT] = writeMultiPointGeometry;\nGEOMETRY_WRITERS[GeometryType.MULTI_LINE_STRING] = writeMultiLineStringGeometry;\nGEOMETRY_WRITERS[GeometryType.MULTI_POLYGON] = writeMultiPolygonGeometry;\n/**\n * @typedef {Object} Options\n * @property {string} [geometryName] Geometry name to use when creating features.\n */\n/**\n * @classdesc\n * Feature format for reading and writing data in the EsriJSON format.\n *\n * @api\n */\nvar EsriJSON = /** @class */ (function (_super) {\n __extends(EsriJSON, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function EsriJSON(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this) || this;\n /**\n * Name of the geometry attribute for features.\n * @type {string|undefined}\n * @private\n */\n _this.geometryName_ = options.geometryName;\n return _this;\n }\n /**\n * @inheritDoc\n */\n EsriJSON.prototype.readFeatureFromObject = function (object, opt_options) {\n var esriJSONFeature = /** @type {EsriJSONFeature} */ (object);\n var geometry = readGeometry(esriJSONFeature.geometry, opt_options);\n var feature = new Feature();\n if (this.geometryName_) {\n feature.setGeometryName(this.geometryName_);\n }\n feature.setGeometry(geometry);\n if (opt_options && opt_options.idField &&\n esriJSONFeature.attributes[opt_options.idField]) {\n feature.setId(/** @type {number} */ (esriJSONFeature.attributes[opt_options.idField]));\n }\n if (esriJSONFeature.attributes) {\n feature.setProperties(esriJSONFeature.attributes, true);\n }\n return feature;\n };\n /**\n * @inheritDoc\n */\n EsriJSON.prototype.readFeaturesFromObject = function (object, opt_options) {\n var options = opt_options ? opt_options : {};\n if (object['features']) {\n var esriJSONFeatureSet = /** @type {EsriJSONFeatureSet} */ (object);\n /** @type {Array<import(\"../Feature.js\").default>} */\n var features = [];\n var esriJSONFeatures = esriJSONFeatureSet.features;\n options.idField = object.objectIdFieldName;\n for (var i = 0, ii = esriJSONFeatures.length; i < ii; ++i) {\n features.push(this.readFeatureFromObject(esriJSONFeatures[i], options));\n }\n return features;\n }\n else {\n return [this.readFeatureFromObject(object, options)];\n }\n };\n /**\n * @inheritDoc\n */\n EsriJSON.prototype.readGeometryFromObject = function (object, opt_options) {\n return readGeometry(/** @type {EsriJSONGeometry} */ (object), opt_options);\n };\n /**\n * @inheritDoc\n */\n EsriJSON.prototype.readProjectionFromObject = function (object) {\n if (object['spatialReference'] && object['spatialReference']['wkid'] !== undefined) {\n var spatialReference = /** @type {EsriJSONSpatialReferenceWkid} */ (object['spatialReference']);\n var crs = spatialReference.wkid;\n return getProjection('EPSG:' + crs);\n }\n else {\n return null;\n }\n };\n /**\n * Encode a geometry as a EsriJSON object.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONGeometry} Object.\n * @override\n * @api\n */\n EsriJSON.prototype.writeGeometryObject = function (geometry, opt_options) {\n return writeGeometry(geometry, this.adaptOptions(opt_options));\n };\n /**\n * Encode a feature as a esriJSON Feature object.\n *\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {Object} Object.\n * @override\n * @api\n */\n EsriJSON.prototype.writeFeatureObject = function (feature, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n var object = {};\n var geometry = feature.getGeometry();\n if (geometry) {\n object['geometry'] = writeGeometry(geometry, opt_options);\n if (opt_options && opt_options.featureProjection) {\n object['geometry']['spatialReference'] = /** @type {EsriJSONSpatialReferenceWkid} */ ({\n wkid: Number(getProjection(opt_options.featureProjection).getCode().split(':').pop())\n });\n }\n }\n var properties = feature.getProperties();\n delete properties[feature.getGeometryName()];\n if (!isEmpty(properties)) {\n object['attributes'] = properties;\n }\n else {\n object['attributes'] = {};\n }\n return object;\n };\n /**\n * Encode an array of features as a EsriJSON object.\n *\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONFeatureSet} EsriJSON Object.\n * @override\n * @api\n */\n EsriJSON.prototype.writeFeaturesObject = function (features, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n var objects = [];\n for (var i = 0, ii = features.length; i < ii; ++i) {\n objects.push(this.writeFeatureObject(features[i], opt_options));\n }\n return {\n 'features': objects\n };\n };\n return EsriJSON;\n}(JSONFeature));\n/**\n * @param {EsriJSONGeometry} object Object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\nfunction readGeometry(object, opt_options) {\n var _a, _b;\n if (!object) {\n return null;\n }\n /** @type {import(\"../geom/GeometryType.js\").default} */\n var type;\n if (typeof object['x'] === 'number' && typeof object['y'] === 'number') {\n type = GeometryType.POINT;\n }\n else if (object['points']) {\n type = GeometryType.MULTI_POINT;\n }\n else if (object['paths']) {\n var esriJSONPolyline = /** @type {EsriJSONPolyline} */ (object);\n if (esriJSONPolyline.paths.length === 1) {\n type = GeometryType.LINE_STRING;\n }\n else {\n type = GeometryType.MULTI_LINE_STRING;\n }\n }\n else if (object['rings']) {\n var esriJSONPolygon = /** @type {EsriJSONPolygon} */ (object);\n var layout = getGeometryLayout(esriJSONPolygon);\n var rings = convertRings(esriJSONPolygon.rings, layout);\n if (rings.length === 1) {\n type = GeometryType.POLYGON;\n object = Object.assign({}, object, (_a = {}, _a['rings'] = rings[0], _a));\n }\n else {\n type = GeometryType.MULTI_POLYGON;\n object = Object.assign({}, object, (_b = {}, _b['rings'] = rings, _b));\n }\n }\n var geometryReader = GEOMETRY_READERS[type];\n return transformGeometryWithOptions(geometryReader(object), false, opt_options);\n}\n/**\n * Determines inner and outer rings.\n * Checks if any polygons in this array contain any other polygons in this\n * array. It is used for checking for holes.\n * Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser\n * @param {Array<!Array<!Array<number>>>} rings Rings.\n * @param {import(\"../geom/GeometryLayout.js\").default} layout Geometry layout.\n * @return {Array<!Array<!Array<!Array<number>>>>} Transformed rings.\n */\nfunction convertRings(rings, layout) {\n var flatRing = [];\n var outerRings = [];\n var holes = [];\n var i, ii;\n for (i = 0, ii = rings.length; i < ii; ++i) {\n flatRing.length = 0;\n deflateCoordinates(flatRing, 0, rings[i], layout.length);\n // is this ring an outer ring? is it clockwise?\n var clockwise = linearRingIsClockwise(flatRing, 0, flatRing.length, layout.length);\n if (clockwise) {\n outerRings.push([rings[i]]);\n }\n else {\n holes.push(rings[i]);\n }\n }\n while (holes.length) {\n var hole = holes.shift();\n var matched = false;\n // loop over all outer rings and see if they contain our hole.\n for (i = outerRings.length - 1; i >= 0; i--) {\n var outerRing = outerRings[i][0];\n var containsHole = containsExtent(new LinearRing(outerRing).getExtent(), new LinearRing(hole).getExtent());\n if (containsHole) {\n // the hole is contained push it into our polygon\n outerRings[i].push(hole);\n matched = true;\n break;\n }\n }\n if (!matched) {\n // no outer rings contain this hole turn it into and outer\n // ring (reverse it)\n outerRings.push([hole.reverse()]);\n }\n }\n return outerRings;\n}\n/**\n * @param {EsriJSONPoint} object Object.\n * @return {import(\"../geom/Geometry.js\").default} Point.\n */\nfunction readPointGeometry(object) {\n var point;\n if (object.m !== undefined && object.z !== undefined) {\n point = new Point([object.x, object.y, object.z, object.m], GeometryLayout.XYZM);\n }\n else if (object.z !== undefined) {\n point = new Point([object.x, object.y, object.z], GeometryLayout.XYZ);\n }\n else if (object.m !== undefined) {\n point = new Point([object.x, object.y, object.m], GeometryLayout.XYM);\n }\n else {\n point = new Point([object.x, object.y]);\n }\n return point;\n}\n/**\n * @param {EsriJSONPolyline} object Object.\n * @return {import(\"../geom/Geometry.js\").default} LineString.\n */\nfunction readLineStringGeometry(object) {\n var layout = getGeometryLayout(object);\n return new LineString(object.paths[0], layout);\n}\n/**\n * @param {EsriJSONPolyline} object Object.\n * @return {import(\"../geom/Geometry.js\").default} MultiLineString.\n */\nfunction readMultiLineStringGeometry(object) {\n var layout = getGeometryLayout(object);\n return new MultiLineString(object.paths, layout);\n}\n/**\n * @param {EsriJSONHasZM} object Object.\n * @return {import(\"../geom/GeometryLayout.js\").default} The geometry layout to use.\n */\nfunction getGeometryLayout(object) {\n var layout = GeometryLayout.XY;\n if (object.hasZ === true && object.hasM === true) {\n layout = GeometryLayout.XYZM;\n }\n else if (object.hasZ === true) {\n layout = GeometryLayout.XYZ;\n }\n else if (object.hasM === true) {\n layout = GeometryLayout.XYM;\n }\n return layout;\n}\n/**\n * @param {EsriJSONMultipoint} object Object.\n * @return {import(\"../geom/Geometry.js\").default} MultiPoint.\n */\nfunction readMultiPointGeometry(object) {\n var layout = getGeometryLayout(object);\n return new MultiPoint(object.points, layout);\n}\n/**\n * @param {EsriJSONMultiPolygon} object Object.\n * @return {import(\"../geom/Geometry.js\").default} MultiPolygon.\n */\nfunction readMultiPolygonGeometry(object) {\n var layout = getGeometryLayout(object);\n return new MultiPolygon(object.rings, layout);\n}\n/**\n * @param {EsriJSONPolygon} object Object.\n * @return {import(\"../geom/Geometry.js\").default} Polygon.\n */\nfunction readPolygonGeometry(object) {\n var layout = getGeometryLayout(object);\n return new Polygon(object.rings, layout);\n}\n/**\n * @param {import(\"../geom/Point.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONPoint} EsriJSON geometry.\n */\nfunction writePointGeometry(geometry, opt_options) {\n var coordinates = geometry.getCoordinates();\n /** @type {EsriJSONPoint} */\n var esriJSON;\n var layout = geometry.getLayout();\n if (layout === GeometryLayout.XYZ) {\n esriJSON = {\n x: coordinates[0],\n y: coordinates[1],\n z: coordinates[2]\n };\n }\n else if (layout === GeometryLayout.XYM) {\n esriJSON = {\n x: coordinates[0],\n y: coordinates[1],\n m: coordinates[2]\n };\n }\n else if (layout === GeometryLayout.XYZM) {\n esriJSON = {\n x: coordinates[0],\n y: coordinates[1],\n z: coordinates[2],\n m: coordinates[3]\n };\n }\n else if (layout === GeometryLayout.XY) {\n esriJSON = {\n x: coordinates[0],\n y: coordinates[1]\n };\n }\n else {\n assert(false, 34); // Invalid geometry layout\n }\n return esriJSON;\n}\n/**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @return {Object} Object with boolean hasZ and hasM keys.\n */\nfunction getHasZM(geometry) {\n var layout = geometry.getLayout();\n return {\n hasZ: (layout === GeometryLayout.XYZ ||\n layout === GeometryLayout.XYZM),\n hasM: (layout === GeometryLayout.XYM ||\n layout === GeometryLayout.XYZM)\n };\n}\n/**\n * @param {import(\"../geom/LineString.js\").default} lineString Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONPolyline} EsriJSON geometry.\n */\nfunction writeLineStringGeometry(lineString, opt_options) {\n var hasZM = getHasZM(lineString);\n return {\n hasZ: hasZM.hasZ,\n hasM: hasZM.hasM,\n paths: [\n /** @type {Array<EsriJSONPosition>} */ (lineString.getCoordinates())\n ]\n };\n}\n/**\n * @param {import(\"../geom/Polygon.js\").default} polygon Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONPolygon} EsriJSON geometry.\n */\nfunction writePolygonGeometry(polygon, opt_options) {\n // Esri geometries use the left-hand rule\n var hasZM = getHasZM(polygon);\n return {\n hasZ: hasZM.hasZ,\n hasM: hasZM.hasM,\n rings: /** @type {Array<Array<EsriJSONPosition>>} */ (polygon.getCoordinates(false))\n };\n}\n/**\n * @param {import(\"../geom/MultiLineString.js\").default} multiLineString Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONPolyline} EsriJSON geometry.\n */\nfunction writeMultiLineStringGeometry(multiLineString, opt_options) {\n var hasZM = getHasZM(multiLineString);\n return {\n hasZ: hasZM.hasZ,\n hasM: hasZM.hasM,\n paths: /** @type {Array<Array<EsriJSONPosition>>} */ (multiLineString.getCoordinates())\n };\n}\n/**\n * @param {import(\"../geom/MultiPoint.js\").default} multiPoint Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONMultipoint} EsriJSON geometry.\n */\nfunction writeMultiPointGeometry(multiPoint, opt_options) {\n var hasZM = getHasZM(multiPoint);\n return {\n hasZ: hasZM.hasZ,\n hasM: hasZM.hasM,\n points: /** @type {Array<EsriJSONPosition>} */ (multiPoint.getCoordinates())\n };\n}\n/**\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONPolygon} EsriJSON geometry.\n */\nfunction writeMultiPolygonGeometry(geometry, opt_options) {\n var hasZM = getHasZM(geometry);\n var coordinates = geometry.getCoordinates(false);\n var output = [];\n for (var i = 0; i < coordinates.length; i++) {\n for (var x = coordinates[i].length - 1; x >= 0; x--) {\n output.push(coordinates[i][x]);\n }\n }\n return {\n hasZ: hasZM.hasZ,\n hasM: hasZM.hasM,\n rings: /** @type {Array<Array<EsriJSONPosition>>} */ (output)\n };\n}\n/**\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {EsriJSONGeometry} EsriJSON geometry.\n */\nfunction writeGeometry(geometry, opt_options) {\n var geometryWriter = GEOMETRY_WRITERS[geometry.getType()];\n return geometryWriter(transformGeometryWithOptions(geometry, true, opt_options), opt_options);\n}\nexport default EsriJSON;\n//# sourceMappingURL=EsriJSON.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/XMLFeature\n */\nimport { abstract } from '../util.js';\nimport { extend } from '../array.js';\nimport FeatureFormat from '../format/Feature.js';\nimport FormatType from '../format/FormatType.js';\nimport { isDocument, parse } from '../xml.js';\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for XML feature formats.\n *\n * @abstract\n */\nvar XMLFeature = /** @class */ (function (_super) {\n __extends(XMLFeature, _super);\n function XMLFeature() {\n var _this = _super.call(this) || this;\n /**\n * @type {XMLSerializer}\n * @private\n */\n _this.xmlSerializer_ = new XMLSerializer();\n return _this;\n }\n /**\n * @inheritDoc\n */\n XMLFeature.prototype.getType = function () {\n return FormatType.XML;\n };\n /**\n * Read a single feature.\n *\n * @param {Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../Feature.js\").default} Feature.\n * @api\n */\n XMLFeature.prototype.readFeature = function (source, opt_options) {\n if (!source) {\n return null;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readFeatureFromDocument(doc, opt_options);\n }\n else if (isDocument(source)) {\n return this.readFeatureFromDocument(/** @type {Document} */ (source), opt_options);\n }\n else {\n return this.readFeatureFromNode(/** @type {Node} */ (source), opt_options);\n }\n };\n /**\n * @param {Document} doc Document.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @return {import(\"../Feature.js\").default} Feature.\n */\n XMLFeature.prototype.readFeatureFromDocument = function (doc, opt_options) {\n var features = this.readFeaturesFromDocument(doc, opt_options);\n if (features.length > 0) {\n return features[0];\n }\n else {\n return null;\n }\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @return {import(\"../Feature.js\").default} Feature.\n */\n XMLFeature.prototype.readFeatureFromNode = function (node, opt_options) {\n return null; // not implemented\n };\n /**\n * Read all features from a feature collection.\n *\n * @param {Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @return {Array<import(\"../Feature.js\").default>} Features.\n * @api\n */\n XMLFeature.prototype.readFeatures = function (source, opt_options) {\n if (!source) {\n return [];\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readFeaturesFromDocument(doc, opt_options);\n }\n else if (isDocument(source)) {\n return this.readFeaturesFromDocument(\n /** @type {Document} */ (source), opt_options);\n }\n else {\n return this.readFeaturesFromNode(/** @type {Node} */ (source), opt_options);\n }\n };\n /**\n * @param {Document} doc Document.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @protected\n * @return {Array<import(\"../Feature.js\").default>} Features.\n */\n XMLFeature.prototype.readFeaturesFromDocument = function (doc, opt_options) {\n /** @type {Array<import(\"../Feature.js\").default>} */\n var features = [];\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n extend(features, this.readFeaturesFromNode(n, opt_options));\n }\n }\n return features;\n };\n /**\n * @abstract\n * @param {Node} node Node.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @protected\n * @return {Array<import(\"../Feature.js\").default>} Features.\n */\n XMLFeature.prototype.readFeaturesFromNode = function (node, opt_options) {\n return abstract();\n };\n /**\n * @inheritDoc\n */\n XMLFeature.prototype.readGeometry = function (source, opt_options) {\n if (!source) {\n return null;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readGeometryFromDocument(doc, opt_options);\n }\n else if (isDocument(source)) {\n return this.readGeometryFromDocument(\n /** @type {Document} */ (source), opt_options);\n }\n else {\n return this.readGeometryFromNode(/** @type {Node} */ (source), opt_options);\n }\n };\n /**\n * @param {Document} doc Document.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @protected\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\n XMLFeature.prototype.readGeometryFromDocument = function (doc, opt_options) {\n return null; // not implemented\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Options.\n * @protected\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\n XMLFeature.prototype.readGeometryFromNode = function (node, opt_options) {\n return null; // not implemented\n };\n /**\n * Read the projection from the source.\n *\n * @param {Document|Node|Object|string} source Source.\n * @return {import(\"../proj/Projection.js\").default} Projection.\n * @api\n */\n XMLFeature.prototype.readProjection = function (source) {\n if (!source) {\n return null;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readProjectionFromDocument(doc);\n }\n else if (isDocument(source)) {\n return this.readProjectionFromDocument(/** @type {Document} */ (source));\n }\n else {\n return this.readProjectionFromNode(/** @type {Node} */ (source));\n }\n };\n /**\n * @param {Document} doc Document.\n * @protected\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n XMLFeature.prototype.readProjectionFromDocument = function (doc) {\n return this.dataProjection;\n };\n /**\n * @param {Node} node Node.\n * @protected\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n XMLFeature.prototype.readProjectionFromNode = function (node) {\n return this.dataProjection;\n };\n /**\n * @inheritDoc\n */\n XMLFeature.prototype.writeFeature = function (feature, opt_options) {\n var node = this.writeFeatureNode(feature, opt_options);\n return this.xmlSerializer_.serializeToString(node);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @protected\n * @return {Node} Node.\n */\n XMLFeature.prototype.writeFeatureNode = function (feature, opt_options) {\n return null; // not implemented\n };\n /**\n * Encode an array of features as string.\n *\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Result.\n * @api\n */\n XMLFeature.prototype.writeFeatures = function (features, opt_options) {\n var node = this.writeFeaturesNode(features, opt_options);\n return this.xmlSerializer_.serializeToString(node);\n };\n /**\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Node} Node.\n */\n XMLFeature.prototype.writeFeaturesNode = function (features, opt_options) {\n return null; // not implemented\n };\n /**\n * @inheritDoc\n */\n XMLFeature.prototype.writeGeometry = function (geometry, opt_options) {\n var node = this.writeGeometryNode(geometry, opt_options);\n return this.xmlSerializer_.serializeToString(node);\n };\n /**\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Node} Node.\n */\n XMLFeature.prototype.writeGeometryNode = function (geometry, opt_options) {\n return null; // not implemented\n };\n return XMLFeature;\n}(FeatureFormat));\nexport default XMLFeature;\n//# sourceMappingURL=XMLFeature.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/GMLBase\n */\n// FIXME Envelopes should not be treated as geometries! readEnvelope_ is part\n// of GEOMETRY_PARSERS_ and methods using GEOMETRY_PARSERS_ do not expect\n// envelopes/extents, only geometries!\nimport { extend } from '../array.js';\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions, transformExtentWithOptions } from './Feature.js';\nimport XMLFeature from './XMLFeature.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport LineString from '../geom/LineString.js';\nimport LinearRing from '../geom/LinearRing.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { assign } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\nimport { getAllTextContent, getAttributeNS, makeArrayPusher, makeReplacer, parseNode, pushParseAndPop } from '../xml.js';\n/**\n * @const\n * @type {string}\n */\nexport var GMLNS = 'http://www.opengis.net/gml';\n/**\n * A regular expression that matches if a string only contains whitespace\n * characters. It will e.g. match `''`, `' '`, `'\\n'` etc. The non-breaking\n * space (0xa0) is explicitly included as IE doesn't include it in its\n * definition of `\\s`.\n *\n * Information from `goog.string.isEmptyOrWhitespace`: https://github.com/google/closure-library/blob/e877b1e/closure/goog/string/string.js#L156-L160\n *\n * @const\n * @type {RegExp}\n */\nvar ONLY_WHITESPACE_RE = /^[\\s\\xa0]*$/;\n/**\n * @typedef {Object} Options\n * @property {Object<string, string>|string} [featureNS] Feature\n * namespace. If not defined will be derived from GML. If multiple\n * feature types have been configured which come from different feature\n * namespaces, this will be an object with the keys being the prefixes used\n * in the entries of featureType array. The values of the object will be the\n * feature namespaces themselves. So for instance there might be a featureType\n * item `topp:states` in the `featureType` array and then there will be a key\n * `topp` in the featureNS object with value `http://www.openplans.org/topp`.\n * @property {Array<string>|string} [featureType] Feature type(s) to parse.\n * If multiple feature types need to be configured\n * which come from different feature namespaces, `featureNS` will be an object\n * with the keys being the prefixes used in the entries of featureType array.\n * The values of the object will be the feature namespaces themselves.\n * So for instance there might be a featureType item `topp:states` and then\n * there will be a key named `topp` in the featureNS object with value\n * `http://www.openplans.org/topp`.\n * @property {string} srsName srsName to use when writing geometries.\n * @property {boolean} [surface=false] Write gml:Surface instead of gml:Polygon\n * elements. This also affects the elements in multi-part geometries.\n * @property {boolean} [curve=false] Write gml:Curve instead of gml:LineString\n * elements. This also affects the elements in multi-part geometries.\n * @property {boolean} [multiCurve=true] Write gml:MultiCurve instead of gml:MultiLineString.\n * Since the latter is deprecated in GML 3.\n * @property {boolean} [multiSurface=true] Write gml:multiSurface instead of\n * gml:MultiPolygon. Since the latter is deprecated in GML 3.\n * @property {string} [schemaLocation] Optional schemaLocation to use when\n * writing out the GML, this will override the default provided.\n * @property {boolean} [hasZ=false] If coordinates have a Z value.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Feature base format for reading and writing data in the GML format.\n * This class cannot be instantiated, it contains only base content that\n * is shared with versioned format classes GML2 and GML3.\n *\n * @abstract\n */\nvar GMLBase = /** @class */ (function (_super) {\n __extends(GMLBase, _super);\n /**\n * @param {Options=} opt_options Optional configuration object.\n */\n function GMLBase(opt_options) {\n var _this = _super.call(this) || this;\n var options = /** @type {Options} */ (opt_options ? opt_options : {});\n /**\n * @protected\n * @type {Array<string>|string|undefined}\n */\n _this.featureType = options.featureType;\n /**\n * @protected\n * @type {Object<string, string>|string|undefined}\n */\n _this.featureNS = options.featureNS;\n /**\n * @protected\n * @type {string}\n */\n _this.srsName = options.srsName;\n /**\n * @protected\n * @type {string}\n */\n _this.schemaLocation = '';\n /**\n * @type {Object<string, Object<string, Object>>}\n */\n _this.FEATURE_COLLECTION_PARSERS = {};\n _this.FEATURE_COLLECTION_PARSERS[_this.namespace] = {\n 'featureMember': makeArrayPusher(_this.readFeaturesInternal),\n 'featureMembers': makeReplacer(_this.readFeaturesInternal)\n };\n return _this;\n }\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<Feature> | undefined} Features.\n */\n GMLBase.prototype.readFeaturesInternal = function (node, objectStack) {\n var localName = node.localName;\n var features = null;\n if (localName == 'FeatureCollection') {\n features = pushParseAndPop([], this.FEATURE_COLLECTION_PARSERS, node, objectStack, this);\n }\n else if (localName == 'featureMembers' || localName == 'featureMember') {\n var context = objectStack[0];\n var featureType = context['featureType'];\n var featureNS = context['featureNS'];\n var prefix = 'p';\n var defaultPrefix = 'p0';\n if (!featureType && node.childNodes) {\n featureType = [], featureNS = {};\n for (var i = 0, ii = node.childNodes.length; i < ii; ++i) {\n var child = node.childNodes[i];\n if (child.nodeType === 1) {\n var ft = child.nodeName.split(':').pop();\n if (featureType.indexOf(ft) === -1) {\n var key = '';\n var count = 0;\n var uri = child.namespaceURI;\n for (var candidate in featureNS) {\n if (featureNS[candidate] === uri) {\n key = candidate;\n break;\n }\n ++count;\n }\n if (!key) {\n key = prefix + count;\n featureNS[key] = uri;\n }\n featureType.push(key + ':' + ft);\n }\n }\n }\n if (localName != 'featureMember') {\n // recheck featureType for each featureMember\n context['featureType'] = featureType;\n context['featureNS'] = featureNS;\n }\n }\n if (typeof featureNS === 'string') {\n var ns = featureNS;\n featureNS = {};\n featureNS[defaultPrefix] = ns;\n }\n /** @type {Object<string, Object<string, import(\"../xml.js\").Parser>>} */\n var parsersNS = {};\n var featureTypes = Array.isArray(featureType) ? featureType : [featureType];\n for (var p in featureNS) {\n /** @type {Object<string, import(\"../xml.js\").Parser>} */\n var parsers = {};\n for (var i = 0, ii = featureTypes.length; i < ii; ++i) {\n var featurePrefix = featureTypes[i].indexOf(':') === -1 ?\n defaultPrefix : featureTypes[i].split(':')[0];\n if (featurePrefix === p) {\n parsers[featureTypes[i].split(':').pop()] =\n (localName == 'featureMembers') ?\n makeArrayPusher(this.readFeatureElement, this) :\n makeReplacer(this.readFeatureElement, this);\n }\n }\n parsersNS[featureNS[p]] = parsers;\n }\n if (localName == 'featureMember') {\n features = pushParseAndPop(undefined, parsersNS, node, objectStack);\n }\n else {\n features = pushParseAndPop([], parsersNS, node, objectStack);\n }\n }\n if (features === null) {\n features = [];\n }\n return features;\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {import(\"../geom/Geometry.js\").default|import(\"../extent.js\").Extent|undefined} Geometry.\n */\n GMLBase.prototype.readGeometryElement = function (node, objectStack) {\n var context = /** @type {Object} */ (objectStack[0]);\n context['srsName'] = node.firstElementChild.getAttribute('srsName');\n context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');\n var geometry = pushParseAndPop(null, this.GEOMETRY_PARSERS, node, objectStack, this);\n if (geometry) {\n if (Array.isArray(geometry)) {\n return transformExtentWithOptions(/** @type {import(\"../extent.js\").Extent} */ (geometry), context);\n }\n else {\n return transformGeometryWithOptions(/** @type {import(\"../geom/Geometry.js\").default} */ (geometry), false, context);\n }\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @param {boolean} asFeature whether result should be wrapped as a feature.\n * @return {Feature|Object} Feature\n */\n GMLBase.prototype.readFeatureElementInternal = function (node, objectStack, asFeature) {\n var geometryName;\n var values = {};\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n var value = void 0;\n var localName = n.localName;\n // first, check if it is simple attribute\n if (n.childNodes.length === 0\n || (n.childNodes.length === 1 && (n.firstChild.nodeType === 3 || n.firstChild.nodeType === 4))) {\n value = getAllTextContent(n, false);\n if (ONLY_WHITESPACE_RE.test(value)) {\n value = undefined;\n }\n }\n else {\n if (asFeature) {\n //if feature, try it as a geometry\n value = this.readGeometryElement(n, objectStack);\n }\n if (!value) { //if not a geometry or not a feature, treat it as a complex attribute\n value = this.readFeatureElementInternal(n, objectStack, false);\n }\n else if (localName !== 'boundedBy') {\n // boundedBy is an extent and must not be considered as a geometry\n geometryName = localName;\n }\n }\n if (values[localName]) {\n if (!(values[localName] instanceof Array)) {\n values[localName] = [values[localName]];\n }\n values[localName].push(value);\n }\n else {\n values[localName] = value;\n }\n var len = n.attributes.length;\n if (len > 0) {\n values[localName] = { _content_: values[localName] };\n for (var i = 0; i < len; i++) {\n var attName = n.attributes[i].name;\n values[localName][attName] = n.attributes[i].value;\n }\n }\n }\n if (!asFeature) {\n return values;\n }\n else {\n var feature = new Feature(values);\n if (geometryName) {\n feature.setGeometryName(geometryName);\n }\n var fid = node.getAttribute('fid') ||\n getAttributeNS(node, this.namespace, 'id');\n if (fid) {\n feature.setId(fid);\n }\n return feature;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Feature} Feature.\n */\n GMLBase.prototype.readFeatureElement = function (node, objectStack) {\n return this.readFeatureElementInternal(node, objectStack, true);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Point|undefined} Point.\n */\n GMLBase.prototype.readPoint = function (node, objectStack) {\n var flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);\n if (flatCoordinates) {\n return new Point(flatCoordinates, GeometryLayout.XYZ);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {MultiPoint|undefined} MultiPoint.\n */\n GMLBase.prototype.readMultiPoint = function (node, objectStack) {\n /** @type {Array<Array<number>>} */\n var coordinates = pushParseAndPop([], this.MULTIPOINT_PARSERS_, node, objectStack, this);\n if (coordinates) {\n return new MultiPoint(coordinates);\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {MultiLineString|undefined} MultiLineString.\n */\n GMLBase.prototype.readMultiLineString = function (node, objectStack) {\n /** @type {Array<LineString>} */\n var lineStrings = pushParseAndPop([], this.MULTILINESTRING_PARSERS_, node, objectStack, this);\n if (lineStrings) {\n return new MultiLineString(lineStrings);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {MultiPolygon|undefined} MultiPolygon.\n */\n GMLBase.prototype.readMultiPolygon = function (node, objectStack) {\n /** @type {Array<Polygon>} */\n var polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);\n if (polygons) {\n return new MultiPolygon(polygons);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GMLBase.prototype.pointMemberParser_ = function (node, objectStack) {\n parseNode(this.POINTMEMBER_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GMLBase.prototype.lineStringMemberParser_ = function (node, objectStack) {\n parseNode(this.LINESTRINGMEMBER_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GMLBase.prototype.polygonMemberParser_ = function (node, objectStack) {\n parseNode(this.POLYGONMEMBER_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {LineString|undefined} LineString.\n */\n GMLBase.prototype.readLineString = function (node, objectStack) {\n var flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);\n if (flatCoordinates) {\n var lineString = new LineString(flatCoordinates, GeometryLayout.XYZ);\n return lineString;\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>|undefined} LinearRing flat coordinates.\n */\n GMLBase.prototype.readFlatLinearRing_ = function (node, objectStack) {\n var ring = pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS, node, objectStack, this);\n if (ring) {\n return ring;\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {LinearRing|undefined} LinearRing.\n */\n GMLBase.prototype.readLinearRing = function (node, objectStack) {\n var flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);\n if (flatCoordinates) {\n return new LinearRing(flatCoordinates, GeometryLayout.XYZ);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Polygon|undefined} Polygon.\n */\n GMLBase.prototype.readPolygon = function (node, objectStack) {\n /** @type {Array<Array<number>>} */\n var flatLinearRings = pushParseAndPop([null], this.FLAT_LINEAR_RINGS_PARSERS, node, objectStack, this);\n if (flatLinearRings && flatLinearRings[0]) {\n var flatCoordinates = flatLinearRings[0];\n var ends = [flatCoordinates.length];\n var i = void 0, ii = void 0;\n for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {\n extend(flatCoordinates, flatLinearRings[i]);\n ends.push(flatCoordinates.length);\n }\n return new Polygon(flatCoordinates, GeometryLayout.XYZ, ends);\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>} Flat coordinates.\n */\n GMLBase.prototype.readFlatCoordinatesFromNode_ = function (node, objectStack) {\n return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS, node, objectStack, this);\n };\n /**\n * @inheritDoc\n */\n //@ts-ignore\n GMLBase.prototype.readGeometryFromNode = function (node, opt_options) {\n var geometry = this.readGeometryElement(node, [this.getReadOptions(node, opt_options ? opt_options : {})]);\n return geometry ? geometry : null;\n };\n /**\n * @inheritDoc\n */\n GMLBase.prototype.readFeaturesFromNode = function (node, opt_options) {\n var options = {\n featureType: this.featureType,\n featureNS: this.featureNS\n };\n if (opt_options) {\n assign(options, this.getReadOptions(node, opt_options));\n }\n var features = this.readFeaturesInternal(node, [options]);\n return features || [];\n };\n /**\n * @inheritDoc\n */\n GMLBase.prototype.readProjectionFromNode = function (node) {\n return getProjection(this.srsName ? this.srsName : node.firstElementChild.getAttribute('srsName'));\n };\n return GMLBase;\n}(XMLFeature));\nGMLBase.prototype.namespace = GMLNS;\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGMLBase.prototype.FLAT_LINEAR_RINGS_PARSERS = {\n 'http://www.opengis.net/gml': {}\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGMLBase.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {\n 'http://www.opengis.net/gml': {}\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGMLBase.prototype.GEOMETRY_PARSERS = {\n 'http://www.opengis.net/gml': {}\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGMLBase.prototype.MULTIPOINT_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser_),\n 'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGMLBase.prototype.MULTILINESTRING_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'lineStringMember': makeArrayPusher(GMLBase.prototype.lineStringMemberParser_),\n 'lineStringMembers': makeArrayPusher(GMLBase.prototype.lineStringMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGMLBase.prototype.MULTIPOLYGON_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),\n 'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGMLBase.prototype.POINTMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'LineString': makeArrayPusher(GMLBase.prototype.readLineString)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGMLBase.prototype.POLYGONMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGMLBase.prototype.RING_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing_)\n }\n};\nexport default GMLBase;\n//# sourceMappingURL=GMLBase.js.map","/**\n * @module ol/format/xsd\n */\nimport { getAllTextContent, DOCUMENT } from '../xml.js';\nimport { padNumber } from '../string.js';\n/**\n * @param {Node} node Node.\n * @return {boolean|undefined} Boolean.\n */\nexport function readBoolean(node) {\n var s = getAllTextContent(node, false);\n return readBooleanString(s);\n}\n/**\n * @param {string} string String.\n * @return {boolean|undefined} Boolean.\n */\nexport function readBooleanString(string) {\n var m = /^\\s*(true|1)|(false|0)\\s*$/.exec(string);\n if (m) {\n return m[1] !== undefined || false;\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {Node} node Node.\n * @return {number|undefined} DateTime in seconds.\n */\nexport function readDateTime(node) {\n var s = getAllTextContent(node, false);\n var dateTime = Date.parse(s);\n return isNaN(dateTime) ? undefined : dateTime / 1000;\n}\n/**\n * @param {Node} node Node.\n * @return {number|undefined} Decimal.\n */\nexport function readDecimal(node) {\n var s = getAllTextContent(node, false);\n return readDecimalString(s);\n}\n/**\n * @param {string} string String.\n * @return {number|undefined} Decimal.\n */\nexport function readDecimalString(string) {\n // FIXME check spec\n var m = /^\\s*([+\\-]?\\d*\\.?\\d+(?:e[+\\-]?\\d+)?)\\s*$/i.exec(string);\n if (m) {\n return parseFloat(m[1]);\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {Node} node Node.\n * @return {number|undefined} Non negative integer.\n */\nexport function readNonNegativeInteger(node) {\n var s = getAllTextContent(node, false);\n return readNonNegativeIntegerString(s);\n}\n/**\n * @param {string} string String.\n * @return {number|undefined} Non negative integer.\n */\nexport function readNonNegativeIntegerString(string) {\n var m = /^\\s*(\\d+)\\s*$/.exec(string);\n if (m) {\n return parseInt(m[1], 10);\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {Node} node Node.\n * @return {string|undefined} String.\n */\nexport function readString(node) {\n return getAllTextContent(node, false).trim();\n}\n/**\n * @param {Node} node Node to append a TextNode with the boolean to.\n * @param {boolean} bool Boolean.\n */\nexport function writeBooleanTextNode(node, bool) {\n writeStringTextNode(node, (bool) ? '1' : '0');\n}\n/**\n * @param {Node} node Node to append a CDATA Section with the string to.\n * @param {string} string String.\n */\nexport function writeCDATASection(node, string) {\n node.appendChild(DOCUMENT.createCDATASection(string));\n}\n/**\n * @param {Node} node Node to append a TextNode with the dateTime to.\n * @param {number} dateTime DateTime in seconds.\n */\nexport function writeDateTimeTextNode(node, dateTime) {\n var date = new Date(dateTime * 1000);\n var string = date.getUTCFullYear() + '-' +\n padNumber(date.getUTCMonth() + 1, 2) + '-' +\n padNumber(date.getUTCDate(), 2) + 'T' +\n padNumber(date.getUTCHours(), 2) + ':' +\n padNumber(date.getUTCMinutes(), 2) + ':' +\n padNumber(date.getUTCSeconds(), 2) + 'Z';\n node.appendChild(DOCUMENT.createTextNode(string));\n}\n/**\n * @param {Node} node Node to append a TextNode with the decimal to.\n * @param {number} decimal Decimal.\n */\nexport function writeDecimalTextNode(node, decimal) {\n var string = decimal.toPrecision();\n node.appendChild(DOCUMENT.createTextNode(string));\n}\n/**\n * @param {Node} node Node to append a TextNode with the decimal to.\n * @param {number} nonNegativeInteger Non negative integer.\n */\nexport function writeNonNegativeIntegerTextNode(node, nonNegativeInteger) {\n var string = nonNegativeInteger.toString();\n node.appendChild(DOCUMENT.createTextNode(string));\n}\n/**\n * @param {Node} node Node to append a TextNode with the string to.\n * @param {string} string String.\n */\nexport function writeStringTextNode(node, string) {\n node.appendChild(DOCUMENT.createTextNode(string));\n}\n//# sourceMappingURL=xsd.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/GML3\n */\nimport { extend } from '../array.js';\nimport { createOrUpdate } from '../extent.js';\nimport { transformExtentWithOptions, transformGeometryWithOptions } from './Feature.js';\nimport GMLBase, { GMLNS } from './GMLBase.js';\nimport { readNonNegativeIntegerString, writeStringTextNode } from './xsd.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Polygon from '../geom/Polygon.js';\nimport { assign } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\nimport { createElementNS, getAllTextContent, makeArrayPusher, makeChildAppender, makeReplacer, makeSimpleNodeFactory, OBJECT_PROPERTY_NODE_FACTORY, parseNode, pushParseAndPop, pushSerializeAndPop, XML_SCHEMA_INSTANCE_URI } from '../xml.js';\n/**\n * @const\n * @type {string}\n * @private\n */\nvar schemaLocation = GMLNS +\n ' http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/' +\n '1.0.0/gmlsf.xsd';\n/**\n * @const\n * @type {Object<string, string>}\n */\nvar MULTIGEOMETRY_TO_MEMBER_NODENAME = {\n 'MultiLineString': 'lineStringMember',\n 'MultiCurve': 'curveMember',\n 'MultiPolygon': 'polygonMember',\n 'MultiSurface': 'surfaceMember'\n};\n/**\n * @classdesc\n * Feature format for reading and writing data in the GML format\n * version 3.1.1.\n * Currently only supports GML 3.1.1 Simple Features profile.\n *\n * @api\n */\nvar GML3 = /** @class */ (function (_super) {\n __extends(GML3, _super);\n /**\n * @param {import(\"./GMLBase.js\").Options=} opt_options Optional configuration object.\n */\n function GML3(opt_options) {\n var _this = this;\n var options = /** @type {import(\"./GMLBase.js\").Options} */ (opt_options ? opt_options : {});\n _this = _super.call(this, options) || this;\n /**\n * @private\n * @type {boolean}\n */\n _this.surface_ = options.surface !== undefined ? options.surface : false;\n /**\n * @private\n * @type {boolean}\n */\n _this.curve_ = options.curve !== undefined ? options.curve : false;\n /**\n * @private\n * @type {boolean}\n */\n _this.multiCurve_ = options.multiCurve !== undefined ?\n options.multiCurve : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.multiSurface_ = options.multiSurface !== undefined ?\n options.multiSurface : true;\n /**\n * @inheritDoc\n */\n _this.schemaLocation = options.schemaLocation ?\n options.schemaLocation : schemaLocation;\n /**\n * @private\n * @type {boolean}\n */\n _this.hasZ = options.hasZ !== undefined ?\n options.hasZ : false;\n return _this;\n }\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {MultiLineString|undefined} MultiLineString.\n */\n GML3.prototype.readMultiCurve_ = function (node, objectStack) {\n /** @type {Array<LineString>} */\n var lineStrings = pushParseAndPop([], this.MULTICURVE_PARSERS_, node, objectStack, this);\n if (lineStrings) {\n var multiLineString = new MultiLineString(lineStrings);\n return multiLineString;\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {MultiPolygon|undefined} MultiPolygon.\n */\n GML3.prototype.readMultiSurface_ = function (node, objectStack) {\n /** @type {Array<Polygon>} */\n var polygons = pushParseAndPop([], this.MULTISURFACE_PARSERS_, node, objectStack, this);\n if (polygons) {\n return new MultiPolygon(polygons);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GML3.prototype.curveMemberParser_ = function (node, objectStack) {\n parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GML3.prototype.surfaceMemberParser_ = function (node, objectStack) {\n parseNode(this.SURFACEMEMBER_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<(Array<number>)>|undefined} flat coordinates.\n */\n GML3.prototype.readPatch_ = function (node, objectStack) {\n return pushParseAndPop([null], this.PATCHES_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>|undefined} flat coordinates.\n */\n GML3.prototype.readSegment_ = function (node, objectStack) {\n return pushParseAndPop([null], this.SEGMENTS_PARSERS_, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<(Array<number>)>|undefined} flat coordinates.\n */\n GML3.prototype.readPolygonPatch_ = function (node, objectStack) {\n return pushParseAndPop([null], this.FLAT_LINEAR_RINGS_PARSERS, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>|undefined} flat coordinates.\n */\n GML3.prototype.readLineStringSegment_ = function (node, objectStack) {\n return pushParseAndPop([null], this.GEOMETRY_FLAT_COORDINATES_PARSERS, node, objectStack, this);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GML3.prototype.interiorParser_ = function (node, objectStack) {\n /** @type {Array<number>|undefined} */\n var flatLinearRing = pushParseAndPop(undefined, this.RING_PARSERS, node, objectStack, this);\n if (flatLinearRing) {\n var flatLinearRings = /** @type {Array<Array<number>>} */ (objectStack[objectStack.length - 1]);\n flatLinearRings.push(flatLinearRing);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GML3.prototype.exteriorParser_ = function (node, objectStack) {\n /** @type {Array<number>|undefined} */\n var flatLinearRing = pushParseAndPop(undefined, this.RING_PARSERS, node, objectStack, this);\n if (flatLinearRing) {\n var flatLinearRings = /** @type {Array<Array<number>>} */ (objectStack[objectStack.length - 1]);\n flatLinearRings[0] = flatLinearRing;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Polygon|undefined} Polygon.\n */\n GML3.prototype.readSurface_ = function (node, objectStack) {\n /** @type {Array<Array<number>>} */\n var flatLinearRings = pushParseAndPop([null], this.SURFACE_PARSERS_, node, objectStack, this);\n if (flatLinearRings && flatLinearRings[0]) {\n var flatCoordinates = flatLinearRings[0];\n var ends = [flatCoordinates.length];\n var i = void 0, ii = void 0;\n for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {\n extend(flatCoordinates, flatLinearRings[i]);\n ends.push(flatCoordinates.length);\n }\n return new Polygon(flatCoordinates, GeometryLayout.XYZ, ends);\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {LineString|undefined} LineString.\n */\n GML3.prototype.readCurve_ = function (node, objectStack) {\n /** @type {Array<number>} */\n var flatCoordinates = pushParseAndPop([null], this.CURVE_PARSERS_, node, objectStack, this);\n if (flatCoordinates) {\n var lineString = new LineString(flatCoordinates, GeometryLayout.XYZ);\n return lineString;\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {import(\"../extent.js\").Extent|undefined} Envelope.\n */\n GML3.prototype.readEnvelope_ = function (node, objectStack) {\n /** @type {Array<number>} */\n var flatCoordinates = pushParseAndPop([null], this.ENVELOPE_PARSERS_, node, objectStack, this);\n return createOrUpdate(flatCoordinates[1][0], flatCoordinates[1][1], flatCoordinates[2][0], flatCoordinates[2][1]);\n };\n /**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>|undefined} Flat coordinates.\n */\n GML3.prototype.readFlatPos_ = function (node, objectStack) {\n var s = getAllTextContent(node, false);\n var re = /^\\s*([+\\-]?\\d*\\.?\\d+(?:[eE][+\\-]?\\d+)?)\\s*/;\n /** @type {Array<number>} */\n var flatCoordinates = [];\n var m;\n while ((m = re.exec(s))) {\n flatCoordinates.push(parseFloat(m[1]));\n s = s.substr(m[0].length);\n }\n if (s !== '') {\n return undefined;\n }\n var context = objectStack[0];\n var containerSrs = context['srsName'];\n var axisOrientation = 'enu';\n if (containerSrs) {\n var proj = getProjection(containerSrs);\n axisOrientation = proj.getAxisOrientation();\n }\n if (axisOrientation === 'neu') {\n var i = void 0, ii = void 0;\n for (i = 0, ii = flatCoordinates.length; i < ii; i += 3) {\n var y = flatCoordinates[i];\n var x = flatCoordinates[i + 1];\n flatCoordinates[i] = x;\n flatCoordinates[i + 1] = y;\n }\n }\n var len = flatCoordinates.length;\n if (len == 2) {\n flatCoordinates.push(0);\n }\n if (len === 0) {\n return undefined;\n }\n return flatCoordinates;\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>|undefined} Flat coordinates.\n */\n GML3.prototype.readFlatPosList_ = function (node, objectStack) {\n var s = getAllTextContent(node, false).replace(/^\\s*|\\s*$/g, '');\n var context = objectStack[0];\n var containerSrs = context['srsName'];\n var contextDimension = context['srsDimension'];\n var axisOrientation = 'enu';\n if (containerSrs) {\n var proj = getProjection(containerSrs);\n axisOrientation = proj.getAxisOrientation();\n }\n var coords = s.split(/\\s+/);\n // The \"dimension\" attribute is from the GML 3.0.1 spec.\n var dim = 2;\n if (node.getAttribute('srsDimension')) {\n dim = readNonNegativeIntegerString(node.getAttribute('srsDimension'));\n }\n else if (node.getAttribute('dimension')) {\n dim = readNonNegativeIntegerString(node.getAttribute('dimension'));\n }\n else if ( /** @type {Element} */(node.parentNode).getAttribute('srsDimension')) {\n dim = readNonNegativeIntegerString(\n /** @type {Element} */ (node.parentNode).getAttribute('srsDimension'));\n }\n else if (contextDimension) {\n dim = readNonNegativeIntegerString(contextDimension);\n }\n var x, y, z;\n var flatCoordinates = [];\n for (var i = 0, ii = coords.length; i < ii; i += dim) {\n x = parseFloat(coords[i]);\n y = parseFloat(coords[i + 1]);\n z = (dim === 3) ? parseFloat(coords[i + 2]) : 0;\n if (axisOrientation.substr(0, 2) === 'en') {\n flatCoordinates.push(x, y, z);\n }\n else {\n flatCoordinates.push(y, x, z);\n }\n }\n return flatCoordinates;\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/Point.js\").default} value Point geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writePos_ = function (node, value, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsDimension = hasZ ? '3' : '2';\n node.setAttribute('srsDimension', srsDimension);\n var srsName = context['srsName'];\n var axisOrientation = 'enu';\n if (srsName) {\n axisOrientation = getProjection(srsName).getAxisOrientation();\n }\n var point = value.getCoordinates();\n var coords;\n // only 2d for simple features profile\n if (axisOrientation.substr(0, 2) === 'en') {\n coords = (point[0] + ' ' + point[1]);\n }\n else {\n coords = (point[1] + ' ' + point[0]);\n }\n if (hasZ) {\n // For newly created points, Z can be undefined.\n var z = point[2] || 0;\n coords += ' ' + z;\n }\n writeStringTextNode(node, coords);\n };\n /**\n * @param {Array<number>} point Point geometry.\n * @param {string=} opt_srsName Optional srsName\n * @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.\n * @return {string} The coords string.\n * @private\n */\n GML3.prototype.getCoords_ = function (point, opt_srsName, opt_hasZ) {\n var axisOrientation = 'enu';\n if (opt_srsName) {\n axisOrientation = getProjection(opt_srsName).getAxisOrientation();\n }\n var coords = ((axisOrientation.substr(0, 2) === 'en') ?\n point[0] + ' ' + point[1] :\n point[1] + ' ' + point[0]);\n if (opt_hasZ) {\n // For newly created points, Z can be undefined.\n var z = point[2] || 0;\n coords += ' ' + z;\n }\n return coords;\n };\n /**\n * @param {Element} node Node.\n * @param {LineString|import(\"../geom/LinearRing.js\").default} value Geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writePosList_ = function (node, value, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsDimension = hasZ ? '3' : '2';\n node.setAttribute('srsDimension', srsDimension);\n var srsName = context['srsName'];\n // only 2d for simple features profile\n var points = value.getCoordinates();\n var len = points.length;\n var parts = new Array(len);\n var point;\n for (var i = 0; i < len; ++i) {\n point = points[i];\n parts[i] = this.getCoords_(point, srsName, hasZ);\n }\n writeStringTextNode(node, parts.join(' '));\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/Point.js\").default} geometry Point geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writePoint_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var pos = createElementNS(node.namespaceURI, 'pos');\n node.appendChild(pos);\n this.writePos_(pos, geometry, objectStack);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {Array<*>} objectStack Node stack.\n */\n GML3.prototype.writeEnvelope = function (node, extent, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var keys = ['lowerCorner', 'upperCorner'];\n var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ ({ node: node }), this.ENVELOPE_SERIALIZERS_, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, keys, this);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/LinearRing.js\").default} geometry LinearRing geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeLinearRing_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var posList = createElementNS(node.namespaceURI, 'posList');\n node.appendChild(posList);\n this.writePosList_(posList, geometry, objectStack);\n };\n /**\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node} Node.\n * @private\n */\n GML3.prototype.RING_NODE_FACTORY_ = function (value, objectStack, opt_nodeName) {\n var context = objectStack[objectStack.length - 1];\n var parentNode = context.node;\n var exteriorWritten = context['exteriorWritten'];\n if (exteriorWritten === undefined) {\n context['exteriorWritten'] = true;\n }\n return createElementNS(parentNode.namespaceURI, exteriorWritten !== undefined ? 'interior' : 'exterior');\n };\n /**\n * @param {Element} node Node.\n * @param {Polygon} geometry Polygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeSurfaceOrPolygon_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n if (node.nodeName !== 'PolygonPatch' && srsName) {\n node.setAttribute('srsName', srsName);\n }\n if (node.nodeName === 'Polygon' || node.nodeName === 'PolygonPatch') {\n var rings = geometry.getLinearRings();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName }, this.RING_SERIALIZERS_, this.RING_NODE_FACTORY_, rings, objectStack, undefined, this);\n }\n else if (node.nodeName === 'Surface') {\n var patches = createElementNS(node.namespaceURI, 'patches');\n node.appendChild(patches);\n this.writeSurfacePatches_(patches, geometry, objectStack);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {LineString} geometry LineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeCurveOrLineString_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (node.nodeName !== 'LineStringSegment' && srsName) {\n node.setAttribute('srsName', srsName);\n }\n if (node.nodeName === 'LineString' ||\n node.nodeName === 'LineStringSegment') {\n var posList = createElementNS(node.namespaceURI, 'posList');\n node.appendChild(posList);\n this.writePosList_(posList, geometry, objectStack);\n }\n else if (node.nodeName === 'Curve') {\n var segments = createElementNS(node.namespaceURI, 'segments');\n node.appendChild(segments);\n this.writeCurveSegments_(segments, geometry, objectStack);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {MultiPolygon} geometry MultiPolygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeMultiSurfaceOrPolygon_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n var surface = context['surface'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var polygons = geometry.getPolygons();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName, surface: surface }, this.SURFACEORPOLYGONMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, polygons, objectStack, undefined, this);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/MultiPoint.js\").default} geometry MultiPoint geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeMultiPoint_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n var hasZ = context['hasZ'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var points = geometry.getPoints();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName }, this.POINTMEMBER_SERIALIZERS_, makeSimpleNodeFactory('pointMember'), points, objectStack, undefined, this);\n };\n /**\n * @param {Element} node Node.\n * @param {MultiLineString} geometry MultiLineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeMultiCurveOrLineString_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n var curve = context['curve'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var lines = geometry.getLineStrings();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName, curve: curve }, this.LINESTRINGORCURVEMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, lines, objectStack, undefined, this);\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/LinearRing.js\").default} ring LinearRing geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeRing_ = function (node, ring, objectStack) {\n var linearRing = createElementNS(node.namespaceURI, 'LinearRing');\n node.appendChild(linearRing);\n this.writeLinearRing_(linearRing, ring, objectStack);\n };\n /**\n * @param {Node} node Node.\n * @param {Polygon} polygon Polygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeSurfaceOrPolygonMember_ = function (node, polygon, objectStack) {\n var child = this.GEOMETRY_NODE_FACTORY_(polygon, objectStack);\n if (child) {\n node.appendChild(child);\n this.writeSurfaceOrPolygon_(child, polygon, objectStack);\n }\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/Point.js\").default} point Point geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writePointMember_ = function (node, point, objectStack) {\n var child = createElementNS(node.namespaceURI, 'Point');\n node.appendChild(child);\n this.writePoint_(child, point, objectStack);\n };\n /**\n * @param {Node} node Node.\n * @param {LineString} line LineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeLineStringOrCurveMember_ = function (node, line, objectStack) {\n var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);\n if (child) {\n node.appendChild(child);\n this.writeCurveOrLineString_(child, line, objectStack);\n }\n };\n /**\n * @param {Node} node Node.\n * @param {Polygon} polygon Polygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeSurfacePatches_ = function (node, polygon, objectStack) {\n var child = createElementNS(node.namespaceURI, 'PolygonPatch');\n node.appendChild(child);\n this.writeSurfaceOrPolygon_(child, polygon, objectStack);\n };\n /**\n * @param {Node} node Node.\n * @param {LineString} line LineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeCurveSegments_ = function (node, line, objectStack) {\n var child = createElementNS(node.namespaceURI, 'LineStringSegment');\n node.appendChild(child);\n this.writeCurveOrLineString_(child, line, objectStack);\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/Geometry.js\").default|import(\"../extent.js\").Extent} geometry Geometry.\n * @param {Array<*>} objectStack Node stack.\n */\n GML3.prototype.writeGeometryElement = function (node, geometry, objectStack) {\n var context = /** @type {import(\"./Feature.js\").WriteOptions} */ (objectStack[objectStack.length - 1]);\n var item = assign({}, context);\n item['node'] = node;\n var value;\n if (Array.isArray(geometry)) {\n value = transformExtentWithOptions(/** @type {import(\"../extent.js\").Extent} */ (geometry), context);\n }\n else {\n value = transformGeometryWithOptions(/** @type {import(\"../geom/Geometry.js\").default} */ (geometry), true, context);\n }\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ (item), this.GEOMETRY_SERIALIZERS_, this.GEOMETRY_NODE_FACTORY_, [value], objectStack, undefined, this);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {Array<*>} objectStack Node stack.\n */\n GML3.prototype.writeFeatureElement = function (node, feature, objectStack) {\n var fid = feature.getId();\n if (fid) {\n node.setAttribute('fid', /** @type {string} */ (fid));\n }\n var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var featureNS = context['featureNS'];\n var geometryName = feature.getGeometryName();\n if (!context.serializers) {\n context.serializers = {};\n context.serializers[featureNS] = {};\n }\n var properties = feature.getProperties();\n var keys = [];\n var values = [];\n for (var key in properties) {\n var value = properties[key];\n if (value !== null) {\n keys.push(key);\n values.push(value);\n if (key == geometryName || typeof /** @type {?} */ (value).getSimplifiedGeometry === 'function') {\n if (!(key in context.serializers[featureNS])) {\n context.serializers[featureNS][key] = makeChildAppender(this.writeGeometryElement, this);\n }\n }\n else {\n if (!(key in context.serializers[featureNS])) {\n context.serializers[featureNS][key] = makeChildAppender(writeStringTextNode);\n }\n }\n }\n }\n var item = assign({}, context);\n item.node = node;\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ (item), context.serializers, makeSimpleNodeFactory(undefined, featureNS), values, objectStack, keys);\n };\n /**\n * @param {Node} node Node.\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML3.prototype.writeFeatureMembers_ = function (node, features, objectStack) {\n var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var featureType = context['featureType'];\n var featureNS = context['featureNS'];\n /** @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>} */\n var serializers = {};\n serializers[featureNS] = {};\n serializers[featureNS][featureType] = makeChildAppender(this.writeFeatureElement, this);\n var item = assign({}, context);\n item.node = node;\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ (item), serializers, makeSimpleNodeFactory(featureType, featureNS), features, objectStack);\n };\n /**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node|undefined} Node.\n * @private\n */\n GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function (value, objectStack, opt_nodeName) {\n var parentNode = objectStack[objectStack.length - 1].node;\n return createElementNS(this.namespace, MULTIGEOMETRY_TO_MEMBER_NODENAME[parentNode.nodeName]);\n };\n /**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Element|undefined} Node.\n * @private\n */\n GML3.prototype.GEOMETRY_NODE_FACTORY_ = function (value, objectStack, opt_nodeName) {\n var context = objectStack[objectStack.length - 1];\n var multiSurface = context['multiSurface'];\n var surface = context['surface'];\n var curve = context['curve'];\n var multiCurve = context['multiCurve'];\n var nodeName;\n if (!Array.isArray(value)) {\n nodeName = /** @type {import(\"../geom/Geometry.js\").default} */ (value).getType();\n if (nodeName === 'MultiPolygon' && multiSurface === true) {\n nodeName = 'MultiSurface';\n }\n else if (nodeName === 'Polygon' && surface === true) {\n nodeName = 'Surface';\n }\n else if (nodeName === 'LineString' && curve === true) {\n nodeName = 'Curve';\n }\n else if (nodeName === 'MultiLineString' && multiCurve === true) {\n nodeName = 'MultiCurve';\n }\n }\n else {\n nodeName = 'Envelope';\n }\n return createElementNS(this.namespace, nodeName);\n };\n /**\n * Encode a geometry in GML 3.1.1 Simple Features.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Node} Node.\n * @override\n * @api\n */\n GML3.prototype.writeGeometryNode = function (geometry, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n var geom = createElementNS(this.namespace, 'geom');\n var context = { node: geom, hasZ: this.hasZ, srsName: this.srsName,\n curve: this.curve_, surface: this.surface_,\n multiSurface: this.multiSurface_, multiCurve: this.multiCurve_ };\n if (opt_options) {\n assign(context, opt_options);\n }\n this.writeGeometryElement(geom, geometry, [context]);\n return geom;\n };\n /**\n * Encode an array of features in the GML 3.1.1 format as an XML node.\n *\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Element} Node.\n * @override\n * @api\n */\n GML3.prototype.writeFeaturesNode = function (features, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n var node = createElementNS(this.namespace, 'featureMembers');\n node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', this.schemaLocation);\n var context = {\n srsName: this.srsName,\n hasZ: this.hasZ,\n curve: this.curve_,\n surface: this.surface_,\n multiSurface: this.multiSurface_,\n multiCurve: this.multiCurve_,\n featureNS: this.featureNS,\n featureType: this.featureType\n };\n if (opt_options) {\n assign(context, opt_options);\n }\n this.writeFeatureMembers_(node, features, [context]);\n return node;\n };\n return GML3;\n}(GMLBase));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'pos': makeReplacer(GML3.prototype.readFlatPos_),\n 'posList': makeReplacer(GML3.prototype.readFlatPosList_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML3.prototype.FLAT_LINEAR_RINGS_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'interior': GML3.prototype.interiorParser_,\n 'exterior': GML3.prototype.exteriorParser_\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML3.prototype.GEOMETRY_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'Point': makeReplacer(GMLBase.prototype.readPoint),\n 'MultiPoint': makeReplacer(GMLBase.prototype.readMultiPoint),\n 'LineString': makeReplacer(GMLBase.prototype.readLineString),\n 'MultiLineString': makeReplacer(GMLBase.prototype.readMultiLineString),\n 'LinearRing': makeReplacer(GMLBase.prototype.readLinearRing),\n 'Polygon': makeReplacer(GMLBase.prototype.readPolygon),\n 'MultiPolygon': makeReplacer(GMLBase.prototype.readMultiPolygon),\n 'Surface': makeReplacer(GML3.prototype.readSurface_),\n 'MultiSurface': makeReplacer(GML3.prototype.readMultiSurface_),\n 'Curve': makeReplacer(GML3.prototype.readCurve_),\n 'MultiCurve': makeReplacer(GML3.prototype.readMultiCurve_),\n 'Envelope': makeReplacer(GML3.prototype.readEnvelope_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.MULTICURVE_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'curveMember': makeArrayPusher(GML3.prototype.curveMemberParser_),\n 'curveMembers': makeArrayPusher(GML3.prototype.curveMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.MULTISURFACE_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'surfaceMember': makeArrayPusher(GML3.prototype.surfaceMemberParser_),\n 'surfaceMembers': makeArrayPusher(GML3.prototype.surfaceMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.CURVEMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'LineString': makeArrayPusher(GMLBase.prototype.readLineString),\n 'Curve': makeArrayPusher(GML3.prototype.readCurve_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.SURFACEMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon),\n 'Surface': makeArrayPusher(GML3.prototype.readSurface_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.SURFACE_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'patches': makeReplacer(GML3.prototype.readPatch_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.CURVE_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'segments': makeReplacer(GML3.prototype.readSegment_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.ENVELOPE_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'lowerCorner': makeArrayPusher(GML3.prototype.readFlatPosList_),\n 'upperCorner': makeArrayPusher(GML3.prototype.readFlatPosList_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.PATCHES_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'PolygonPatch': makeReplacer(GML3.prototype.readPolygonPatch_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML3.prototype.SEGMENTS_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'LineStringSegment': makeReplacer(GML3.prototype.readLineStringSegment_)\n }\n};\n/**\n * Encode an array of features in GML 3.1.1 Simple Features.\n *\n * @function\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {string} Result.\n * @api\n */\nGML3.prototype.writeFeatures;\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML3.prototype.RING_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'exterior': makeChildAppender(GML3.prototype.writeRing_),\n 'interior': makeChildAppender(GML3.prototype.writeRing_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML3.prototype.ENVELOPE_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'lowerCorner': makeChildAppender(writeStringTextNode),\n 'upperCorner': makeChildAppender(writeStringTextNode)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'surfaceMember': makeChildAppender(GML3.prototype.writeSurfaceOrPolygonMember_),\n 'polygonMember': makeChildAppender(GML3.prototype.writeSurfaceOrPolygonMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML3.prototype.POINTMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'pointMember': makeChildAppender(GML3.prototype.writePointMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'lineStringMember': makeChildAppender(GML3.prototype.writeLineStringOrCurveMember_),\n 'curveMember': makeChildAppender(GML3.prototype.writeLineStringOrCurveMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML3.prototype.GEOMETRY_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'Curve': makeChildAppender(GML3.prototype.writeCurveOrLineString_),\n 'MultiCurve': makeChildAppender(GML3.prototype.writeMultiCurveOrLineString_),\n 'Point': makeChildAppender(GML3.prototype.writePoint_),\n 'MultiPoint': makeChildAppender(GML3.prototype.writeMultiPoint_),\n 'LineString': makeChildAppender(GML3.prototype.writeCurveOrLineString_),\n 'MultiLineString': makeChildAppender(GML3.prototype.writeMultiCurveOrLineString_),\n 'LinearRing': makeChildAppender(GML3.prototype.writeLinearRing_),\n 'Polygon': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),\n 'MultiPolygon': makeChildAppender(GML3.prototype.writeMultiSurfaceOrPolygon_),\n 'Surface': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),\n 'MultiSurface': makeChildAppender(GML3.prototype.writeMultiSurfaceOrPolygon_),\n 'Envelope': makeChildAppender(GML3.prototype.writeEnvelope)\n }\n};\nexport default GML3;\n//# sourceMappingURL=GML3.js.map","/**\n * @module ol/format/GML\n */\nimport GML3 from './GML3.js';\n/**\n * @classdesc\n * Feature format for reading and writing data in the GML format\n * version 3.1.1.\n * Currently only supports GML 3.1.1 Simple Features profile.\n *\n * @param {import(\"./GMLBase.js\").Options=} opt_options\n * Optional configuration object.\n * @api\n */\nvar GML = GML3;\n/**\n * Encode an array of features in GML 3.1.1 Simple Features.\n *\n * @function\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {string} Result.\n * @api\n */\nGML.prototype.writeFeatures;\n/**\n * Encode an array of features in the GML 3.1.1 format as an XML node.\n *\n * @function\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Node} Node.\n * @api\n */\nGML.prototype.writeFeaturesNode;\nexport default GML;\n//# sourceMappingURL=GML.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/GML2\n */\nimport { createOrUpdate } from '../extent.js';\nimport { transformExtentWithOptions, transformGeometryWithOptions } from './Feature.js';\nimport GMLBase, { GMLNS } from './GMLBase.js';\nimport { writeStringTextNode } from './xsd.js';\nimport { assign } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\nimport { createElementNS, getAllTextContent, makeArrayPusher, makeChildAppender, makeReplacer, makeSimpleNodeFactory, OBJECT_PROPERTY_NODE_FACTORY, pushParseAndPop, pushSerializeAndPop } from '../xml.js';\n/**\n * @const\n * @type {string}\n */\nvar schemaLocation = GMLNS + ' http://schemas.opengis.net/gml/2.1.2/feature.xsd';\n/**\n * @const\n * @type {Object<string, string>}\n */\nvar MULTIGEOMETRY_TO_MEMBER_NODENAME = {\n 'MultiLineString': 'lineStringMember',\n 'MultiCurve': 'curveMember',\n 'MultiPolygon': 'polygonMember',\n 'MultiSurface': 'surfaceMember'\n};\n/**\n * @classdesc\n * Feature format for reading and writing data in the GML format,\n * version 2.1.2.\n *\n * @api\n */\nvar GML2 = /** @class */ (function (_super) {\n __extends(GML2, _super);\n /**\n * @param {import(\"./GMLBase.js\").Options=} opt_options Optional configuration object.\n */\n function GML2(opt_options) {\n var _this = this;\n var options = /** @type {import(\"./GMLBase.js\").Options} */ (opt_options ? opt_options : {});\n _this = _super.call(this, options) || this;\n _this.FEATURE_COLLECTION_PARSERS[GMLNS]['featureMember'] =\n makeArrayPusher(_this.readFeaturesInternal);\n /**\n * @inheritDoc\n */\n _this.schemaLocation = options.schemaLocation ?\n options.schemaLocation : schemaLocation;\n return _this;\n }\n /**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<number>|undefined} Flat coordinates.\n */\n GML2.prototype.readFlatCoordinates_ = function (node, objectStack) {\n var s = getAllTextContent(node, false).replace(/^\\s*|\\s*$/g, '');\n var context = /** @type {import(\"../xml.js\").NodeStackItem} */ (objectStack[0]);\n var containerSrs = context['srsName'];\n var axisOrientation = 'enu';\n if (containerSrs) {\n var proj = getProjection(containerSrs);\n if (proj) {\n axisOrientation = proj.getAxisOrientation();\n }\n }\n var coordsGroups = s.trim().split(/\\s+/);\n var flatCoordinates = [];\n for (var i = 0, ii = coordsGroups.length; i < ii; i++) {\n var coords = coordsGroups[i].split(/,+/);\n var x = parseFloat(coords[0]);\n var y = parseFloat(coords[1]);\n var z = (coords.length === 3) ? parseFloat(coords[2]) : 0;\n if (axisOrientation.substr(0, 2) === 'en') {\n flatCoordinates.push(x, y, z);\n }\n else {\n flatCoordinates.push(y, x, z);\n }\n }\n return flatCoordinates;\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {import(\"../extent.js\").Extent|undefined} Envelope.\n */\n GML2.prototype.readBox_ = function (node, objectStack) {\n /** @type {Array<number>} */\n var flatCoordinates = pushParseAndPop([null], this.BOX_PARSERS_, node, objectStack, this);\n return createOrUpdate(flatCoordinates[1][0], flatCoordinates[1][1], flatCoordinates[1][3], flatCoordinates[1][4]);\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GML2.prototype.innerBoundaryIsParser_ = function (node, objectStack) {\n /** @type {Array<number>|undefined} */\n var flatLinearRing = pushParseAndPop(undefined, this.RING_PARSERS, node, objectStack, this);\n if (flatLinearRing) {\n var flatLinearRings = /** @type {Array<Array<number>>} */ (objectStack[objectStack.length - 1]);\n flatLinearRings.push(flatLinearRing);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n GML2.prototype.outerBoundaryIsParser_ = function (node, objectStack) {\n /** @type {Array<number>|undefined} */\n var flatLinearRing = pushParseAndPop(undefined, this.RING_PARSERS, node, objectStack, this);\n if (flatLinearRing) {\n var flatLinearRings = /** @type {Array<Array<number>>} */ (objectStack[objectStack.length - 1]);\n flatLinearRings[0] = flatLinearRing;\n }\n };\n /**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Element|undefined} Node.\n * @private\n */\n GML2.prototype.GEOMETRY_NODE_FACTORY_ = function (value, objectStack, opt_nodeName) {\n var context = objectStack[objectStack.length - 1];\n var multiSurface = context['multiSurface'];\n var surface = context['surface'];\n var multiCurve = context['multiCurve'];\n var nodeName;\n if (!Array.isArray(value)) {\n nodeName = /** @type {import(\"../geom/Geometry.js\").default} */ (value).getType();\n if (nodeName === 'MultiPolygon' && multiSurface === true) {\n nodeName = 'MultiSurface';\n }\n else if (nodeName === 'Polygon' && surface === true) {\n nodeName = 'Surface';\n }\n else if (nodeName === 'MultiLineString' && multiCurve === true) {\n nodeName = 'MultiCurve';\n }\n }\n else {\n nodeName = 'Envelope';\n }\n return createElementNS('http://www.opengis.net/gml', nodeName);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {Array<*>} objectStack Node stack.\n */\n GML2.prototype.writeFeatureElement = function (node, feature, objectStack) {\n var fid = feature.getId();\n if (fid) {\n node.setAttribute('fid', /** @type {string} */ (fid));\n }\n var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var featureNS = context['featureNS'];\n var geometryName = feature.getGeometryName();\n if (!context.serializers) {\n context.serializers = {};\n context.serializers[featureNS] = {};\n }\n var properties = feature.getProperties();\n var keys = [];\n var values = [];\n for (var key in properties) {\n var value = properties[key];\n if (value !== null) {\n keys.push(key);\n values.push(value);\n if (key == geometryName || typeof /** @type {?} */ (value).getSimplifiedGeometry === 'function') {\n if (!(key in context.serializers[featureNS])) {\n context.serializers[featureNS][key] = makeChildAppender(this.writeGeometryElement, this);\n }\n }\n else {\n if (!(key in context.serializers[featureNS])) {\n context.serializers[featureNS][key] = makeChildAppender(writeStringTextNode);\n }\n }\n }\n }\n var item = assign({}, context);\n item.node = node;\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ (item), context.serializers, makeSimpleNodeFactory(undefined, featureNS), values, objectStack, keys);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/LineString.js\").default} geometry LineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeCurveOrLineString_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (node.nodeName !== 'LineStringSegment' && srsName) {\n node.setAttribute('srsName', srsName);\n }\n if (node.nodeName === 'LineString' ||\n node.nodeName === 'LineStringSegment') {\n var coordinates = this.createCoordinatesNode_(node.namespaceURI);\n node.appendChild(coordinates);\n this.writeCoordinates_(coordinates, geometry, objectStack);\n }\n else if (node.nodeName === 'Curve') {\n var segments = createElementNS(node.namespaceURI, 'segments');\n node.appendChild(segments);\n this.writeCurveSegments_(segments, geometry, objectStack);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/LineString.js\").default} line LineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeLineStringOrCurveMember_ = function (node, line, objectStack) {\n var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);\n if (child) {\n node.appendChild(child);\n this.writeCurveOrLineString_(child, line, objectStack);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/MultiLineString.js\").default} geometry MultiLineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeMultiCurveOrLineString_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n var curve = context['curve'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var lines = geometry.getLineStrings();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName, curve: curve }, this.LINESTRINGORCURVEMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, lines, objectStack, undefined, this);\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/Geometry.js\").default|import(\"../extent.js\").Extent} geometry Geometry.\n * @param {Array<*>} objectStack Node stack.\n */\n GML2.prototype.writeGeometryElement = function (node, geometry, objectStack) {\n var context = /** @type {import(\"./Feature.js\").WriteOptions} */ (objectStack[objectStack.length - 1]);\n var item = assign({}, context);\n item['node'] = node;\n var value;\n if (Array.isArray(geometry)) {\n value = transformExtentWithOptions(/** @type {import(\"../extent.js\").Extent} */ (geometry), context);\n }\n else {\n value = transformGeometryWithOptions(/** @type {import(\"../geom/Geometry.js\").default} */ (geometry), true, context);\n }\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ (item), this.GEOMETRY_SERIALIZERS_, this.GEOMETRY_NODE_FACTORY_, [value], objectStack, undefined, this);\n };\n /**\n * @param {string} namespaceURI XML namespace.\n * @returns {Element} coordinates node.\n * @private\n */\n GML2.prototype.createCoordinatesNode_ = function (namespaceURI) {\n var coordinates = createElementNS(namespaceURI, 'coordinates');\n coordinates.setAttribute('decimal', '.');\n coordinates.setAttribute('cs', ',');\n coordinates.setAttribute('ts', ' ');\n return coordinates;\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/LineString.js\").default|import(\"../geom/LinearRing.js\").default} value Geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeCoordinates_ = function (node, value, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n // only 2d for simple features profile\n var points = value.getCoordinates();\n var len = points.length;\n var parts = new Array(len);\n for (var i = 0; i < len; ++i) {\n var point = points[i];\n parts[i] = this.getCoords_(point, srsName, hasZ);\n }\n writeStringTextNode(node, parts.join(' '));\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/LineString.js\").default} line LineString geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeCurveSegments_ = function (node, line, objectStack) {\n var child = createElementNS(node.namespaceURI, 'LineStringSegment');\n node.appendChild(child);\n this.writeCurveOrLineString_(child, line, objectStack);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/Polygon.js\").default} geometry Polygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeSurfaceOrPolygon_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n if (node.nodeName !== 'PolygonPatch' && srsName) {\n node.setAttribute('srsName', srsName);\n }\n if (node.nodeName === 'Polygon' || node.nodeName === 'PolygonPatch') {\n var rings = geometry.getLinearRings();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName }, this.RING_SERIALIZERS_, this.RING_NODE_FACTORY_, rings, objectStack, undefined, this);\n }\n else if (node.nodeName === 'Surface') {\n var patches = createElementNS(node.namespaceURI, 'patches');\n node.appendChild(patches);\n this.writeSurfacePatches_(patches, geometry, objectStack);\n }\n };\n /**\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node} Node.\n * @private\n */\n GML2.prototype.RING_NODE_FACTORY_ = function (value, objectStack, opt_nodeName) {\n var context = objectStack[objectStack.length - 1];\n var parentNode = context.node;\n var exteriorWritten = context['exteriorWritten'];\n if (exteriorWritten === undefined) {\n context['exteriorWritten'] = true;\n }\n return createElementNS(parentNode.namespaceURI, exteriorWritten !== undefined ? 'innerBoundaryIs' : 'outerBoundaryIs');\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/Polygon.js\").default} polygon Polygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeSurfacePatches_ = function (node, polygon, objectStack) {\n var child = createElementNS(node.namespaceURI, 'PolygonPatch');\n node.appendChild(child);\n this.writeSurfaceOrPolygon_(child, polygon, objectStack);\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/LinearRing.js\").default} ring LinearRing geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeRing_ = function (node, ring, objectStack) {\n var linearRing = createElementNS(node.namespaceURI, 'LinearRing');\n node.appendChild(linearRing);\n this.writeLinearRing_(linearRing, ring, objectStack);\n };\n /**\n * @param {Array<number>} point Point geometry.\n * @param {string=} opt_srsName Optional srsName\n * @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.\n * @return {string} The coords string.\n * @private\n */\n GML2.prototype.getCoords_ = function (point, opt_srsName, opt_hasZ) {\n var axisOrientation = 'enu';\n if (opt_srsName) {\n axisOrientation = getProjection(opt_srsName).getAxisOrientation();\n }\n var coords = ((axisOrientation.substr(0, 2) === 'en') ?\n point[0] + ',' + point[1] :\n point[1] + ',' + point[0]);\n if (opt_hasZ) {\n // For newly created points, Z can be undefined.\n var z = point[2] || 0;\n coords += ',' + z;\n }\n return coords;\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/Point.js\").default} geometry Point geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writePoint_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var coordinates = this.createCoordinatesNode_(node.namespaceURI);\n node.appendChild(coordinates);\n var point = geometry.getCoordinates();\n var coord = this.getCoords_(point, srsName, hasZ);\n writeStringTextNode(coordinates, coord);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/MultiPoint.js\").default} geometry MultiPoint geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeMultiPoint_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var points = geometry.getPoints();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName }, this.POINTMEMBER_SERIALIZERS_, makeSimpleNodeFactory('pointMember'), points, objectStack, undefined, this);\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/Point.js\").default} point Point geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writePointMember_ = function (node, point, objectStack) {\n var child = createElementNS(node.namespaceURI, 'Point');\n node.appendChild(child);\n this.writePoint_(child, point, objectStack);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/LinearRing.js\").default} geometry LinearRing geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeLinearRing_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var coordinates = this.createCoordinatesNode_(node.namespaceURI);\n node.appendChild(coordinates);\n this.writeCoordinates_(coordinates, geometry, objectStack);\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry MultiPolygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeMultiSurfaceOrPolygon_ = function (node, geometry, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var hasZ = context['hasZ'];\n var srsName = context['srsName'];\n var surface = context['surface'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var polygons = geometry.getPolygons();\n pushSerializeAndPop({ node: node, hasZ: hasZ, srsName: srsName, surface: surface }, this.SURFACEORPOLYGONMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, polygons, objectStack, undefined, this);\n };\n /**\n * @param {Node} node Node.\n * @param {import(\"../geom/Polygon.js\").default} polygon Polygon geometry.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeSurfaceOrPolygonMember_ = function (node, polygon, objectStack) {\n var child = this.GEOMETRY_NODE_FACTORY_(polygon, objectStack);\n if (child) {\n node.appendChild(child);\n this.writeSurfaceOrPolygon_(child, polygon, objectStack);\n }\n };\n /**\n * @param {Element} node Node.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {Array<*>} objectStack Node stack.\n * @private\n */\n GML2.prototype.writeEnvelope = function (node, extent, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var srsName = context['srsName'];\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n var keys = ['lowerCorner', 'upperCorner'];\n var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ ({ node: node }), this.ENVELOPE_SERIALIZERS_, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, keys, this);\n };\n /**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node|undefined} Node.\n * @private\n */\n GML2.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function (value, objectStack, opt_nodeName) {\n var parentNode = objectStack[objectStack.length - 1].node;\n return createElementNS('http://www.opengis.net/gml', MULTIGEOMETRY_TO_MEMBER_NODENAME[parentNode.nodeName]);\n };\n return GML2;\n}(GMLBase));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'coordinates': makeReplacer(GML2.prototype.readFlatCoordinates_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML2.prototype.FLAT_LINEAR_RINGS_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'innerBoundaryIs': GML2.prototype.innerBoundaryIsParser_,\n 'outerBoundaryIs': GML2.prototype.outerBoundaryIsParser_\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML2.prototype.BOX_PARSERS_ = {\n 'http://www.opengis.net/gml': {\n 'coordinates': makeArrayPusher(GML2.prototype.readFlatCoordinates_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML2.prototype.GEOMETRY_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'Point': makeReplacer(GMLBase.prototype.readPoint),\n 'MultiPoint': makeReplacer(GMLBase.prototype.readMultiPoint),\n 'LineString': makeReplacer(GMLBase.prototype.readLineString),\n 'MultiLineString': makeReplacer(GMLBase.prototype.readMultiLineString),\n 'LinearRing': makeReplacer(GMLBase.prototype.readLinearRing),\n 'Polygon': makeReplacer(GMLBase.prototype.readPolygon),\n 'MultiPolygon': makeReplacer(GMLBase.prototype.readMultiPolygon),\n 'Box': makeReplacer(GML2.prototype.readBox_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML2.prototype.GEOMETRY_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'Curve': makeChildAppender(GML2.prototype.writeCurveOrLineString_),\n 'MultiCurve': makeChildAppender(GML2.prototype.writeMultiCurveOrLineString_),\n 'Point': makeChildAppender(GML2.prototype.writePoint_),\n 'MultiPoint': makeChildAppender(GML2.prototype.writeMultiPoint_),\n 'LineString': makeChildAppender(GML2.prototype.writeCurveOrLineString_),\n 'MultiLineString': makeChildAppender(GML2.prototype.writeMultiCurveOrLineString_),\n 'LinearRing': makeChildAppender(GML2.prototype.writeLinearRing_),\n 'Polygon': makeChildAppender(GML2.prototype.writeSurfaceOrPolygon_),\n 'MultiPolygon': makeChildAppender(GML2.prototype.writeMultiSurfaceOrPolygon_),\n 'Surface': makeChildAppender(GML2.prototype.writeSurfaceOrPolygon_),\n 'MultiSurface': makeChildAppender(GML2.prototype.writeMultiSurfaceOrPolygon_),\n 'Envelope': makeChildAppender(GML2.prototype.writeEnvelope)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'lineStringMember': makeChildAppender(GML2.prototype.writeLineStringOrCurveMember_),\n 'curveMember': makeChildAppender(GML2.prototype.writeLineStringOrCurveMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML2.prototype.RING_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'outerBoundaryIs': makeChildAppender(GML2.prototype.writeRing_),\n 'innerBoundaryIs': makeChildAppender(GML2.prototype.writeRing_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML2.prototype.POINTMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'pointMember': makeChildAppender(GML2.prototype.writePointMember_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'surfaceMember': makeChildAppender(GML2.prototype.writeSurfaceOrPolygonMember_),\n 'polygonMember': makeChildAppender(GML2.prototype.writeSurfaceOrPolygonMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML2.prototype.ENVELOPE_SERIALIZERS_ = {\n 'http://www.opengis.net/gml': {\n 'lowerCorner': makeChildAppender(writeStringTextNode),\n 'upperCorner': makeChildAppender(writeStringTextNode)\n }\n};\nexport default GML2;\n//# sourceMappingURL=GML2.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/GML32\n */\nimport GML3 from './GML3.js';\nimport GMLBase from './GMLBase.js';\nimport { makeArrayPusher, makeReplacer, makeChildAppender } from '../xml.js';\nimport { writeStringTextNode } from '../format/xsd.js';\n/**\n * @classdesc Feature format for reading and writing data in the GML format\n * version 3.2.1.\n * @api\n */\nvar GML32 = /** @class */ (function (_super) {\n __extends(GML32, _super);\n /**\n * @param {import(\"./GMLBase.js\").Options=} opt_options Optional configuration object.\n */\n function GML32(opt_options) {\n var _this = this;\n var options = /** @type {import(\"./GMLBase.js\").Options} */ (opt_options ? opt_options : {});\n _this = _super.call(this, options) || this;\n /**\n * @inheritDoc\n */\n _this.schemaLocation = options.schemaLocation ?\n options.schemaLocation : _this.namespace + ' http://schemas.opengis.net/gml/3.2.1/gml.xsd';\n return _this;\n }\n return GML32;\n}(GML3));\nGML32.prototype.namespace = 'http://www.opengis.net/gml/3.2';\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML32.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {\n 'http://www.opengis.net/gml/3.2': {\n 'pos': makeReplacer(GML3.prototype.readFlatPos_),\n 'posList': makeReplacer(GML3.prototype.readFlatPosList_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML32.prototype.FLAT_LINEAR_RINGS_PARSERS = {\n 'http://www.opengis.net/gml/3.2': {\n 'interior': GML3.prototype.interiorParser_,\n 'exterior': GML3.prototype.exteriorParser_\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML32.prototype.GEOMETRY_PARSERS = {\n 'http://www.opengis.net/gml/3.2': {\n 'Point': makeReplacer(GMLBase.prototype.readPoint),\n 'MultiPoint': makeReplacer(GMLBase.prototype.readMultiPoint),\n 'LineString': makeReplacer(GMLBase.prototype.readLineString),\n 'MultiLineString': makeReplacer(GMLBase.prototype.readMultiLineString),\n 'LinearRing': makeReplacer(GMLBase.prototype.readLinearRing),\n 'Polygon': makeReplacer(GMLBase.prototype.readPolygon),\n 'MultiPolygon': makeReplacer(GMLBase.prototype.readMultiPolygon),\n 'Surface': makeReplacer(GML32.prototype.readSurface_),\n 'MultiSurface': makeReplacer(GML3.prototype.readMultiSurface_),\n 'Curve': makeReplacer(GML32.prototype.readCurve_),\n 'MultiCurve': makeReplacer(GML3.prototype.readMultiCurve_),\n 'Envelope': makeReplacer(GML32.prototype.readEnvelope_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.MULTICURVE_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'curveMember': makeArrayPusher(GML3.prototype.curveMemberParser_),\n 'curveMembers': makeArrayPusher(GML3.prototype.curveMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.MULTISURFACE_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'surfaceMember': makeArrayPusher(GML3.prototype.surfaceMemberParser_),\n 'surfaceMembers': makeArrayPusher(GML3.prototype.surfaceMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.CURVEMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'LineString': makeArrayPusher(GMLBase.prototype.readLineString),\n 'Curve': makeArrayPusher(GML3.prototype.readCurve_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.SURFACEMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon),\n 'Surface': makeArrayPusher(GML3.prototype.readSurface_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.SURFACE_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'patches': makeReplacer(GML3.prototype.readPatch_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.CURVE_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'segments': makeReplacer(GML3.prototype.readSegment_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.ENVELOPE_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'lowerCorner': makeArrayPusher(GML3.prototype.readFlatPosList_),\n 'upperCorner': makeArrayPusher(GML3.prototype.readFlatPosList_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.PATCHES_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'PolygonPatch': makeReplacer(GML3.prototype.readPolygonPatch_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.SEGMENTS_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'LineStringSegment': makeReplacer(GML3.prototype.readLineStringSegment_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.MULTIPOINT_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser_),\n 'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.MULTILINESTRING_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'lineStringMember': makeArrayPusher(GMLBase.prototype.lineStringMemberParser_),\n 'lineStringMembers': makeArrayPusher(GMLBase.prototype.lineStringMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.MULTIPOLYGON_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),\n 'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.POINTMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode_)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.LINESTRINGMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'LineString': makeArrayPusher(GMLBase.prototype.readLineString)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @private\n */\nGML32.prototype.POLYGONMEMBER_PARSERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n * @protected\n */\nGML32.prototype.RING_PARSERS = {\n 'http://www.opengis.net/gml/3.2': {\n 'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML32.prototype.RING_SERIALIZERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'exterior': makeChildAppender(GML3.prototype.writeRing_),\n 'interior': makeChildAppender(GML3.prototype.writeRing_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML32.prototype.ENVELOPE_SERIALIZERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'lowerCorner': makeChildAppender(writeStringTextNode),\n 'upperCorner': makeChildAppender(writeStringTextNode)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML32.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'surfaceMember': makeChildAppender(GML3.prototype.writeSurfaceOrPolygonMember_),\n 'polygonMember': makeChildAppender(GML3.prototype.writeSurfaceOrPolygonMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML32.prototype.POINTMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'pointMember': makeChildAppender(GML3.prototype.writePointMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML32.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'lineStringMember': makeChildAppender(GML3.prototype.writeLineStringOrCurveMember_),\n 'curveMember': makeChildAppender(GML3.prototype.writeLineStringOrCurveMember_)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n * @private\n */\nGML32.prototype.GEOMETRY_SERIALIZERS_ = {\n 'http://www.opengis.net/gml/3.2': {\n 'Curve': makeChildAppender(GML3.prototype.writeCurveOrLineString_),\n 'MultiCurve': makeChildAppender(GML3.prototype.writeMultiCurveOrLineString_),\n 'Point': makeChildAppender(GML32.prototype.writePoint_),\n 'MultiPoint': makeChildAppender(GML3.prototype.writeMultiPoint_),\n 'LineString': makeChildAppender(GML3.prototype.writeCurveOrLineString_),\n 'MultiLineString': makeChildAppender(GML3.prototype.writeMultiCurveOrLineString_),\n 'LinearRing': makeChildAppender(GML3.prototype.writeLinearRing_),\n 'Polygon': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),\n 'MultiPolygon': makeChildAppender(GML3.prototype.writeMultiSurfaceOrPolygon_),\n 'Surface': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),\n 'MultiSurface': makeChildAppender(GML3.prototype.writeMultiSurfaceOrPolygon_),\n 'Envelope': makeChildAppender(GML3.prototype.writeEnvelope)\n }\n};\nexport default GML32;\n//# sourceMappingURL=GML32.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/GPX\n */\nimport Feature from '../Feature.js';\nimport { includes } from '../array.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport XMLFeature from './XMLFeature.js';\nimport { readString, readDecimal, readNonNegativeInteger, readDateTime, writeStringTextNode, writeNonNegativeIntegerTextNode, writeDecimalTextNode, writeDateTimeTextNode } from './xsd.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport Point from '../geom/Point.js';\nimport { get as getProjection } from '../proj.js';\nimport { createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender, makeObjectPropertySetter, makeSequence, makeSimpleNodeFactory, makeStructureNS, OBJECT_PROPERTY_NODE_FACTORY, parseNode, pushParseAndPop, pushSerializeAndPop, XML_SCHEMA_INSTANCE_URI } from '../xml.js';\n/**\n * @const\n * @type {Array<null|string>}\n */\nvar NAMESPACE_URIS = [\n null,\n 'http://www.topografix.com/GPX/1/0',\n 'http://www.topografix.com/GPX/1/1'\n];\n/**\n * @const\n * @type {string}\n */\nvar SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +\n 'http://www.topografix.com/GPX/1/1/gpx.xsd';\n/**\n * @const\n * @type {Object<string, function(Node, Array<*>): (Feature|undefined)>}\n */\nvar FEATURE_READER = {\n 'rte': readRte,\n 'trk': readTrk,\n 'wpt': readWpt\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar GPX_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'rte': makeArrayPusher(readRte),\n 'trk': makeArrayPusher(readTrk),\n 'wpt': makeArrayPusher(readWpt)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LINK_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'text': makeObjectPropertySetter(readString, 'linkText'),\n 'type': makeObjectPropertySetter(readString, 'linkType')\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar GPX_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'rte': makeChildAppender(writeRte),\n 'trk': makeChildAppender(writeTrk),\n 'wpt': makeChildAppender(writeWpt)\n});\n/**\n * @typedef {Object} Options\n * @property {function(Feature, Node)} [readExtensions] Callback function\n * to process `extensions` nodes. To prevent memory leaks, this callback function must\n * not store any references to the node. Note that the `extensions`\n * node is not allowed in GPX 1.0. Moreover, only `extensions`\n * nodes from `wpt`, `rte` and `trk` can be processed, as those are\n * directly mapped to a feature.\n */\n/**\n * @typedef {Object} LayoutOptions\n * @property {boolean} [hasZ]\n * @property {boolean} [hasM]\n */\n/**\n * @classdesc\n * Feature format for reading and writing data in the GPX format.\n *\n * Note that {@link module:ol/format/GPX~GPX#readFeature} only reads the first\n * feature of the source.\n *\n * When reading, routes (`<rte>`) are converted into LineString geometries, and\n * tracks (`<trk>`) into MultiLineString. Any properties on route and track\n * waypoints are ignored.\n *\n * When writing, LineString geometries are output as routes (`<rte>`), and\n * MultiLineString as tracks (`<trk>`).\n *\n * @api\n */\nvar GPX = /** @class */ (function (_super) {\n __extends(GPX, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function GPX(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection('EPSG:4326');\n /**\n * @type {function(Feature, Node): void|undefined}\n * @private\n */\n _this.readExtensions_ = options.readExtensions;\n return _this;\n }\n /**\n * @param {Array<Feature>} features List of features.\n * @private\n */\n GPX.prototype.handleReadExtensions_ = function (features) {\n if (!features) {\n features = [];\n }\n for (var i = 0, ii = features.length; i < ii; ++i) {\n var feature = features[i];\n if (this.readExtensions_) {\n var extensionsNode = feature.get('extensionsNode_') || null;\n this.readExtensions_(feature, extensionsNode);\n }\n feature.set('extensionsNode_', undefined);\n }\n };\n /**\n * @inheritDoc\n */\n GPX.prototype.readFeatureFromNode = function (node, opt_options) {\n if (!includes(NAMESPACE_URIS, node.namespaceURI)) {\n return null;\n }\n var featureReader = FEATURE_READER[node.localName];\n if (!featureReader) {\n return null;\n }\n var feature = featureReader(node, [this.getReadOptions(node, opt_options)]);\n if (!feature) {\n return null;\n }\n this.handleReadExtensions_([feature]);\n return feature;\n };\n /**\n * @inheritDoc\n */\n GPX.prototype.readFeaturesFromNode = function (node, opt_options) {\n if (!includes(NAMESPACE_URIS, node.namespaceURI)) {\n return [];\n }\n if (node.localName == 'gpx') {\n /** @type {Array<Feature>} */\n var features = pushParseAndPop([], GPX_PARSERS, node, [this.getReadOptions(node, opt_options)]);\n if (features) {\n this.handleReadExtensions_(features);\n return features;\n }\n else {\n return [];\n }\n }\n return [];\n };\n /**\n * Encode an array of features in the GPX format as an XML node.\n * LineString geometries are output as routes (`<rte>`), and MultiLineString\n * as tracks (`<trk>`).\n *\n * @param {Array<Feature>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Node} Node.\n * @override\n * @api\n */\n GPX.prototype.writeFeaturesNode = function (features, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n //FIXME Serialize metadata\n var gpx = createElementNS('http://www.topografix.com/GPX/1/1', 'gpx');\n var xmlnsUri = 'http://www.w3.org/2000/xmlns/';\n gpx.setAttributeNS(xmlnsUri, 'xmlns:xsi', XML_SCHEMA_INSTANCE_URI);\n gpx.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', SCHEMA_LOCATION);\n gpx.setAttribute('version', '1.1');\n gpx.setAttribute('creator', 'OpenLayers');\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ ({ node: gpx }), GPX_SERIALIZERS, GPX_NODE_FACTORY, features, [opt_options]);\n return gpx;\n };\n return GPX;\n}(XMLFeature));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar RTE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'name': makeObjectPropertySetter(readString),\n 'cmt': makeObjectPropertySetter(readString),\n 'desc': makeObjectPropertySetter(readString),\n 'src': makeObjectPropertySetter(readString),\n 'link': parseLink,\n 'number': makeObjectPropertySetter(readNonNegativeInteger),\n 'extensions': parseExtensions,\n 'type': makeObjectPropertySetter(readString),\n 'rtept': parseRtePt\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar RTEPT_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ele': makeObjectPropertySetter(readDecimal),\n 'time': makeObjectPropertySetter(readDateTime)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TRK_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'name': makeObjectPropertySetter(readString),\n 'cmt': makeObjectPropertySetter(readString),\n 'desc': makeObjectPropertySetter(readString),\n 'src': makeObjectPropertySetter(readString),\n 'link': parseLink,\n 'number': makeObjectPropertySetter(readNonNegativeInteger),\n 'type': makeObjectPropertySetter(readString),\n 'extensions': parseExtensions,\n 'trkseg': parseTrkSeg\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TRKSEG_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'trkpt': parseTrkPt\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TRKPT_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ele': makeObjectPropertySetter(readDecimal),\n 'time': makeObjectPropertySetter(readDateTime)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar WPT_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ele': makeObjectPropertySetter(readDecimal),\n 'time': makeObjectPropertySetter(readDateTime),\n 'magvar': makeObjectPropertySetter(readDecimal),\n 'geoidheight': makeObjectPropertySetter(readDecimal),\n 'name': makeObjectPropertySetter(readString),\n 'cmt': makeObjectPropertySetter(readString),\n 'desc': makeObjectPropertySetter(readString),\n 'src': makeObjectPropertySetter(readString),\n 'link': parseLink,\n 'sym': makeObjectPropertySetter(readString),\n 'type': makeObjectPropertySetter(readString),\n 'fix': makeObjectPropertySetter(readString),\n 'sat': makeObjectPropertySetter(readNonNegativeInteger),\n 'hdop': makeObjectPropertySetter(readDecimal),\n 'vdop': makeObjectPropertySetter(readDecimal),\n 'pdop': makeObjectPropertySetter(readDecimal),\n 'ageofdgpsdata': makeObjectPropertySetter(readDecimal),\n 'dgpsid': makeObjectPropertySetter(readNonNegativeInteger),\n 'extensions': parseExtensions\n});\n/**\n * @const\n * @type {Array<string>}\n */\nvar LINK_SEQUENCE = ['text', 'type'];\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar LINK_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'text': makeChildAppender(writeStringTextNode),\n 'type': makeChildAppender(writeStringTextNode)\n});\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar RTE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'name', 'cmt', 'desc', 'src', 'link', 'number', 'type', 'rtept'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar RTE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'name': makeChildAppender(writeStringTextNode),\n 'cmt': makeChildAppender(writeStringTextNode),\n 'desc': makeChildAppender(writeStringTextNode),\n 'src': makeChildAppender(writeStringTextNode),\n 'link': makeChildAppender(writeLink),\n 'number': makeChildAppender(writeNonNegativeIntegerTextNode),\n 'type': makeChildAppender(writeStringTextNode),\n 'rtept': makeArraySerializer(makeChildAppender(writeWptType))\n});\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar RTEPT_TYPE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'ele', 'time'\n]);\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar TRK_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'name', 'cmt', 'desc', 'src', 'link', 'number', 'type', 'trkseg'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar TRK_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'name': makeChildAppender(writeStringTextNode),\n 'cmt': makeChildAppender(writeStringTextNode),\n 'desc': makeChildAppender(writeStringTextNode),\n 'src': makeChildAppender(writeStringTextNode),\n 'link': makeChildAppender(writeLink),\n 'number': makeChildAppender(writeNonNegativeIntegerTextNode),\n 'type': makeChildAppender(writeStringTextNode),\n 'trkseg': makeArraySerializer(makeChildAppender(writeTrkSeg))\n});\n/**\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar TRKSEG_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'trkpt': makeChildAppender(writeWptType)\n});\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar WPT_TYPE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'ele', 'time', 'magvar', 'geoidheight', 'name', 'cmt', 'desc', 'src',\n 'link', 'sym', 'type', 'fix', 'sat', 'hdop', 'vdop', 'pdop',\n 'ageofdgpsdata', 'dgpsid'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar WPT_TYPE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'ele': makeChildAppender(writeDecimalTextNode),\n 'time': makeChildAppender(writeDateTimeTextNode),\n 'magvar': makeChildAppender(writeDecimalTextNode),\n 'geoidheight': makeChildAppender(writeDecimalTextNode),\n 'name': makeChildAppender(writeStringTextNode),\n 'cmt': makeChildAppender(writeStringTextNode),\n 'desc': makeChildAppender(writeStringTextNode),\n 'src': makeChildAppender(writeStringTextNode),\n 'link': makeChildAppender(writeLink),\n 'sym': makeChildAppender(writeStringTextNode),\n 'type': makeChildAppender(writeStringTextNode),\n 'fix': makeChildAppender(writeStringTextNode),\n 'sat': makeChildAppender(writeNonNegativeIntegerTextNode),\n 'hdop': makeChildAppender(writeDecimalTextNode),\n 'vdop': makeChildAppender(writeDecimalTextNode),\n 'pdop': makeChildAppender(writeDecimalTextNode),\n 'ageofdgpsdata': makeChildAppender(writeDecimalTextNode),\n 'dgpsid': makeChildAppender(writeNonNegativeIntegerTextNode)\n});\n/**\n * @const\n * @type {Object<string, string>}\n */\nvar GEOMETRY_TYPE_TO_NODENAME = {\n 'Point': 'wpt',\n 'LineString': 'rte',\n 'MultiLineString': 'trk'\n};\n/**\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node|undefined} Node.\n */\nfunction GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {\n var geometry = /** @type {Feature} */ (value).getGeometry();\n if (geometry) {\n var nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()];\n if (nodeName) {\n var parentNode = objectStack[objectStack.length - 1].node;\n return createElementNS(parentNode.namespaceURI, nodeName);\n }\n }\n}\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {LayoutOptions} layoutOptions Layout options.\n * @param {Element} node Node.\n * @param {!Object} values Values.\n * @return {Array<number>} Flat coordinates.\n */\nfunction appendCoordinate(flatCoordinates, layoutOptions, node, values) {\n flatCoordinates.push(parseFloat(node.getAttribute('lon')), parseFloat(node.getAttribute('lat')));\n if ('ele' in values) {\n flatCoordinates.push(/** @type {number} */ (values['ele']));\n delete values['ele'];\n layoutOptions.hasZ = true;\n }\n else {\n flatCoordinates.push(0);\n }\n if ('time' in values) {\n flatCoordinates.push(/** @type {number} */ (values['time']));\n delete values['time'];\n layoutOptions.hasM = true;\n }\n else {\n flatCoordinates.push(0);\n }\n return flatCoordinates;\n}\n/**\n * Choose GeometryLayout based on flags in layoutOptions and adjust flatCoordinates\n * and ends arrays by shrinking them accordingly (removing unused zero entries).\n *\n * @param {LayoutOptions} layoutOptions Layout options.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {Array<number>=} ends Ends.\n * @return {GeometryLayout} Layout.\n */\nfunction applyLayoutOptions(layoutOptions, flatCoordinates, ends) {\n var layout = GeometryLayout.XY;\n var stride = 2;\n if (layoutOptions.hasZ && layoutOptions.hasM) {\n layout = GeometryLayout.XYZM;\n stride = 4;\n }\n else if (layoutOptions.hasZ) {\n layout = GeometryLayout.XYZ;\n stride = 3;\n }\n else if (layoutOptions.hasM) {\n layout = GeometryLayout.XYM;\n stride = 3;\n }\n if (stride !== 4) {\n for (var i = 0, ii = flatCoordinates.length / 4; i < ii; i++) {\n flatCoordinates[i * stride] = flatCoordinates[i * 4];\n flatCoordinates[i * stride + 1] = flatCoordinates[i * 4 + 1];\n if (layoutOptions.hasZ) {\n flatCoordinates[i * stride + 2] = flatCoordinates[i * 4 + 2];\n }\n if (layoutOptions.hasM) {\n flatCoordinates[i * stride + 2] = flatCoordinates[i * 4 + 3];\n }\n }\n flatCoordinates.length = flatCoordinates.length / 4 * stride;\n if (ends) {\n for (var i = 0, ii = ends.length; i < ii; i++) {\n ends[i] = ends[i] / 4 * stride;\n }\n }\n }\n return layout;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction parseLink(node, objectStack) {\n var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var href = node.getAttribute('href');\n if (href !== null) {\n values['link'] = href;\n }\n parseNode(LINK_PARSERS, node, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction parseExtensions(node, objectStack) {\n var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n values['extensionsNode_'] = node;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction parseRtePt(node, objectStack) {\n var values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);\n if (values) {\n var rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);\n var flatCoordinates = /** @type {Array<number>} */ (rteValues['flatCoordinates']);\n var layoutOptions = /** @type {LayoutOptions} */ (rteValues['layoutOptions']);\n appendCoordinate(flatCoordinates, layoutOptions, node, values);\n }\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction parseTrkPt(node, objectStack) {\n var values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);\n if (values) {\n var trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);\n var flatCoordinates = /** @type {Array<number>} */ (trkValues['flatCoordinates']);\n var layoutOptions = /** @type {LayoutOptions} */ (trkValues['layoutOptions']);\n appendCoordinate(flatCoordinates, layoutOptions, node, values);\n }\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction parseTrkSeg(node, objectStack) {\n var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n parseNode(TRKSEG_PARSERS, node, objectStack);\n var flatCoordinates = /** @type {Array<number>} */ (values['flatCoordinates']);\n var ends = /** @type {Array<number>} */ (values['ends']);\n ends.push(flatCoordinates.length);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Feature|undefined} Track.\n */\nfunction readRte(node, objectStack) {\n var options = /** @type {import(\"./Feature.js\").ReadOptions} */ (objectStack[0]);\n var values = pushParseAndPop({\n 'flatCoordinates': [],\n 'layoutOptions': {}\n }, RTE_PARSERS, node, objectStack);\n if (!values) {\n return undefined;\n }\n var flatCoordinates = /** @type {Array<number>} */ (values['flatCoordinates']);\n delete values['flatCoordinates'];\n var layoutOptions = /** @type {LayoutOptions} */ (values['layoutOptions']);\n delete values['layoutOptions'];\n var layout = applyLayoutOptions(layoutOptions, flatCoordinates);\n var geometry = new LineString(flatCoordinates, layout);\n transformGeometryWithOptions(geometry, false, options);\n var feature = new Feature(geometry);\n feature.setProperties(values, true);\n return feature;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Feature|undefined} Track.\n */\nfunction readTrk(node, objectStack) {\n var options = /** @type {import(\"./Feature.js\").ReadOptions} */ (objectStack[0]);\n var values = pushParseAndPop({\n 'flatCoordinates': [],\n 'ends': [],\n 'layoutOptions': {}\n }, TRK_PARSERS, node, objectStack);\n if (!values) {\n return undefined;\n }\n var flatCoordinates = /** @type {Array<number>} */ (values['flatCoordinates']);\n delete values['flatCoordinates'];\n var ends = /** @type {Array<number>} */ (values['ends']);\n delete values['ends'];\n var layoutOptions = /** @type {LayoutOptions} */ (values['layoutOptions']);\n delete values['layoutOptions'];\n var layout = applyLayoutOptions(layoutOptions, flatCoordinates, ends);\n var geometry = new MultiLineString(flatCoordinates, layout, ends);\n transformGeometryWithOptions(geometry, false, options);\n var feature = new Feature(geometry);\n feature.setProperties(values, true);\n return feature;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Feature|undefined} Waypoint.\n */\nfunction readWpt(node, objectStack) {\n var options = /** @type {import(\"./Feature.js\").ReadOptions} */ (objectStack[0]);\n var values = pushParseAndPop({}, WPT_PARSERS, node, objectStack);\n if (!values) {\n return undefined;\n }\n var layoutOptions = /** @type {LayoutOptions} */ ({});\n var coordinates = appendCoordinate([], layoutOptions, node, values);\n var layout = applyLayoutOptions(layoutOptions, coordinates);\n var geometry = new Point(coordinates, layout);\n transformGeometryWithOptions(geometry, false, options);\n var feature = new Feature(geometry);\n feature.setProperties(values, true);\n return feature;\n}\n/**\n * @param {Element} node Node.\n * @param {string} value Value for the link's `href` attribute.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeLink(node, value, objectStack) {\n node.setAttribute('href', value);\n var context = objectStack[objectStack.length - 1];\n var properties = context['properties'];\n var link = [\n properties['linkText'],\n properties['linkType']\n ];\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ ({ node: node }), LINK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, link, objectStack, LINK_SEQUENCE);\n}\n/**\n * @param {Element} node Node.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeWptType(node, coordinate, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var parentNode = context.node;\n var namespaceURI = parentNode.namespaceURI;\n var properties = context['properties'];\n //FIXME Projection handling\n node.setAttributeNS(null, 'lat', String(coordinate[1]));\n node.setAttributeNS(null, 'lon', String(coordinate[0]));\n var geometryLayout = context['geometryLayout'];\n switch (geometryLayout) {\n case GeometryLayout.XYZM:\n if (coordinate[3] !== 0) {\n properties['time'] = coordinate[3];\n }\n // fall through\n case GeometryLayout.XYZ:\n if (coordinate[2] !== 0) {\n properties['ele'] = coordinate[2];\n }\n break;\n case GeometryLayout.XYM:\n if (coordinate[2] !== 0) {\n properties['time'] = coordinate[2];\n }\n break;\n default:\n // pass\n }\n var orderedKeys = (node.nodeName == 'rtept') ?\n RTEPT_TYPE_SEQUENCE[namespaceURI] :\n WPT_TYPE_SEQUENCE[namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ ({ node: node, 'properties': properties }), WPT_TYPE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @param {Node} node Node.\n * @param {Feature} feature Feature.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeRte(node, feature, objectStack) {\n var options = /** @type {import(\"./Feature.js\").WriteOptions} */ (objectStack[0]);\n var properties = feature.getProperties();\n var context = { node: node };\n context['properties'] = properties;\n var geometry = feature.getGeometry();\n if (geometry.getType() == GeometryType.LINE_STRING) {\n var lineString = /** @type {LineString} */ (transformGeometryWithOptions(geometry, true, options));\n context['geometryLayout'] = lineString.getLayout();\n properties['rtept'] = lineString.getCoordinates();\n }\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = RTE_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, RTE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @param {Node} node Node.\n * @param {Feature} feature Feature.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeTrk(node, feature, objectStack) {\n var options = /** @type {import(\"./Feature.js\").WriteOptions} */ (objectStack[0]);\n var properties = feature.getProperties();\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var context = { node: node };\n context['properties'] = properties;\n var geometry = feature.getGeometry();\n if (geometry.getType() == GeometryType.MULTI_LINE_STRING) {\n var multiLineString = /** @type {MultiLineString} */ (transformGeometryWithOptions(geometry, true, options));\n properties['trkseg'] = multiLineString.getLineStrings();\n }\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = TRK_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, TRK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @param {Node} node Node.\n * @param {LineString} lineString LineString.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeTrkSeg(node, lineString, objectStack) {\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var context = { node: node };\n context['geometryLayout'] = lineString.getLayout();\n context['properties'] = {};\n pushSerializeAndPop(context, TRKSEG_SERIALIZERS, TRKSEG_NODE_FACTORY, lineString.getCoordinates(), objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Feature} feature Feature.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeWpt(node, feature, objectStack) {\n var options = /** @type {import(\"./Feature.js\").WriteOptions} */ (objectStack[0]);\n var context = objectStack[objectStack.length - 1];\n context['properties'] = feature.getProperties();\n var geometry = feature.getGeometry();\n if (geometry.getType() == GeometryType.POINT) {\n var point = /** @type {Point} */ (transformGeometryWithOptions(geometry, true, options));\n context['geometryLayout'] = point.getLayout();\n writeWptType(node, point.getCoordinates(), objectStack);\n }\n}\nexport default GPX;\n//# sourceMappingURL=GPX.js.map","/**\n * @module ol/format/GeoJSON\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { assert } from '../asserts.js';\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport JSONFeature from './JSONFeature.js';\nimport GeometryCollection from '../geom/GeometryCollection.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { assign, isEmpty } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\nimport GeometryType from '../geom/GeometryType.js';\n/**\n * @typedef {import(\"geojson\").GeoJSON} GeoJSONObject\n * @typedef {import(\"geojson\").Feature} GeoJSONFeature\n * @typedef {import(\"geojson\").FeatureCollection} GeoJSONFeatureCollection\n * @typedef {import(\"geojson\").Geometry} GeoJSONGeometry\n * @typedef {import(\"geojson\").Point} GeoJSONPoint\n * @typedef {import(\"geojson\").LineString} GeoJSONLineString\n * @typedef {import(\"geojson\").Polygon} GeoJSONPolygon\n * @typedef {import(\"geojson\").MultiPoint} GeoJSONMultiPoint\n * @typedef {import(\"geojson\").MultiLineString} GeoJSONMultiLineString\n * @typedef {import(\"geojson\").MultiPolygon} GeoJSONMultiPolygon\n * @typedef {import(\"geojson\").GeometryCollection} GeoJSONGeometryCollection\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../proj.js\").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.\n * @property {import(\"../proj.js\").ProjectionLike} [featureProjection] Projection for features read or\n * written by the format. Options passed to read or write methods will take precedence.\n * @property {string} [geometryName] Geometry name to use when creating features.\n * @property {boolean} [extractGeometryName=false] Certain GeoJSON providers include\n * the geometry_name field in the feature GeoJSON. If set to `true` the GeoJSON reader\n * will look for that field to set the geometry name. If both this field is set to `true`\n * and a `geometryName` is provided, the `geometryName` will take precedence.\n */\n/**\n * @classdesc\n * Feature format for reading and writing data in the GeoJSON format.\n *\n * @api\n */\nvar GeoJSON = /** @class */ (function (_super) {\n __extends(GeoJSON, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function GeoJSON(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this) || this;\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection(options.dataProjection ?\n options.dataProjection : 'EPSG:4326');\n if (options.featureProjection) {\n _this.defaultFeatureProjection = getProjection(options.featureProjection);\n }\n /**\n * Name of the geometry attribute for features.\n * @type {string|undefined}\n * @private\n */\n _this.geometryName_ = options.geometryName;\n /**\n * Look for the geometry name in the feature GeoJSON\n * @type {boolean|undefined}\n * @private\n */\n _this.extractGeometryName_ = options.extractGeometryName;\n return _this;\n }\n /**\n * @inheritDoc\n */\n GeoJSON.prototype.readFeatureFromObject = function (object, opt_options) {\n /**\n * @type {GeoJSONFeature}\n */\n var geoJSONFeature = null;\n if (object['type'] === 'Feature') {\n geoJSONFeature = /** @type {GeoJSONFeature} */ (object);\n }\n else {\n geoJSONFeature = {\n 'type': 'Feature',\n 'geometry': /** @type {GeoJSONGeometry} */ (object),\n 'properties': null\n };\n }\n var geometry = readGeometry(geoJSONFeature['geometry'], opt_options);\n var feature = new Feature();\n if (this.geometryName_) {\n feature.setGeometryName(this.geometryName_);\n }\n else if (this.extractGeometryName_ && 'geometry_name' in geoJSONFeature !== undefined) {\n feature.setGeometryName(geoJSONFeature['geometry_name']);\n }\n feature.setGeometry(geometry);\n if ('id' in geoJSONFeature) {\n feature.setId(geoJSONFeature['id']);\n }\n if (geoJSONFeature['properties']) {\n feature.setProperties(geoJSONFeature['properties'], true);\n }\n return feature;\n };\n /**\n * @inheritDoc\n */\n GeoJSON.prototype.readFeaturesFromObject = function (object, opt_options) {\n var geoJSONObject = /** @type {GeoJSONObject} */ (object);\n /** @type {Array<import(\"../Feature.js\").default>} */\n var features = null;\n if (geoJSONObject['type'] === 'FeatureCollection') {\n var geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);\n features = [];\n var geoJSONFeatures = geoJSONFeatureCollection['features'];\n for (var i = 0, ii = geoJSONFeatures.length; i < ii; ++i) {\n features.push(this.readFeatureFromObject(geoJSONFeatures[i], opt_options));\n }\n }\n else {\n features = [this.readFeatureFromObject(object, opt_options)];\n }\n return features;\n };\n /**\n * @inheritDoc\n */\n GeoJSON.prototype.readGeometryFromObject = function (object, opt_options) {\n return readGeometry(/** @type {GeoJSONGeometry} */ (object), opt_options);\n };\n /**\n * @inheritDoc\n */\n GeoJSON.prototype.readProjectionFromObject = function (object) {\n var crs = object['crs'];\n var projection;\n if (crs) {\n if (crs['type'] == 'name') {\n projection = getProjection(crs['properties']['name']);\n }\n else {\n assert(false, 36); // Unknown SRS type\n }\n }\n else {\n projection = this.dataProjection;\n }\n return (\n /** @type {import(\"../proj/Projection.js\").default} */ (projection));\n };\n /**\n * Encode a feature as a GeoJSON Feature object.\n *\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONFeature} Object.\n * @override\n * @api\n */\n GeoJSON.prototype.writeFeatureObject = function (feature, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n /** @type {GeoJSONFeature} */\n var object = {\n 'type': 'Feature',\n geometry: null,\n properties: null\n };\n var id = feature.getId();\n if (id !== undefined) {\n object.id = id;\n }\n var geometry = feature.getGeometry();\n if (geometry) {\n object.geometry = writeGeometry(geometry, opt_options);\n }\n var properties = feature.getProperties();\n delete properties[feature.getGeometryName()];\n if (!isEmpty(properties)) {\n object.properties = properties;\n }\n return object;\n };\n /**\n * Encode an array of features as a GeoJSON object.\n *\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONFeatureCollection} GeoJSON Object.\n * @override\n * @api\n */\n GeoJSON.prototype.writeFeaturesObject = function (features, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n var objects = [];\n for (var i = 0, ii = features.length; i < ii; ++i) {\n objects.push(this.writeFeatureObject(features[i], opt_options));\n }\n return {\n type: 'FeatureCollection',\n features: objects\n };\n };\n /**\n * Encode a geometry as a GeoJSON object.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.\n * @override\n * @api\n */\n GeoJSON.prototype.writeGeometryObject = function (geometry, opt_options) {\n return writeGeometry(geometry, this.adaptOptions(opt_options));\n };\n return GeoJSON;\n}(JSONFeature));\n/**\n * @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\nfunction readGeometry(object, opt_options) {\n if (!object) {\n return null;\n }\n /**\n * @type {import(\"../geom/Geometry.js\").default}\n */\n var geometry;\n switch (object['type']) {\n case GeometryType.POINT: {\n geometry = readPointGeometry(/** @type {GeoJSONPoint} */ (object));\n break;\n }\n case GeometryType.LINE_STRING: {\n geometry = readLineStringGeometry(/** @type {GeoJSONLineString} */ (object));\n break;\n }\n case GeometryType.POLYGON: {\n geometry = readPolygonGeometry(/** @type {GeoJSONPolygon} */ (object));\n break;\n }\n case GeometryType.MULTI_POINT: {\n geometry = readMultiPointGeometry(/** @type {GeoJSONMultiPoint} */ (object));\n break;\n }\n case GeometryType.MULTI_LINE_STRING: {\n geometry = readMultiLineStringGeometry(/** @type {GeoJSONMultiLineString} */ (object));\n break;\n }\n case GeometryType.MULTI_POLYGON: {\n geometry = readMultiPolygonGeometry(/** @type {GeoJSONMultiPolygon} */ (object));\n break;\n }\n case GeometryType.GEOMETRY_COLLECTION: {\n geometry = readGeometryCollectionGeometry(/** @type {GeoJSONGeometryCollection} */ (object));\n break;\n }\n default: {\n throw new Error('Unsupported GeoJSON type: ' + object.type);\n }\n }\n return transformGeometryWithOptions(geometry, false, opt_options);\n}\n/**\n * @param {GeoJSONGeometryCollection} object Object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {GeometryCollection} Geometry collection.\n */\nfunction readGeometryCollectionGeometry(object, opt_options) {\n var geometries = object['geometries'].map(\n /**\n * @param {GeoJSONGeometry} geometry Geometry.\n * @return {import(\"../geom/Geometry.js\").default} geometry Geometry.\n */\n function (geometry) {\n return readGeometry(geometry, opt_options);\n });\n return new GeometryCollection(geometries);\n}\n/**\n * @param {GeoJSONPoint} object Object.\n * @return {Point} Point.\n */\nfunction readPointGeometry(object) {\n return new Point(object['coordinates']);\n}\n/**\n * @param {GeoJSONLineString} object Object.\n * @return {LineString} LineString.\n */\nfunction readLineStringGeometry(object) {\n return new LineString(object['coordinates']);\n}\n/**\n * @param {GeoJSONMultiLineString} object Object.\n * @return {MultiLineString} MultiLineString.\n */\nfunction readMultiLineStringGeometry(object) {\n return new MultiLineString(object['coordinates']);\n}\n/**\n * @param {GeoJSONMultiPoint} object Object.\n * @return {MultiPoint} MultiPoint.\n */\nfunction readMultiPointGeometry(object) {\n return new MultiPoint(object['coordinates']);\n}\n/**\n * @param {GeoJSONMultiPolygon} object Object.\n * @return {MultiPolygon} MultiPolygon.\n */\nfunction readMultiPolygonGeometry(object) {\n return new MultiPolygon(object['coordinates']);\n}\n/**\n * @param {GeoJSONPolygon} object Object.\n * @return {Polygon} Polygon.\n */\nfunction readPolygonGeometry(object) {\n return new Polygon(object['coordinates']);\n}\n/**\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writeGeometry(geometry, opt_options) {\n geometry = transformGeometryWithOptions(geometry, true, opt_options);\n var type = geometry.getType();\n /** @type {GeoJSONGeometry} */\n var geoJSON;\n switch (type) {\n case GeometryType.POINT: {\n geoJSON = writePointGeometry(/** @type {Point} */ (geometry), opt_options);\n break;\n }\n case GeometryType.LINE_STRING: {\n geoJSON = writeLineStringGeometry(/** @type {LineString} */ (geometry), opt_options);\n break;\n }\n case GeometryType.POLYGON: {\n geoJSON = writePolygonGeometry(/** @type {Polygon} */ (geometry), opt_options);\n break;\n }\n case GeometryType.MULTI_POINT: {\n geoJSON = writeMultiPointGeometry(/** @type {MultiPoint} */ (geometry), opt_options);\n break;\n }\n case GeometryType.MULTI_LINE_STRING: {\n geoJSON = writeMultiLineStringGeometry(/** @type {MultiLineString} */ (geometry), opt_options);\n break;\n }\n case GeometryType.MULTI_POLYGON: {\n geoJSON = writeMultiPolygonGeometry(/** @type {MultiPolygon} */ (geometry), opt_options);\n break;\n }\n case GeometryType.GEOMETRY_COLLECTION: {\n geoJSON = writeGeometryCollectionGeometry(/** @type {GeometryCollection} */ (geometry), opt_options);\n break;\n }\n case GeometryType.CIRCLE: {\n geoJSON = {\n type: 'GeometryCollection',\n geometries: []\n };\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return geoJSON;\n}\n/**\n * @param {GeometryCollection} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometryCollection} GeoJSON geometry collection.\n */\nfunction writeGeometryCollectionGeometry(geometry, opt_options) {\n var geometries = geometry.getGeometriesArray().map(function (geometry) {\n var options = assign({}, opt_options);\n delete options.featureProjection;\n return writeGeometry(geometry, options);\n });\n return {\n type: 'GeometryCollection',\n geometries: geometries\n };\n}\n/**\n * @param {LineString} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writeLineStringGeometry(geometry, opt_options) {\n return {\n type: 'LineString',\n coordinates: geometry.getCoordinates()\n };\n}\n/**\n * @param {MultiLineString} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writeMultiLineStringGeometry(geometry, opt_options) {\n return {\n type: 'MultiLineString',\n coordinates: geometry.getCoordinates()\n };\n}\n/**\n * @param {MultiPoint} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writeMultiPointGeometry(geometry, opt_options) {\n return {\n type: 'MultiPoint',\n coordinates: geometry.getCoordinates()\n };\n}\n/**\n * @param {MultiPolygon} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writeMultiPolygonGeometry(geometry, opt_options) {\n var right;\n if (opt_options) {\n right = opt_options.rightHanded;\n }\n return {\n type: 'MultiPolygon',\n coordinates: geometry.getCoordinates(right)\n };\n}\n/**\n * @param {Point} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writePointGeometry(geometry, opt_options) {\n return {\n type: 'Point',\n coordinates: geometry.getCoordinates()\n };\n}\n/**\n * @param {Polygon} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {GeoJSONGeometry} GeoJSON geometry.\n */\nfunction writePolygonGeometry(geometry, opt_options) {\n var right;\n if (opt_options) {\n right = opt_options.rightHanded;\n }\n return {\n type: 'Polygon',\n coordinates: geometry.getCoordinates(right)\n };\n}\nexport default GeoJSON;\n//# sourceMappingURL=GeoJSON.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/TextFeature\n */\nimport { abstract } from '../util.js';\nimport FeatureFormat from '../format/Feature.js';\nimport FormatType from '../format/FormatType.js';\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for text feature formats.\n *\n * @abstract\n */\nvar TextFeature = /** @class */ (function (_super) {\n __extends(TextFeature, _super);\n function TextFeature() {\n return _super.call(this) || this;\n }\n /**\n * @inheritDoc\n */\n TextFeature.prototype.getType = function () {\n return FormatType.TEXT;\n };\n /**\n * Read the feature from the source.\n *\n * @param {Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../Feature.js\").default} Feature.\n * @api\n */\n TextFeature.prototype.readFeature = function (source, opt_options) {\n return this.readFeatureFromText(getText(source), this.adaptOptions(opt_options));\n };\n /**\n * @abstract\n * @param {string} text Text.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @protected\n * @return {import(\"../Feature.js\").default} Feature.\n */\n TextFeature.prototype.readFeatureFromText = function (text, opt_options) {\n return abstract();\n };\n /**\n * Read the features from the source.\n *\n * @param {Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {Array<import(\"../Feature.js\").default>} Features.\n * @api\n */\n TextFeature.prototype.readFeatures = function (source, opt_options) {\n return this.readFeaturesFromText(getText(source), this.adaptOptions(opt_options));\n };\n /**\n * @abstract\n * @param {string} text Text.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @protected\n * @return {Array<import(\"../Feature.js\").default>} Features.\n */\n TextFeature.prototype.readFeaturesFromText = function (text, opt_options) {\n return abstract();\n };\n /**\n * Read the geometry from the source.\n *\n * @param {Document|Node|Object|string} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n * @api\n */\n TextFeature.prototype.readGeometry = function (source, opt_options) {\n return this.readGeometryFromText(getText(source), this.adaptOptions(opt_options));\n };\n /**\n * @abstract\n * @param {string} text Text.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @protected\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\n TextFeature.prototype.readGeometryFromText = function (text, opt_options) {\n return abstract();\n };\n /**\n * Read the projection from the source.\n *\n * @param {Document|Node|Object|string} source Source.\n * @return {import(\"../proj/Projection.js\").default} Projection.\n * @api\n */\n TextFeature.prototype.readProjection = function (source) {\n return this.readProjectionFromText(getText(source));\n };\n /**\n * @param {string} text Text.\n * @protected\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n TextFeature.prototype.readProjectionFromText = function (text) {\n return this.dataProjection;\n };\n /**\n * Encode a feature as a string.\n *\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Encoded feature.\n * @api\n */\n TextFeature.prototype.writeFeature = function (feature, opt_options) {\n return this.writeFeatureText(feature, this.adaptOptions(opt_options));\n };\n /**\n * @abstract\n * @param {import(\"../Feature.js\").default} feature Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @protected\n * @return {string} Text.\n */\n TextFeature.prototype.writeFeatureText = function (feature, opt_options) {\n return abstract();\n };\n /**\n * Encode an array of features as string.\n *\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Encoded features.\n * @api\n */\n TextFeature.prototype.writeFeatures = function (features, opt_options) {\n return this.writeFeaturesText(features, this.adaptOptions(opt_options));\n };\n /**\n * @abstract\n * @param {Array<import(\"../Feature.js\").default>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @protected\n * @return {string} Text.\n */\n TextFeature.prototype.writeFeaturesText = function (features, opt_options) {\n return abstract();\n };\n /**\n * Write a single geometry.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @return {string} Geometry.\n * @api\n */\n TextFeature.prototype.writeGeometry = function (geometry, opt_options) {\n return this.writeGeometryText(geometry, this.adaptOptions(opt_options));\n };\n /**\n * @abstract\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Write options.\n * @protected\n * @return {string} Text.\n */\n TextFeature.prototype.writeGeometryText = function (geometry, opt_options) {\n return abstract();\n };\n return TextFeature;\n}(FeatureFormat));\n/**\n * @param {Document|Node|Object|string} source Source.\n * @return {string} Text.\n */\nfunction getText(source) {\n if (typeof source === 'string') {\n return source;\n }\n else {\n return '';\n }\n}\nexport default TextFeature;\n//# sourceMappingURL=TextFeature.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/KML\n */\nimport Feature from '../Feature.js';\nimport { extend, includes } from '../array.js';\nimport { assert } from '../asserts.js';\nimport { asArray } from '../color.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport XMLFeature from './XMLFeature.js';\nimport { readDecimal, readBoolean, readString, writeStringTextNode, writeCDATASection, writeDecimalTextNode, writeBooleanTextNode } from './xsd.js';\nimport GeometryCollection from '../geom/GeometryCollection.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { toRadians } from '../math.js';\nimport { get as getProjection } from '../proj.js';\nimport Fill from '../style/Fill.js';\nimport Icon from '../style/Icon.js';\nimport IconAnchorUnits from '../style/IconAnchorUnits.js';\nimport IconOrigin from '../style/IconOrigin.js';\nimport Stroke from '../style/Stroke.js';\nimport Style from '../style/Style.js';\nimport Text from '../style/Text.js';\nimport { createElementNS, getAllTextContent, isDocument, makeArrayExtender, makeArrayPusher, makeChildAppender, makeObjectPropertySetter, makeReplacer, makeSequence, makeSimpleNodeFactory, makeStructureNS, OBJECT_PROPERTY_NODE_FACTORY, parse, parseNode, pushParseAndPop, pushSerializeAndPop, XML_SCHEMA_INSTANCE_URI } from '../xml.js';\n/**\n * @typedef {Object} Vec2\n * @property {number} x\n * @property {IconAnchorUnits} xunits\n * @property {number} y\n * @property {IconAnchorUnits} yunits\n * @property {IconOrigin} origin\n */\n/**\n * @typedef {Object} GxTrackObject\n * @property {Array<number>} flatCoordinates\n * @property {Array<number>} whens\n */\n/**\n * @const\n * @type {Array<string>}\n */\nvar GX_NAMESPACE_URIS = [\n 'http://www.google.com/kml/ext/2.2'\n];\n/**\n * @const\n * @type {Array<null|string>}\n */\nvar NAMESPACE_URIS = [\n null,\n 'http://earth.google.com/kml/2.0',\n 'http://earth.google.com/kml/2.1',\n 'http://earth.google.com/kml/2.2',\n 'http://www.opengis.net/kml/2.2'\n];\n/**\n * @const\n * @type {string}\n */\nvar SCHEMA_LOCATION = 'http://www.opengis.net/kml/2.2 ' +\n 'https://developers.google.com/kml/schema/kml22gx.xsd';\n/**\n * @type {Object<string, IconAnchorUnits>}\n */\nvar ICON_ANCHOR_UNITS_MAP = {\n 'fraction': IconAnchorUnits.FRACTION,\n 'pixels': IconAnchorUnits.PIXELS,\n 'insetPixels': IconAnchorUnits.PIXELS\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PLACEMARK_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ExtendedData': extendedDataParser,\n 'Region': regionParser,\n 'MultiGeometry': makeObjectPropertySetter(readMultiGeometry, 'geometry'),\n 'LineString': makeObjectPropertySetter(readLineString, 'geometry'),\n 'LinearRing': makeObjectPropertySetter(readLinearRing, 'geometry'),\n 'Point': makeObjectPropertySetter(readPoint, 'geometry'),\n 'Polygon': makeObjectPropertySetter(readPolygon, 'geometry'),\n 'Style': makeObjectPropertySetter(readStyle),\n 'StyleMap': placemarkStyleMapParser,\n 'address': makeObjectPropertySetter(readString),\n 'description': makeObjectPropertySetter(readString),\n 'name': makeObjectPropertySetter(readString),\n 'open': makeObjectPropertySetter(readBoolean),\n 'phoneNumber': makeObjectPropertySetter(readString),\n 'styleUrl': makeObjectPropertySetter(readURI),\n 'visibility': makeObjectPropertySetter(readBoolean)\n}, makeStructureNS(GX_NAMESPACE_URIS, {\n 'MultiTrack': makeObjectPropertySetter(readGxMultiTrack, 'geometry'),\n 'Track': makeObjectPropertySetter(readGxTrack, 'geometry')\n}));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar NETWORK_LINK_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ExtendedData': extendedDataParser,\n 'Region': regionParser,\n 'Link': linkParser,\n 'address': makeObjectPropertySetter(readString),\n 'description': makeObjectPropertySetter(readString),\n 'name': makeObjectPropertySetter(readString),\n 'open': makeObjectPropertySetter(readBoolean),\n 'phoneNumber': makeObjectPropertySetter(readString),\n 'visibility': makeObjectPropertySetter(readBoolean)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LINK_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'href': makeObjectPropertySetter(readURI)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar REGION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'LatLonAltBox': latLonAltBoxParser,\n 'Lod': lodParser\n});\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar KML_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'Document', 'Placemark'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar KML_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'Document': makeChildAppender(writeDocument),\n 'Placemark': makeChildAppender(writePlacemark)\n});\n/**\n * @type {import(\"../color.js\").Color}\n */\nvar DEFAULT_COLOR;\n/**\n * @type {Fill}\n */\nvar DEFAULT_FILL_STYLE = null;\n/**\n * Get the default fill style (or null if not yet set).\n * @return {Fill} The default fill style.\n */\nexport function getDefaultFillStyle() {\n return DEFAULT_FILL_STYLE;\n}\n/**\n * @type {import(\"../size.js\").Size}\n */\nvar DEFAULT_IMAGE_STYLE_ANCHOR;\n/**\n * @type {IconAnchorUnits}\n */\nvar DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS;\n/**\n * @type {IconAnchorUnits}\n */\nvar DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS;\n/**\n * @type {import(\"../size.js\").Size}\n */\nvar DEFAULT_IMAGE_STYLE_SIZE;\n/**\n * @type {string}\n */\nvar DEFAULT_IMAGE_STYLE_SRC;\n/**\n * @type {number}\n */\nvar DEFAULT_IMAGE_SCALE_MULTIPLIER;\n/**\n * @type {import(\"../style/Image.js\").default}\n */\nvar DEFAULT_IMAGE_STYLE = null;\n/**\n * Get the default image style (or null if not yet set).\n * @return {import(\"../style/Image.js\").default} The default image style.\n */\nexport function getDefaultImageStyle() {\n return DEFAULT_IMAGE_STYLE;\n}\n/**\n * @type {string}\n */\nvar DEFAULT_NO_IMAGE_STYLE;\n/**\n * @type {Stroke}\n */\nvar DEFAULT_STROKE_STYLE = null;\n/**\n * Get the default stroke style (or null if not yet set).\n * @return {Stroke} The default stroke style.\n */\nexport function getDefaultStrokeStyle() {\n return DEFAULT_STROKE_STYLE;\n}\n/**\n * @type {Stroke}\n */\nvar DEFAULT_TEXT_STROKE_STYLE;\n/**\n * @type {Text}\n */\nvar DEFAULT_TEXT_STYLE = null;\n/**\n * Get the default text style (or null if not yet set).\n * @return {Text} The default text style.\n */\nexport function getDefaultTextStyle() {\n return DEFAULT_TEXT_STYLE;\n}\n/**\n * @type {Style}\n */\nvar DEFAULT_STYLE = null;\n/**\n * Get the default style (or null if not yet set).\n * @return {Style} The default style.\n */\nexport function getDefaultStyle() {\n return DEFAULT_STYLE;\n}\n/**\n * @type {Array<Style>}\n */\nvar DEFAULT_STYLE_ARRAY = null;\n/**\n * Get the default style array (or null if not yet set).\n * @return {Array<Style>} The default style.\n */\nexport function getDefaultStyleArray() {\n return DEFAULT_STYLE_ARRAY;\n}\nfunction createStyleDefaults() {\n DEFAULT_COLOR = [255, 255, 255, 1];\n DEFAULT_FILL_STYLE = new Fill({\n color: DEFAULT_COLOR\n });\n DEFAULT_IMAGE_STYLE_ANCHOR = [20, 2]; // FIXME maybe [8, 32] ?\n DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS = IconAnchorUnits.PIXELS;\n DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS = IconAnchorUnits.PIXELS;\n DEFAULT_IMAGE_STYLE_SIZE = [64, 64];\n DEFAULT_IMAGE_STYLE_SRC =\n 'https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png';\n DEFAULT_IMAGE_SCALE_MULTIPLIER = 0.5;\n DEFAULT_IMAGE_STYLE = new Icon({\n anchor: DEFAULT_IMAGE_STYLE_ANCHOR,\n anchorOrigin: IconOrigin.BOTTOM_LEFT,\n anchorXUnits: DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS,\n anchorYUnits: DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS,\n crossOrigin: 'anonymous',\n rotation: 0,\n scale: DEFAULT_IMAGE_SCALE_MULTIPLIER,\n size: DEFAULT_IMAGE_STYLE_SIZE,\n src: DEFAULT_IMAGE_STYLE_SRC\n });\n DEFAULT_NO_IMAGE_STYLE = 'NO_IMAGE';\n DEFAULT_STROKE_STYLE = new Stroke({\n color: DEFAULT_COLOR,\n width: 1\n });\n DEFAULT_TEXT_STROKE_STYLE = new Stroke({\n color: [51, 51, 51, 1],\n width: 2\n });\n DEFAULT_TEXT_STYLE = new Text({\n font: 'bold 16px Helvetica',\n fill: DEFAULT_FILL_STYLE,\n stroke: DEFAULT_TEXT_STROKE_STYLE,\n scale: 0.8\n });\n DEFAULT_STYLE = new Style({\n fill: DEFAULT_FILL_STYLE,\n image: DEFAULT_IMAGE_STYLE,\n text: DEFAULT_TEXT_STYLE,\n stroke: DEFAULT_STROKE_STYLE,\n zIndex: 0\n });\n DEFAULT_STYLE_ARRAY = [DEFAULT_STYLE];\n}\n/**\n * @typedef {Object} Options\n * @property {boolean} [extractStyles=true] Extract styles from the KML.\n * @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points.\n * @property {Array<Style>} [defaultStyle] Default style. The\n * default default style is the same as Google Earth.\n * @property {boolean} [writeStyles=true] Write styles into KML.\n */\n/**\n * @classdesc\n * Feature format for reading and writing data in the KML format.\n *\n * {@link module:ol/format/KML~KML#readFeature} will read the first feature from\n * a KML source.\n *\n * MultiGeometries are converted into GeometryCollections if they are a mix of\n * geometry types, and into MultiPoint/MultiLineString/MultiPolygon if they are\n * all of the same type.\n *\n * Note that the KML format uses the URL() constructor. Older browsers such as IE\n * which do not support this will need a URL polyfill to be loaded before use.\n *\n * @api\n */\nvar KML = /** @class */ (function (_super) {\n __extends(KML, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function KML(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n if (!DEFAULT_STYLE_ARRAY) {\n createStyleDefaults();\n }\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection('EPSG:4326');\n /**\n * @private\n * @type {Array<Style>}\n */\n _this.defaultStyle_ = options.defaultStyle ?\n options.defaultStyle : DEFAULT_STYLE_ARRAY;\n /**\n * @private\n * @type {boolean}\n */\n _this.extractStyles_ = options.extractStyles !== undefined ?\n options.extractStyles : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.writeStyles_ = options.writeStyles !== undefined ?\n options.writeStyles : true;\n /**\n * @private\n * @type {!Object<string, (Array<Style>|string)>}\n */\n _this.sharedStyles_ = {};\n /**\n * @private\n * @type {boolean}\n */\n _this.showPointNames_ = options.showPointNames !== undefined ?\n options.showPointNames : true;\n return _this;\n }\n /**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Array<Feature>|undefined} Features.\n */\n KML.prototype.readDocumentOrFolder_ = function (node, objectStack) {\n // FIXME use scope somehow\n var parsersNS = makeStructureNS(NAMESPACE_URIS, {\n 'Document': makeArrayExtender(this.readDocumentOrFolder_, this),\n 'Folder': makeArrayExtender(this.readDocumentOrFolder_, this),\n 'Placemark': makeArrayPusher(this.readPlacemark_, this),\n 'Style': this.readSharedStyle_.bind(this),\n 'StyleMap': this.readSharedStyleMap_.bind(this)\n });\n /** @type {Array<Feature>} */\n // @ts-ignore\n var features = pushParseAndPop([], parsersNS, node, objectStack, this);\n if (features) {\n return features;\n }\n else {\n return undefined;\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n * @return {Feature|undefined} Feature.\n */\n KML.prototype.readPlacemark_ = function (node, objectStack) {\n var object = pushParseAndPop({ 'geometry': null }, PLACEMARK_PARSERS, node, objectStack);\n if (!object) {\n return undefined;\n }\n var feature = new Feature();\n var id = node.getAttribute('id');\n if (id !== null) {\n feature.setId(id);\n }\n var options = /** @type {import(\"./Feature.js\").ReadOptions} */ (objectStack[0]);\n var geometry = object['geometry'];\n if (geometry) {\n transformGeometryWithOptions(geometry, false, options);\n }\n feature.setGeometry(geometry);\n delete object['geometry'];\n if (this.extractStyles_) {\n var style = object['Style'];\n var styleUrl = object['styleUrl'];\n var styleFunction = createFeatureStyleFunction(style, styleUrl, this.defaultStyle_, this.sharedStyles_, this.showPointNames_);\n feature.setStyle(styleFunction);\n }\n delete object['Style'];\n // we do not remove the styleUrl property from the object, so it\n // gets stored on feature when setProperties is called\n feature.setProperties(object, true);\n return feature;\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n KML.prototype.readSharedStyle_ = function (node, objectStack) {\n var id = node.getAttribute('id');\n if (id !== null) {\n var style = readStyle(node, objectStack);\n if (style) {\n var styleUri = void 0;\n var baseURI = node.baseURI;\n if (!baseURI || baseURI == 'about:blank') {\n baseURI = window.location.href;\n }\n if (baseURI) {\n var url = new URL('#' + id, baseURI);\n styleUri = url.href;\n }\n else {\n styleUri = '#' + id;\n }\n this.sharedStyles_[styleUri] = style;\n }\n }\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @private\n */\n KML.prototype.readSharedStyleMap_ = function (node, objectStack) {\n var id = node.getAttribute('id');\n if (id === null) {\n return;\n }\n var styleMapValue = readStyleMapValue(node, objectStack);\n if (!styleMapValue) {\n return;\n }\n var styleUri;\n var baseURI = node.baseURI;\n if (!baseURI || baseURI == 'about:blank') {\n baseURI = window.location.href;\n }\n if (baseURI) {\n var url = new URL('#' + id, baseURI);\n styleUri = url.href;\n }\n else {\n styleUri = '#' + id;\n }\n this.sharedStyles_[styleUri] = styleMapValue;\n };\n /**\n * @inheritDoc\n */\n KML.prototype.readFeatureFromNode = function (node, opt_options) {\n if (!includes(NAMESPACE_URIS, node.namespaceURI)) {\n return null;\n }\n var feature = this.readPlacemark_(node, [this.getReadOptions(node, opt_options)]);\n if (feature) {\n return feature;\n }\n else {\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n KML.prototype.readFeaturesFromNode = function (node, opt_options) {\n if (!includes(NAMESPACE_URIS, node.namespaceURI)) {\n return [];\n }\n var features;\n var localName = node.localName;\n if (localName == 'Document' || localName == 'Folder') {\n features = this.readDocumentOrFolder_(node, [this.getReadOptions(node, opt_options)]);\n if (features) {\n return features;\n }\n else {\n return [];\n }\n }\n else if (localName == 'Placemark') {\n var feature = this.readPlacemark_(node, [this.getReadOptions(node, opt_options)]);\n if (feature) {\n return [feature];\n }\n else {\n return [];\n }\n }\n else if (localName == 'kml') {\n features = [];\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n var fs = this.readFeaturesFromNode(n, opt_options);\n if (fs) {\n extend(features, fs);\n }\n }\n return features;\n }\n else {\n return [];\n }\n };\n /**\n * Read the name of the KML.\n *\n * @param {Document|Element|string} source Source.\n * @return {string|undefined} Name.\n * @api\n */\n KML.prototype.readName = function (source) {\n if (!source) {\n return undefined;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readNameFromDocument(doc);\n }\n else if (isDocument(source)) {\n return this.readNameFromDocument(/** @type {Document} */ (source));\n }\n else {\n return this.readNameFromNode(/** @type {Element} */ (source));\n }\n };\n /**\n * @param {Document} doc Document.\n * @return {string|undefined} Name.\n */\n KML.prototype.readNameFromDocument = function (doc) {\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n var name_1 = this.readNameFromNode(/** @type {Element} */ (n));\n if (name_1) {\n return name_1;\n }\n }\n }\n return undefined;\n };\n /**\n * @param {Element} node Node.\n * @return {string|undefined} Name.\n */\n KML.prototype.readNameFromNode = function (node) {\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n if (includes(NAMESPACE_URIS, n.namespaceURI) &&\n n.localName == 'name') {\n return readString(n);\n }\n }\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n var localName = n.localName;\n if (includes(NAMESPACE_URIS, n.namespaceURI) &&\n (localName == 'Document' ||\n localName == 'Folder' ||\n localName == 'Placemark' ||\n localName == 'kml')) {\n var name_2 = this.readNameFromNode(n);\n if (name_2) {\n return name_2;\n }\n }\n }\n return undefined;\n };\n /**\n * Read the network links of the KML.\n *\n * @param {Document|Element|string} source Source.\n * @return {Array<Object>} Network links.\n * @api\n */\n KML.prototype.readNetworkLinks = function (source) {\n var networkLinks = [];\n if (typeof source === 'string') {\n var doc = parse(source);\n extend(networkLinks, this.readNetworkLinksFromDocument(doc));\n }\n else if (isDocument(source)) {\n extend(networkLinks, this.readNetworkLinksFromDocument(\n /** @type {Document} */ (source)));\n }\n else {\n extend(networkLinks, this.readNetworkLinksFromNode(\n /** @type {Element} */ (source)));\n }\n return networkLinks;\n };\n /**\n * @param {Document} doc Document.\n * @return {Array<Object>} Network links.\n */\n KML.prototype.readNetworkLinksFromDocument = function (doc) {\n var networkLinks = [];\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n extend(networkLinks, this.readNetworkLinksFromNode(/** @type {Element} */ (n)));\n }\n }\n return networkLinks;\n };\n /**\n * @param {Element} node Node.\n * @return {Array<Object>} Network links.\n */\n KML.prototype.readNetworkLinksFromNode = function (node) {\n var networkLinks = [];\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n if (includes(NAMESPACE_URIS, n.namespaceURI) &&\n n.localName == 'NetworkLink') {\n var obj = pushParseAndPop({}, NETWORK_LINK_PARSERS, n, []);\n networkLinks.push(obj);\n }\n }\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n var localName = n.localName;\n if (includes(NAMESPACE_URIS, n.namespaceURI) &&\n (localName == 'Document' ||\n localName == 'Folder' ||\n localName == 'kml')) {\n extend(networkLinks, this.readNetworkLinksFromNode(n));\n }\n }\n return networkLinks;\n };\n /**\n * Read the regions of the KML.\n *\n * @param {Document|Element|string} source Source.\n * @return {Array<Object>} Regions.\n * @api\n */\n KML.prototype.readRegion = function (source) {\n var regions = [];\n if (typeof source === 'string') {\n var doc = parse(source);\n extend(regions, this.readRegionFromDocument(doc));\n }\n else if (isDocument(source)) {\n extend(regions, this.readRegionFromDocument(\n /** @type {Document} */ (source)));\n }\n else {\n extend(regions, this.readRegionFromNode(\n /** @type {Element} */ (source)));\n }\n return regions;\n };\n /**\n * @param {Document} doc Document.\n * @return {Array<Object>} Region.\n */\n KML.prototype.readRegionFromDocument = function (doc) {\n var regions = [];\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n extend(regions, this.readRegionFromNode(/** @type {Element} */ (n)));\n }\n }\n return regions;\n };\n /**\n * @param {Element} node Node.\n * @return {Array<Object>} Region.\n * @api\n */\n KML.prototype.readRegionFromNode = function (node) {\n var regions = [];\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n if (includes(NAMESPACE_URIS, n.namespaceURI) &&\n n.localName == 'Region') {\n var obj = pushParseAndPop({}, REGION_PARSERS, n, []);\n regions.push(obj);\n }\n }\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n var localName = n.localName;\n if (includes(NAMESPACE_URIS, n.namespaceURI) &&\n (localName == 'Document' ||\n localName == 'Folder' ||\n localName == 'kml')) {\n extend(regions, this.readRegionFromNode(n));\n }\n }\n return regions;\n };\n /**\n * Encode an array of features in the KML format as an XML node. GeometryCollections,\n * MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.\n *\n * @param {Array<Feature>} features Features.\n * @param {import(\"./Feature.js\").WriteOptions=} opt_options Options.\n * @return {Node} Node.\n * @override\n * @api\n */\n KML.prototype.writeFeaturesNode = function (features, opt_options) {\n opt_options = this.adaptOptions(opt_options);\n var kml = createElementNS(NAMESPACE_URIS[4], 'kml');\n var xmlnsUri = 'http://www.w3.org/2000/xmlns/';\n kml.setAttributeNS(xmlnsUri, 'xmlns:gx', GX_NAMESPACE_URIS[0]);\n kml.setAttributeNS(xmlnsUri, 'xmlns:xsi', XML_SCHEMA_INSTANCE_URI);\n kml.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', SCHEMA_LOCATION);\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: kml };\n /** @type {!Object<string, (Array<Feature>|Feature|undefined)>} */\n var properties = {};\n if (features.length > 1) {\n properties['Document'] = features;\n }\n else if (features.length == 1) {\n properties['Placemark'] = features[0];\n }\n var orderedKeys = KML_SEQUENCE[kml.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, KML_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, [opt_options], orderedKeys, this);\n return kml;\n };\n return KML;\n}(XMLFeature));\n/**\n * @param {Style|undefined} foundStyle Style.\n * @param {string} name Name.\n * @return {Style} style Style.\n */\nfunction createNameStyleFunction(foundStyle, name) {\n var textStyle = null;\n var textOffset = [0, 0];\n var textAlign = 'start';\n if (foundStyle.getImage()) {\n var imageSize = foundStyle.getImage().getImageSize();\n if (imageSize === null) {\n imageSize = DEFAULT_IMAGE_STYLE_SIZE;\n }\n if (imageSize.length == 2) {\n var imageScale = foundStyle.getImage().getScale();\n // Offset the label to be centered to the right of the icon, if there is\n // one.\n textOffset[0] = imageScale * imageSize[0] / 2;\n textOffset[1] = -imageScale * imageSize[1] / 2;\n textAlign = 'left';\n }\n }\n if (foundStyle.getText() !== null) {\n // clone the text style, customizing it with name, alignments and offset.\n // Note that kml does not support many text options that OpenLayers does (rotation, textBaseline).\n var foundText = foundStyle.getText();\n textStyle = foundText.clone();\n textStyle.setFont(foundText.getFont() || DEFAULT_TEXT_STYLE.getFont());\n textStyle.setScale(foundText.getScale() || DEFAULT_TEXT_STYLE.getScale());\n textStyle.setFill(foundText.getFill() || DEFAULT_TEXT_STYLE.getFill());\n textStyle.setStroke(foundText.getStroke() || DEFAULT_TEXT_STROKE_STYLE);\n }\n else {\n textStyle = DEFAULT_TEXT_STYLE.clone();\n }\n textStyle.setText(name);\n textStyle.setOffsetX(textOffset[0]);\n textStyle.setOffsetY(textOffset[1]);\n textStyle.setTextAlign(textAlign);\n var nameStyle = new Style({\n text: textStyle\n });\n return nameStyle;\n}\n/**\n * @param {Array<Style>|undefined} style Style.\n * @param {string} styleUrl Style URL.\n * @param {Array<Style>} defaultStyle Default style.\n * @param {!Object<string, (Array<Style>|string)>} sharedStyles Shared styles.\n * @param {boolean|undefined} showPointNames true to show names for point placemarks.\n * @return {import(\"../style/Style.js\").StyleFunction} Feature style function.\n */\nfunction createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles, showPointNames) {\n return (\n /**\n * @param {Feature} feature feature.\n * @param {number} resolution Resolution.\n * @return {Array<Style>} Style.\n */\n function (feature, resolution) {\n var drawName = showPointNames;\n /** @type {Style|undefined} */\n var nameStyle;\n var name = '';\n if (drawName) {\n var geometry = feature.getGeometry();\n if (geometry) {\n drawName = geometry.getType() === GeometryType.POINT;\n }\n }\n if (drawName) {\n name = /** @type {string} */ (feature.get('name'));\n drawName = drawName && !!name;\n }\n if (style) {\n if (drawName) {\n nameStyle = createNameStyleFunction(style[0], name);\n return style.concat(nameStyle);\n }\n return style;\n }\n if (styleUrl) {\n var foundStyle = findStyle(styleUrl, defaultStyle, sharedStyles);\n if (drawName) {\n nameStyle = createNameStyleFunction(foundStyle[0], name);\n return foundStyle.concat(nameStyle);\n }\n return foundStyle;\n }\n if (drawName) {\n nameStyle = createNameStyleFunction(defaultStyle[0], name);\n return defaultStyle.concat(nameStyle);\n }\n return defaultStyle;\n });\n}\n/**\n * @param {Array<Style>|string|undefined} styleValue Style value.\n * @param {Array<Style>} defaultStyle Default style.\n * @param {!Object<string, (Array<Style>|string)>} sharedStyles\n * Shared styles.\n * @return {Array<Style>} Style.\n */\nfunction findStyle(styleValue, defaultStyle, sharedStyles) {\n if (Array.isArray(styleValue)) {\n return styleValue;\n }\n else if (typeof styleValue === 'string') {\n // KML files in the wild occasionally forget the leading `#` on styleUrls\n // defined in the same document. Add a leading `#` if it enables to find\n // a style.\n if (!(styleValue in sharedStyles) && ('#' + styleValue in sharedStyles)) {\n styleValue = '#' + styleValue;\n }\n return findStyle(sharedStyles[styleValue], defaultStyle, sharedStyles);\n }\n else {\n return defaultStyle;\n }\n}\n/**\n * @param {Node} node Node.\n * @return {import(\"../color.js\").Color|undefined} Color.\n */\nfunction readColor(node) {\n var s = getAllTextContent(node, false);\n // The KML specification states that colors should not include a leading `#`\n // but we tolerate them.\n var m = /^\\s*#?\\s*([0-9A-Fa-f]{8})\\s*$/.exec(s);\n if (m) {\n var hexColor = m[1];\n return [\n parseInt(hexColor.substr(6, 2), 16),\n parseInt(hexColor.substr(4, 2), 16),\n parseInt(hexColor.substr(2, 2), 16),\n parseInt(hexColor.substr(0, 2), 16) / 255\n ];\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {Node} node Node.\n * @return {Array<number>|undefined} Flat coordinates.\n */\nexport function readFlatCoordinates(node) {\n var s = getAllTextContent(node, false);\n var flatCoordinates = [];\n // The KML specification states that coordinate tuples should not include\n // spaces, but we tolerate them.\n var re = /^\\s*([+\\-]?\\d*\\.?\\d+(?:e[+\\-]?\\d+)?)\\s*,\\s*([+\\-]?\\d*\\.?\\d+(?:e[+\\-]?\\d+)?)(?:\\s*,\\s*([+\\-]?\\d*\\.?\\d+(?:e[+\\-]?\\d+)?))?\\s*/i;\n var m;\n while ((m = re.exec(s))) {\n var x = parseFloat(m[1]);\n var y = parseFloat(m[2]);\n var z = m[3] ? parseFloat(m[3]) : 0;\n flatCoordinates.push(x, y, z);\n s = s.substr(m[0].length);\n }\n if (s !== '') {\n return undefined;\n }\n return flatCoordinates;\n}\n/**\n * @param {Node} node Node.\n * @return {string} URI.\n */\nfunction readURI(node) {\n var s = getAllTextContent(node, false).trim();\n var baseURI = node.baseURI;\n if (!baseURI || baseURI == 'about:blank') {\n baseURI = window.location.href;\n }\n if (baseURI) {\n var url = new URL(s, baseURI);\n return url.href;\n }\n else {\n return s;\n }\n}\n/**\n * @param {Element} node Node.\n * @return {Vec2} Vec2.\n */\nfunction readVec2(node) {\n var xunits = node.getAttribute('xunits');\n var yunits = node.getAttribute('yunits');\n var origin;\n if (xunits !== 'insetPixels') {\n if (yunits !== 'insetPixels') {\n origin = IconOrigin.BOTTOM_LEFT;\n }\n else {\n origin = IconOrigin.TOP_LEFT;\n }\n }\n else {\n if (yunits !== 'insetPixels') {\n origin = IconOrigin.BOTTOM_RIGHT;\n }\n else {\n origin = IconOrigin.TOP_RIGHT;\n }\n }\n return {\n x: parseFloat(node.getAttribute('x')),\n xunits: ICON_ANCHOR_UNITS_MAP[xunits],\n y: parseFloat(node.getAttribute('y')),\n yunits: ICON_ANCHOR_UNITS_MAP[yunits],\n origin: origin\n };\n}\n/**\n * @param {Node} node Node.\n * @return {number|undefined} Scale.\n */\nfunction readScale(node) {\n return readDecimal(node);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar STYLE_MAP_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Pair': pairDataParser\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<Style>|string|undefined} StyleMap.\n */\nfunction readStyleMapValue(node, objectStack) {\n return pushParseAndPop(undefined, STYLE_MAP_PARSERS, node, objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar ICON_STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Icon': makeObjectPropertySetter(readIcon),\n 'heading': makeObjectPropertySetter(readDecimal),\n 'hotSpot': makeObjectPropertySetter(readVec2),\n 'scale': makeObjectPropertySetter(readScale)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction iconStyleParser(node, objectStack) {\n // FIXME refreshMode\n // FIXME refreshInterval\n // FIXME viewRefreshTime\n // FIXME viewBoundScale\n // FIXME viewFormat\n // FIXME httpQuery\n var object = pushParseAndPop({}, ICON_STYLE_PARSERS, node, objectStack);\n if (!object) {\n return;\n }\n var styleObject = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var IconObject = 'Icon' in object ? object['Icon'] : {};\n var drawIcon = (!('Icon' in object) || Object.keys(IconObject).length > 0);\n var src;\n var href = /** @type {string|undefined} */ (IconObject['href']);\n if (href) {\n src = href;\n }\n else if (drawIcon) {\n src = DEFAULT_IMAGE_STYLE_SRC;\n }\n var anchor, anchorXUnits, anchorYUnits;\n var anchorOrigin = IconOrigin.BOTTOM_LEFT;\n var hotSpot = /** @type {Vec2|undefined} */ (object['hotSpot']);\n if (hotSpot) {\n anchor = [hotSpot.x, hotSpot.y];\n anchorXUnits = hotSpot.xunits;\n anchorYUnits = hotSpot.yunits;\n anchorOrigin = hotSpot.origin;\n }\n else if (src === DEFAULT_IMAGE_STYLE_SRC) {\n anchor = DEFAULT_IMAGE_STYLE_ANCHOR;\n anchorXUnits = DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS;\n anchorYUnits = DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS;\n }\n else if (/^http:\\/\\/maps\\.(?:google|gstatic)\\.com\\//.test(src)) {\n anchor = [0.5, 0];\n anchorXUnits = IconAnchorUnits.FRACTION;\n anchorYUnits = IconAnchorUnits.FRACTION;\n }\n var offset;\n var x = /** @type {number|undefined} */ (IconObject['x']);\n var y = /** @type {number|undefined} */ (IconObject['y']);\n if (x !== undefined && y !== undefined) {\n offset = [x, y];\n }\n var size;\n var w = /** @type {number|undefined} */ (IconObject['w']);\n var h = /** @type {number|undefined} */ (IconObject['h']);\n if (w !== undefined && h !== undefined) {\n size = [w, h];\n }\n var rotation;\n var heading = /** @type {number} */ (object['heading']);\n if (heading !== undefined) {\n rotation = toRadians(heading);\n }\n var scale = /** @type {number|undefined} */ (object['scale']);\n if (drawIcon) {\n if (src == DEFAULT_IMAGE_STYLE_SRC) {\n size = DEFAULT_IMAGE_STYLE_SIZE;\n if (scale === undefined) {\n scale = DEFAULT_IMAGE_SCALE_MULTIPLIER;\n }\n }\n var imageStyle = new Icon({\n anchor: anchor,\n anchorOrigin: anchorOrigin,\n anchorXUnits: anchorXUnits,\n anchorYUnits: anchorYUnits,\n crossOrigin: 'anonymous',\n offset: offset,\n offsetOrigin: IconOrigin.BOTTOM_LEFT,\n rotation: rotation,\n scale: scale,\n size: size,\n src: src\n });\n styleObject['imageStyle'] = imageStyle;\n }\n else {\n // handle the case when we explicitly want to draw no icon.\n styleObject['imageStyle'] = DEFAULT_NO_IMAGE_STYLE;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LABEL_STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'color': makeObjectPropertySetter(readColor),\n 'scale': makeObjectPropertySetter(readScale)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction labelStyleParser(node, objectStack) {\n // FIXME colorMode\n var object = pushParseAndPop({}, LABEL_STYLE_PARSERS, node, objectStack);\n if (!object) {\n return;\n }\n var styleObject = objectStack[objectStack.length - 1];\n var textStyle = new Text({\n fill: new Fill({\n color: /** @type {import(\"../color.js\").Color} */ ('color' in object ? object['color'] : DEFAULT_COLOR)\n }),\n scale: /** @type {number|undefined} */ (object['scale'])\n });\n styleObject['textStyle'] = textStyle;\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LINE_STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'color': makeObjectPropertySetter(readColor),\n 'width': makeObjectPropertySetter(readDecimal)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction lineStyleParser(node, objectStack) {\n // FIXME colorMode\n // FIXME gx:outerColor\n // FIXME gx:outerWidth\n // FIXME gx:physicalWidth\n // FIXME gx:labelVisibility\n var object = pushParseAndPop({}, LINE_STYLE_PARSERS, node, objectStack);\n if (!object) {\n return;\n }\n var styleObject = objectStack[objectStack.length - 1];\n var strokeStyle = new Stroke({\n color: /** @type {import(\"../color.js\").Color} */ ('color' in object ? object['color'] : DEFAULT_COLOR),\n width: /** @type {number} */ ('width' in object ? object['width'] : 1)\n });\n styleObject['strokeStyle'] = strokeStyle;\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar POLY_STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'color': makeObjectPropertySetter(readColor),\n 'fill': makeObjectPropertySetter(readBoolean),\n 'outline': makeObjectPropertySetter(readBoolean)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction polyStyleParser(node, objectStack) {\n // FIXME colorMode\n var object = pushParseAndPop({}, POLY_STYLE_PARSERS, node, objectStack);\n if (!object) {\n return;\n }\n var styleObject = objectStack[objectStack.length - 1];\n var fillStyle = new Fill({\n color: /** @type {import(\"../color.js\").Color} */ ('color' in object ? object['color'] : DEFAULT_COLOR)\n });\n styleObject['fillStyle'] = fillStyle;\n var fill = /** @type {boolean|undefined} */ (object['fill']);\n if (fill !== undefined) {\n styleObject['fill'] = fill;\n }\n var outline = /** @type {boolean|undefined} */ (object['outline']);\n if (outline !== undefined) {\n styleObject['outline'] = outline;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar FLAT_LINEAR_RING_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'coordinates': makeReplacer(readFlatCoordinates)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<number>} LinearRing flat coordinates.\n */\nfunction readFlatLinearRing(node, objectStack) {\n return pushParseAndPop(null, FLAT_LINEAR_RING_PARSERS, node, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction gxCoordParser(node, objectStack) {\n var gxTrackObject = /** @type {GxTrackObject} */ (objectStack[objectStack.length - 1]);\n var flatCoordinates = gxTrackObject.flatCoordinates;\n var s = getAllTextContent(node, false);\n var re = /^\\s*([+\\-]?\\d+(?:\\.\\d*)?(?:e[+\\-]?\\d*)?)\\s+([+\\-]?\\d+(?:\\.\\d*)?(?:e[+\\-]?\\d*)?)\\s+([+\\-]?\\d+(?:\\.\\d*)?(?:e[+\\-]?\\d*)?)\\s*$/i;\n var m = re.exec(s);\n if (m) {\n var x = parseFloat(m[1]);\n var y = parseFloat(m[2]);\n var z = parseFloat(m[3]);\n flatCoordinates.push(x, y, z, 0);\n }\n else {\n flatCoordinates.push(0, 0, 0, 0);\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(GX_NAMESPACE_URIS, {\n 'Track': makeArrayPusher(readGxTrack)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {MultiLineString|undefined} MultiLineString.\n */\nfunction readGxMultiTrack(node, objectStack) {\n var lineStrings = pushParseAndPop([], GX_MULTITRACK_GEOMETRY_PARSERS, node, objectStack);\n if (!lineStrings) {\n return undefined;\n }\n return new MultiLineString(lineStrings);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar GX_TRACK_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'when': whenParser\n}, makeStructureNS(GX_NAMESPACE_URIS, {\n 'coord': gxCoordParser\n}));\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {LineString|undefined} LineString.\n */\nfunction readGxTrack(node, objectStack) {\n var gxTrackObject = pushParseAndPop(\n /** @type {GxTrackObject} */ ({\n flatCoordinates: [],\n whens: []\n }), GX_TRACK_PARSERS, node, objectStack);\n if (!gxTrackObject) {\n return undefined;\n }\n var flatCoordinates = gxTrackObject.flatCoordinates;\n var whens = gxTrackObject.whens;\n for (var i = 0, ii = Math.min(flatCoordinates.length, whens.length); i < ii; ++i) {\n flatCoordinates[4 * i + 3] = whens[i];\n }\n return new LineString(flatCoordinates, GeometryLayout.XYZM);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar ICON_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'href': makeObjectPropertySetter(readURI)\n}, makeStructureNS(GX_NAMESPACE_URIS, {\n 'x': makeObjectPropertySetter(readDecimal),\n 'y': makeObjectPropertySetter(readDecimal),\n 'w': makeObjectPropertySetter(readDecimal),\n 'h': makeObjectPropertySetter(readDecimal)\n}));\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object} Icon object.\n */\nfunction readIcon(node, objectStack) {\n var iconObject = pushParseAndPop({}, ICON_PARSERS, node, objectStack);\n if (iconObject) {\n return iconObject;\n }\n else {\n return null;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar GEOMETRY_FLAT_COORDINATES_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'coordinates': makeReplacer(readFlatCoordinates)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<number>} Flat coordinates.\n */\nfunction readFlatCoordinatesFromNode(node, objectStack) {\n return pushParseAndPop(null, GEOMETRY_FLAT_COORDINATES_PARSERS, node, objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'extrude': makeObjectPropertySetter(readBoolean),\n 'tessellate': makeObjectPropertySetter(readBoolean),\n 'altitudeMode': makeObjectPropertySetter(readString)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {LineString|undefined} LineString.\n */\nfunction readLineString(node, objectStack) {\n var properties = pushParseAndPop({}, EXTRUDE_AND_ALTITUDE_MODE_PARSERS, node, objectStack);\n var flatCoordinates = readFlatCoordinatesFromNode(node, objectStack);\n if (flatCoordinates) {\n var lineString = new LineString(flatCoordinates, GeometryLayout.XYZ);\n lineString.setProperties(properties, true);\n return lineString;\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Polygon|undefined} Polygon.\n */\nfunction readLinearRing(node, objectStack) {\n var properties = pushParseAndPop({}, EXTRUDE_AND_ALTITUDE_MODE_PARSERS, node, objectStack);\n var flatCoordinates = readFlatCoordinatesFromNode(node, objectStack);\n if (flatCoordinates) {\n var polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, [flatCoordinates.length]);\n polygon.setProperties(properties, true);\n return polygon;\n }\n else {\n return undefined;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar MULTI_GEOMETRY_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'LineString': makeArrayPusher(readLineString),\n 'LinearRing': makeArrayPusher(readLinearRing),\n 'MultiGeometry': makeArrayPusher(readMultiGeometry),\n 'Point': makeArrayPusher(readPoint),\n 'Polygon': makeArrayPusher(readPolygon)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {import(\"../geom/Geometry.js\").default} Geometry.\n */\nfunction readMultiGeometry(node, objectStack) {\n var geometries = pushParseAndPop([], MULTI_GEOMETRY_PARSERS, node, objectStack);\n if (!geometries) {\n return null;\n }\n if (geometries.length === 0) {\n return new GeometryCollection(geometries);\n }\n var multiGeometry;\n var homogeneous = true;\n var type = geometries[0].getType();\n var geometry;\n for (var i = 1, ii = geometries.length; i < ii; ++i) {\n geometry = geometries[i];\n if (geometry.getType() != type) {\n homogeneous = false;\n break;\n }\n }\n if (homogeneous) {\n var layout = void 0;\n var flatCoordinates = void 0;\n if (type == GeometryType.POINT) {\n var point = geometries[0];\n layout = point.getLayout();\n flatCoordinates = point.getFlatCoordinates();\n for (var i = 1, ii = geometries.length; i < ii; ++i) {\n geometry = geometries[i];\n extend(flatCoordinates, geometry.getFlatCoordinates());\n }\n multiGeometry = new MultiPoint(flatCoordinates, layout);\n setCommonGeometryProperties(multiGeometry, geometries);\n }\n else if (type == GeometryType.LINE_STRING) {\n multiGeometry = new MultiLineString(geometries);\n setCommonGeometryProperties(multiGeometry, geometries);\n }\n else if (type == GeometryType.POLYGON) {\n multiGeometry = new MultiPolygon(geometries);\n setCommonGeometryProperties(multiGeometry, geometries);\n }\n else if (type == GeometryType.GEOMETRY_COLLECTION) {\n multiGeometry = new GeometryCollection(geometries);\n }\n else {\n assert(false, 37); // Unknown geometry type found\n }\n }\n else {\n multiGeometry = new GeometryCollection(geometries);\n }\n return (\n /** @type {import(\"../geom/Geometry.js\").default} */ (multiGeometry));\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Point|undefined} Point.\n */\nfunction readPoint(node, objectStack) {\n var properties = pushParseAndPop({}, EXTRUDE_AND_ALTITUDE_MODE_PARSERS, node, objectStack);\n var flatCoordinates = readFlatCoordinatesFromNode(node, objectStack);\n if (flatCoordinates) {\n var point = new Point(flatCoordinates, GeometryLayout.XYZ);\n point.setProperties(properties, true);\n return point;\n }\n else {\n return undefined;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'innerBoundaryIs': innerBoundaryIsParser,\n 'outerBoundaryIs': outerBoundaryIsParser\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Polygon|undefined} Polygon.\n */\nfunction readPolygon(node, objectStack) {\n var properties = pushParseAndPop(/** @type {Object<string,*>} */ ({}), EXTRUDE_AND_ALTITUDE_MODE_PARSERS, node, objectStack);\n var flatLinearRings = pushParseAndPop([null], FLAT_LINEAR_RINGS_PARSERS, node, objectStack);\n if (flatLinearRings && flatLinearRings[0]) {\n var flatCoordinates = flatLinearRings[0];\n var ends = [flatCoordinates.length];\n for (var i = 1, ii = flatLinearRings.length; i < ii; ++i) {\n extend(flatCoordinates, flatLinearRings[i]);\n ends.push(flatCoordinates.length);\n }\n var polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, ends);\n polygon.setProperties(properties, true);\n return polygon;\n }\n else {\n return undefined;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'IconStyle': iconStyleParser,\n 'LabelStyle': labelStyleParser,\n 'LineStyle': lineStyleParser,\n 'PolyStyle': polyStyleParser\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<Style>} Style.\n */\nfunction readStyle(node, objectStack) {\n var styleObject = pushParseAndPop({}, STYLE_PARSERS, node, objectStack);\n if (!styleObject) {\n return null;\n }\n var fillStyle = /** @type {Fill} */ ('fillStyle' in styleObject ?\n styleObject['fillStyle'] : DEFAULT_FILL_STYLE);\n var fill = /** @type {boolean|undefined} */ (styleObject['fill']);\n if (fill !== undefined && !fill) {\n fillStyle = null;\n }\n var imageStyle;\n if ('imageStyle' in styleObject) {\n if (styleObject['imageStyle'] != DEFAULT_NO_IMAGE_STYLE) {\n imageStyle = styleObject['imageStyle'];\n }\n }\n else {\n imageStyle = DEFAULT_IMAGE_STYLE;\n }\n var textStyle = /** @type {Text} */ ('textStyle' in styleObject ?\n styleObject['textStyle'] : DEFAULT_TEXT_STYLE);\n var strokeStyle = /** @type {Stroke} */ ('strokeStyle' in styleObject ?\n styleObject['strokeStyle'] : DEFAULT_STROKE_STYLE);\n var outline = /** @type {boolean|undefined} */ (styleObject['outline']);\n if (outline !== undefined && !outline) {\n strokeStyle = null;\n }\n return [new Style({\n fill: fillStyle,\n image: imageStyle,\n stroke: strokeStyle,\n text: textStyle,\n zIndex: undefined // FIXME\n })];\n}\n/**\n * Reads an array of geometries and creates arrays for common geometry\n * properties. Then sets them to the multi geometry.\n * @param {MultiPoint|MultiLineString|MultiPolygon} multiGeometry A multi-geometry.\n * @param {Array<import(\"../geom/Geometry.js\").default>} geometries List of geometries.\n */\nfunction setCommonGeometryProperties(multiGeometry, geometries) {\n var ii = geometries.length;\n var extrudes = new Array(geometries.length);\n var tessellates = new Array(geometries.length);\n var altitudeModes = new Array(geometries.length);\n var hasExtrude, hasTessellate, hasAltitudeMode;\n hasExtrude = false;\n hasTessellate = false;\n hasAltitudeMode = false;\n for (var i = 0; i < ii; ++i) {\n var geometry = geometries[i];\n extrudes[i] = geometry.get('extrude');\n tessellates[i] = geometry.get('tessellate');\n altitudeModes[i] = geometry.get('altitudeMode');\n hasExtrude = hasExtrude || extrudes[i] !== undefined;\n hasTessellate = hasTessellate || tessellates[i] !== undefined;\n hasAltitudeMode = hasAltitudeMode || altitudeModes[i];\n }\n if (hasExtrude) {\n multiGeometry.set('extrude', extrudes);\n }\n if (hasTessellate) {\n multiGeometry.set('tessellate', tessellates);\n }\n if (hasAltitudeMode) {\n multiGeometry.set('altitudeMode', altitudeModes);\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar DATA_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'displayName': makeObjectPropertySetter(readString),\n 'value': makeObjectPropertySetter(readString)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction dataParser(node, objectStack) {\n var name = node.getAttribute('name');\n parseNode(DATA_PARSERS, node, objectStack);\n var featureObject = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n if (name && featureObject.displayName) {\n featureObject[name] = {\n value: featureObject.value,\n displayName: featureObject.displayName,\n toString: function () {\n return featureObject.value;\n }\n };\n }\n else if (name !== null) {\n featureObject[name] = featureObject.value;\n }\n else if (featureObject.displayName !== null) {\n featureObject[featureObject.displayName] = featureObject.value;\n }\n delete featureObject['value'];\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar EXTENDED_DATA_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Data': dataParser,\n 'SchemaData': schemaDataParser\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction extendedDataParser(node, objectStack) {\n parseNode(EXTENDED_DATA_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction regionParser(node, objectStack) {\n parseNode(REGION_PARSERS, node, objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PAIR_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Style': makeObjectPropertySetter(readStyle),\n 'key': makeObjectPropertySetter(readString),\n 'styleUrl': makeObjectPropertySetter(readURI)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction pairDataParser(node, objectStack) {\n var pairObject = pushParseAndPop({}, PAIR_PARSERS, node, objectStack);\n if (!pairObject) {\n return;\n }\n var key = /** @type {string|undefined} */ (pairObject['key']);\n if (key && key == 'normal') {\n var styleUrl = /** @type {string|undefined} */ (pairObject['styleUrl']);\n if (styleUrl) {\n objectStack[objectStack.length - 1] = styleUrl;\n }\n var style = /** @type {Style} */ (pairObject['Style']);\n if (style) {\n objectStack[objectStack.length - 1] = style;\n }\n }\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction placemarkStyleMapParser(node, objectStack) {\n var styleMapValue = readStyleMapValue(node, objectStack);\n if (!styleMapValue) {\n return;\n }\n var placemarkObject = objectStack[objectStack.length - 1];\n if (Array.isArray(styleMapValue)) {\n placemarkObject['Style'] = styleMapValue;\n }\n else if (typeof styleMapValue === 'string') {\n placemarkObject['styleUrl'] = styleMapValue;\n }\n else {\n assert(false, 38); // `styleMapValue` has an unknown type\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar SCHEMA_DATA_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'SimpleData': simpleDataParser\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction schemaDataParser(node, objectStack) {\n parseNode(SCHEMA_DATA_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction simpleDataParser(node, objectStack) {\n var name = node.getAttribute('name');\n if (name !== null) {\n var data = readString(node);\n var featureObject = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n featureObject[name] = data;\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LAT_LON_ALT_BOX_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'altitudeMode': makeObjectPropertySetter(readString),\n 'minAltitude': makeObjectPropertySetter(readDecimal),\n 'maxAltitude': makeObjectPropertySetter(readDecimal),\n 'north': makeObjectPropertySetter(readDecimal),\n 'south': makeObjectPropertySetter(readDecimal),\n 'east': makeObjectPropertySetter(readDecimal),\n 'west': makeObjectPropertySetter(readDecimal)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction latLonAltBoxParser(node, objectStack) {\n var object = pushParseAndPop({}, LAT_LON_ALT_BOX_PARSERS, node, objectStack);\n if (!object) {\n return;\n }\n var regionObject = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var extent = [\n parseFloat(object['west']),\n parseFloat(object['south']),\n parseFloat(object['east']),\n parseFloat(object['north'])\n ];\n regionObject['extent'] = extent;\n regionObject['altitudeMode'] = object['altitudeMode'];\n regionObject['minAltitude'] = parseFloat(object['minAltitude']);\n regionObject['maxAltitude'] = parseFloat(object['maxAltitude']);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LOD_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'minLodPixels': makeObjectPropertySetter(readDecimal),\n 'maxLodPixels': makeObjectPropertySetter(readDecimal),\n 'minFadeExtent': makeObjectPropertySetter(readDecimal),\n 'maxFadeExtent': makeObjectPropertySetter(readDecimal)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction lodParser(node, objectStack) {\n var object = pushParseAndPop({}, LOD_PARSERS, node, objectStack);\n if (!object) {\n return;\n }\n var lodObject = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n lodObject['minLodPixels'] = parseFloat(object['minLodPixels']);\n lodObject['maxLodPixels'] = parseFloat(object['maxLodPixels']);\n lodObject['minFadeExtent'] = parseFloat(object['minFadeExtent']);\n lodObject['maxFadeExtent'] = parseFloat(object['maxFadeExtent']);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar INNER_BOUNDARY_IS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'LinearRing': makeReplacer(readFlatLinearRing)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction innerBoundaryIsParser(node, objectStack) {\n /** @type {Array<number>|undefined} */\n var flatLinearRing = pushParseAndPop(undefined, INNER_BOUNDARY_IS_PARSERS, node, objectStack);\n if (flatLinearRing) {\n var flatLinearRings = /** @type {Array<Array<number>>} */ (objectStack[objectStack.length - 1]);\n flatLinearRings.push(flatLinearRing);\n }\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar OUTER_BOUNDARY_IS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'LinearRing': makeReplacer(readFlatLinearRing)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction outerBoundaryIsParser(node, objectStack) {\n /** @type {Array<number>|undefined} */\n var flatLinearRing = pushParseAndPop(undefined, OUTER_BOUNDARY_IS_PARSERS, node, objectStack);\n if (flatLinearRing) {\n var flatLinearRings = /** @type {Array<Array<number>>} */ (objectStack[objectStack.length - 1]);\n flatLinearRings[0] = flatLinearRing;\n }\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction linkParser(node, objectStack) {\n parseNode(LINK_PARSERS, node, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction whenParser(node, objectStack) {\n var gxTrackObject = /** @type {GxTrackObject} */ (objectStack[objectStack.length - 1]);\n var whens = gxTrackObject.whens;\n var s = getAllTextContent(node, false);\n var when = Date.parse(s);\n whens.push(isNaN(when) ? 0 : when);\n}\n/**\n * @param {Node} node Node to append a TextNode with the color to.\n * @param {import(\"../color.js\").Color|string} color Color.\n */\nfunction writeColorTextNode(node, color) {\n var rgba = asArray(color);\n var opacity = (rgba.length == 4) ? rgba[3] : 1;\n /** @type {Array<string|number>} */\n var abgr = [opacity * 255, rgba[2], rgba[1], rgba[0]];\n for (var i = 0; i < 4; ++i) {\n var hex = Math.floor(/** @type {number} */ (abgr[i])).toString(16);\n abgr[i] = (hex.length == 1) ? '0' + hex : hex;\n }\n writeStringTextNode(node, abgr.join(''));\n}\n/**\n * @param {Node} node Node to append a TextNode with the coordinates to.\n * @param {Array<number>} coordinates Coordinates.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeCoordinatesTextNode(node, coordinates, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var layout = context['layout'];\n var stride = context['stride'];\n var dimension;\n if (layout == GeometryLayout.XY ||\n layout == GeometryLayout.XYM) {\n dimension = 2;\n }\n else if (layout == GeometryLayout.XYZ ||\n layout == GeometryLayout.XYZM) {\n dimension = 3;\n }\n else {\n assert(false, 34); // Invalid geometry layout\n }\n var ii = coordinates.length;\n var text = '';\n if (ii > 0) {\n text += coordinates[0];\n for (var d = 1; d < dimension; ++d) {\n text += ',' + coordinates[d];\n }\n for (var i = stride; i < ii; i += stride) {\n text += ' ' + coordinates[i];\n for (var d = 1; d < dimension; ++d) {\n text += ',' + coordinates[i + d];\n }\n }\n }\n writeStringTextNode(node, text);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar EXTENDEDDATA_NODE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'Data': makeChildAppender(writeDataNode),\n 'value': makeChildAppender(writeDataNodeValue),\n 'displayName': makeChildAppender(writeDataNodeName)\n});\n/**\n * @param {Element} node Node.\n * @param {{name: *, value: *}} pair Name value pair.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeDataNode(node, pair, objectStack) {\n node.setAttribute('name', pair.name);\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var value = pair.value;\n if (typeof value == 'object') {\n if (value !== null && value.displayName) {\n pushSerializeAndPop(context, EXTENDEDDATA_NODE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, [value.displayName], objectStack, ['displayName']);\n }\n if (value !== null && value.value) {\n pushSerializeAndPop(context, EXTENDEDDATA_NODE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, [value.value], objectStack, ['value']);\n }\n }\n else {\n pushSerializeAndPop(context, EXTENDEDDATA_NODE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, [value], objectStack, ['value']);\n }\n}\n/**\n * @param {Node} node Node to append a TextNode with the name to.\n * @param {string} name DisplayName.\n */\nfunction writeDataNodeName(node, name) {\n writeCDATASection(node, name);\n}\n/**\n * @param {Node} node Node to append a CDATA Section with the value to.\n * @param {string} value Value.\n */\nfunction writeDataNodeValue(node, value) {\n writeStringTextNode(node, value);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar DOCUMENT_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'Placemark': makeChildAppender(writePlacemark)\n});\n/**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node|undefined} Node.\n */\nvar DOCUMENT_NODE_FACTORY = function (value, objectStack, opt_nodeName) {\n var parentNode = objectStack[objectStack.length - 1].node;\n return createElementNS(parentNode.namespaceURI, 'Placemark');\n};\n/**\n * @param {Node} node Node.\n * @param {Array<Feature>} features Features.\n * @param {Array<*>} objectStack Object stack.\n * @this {KML}\n */\nfunction writeDocument(node, features, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n pushSerializeAndPop(context, DOCUMENT_SERIALIZERS, DOCUMENT_NODE_FACTORY, features, objectStack, undefined, this);\n}\n/**\n * A factory for creating Data nodes.\n * @const\n * @type {function(*, Array<*>): (Node|undefined)}\n */\nvar DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');\n/**\n * @param {Node} node Node.\n * @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeExtendedData(node, namesAndValues, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var names = namesAndValues.names;\n var values = namesAndValues.values;\n var length = names.length;\n for (var i = 0; i < length; i++) {\n pushSerializeAndPop(context, EXTENDEDDATA_NODE_SERIALIZERS, DATA_NODE_FACTORY, [{ name: names[i], value: values[i] }], objectStack);\n }\n}\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar ICON_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'href'\n], makeStructureNS(GX_NAMESPACE_URIS, [\n 'x', 'y', 'w', 'h'\n]));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar ICON_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'href': makeChildAppender(writeStringTextNode)\n}, makeStructureNS(GX_NAMESPACE_URIS, {\n 'x': makeChildAppender(writeDecimalTextNode),\n 'y': makeChildAppender(writeDecimalTextNode),\n 'w': makeChildAppender(writeDecimalTextNode),\n 'h': makeChildAppender(writeDecimalTextNode)\n}));\n/**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node|undefined} Node.\n */\nvar GX_NODE_FACTORY = function (value, objectStack, opt_nodeName) {\n return createElementNS(GX_NAMESPACE_URIS[0], 'gx:' + opt_nodeName);\n};\n/**\n * @param {Node} node Node.\n * @param {Object} icon Icon object.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeIcon(node, icon, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = ICON_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(icon, orderedKeys);\n pushSerializeAndPop(context, ICON_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n orderedKeys =\n ICON_SEQUENCE[GX_NAMESPACE_URIS[0]];\n values = makeSequence(icon, orderedKeys);\n pushSerializeAndPop(context, ICON_SERIALIZERS, GX_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar ICON_STYLE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'scale', 'heading', 'Icon', 'hotSpot'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar ICON_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'Icon': makeChildAppender(writeIcon),\n 'heading': makeChildAppender(writeDecimalTextNode),\n 'hotSpot': makeChildAppender(writeVec2),\n 'scale': makeChildAppender(writeScaleTextNode)\n});\n/**\n * @param {Node} node Node.\n * @param {import(\"../style/Icon.js\").default} style Icon style.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeIconStyle(node, style, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var /** @type {Object<string, any>} */ properties = {};\n var src = style.getSrc();\n var size = style.getSize();\n var iconImageSize = style.getImageSize();\n var iconProperties = {\n 'href': src\n };\n if (size) {\n iconProperties['w'] = size[0];\n iconProperties['h'] = size[1];\n var anchor = style.getAnchor(); // top-left\n var origin_1 = style.getOrigin(); // top-left\n if (origin_1 && iconImageSize && origin_1[0] !== 0 && origin_1[1] !== size[1]) {\n iconProperties['x'] = origin_1[0];\n iconProperties['y'] = iconImageSize[1] - (origin_1[1] + size[1]);\n }\n if (anchor && (anchor[0] !== size[0] / 2 || anchor[1] !== size[1] / 2)) {\n var /** @type {Vec2} */ hotSpot = {\n x: anchor[0],\n xunits: IconAnchorUnits.PIXELS,\n y: size[1] - anchor[1],\n yunits: IconAnchorUnits.PIXELS\n };\n properties['hotSpot'] = hotSpot;\n }\n }\n properties['Icon'] = iconProperties;\n var scale = style.getScale();\n if (scale !== 1) {\n properties['scale'] = scale;\n }\n var rotation = style.getRotation();\n if (rotation !== 0) {\n properties['heading'] = rotation; // 0-360\n }\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = ICON_STYLE_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, ICON_STYLE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar LABEL_STYLE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'color', 'scale'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar LABEL_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'color': makeChildAppender(writeColorTextNode),\n 'scale': makeChildAppender(writeScaleTextNode)\n});\n/**\n * @param {Node} node Node.\n * @param {Text} style style.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeLabelStyle(node, style, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var properties = {};\n var fill = style.getFill();\n if (fill) {\n properties['color'] = fill.getColor();\n }\n var scale = style.getScale();\n if (scale && scale !== 1) {\n properties['scale'] = scale;\n }\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = LABEL_STYLE_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, LABEL_STYLE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar LINE_STYLE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'color', 'width'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar LINE_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'color': makeChildAppender(writeColorTextNode),\n 'width': makeChildAppender(writeDecimalTextNode)\n});\n/**\n * @param {Node} node Node.\n * @param {Stroke} style style.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeLineStyle(node, style, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var properties = {\n 'color': style.getColor(),\n 'width': style.getWidth()\n };\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = LINE_STYLE_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, LINE_STYLE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @const\n * @type {Object<string, string>}\n */\nvar GEOMETRY_TYPE_TO_NODENAME = {\n 'Point': 'Point',\n 'LineString': 'LineString',\n 'LinearRing': 'LinearRing',\n 'Polygon': 'Polygon',\n 'MultiPoint': 'MultiGeometry',\n 'MultiLineString': 'MultiGeometry',\n 'MultiPolygon': 'MultiGeometry',\n 'GeometryCollection': 'MultiGeometry'\n};\n/**\n * @const\n * @param {*} value Value.\n * @param {Array<*>} objectStack Object stack.\n * @param {string=} opt_nodeName Node name.\n * @return {Node|undefined} Node.\n */\nvar GEOMETRY_NODE_FACTORY = function (value, objectStack, opt_nodeName) {\n if (value) {\n var parentNode = objectStack[objectStack.length - 1].node;\n return createElementNS(parentNode.namespaceURI, GEOMETRY_TYPE_TO_NODENAME[ /** @type {import(\"../geom/Geometry.js\").default} */(value).getType()]);\n }\n};\n/**\n * A factory for creating Point nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');\n/**\n * A factory for creating LineString nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');\n/**\n * A factory for creating LinearRing nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');\n/**\n * A factory for creating Polygon nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar POLYGON_NODE_FACTORY = makeSimpleNodeFactory('Polygon');\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'LineString': makeChildAppender(writePrimitiveGeometry),\n 'Point': makeChildAppender(writePrimitiveGeometry),\n 'Polygon': makeChildAppender(writePolygon),\n 'GeometryCollection': makeChildAppender(writeMultiGeometry)\n});\n/**\n * @param {Node} node Node.\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeMultiGeometry(node, geometry, objectStack) {\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var context = { node: node };\n var type = geometry.getType();\n /** @type {Array<import(\"../geom/Geometry.js\").default>} */\n var geometries;\n /** @type {function(*, Array<*>, string=): (Node|undefined)} */\n var factory;\n if (type == GeometryType.GEOMETRY_COLLECTION) {\n geometries = /** @type {GeometryCollection} */ (geometry).getGeometries();\n factory = GEOMETRY_NODE_FACTORY;\n }\n else if (type == GeometryType.MULTI_POINT) {\n geometries = /** @type {MultiPoint} */ (geometry).getPoints();\n factory = POINT_NODE_FACTORY;\n }\n else if (type == GeometryType.MULTI_LINE_STRING) {\n geometries =\n ( /** @type {MultiLineString} */(geometry)).getLineStrings();\n factory = LINE_STRING_NODE_FACTORY;\n }\n else if (type == GeometryType.MULTI_POLYGON) {\n geometries =\n ( /** @type {MultiPolygon} */(geometry)).getPolygons();\n factory = POLYGON_NODE_FACTORY;\n }\n else {\n assert(false, 39); // Unknown geometry type\n }\n pushSerializeAndPop(context, MULTI_GEOMETRY_SERIALIZERS, factory, geometries, objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar BOUNDARY_IS_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'LinearRing': makeChildAppender(writePrimitiveGeometry)\n});\n/**\n * @param {Node} node Node.\n * @param {import(\"../geom/LinearRing.js\").default} linearRing Linear ring.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeBoundaryIs(node, linearRing, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n pushSerializeAndPop(context, BOUNDARY_IS_SERIALIZERS, LINEAR_RING_NODE_FACTORY, [linearRing], objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar PLACEMARK_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'ExtendedData': makeChildAppender(writeExtendedData),\n 'MultiGeometry': makeChildAppender(writeMultiGeometry),\n 'LineString': makeChildAppender(writePrimitiveGeometry),\n 'LinearRing': makeChildAppender(writePrimitiveGeometry),\n 'Point': makeChildAppender(writePrimitiveGeometry),\n 'Polygon': makeChildAppender(writePolygon),\n 'Style': makeChildAppender(writeStyle),\n 'address': makeChildAppender(writeStringTextNode),\n 'description': makeChildAppender(writeStringTextNode),\n 'name': makeChildAppender(writeStringTextNode),\n 'open': makeChildAppender(writeBooleanTextNode),\n 'phoneNumber': makeChildAppender(writeStringTextNode),\n 'styleUrl': makeChildAppender(writeStringTextNode),\n 'visibility': makeChildAppender(writeBooleanTextNode)\n});\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar PLACEMARK_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'name', 'open', 'visibility', 'address', 'phoneNumber', 'description',\n 'styleUrl', 'Style'\n]);\n/**\n * A factory for creating ExtendedData nodes.\n * @const\n * @type {function(*, Array<*>): (Node|undefined)}\n */\nvar EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');\n/**\n * FIXME currently we do serialize arbitrary/custom feature properties\n * (ExtendedData).\n * @param {Element} node Node.\n * @param {Feature} feature Feature.\n * @param {Array<*>} objectStack Object stack.\n * @this {KML}\n */\nfunction writePlacemark(node, feature, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n // set id\n if (feature.getId()) {\n node.setAttribute('id', /** @type {string} */ (feature.getId()));\n }\n // serialize properties (properties unknown to KML are not serialized)\n var properties = feature.getProperties();\n // don't export these to ExtendedData\n var filter = { 'address': 1, 'description': 1, 'name': 1, 'open': 1,\n 'phoneNumber': 1, 'styleUrl': 1, 'visibility': 1 };\n filter[feature.getGeometryName()] = 1;\n var keys = Object.keys(properties || {}).sort().filter(function (v) {\n return !filter[v];\n });\n var styleFunction = feature.getStyleFunction();\n if (styleFunction) {\n // FIXME the styles returned by the style function are supposed to be\n // resolution-independent here\n var styles = styleFunction(feature, 0);\n if (styles) {\n var style = Array.isArray(styles) ? styles[0] : styles;\n if (this.writeStyles_) {\n properties['Style'] = style;\n }\n var textStyle = style.getText();\n if (textStyle) {\n properties['name'] = textStyle.getText();\n }\n }\n }\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = PLACEMARK_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, PLACEMARK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n if (keys.length > 0) {\n var sequence = makeSequence(properties, keys);\n var namesAndValues = { names: keys, values: sequence };\n pushSerializeAndPop(context, PLACEMARK_SERIALIZERS, EXTENDEDDATA_NODE_FACTORY, [namesAndValues], objectStack);\n }\n // serialize geometry\n var options = /** @type {import(\"./Feature.js\").WriteOptions} */ (objectStack[0]);\n var geometry = feature.getGeometry();\n if (geometry) {\n geometry = transformGeometryWithOptions(geometry, true, options);\n }\n pushSerializeAndPop(context, PLACEMARK_SERIALIZERS, GEOMETRY_NODE_FACTORY, [geometry], objectStack);\n}\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar PRIMITIVE_GEOMETRY_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'extrude', 'tessellate', 'altitudeMode', 'coordinates'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'extrude': makeChildAppender(writeBooleanTextNode),\n 'tessellate': makeChildAppender(writeBooleanTextNode),\n 'altitudeMode': makeChildAppender(writeStringTextNode),\n 'coordinates': makeChildAppender(writeCoordinatesTextNode)\n});\n/**\n * @param {Node} node Node.\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writePrimitiveGeometry(node, geometry, objectStack) {\n var flatCoordinates = geometry.getFlatCoordinates();\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n context['layout'] = geometry.getLayout();\n context['stride'] = geometry.getStride();\n // serialize properties (properties unknown to KML are not serialized)\n var properties = geometry.getProperties();\n properties.coordinates = flatCoordinates;\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = PRIMITIVE_GEOMETRY_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, PRIMITIVE_GEOMETRY_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar POLYGON_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'outerBoundaryIs': makeChildAppender(writeBoundaryIs),\n 'innerBoundaryIs': makeChildAppender(writeBoundaryIs)\n});\n/**\n * A factory for creating innerBoundaryIs nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');\n/**\n * A factory for creating outerBoundaryIs nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');\n/**\n * @param {Node} node Node.\n * @param {Polygon} polygon Polygon.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writePolygon(node, polygon, objectStack) {\n var linearRings = polygon.getLinearRings();\n var outerRing = linearRings.shift();\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n // inner rings\n pushSerializeAndPop(context, POLYGON_SERIALIZERS, INNER_BOUNDARY_NODE_FACTORY, linearRings, objectStack);\n // outer ring\n pushSerializeAndPop(context, POLYGON_SERIALIZERS, OUTER_BOUNDARY_NODE_FACTORY, [outerRing], objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar POLY_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'color': makeChildAppender(writeColorTextNode)\n});\n/**\n * A factory for creating coordinates nodes.\n * @const\n * @type {function(*, Array<*>, string=): (Node|undefined)}\n */\nvar COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');\n/**\n * @param {Node} node Node.\n * @param {Fill} style Style.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writePolyStyle(node, style, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n pushSerializeAndPop(context, POLY_STYLE_SERIALIZERS, COLOR_NODE_FACTORY, [style.getColor()], objectStack);\n}\n/**\n * @param {Node} node Node to append a TextNode with the scale to.\n * @param {number|undefined} scale Scale.\n */\nfunction writeScaleTextNode(node, scale) {\n // the Math is to remove any excess decimals created by float arithmetic\n writeDecimalTextNode(node, Math.round(scale * 1e6) / 1e6);\n}\n/**\n * @const\n * @type {Object<string, Array<string>>}\n */\n// @ts-ignore\nvar STYLE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'IconStyle', 'LabelStyle', 'LineStyle', 'PolyStyle'\n]);\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\n// @ts-ignore\nvar STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {\n 'IconStyle': makeChildAppender(writeIconStyle),\n 'LabelStyle': makeChildAppender(writeLabelStyle),\n 'LineStyle': makeChildAppender(writeLineStyle),\n 'PolyStyle': makeChildAppender(writePolyStyle)\n});\n/**\n * @param {Node} node Node.\n * @param {Style} style Style.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeStyle(node, style, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var properties = {};\n var fillStyle = style.getFill();\n var strokeStyle = style.getStroke();\n var imageStyle = style.getImage();\n var textStyle = style.getText();\n if (imageStyle && typeof /** @type {?} */ (imageStyle).getSrc === 'function') {\n properties['IconStyle'] = imageStyle;\n }\n if (textStyle) {\n properties['LabelStyle'] = textStyle;\n }\n if (strokeStyle) {\n properties['LineStyle'] = strokeStyle;\n }\n if (fillStyle) {\n properties['PolyStyle'] = fillStyle;\n }\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = STYLE_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, STYLE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\n}\n/**\n * @param {Element} node Node to append a TextNode with the Vec2 to.\n * @param {Vec2} vec2 Vec2.\n */\nfunction writeVec2(node, vec2) {\n node.setAttribute('x', String(vec2.x));\n node.setAttribute('y', String(vec2.y));\n node.setAttribute('xunits', vec2.xunits);\n node.setAttribute('yunits', vec2.yunits);\n}\nexport default KML;\n//# sourceMappingURL=KML.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/IGC\n */\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport TextFeature from './TextFeature.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport LineString from '../geom/LineString.js';\nimport { get as getProjection } from '../proj.js';\n/**\n * IGC altitude/z. One of 'barometric', 'gps', 'none'.\n * @enum {string}\n */\nvar IGCZ = {\n BAROMETRIC: 'barometric',\n GPS: 'gps',\n NONE: 'none'\n};\n/**\n * @const\n * @type {RegExp}\n */\nvar B_RECORD_RE = /^B(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{5})([NS])(\\d{3})(\\d{5})([EW])([AV])(\\d{5})(\\d{5})/;\n/**\n * @const\n * @type {RegExp}\n */\nvar H_RECORD_RE = /^H.([A-Z]{3}).*?:(.*)/;\n/**\n * @const\n * @type {RegExp}\n */\nvar HFDTE_RECORD_RE = /^HFDTE(\\d{2})(\\d{2})(\\d{2})/;\n/**\n * A regular expression matching the newline characters `\\r\\n`, `\\r` and `\\n`.\n *\n * @const\n * @type {RegExp}\n */\nvar NEWLINE_RE = /\\r\\n|\\r|\\n/;\n/**\n * @typedef {Object} Options\n * @property {IGCZ|string} [altitudeMode='none'] Altitude mode. Possible\n * values are `'barometric'`, `'gps'`, and `'none'`.\n */\n/**\n * @classdesc\n * Feature format for `*.igc` flight recording files.\n *\n * As IGC sources contain a single feature,\n * {@link module:ol/format/IGC~IGC#readFeatures} will return the feature in an\n * array\n *\n * @api\n */\nvar IGC = /** @class */ (function (_super) {\n __extends(IGC, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function IGC(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection('EPSG:4326');\n /**\n * @private\n * @type {IGCZ}\n */\n _this.altitudeMode_ = options.altitudeMode ? options.altitudeMode : IGCZ.NONE;\n return _this;\n }\n /**\n * @inheritDoc\n */\n IGC.prototype.readFeatureFromText = function (text, opt_options) {\n var altitudeMode = this.altitudeMode_;\n var lines = text.split(NEWLINE_RE);\n /** @type {Object<string, string>} */\n var properties = {};\n var flatCoordinates = [];\n var year = 2000;\n var month = 0;\n var day = 1;\n var lastDateTime = -1;\n var i, ii;\n for (i = 0, ii = lines.length; i < ii; ++i) {\n var line = lines[i];\n var m = void 0;\n if (line.charAt(0) == 'B') {\n m = B_RECORD_RE.exec(line);\n if (m) {\n var hour = parseInt(m[1], 10);\n var minute = parseInt(m[2], 10);\n var second = parseInt(m[3], 10);\n var y = parseInt(m[4], 10) + parseInt(m[5], 10) / 60000;\n if (m[6] == 'S') {\n y = -y;\n }\n var x = parseInt(m[7], 10) + parseInt(m[8], 10) / 60000;\n if (m[9] == 'W') {\n x = -x;\n }\n flatCoordinates.push(x, y);\n if (altitudeMode != IGCZ.NONE) {\n var z = void 0;\n if (altitudeMode == IGCZ.GPS) {\n z = parseInt(m[11], 10);\n }\n else if (altitudeMode == IGCZ.BAROMETRIC) {\n z = parseInt(m[12], 10);\n }\n else {\n z = 0;\n }\n flatCoordinates.push(z);\n }\n var dateTime = Date.UTC(year, month, day, hour, minute, second);\n // Detect UTC midnight wrap around.\n if (dateTime < lastDateTime) {\n dateTime = Date.UTC(year, month, day + 1, hour, minute, second);\n }\n flatCoordinates.push(dateTime / 1000);\n lastDateTime = dateTime;\n }\n }\n else if (line.charAt(0) == 'H') {\n m = HFDTE_RECORD_RE.exec(line);\n if (m) {\n day = parseInt(m[1], 10);\n month = parseInt(m[2], 10) - 1;\n year = 2000 + parseInt(m[3], 10);\n }\n else {\n m = H_RECORD_RE.exec(line);\n if (m) {\n properties[m[1]] = m[2].trim();\n }\n }\n }\n }\n if (flatCoordinates.length === 0) {\n return null;\n }\n var layout = altitudeMode == IGCZ.NONE ? GeometryLayout.XYM : GeometryLayout.XYZM;\n var lineString = new LineString(flatCoordinates, layout);\n var feature = new Feature(transformGeometryWithOptions(lineString, false, opt_options));\n feature.setProperties(properties, true);\n return feature;\n };\n /**\n * @inheritDoc\n */\n IGC.prototype.readFeaturesFromText = function (text, opt_options) {\n var feature = this.readFeatureFromText(text, opt_options);\n if (feature) {\n return [feature];\n }\n else {\n return [];\n }\n };\n return IGC;\n}(TextFeature));\nexport default IGC;\n//# sourceMappingURL=IGC.js.map","/**\n * @module ol/render/Feature\n */\nimport { extend } from '../array.js';\nimport { createOrUpdateFromCoordinate, createOrUpdateFromFlatCoordinates, getCenter, getHeight } from '../extent.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport { linearRingss as linearRingssCenter } from '../geom/flat/center.js';\nimport { getInteriorPointOfArray, getInteriorPointsOfMultiArray } from '../geom/flat/interiorpoint.js';\nimport { interpolatePoint } from '../geom/flat/interpolate.js';\nimport { get as getProjection } from '../proj.js';\nimport { transform2D } from '../geom/flat/transform.js';\nimport { create as createTransform, compose as composeTransform } from '../transform.js';\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nvar tmpTransform = createTransform();\n/**\n * Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like\n * structure, optimized for vector tile rendering and styling. Geometry access\n * through the API is limited to getting the type and extent of the geometry.\n */\nvar RenderFeature = /** @class */ (function () {\n /**\n * @param {GeometryType} type Geometry type.\n * @param {Array<number>} flatCoordinates Flat coordinates. These always need\n * to be right-handed for polygons.\n * @param {Array<number>|Array<Array<number>>} ends Ends or Endss.\n * @param {Object<string, *>} properties Properties.\n * @param {number|string|undefined} id Feature id.\n */\n function RenderFeature(type, flatCoordinates, ends, properties, id) {\n /**\n * @private\n * @type {import(\"../extent.js\").Extent|undefined}\n */\n this.extent_;\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = id;\n /**\n * @private\n * @type {GeometryType}\n */\n this.type_ = type;\n /**\n * @private\n * @type {Array<number>}\n */\n this.flatCoordinates_ = flatCoordinates;\n /**\n * @private\n * @type {Array<number>}\n */\n this.flatInteriorPoints_ = null;\n /**\n * @private\n * @type {Array<number>}\n */\n this.flatMidpoints_ = null;\n /**\n * @private\n * @type {Array<number>|Array<Array<number>>}\n */\n this.ends_ = ends;\n /**\n * @private\n * @type {Object<string, *>}\n */\n this.properties_ = properties;\n }\n /**\n * Get a feature property by its key.\n * @param {string} key Key\n * @return {*} Value for the requested key.\n * @api\n */\n RenderFeature.prototype.get = function (key) {\n return this.properties_[key];\n };\n /**\n * Get the extent of this feature's geometry.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n RenderFeature.prototype.getExtent = function () {\n if (!this.extent_) {\n this.extent_ = this.type_ === GeometryType.POINT ?\n createOrUpdateFromCoordinate(this.flatCoordinates_) :\n createOrUpdateFromFlatCoordinates(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2);\n }\n return this.extent_;\n };\n /**\n * @return {Array<number>} Flat interior points.\n */\n RenderFeature.prototype.getFlatInteriorPoint = function () {\n if (!this.flatInteriorPoints_) {\n var flatCenter = getCenter(this.getExtent());\n this.flatInteriorPoints_ = getInteriorPointOfArray(this.flatCoordinates_, 0, /** @type {Array<number>} */ (this.ends_), 2, flatCenter, 0);\n }\n return this.flatInteriorPoints_;\n };\n /**\n * @return {Array<number>} Flat interior points.\n */\n RenderFeature.prototype.getFlatInteriorPoints = function () {\n if (!this.flatInteriorPoints_) {\n var flatCenters = linearRingssCenter(this.flatCoordinates_, 0, /** @type {Array<Array<number>>} */ (this.ends_), 2);\n this.flatInteriorPoints_ = getInteriorPointsOfMultiArray(this.flatCoordinates_, 0, /** @type {Array<Array<number>>} */ (this.ends_), 2, flatCenters);\n }\n return this.flatInteriorPoints_;\n };\n /**\n * @return {Array<number>} Flat midpoint.\n */\n RenderFeature.prototype.getFlatMidpoint = function () {\n if (!this.flatMidpoints_) {\n this.flatMidpoints_ = interpolatePoint(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, 0.5);\n }\n return this.flatMidpoints_;\n };\n /**\n * @return {Array<number>} Flat midpoints.\n */\n RenderFeature.prototype.getFlatMidpoints = function () {\n if (!this.flatMidpoints_) {\n this.flatMidpoints_ = [];\n var flatCoordinates = this.flatCoordinates_;\n var offset = 0;\n var ends = /** @type {Array<number>} */ (this.ends_);\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var midpoint = interpolatePoint(flatCoordinates, offset, end, 2, 0.5);\n extend(this.flatMidpoints_, midpoint);\n offset = end;\n }\n }\n return this.flatMidpoints_;\n };\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is set when reading data from a remote source.\n * @return {number|string|undefined} Id.\n * @api\n */\n RenderFeature.prototype.getId = function () {\n return this.id_;\n };\n /**\n * @return {Array<number>} Flat coordinates.\n */\n RenderFeature.prototype.getOrientedFlatCoordinates = function () {\n return this.flatCoordinates_;\n };\n /**\n * For API compatibility with {@link module:ol/Feature~Feature}, this method is useful when\n * determining the geometry type in style function (see {@link #getType}).\n * @return {RenderFeature} Feature.\n * @api\n */\n RenderFeature.prototype.getGeometry = function () {\n return this;\n };\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {RenderFeature} Simplified geometry.\n */\n RenderFeature.prototype.getSimplifiedGeometry = function (squaredTolerance) {\n return this;\n };\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Optional transform function.\n * @return {RenderFeature} Simplified geometry.\n */\n RenderFeature.prototype.simplifyTransformed = function (squaredTolerance, opt_transform) {\n return this;\n };\n /**\n * Get the feature properties.\n * @return {Object<string, *>} Feature properties.\n * @api\n */\n RenderFeature.prototype.getProperties = function () {\n return this.properties_;\n };\n /**\n * @return {number} Stride.\n */\n RenderFeature.prototype.getStride = function () {\n return 2;\n };\n /**\n * @return {undefined}\n */\n RenderFeature.prototype.getStyleFunction = function () {\n return undefined;\n };\n /**\n * Get the type of this feature's geometry.\n * @return {GeometryType} Geometry type.\n * @api\n */\n RenderFeature.prototype.getType = function () {\n return this.type_;\n };\n /**\n * Transform geometry coordinates from tile pixel space to projected.\n * The SRS of the source and destination are expected to be the same.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection.\n */\n RenderFeature.prototype.transform = function (source, destination) {\n source = getProjection(source);\n var pixelExtent = source.getExtent();\n var projectedExtent = source.getWorldExtent();\n var scale = getHeight(projectedExtent) / getHeight(pixelExtent);\n composeTransform(tmpTransform, projectedExtent[0], projectedExtent[3], scale, -scale, 0, 0, 0);\n transform2D(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, tmpTransform, this.flatCoordinates_);\n };\n return RenderFeature;\n}());\n/**\n * @return {Array<number>|Array<Array<number>>} Ends or endss.\n */\nRenderFeature.prototype.getEnds = function () {\n return this.ends_;\n};\nRenderFeature.prototype.getEndss = RenderFeature.prototype.getEnds;\n/**\n * @return {Array<number>} Flat coordinates.\n */\nRenderFeature.prototype.getFlatCoordinates =\n RenderFeature.prototype.getOrientedFlatCoordinates;\nexport default RenderFeature;\n//# sourceMappingURL=Feature.js.map","/**\n * @module ol/format/MVT\n */\n//FIXME Implement projection handling\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { assert } from '../asserts.js';\nimport PBF from 'pbf';\nimport FeatureFormat, { transformGeometryWithOptions } from './Feature.js';\nimport FormatType from './FormatType.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { linearRingIsClockwise } from '../geom/flat/orient.js';\nimport Projection from '../proj/Projection.js';\nimport Units from '../proj/Units.js';\nimport RenderFeature from '../render/Feature.js';\nimport { get } from '../proj.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../Feature.js\").FeatureClass} [featureClass] Class for features returned by\n * {@link module:ol/format/MVT#readFeatures}. Set to {@link module:ol/Feature~Feature} to get full editing and geometry\n * support at the cost of decreased rendering performance. The default is\n * {@link module:ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection.\n * @property {string} [geometryName='geometry'] Geometry name to use when creating features.\n * @property {string} [layerName='layer'] Name of the feature attribute that holds the layer name.\n * @property {Array<string>} [layers] Layers to read features from. If not provided, features will be read from all\n * @property {string} [idProperty] Optional property that will be assigned as the feature id and removed from the properties.\n * layers.\n */\n/**\n * @classdesc\n * Feature format for reading data in the Mapbox MVT format.\n *\n * @param {Options=} opt_options Options.\n * @api\n */\nvar MVT = /** @class */ (function (_super) {\n __extends(MVT, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function MVT(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @type {Projection}\n */\n _this.dataProjection = new Projection({\n code: '',\n units: Units.TILE_PIXELS\n });\n /**\n * @private\n * @type {import(\"../Feature.js\").FeatureClass}\n */\n _this.featureClass_ = options.featureClass ? options.featureClass : RenderFeature;\n /**\n * @private\n * @type {string|undefined}\n */\n _this.geometryName_ = options.geometryName;\n /**\n * @private\n * @type {string}\n */\n _this.layerName_ = options.layerName ? options.layerName : 'layer';\n /**\n * @private\n * @type {Array<string>}\n */\n _this.layers_ = options.layers ? options.layers : null;\n /**\n * @private\n * @type {string}\n */\n _this.idProperty_ = options.idProperty;\n return _this;\n }\n /**\n * Read the raw geometry from the pbf offset stored in a raw feature's geometry\n * property.\n * @param {PBF} pbf PBF.\n * @param {Object} feature Raw feature.\n * @param {Array<number>} flatCoordinates Array to store flat coordinates in.\n * @param {Array<number>} ends Array to store ends in.\n * @private\n */\n MVT.prototype.readRawGeometry_ = function (pbf, feature, flatCoordinates, ends) {\n pbf.pos = feature.geometry;\n var end = pbf.readVarint() + pbf.pos;\n var cmd = 1;\n var length = 0;\n var x = 0;\n var y = 0;\n var coordsLen = 0;\n var currentEnd = 0;\n while (pbf.pos < end) {\n if (!length) {\n var cmdLen = pbf.readVarint();\n cmd = cmdLen & 0x7;\n length = cmdLen >> 3;\n }\n length--;\n if (cmd === 1 || cmd === 2) {\n x += pbf.readSVarint();\n y += pbf.readSVarint();\n if (cmd === 1) { // moveTo\n if (coordsLen > currentEnd) {\n ends.push(coordsLen);\n currentEnd = coordsLen;\n }\n }\n flatCoordinates.push(x, y);\n coordsLen += 2;\n }\n else if (cmd === 7) {\n if (coordsLen > currentEnd) {\n // close polygon\n flatCoordinates.push(flatCoordinates[currentEnd], flatCoordinates[currentEnd + 1]);\n coordsLen += 2;\n }\n }\n else {\n assert(false, 59); // Invalid command found in the PBF\n }\n }\n if (coordsLen > currentEnd) {\n ends.push(coordsLen);\n currentEnd = coordsLen;\n }\n };\n /**\n * @private\n * @param {PBF} pbf PBF\n * @param {Object} rawFeature Raw Mapbox feature.\n * @param {import(\"./Feature.js\").ReadOptions} options Read options.\n * @return {import(\"../Feature.js\").FeatureLike} Feature.\n */\n MVT.prototype.createFeature_ = function (pbf, rawFeature, options) {\n var type = rawFeature.type;\n if (type === 0) {\n return null;\n }\n var feature;\n var values = rawFeature.properties;\n var id;\n if (!this.idProperty_) {\n id = rawFeature.id;\n }\n else {\n id = values[this.idProperty_];\n delete values[this.idProperty_];\n }\n values[this.layerName_] = rawFeature.layer.name;\n var flatCoordinates = [];\n var ends = [];\n this.readRawGeometry_(pbf, rawFeature, flatCoordinates, ends);\n var geometryType = getGeometryType(type, ends.length);\n if (this.featureClass_ === RenderFeature) {\n feature = new this.featureClass_(geometryType, flatCoordinates, ends, values, id);\n feature.transform(options.dataProjection, options.featureProjection);\n }\n else {\n var geom = void 0;\n if (geometryType == GeometryType.POLYGON) {\n var endss = [];\n var offset = 0;\n var prevEndIndex = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n if (!linearRingIsClockwise(flatCoordinates, offset, end, 2)) {\n endss.push(ends.slice(prevEndIndex, i));\n prevEndIndex = i;\n }\n offset = end;\n }\n if (endss.length > 1) {\n geom = new MultiPolygon(flatCoordinates, GeometryLayout.XY, endss);\n }\n else {\n geom = new Polygon(flatCoordinates, GeometryLayout.XY, ends);\n }\n }\n else {\n geom = geometryType === GeometryType.POINT ? new Point(flatCoordinates, GeometryLayout.XY) :\n geometryType === GeometryType.LINE_STRING ? new LineString(flatCoordinates, GeometryLayout.XY) :\n geometryType === GeometryType.POLYGON ? new Polygon(flatCoordinates, GeometryLayout.XY, ends) :\n geometryType === GeometryType.MULTI_POINT ? new MultiPoint(flatCoordinates, GeometryLayout.XY) :\n geometryType === GeometryType.MULTI_LINE_STRING ? new MultiLineString(flatCoordinates, GeometryLayout.XY, ends) :\n null;\n }\n var ctor = /** @type {typeof import(\"../Feature.js\").default} */ (this.featureClass_);\n feature = new ctor();\n if (this.geometryName_) {\n feature.setGeometryName(this.geometryName_);\n }\n var geometry = transformGeometryWithOptions(geom, false, options);\n feature.setGeometry(geometry);\n feature.setId(id);\n feature.setProperties(values, true);\n }\n return feature;\n };\n /**\n * @inheritDoc\n */\n MVT.prototype.getType = function () {\n return FormatType.ARRAY_BUFFER;\n };\n /**\n * Read all features.\n *\n * @param {ArrayBuffer} source Source.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {Array<import(\"../Feature.js\").FeatureLike>} Features.\n * @api\n */\n MVT.prototype.readFeatures = function (source, opt_options) {\n var layers = this.layers_;\n var options = /** @type {import(\"./Feature.js\").ReadOptions} */ (this.adaptOptions(opt_options));\n var dataProjection = get(options.dataProjection);\n dataProjection.setWorldExtent(options.extent);\n options.dataProjection = dataProjection;\n var pbf = new PBF(/** @type {ArrayBuffer} */ (source));\n var pbfLayers = pbf.readFields(layersPBFReader, {});\n var features = [];\n for (var name_1 in pbfLayers) {\n if (layers && layers.indexOf(name_1) == -1) {\n continue;\n }\n var pbfLayer = pbfLayers[name_1];\n var extent = pbfLayer ? [0, 0, pbfLayer.extent, pbfLayer.extent] : null;\n dataProjection.setExtent(extent);\n for (var i = 0, ii = pbfLayer.length; i < ii; ++i) {\n var rawFeature = readRawFeature(pbf, pbfLayer, i);\n features.push(this.createFeature_(pbf, rawFeature, options));\n }\n }\n return features;\n };\n /**\n * @inheritDoc\n * @api\n */\n MVT.prototype.readProjection = function (source) {\n return this.dataProjection;\n };\n /**\n * Sets the layers that features will be read from.\n * @param {Array<string>} layers Layers.\n * @api\n */\n MVT.prototype.setLayers = function (layers) {\n this.layers_ = layers;\n };\n return MVT;\n}(FeatureFormat));\n/**\n * Reader callback for parsing layers.\n * @param {number} tag The tag.\n * @param {Object} layers The layers object.\n * @param {PBF} pbf The PBF.\n */\nfunction layersPBFReader(tag, layers, pbf) {\n if (tag === 3) {\n var layer = {\n keys: [],\n values: [],\n features: []\n };\n var end = pbf.readVarint() + pbf.pos;\n pbf.readFields(layerPBFReader, layer, end);\n layer.length = layer.features.length;\n if (layer.length) {\n layers[layer.name] = layer;\n }\n }\n}\n/**\n * Reader callback for parsing layer.\n * @param {number} tag The tag.\n * @param {Object} layer The layer object.\n * @param {PBF} pbf The PBF.\n */\nfunction layerPBFReader(tag, layer, pbf) {\n if (tag === 15) {\n layer.version = pbf.readVarint();\n }\n else if (tag === 1) {\n layer.name = pbf.readString();\n }\n else if (tag === 5) {\n layer.extent = pbf.readVarint();\n }\n else if (tag === 2) {\n layer.features.push(pbf.pos);\n }\n else if (tag === 3) {\n layer.keys.push(pbf.readString());\n }\n else if (tag === 4) {\n var value = null;\n var end = pbf.readVarint() + pbf.pos;\n while (pbf.pos < end) {\n tag = pbf.readVarint() >> 3;\n value = tag === 1 ? pbf.readString() :\n tag === 2 ? pbf.readFloat() :\n tag === 3 ? pbf.readDouble() :\n tag === 4 ? pbf.readVarint64() :\n tag === 5 ? pbf.readVarint() :\n tag === 6 ? pbf.readSVarint() :\n tag === 7 ? pbf.readBoolean() : null;\n }\n layer.values.push(value);\n }\n}\n/**\n * Reader callback for parsing feature.\n * @param {number} tag The tag.\n * @param {Object} feature The feature object.\n * @param {PBF} pbf The PBF.\n */\nfunction featurePBFReader(tag, feature, pbf) {\n if (tag == 1) {\n feature.id = pbf.readVarint();\n }\n else if (tag == 2) {\n var end = pbf.readVarint() + pbf.pos;\n while (pbf.pos < end) {\n var key = feature.layer.keys[pbf.readVarint()];\n var value = feature.layer.values[pbf.readVarint()];\n feature.properties[key] = value;\n }\n }\n else if (tag == 3) {\n feature.type = pbf.readVarint();\n }\n else if (tag == 4) {\n feature.geometry = pbf.pos;\n }\n}\n/**\n * Read a raw feature from the pbf offset stored at index `i` in the raw layer.\n * @param {PBF} pbf PBF.\n * @param {Object} layer Raw layer.\n * @param {number} i Index of the feature in the raw layer's `features` array.\n * @return {Object} Raw feature.\n */\nfunction readRawFeature(pbf, layer, i) {\n pbf.pos = layer.features[i];\n var end = pbf.readVarint() + pbf.pos;\n var feature = {\n layer: layer,\n type: 0,\n properties: {}\n };\n pbf.readFields(featurePBFReader, feature, end);\n return feature;\n}\n/**\n * @param {number} type The raw feature's geometry type\n * @param {number} numEnds Number of ends of the flat coordinates of the\n * geometry.\n * @return {GeometryType} The geometry type.\n */\nfunction getGeometryType(type, numEnds) {\n /** @type {GeometryType} */\n var geometryType;\n if (type === 1) {\n geometryType = numEnds === 1 ?\n GeometryType.POINT : GeometryType.MULTI_POINT;\n }\n else if (type === 2) {\n geometryType = numEnds === 1 ?\n GeometryType.LINE_STRING :\n GeometryType.MULTI_LINE_STRING;\n }\n else if (type === 3) {\n geometryType = GeometryType.POLYGON;\n // MultiPolygon not relevant for rendering - winding order determines\n // outer rings of polygons.\n }\n return geometryType;\n}\nexport default MVT;\n//# sourceMappingURL=MVT.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/OSMXML\n */\n// FIXME add typedef for stack state objects\nimport { extend } from '../array.js';\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport XMLFeature from './XMLFeature.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport LineString from '../geom/LineString.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { isEmpty } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\nimport { pushParseAndPop, makeStructureNS } from '../xml.js';\n/**\n * @const\n * @type {Array<null>}\n */\nvar NAMESPACE_URIS = [null];\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar WAY_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'nd': readNd,\n 'tag': readTag\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'node': readNode,\n 'way': readWay\n});\n/**\n * @classdesc\n * Feature format for reading data in the\n * [OSMXML format](http://wiki.openstreetmap.org/wiki/OSM_XML).\n *\n * @api\n */\nvar OSMXML = /** @class */ (function (_super) {\n __extends(OSMXML, _super);\n function OSMXML() {\n var _this = _super.call(this) || this;\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection('EPSG:4326');\n return _this;\n }\n /**\n * @inheritDoc\n */\n OSMXML.prototype.readFeaturesFromNode = function (node, opt_options) {\n var options = this.getReadOptions(node, opt_options);\n if (node.localName == 'osm') {\n var state = pushParseAndPop({\n nodes: {},\n ways: [],\n features: []\n }, PARSERS, node, [options]);\n // parse nodes in ways\n for (var j = 0; j < state.ways.length; j++) {\n var values = /** @type {Object} */ (state.ways[j]);\n /** @type {Array<number>} */\n var flatCoordinates = [];\n for (var i = 0, ii = values.ndrefs.length; i < ii; i++) {\n var point = state.nodes[values.ndrefs[i]];\n extend(flatCoordinates, point);\n }\n var geometry = void 0;\n if (values.ndrefs[0] == values.ndrefs[values.ndrefs.length - 1]) {\n // closed way\n geometry = new Polygon(flatCoordinates, GeometryLayout.XY, [flatCoordinates.length]);\n }\n else {\n geometry = new LineString(flatCoordinates, GeometryLayout.XY);\n }\n transformGeometryWithOptions(geometry, false, options);\n var feature = new Feature(geometry);\n feature.setId(values.id);\n feature.setProperties(values.tags, true);\n state.features.push(feature);\n }\n if (state.features) {\n return state.features;\n }\n }\n return [];\n };\n return OSMXML;\n}(XMLFeature));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar NODE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'tag': readTag\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction readNode(node, objectStack) {\n var options = /** @type {import(\"./Feature.js\").ReadOptions} */ (objectStack[0]);\n var state = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var id = node.getAttribute('id');\n /** @type {import(\"../coordinate.js\").Coordinate} */\n var coordinates = [\n parseFloat(node.getAttribute('lon')),\n parseFloat(node.getAttribute('lat'))\n ];\n state.nodes[id] = coordinates;\n var values = pushParseAndPop({\n tags: {}\n }, NODE_PARSERS, node, objectStack);\n if (!isEmpty(values.tags)) {\n var geometry = new Point(coordinates);\n transformGeometryWithOptions(geometry, false, options);\n var feature = new Feature(geometry);\n feature.setId(id);\n feature.setProperties(values.tags, true);\n state.features.push(feature);\n }\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction readWay(node, objectStack) {\n var id = node.getAttribute('id');\n var values = pushParseAndPop({\n id: id,\n ndrefs: [],\n tags: {}\n }, WAY_PARSERS, node, objectStack);\n var state = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n state.ways.push(values);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction readNd(node, objectStack) {\n var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n values.ndrefs.push(node.getAttribute('ref'));\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction readTag(node, objectStack) {\n var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n values.tags[node.getAttribute('k')] = node.getAttribute('v');\n}\nexport default OSMXML;\n//# sourceMappingURL=OSMXML.js.map","/**\n * @module ol/geom/flat/flip\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 {Array<number>=} opt_dest Destination.\n * @param {number=} opt_destOffset Destination offset.\n * @return {Array<number>} Flat coordinates.\n */\nexport function flipXY(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) {\n var dest, destOffset;\n if (opt_dest !== undefined) {\n dest = opt_dest;\n destOffset = opt_destOffset !== undefined ? opt_destOffset : 0;\n }\n else {\n dest = [];\n destOffset = 0;\n }\n var j = offset;\n while (j < end) {\n var x = flatCoordinates[j++];\n dest[destOffset++] = flatCoordinates[j++];\n dest[destOffset++] = x;\n for (var k = 2; k < stride; ++k) {\n dest[destOffset++] = flatCoordinates[j++];\n }\n }\n dest.length = destOffset;\n return dest;\n}\n//# sourceMappingURL=flip.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/Polyline\n */\nimport { assert } from '../asserts.js';\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport TextFeature from './TextFeature.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport LineString from '../geom/LineString.js';\nimport { getStrideForLayout } from '../geom/SimpleGeometry.js';\nimport { flipXY } from '../geom/flat/flip.js';\nimport { inflateCoordinates } from '../geom/flat/inflate.js';\nimport { get as getProjection } from '../proj.js';\n/**\n * @typedef {Object} Options\n * @property {number} [factor=1e5] The factor by which the coordinates values will be scaled.\n * @property {GeometryLayout} [geometryLayout='XY'] Layout of the\n * feature geometries created by the format reader.\n */\n/**\n * @classdesc\n * Feature format for reading and writing data in the Encoded\n * Polyline Algorithm Format.\n *\n * When reading features, the coordinates are assumed to be in two dimensions\n * and in [latitude, longitude] order.\n *\n * As Polyline sources contain a single feature,\n * {@link module:ol/format/Polyline~Polyline#readFeatures} will return the\n * feature in an array.\n *\n * @api\n */\nvar Polyline = /** @class */ (function (_super) {\n __extends(Polyline, _super);\n /**\n * @param {Options=} opt_options Optional configuration object.\n */\n function Polyline(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection('EPSG:4326');\n /**\n * @private\n * @type {number}\n */\n _this.factor_ = options.factor ? options.factor : 1e5;\n /**\n * @private\n * @type {GeometryLayout}\n */\n _this.geometryLayout_ = options.geometryLayout ?\n options.geometryLayout : GeometryLayout.XY;\n return _this;\n }\n /**\n * @inheritDoc\n */\n Polyline.prototype.readFeatureFromText = function (text, opt_options) {\n var geometry = this.readGeometryFromText(text, opt_options);\n return new Feature(geometry);\n };\n /**\n * @inheritDoc\n */\n Polyline.prototype.readFeaturesFromText = function (text, opt_options) {\n var feature = this.readFeatureFromText(text, opt_options);\n return [feature];\n };\n /**\n * @inheritDoc\n */\n Polyline.prototype.readGeometryFromText = function (text, opt_options) {\n var stride = getStrideForLayout(this.geometryLayout_);\n var flatCoordinates = decodeDeltas(text, stride, this.factor_);\n flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);\n var coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride);\n var lineString = new LineString(coordinates, this.geometryLayout_);\n return transformGeometryWithOptions(lineString, false, this.adaptOptions(opt_options));\n };\n /**\n * @inheritDoc\n */\n Polyline.prototype.writeFeatureText = function (feature, opt_options) {\n var geometry = feature.getGeometry();\n if (geometry) {\n return this.writeGeometryText(geometry, opt_options);\n }\n else {\n assert(false, 40); // Expected `feature` to have a geometry\n return '';\n }\n };\n /**\n * @inheritDoc\n */\n Polyline.prototype.writeFeaturesText = function (features, opt_options) {\n return this.writeFeatureText(features[0], opt_options);\n };\n /**\n * @inheritDoc\n */\n Polyline.prototype.writeGeometryText = function (geometry, opt_options) {\n geometry = /** @type {LineString} */\n (transformGeometryWithOptions(geometry, true, this.adaptOptions(opt_options)));\n var flatCoordinates = geometry.getFlatCoordinates();\n var stride = geometry.getStride();\n flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);\n return encodeDeltas(flatCoordinates, stride, this.factor_);\n };\n return Polyline;\n}(TextFeature));\n/**\n * Encode a list of n-dimensional points and return an encoded string\n *\n * Attention: This function will modify the passed array!\n *\n * @param {Array<number>} numbers A list of n-dimensional points.\n * @param {number} stride The number of dimension of the points in the list.\n * @param {number=} opt_factor The factor by which the numbers will be\n * multiplied. The remaining decimal places will get rounded away.\n * Default is `1e5`.\n * @return {string} The encoded string.\n * @api\n */\nexport function encodeDeltas(numbers, stride, opt_factor) {\n var factor = opt_factor ? opt_factor : 1e5;\n var d;\n var lastNumbers = new Array(stride);\n for (d = 0; d < stride; ++d) {\n lastNumbers[d] = 0;\n }\n for (var i = 0, ii = numbers.length; i < ii;) {\n for (d = 0; d < stride; ++d, ++i) {\n var num = numbers[i];\n var delta = num - lastNumbers[d];\n lastNumbers[d] = num;\n numbers[i] = delta;\n }\n }\n return encodeFloats(numbers, factor);\n}\n/**\n * Decode a list of n-dimensional points from an encoded string\n *\n * @param {string} encoded An encoded string.\n * @param {number} stride The number of dimension of the points in the\n * encoded string.\n * @param {number=} opt_factor The factor by which the resulting numbers will\n * be divided. Default is `1e5`.\n * @return {Array<number>} A list of n-dimensional points.\n * @api\n */\nexport function decodeDeltas(encoded, stride, opt_factor) {\n var factor = opt_factor ? opt_factor : 1e5;\n var d;\n /** @type {Array<number>} */\n var lastNumbers = new Array(stride);\n for (d = 0; d < stride; ++d) {\n lastNumbers[d] = 0;\n }\n var numbers = decodeFloats(encoded, factor);\n for (var i = 0, ii = numbers.length; i < ii;) {\n for (d = 0; d < stride; ++d, ++i) {\n lastNumbers[d] += numbers[i];\n numbers[i] = lastNumbers[d];\n }\n }\n return numbers;\n}\n/**\n * Encode a list of floating point numbers and return an encoded string\n *\n * Attention: This function will modify the passed array!\n *\n * @param {Array<number>} numbers A list of floating point numbers.\n * @param {number=} opt_factor The factor by which the numbers will be\n * multiplied. The remaining decimal places will get rounded away.\n * Default is `1e5`.\n * @return {string} The encoded string.\n * @api\n */\nexport function encodeFloats(numbers, opt_factor) {\n var factor = opt_factor ? opt_factor : 1e5;\n for (var i = 0, ii = numbers.length; i < ii; ++i) {\n numbers[i] = Math.round(numbers[i] * factor);\n }\n return encodeSignedIntegers(numbers);\n}\n/**\n * Decode a list of floating point numbers from an encoded string\n *\n * @param {string} encoded An encoded string.\n * @param {number=} opt_factor The factor by which the result will be divided.\n * Default is `1e5`.\n * @return {Array<number>} A list of floating point numbers.\n * @api\n */\nexport function decodeFloats(encoded, opt_factor) {\n var factor = opt_factor ? opt_factor : 1e5;\n var numbers = decodeSignedIntegers(encoded);\n for (var i = 0, ii = numbers.length; i < ii; ++i) {\n numbers[i] /= factor;\n }\n return numbers;\n}\n/**\n * Encode a list of signed integers and return an encoded string\n *\n * Attention: This function will modify the passed array!\n *\n * @param {Array<number>} numbers A list of signed integers.\n * @return {string} The encoded string.\n */\nexport function encodeSignedIntegers(numbers) {\n for (var i = 0, ii = numbers.length; i < ii; ++i) {\n var num = numbers[i];\n numbers[i] = (num < 0) ? ~(num << 1) : (num << 1);\n }\n return encodeUnsignedIntegers(numbers);\n}\n/**\n * Decode a list of signed integers from an encoded string\n *\n * @param {string} encoded An encoded string.\n * @return {Array<number>} A list of signed integers.\n */\nexport function decodeSignedIntegers(encoded) {\n var numbers = decodeUnsignedIntegers(encoded);\n for (var i = 0, ii = numbers.length; i < ii; ++i) {\n var num = numbers[i];\n numbers[i] = (num & 1) ? ~(num >> 1) : (num >> 1);\n }\n return numbers;\n}\n/**\n * Encode a list of unsigned integers and return an encoded string\n *\n * @param {Array<number>} numbers A list of unsigned integers.\n * @return {string} The encoded string.\n */\nexport function encodeUnsignedIntegers(numbers) {\n var encoded = '';\n for (var i = 0, ii = numbers.length; i < ii; ++i) {\n encoded += encodeUnsignedInteger(numbers[i]);\n }\n return encoded;\n}\n/**\n * Decode a list of unsigned integers from an encoded string\n *\n * @param {string} encoded An encoded string.\n * @return {Array<number>} A list of unsigned integers.\n */\nexport function decodeUnsignedIntegers(encoded) {\n var numbers = [];\n var current = 0;\n var shift = 0;\n for (var i = 0, ii = encoded.length; i < ii; ++i) {\n var b = encoded.charCodeAt(i) - 63;\n current |= (b & 0x1f) << shift;\n if (b < 0x20) {\n numbers.push(current);\n current = 0;\n shift = 0;\n }\n else {\n shift += 5;\n }\n }\n return numbers;\n}\n/**\n * Encode one single unsigned integer and return an encoded string\n *\n * @param {number} num Unsigned integer that should be encoded.\n * @return {string} The encoded string.\n */\nexport function encodeUnsignedInteger(num) {\n var value, encoded = '';\n while (num >= 0x20) {\n value = (0x20 | (num & 0x1f)) + 63;\n encoded += String.fromCharCode(value);\n num >>= 5;\n }\n value = num + 63;\n encoded += String.fromCharCode(value);\n return encoded;\n}\nexport default Polyline;\n//# sourceMappingURL=Polyline.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/TopoJSON\n */\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport JSONFeature from './JSONFeature.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\nimport { get as getProjection } from '../proj.js';\n/**\n * @typedef {import(\"topojson-specification\").Topology} TopoJSONTopology\n * @typedef {import(\"topojson-specification\").GeometryCollection} TopoJSONGeometryCollection\n * @typedef {import(\"topojson-specification\").GeometryObject} TopoJSONGeometry\n * @typedef {import(\"topojson-specification\").Point} TopoJSONPoint\n * @typedef {import(\"topojson-specification\").MultiPoint} TopoJSONMultiPoint\n * @typedef {import(\"topojson-specification\").LineString} TopoJSONLineString\n * @typedef {import(\"topojson-specification\").MultiLineString} TopoJSONMultiLineString\n * @typedef {import(\"topojson-specification\").Polygon} TopoJSONPolygon\n * @typedef {import(\"topojson-specification\").MultiPolygon} TopoJSONMultiPolygon\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../proj.js\").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.\n * @property {string} [layerName] Set the name of the TopoJSON topology\n * `objects`'s children as feature property with the specified name. This means\n * that when set to `'layer'`, a topology like\n * ```\n * {\n * \"type\": \"Topology\",\n * \"objects\": {\n * \"example\": {\n * \"type\": \"GeometryCollection\",\n * \"geometries\": []\n * }\n * }\n * }\n * ```\n * will result in features that have a property `'layer'` set to `'example'`.\n * When not set, no property will be added to features.\n * @property {Array<string>} [layers] Names of the TopoJSON topology's\n * `objects`'s children to read features from. If not provided, features will\n * be read from all children.\n */\n/**\n * @classdesc\n * Feature format for reading data in the TopoJSON format.\n *\n * @api\n */\nvar TopoJSON = /** @class */ (function (_super) {\n __extends(TopoJSON, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function TopoJSON(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {string|undefined}\n */\n _this.layerName_ = options.layerName;\n /**\n * @private\n * @type {?Array<string>}\n */\n _this.layers_ = options.layers ? options.layers : null;\n /**\n * @inheritDoc\n */\n _this.dataProjection = getProjection(options.dataProjection ?\n options.dataProjection : 'EPSG:4326');\n return _this;\n }\n /**\n * @inheritDoc\n */\n TopoJSON.prototype.readFeaturesFromObject = function (object, opt_options) {\n if (object.type == 'Topology') {\n var topoJSONTopology = /** @type {TopoJSONTopology} */ (object);\n var transform = void 0, scale = null, translate = null;\n if (topoJSONTopology['transform']) {\n transform = topoJSONTopology['transform'];\n scale = transform['scale'];\n translate = transform['translate'];\n }\n var arcs = topoJSONTopology['arcs'];\n if (transform) {\n transformArcs(arcs, scale, translate);\n }\n /** @type {Array<Feature>} */\n var features = [];\n var topoJSONFeatures = topoJSONTopology['objects'];\n var property = this.layerName_;\n var feature = void 0;\n for (var objectName in topoJSONFeatures) {\n if (this.layers_ && this.layers_.indexOf(objectName) == -1) {\n continue;\n }\n if (topoJSONFeatures[objectName].type === 'GeometryCollection') {\n feature = /** @type {TopoJSONGeometryCollection} */ (topoJSONFeatures[objectName]);\n features.push.apply(features, readFeaturesFromGeometryCollection(feature, arcs, scale, translate, property, objectName, opt_options));\n }\n else {\n feature = /** @type {TopoJSONGeometry} */ (topoJSONFeatures[objectName]);\n features.push(readFeatureFromGeometry(feature, arcs, scale, translate, property, objectName, opt_options));\n }\n }\n return features;\n }\n else {\n return [];\n }\n };\n /**\n * @inheritDoc\n */\n TopoJSON.prototype.readProjectionFromObject = function (object) {\n return this.dataProjection;\n };\n return TopoJSON;\n}(JSONFeature));\n/**\n * @const\n * @type {Object<string, function(TopoJSONGeometry, Array, ...Array=): import(\"../geom/Geometry.js\").default>}\n */\nvar GEOMETRY_READERS = {\n 'Point': readPointGeometry,\n 'LineString': readLineStringGeometry,\n 'Polygon': readPolygonGeometry,\n 'MultiPoint': readMultiPointGeometry,\n 'MultiLineString': readMultiLineStringGeometry,\n 'MultiPolygon': readMultiPolygonGeometry\n};\n/**\n * Concatenate arcs into a coordinate array.\n * @param {Array<number>} indices Indices of arcs to concatenate. Negative\n * values indicate arcs need to be reversed.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs (already\n * transformed).\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates array.\n */\nfunction concatenateArcs(indices, arcs) {\n /** @type {Array<import(\"../coordinate.js\").Coordinate>} */\n var coordinates = [];\n var index, arc;\n for (var i = 0, ii = indices.length; i < ii; ++i) {\n index = indices[i];\n if (i > 0) {\n // splicing together arcs, discard last point\n coordinates.pop();\n }\n if (index >= 0) {\n // forward arc\n arc = arcs[index];\n }\n else {\n // reverse arc\n arc = arcs[~index].slice().reverse();\n }\n coordinates.push.apply(coordinates, arc);\n }\n // provide fresh copies of coordinate arrays\n for (var j = 0, jj = coordinates.length; j < jj; ++j) {\n coordinates[j] = coordinates[j].slice();\n }\n return coordinates;\n}\n/**\n * Create a point from a TopoJSON geometry object.\n *\n * @param {TopoJSONPoint} object TopoJSON object.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n * @return {Point} Geometry.\n */\nfunction readPointGeometry(object, scale, translate) {\n var coordinates = object['coordinates'];\n if (scale && translate) {\n transformVertex(coordinates, scale, translate);\n }\n return new Point(coordinates);\n}\n/**\n * Create a multi-point from a TopoJSON geometry object.\n *\n * @param {TopoJSONMultiPoint} object TopoJSON object.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n * @return {MultiPoint} Geometry.\n */\nfunction readMultiPointGeometry(object, scale, translate) {\n var coordinates = object['coordinates'];\n if (scale && translate) {\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n transformVertex(coordinates[i], scale, translate);\n }\n }\n return new MultiPoint(coordinates);\n}\n/**\n * Create a linestring from a TopoJSON geometry object.\n *\n * @param {TopoJSONLineString} object TopoJSON object.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @return {LineString} Geometry.\n */\nfunction readLineStringGeometry(object, arcs) {\n var coordinates = concatenateArcs(object['arcs'], arcs);\n return new LineString(coordinates);\n}\n/**\n * Create a multi-linestring from a TopoJSON geometry object.\n *\n * @param {TopoJSONMultiLineString} object TopoJSON object.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @return {MultiLineString} Geometry.\n */\nfunction readMultiLineStringGeometry(object, arcs) {\n var coordinates = [];\n for (var i = 0, ii = object['arcs'].length; i < ii; ++i) {\n coordinates[i] = concatenateArcs(object['arcs'][i], arcs);\n }\n return new MultiLineString(coordinates);\n}\n/**\n * Create a polygon from a TopoJSON geometry object.\n *\n * @param {TopoJSONPolygon} object TopoJSON object.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @return {Polygon} Geometry.\n */\nfunction readPolygonGeometry(object, arcs) {\n var coordinates = [];\n for (var i = 0, ii = object['arcs'].length; i < ii; ++i) {\n coordinates[i] = concatenateArcs(object['arcs'][i], arcs);\n }\n return new Polygon(coordinates);\n}\n/**\n * Create a multi-polygon from a TopoJSON geometry object.\n *\n * @param {TopoJSONMultiPolygon} object TopoJSON object.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @return {MultiPolygon} Geometry.\n */\nfunction readMultiPolygonGeometry(object, arcs) {\n var coordinates = [];\n for (var i = 0, ii = object['arcs'].length; i < ii; ++i) {\n // for each polygon\n var polyArray = object['arcs'][i];\n var ringCoords = [];\n for (var j = 0, jj = polyArray.length; j < jj; ++j) {\n // for each ring\n ringCoords[j] = concatenateArcs(polyArray[j], arcs);\n }\n coordinates[i] = ringCoords;\n }\n return new MultiPolygon(coordinates);\n}\n/**\n * Create features from a TopoJSON GeometryCollection object.\n *\n * @param {TopoJSONGeometryCollection} collection TopoJSON Geometry\n * object.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n * @param {string|undefined} property Property to set the `GeometryCollection`'s parent\n * object to.\n * @param {string} name Name of the `Topology`'s child object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {Array<Feature>} Array of features.\n */\nfunction readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {\n var geometries = collection['geometries'];\n var features = [];\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n features[i] = readFeatureFromGeometry(geometries[i], arcs, scale, translate, property, name, opt_options);\n }\n return features;\n}\n/**\n * Create a feature from a TopoJSON geometry object.\n *\n * @param {TopoJSONGeometry} object TopoJSON geometry object.\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n * @param {string|undefined} property Property to set the `GeometryCollection`'s parent\n * object to.\n * @param {string} name Name of the `Topology`'s child object.\n * @param {import(\"./Feature.js\").ReadOptions=} opt_options Read options.\n * @return {Feature} Feature.\n */\nfunction readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {\n var geometry;\n var type = object.type;\n var geometryReader = GEOMETRY_READERS[type];\n if ((type === 'Point') || (type === 'MultiPoint')) {\n geometry = geometryReader(object, scale, translate);\n }\n else {\n geometry = geometryReader(object, arcs);\n }\n var feature = new Feature();\n feature.setGeometry(transformGeometryWithOptions(geometry, false, opt_options));\n if (object.id !== undefined) {\n feature.setId(object.id);\n }\n var properties = object.properties;\n if (property) {\n if (!properties) {\n properties = {};\n }\n properties[property] = name;\n }\n if (properties) {\n feature.setProperties(properties, true);\n }\n return feature;\n}\n/**\n * Apply a linear transform to array of arcs. The provided array of arcs is\n * modified in place.\n *\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>>} arcs Array of arcs.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n */\nfunction transformArcs(arcs, scale, translate) {\n for (var i = 0, ii = arcs.length; i < ii; ++i) {\n transformArc(arcs[i], scale, translate);\n }\n}\n/**\n * Apply a linear transform to an arc. The provided arc is modified in place.\n *\n * @param {Array<import(\"../coordinate.js\").Coordinate>} arc Arc.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n */\nfunction transformArc(arc, scale, translate) {\n var x = 0;\n var y = 0;\n for (var i = 0, ii = arc.length; i < ii; ++i) {\n var vertex = arc[i];\n x += vertex[0];\n y += vertex[1];\n vertex[0] = x;\n vertex[1] = y;\n transformVertex(vertex, scale, translate);\n }\n}\n/**\n * Apply a linear transform to a vertex. The provided vertex is modified in\n * place.\n *\n * @param {import(\"../coordinate.js\").Coordinate} vertex Vertex.\n * @param {Array<number>} scale Scale for each dimension.\n * @param {Array<number>} translate Translation for each dimension.\n */\nfunction transformVertex(vertex, scale, translate) {\n vertex[0] = vertex[0] * scale[0] + translate[0];\n vertex[1] = vertex[1] * scale[1] + translate[1];\n}\nexport default TopoJSON;\n//# sourceMappingURL=TopoJSON.js.map","/**\n * @module ol/format/filter/Filter\n */\n/**\n * @classdesc\n * Abstract class; normally only used for creating subclasses and not instantiated in apps.\n * Base class for WFS GetFeature filters.\n *\n * @abstract\n */\nvar Filter = /** @class */ (function () {\n /**\n * @param {!string} tagName The XML tag name for this filter.\n */\n function Filter(tagName) {\n /**\n * @private\n * @type {!string}\n */\n this.tagName_ = tagName;\n }\n /**\n * The XML tag name for a filter.\n * @returns {!string} Name.\n */\n Filter.prototype.getTagName = function () {\n return this.tagName_;\n };\n return Filter;\n}());\nexport default Filter;\n//# sourceMappingURL=Filter.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/LogicalNary\n */\nimport { assert } from '../../asserts.js';\nimport Filter from './Filter.js';\n/**\n * @classdesc\n * Abstract class; normally only used for creating subclasses and not instantiated in apps.\n * Base class for WFS GetFeature n-ary logical filters.\n *\n * @abstract\n */\nvar LogicalNary = /** @class */ (function (_super) {\n __extends(LogicalNary, _super);\n /**\n * @param {!string} tagName The XML tag name for this filter.\n * @param {Array<import(\"./Filter.js\").default>} conditions Conditions.\n */\n function LogicalNary(tagName, conditions) {\n var _this = _super.call(this, tagName) || this;\n /**\n * @type {Array<import(\"./Filter.js\").default>}\n */\n _this.conditions = conditions;\n assert(_this.conditions.length >= 2, 57); // At least 2 conditions are required.\n return _this;\n }\n return LogicalNary;\n}(Filter));\nexport default LogicalNary;\n//# sourceMappingURL=LogicalNary.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/And\n */\nimport LogicalNary from './LogicalNary.js';\n/**\n * @classdesc\n * Represents a logical `<And>` operator between two or more filter conditions.\n *\n * @abstract\n */\nvar And = /** @class */ (function (_super) {\n __extends(And, _super);\n /**\n * @param {...import(\"./Filter.js\").default} conditions Conditions.\n */\n function And(conditions) {\n return _super.call(this, 'And', Array.prototype.slice.call(arguments)) || this;\n }\n return And;\n}(LogicalNary));\nexport default And;\n//# sourceMappingURL=And.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Bbox\n */\nimport Filter from './Filter.js';\n/**\n * @classdesc\n * Represents a `<BBOX>` operator to test whether a geometry-valued property\n * intersects a fixed bounding box\n *\n * @api\n */\nvar Bbox = /** @class */ (function (_super) {\n __extends(Bbox, _super);\n /**\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../../extent.js\").Extent} extent Extent.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be set\n * on geometries when this is not provided.\n */\n function Bbox(geometryName, extent, opt_srsName) {\n var _this = _super.call(this, 'BBOX') || this;\n /**\n * @type {!string}\n */\n _this.geometryName = geometryName;\n /**\n * @type {import(\"../../extent.js\").Extent}\n */\n _this.extent = extent;\n if (extent.length !== 4) {\n throw new Error('Expected an extent with four values ([minX, minY, maxX, maxY])');\n }\n /**\n * @type {string|undefined}\n */\n _this.srsName = opt_srsName;\n return _this;\n }\n return Bbox;\n}(Filter));\nexport default Bbox;\n//# sourceMappingURL=Bbox.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Spatial\n */\nimport Filter from './Filter.js';\n/**\n * @classdesc\n * Abstract class; normally only used for creating subclasses and not instantiated in apps.\n * Represents a spatial operator to test whether a geometry-valued property\n * relates to a given geometry.\n *\n * @abstract\n */\nvar Spatial = /** @class */ (function (_super) {\n __extends(Spatial, _super);\n /**\n * @param {!string} tagName The XML tag name for this filter.\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n */\n function Spatial(tagName, geometryName, geometry, opt_srsName) {\n var _this = _super.call(this, tagName) || this;\n /**\n * @type {!string}\n */\n _this.geometryName = geometryName || 'the_geom';\n /**\n * @type {import(\"../../geom/Geometry.js\").default}\n */\n _this.geometry = geometry;\n /**\n * @type {string|undefined}\n */\n _this.srsName = opt_srsName;\n return _this;\n }\n return Spatial;\n}(Filter));\nexport default Spatial;\n//# sourceMappingURL=Spatial.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Contains\n */\nimport Spatial from './Spatial.js';\n/**\n * @classdesc\n * Represents a `<Contains>` operator to test whether a geometry-valued property\n * contains a given geometry.\n * @api\n */\nvar Contains = /** @class */ (function (_super) {\n __extends(Contains, _super);\n /**\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n */\n function Contains(geometryName, geometry, opt_srsName) {\n return _super.call(this, 'Contains', geometryName, geometry, opt_srsName) || this;\n }\n return Contains;\n}(Spatial));\nexport default Contains;\n//# sourceMappingURL=Contains.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Comparison\n */\nimport Filter from './Filter.js';\n/**\n * @classdesc\n * Abstract class; normally only used for creating subclasses and not instantiated in apps.\n * Base class for WFS GetFeature property comparison filters.\n *\n * @abstract\n */\nvar Comparison = /** @class */ (function (_super) {\n __extends(Comparison, _super);\n /**\n * @param {!string} tagName The XML tag name for this filter.\n * @param {!string} propertyName Name of the context property to compare.\n */\n function Comparison(tagName, propertyName) {\n var _this = _super.call(this, tagName) || this;\n /**\n * @type {!string}\n */\n _this.propertyName = propertyName;\n return _this;\n }\n return Comparison;\n}(Filter));\nexport default Comparison;\n//# sourceMappingURL=Comparison.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/During\n */\nimport Comparison from './Comparison.js';\n/**\n * @classdesc\n * Represents a `<During>` comparison operator.\n * @api\n */\nvar During = /** @class */ (function (_super) {\n __extends(During, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!string} begin The begin date in ISO-8601 format.\n * @param {!string} end The end date in ISO-8601 format.\n */\n function During(propertyName, begin, end) {\n var _this = _super.call(this, 'During', propertyName) || this;\n /**\n * @type {!string}\n */\n _this.begin = begin;\n /**\n * @type {!string}\n */\n _this.end = end;\n return _this;\n }\n return During;\n}(Comparison));\nexport default During;\n//# sourceMappingURL=During.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/ComparisonBinary\n */\nimport Comparison from './Comparison.js';\n/**\n * @classdesc\n * Abstract class; normally only used for creating subclasses and not instantiated in apps.\n * Base class for WFS GetFeature property binary comparison filters.\n *\n * @abstract\n */\nvar ComparisonBinary = /** @class */ (function (_super) {\n __extends(ComparisonBinary, _super);\n /**\n * @param {!string} tagName The XML tag name for this filter.\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!(string|number)} expression The value to compare.\n * @param {boolean=} opt_matchCase Case-sensitive?\n */\n function ComparisonBinary(tagName, propertyName, expression, opt_matchCase) {\n var _this = _super.call(this, tagName, propertyName) || this;\n /**\n * @type {!(string|number)}\n */\n _this.expression = expression;\n /**\n * @type {boolean|undefined}\n */\n _this.matchCase = opt_matchCase;\n return _this;\n }\n return ComparisonBinary;\n}(Comparison));\nexport default ComparisonBinary;\n//# sourceMappingURL=ComparisonBinary.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/EqualTo\n */\nimport ComparisonBinary from './ComparisonBinary.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsEqualTo>` comparison operator.\n * @api\n */\nvar EqualTo = /** @class */ (function (_super) {\n __extends(EqualTo, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!(string|number)} expression The value to compare.\n * @param {boolean=} opt_matchCase Case-sensitive?\n */\n function EqualTo(propertyName, expression, opt_matchCase) {\n return _super.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase) || this;\n }\n return EqualTo;\n}(ComparisonBinary));\nexport default EqualTo;\n//# sourceMappingURL=EqualTo.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/GreaterThan\n */\nimport ComparisonBinary from './ComparisonBinary.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsGreaterThan>` comparison operator.\n * @api\n */\nvar GreaterThan = /** @class */ (function (_super) {\n __extends(GreaterThan, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n */\n function GreaterThan(propertyName, expression) {\n return _super.call(this, 'PropertyIsGreaterThan', propertyName, expression) || this;\n }\n return GreaterThan;\n}(ComparisonBinary));\nexport default GreaterThan;\n//# sourceMappingURL=GreaterThan.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/GreaterThanOrEqualTo\n */\nimport ComparisonBinary from './ComparisonBinary.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsGreaterThanOrEqualTo>` comparison operator.\n * @api\n */\nvar GreaterThanOrEqualTo = /** @class */ (function (_super) {\n __extends(GreaterThanOrEqualTo, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n */\n function GreaterThanOrEqualTo(propertyName, expression) {\n return _super.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression) || this;\n }\n return GreaterThanOrEqualTo;\n}(ComparisonBinary));\nexport default GreaterThanOrEqualTo;\n//# sourceMappingURL=GreaterThanOrEqualTo.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Intersects\n */\nimport Spatial from './Spatial.js';\n/**\n * @classdesc\n * Represents a `<Intersects>` operator to test whether a geometry-valued property\n * intersects a given geometry.\n * @api\n */\nvar Intersects = /** @class */ (function (_super) {\n __extends(Intersects, _super);\n /**\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n */\n function Intersects(geometryName, geometry, opt_srsName) {\n return _super.call(this, 'Intersects', geometryName, geometry, opt_srsName) || this;\n }\n return Intersects;\n}(Spatial));\nexport default Intersects;\n//# sourceMappingURL=Intersects.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/IsBetween\n */\nimport Comparison from './Comparison.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsBetween>` comparison operator.\n * @api\n */\nvar IsBetween = /** @class */ (function (_super) {\n __extends(IsBetween, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} lowerBoundary The lower bound of the range.\n * @param {!number} upperBoundary The upper bound of the range.\n */\n function IsBetween(propertyName, lowerBoundary, upperBoundary) {\n var _this = _super.call(this, 'PropertyIsBetween', propertyName) || this;\n /**\n * @type {!number}\n */\n _this.lowerBoundary = lowerBoundary;\n /**\n * @type {!number}\n */\n _this.upperBoundary = upperBoundary;\n return _this;\n }\n return IsBetween;\n}(Comparison));\nexport default IsBetween;\n//# sourceMappingURL=IsBetween.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/IsLike\n */\nimport Comparison from './Comparison.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsLike>` comparison operator.\n * @api\n */\nvar IsLike = /** @class */ (function (_super) {\n __extends(IsLike, _super);\n /**\n * [constructor description]\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!string} pattern Text pattern.\n * @param {string=} opt_wildCard Pattern character which matches any sequence of\n * zero or more string characters. Default is '*'.\n * @param {string=} opt_singleChar pattern character which matches any single\n * string character. Default is '.'.\n * @param {string=} opt_escapeChar Escape character which can be used to escape\n * the pattern characters. Default is '!'.\n * @param {boolean=} opt_matchCase Case-sensitive?\n */\n function IsLike(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {\n var _this = _super.call(this, 'PropertyIsLike', propertyName) || this;\n /**\n * @type {!string}\n */\n _this.pattern = pattern;\n /**\n * @type {!string}\n */\n _this.wildCard = (opt_wildCard !== undefined) ? opt_wildCard : '*';\n /**\n * @type {!string}\n */\n _this.singleChar = (opt_singleChar !== undefined) ? opt_singleChar : '.';\n /**\n * @type {!string}\n */\n _this.escapeChar = (opt_escapeChar !== undefined) ? opt_escapeChar : '!';\n /**\n * @type {boolean|undefined}\n */\n _this.matchCase = opt_matchCase;\n return _this;\n }\n return IsLike;\n}(Comparison));\nexport default IsLike;\n//# sourceMappingURL=IsLike.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/IsNull\n */\nimport Comparison from './Comparison.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsNull>` comparison operator.\n * @api\n */\nvar IsNull = /** @class */ (function (_super) {\n __extends(IsNull, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n */\n function IsNull(propertyName) {\n return _super.call(this, 'PropertyIsNull', propertyName) || this;\n }\n return IsNull;\n}(Comparison));\nexport default IsNull;\n//# sourceMappingURL=IsNull.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/LessThan\n */\nimport ComparisonBinary from './ComparisonBinary.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsLessThan>` comparison operator.\n * @api\n */\nvar LessThan = /** @class */ (function (_super) {\n __extends(LessThan, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n */\n function LessThan(propertyName, expression) {\n return _super.call(this, 'PropertyIsLessThan', propertyName, expression) || this;\n }\n return LessThan;\n}(ComparisonBinary));\nexport default LessThan;\n//# sourceMappingURL=LessThan.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/LessThanOrEqualTo\n */\nimport ComparisonBinary from './ComparisonBinary.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsLessThanOrEqualTo>` comparison operator.\n * @api\n */\nvar LessThanOrEqualTo = /** @class */ (function (_super) {\n __extends(LessThanOrEqualTo, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n */\n function LessThanOrEqualTo(propertyName, expression) {\n return _super.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression) || this;\n }\n return LessThanOrEqualTo;\n}(ComparisonBinary));\nexport default LessThanOrEqualTo;\n//# sourceMappingURL=LessThanOrEqualTo.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Not\n */\nimport Filter from './Filter.js';\n/**\n * @classdesc\n * Represents a logical `<Not>` operator for a filter condition.\n * @api\n */\nvar Not = /** @class */ (function (_super) {\n __extends(Not, _super);\n /**\n * @param {!import(\"./Filter.js\").default} condition Filter condition.\n */\n function Not(condition) {\n var _this = _super.call(this, 'Not') || this;\n /**\n * @type {!import(\"./Filter.js\").default}\n */\n _this.condition = condition;\n return _this;\n }\n return Not;\n}(Filter));\nexport default Not;\n//# sourceMappingURL=Not.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/NotEqualTo\n */\nimport ComparisonBinary from './ComparisonBinary.js';\n/**\n * @classdesc\n * Represents a `<PropertyIsNotEqualTo>` comparison operator.\n * @api\n */\nvar NotEqualTo = /** @class */ (function (_super) {\n __extends(NotEqualTo, _super);\n /**\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!(string|number)} expression The value to compare.\n * @param {boolean=} opt_matchCase Case-sensitive?\n */\n function NotEqualTo(propertyName, expression, opt_matchCase) {\n return _super.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase) || this;\n }\n return NotEqualTo;\n}(ComparisonBinary));\nexport default NotEqualTo;\n//# sourceMappingURL=NotEqualTo.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Or\n */\nimport LogicalNary from './LogicalNary.js';\n/**\n * @classdesc\n * Represents a logical `<Or>` operator between two ore more filter conditions.\n * @api\n */\nvar Or = /** @class */ (function (_super) {\n __extends(Or, _super);\n /**\n * @param {...import(\"./Filter.js\").default} conditions Conditions.\n */\n function Or(conditions) {\n return _super.call(this, 'Or', Array.prototype.slice.call(arguments)) || this;\n }\n return Or;\n}(LogicalNary));\nexport default Or;\n//# sourceMappingURL=Or.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/filter/Within\n */\nimport Spatial from './Spatial.js';\n/**\n * @classdesc\n * Represents a `<Within>` operator to test whether a geometry-valued property\n * is within a given geometry.\n * @api\n */\nvar Within = /** @class */ (function (_super) {\n __extends(Within, _super);\n /**\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n */\n function Within(geometryName, geometry, opt_srsName) {\n return _super.call(this, 'Within', geometryName, geometry, opt_srsName) || this;\n }\n return Within;\n}(Spatial));\nexport default Within;\n//# sourceMappingURL=Within.js.map","/**\n * @module ol/format/filter\n */\nimport And from './filter/And.js';\nimport Bbox from './filter/Bbox.js';\nimport Contains from './filter/Contains.js';\nimport During from './filter/During.js';\nimport EqualTo from './filter/EqualTo.js';\nimport GreaterThan from './filter/GreaterThan.js';\nimport GreaterThanOrEqualTo from './filter/GreaterThanOrEqualTo.js';\nimport Intersects from './filter/Intersects.js';\nimport IsBetween from './filter/IsBetween.js';\nimport IsLike from './filter/IsLike.js';\nimport IsNull from './filter/IsNull.js';\nimport LessThan from './filter/LessThan.js';\nimport LessThanOrEqualTo from './filter/LessThanOrEqualTo.js';\nimport Not from './filter/Not.js';\nimport NotEqualTo from './filter/NotEqualTo.js';\nimport Or from './filter/Or.js';\nimport Within from './filter/Within.js';\n/**\n * Create a logical `<And>` operator between two or more filter conditions.\n *\n * @param {...import(\"./filter/Filter.js\").default} conditions Filter conditions.\n * @returns {!And} `<And>` operator.\n * @api\n */\nexport function and(conditions) {\n var params = [null].concat(Array.prototype.slice.call(arguments));\n return new (Function.prototype.bind.apply(And, params));\n}\n/**\n * Create a logical `<Or>` operator between two or more filter conditions.\n *\n * @param {...import(\"./filter/Filter.js\").default} conditions Filter conditions.\n * @returns {!Or} `<Or>` operator.\n * @api\n */\nexport function or(conditions) {\n var params = [null].concat(Array.prototype.slice.call(arguments));\n return new (Function.prototype.bind.apply(Or, params));\n}\n/**\n * Represents a logical `<Not>` operator for a filter condition.\n *\n * @param {!import(\"./filter/Filter.js\").default} condition Filter condition.\n * @returns {!Not} `<Not>` operator.\n * @api\n */\nexport function not(condition) {\n return new Not(condition);\n}\n/**\n * Create a `<BBOX>` operator to test whether a geometry-valued property\n * intersects a fixed bounding box\n *\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../extent.js\").Extent} extent Extent.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n * @returns {!Bbox} `<BBOX>` operator.\n * @api\n */\nexport function bbox(geometryName, extent, opt_srsName) {\n return new Bbox(geometryName, extent, opt_srsName);\n}\n/**\n * Create a `<Contains>` operator to test whether a geometry-valued property\n * contains a given geometry.\n *\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n * @returns {!Contains} `<Contains>` operator.\n * @api\n */\nexport function contains(geometryName, geometry, opt_srsName) {\n return new Contains(geometryName, geometry, opt_srsName);\n}\n/**\n * Create a `<Intersects>` operator to test whether a geometry-valued property\n * intersects a given geometry.\n *\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n * @returns {!Intersects} `<Intersects>` operator.\n * @api\n */\nexport function intersects(geometryName, geometry, opt_srsName) {\n return new Intersects(geometryName, geometry, opt_srsName);\n}\n/**\n * Create a `<Within>` operator to test whether a geometry-valued property\n * is within a given geometry.\n *\n * @param {!string} geometryName Geometry name to use.\n * @param {!import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @param {string=} opt_srsName SRS name. No srsName attribute will be\n * set on geometries when this is not provided.\n * @returns {!Within} `<Within>` operator.\n * @api\n */\nexport function within(geometryName, geometry, opt_srsName) {\n return new Within(geometryName, geometry, opt_srsName);\n}\n/**\n * Creates a `<PropertyIsEqualTo>` comparison operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!(string|number)} expression The value to compare.\n * @param {boolean=} opt_matchCase Case-sensitive?\n * @returns {!EqualTo} `<PropertyIsEqualTo>` operator.\n * @api\n */\nexport function equalTo(propertyName, expression, opt_matchCase) {\n return new EqualTo(propertyName, expression, opt_matchCase);\n}\n/**\n * Creates a `<PropertyIsNotEqualTo>` comparison operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!(string|number)} expression The value to compare.\n * @param {boolean=} opt_matchCase Case-sensitive?\n * @returns {!NotEqualTo} `<PropertyIsNotEqualTo>` operator.\n * @api\n */\nexport function notEqualTo(propertyName, expression, opt_matchCase) {\n return new NotEqualTo(propertyName, expression, opt_matchCase);\n}\n/**\n * Creates a `<PropertyIsLessThan>` comparison operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n * @returns {!LessThan} `<PropertyIsLessThan>` operator.\n * @api\n */\nexport function lessThan(propertyName, expression) {\n return new LessThan(propertyName, expression);\n}\n/**\n * Creates a `<PropertyIsLessThanOrEqualTo>` comparison operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n * @returns {!LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.\n * @api\n */\nexport function lessThanOrEqualTo(propertyName, expression) {\n return new LessThanOrEqualTo(propertyName, expression);\n}\n/**\n * Creates a `<PropertyIsGreaterThan>` comparison operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n * @returns {!GreaterThan} `<PropertyIsGreaterThan>` operator.\n * @api\n */\nexport function greaterThan(propertyName, expression) {\n return new GreaterThan(propertyName, expression);\n}\n/**\n * Creates a `<PropertyIsGreaterThanOrEqualTo>` comparison operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} expression The value to compare.\n * @returns {!GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.\n * @api\n */\nexport function greaterThanOrEqualTo(propertyName, expression) {\n return new GreaterThanOrEqualTo(propertyName, expression);\n}\n/**\n * Creates a `<PropertyIsNull>` comparison operator to test whether a property value\n * is null.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @returns {!IsNull} `<PropertyIsNull>` operator.\n * @api\n */\nexport function isNull(propertyName) {\n return new IsNull(propertyName);\n}\n/**\n * Creates a `<PropertyIsBetween>` comparison operator to test whether an expression\n * value lies within a range given by a lower and upper bound (inclusive).\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!number} lowerBoundary The lower bound of the range.\n * @param {!number} upperBoundary The upper bound of the range.\n * @returns {!IsBetween} `<PropertyIsBetween>` operator.\n * @api\n */\nexport function between(propertyName, lowerBoundary, upperBoundary) {\n return new IsBetween(propertyName, lowerBoundary, upperBoundary);\n}\n/**\n * Represents a `<PropertyIsLike>` comparison operator that matches a string property\n * value against a text pattern.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!string} pattern Text pattern.\n * @param {string=} opt_wildCard Pattern character which matches any sequence of\n * zero or more string characters. Default is '*'.\n * @param {string=} opt_singleChar pattern character which matches any single\n * string character. Default is '.'.\n * @param {string=} opt_escapeChar Escape character which can be used to escape\n * the pattern characters. Default is '!'.\n * @param {boolean=} opt_matchCase Case-sensitive?\n * @returns {!IsLike} `<PropertyIsLike>` operator.\n * @api\n */\nexport function like(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {\n return new IsLike(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase);\n}\n/**\n * Create a `<During>` temporal operator.\n *\n * @param {!string} propertyName Name of the context property to compare.\n * @param {!string} begin The begin date in ISO-8601 format.\n * @param {!string} end The end date in ISO-8601 format.\n * @returns {!During} `<During>` operator.\n * @api\n */\nexport function during(propertyName, begin, end) {\n return new During(propertyName, begin, end);\n}\n//# sourceMappingURL=filter.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/WFS\n */\nimport { assert } from '../asserts.js';\nimport GML2 from './GML2.js';\nimport GML3 from './GML3.js';\nimport GMLBase, { GMLNS } from './GMLBase.js';\nimport { and as andFilter, bbox as bboxFilter } from './filter.js';\nimport XMLFeature from './XMLFeature.js';\nimport { readNonNegativeIntegerString, readNonNegativeInteger, writeStringTextNode } from './xsd.js';\nimport { assign } from '../obj.js';\nimport { get as getProjection } from '../proj.js';\nimport { createElementNS, isDocument, makeArrayPusher, makeChildAppender, makeObjectPropertySetter, makeSimpleNodeFactory, parse, parseNode, pushParseAndPop, pushSerializeAndPop, XML_SCHEMA_INSTANCE_URI } from '../xml.js';\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\nvar FEATURE_COLLECTION_PARSERS = {\n 'http://www.opengis.net/gml': {\n 'boundedBy': makeObjectPropertySetter(GMLBase.prototype.readGeometryElement, 'bounds')\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\nvar TRANSACTION_SUMMARY_PARSERS = {\n 'http://www.opengis.net/wfs': {\n 'totalInserted': makeObjectPropertySetter(readNonNegativeInteger),\n 'totalUpdated': makeObjectPropertySetter(readNonNegativeInteger),\n 'totalDeleted': makeObjectPropertySetter(readNonNegativeInteger)\n }\n};\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\nvar TRANSACTION_RESPONSE_PARSERS = {\n 'http://www.opengis.net/wfs': {\n 'TransactionSummary': makeObjectPropertySetter(readTransactionSummary, 'transactionSummary'),\n 'InsertResults': makeObjectPropertySetter(readInsertResults, 'insertIds')\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\nvar QUERY_SERIALIZERS = {\n 'http://www.opengis.net/wfs': {\n 'PropertyName': makeChildAppender(writeStringTextNode)\n }\n};\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\nvar TRANSACTION_SERIALIZERS = {\n 'http://www.opengis.net/wfs': {\n 'Insert': makeChildAppender(writeFeature),\n 'Update': makeChildAppender(writeUpdate),\n 'Delete': makeChildAppender(writeDelete),\n 'Property': makeChildAppender(writeProperty),\n 'Native': makeChildAppender(writeNative)\n }\n};\n/**\n * @typedef {Object} Options\n * @property {Object<string, string>|string} [featureNS] The namespace URI used for features.\n * @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.\n * @property {GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.\n * @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.\n */\n/**\n * @typedef {Object} WriteGetFeatureOptions\n * @property {string} featureNS The namespace URI used for features.\n * @property {string} featurePrefix The prefix for the feature namespace.\n * @property {Array<string>} featureTypes The feature type names.\n * @property {string} [srsName] SRS name. No srsName attribute will be set on\n * geometries when this is not provided.\n * @property {string} [handle] Handle.\n * @property {string} [outputFormat] Output format.\n * @property {number} [maxFeatures] Maximum number of features to fetch.\n * @property {string} [geometryName] Geometry name to use in a BBOX filter.\n * @property {Array<string>} [propertyNames] Optional list of property names to serialize.\n * @property {string} [viewParams] viewParams GeoServer vendor parameter.\n * @property {number} [startIndex] Start index to use for WFS paging. This is a\n * WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.\n * @property {number} [count] Number of features to retrieve when paging. This is a\n * WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some\n * Web Feature Services have repurposed `maxfeatures` instead.\n * @property {import(\"../extent.js\").Extent} [bbox] Extent to use for the BBOX filter.\n * @property {import(\"./filter/Filter.js\").default} [filter] Filter condition. See\n * {@link module:ol/format/Filter} for more information.\n * @property {string} [resultType] Indicates what response should be returned,\n * E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.\n */\n/**\n * @typedef {Object} WriteTransactionOptions\n * @property {string} featureNS The namespace URI used for features.\n * @property {string} featurePrefix The prefix for the feature namespace.\n * @property {string} featureType The feature type name.\n * @property {string} [srsName] SRS name. No srsName attribute will be set on\n * geometries when this is not provided.\n * @property {string} [handle] Handle.\n * @property {boolean} [hasZ] Must be set to true if the transaction is for\n * a 3D layer. This will allow the Z coordinate to be included in the transaction.\n * @property {Array<Object>} nativeElements Native elements. Currently not supported.\n * @property {import(\"./GMLBase.js\").Options} [gmlOptions] GML options for the WFS transaction writer.\n * @property {string} [version='1.1.0'] WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.\n */\n/**\n * Number of features; bounds/extent.\n * @typedef {Object} FeatureCollectionMetadata\n * @property {number} numberOfFeatures\n * @property {import(\"../extent.js\").Extent} bounds\n */\n/**\n * Total deleted; total inserted; total updated; array of insert ids.\n * @typedef {Object} TransactionResponse\n * @property {number} totalDeleted\n * @property {number} totalInserted\n * @property {number} totalUpdated\n * @property {Array<string>} insertIds\n */\n/**\n * @type {string}\n */\nvar FEATURE_PREFIX = 'feature';\n/**\n * @type {string}\n */\nvar XMLNS = 'http://www.w3.org/2000/xmlns/';\n/**\n * @type {string}\n */\nvar OGCNS = 'http://www.opengis.net/ogc';\n/**\n * @type {string}\n */\nvar WFSNS = 'http://www.opengis.net/wfs';\n/**\n * @type {string}\n */\nvar FESNS = 'http://www.opengis.net/fes';\n/**\n * @type {Object<string, string>}\n */\nvar SCHEMA_LOCATIONS = {\n '1.1.0': 'http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd',\n '1.0.0': 'http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd'\n};\n/**\n * @const\n * @type {string}\n */\nvar DEFAULT_VERSION = '1.1.0';\n/**\n * @classdesc\n * Feature format for reading and writing data in the WFS format.\n * By default, supports WFS version 1.1.0. You can pass a GML format\n * as option if you want to read a WFS that contains GML2 (WFS 1.0.0).\n * Also see {@link module:ol/format/GMLBase~GMLBase} which is used by this format.\n *\n * @api\n */\nvar WFS = /** @class */ (function (_super) {\n __extends(WFS, _super);\n /**\n * @param {Options=} opt_options Optional configuration object.\n */\n function WFS(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {Array<string>|string|undefined}\n */\n _this.featureType_ = options.featureType;\n /**\n * @private\n * @type {Object<string, string>|string|undefined}\n */\n _this.featureNS_ = options.featureNS;\n /**\n * @private\n * @type {GMLBase}\n */\n _this.gmlFormat_ = options.gmlFormat ?\n options.gmlFormat : new GML3();\n /**\n * @private\n * @type {string}\n */\n _this.schemaLocation_ = options.schemaLocation ?\n options.schemaLocation : SCHEMA_LOCATIONS[DEFAULT_VERSION];\n return _this;\n }\n /**\n * @return {Array<string>|string|undefined} featureType\n */\n WFS.prototype.getFeatureType = function () {\n return this.featureType_;\n };\n /**\n * @param {Array<string>|string|undefined} featureType Feature type(s) to parse.\n */\n WFS.prototype.setFeatureType = function (featureType) {\n this.featureType_ = featureType;\n };\n /**\n * @inheritDoc\n */\n WFS.prototype.readFeaturesFromNode = function (node, opt_options) {\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var context = {\n node: node\n };\n assign(context, {\n 'featureType': this.featureType_,\n 'featureNS': this.featureNS_\n });\n assign(context, this.getReadOptions(node, opt_options ? opt_options : {}));\n var objectStack = [context];\n this.gmlFormat_.FEATURE_COLLECTION_PARSERS[GMLNS]['featureMember'] =\n makeArrayPusher(GMLBase.prototype.readFeaturesInternal);\n var features = pushParseAndPop([], this.gmlFormat_.FEATURE_COLLECTION_PARSERS, node, objectStack, this.gmlFormat_);\n if (!features) {\n features = [];\n }\n return features;\n };\n /**\n * Read transaction response of the source.\n *\n * @param {Document|Element|Object|string} source Source.\n * @return {TransactionResponse|undefined} Transaction response.\n * @api\n */\n WFS.prototype.readTransactionResponse = function (source) {\n if (!source) {\n return undefined;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readTransactionResponseFromDocument(doc);\n }\n else if (isDocument(source)) {\n return this.readTransactionResponseFromDocument(\n /** @type {Document} */ (source));\n }\n else {\n return this.readTransactionResponseFromNode(/** @type {Element} */ (source));\n }\n };\n /**\n * Read feature collection metadata of the source.\n *\n * @param {Document|Element|Object|string} source Source.\n * @return {FeatureCollectionMetadata|undefined}\n * FeatureCollection metadata.\n * @api\n */\n WFS.prototype.readFeatureCollectionMetadata = function (source) {\n if (!source) {\n return undefined;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readFeatureCollectionMetadataFromDocument(doc);\n }\n else if (isDocument(source)) {\n return this.readFeatureCollectionMetadataFromDocument(\n /** @type {Document} */ (source));\n }\n else {\n return this.readFeatureCollectionMetadataFromNode(\n /** @type {Element} */ (source));\n }\n };\n /**\n * @param {Document} doc Document.\n * @return {FeatureCollectionMetadata|undefined}\n * FeatureCollection metadata.\n */\n WFS.prototype.readFeatureCollectionMetadataFromDocument = function (doc) {\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n return this.readFeatureCollectionMetadataFromNode(/** @type {Element} */ (n));\n }\n }\n return undefined;\n };\n /**\n * @param {Element} node Node.\n * @return {FeatureCollectionMetadata|undefined}\n * FeatureCollection metadata.\n */\n WFS.prototype.readFeatureCollectionMetadataFromNode = function (node) {\n var result = {};\n var value = readNonNegativeIntegerString(node.getAttribute('numberOfFeatures'));\n result['numberOfFeatures'] = value;\n return pushParseAndPop(\n /** @type {FeatureCollectionMetadata} */ (result), FEATURE_COLLECTION_PARSERS, node, [], this.gmlFormat_);\n };\n /**\n * @param {Document} doc Document.\n * @return {TransactionResponse|undefined} Transaction response.\n */\n WFS.prototype.readTransactionResponseFromDocument = function (doc) {\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n return this.readTransactionResponseFromNode(/** @type {Element} */ (n));\n }\n }\n return undefined;\n };\n /**\n * @param {Element} node Node.\n * @return {TransactionResponse|undefined} Transaction response.\n */\n WFS.prototype.readTransactionResponseFromNode = function (node) {\n return pushParseAndPop(\n /** @type {TransactionResponse} */ ({}), TRANSACTION_RESPONSE_PARSERS, node, []);\n };\n /**\n * Encode format as WFS `GetFeature` and return the Node.\n *\n * @param {WriteGetFeatureOptions} options Options.\n * @return {Node} Result.\n * @api\n */\n WFS.prototype.writeGetFeature = function (options) {\n var node = createElementNS(WFSNS, 'GetFeature');\n node.setAttribute('service', 'WFS');\n node.setAttribute('version', '1.1.0');\n var filter;\n if (options) {\n if (options.handle) {\n node.setAttribute('handle', options.handle);\n }\n if (options.outputFormat) {\n node.setAttribute('outputFormat', options.outputFormat);\n }\n if (options.maxFeatures !== undefined) {\n node.setAttribute('maxFeatures', String(options.maxFeatures));\n }\n if (options.resultType) {\n node.setAttribute('resultType', options.resultType);\n }\n if (options.startIndex !== undefined) {\n node.setAttribute('startIndex', String(options.startIndex));\n }\n if (options.count !== undefined) {\n node.setAttribute('count', String(options.count));\n }\n if (options.viewParams !== undefined) {\n node.setAttribute('viewParams', options.viewParams);\n }\n filter = options.filter;\n if (options.bbox) {\n assert(options.geometryName, 12); // `options.geometryName` must also be provided when `options.bbox` is set\n var bbox = bboxFilter(\n /** @type {string} */ (options.geometryName), options.bbox, options.srsName);\n if (filter) {\n // if bbox and filter are both set, combine the two into a single filter\n filter = andFilter(filter, bbox);\n }\n else {\n filter = bbox;\n }\n }\n }\n node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', this.schemaLocation_);\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var context = {\n node: node\n };\n assign(context, {\n 'srsName': options.srsName,\n 'featureNS': options.featureNS ? options.featureNS : this.featureNS_,\n 'featurePrefix': options.featurePrefix,\n 'geometryName': options.geometryName,\n 'filter': filter,\n 'propertyNames': options.propertyNames ? options.propertyNames : []\n });\n assert(Array.isArray(options.featureTypes), 11); // `options.featureTypes` should be an Array\n writeGetFeature(node, /** @type {!Array<string>} */ (options.featureTypes), [context]);\n return node;\n };\n /**\n * Encode format as WFS `Transaction` and return the Node.\n *\n * @param {Array<import(\"../Feature.js\").default>} inserts The features to insert.\n * @param {Array<import(\"../Feature.js\").default>} updates The features to update.\n * @param {Array<import(\"../Feature.js\").default>} deletes The features to delete.\n * @param {WriteTransactionOptions} options Write options.\n * @return {Node} Result.\n * @api\n */\n WFS.prototype.writeTransaction = function (inserts, updates, deletes, options) {\n var objectStack = [];\n var node = createElementNS(WFSNS, 'Transaction');\n var version = options.version ? options.version : DEFAULT_VERSION;\n var gmlVersion = version === '1.0.0' ? 2 : 3;\n node.setAttribute('service', 'WFS');\n node.setAttribute('version', version);\n var baseObj;\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var obj;\n if (options) {\n baseObj = options.gmlOptions ? options.gmlOptions : {};\n if (options.handle) {\n node.setAttribute('handle', options.handle);\n }\n }\n var schemaLocation = SCHEMA_LOCATIONS[version];\n node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', schemaLocation);\n var featurePrefix = options.featurePrefix ? options.featurePrefix : FEATURE_PREFIX;\n if (inserts) {\n obj = assign({ node: node }, { 'featureNS': options.featureNS,\n 'featureType': options.featureType, 'featurePrefix': featurePrefix,\n 'gmlVersion': gmlVersion, 'hasZ': options.hasZ, 'srsName': options.srsName });\n assign(obj, baseObj);\n pushSerializeAndPop(obj, TRANSACTION_SERIALIZERS, makeSimpleNodeFactory('Insert'), inserts, objectStack);\n }\n if (updates) {\n obj = assign({ node: node }, { 'featureNS': options.featureNS,\n 'featureType': options.featureType, 'featurePrefix': featurePrefix,\n 'gmlVersion': gmlVersion, 'hasZ': options.hasZ, 'srsName': options.srsName });\n assign(obj, baseObj);\n pushSerializeAndPop(obj, TRANSACTION_SERIALIZERS, makeSimpleNodeFactory('Update'), updates, objectStack);\n }\n if (deletes) {\n pushSerializeAndPop({ node: node, 'featureNS': options.featureNS,\n 'featureType': options.featureType, 'featurePrefix': featurePrefix,\n 'gmlVersion': gmlVersion, 'srsName': options.srsName }, TRANSACTION_SERIALIZERS, makeSimpleNodeFactory('Delete'), deletes, objectStack);\n }\n if (options.nativeElements) {\n pushSerializeAndPop({ node: node, 'featureNS': options.featureNS,\n 'featureType': options.featureType, 'featurePrefix': featurePrefix,\n 'gmlVersion': gmlVersion, 'srsName': options.srsName }, TRANSACTION_SERIALIZERS, makeSimpleNodeFactory('Native'), options.nativeElements, objectStack);\n }\n return node;\n };\n /**\n * @inheritDoc\n */\n WFS.prototype.readProjectionFromDocument = function (doc) {\n for (var n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n return this.readProjectionFromNode(n);\n }\n }\n return null;\n };\n /**\n * @inheritDoc\n */\n WFS.prototype.readProjectionFromNode = function (node) {\n if (node.firstElementChild &&\n node.firstElementChild.firstElementChild) {\n node = node.firstElementChild.firstElementChild;\n for (var n = node.firstElementChild; n; n = n.nextElementSibling) {\n if (!(n.childNodes.length === 0 ||\n (n.childNodes.length === 1 &&\n n.firstChild.nodeType === 3))) {\n var objectStack = [{}];\n this.gmlFormat_.readGeometryElement(n, objectStack);\n return getProjection(objectStack.pop().srsName);\n }\n }\n }\n return null;\n };\n return WFS;\n}(XMLFeature));\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Transaction Summary.\n */\nfunction readTransactionSummary(node, objectStack) {\n return pushParseAndPop({}, TRANSACTION_SUMMARY_PARSERS, node, objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\nvar OGC_FID_PARSERS = {\n 'http://www.opengis.net/ogc': {\n 'FeatureId': makeArrayPusher(function (node, objectStack) {\n return node.getAttribute('fid');\n })\n }\n};\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction fidParser(node, objectStack) {\n parseNode(OGC_FID_PARSERS, node, objectStack);\n}\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\nvar INSERT_RESULTS_PARSERS = {\n 'http://www.opengis.net/wfs': {\n 'Feature': fidParser\n }\n};\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<string>|undefined} Insert results.\n */\nfunction readInsertResults(node, objectStack) {\n return pushParseAndPop([], INSERT_RESULTS_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeFeature(node, feature, objectStack) {\n var context = objectStack[objectStack.length - 1];\n var featureType = context['featureType'];\n var featureNS = context['featureNS'];\n var gmlVersion = context['gmlVersion'];\n var child = createElementNS(featureNS, featureType);\n node.appendChild(child);\n if (gmlVersion === 2) {\n GML2.prototype.writeFeatureElement(child, feature, objectStack);\n }\n else {\n GML3.prototype.writeFeatureElement(child, feature, objectStack);\n }\n}\n/**\n * @param {Node} node Node.\n * @param {number|string} fid Feature identifier.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeOgcFidFilter(node, fid, objectStack) {\n var filter = createElementNS(OGCNS, 'Filter');\n var child = createElementNS(OGCNS, 'FeatureId');\n filter.appendChild(child);\n child.setAttribute('fid', /** @type {string} */ (fid));\n node.appendChild(filter);\n}\n/**\n * @param {string|undefined} featurePrefix The prefix of the feature.\n * @param {string} featureType The type of the feature.\n * @returns {string} The value of the typeName property.\n */\nfunction getTypeName(featurePrefix, featureType) {\n featurePrefix = featurePrefix ? featurePrefix : FEATURE_PREFIX;\n var prefix = featurePrefix + ':';\n // The featureType already contains the prefix.\n if (featureType.indexOf(prefix) === 0) {\n return featureType;\n }\n else {\n return prefix + featureType;\n }\n}\n/**\n * @param {Element} node Node.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeDelete(node, feature, objectStack) {\n var context = objectStack[objectStack.length - 1];\n assert(feature.getId() !== undefined, 26); // Features must have an id set\n var featureType = context['featureType'];\n var featurePrefix = context['featurePrefix'];\n var featureNS = context['featureNS'];\n var typeName = getTypeName(featurePrefix, featureType);\n node.setAttribute('typeName', typeName);\n node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);\n var fid = feature.getId();\n if (fid !== undefined) {\n writeOgcFidFilter(node, fid, objectStack);\n }\n}\n/**\n * @param {Element} node Node.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeUpdate(node, feature, objectStack) {\n var context = objectStack[objectStack.length - 1];\n assert(feature.getId() !== undefined, 27); // Features must have an id set\n var featureType = context['featureType'];\n var featurePrefix = context['featurePrefix'];\n var featureNS = context['featureNS'];\n var typeName = getTypeName(featurePrefix, featureType);\n var geometryName = feature.getGeometryName();\n node.setAttribute('typeName', typeName);\n node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);\n var fid = feature.getId();\n if (fid !== undefined) {\n var keys = feature.getKeys();\n var values = [];\n for (var i = 0, ii = keys.length; i < ii; i++) {\n var value = feature.get(keys[i]);\n if (value !== undefined) {\n var name_1 = keys[i];\n if (value && typeof /** @type {?} */ (value).getSimplifiedGeometry === 'function') {\n name_1 = geometryName;\n }\n values.push({ name: name_1, value: value });\n }\n }\n pushSerializeAndPop(/** @type {import(\"../xml.js\").NodeStackItem} */ ({ 'gmlVersion': context['gmlVersion'], node: node,\n 'hasZ': context['hasZ'], 'srsName': context['srsName'] }), TRANSACTION_SERIALIZERS, makeSimpleNodeFactory('Property'), values, objectStack);\n writeOgcFidFilter(node, fid, objectStack);\n }\n}\n/**\n * @param {Node} node Node.\n * @param {Object} pair Property name and value.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeProperty(node, pair, objectStack) {\n var name = createElementNS(WFSNS, 'Name');\n var context = objectStack[objectStack.length - 1];\n var gmlVersion = context['gmlVersion'];\n node.appendChild(name);\n writeStringTextNode(name, pair.name);\n if (pair.value !== undefined && pair.value !== null) {\n var value = createElementNS(WFSNS, 'Value');\n node.appendChild(value);\n if (pair.value && typeof /** @type {?} */ (pair.value).getSimplifiedGeometry === 'function') {\n if (gmlVersion === 2) {\n GML2.prototype.writeGeometryElement(value, pair.value, objectStack);\n }\n else {\n GML3.prototype.writeGeometryElement(value, pair.value, objectStack);\n }\n }\n else {\n writeStringTextNode(value, pair.value);\n }\n }\n}\n/**\n * @param {Element} node Node.\n * @param {{vendorId: string, safeToIgnore: boolean, value: string}} nativeElement The native element.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeNative(node, nativeElement, objectStack) {\n if (nativeElement.vendorId) {\n node.setAttribute('vendorId', nativeElement.vendorId);\n }\n if (nativeElement.safeToIgnore !== undefined) {\n node.setAttribute('safeToIgnore', String(nativeElement.safeToIgnore));\n }\n if (nativeElement.value !== undefined) {\n writeStringTextNode(node, nativeElement.value);\n }\n}\n/**\n * @type {Object<string, Object<string, import(\"../xml.js\").Serializer>>}\n */\nvar GETFEATURE_SERIALIZERS = {\n 'http://www.opengis.net/wfs': {\n 'Query': makeChildAppender(writeQuery)\n },\n 'http://www.opengis.net/ogc': {\n 'During': makeChildAppender(writeDuringFilter),\n 'And': makeChildAppender(writeLogicalFilter),\n 'Or': makeChildAppender(writeLogicalFilter),\n 'Not': makeChildAppender(writeNotFilter),\n 'BBOX': makeChildAppender(writeBboxFilter),\n 'Contains': makeChildAppender(writeContainsFilter),\n 'Intersects': makeChildAppender(writeIntersectsFilter),\n 'Within': makeChildAppender(writeWithinFilter),\n 'PropertyIsEqualTo': makeChildAppender(writeComparisonFilter),\n 'PropertyIsNotEqualTo': makeChildAppender(writeComparisonFilter),\n 'PropertyIsLessThan': makeChildAppender(writeComparisonFilter),\n 'PropertyIsLessThanOrEqualTo': makeChildAppender(writeComparisonFilter),\n 'PropertyIsGreaterThan': makeChildAppender(writeComparisonFilter),\n 'PropertyIsGreaterThanOrEqualTo': makeChildAppender(writeComparisonFilter),\n 'PropertyIsNull': makeChildAppender(writeIsNullFilter),\n 'PropertyIsBetween': makeChildAppender(writeIsBetweenFilter),\n 'PropertyIsLike': makeChildAppender(writeIsLikeFilter)\n }\n};\n/**\n * @param {Element} node Node.\n * @param {string} featureType Feature type.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeQuery(node, featureType, objectStack) {\n var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var featurePrefix = context['featurePrefix'];\n var featureNS = context['featureNS'];\n var propertyNames = context['propertyNames'];\n var srsName = context['srsName'];\n var typeName;\n // If feature prefix is not defined, we must not use the default prefix.\n if (featurePrefix) {\n typeName = getTypeName(featurePrefix, featureType);\n }\n else {\n typeName = featureType;\n }\n node.setAttribute('typeName', typeName);\n if (srsName) {\n node.setAttribute('srsName', srsName);\n }\n if (featureNS) {\n node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);\n }\n var item = /** @type {import(\"../xml.js\").NodeStackItem} */ (assign({}, context));\n item.node = node;\n pushSerializeAndPop(item, QUERY_SERIALIZERS, makeSimpleNodeFactory('PropertyName'), propertyNames, objectStack);\n var filter = context['filter'];\n if (filter) {\n var child = createElementNS(OGCNS, 'Filter');\n node.appendChild(child);\n writeFilterCondition(child, filter, objectStack);\n }\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/Filter.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeFilterCondition(node, filter, objectStack) {\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var item = { node: node };\n pushSerializeAndPop(item, GETFEATURE_SERIALIZERS, makeSimpleNodeFactory(filter.getTagName()), [filter], objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/Bbox.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeBboxFilter(node, filter, objectStack) {\n var context = objectStack[objectStack.length - 1];\n context['srsName'] = filter.srsName;\n writeOgcPropertyName(node, filter.geometryName);\n GML3.prototype.writeGeometryElement(node, filter.extent, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/Contains.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeContainsFilter(node, filter, objectStack) {\n var context = objectStack[objectStack.length - 1];\n context['srsName'] = filter.srsName;\n writeOgcPropertyName(node, filter.geometryName);\n GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/Intersects.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeIntersectsFilter(node, filter, objectStack) {\n var context = objectStack[objectStack.length - 1];\n context['srsName'] = filter.srsName;\n writeOgcPropertyName(node, filter.geometryName);\n GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/Within.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeWithinFilter(node, filter, objectStack) {\n var context = objectStack[objectStack.length - 1];\n context['srsName'] = filter.srsName;\n writeOgcPropertyName(node, filter.geometryName);\n GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/During.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeDuringFilter(node, filter, objectStack) {\n var valueReference = createElementNS(FESNS, 'ValueReference');\n writeStringTextNode(valueReference, filter.propertyName);\n node.appendChild(valueReference);\n var timePeriod = createElementNS(GMLNS, 'TimePeriod');\n node.appendChild(timePeriod);\n var begin = createElementNS(GMLNS, 'begin');\n timePeriod.appendChild(begin);\n writeTimeInstant(begin, filter.begin);\n var end = createElementNS(GMLNS, 'end');\n timePeriod.appendChild(end);\n writeTimeInstant(end, filter.end);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/LogicalNary.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeLogicalFilter(node, filter, objectStack) {\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var item = { node: node };\n var conditions = filter.conditions;\n for (var i = 0, ii = conditions.length; i < ii; ++i) {\n var condition = conditions[i];\n pushSerializeAndPop(item, GETFEATURE_SERIALIZERS, makeSimpleNodeFactory(condition.getTagName()), [condition], objectStack);\n }\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/Not.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeNotFilter(node, filter, objectStack) {\n /** @type {import(\"../xml.js\").NodeStackItem} */\n var item = { node: node };\n var condition = filter.condition;\n pushSerializeAndPop(item, GETFEATURE_SERIALIZERS, makeSimpleNodeFactory(condition.getTagName()), [condition], objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {import(\"./filter/ComparisonBinary.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeComparisonFilter(node, filter, objectStack) {\n if (filter.matchCase !== undefined) {\n node.setAttribute('matchCase', filter.matchCase.toString());\n }\n writeOgcPropertyName(node, filter.propertyName);\n writeOgcLiteral(node, '' + filter.expression);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/IsNull.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeIsNullFilter(node, filter, objectStack) {\n writeOgcPropertyName(node, filter.propertyName);\n}\n/**\n * @param {Node} node Node.\n * @param {import(\"./filter/IsBetween.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeIsBetweenFilter(node, filter, objectStack) {\n writeOgcPropertyName(node, filter.propertyName);\n var lowerBoundary = createElementNS(OGCNS, 'LowerBoundary');\n node.appendChild(lowerBoundary);\n writeOgcLiteral(lowerBoundary, '' + filter.lowerBoundary);\n var upperBoundary = createElementNS(OGCNS, 'UpperBoundary');\n node.appendChild(upperBoundary);\n writeOgcLiteral(upperBoundary, '' + filter.upperBoundary);\n}\n/**\n * @param {Element} node Node.\n * @param {import(\"./filter/IsLike.js\").default} filter Filter.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeIsLikeFilter(node, filter, objectStack) {\n node.setAttribute('wildCard', filter.wildCard);\n node.setAttribute('singleChar', filter.singleChar);\n node.setAttribute('escapeChar', filter.escapeChar);\n if (filter.matchCase !== undefined) {\n node.setAttribute('matchCase', filter.matchCase.toString());\n }\n writeOgcPropertyName(node, filter.propertyName);\n writeOgcLiteral(node, '' + filter.pattern);\n}\n/**\n * @param {string} tagName Tag name.\n * @param {Node} node Node.\n * @param {string} value Value.\n */\nfunction writeOgcExpression(tagName, node, value) {\n var property = createElementNS(OGCNS, tagName);\n writeStringTextNode(property, value);\n node.appendChild(property);\n}\n/**\n * @param {Node} node Node.\n * @param {string} value PropertyName value.\n */\nfunction writeOgcPropertyName(node, value) {\n writeOgcExpression('PropertyName', node, value);\n}\n/**\n * @param {Node} node Node.\n * @param {string} value PropertyName value.\n */\nfunction writeOgcLiteral(node, value) {\n writeOgcExpression('Literal', node, value);\n}\n/**\n * @param {Node} node Node.\n * @param {string} time PropertyName value.\n */\nfunction writeTimeInstant(node, time) {\n var timeInstant = createElementNS(GMLNS, 'TimeInstant');\n node.appendChild(timeInstant);\n var timePosition = createElementNS(GMLNS, 'timePosition');\n timeInstant.appendChild(timePosition);\n writeStringTextNode(timePosition, time);\n}\n/**\n * Encode filter as WFS `Filter` and return the Node.\n *\n * @param {import(\"./filter/Filter.js\").default} filter Filter.\n * @return {Node} Result.\n * @api\n */\nexport function writeFilter(filter) {\n var child = createElementNS(OGCNS, 'Filter');\n writeFilterCondition(child, filter, []);\n return child;\n}\n/**\n * @param {Node} node Node.\n * @param {Array<string>} featureTypes Feature types.\n * @param {Array<*>} objectStack Node stack.\n */\nfunction writeGetFeature(node, featureTypes, objectStack) {\n var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n var item = /** @type {import(\"../xml.js\").NodeStackItem} */ (assign({}, context));\n item.node = node;\n pushSerializeAndPop(item, GETFEATURE_SERIALIZERS, makeSimpleNodeFactory('Query'), featureTypes, objectStack);\n}\nexport default WFS;\n//# sourceMappingURL=WFS.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/WKT\n */\nimport Feature from '../Feature.js';\nimport { transformGeometryWithOptions } from './Feature.js';\nimport TextFeature from './TextFeature.js';\nimport GeometryCollection from '../geom/GeometryCollection.js';\nimport GeometryType from '../geom/GeometryType.js';\nimport GeometryLayout from '../geom/GeometryLayout.js';\nimport LineString from '../geom/LineString.js';\nimport MultiLineString from '../geom/MultiLineString.js';\nimport MultiPoint from '../geom/MultiPoint.js';\nimport MultiPolygon from '../geom/MultiPolygon.js';\nimport Point from '../geom/Point.js';\nimport Polygon from '../geom/Polygon.js';\n/**\n * Geometry constructors\n * @enum {function (new:import(\"../geom/Geometry.js\").default, Array, GeometryLayout)}\n */\nvar GeometryConstructor = {\n 'POINT': Point,\n 'LINESTRING': LineString,\n 'POLYGON': Polygon,\n 'MULTIPOINT': MultiPoint,\n 'MULTILINESTRING': MultiLineString,\n 'MULTIPOLYGON': MultiPolygon\n};\n/**\n * @typedef {Object} Options\n * @property {boolean} [splitCollection=false] Whether to split GeometryCollections into\n * multiple features on reading.\n */\n/**\n * @typedef {Object} Token\n * @property {number} type\n * @property {number|string} [value]\n * @property {number} position\n */\n/**\n * @const\n * @type {string}\n */\nvar EMPTY = 'EMPTY';\n/**\n * @const\n * @type {string}\n */\nvar Z = 'Z';\n/**\n * @const\n * @type {string}\n */\nvar M = 'M';\n/**\n * @const\n * @type {string}\n */\nvar ZM = 'ZM';\n/**\n * @const\n * @enum {number}\n */\nvar TokenType = {\n TEXT: 1,\n LEFT_PAREN: 2,\n RIGHT_PAREN: 3,\n NUMBER: 4,\n COMMA: 5,\n EOF: 6\n};\n/**\n * @const\n * @type {Object<string, string>}\n */\nvar WKTGeometryType = {};\nfor (var type in GeometryType) {\n WKTGeometryType[type] = GeometryType[type].toUpperCase();\n}\n/**\n * Class to tokenize a WKT string.\n */\nvar Lexer = /** @class */ (function () {\n /**\n * @param {string} wkt WKT string.\n */\n function Lexer(wkt) {\n /**\n * @type {string}\n */\n this.wkt = wkt;\n /**\n * @type {number}\n * @private\n */\n this.index_ = -1;\n }\n /**\n * @param {string} c Character.\n * @return {boolean} Whether the character is alphabetic.\n * @private\n */\n Lexer.prototype.isAlpha_ = function (c) {\n return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';\n };\n /**\n * @param {string} c Character.\n * @param {boolean=} opt_decimal Whether the string number\n * contains a dot, i.e. is a decimal number.\n * @return {boolean} Whether the character is numeric.\n * @private\n */\n Lexer.prototype.isNumeric_ = function (c, opt_decimal) {\n var decimal = opt_decimal !== undefined ? opt_decimal : false;\n return c >= '0' && c <= '9' || c == '.' && !decimal;\n };\n /**\n * @param {string} c Character.\n * @return {boolean} Whether the character is whitespace.\n * @private\n */\n Lexer.prototype.isWhiteSpace_ = function (c) {\n return c == ' ' || c == '\\t' || c == '\\r' || c == '\\n';\n };\n /**\n * @return {string} Next string character.\n * @private\n */\n Lexer.prototype.nextChar_ = function () {\n return this.wkt.charAt(++this.index_);\n };\n /**\n * Fetch and return the next token.\n * @return {!Token} Next string token.\n */\n Lexer.prototype.nextToken = function () {\n var c = this.nextChar_();\n var position = this.index_;\n /** @type {number|string} */\n var value = c;\n var type;\n if (c == '(') {\n type = TokenType.LEFT_PAREN;\n }\n else if (c == ',') {\n type = TokenType.COMMA;\n }\n else if (c == ')') {\n type = TokenType.RIGHT_PAREN;\n }\n else if (this.isNumeric_(c) || c == '-') {\n type = TokenType.NUMBER;\n value = this.readNumber_();\n }\n else if (this.isAlpha_(c)) {\n type = TokenType.TEXT;\n value = this.readText_();\n }\n else if (this.isWhiteSpace_(c)) {\n return this.nextToken();\n }\n else if (c === '') {\n type = TokenType.EOF;\n }\n else {\n throw new Error('Unexpected character: ' + c);\n }\n return { position: position, value: value, type: type };\n };\n /**\n * @return {number} Numeric token value.\n * @private\n */\n Lexer.prototype.readNumber_ = function () {\n var c;\n var index = this.index_;\n var decimal = false;\n var scientificNotation = false;\n do {\n if (c == '.') {\n decimal = true;\n }\n else if (c == 'e' || c == 'E') {\n scientificNotation = true;\n }\n c = this.nextChar_();\n } while (this.isNumeric_(c, decimal) ||\n // if we haven't detected a scientific number before, 'e' or 'E'\n // hint that we should continue to read\n !scientificNotation && (c == 'e' || c == 'E') ||\n // once we know that we have a scientific number, both '-' and '+'\n // are allowed\n scientificNotation && (c == '-' || c == '+'));\n return parseFloat(this.wkt.substring(index, this.index_--));\n };\n /**\n * @return {string} String token value.\n * @private\n */\n Lexer.prototype.readText_ = function () {\n var c;\n var index = this.index_;\n do {\n c = this.nextChar_();\n } while (this.isAlpha_(c));\n return this.wkt.substring(index, this.index_--).toUpperCase();\n };\n return Lexer;\n}());\n/**\n * Class to parse the tokens from the WKT string.\n */\nvar Parser = /** @class */ (function () {\n /**\n * @param {Lexer} lexer The lexer.\n */\n function Parser(lexer) {\n /**\n * @type {Lexer}\n * @private\n */\n this.lexer_ = lexer;\n /**\n * @type {Token}\n * @private\n */\n this.token_;\n /**\n * @type {GeometryLayout}\n * @private\n */\n this.layout_ = GeometryLayout.XY;\n }\n /**\n * Fetch the next token form the lexer and replace the active token.\n * @private\n */\n Parser.prototype.consume_ = function () {\n this.token_ = this.lexer_.nextToken();\n };\n /**\n * Tests if the given type matches the type of the current token.\n * @param {TokenType} type Token type.\n * @return {boolean} Whether the token matches the given type.\n */\n Parser.prototype.isTokenType = function (type) {\n var isMatch = this.token_.type == type;\n return isMatch;\n };\n /**\n * If the given type matches the current token, consume it.\n * @param {TokenType} type Token type.\n * @return {boolean} Whether the token matches the given type.\n */\n Parser.prototype.match = function (type) {\n var isMatch = this.isTokenType(type);\n if (isMatch) {\n this.consume_();\n }\n return isMatch;\n };\n /**\n * Try to parse the tokens provided by the lexer.\n * @return {import(\"../geom/Geometry.js\").default} The geometry.\n */\n Parser.prototype.parse = function () {\n this.consume_();\n var geometry = this.parseGeometry_();\n return geometry;\n };\n /**\n * Try to parse the dimensional info.\n * @return {GeometryLayout} The layout.\n * @private\n */\n Parser.prototype.parseGeometryLayout_ = function () {\n var layout = GeometryLayout.XY;\n var dimToken = this.token_;\n if (this.isTokenType(TokenType.TEXT)) {\n var dimInfo = dimToken.value;\n if (dimInfo === Z) {\n layout = GeometryLayout.XYZ;\n }\n else if (dimInfo === M) {\n layout = GeometryLayout.XYM;\n }\n else if (dimInfo === ZM) {\n layout = GeometryLayout.XYZM;\n }\n if (layout !== GeometryLayout.XY) {\n this.consume_();\n }\n }\n return layout;\n };\n /**\n * @return {!Array<import(\"../geom/Geometry.js\").default>} A collection of geometries.\n * @private\n */\n Parser.prototype.parseGeometryCollectionText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var geometries = [];\n do {\n geometries.push(this.parseGeometry_());\n } while (this.match(TokenType.COMMA));\n if (this.match(TokenType.RIGHT_PAREN)) {\n return geometries;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return [];\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {Array<number>} All values in a point.\n * @private\n */\n Parser.prototype.parsePointText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var coordinates = this.parsePoint_();\n if (this.match(TokenType.RIGHT_PAREN)) {\n return coordinates;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return null;\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<!Array<number>>} All points in a linestring.\n * @private\n */\n Parser.prototype.parseLineStringText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var coordinates = this.parsePointList_();\n if (this.match(TokenType.RIGHT_PAREN)) {\n return coordinates;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return [];\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<!Array<!Array<number>>>} All points in a polygon.\n * @private\n */\n Parser.prototype.parsePolygonText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var coordinates = this.parseLineStringTextList_();\n if (this.match(TokenType.RIGHT_PAREN)) {\n return coordinates;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return [];\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<!Array<number>>} All points in a multipoint.\n * @private\n */\n Parser.prototype.parseMultiPointText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var coordinates = void 0;\n if (this.token_.type == TokenType.LEFT_PAREN) {\n coordinates = this.parsePointTextList_();\n }\n else {\n coordinates = this.parsePointList_();\n }\n if (this.match(TokenType.RIGHT_PAREN)) {\n return coordinates;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return [];\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<!Array<!Array<number>>>} All linestring points\n * in a multilinestring.\n * @private\n */\n Parser.prototype.parseMultiLineStringText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var coordinates = this.parseLineStringTextList_();\n if (this.match(TokenType.RIGHT_PAREN)) {\n return coordinates;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return [];\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<!Array<!Array<!Array<number>>>>} All polygon points in a multipolygon.\n * @private\n */\n Parser.prototype.parseMultiPolygonText_ = function () {\n if (this.match(TokenType.LEFT_PAREN)) {\n var coordinates = this.parsePolygonTextList_();\n if (this.match(TokenType.RIGHT_PAREN)) {\n return coordinates;\n }\n }\n else if (this.isEmptyGeometry_()) {\n return [];\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<number>} A point.\n * @private\n */\n Parser.prototype.parsePoint_ = function () {\n var coordinates = [];\n var dimensions = this.layout_.length;\n for (var i = 0; i < dimensions; ++i) {\n var token = this.token_;\n if (this.match(TokenType.NUMBER)) {\n coordinates.push(/** @type {number} */ (token.value));\n }\n else {\n break;\n }\n }\n if (coordinates.length == dimensions) {\n return coordinates;\n }\n throw new Error(this.formatErrorMessage_());\n };\n /**\n * @return {!Array<!Array<number>>} An array of points.\n * @private\n */\n Parser.prototype.parsePointList_ = function () {\n var coordinates = [this.parsePoint_()];\n while (this.match(TokenType.COMMA)) {\n coordinates.push(this.parsePoint_());\n }\n return coordinates;\n };\n /**\n * @return {!Array<!Array<number>>} An array of points.\n * @private\n */\n Parser.prototype.parsePointTextList_ = function () {\n var coordinates = [this.parsePointText_()];\n while (this.match(TokenType.COMMA)) {\n coordinates.push(this.parsePointText_());\n }\n return coordinates;\n };\n /**\n * @return {!Array<!Array<!Array<number>>>} An array of points.\n * @private\n */\n Parser.prototype.parseLineStringTextList_ = function () {\n var coordinates = [this.parseLineStringText_()];\n while (this.match(TokenType.COMMA)) {\n coordinates.push(this.parseLineStringText_());\n }\n return coordinates;\n };\n /**\n * @return {!Array<!Array<!Array<!Array<number>>>>} An array of points.\n * @private\n */\n Parser.prototype.parsePolygonTextList_ = function () {\n var coordinates = [this.parsePolygonText_()];\n while (this.match(TokenType.COMMA)) {\n coordinates.push(this.parsePolygonText_());\n }\n return coordinates;\n };\n /**\n * @return {boolean} Whether the token implies an empty geometry.\n * @private\n */\n Parser.prototype.isEmptyGeometry_ = function () {\n var isEmpty = this.isTokenType(TokenType.TEXT) &&\n this.token_.value == EMPTY;\n if (isEmpty) {\n this.consume_();\n }\n return isEmpty;\n };\n /**\n * Create an error message for an unexpected token error.\n * @return {string} Error message.\n * @private\n */\n Parser.prototype.formatErrorMessage_ = function () {\n return 'Unexpected `' + this.token_.value + '` at position ' +\n this.token_.position + ' in `' + this.lexer_.wkt + '`';\n };\n /**\n * @return {!import(\"../geom/Geometry.js\").default} The geometry.\n * @private\n */\n Parser.prototype.parseGeometry_ = function () {\n var token = this.token_;\n if (this.match(TokenType.TEXT)) {\n var geomType = token.value;\n this.layout_ = this.parseGeometryLayout_();\n if (geomType == 'GEOMETRYCOLLECTION') {\n var geometries = this.parseGeometryCollectionText_();\n return new GeometryCollection(geometries);\n }\n else {\n var ctor = GeometryConstructor[geomType];\n if (!ctor) {\n throw new Error('Invalid geometry type: ' + geomType);\n }\n var coordinates = void 0;\n switch (geomType) {\n case 'POINT': {\n coordinates = this.parsePointText_();\n break;\n }\n case 'LINESTRING': {\n coordinates = this.parseLineStringText_();\n break;\n }\n case 'POLYGON': {\n coordinates = this.parsePolygonText_();\n break;\n }\n case 'MULTIPOINT': {\n coordinates = this.parseMultiPointText_();\n break;\n }\n case 'MULTILINESTRING': {\n coordinates = this.parseMultiLineStringText_();\n break;\n }\n case 'MULTIPOLYGON': {\n coordinates = this.parseMultiPolygonText_();\n break;\n }\n default: {\n throw new Error('Invalid geometry type: ' + geomType);\n }\n }\n if (!coordinates) {\n if (ctor === GeometryConstructor['POINT']) {\n coordinates = [NaN, NaN];\n }\n else {\n coordinates = [];\n }\n }\n return new ctor(coordinates, this.layout_);\n }\n }\n throw new Error(this.formatErrorMessage_());\n };\n return Parser;\n}());\n/**\n * @classdesc\n * Geometry format for reading and writing data in the `WellKnownText` (WKT)\n * format.\n *\n * @api\n */\nvar WKT = /** @class */ (function (_super) {\n __extends(WKT, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function WKT(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * Split GeometryCollection into multiple features.\n * @type {boolean}\n * @private\n */\n _this.splitCollection_ = options.splitCollection !== undefined ?\n options.splitCollection : false;\n return _this;\n }\n /**\n * Parse a WKT string.\n * @param {string} wkt WKT string.\n * @return {import(\"../geom/Geometry.js\").default|undefined}\n * The geometry created.\n * @private\n */\n WKT.prototype.parse_ = function (wkt) {\n var lexer = new Lexer(wkt);\n var parser = new Parser(lexer);\n return parser.parse();\n };\n /**\n * @inheritDoc\n */\n WKT.prototype.readFeatureFromText = function (text, opt_options) {\n var geom = this.readGeometryFromText(text, opt_options);\n if (geom) {\n var feature = new Feature();\n feature.setGeometry(geom);\n return feature;\n }\n return null;\n };\n /**\n * @inheritDoc\n */\n WKT.prototype.readFeaturesFromText = function (text, opt_options) {\n var geometries = [];\n var geometry = this.readGeometryFromText(text, opt_options);\n if (this.splitCollection_ &&\n geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {\n geometries = ( /** @type {GeometryCollection} */(geometry))\n .getGeometriesArray();\n }\n else {\n geometries = [geometry];\n }\n var features = [];\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n var feature = new Feature();\n feature.setGeometry(geometries[i]);\n features.push(feature);\n }\n return features;\n };\n /**\n * @inheritDoc\n */\n WKT.prototype.readGeometryFromText = function (text, opt_options) {\n var geometry = this.parse_(text);\n if (geometry) {\n return transformGeometryWithOptions(geometry, false, opt_options);\n }\n else {\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n WKT.prototype.writeFeatureText = function (feature, opt_options) {\n var geometry = feature.getGeometry();\n if (geometry) {\n return this.writeGeometryText(geometry, opt_options);\n }\n return '';\n };\n /**\n * @inheritDoc\n */\n WKT.prototype.writeFeaturesText = function (features, opt_options) {\n if (features.length == 1) {\n return this.writeFeatureText(features[0], opt_options);\n }\n var geometries = [];\n for (var i = 0, ii = features.length; i < ii; ++i) {\n geometries.push(features[i].getGeometry());\n }\n var collection = new GeometryCollection(geometries);\n return this.writeGeometryText(collection, opt_options);\n };\n /**\n * @inheritDoc\n */\n WKT.prototype.writeGeometryText = function (geometry, opt_options) {\n return encode(transformGeometryWithOptions(geometry, true, opt_options));\n };\n return WKT;\n}(TextFeature));\n/**\n * @param {Point} geom Point geometry.\n * @return {string} Coordinates part of Point as WKT.\n */\nfunction encodePointGeometry(geom) {\n var coordinates = geom.getCoordinates();\n if (coordinates.length === 0) {\n return '';\n }\n return coordinates.join(' ');\n}\n/**\n * @param {MultiPoint} geom MultiPoint geometry.\n * @return {string} Coordinates part of MultiPoint as WKT.\n */\nfunction encodeMultiPointGeometry(geom) {\n var array = [];\n var components = geom.getPoints();\n for (var i = 0, ii = components.length; i < ii; ++i) {\n array.push('(' + encodePointGeometry(components[i]) + ')');\n }\n return array.join(',');\n}\n/**\n * @param {GeometryCollection} geom GeometryCollection geometry.\n * @return {string} Coordinates part of GeometryCollection as WKT.\n */\nfunction encodeGeometryCollectionGeometry(geom) {\n var array = [];\n var geoms = geom.getGeometries();\n for (var i = 0, ii = geoms.length; i < ii; ++i) {\n array.push(encode(geoms[i]));\n }\n return array.join(',');\n}\n/**\n * @param {LineString|import(\"../geom/LinearRing.js\").default} geom LineString geometry.\n * @return {string} Coordinates part of LineString as WKT.\n */\nfunction encodeLineStringGeometry(geom) {\n var coordinates = geom.getCoordinates();\n var array = [];\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n array.push(coordinates[i].join(' '));\n }\n return array.join(',');\n}\n/**\n * @param {MultiLineString} geom MultiLineString geometry.\n * @return {string} Coordinates part of MultiLineString as WKT.\n */\nfunction encodeMultiLineStringGeometry(geom) {\n var array = [];\n var components = geom.getLineStrings();\n for (var i = 0, ii = components.length; i < ii; ++i) {\n array.push('(' + encodeLineStringGeometry(components[i]) + ')');\n }\n return array.join(',');\n}\n/**\n * @param {Polygon} geom Polygon geometry.\n * @return {string} Coordinates part of Polygon as WKT.\n */\nfunction encodePolygonGeometry(geom) {\n var array = [];\n var rings = geom.getLinearRings();\n for (var i = 0, ii = rings.length; i < ii; ++i) {\n array.push('(' + encodeLineStringGeometry(rings[i]) + ')');\n }\n return array.join(',');\n}\n/**\n * @param {MultiPolygon} geom MultiPolygon geometry.\n * @return {string} Coordinates part of MultiPolygon as WKT.\n */\nfunction encodeMultiPolygonGeometry(geom) {\n var array = [];\n var components = geom.getPolygons();\n for (var i = 0, ii = components.length; i < ii; ++i) {\n array.push('(' + encodePolygonGeometry(components[i]) + ')');\n }\n return array.join(',');\n}\n/**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geom SimpleGeometry geometry.\n * @return {string} Potential dimensional information for WKT type.\n */\nfunction encodeGeometryLayout(geom) {\n var layout = geom.getLayout();\n var dimInfo = '';\n if (layout === GeometryLayout.XYZ || layout === GeometryLayout.XYZM) {\n dimInfo += Z;\n }\n if (layout === GeometryLayout.XYM || layout === GeometryLayout.XYZM) {\n dimInfo += M;\n }\n return dimInfo;\n}\n/**\n * @const\n * @type {Object<string, function(import(\"../geom/Geometry.js\").default): string>}\n */\nvar GeometryEncoder = {\n 'Point': encodePointGeometry,\n 'LineString': encodeLineStringGeometry,\n 'Polygon': encodePolygonGeometry,\n 'MultiPoint': encodeMultiPointGeometry,\n 'MultiLineString': encodeMultiLineStringGeometry,\n 'MultiPolygon': encodeMultiPolygonGeometry,\n 'GeometryCollection': encodeGeometryCollectionGeometry\n};\n/**\n * Encode a geometry as WKT.\n * @param {!import(\"../geom/Geometry.js\").default} geom The geometry to encode.\n * @return {string} WKT string for the geometry.\n */\nfunction encode(geom) {\n var type = geom.getType();\n var geometryEncoder = GeometryEncoder[type];\n var enc = geometryEncoder(geom);\n type = type.toUpperCase();\n if (typeof /** @type {?} */ (geom).getFlatCoordinates === 'function') {\n var dimInfo = encodeGeometryLayout(/** @type {import(\"../geom/SimpleGeometry.js\").default} */ (geom));\n if (dimInfo.length > 0) {\n type += ' ' + dimInfo;\n }\n }\n if (enc.length === 0) {\n return type + ' ' + EMPTY;\n }\n return type + '(' + enc + ')';\n}\nexport default WKT;\n//# sourceMappingURL=WKT.js.map","/**\n * @module ol/format/XLink\n */\n/**\n * @const\n * @type {string}\n */\nvar NAMESPACE_URI = 'http://www.w3.org/1999/xlink';\n/**\n * @param {Element} node Node.\n * @return {string|undefined} href.\n */\nexport function readHref(node) {\n return node.getAttributeNS(NAMESPACE_URI, 'href');\n}\n//# sourceMappingURL=XLink.js.map","/**\n * @module ol/format/XML\n */\nimport { isDocument, parse } from '../xml.js';\n/**\n * @classdesc\n * Generic format for reading non-feature XML data\n *\n * @abstract\n */\nvar XML = /** @class */ (function () {\n function XML() {\n }\n /**\n * Read the source document.\n *\n * @param {Document|Element|string} source The XML source.\n * @return {Object} An object representing the source.\n * @api\n */\n XML.prototype.read = function (source) {\n if (!source) {\n return null;\n }\n else if (typeof source === 'string') {\n var doc = parse(source);\n return this.readFromDocument(doc);\n }\n else if (isDocument(source)) {\n return this.readFromDocument(/** @type {Document} */ (source));\n }\n else {\n return this.readFromNode(/** @type {Element} */ (source));\n }\n };\n /**\n * @abstract\n * @param {Document} doc Document.\n * @return {Object} Object\n */\n XML.prototype.readFromDocument = function (doc) { };\n /**\n * @abstract\n * @param {Element} node Node.\n * @return {Object} Object\n */\n XML.prototype.readFromNode = function (node) { };\n return XML;\n}());\nexport default XML;\n//# sourceMappingURL=XML.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/WMSCapabilities\n */\nimport { readHref } from './XLink.js';\nimport XML from './XML.js';\nimport { readDecimalString, readString, readNonNegativeInteger, readDecimal, readBooleanString, readNonNegativeIntegerString } from './xsd.js';\nimport { makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pushParseAndPop } from '../xml.js';\n/**\n * @const\n * @type {Array<null|string>}\n */\nvar NAMESPACE_URIS = [\n null,\n 'http://www.opengis.net/wms'\n];\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Service': makeObjectPropertySetter(readService),\n 'Capability': makeObjectPropertySetter(readCapability)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CAPABILITY_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Request': makeObjectPropertySetter(readRequest),\n 'Exception': makeObjectPropertySetter(readException),\n 'Layer': makeObjectPropertySetter(readCapabilityLayer)\n});\n/**\n * @classdesc\n * Format for reading WMS capabilities data\n *\n * @api\n */\nvar WMSCapabilities = /** @class */ (function (_super) {\n __extends(WMSCapabilities, _super);\n function WMSCapabilities() {\n var _this = _super.call(this) || this;\n /**\n * @type {string|undefined}\n */\n _this.version = undefined;\n return _this;\n }\n /**\n * @inheritDoc\n */\n WMSCapabilities.prototype.readFromDocument = function (doc) {\n for (var n = doc.firstChild; n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n return this.readFromNode(n);\n }\n }\n return null;\n };\n /**\n * @inheritDoc\n */\n WMSCapabilities.prototype.readFromNode = function (node) {\n this.version = node.getAttribute('version').trim();\n var wmsCapabilityObject = pushParseAndPop({\n 'version': this.version\n }, PARSERS, node, []);\n return wmsCapabilityObject ? wmsCapabilityObject : null;\n };\n return WMSCapabilities;\n}(XML));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar SERVICE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Name': makeObjectPropertySetter(readString),\n 'Title': makeObjectPropertySetter(readString),\n 'Abstract': makeObjectPropertySetter(readString),\n 'KeywordList': makeObjectPropertySetter(readKeywordList),\n 'OnlineResource': makeObjectPropertySetter(readHref),\n 'ContactInformation': makeObjectPropertySetter(readContactInformation),\n 'Fees': makeObjectPropertySetter(readString),\n 'AccessConstraints': makeObjectPropertySetter(readString),\n 'LayerLimit': makeObjectPropertySetter(readNonNegativeInteger),\n 'MaxWidth': makeObjectPropertySetter(readNonNegativeInteger),\n 'MaxHeight': makeObjectPropertySetter(readNonNegativeInteger)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CONTACT_INFORMATION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ContactPersonPrimary': makeObjectPropertySetter(readContactPersonPrimary),\n 'ContactPosition': makeObjectPropertySetter(readString),\n 'ContactAddress': makeObjectPropertySetter(readContactAddress),\n 'ContactVoiceTelephone': makeObjectPropertySetter(readString),\n 'ContactFacsimileTelephone': makeObjectPropertySetter(readString),\n 'ContactElectronicMailAddress': makeObjectPropertySetter(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CONTACT_PERSON_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ContactPerson': makeObjectPropertySetter(readString),\n 'ContactOrganization': makeObjectPropertySetter(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CONTACT_ADDRESS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'AddressType': makeObjectPropertySetter(readString),\n 'Address': makeObjectPropertySetter(readString),\n 'City': makeObjectPropertySetter(readString),\n 'StateOrProvince': makeObjectPropertySetter(readString),\n 'PostCode': makeObjectPropertySetter(readString),\n 'Country': makeObjectPropertySetter(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar EXCEPTION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Format': makeArrayPusher(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LAYER_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Name': makeObjectPropertySetter(readString),\n 'Title': makeObjectPropertySetter(readString),\n 'Abstract': makeObjectPropertySetter(readString),\n 'KeywordList': makeObjectPropertySetter(readKeywordList),\n 'CRS': makeObjectPropertyPusher(readString),\n 'EX_GeographicBoundingBox': makeObjectPropertySetter(readEXGeographicBoundingBox),\n 'BoundingBox': makeObjectPropertyPusher(readBoundingBox),\n 'Dimension': makeObjectPropertyPusher(readDimension),\n 'Attribution': makeObjectPropertySetter(readAttribution),\n 'AuthorityURL': makeObjectPropertyPusher(readAuthorityURL),\n 'Identifier': makeObjectPropertyPusher(readString),\n 'MetadataURL': makeObjectPropertyPusher(readMetadataURL),\n 'DataURL': makeObjectPropertyPusher(readFormatOnlineresource),\n 'FeatureListURL': makeObjectPropertyPusher(readFormatOnlineresource),\n 'Style': makeObjectPropertyPusher(readStyle),\n 'MinScaleDenominator': makeObjectPropertySetter(readDecimal),\n 'MaxScaleDenominator': makeObjectPropertySetter(readDecimal),\n 'Layer': makeObjectPropertyPusher(readLayer)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar ATTRIBUTION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Title': makeObjectPropertySetter(readString),\n 'OnlineResource': makeObjectPropertySetter(readHref),\n 'LogoURL': makeObjectPropertySetter(readSizedFormatOnlineresource)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'westBoundLongitude': makeObjectPropertySetter(readDecimal),\n 'eastBoundLongitude': makeObjectPropertySetter(readDecimal),\n 'southBoundLatitude': makeObjectPropertySetter(readDecimal),\n 'northBoundLatitude': makeObjectPropertySetter(readDecimal)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar REQUEST_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'GetCapabilities': makeObjectPropertySetter(readOperationType),\n 'GetMap': makeObjectPropertySetter(readOperationType),\n 'GetFeatureInfo': makeObjectPropertySetter(readOperationType)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar OPERATIONTYPE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Format': makeObjectPropertyPusher(readString),\n 'DCPType': makeObjectPropertyPusher(readDCPType)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar DCPTYPE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'HTTP': makeObjectPropertySetter(readHTTP)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar HTTP_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Get': makeObjectPropertySetter(readFormatOnlineresource),\n 'Post': makeObjectPropertySetter(readFormatOnlineresource)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Name': makeObjectPropertySetter(readString),\n 'Title': makeObjectPropertySetter(readString),\n 'Abstract': makeObjectPropertySetter(readString),\n 'LegendURL': makeObjectPropertyPusher(readSizedFormatOnlineresource),\n 'StyleSheetURL': makeObjectPropertySetter(readFormatOnlineresource),\n 'StyleURL': makeObjectPropertySetter(readFormatOnlineresource)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar FORMAT_ONLINERESOURCE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Format': makeObjectPropertySetter(readString),\n 'OnlineResource': makeObjectPropertySetter(readHref)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar KEYWORDLIST_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Keyword': makeArrayPusher(readString)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Attribution object.\n */\nfunction readAttribution(node, objectStack) {\n return pushParseAndPop({}, ATTRIBUTION_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object} Bounding box object.\n */\nfunction readBoundingBox(node, objectStack) {\n var extent = [\n readDecimalString(node.getAttribute('minx')),\n readDecimalString(node.getAttribute('miny')),\n readDecimalString(node.getAttribute('maxx')),\n readDecimalString(node.getAttribute('maxy'))\n ];\n var resolutions = [\n readDecimalString(node.getAttribute('resx')),\n readDecimalString(node.getAttribute('resy'))\n ];\n return {\n 'crs': node.getAttribute('CRS'),\n 'extent': extent,\n 'res': resolutions\n };\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {import(\"../extent.js\").Extent|undefined} Bounding box object.\n */\nfunction readEXGeographicBoundingBox(node, objectStack) {\n var geographicBoundingBox = pushParseAndPop({}, EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS, node, objectStack);\n if (!geographicBoundingBox) {\n return undefined;\n }\n var westBoundLongitude = /** @type {number|undefined} */ (geographicBoundingBox['westBoundLongitude']);\n var southBoundLatitude = /** @type {number|undefined} */ (geographicBoundingBox['southBoundLatitude']);\n var eastBoundLongitude = /** @type {number|undefined} */ (geographicBoundingBox['eastBoundLongitude']);\n var northBoundLatitude = /** @type {number|undefined} */ (geographicBoundingBox['northBoundLatitude']);\n if (westBoundLongitude === undefined || southBoundLatitude === undefined ||\n eastBoundLongitude === undefined || northBoundLatitude === undefined) {\n return undefined;\n }\n return [\n westBoundLongitude, southBoundLatitude,\n eastBoundLongitude, northBoundLatitude\n ];\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Capability object.\n */\nfunction readCapability(node, objectStack) {\n return pushParseAndPop({}, CAPABILITY_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Service object.\n */\nfunction readService(node, objectStack) {\n return pushParseAndPop({}, SERVICE_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Contact information object.\n */\nfunction readContactInformation(node, objectStack) {\n return pushParseAndPop({}, CONTACT_INFORMATION_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Contact person object.\n */\nfunction readContactPersonPrimary(node, objectStack) {\n return pushParseAndPop({}, CONTACT_PERSON_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Contact address object.\n */\nfunction readContactAddress(node, objectStack) {\n return pushParseAndPop({}, CONTACT_ADDRESS_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<string>|undefined} Format array.\n */\nfunction readException(node, objectStack) {\n return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Layer object.\n */\nfunction readCapabilityLayer(node, objectStack) {\n return pushParseAndPop({}, LAYER_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Layer object.\n */\nfunction readLayer(node, objectStack) {\n var parentLayerObject = /** @type {!Object<string,*>} */ (objectStack[objectStack.length - 1]);\n var layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack);\n if (!layerObject) {\n return undefined;\n }\n var queryable = readBooleanString(node.getAttribute('queryable'));\n if (queryable === undefined) {\n queryable = parentLayerObject['queryable'];\n }\n layerObject['queryable'] = queryable !== undefined ? queryable : false;\n var cascaded = readNonNegativeIntegerString(node.getAttribute('cascaded'));\n if (cascaded === undefined) {\n cascaded = parentLayerObject['cascaded'];\n }\n layerObject['cascaded'] = cascaded;\n var opaque = readBooleanString(node.getAttribute('opaque'));\n if (opaque === undefined) {\n opaque = parentLayerObject['opaque'];\n }\n layerObject['opaque'] = opaque !== undefined ? opaque : false;\n var noSubsets = readBooleanString(node.getAttribute('noSubsets'));\n if (noSubsets === undefined) {\n noSubsets = parentLayerObject['noSubsets'];\n }\n layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;\n var fixedWidth = readDecimalString(node.getAttribute('fixedWidth'));\n if (!fixedWidth) {\n fixedWidth = parentLayerObject['fixedWidth'];\n }\n layerObject['fixedWidth'] = fixedWidth;\n var fixedHeight = readDecimalString(node.getAttribute('fixedHeight'));\n if (!fixedHeight) {\n fixedHeight = parentLayerObject['fixedHeight'];\n }\n layerObject['fixedHeight'] = fixedHeight;\n // See 7.2.4.8\n var addKeys = ['Style', 'CRS', 'AuthorityURL'];\n addKeys.forEach(function (key) {\n if (key in parentLayerObject) {\n var childValue = layerObject[key] || [];\n layerObject[key] = childValue.concat(parentLayerObject[key]);\n }\n });\n var replaceKeys = ['EX_GeographicBoundingBox', 'BoundingBox', 'Dimension',\n 'Attribution', 'MinScaleDenominator', 'MaxScaleDenominator'];\n replaceKeys.forEach(function (key) {\n if (!(key in layerObject)) {\n var parentValue = parentLayerObject[key];\n layerObject[key] = parentValue;\n }\n });\n return layerObject;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object} Dimension object.\n */\nfunction readDimension(node, objectStack) {\n var dimensionObject = {\n 'name': node.getAttribute('name'),\n 'units': node.getAttribute('units'),\n 'unitSymbol': node.getAttribute('unitSymbol'),\n 'default': node.getAttribute('default'),\n 'multipleValues': readBooleanString(node.getAttribute('multipleValues')),\n 'nearestValue': readBooleanString(node.getAttribute('nearestValue')),\n 'current': readBooleanString(node.getAttribute('current')),\n 'values': readString(node)\n };\n return dimensionObject;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Online resource object.\n */\nfunction readFormatOnlineresource(node, objectStack) {\n return pushParseAndPop({}, FORMAT_ONLINERESOURCE_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Request object.\n */\nfunction readRequest(node, objectStack) {\n return pushParseAndPop({}, REQUEST_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} DCP type object.\n */\nfunction readDCPType(node, objectStack) {\n return pushParseAndPop({}, DCPTYPE_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} HTTP object.\n */\nfunction readHTTP(node, objectStack) {\n return pushParseAndPop({}, HTTP_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Operation type object.\n */\nfunction readOperationType(node, objectStack) {\n return pushParseAndPop({}, OPERATIONTYPE_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Online resource object.\n */\nfunction readSizedFormatOnlineresource(node, objectStack) {\n var formatOnlineresource = readFormatOnlineresource(node, objectStack);\n if (formatOnlineresource) {\n var size = [\n readNonNegativeIntegerString(node.getAttribute('width')),\n readNonNegativeIntegerString(node.getAttribute('height'))\n ];\n formatOnlineresource['size'] = size;\n return formatOnlineresource;\n }\n return undefined;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Authority URL object.\n */\nfunction readAuthorityURL(node, objectStack) {\n var authorityObject = readFormatOnlineresource(node, objectStack);\n if (authorityObject) {\n authorityObject['name'] = node.getAttribute('name');\n return authorityObject;\n }\n return undefined;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Metadata URL object.\n */\nfunction readMetadataURL(node, objectStack) {\n var metadataObject = readFormatOnlineresource(node, objectStack);\n if (metadataObject) {\n metadataObject['type'] = node.getAttribute('type');\n return metadataObject;\n }\n return undefined;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Style object.\n */\nfunction readStyle(node, objectStack) {\n return pushParseAndPop({}, STYLE_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<string>|undefined} Keyword list.\n */\nfunction readKeywordList(node, objectStack) {\n return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);\n}\nexport default WMSCapabilities;\n//# sourceMappingURL=WMSCapabilities.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/WMSGetFeatureInfo\n */\nimport { extend, includes } from '../array.js';\nimport GML2 from './GML2.js';\nimport XMLFeature from './XMLFeature.js';\nimport { assign } from '../obj.js';\nimport { makeArrayPusher, makeStructureNS, pushParseAndPop } from '../xml.js';\n/**\n * @typedef {Object} Options\n * @property {Array<string>} [layers] If set, only features of the given layers will be returned by the format when read.\n */\n/**\n * @const\n * @type {string}\n */\nvar featureIdentifier = '_feature';\n/**\n * @const\n * @type {string}\n */\nvar layerIdentifier = '_layer';\n/**\n * @classdesc\n * Format for reading WMSGetFeatureInfo format. It uses\n * {@link module:ol/format/GML2~GML2} to read features.\n *\n * @api\n */\nvar WMSGetFeatureInfo = /** @class */ (function (_super) {\n __extends(WMSGetFeatureInfo, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function WMSGetFeatureInfo(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {string}\n */\n _this.featureNS_ = 'http://mapserver.gis.umn.edu/mapserver';\n /**\n * @private\n * @type {GML2}\n */\n _this.gmlFormat_ = new GML2();\n /**\n * @private\n * @type {Array<string>}\n */\n _this.layers_ = options.layers ? options.layers : null;\n return _this;\n }\n /**\n * @return {Array<string>} layers\n */\n WMSGetFeatureInfo.prototype.getLayers = function () {\n return this.layers_;\n };\n /**\n * @param {Array<string>} layers Layers to parse.\n */\n WMSGetFeatureInfo.prototype.setLayers = function (layers) {\n this.layers_ = layers;\n };\n /**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Array<import(\"../Feature.js\").default>} Features.\n * @private\n */\n WMSGetFeatureInfo.prototype.readFeatures_ = function (node, objectStack) {\n node.setAttribute('namespaceURI', this.featureNS_);\n var localName = node.localName;\n /** @type {Array<import(\"../Feature.js\").default>} */\n var features = [];\n if (node.childNodes.length === 0) {\n return features;\n }\n if (localName == 'msGMLOutput') {\n for (var i = 0, ii = node.childNodes.length; i < ii; i++) {\n var layer = node.childNodes[i];\n if (layer.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n var layerElement = /** @type {Element} */ (layer);\n var context = objectStack[0];\n var toRemove = layerIdentifier;\n var layerName = layerElement.localName.replace(toRemove, '');\n if (this.layers_ && !includes(this.layers_, layerName)) {\n continue;\n }\n var featureType = layerName +\n featureIdentifier;\n context['featureType'] = featureType;\n context['featureNS'] = this.featureNS_;\n /** @type {Object<string, import(\"../xml.js\").Parser>} */\n var parsers = {};\n parsers[featureType] = makeArrayPusher(this.gmlFormat_.readFeatureElement, this.gmlFormat_);\n var parsersNS = makeStructureNS([context['featureNS'], null], parsers);\n layerElement.setAttribute('namespaceURI', this.featureNS_);\n var layerFeatures = pushParseAndPop(\n // @ts-ignore\n [], parsersNS, layerElement, objectStack, this.gmlFormat_);\n if (layerFeatures) {\n extend(features, layerFeatures);\n }\n }\n }\n if (localName == 'FeatureCollection') {\n var gmlFeatures = pushParseAndPop([], this.gmlFormat_.FEATURE_COLLECTION_PARSERS, node, [{}], this.gmlFormat_);\n if (gmlFeatures) {\n features = gmlFeatures;\n }\n }\n return features;\n };\n /**\n * @inheritDoc\n */\n WMSGetFeatureInfo.prototype.readFeaturesFromNode = function (node, opt_options) {\n var options = {};\n if (opt_options) {\n assign(options, this.getReadOptions(node, opt_options));\n }\n return this.readFeatures_(node, [options]);\n };\n return WMSGetFeatureInfo;\n}(XMLFeature));\nexport default WMSGetFeatureInfo;\n//# sourceMappingURL=WMSGetFeatureInfo.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/OWS\n */\nimport { readHref } from './XLink.js';\nimport XML from './XML.js';\nimport { readString } from './xsd.js';\nimport { makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pushParseAndPop } from '../xml.js';\n/**\n * @const\n * @type {Array<null|string>}\n */\nvar NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ServiceIdentification': makeObjectPropertySetter(readServiceIdentification),\n 'ServiceProvider': makeObjectPropertySetter(readServiceProvider),\n 'OperationsMetadata': makeObjectPropertySetter(readOperationsMetadata)\n});\nvar OWS = /** @class */ (function (_super) {\n __extends(OWS, _super);\n function OWS() {\n return _super.call(this) || this;\n }\n /**\n * @inheritDoc\n */\n OWS.prototype.readFromDocument = function (doc) {\n for (var n = doc.firstChild; n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n return this.readFromNode(n);\n }\n }\n return null;\n };\n /**\n * @inheritDoc\n */\n OWS.prototype.readFromNode = function (node) {\n var owsObject = pushParseAndPop({}, PARSERS, node, []);\n return owsObject ? owsObject : null;\n };\n return OWS;\n}(XML));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar ADDRESS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'DeliveryPoint': makeObjectPropertySetter(readString),\n 'City': makeObjectPropertySetter(readString),\n 'AdministrativeArea': makeObjectPropertySetter(readString),\n 'PostalCode': makeObjectPropertySetter(readString),\n 'Country': makeObjectPropertySetter(readString),\n 'ElectronicMailAddress': makeObjectPropertySetter(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar ALLOWED_VALUES_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Value': makeObjectPropertyPusher(readValue)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CONSTRAINT_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'AllowedValues': makeObjectPropertySetter(readAllowedValues)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CONTACT_INFO_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Phone': makeObjectPropertySetter(readPhone),\n 'Address': makeObjectPropertySetter(readAddress)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar DCP_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'HTTP': makeObjectPropertySetter(readHttp)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar HTTP_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Get': makeObjectPropertyPusher(readGet),\n 'Post': undefined // TODO\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar OPERATION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'DCP': makeObjectPropertySetter(readDcp)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar OPERATIONS_METADATA_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Operation': readOperation\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PHONE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Voice': makeObjectPropertySetter(readString),\n 'Facsimile': makeObjectPropertySetter(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar REQUEST_METHOD_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Constraint': makeObjectPropertyPusher(readConstraint)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar SERVICE_CONTACT_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'IndividualName': makeObjectPropertySetter(readString),\n 'PositionName': makeObjectPropertySetter(readString),\n 'ContactInfo': makeObjectPropertySetter(readContactInfo)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar SERVICE_IDENTIFICATION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Abstract': makeObjectPropertySetter(readString),\n 'AccessConstraints': makeObjectPropertySetter(readString),\n 'Fees': makeObjectPropertySetter(readString),\n 'Title': makeObjectPropertySetter(readString),\n 'ServiceTypeVersion': makeObjectPropertySetter(readString),\n 'ServiceType': makeObjectPropertySetter(readString)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar SERVICE_PROVIDER_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'ProviderName': makeObjectPropertySetter(readString),\n 'ProviderSite': makeObjectPropertySetter(readHref),\n 'ServiceContact': makeObjectPropertySetter(readServiceContact)\n});\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The address.\n */\nfunction readAddress(node, objectStack) {\n return pushParseAndPop({}, ADDRESS_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The values.\n */\nfunction readAllowedValues(node, objectStack) {\n return pushParseAndPop({}, ALLOWED_VALUES_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The constraint.\n */\nfunction readConstraint(node, objectStack) {\n var name = node.getAttribute('name');\n if (!name) {\n return undefined;\n }\n return pushParseAndPop({ 'name': name }, CONSTRAINT_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The contact info.\n */\nfunction readContactInfo(node, objectStack) {\n return pushParseAndPop({}, CONTACT_INFO_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The DCP.\n */\nfunction readDcp(node, objectStack) {\n return pushParseAndPop({}, DCP_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The GET object.\n */\nfunction readGet(node, objectStack) {\n var href = readHref(node);\n if (!href) {\n return undefined;\n }\n return pushParseAndPop({ 'href': href }, REQUEST_METHOD_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The HTTP object.\n */\nfunction readHttp(node, objectStack) {\n return pushParseAndPop({}, HTTP_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The operation.\n */\nfunction readOperation(node, objectStack) {\n var name = node.getAttribute('name');\n var value = pushParseAndPop({}, OPERATION_PARSERS, node, objectStack);\n if (!value) {\n return undefined;\n }\n var object = /** @type {Object} */ (objectStack[objectStack.length - 1]);\n object[name] = value;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The operations metadata.\n */\nfunction readOperationsMetadata(node, objectStack) {\n return pushParseAndPop({}, OPERATIONS_METADATA_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The phone.\n */\nfunction readPhone(node, objectStack) {\n return pushParseAndPop({}, PHONE_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The service identification.\n */\nfunction readServiceIdentification(node, objectStack) {\n return pushParseAndPop({}, SERVICE_IDENTIFICATION_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The service contact.\n */\nfunction readServiceContact(node, objectStack) {\n return pushParseAndPop({}, SERVICE_CONTACT_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} The service provider.\n */\nfunction readServiceProvider(node, objectStack) {\n return pushParseAndPop({}, SERVICE_PROVIDER_PARSERS, node, objectStack);\n}\n/**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {string|undefined} The value.\n */\nfunction readValue(node, objectStack) {\n return readString(node);\n}\nexport default OWS;\n//# sourceMappingURL=OWS.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/format/WMTSCapabilities\n */\nimport { boundingExtent } from '../extent.js';\nimport OWS from './OWS.js';\nimport { readHref } from './XLink.js';\nimport XML from './XML.js';\nimport { readString, readNonNegativeInteger, readDecimal } from './xsd.js';\nimport { pushParseAndPop, makeStructureNS, makeObjectPropertySetter, makeObjectPropertyPusher, makeArrayPusher } from '../xml.js';\n/**\n * @const\n * @type {Array<null|string>}\n */\nvar NAMESPACE_URIS = [\n null,\n 'http://www.opengis.net/wmts/1.0'\n];\n/**\n * @const\n * @type {Array<null|string>}\n */\nvar OWS_NAMESPACE_URIS = [\n null,\n 'http://www.opengis.net/ows/1.1'\n];\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Contents': makeObjectPropertySetter(readContents)\n});\n/**\n * @classdesc\n * Format for reading WMTS capabilities data.\n *\n * @api\n */\nvar WMTSCapabilities = /** @class */ (function (_super) {\n __extends(WMTSCapabilities, _super);\n function WMTSCapabilities() {\n var _this = _super.call(this) || this;\n /**\n * @type {OWS}\n * @private\n */\n _this.owsParser_ = new OWS();\n return _this;\n }\n /**\n * @inheritDoc\n */\n WMTSCapabilities.prototype.readFromDocument = function (doc) {\n for (var n = doc.firstChild; n; n = n.nextSibling) {\n if (n.nodeType == Node.ELEMENT_NODE) {\n return this.readFromNode(n);\n }\n }\n return null;\n };\n /**\n * @inheritDoc\n */\n WMTSCapabilities.prototype.readFromNode = function (node) {\n var version = node.getAttribute('version').trim();\n var WMTSCapabilityObject = this.owsParser_.readFromNode(node);\n if (!WMTSCapabilityObject) {\n return null;\n }\n WMTSCapabilityObject['version'] = version;\n WMTSCapabilityObject = pushParseAndPop(WMTSCapabilityObject, PARSERS, node, []);\n return WMTSCapabilityObject ? WMTSCapabilityObject : null;\n };\n return WMTSCapabilities;\n}(XML));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar CONTENTS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Layer': makeObjectPropertyPusher(readLayer),\n 'TileMatrixSet': makeObjectPropertyPusher(readTileMatrixSet)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar LAYER_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Style': makeObjectPropertyPusher(readStyle),\n 'Format': makeObjectPropertyPusher(readString),\n 'TileMatrixSetLink': makeObjectPropertyPusher(readTileMatrixSetLink),\n 'Dimension': makeObjectPropertyPusher(readDimensions),\n 'ResourceURL': makeObjectPropertyPusher(readResourceUrl)\n}, makeStructureNS(OWS_NAMESPACE_URIS, {\n 'Title': makeObjectPropertySetter(readString),\n 'Abstract': makeObjectPropertySetter(readString),\n 'WGS84BoundingBox': makeObjectPropertySetter(readWgs84BoundingBox),\n 'Identifier': makeObjectPropertySetter(readString)\n}));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar STYLE_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'LegendURL': makeObjectPropertyPusher(readLegendUrl)\n}, makeStructureNS(OWS_NAMESPACE_URIS, {\n 'Title': makeObjectPropertySetter(readString),\n 'Identifier': makeObjectPropertySetter(readString)\n}));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TMS_LINKS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'TileMatrixSet': makeObjectPropertySetter(readString),\n 'TileMatrixSetLimits': makeObjectPropertySetter(readTileMatrixLimitsList)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TMS_LIMITS_LIST_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'TileMatrixLimits': makeArrayPusher(readTileMatrixLimits)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TMS_LIMITS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'TileMatrix': makeObjectPropertySetter(readString),\n 'MinTileRow': makeObjectPropertySetter(readNonNegativeInteger),\n 'MaxTileRow': makeObjectPropertySetter(readNonNegativeInteger),\n 'MinTileCol': makeObjectPropertySetter(readNonNegativeInteger),\n 'MaxTileCol': makeObjectPropertySetter(readNonNegativeInteger)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar DIMENSION_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'Default': makeObjectPropertySetter(readString),\n 'Value': makeObjectPropertyPusher(readString)\n}, makeStructureNS(OWS_NAMESPACE_URIS, {\n 'Identifier': makeObjectPropertySetter(readString)\n}));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar WGS84_BBOX_READERS = makeStructureNS(OWS_NAMESPACE_URIS, {\n 'LowerCorner': makeArrayPusher(readCoordinates),\n 'UpperCorner': makeArrayPusher(readCoordinates)\n});\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TMS_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'WellKnownScaleSet': makeObjectPropertySetter(readString),\n 'TileMatrix': makeObjectPropertyPusher(readTileMatrix)\n}, makeStructureNS(OWS_NAMESPACE_URIS, {\n 'SupportedCRS': makeObjectPropertySetter(readString),\n 'Identifier': makeObjectPropertySetter(readString)\n}));\n/**\n * @const\n * @type {Object<string, Object<string, import(\"../xml.js\").Parser>>}\n */\n// @ts-ignore\nvar TM_PARSERS = makeStructureNS(NAMESPACE_URIS, {\n 'TopLeftCorner': makeObjectPropertySetter(readCoordinates),\n 'ScaleDenominator': makeObjectPropertySetter(readDecimal),\n 'TileWidth': makeObjectPropertySetter(readNonNegativeInteger),\n 'TileHeight': makeObjectPropertySetter(readNonNegativeInteger),\n 'MatrixWidth': makeObjectPropertySetter(readNonNegativeInteger),\n 'MatrixHeight': makeObjectPropertySetter(readNonNegativeInteger)\n}, makeStructureNS(OWS_NAMESPACE_URIS, {\n 'Identifier': makeObjectPropertySetter(readString)\n}));\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Attribution object.\n */\nfunction readContents(node, objectStack) {\n return pushParseAndPop({}, CONTENTS_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Layers object.\n */\nfunction readLayer(node, objectStack) {\n return pushParseAndPop({}, LAYER_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Tile Matrix Set object.\n */\nfunction readTileMatrixSet(node, objectStack) {\n return pushParseAndPop({}, TMS_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Style object.\n */\nfunction readStyle(node, objectStack) {\n var style = pushParseAndPop({}, STYLE_PARSERS, node, objectStack);\n if (!style) {\n return undefined;\n }\n var isDefault = node.getAttribute('isDefault') === 'true';\n style['isDefault'] = isDefault;\n return style;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Tile Matrix Set Link object.\n */\nfunction readTileMatrixSetLink(node, objectStack) {\n return pushParseAndPop({}, TMS_LINKS_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Dimension object.\n */\nfunction readDimensions(node, objectStack) {\n return pushParseAndPop({}, DIMENSION_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Resource URL object.\n */\nfunction readResourceUrl(node, objectStack) {\n var format = node.getAttribute('format');\n var template = node.getAttribute('template');\n var resourceType = node.getAttribute('resourceType');\n var resource = {};\n if (format) {\n resource['format'] = format;\n }\n if (template) {\n resource['template'] = template;\n }\n if (resourceType) {\n resource['resourceType'] = resourceType;\n }\n return resource;\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} WGS84 BBox object.\n */\nfunction readWgs84BoundingBox(node, objectStack) {\n var coordinates = pushParseAndPop([], WGS84_BBOX_READERS, node, objectStack);\n if (coordinates.length != 2) {\n return undefined;\n }\n return boundingExtent(coordinates);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Legend object.\n */\nfunction readLegendUrl(node, objectStack) {\n var legend = {};\n legend['format'] = node.getAttribute('format');\n legend['href'] = readHref(node);\n return legend;\n}\n/**\n * @param {Node} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} Coordinates object.\n */\nfunction readCoordinates(node, objectStack) {\n var coordinates = readString(node).split(/\\s+/);\n if (!coordinates || coordinates.length != 2) {\n return undefined;\n }\n var x = +coordinates[0];\n var y = +coordinates[1];\n if (isNaN(x) || isNaN(y)) {\n return undefined;\n }\n return [x, y];\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} TileMatrix object.\n */\nfunction readTileMatrix(node, objectStack) {\n return pushParseAndPop({}, TM_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} TileMatrixSetLimits Object.\n */\nfunction readTileMatrixLimitsList(node, objectStack) {\n return pushParseAndPop([], TMS_LIMITS_LIST_PARSERS, node, objectStack);\n}\n/**\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n * @return {Object|undefined} TileMatrixLimits Array.\n */\nfunction readTileMatrixLimits(node, objectStack) {\n return pushParseAndPop({}, TMS_LIMITS_PARSERS, node, objectStack);\n}\nexport default WMTSCapabilities;\n//# sourceMappingURL=WMTSCapabilities.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/FullScreen\n */\nimport Control from './Control.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE, CLASS_UNSUPPORTED } from '../css.js';\nimport { replaceNode } from '../dom.js';\nimport { listen } from '../events.js';\nimport EventType from '../events/EventType.js';\nvar events = ['fullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'];\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-full-screen'] CSS class name.\n * @property {string|Text} [label='\\u2922'] Text label to use for the button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string|Text} [labelActive='\\u00d7'] Text label to use for the\n * button when full-screen is active.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [tipLabel='Toggle full-screen'] Text label to use for the button tip.\n * @property {boolean} [keys=false] Full keyboard access.\n * @property {HTMLElement|string} [target] Specify a target if you want the\n * control to be rendered outside of the map's viewport.\n * @property {HTMLElement|string} [source] The element to be displayed\n * fullscreen. When not provided, the element containing the map viewport will\n * be displayed fullscreen.\n */\n/**\n * @classdesc\n * Provides a button that when clicked fills up the full screen with the map.\n * The full screen source element is by default the element containing the map viewport unless\n * overridden by providing the `source` option. In which case, the dom\n * element introduced using this parameter will be displayed in full screen.\n *\n * When in full screen mode, a close button is shown to exit full screen mode.\n * The [Fullscreen API](http://www.w3.org/TR/fullscreen/) is used to\n * toggle the map in full screen mode.\n *\n * @api\n */\nvar FullScreen = /** @class */ (function (_super) {\n __extends(FullScreen, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function FullScreen(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n target: options.target\n }) || this;\n /**\n * @private\n * @type {string}\n */\n _this.cssClassName_ = options.className !== undefined ? options.className :\n 'ol-full-screen';\n var label = options.label !== undefined ? options.label : '\\u2922';\n /**\n * @private\n * @type {Text}\n */\n _this.labelNode_ = typeof label === 'string' ?\n document.createTextNode(label) : label;\n var labelActive = options.labelActive !== undefined ? options.labelActive : '\\u00d7';\n /**\n * @private\n * @type {Text}\n */\n _this.labelActiveNode_ = typeof labelActive === 'string' ?\n document.createTextNode(labelActive) : labelActive;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.button_ = document.createElement('button');\n var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';\n _this.setClassName_(_this.button_, isFullScreen());\n _this.button_.setAttribute('type', 'button');\n _this.button_.title = tipLabel;\n _this.button_.appendChild(_this.labelNode_);\n _this.button_.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n var cssClasses = _this.cssClassName_ + ' ' + CLASS_UNSELECTABLE +\n ' ' + CLASS_CONTROL + ' ' +\n (!isFullScreenSupported() ? CLASS_UNSUPPORTED : '');\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(_this.button_);\n /**\n * @private\n * @type {boolean}\n */\n _this.keys_ = options.keys !== undefined ? options.keys : false;\n /**\n * @private\n * @type {HTMLElement|string|undefined}\n */\n _this.source_ = options.source;\n return _this;\n }\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n FullScreen.prototype.handleClick_ = function (event) {\n event.preventDefault();\n this.handleFullScreen_();\n };\n /**\n * @private\n */\n FullScreen.prototype.handleFullScreen_ = function () {\n if (!isFullScreenSupported()) {\n return;\n }\n var map = this.getMap();\n if (!map) {\n return;\n }\n if (isFullScreen()) {\n exitFullScreen();\n }\n else {\n var element = void 0;\n if (this.source_) {\n element = typeof this.source_ === 'string' ?\n document.getElementById(this.source_) :\n this.source_;\n }\n else {\n element = map.getTargetElement();\n }\n if (this.keys_) {\n requestFullScreenWithKeys(element);\n }\n else {\n requestFullScreen(element);\n }\n }\n };\n /**\n * @private\n */\n FullScreen.prototype.handleFullScreenChange_ = function () {\n var map = this.getMap();\n if (isFullScreen()) {\n this.setClassName_(this.button_, true);\n replaceNode(this.labelActiveNode_, this.labelNode_);\n }\n else {\n this.setClassName_(this.button_, false);\n replaceNode(this.labelNode_, this.labelActiveNode_);\n }\n if (map) {\n map.updateSize();\n }\n };\n /**\n * @param {HTMLElement} element Target element\n * @param {boolean} fullscreen True if fullscreen class name should be active\n * @private\n */\n FullScreen.prototype.setClassName_ = function (element, fullscreen) {\n var activeClassName = this.cssClassName_ + '-true';\n var inactiveClassName = this.cssClassName_ + '-false';\n var nextClassName = fullscreen ? activeClassName : inactiveClassName;\n element.classList.remove(activeClassName);\n element.classList.remove(inactiveClassName);\n element.classList.add(nextClassName);\n };\n /**\n * @inheritDoc\n * @api\n */\n FullScreen.prototype.setMap = function (map) {\n _super.prototype.setMap.call(this, map);\n if (map) {\n for (var i = 0, ii = events.length; i < ii; ++i) {\n this.listenerKeys.push(listen(document, events[i], this.handleFullScreenChange_, this));\n }\n }\n };\n return FullScreen;\n}(Control));\n/**\n * @return {boolean} Fullscreen is supported by the current platform.\n */\nfunction isFullScreenSupported() {\n var body = document.body;\n return !!(body.webkitRequestFullscreen ||\n (body.msRequestFullscreen && document.msFullscreenEnabled) ||\n (body.requestFullscreen && document.fullscreenEnabled));\n}\n/**\n * @return {boolean} Element is currently in fullscreen.\n */\nfunction isFullScreen() {\n return !!(document.webkitIsFullScreen || document.msFullscreenElement || document.fullscreenElement);\n}\n/**\n * Request to fullscreen an element.\n * @param {HTMLElement} element Element to request fullscreen\n */\nfunction requestFullScreen(element) {\n if (element.requestFullscreen) {\n element.requestFullscreen();\n }\n else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n }\n else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n }\n}\n/**\n * Request to fullscreen an element with keyboard input.\n * @param {HTMLElement} element Element to request fullscreen\n */\nfunction requestFullScreenWithKeys(element) {\n if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n }\n else {\n requestFullScreen(element);\n }\n}\n/**\n * Exit fullscreen.\n */\nfunction exitFullScreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n }\n else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n}\nexport default FullScreen;\n//# sourceMappingURL=FullScreen.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/MousePosition\n */\nimport { listen } from '../events.js';\nimport EventType from '../pointer/EventType.js';\nimport { getChangeEventType } from '../Object.js';\nimport Control from './Control.js';\nimport { getTransformFromProjections, identityTransform, get as getProjection, getUserProjection } from '../proj.js';\nimport '@openlayers/pepjs';\n/**\n * @type {string}\n */\nvar PROJECTION = 'projection';\n/**\n * @type {string}\n */\nvar COORDINATE_FORMAT = 'coordinateFormat';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-mouse-position'] CSS class name.\n * @property {import(\"../coordinate.js\").CoordinateFormat} [coordinateFormat] Coordinate format.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when the\n * control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n * @property {HTMLElement|string} [target] Specify a target if you want the\n * control to be rendered outside of the map's viewport.\n * @property {string} [undefinedHTML=' '] Markup to show when coordinates are not\n * available (e.g. when the pointer leaves the map viewport). By default, the last position\n * will be replaced with `' '` (` `) when the pointer leaves the viewport. To\n * retain the last rendered position, set this option to something falsey (like an empty\n * string `''`).\n */\n/**\n * @classdesc\n * A control to show the 2D coordinates of the mouse cursor. By default, these\n * are in the view projection, but can be in any supported projection.\n * By default the control is shown in the top right corner of the map, but this\n * can be changed by using the css selector `.ol-mouse-position`.\n *\n * On touch devices, which usually do not have a mouse cursor, the coordinates\n * of the currently touched position are shown.\n *\n * @api\n */\nvar MousePosition = /** @class */ (function (_super) {\n __extends(MousePosition, _super);\n /**\n * @param {Options=} opt_options Mouse position options.\n */\n function MousePosition(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var element = document.createElement('div');\n element.className = options.className !== undefined ? options.className : 'ol-mouse-position';\n _this = _super.call(this, {\n element: element,\n render: options.render || render,\n target: options.target\n }) || this;\n _this.addEventListener(getChangeEventType(PROJECTION), _this.handleProjectionChanged_);\n if (options.coordinateFormat) {\n _this.setCoordinateFormat(options.coordinateFormat);\n }\n if (options.projection) {\n _this.setProjection(options.projection);\n }\n /**\n * @private\n * @type {string}\n */\n _this.undefinedHTML_ = options.undefinedHTML !== undefined ? options.undefinedHTML : ' ';\n /**\n * @private\n * @type {boolean}\n */\n _this.renderOnMouseOut_ = !!_this.undefinedHTML_;\n /**\n * @private\n * @type {string}\n */\n _this.renderedHTML_ = element.innerHTML;\n /**\n * @private\n * @type {?import(\"../proj/Projection.js\").default}\n */\n _this.mapProjection_ = null;\n /**\n * @private\n * @type {?import(\"../proj.js\").TransformFunction}\n */\n _this.transform_ = null;\n return _this;\n }\n /**\n * @private\n */\n MousePosition.prototype.handleProjectionChanged_ = function () {\n this.transform_ = null;\n };\n /**\n * Return the coordinate format type used to render the current position or\n * undefined.\n * @return {import(\"../coordinate.js\").CoordinateFormat|undefined} The format to render the current\n * position in.\n * @observable\n * @api\n */\n MousePosition.prototype.getCoordinateFormat = function () {\n return (\n /** @type {import(\"../coordinate.js\").CoordinateFormat|undefined} */ (this.get(COORDINATE_FORMAT)));\n };\n /**\n * Return the projection that is used to report the mouse position.\n * @return {import(\"../proj/Projection.js\").default|undefined} The projection to report mouse\n * position in.\n * @observable\n * @api\n */\n MousePosition.prototype.getProjection = function () {\n return (\n /** @type {import(\"../proj/Projection.js\").default|undefined} */ (this.get(PROJECTION)));\n };\n /**\n * @param {Event} event Browser event.\n * @protected\n */\n MousePosition.prototype.handleMouseMove = function (event) {\n var map = this.getMap();\n this.updateHTML_(map.getEventPixel(event));\n };\n /**\n * @param {Event} event Browser event.\n * @protected\n */\n MousePosition.prototype.handleMouseOut = function (event) {\n this.updateHTML_(null);\n };\n /**\n * @inheritDoc\n * @api\n */\n MousePosition.prototype.setMap = function (map) {\n _super.prototype.setMap.call(this, map);\n if (map) {\n var viewport = map.getViewport();\n this.listenerKeys.push(listen(viewport, EventType.POINTERMOVE, this.handleMouseMove, this));\n if (this.renderOnMouseOut_) {\n this.listenerKeys.push(listen(viewport, EventType.POINTEROUT, this.handleMouseOut, this));\n }\n }\n };\n /**\n * Set the coordinate format type used to render the current position.\n * @param {import(\"../coordinate.js\").CoordinateFormat} format The format to render the current\n * position in.\n * @observable\n * @api\n */\n MousePosition.prototype.setCoordinateFormat = function (format) {\n this.set(COORDINATE_FORMAT, format);\n };\n /**\n * Set the projection that is used to report the mouse position.\n * @param {import(\"../proj.js\").ProjectionLike} projection The projection to report mouse\n * position in.\n * @observable\n * @api\n */\n MousePosition.prototype.setProjection = function (projection) {\n this.set(PROJECTION, getProjection(projection));\n };\n /**\n * @param {?import(\"../pixel.js\").Pixel} pixel Pixel.\n * @private\n */\n MousePosition.prototype.updateHTML_ = function (pixel) {\n var html = this.undefinedHTML_;\n if (pixel && this.mapProjection_) {\n if (!this.transform_) {\n var projection = this.getProjection();\n if (projection) {\n this.transform_ = getTransformFromProjections(this.mapProjection_, projection);\n }\n else {\n this.transform_ = identityTransform;\n }\n }\n var map = this.getMap();\n var coordinate = map.getCoordinateFromPixelInternal(pixel);\n if (coordinate) {\n var userProjection = getUserProjection();\n if (userProjection) {\n this.transform_ = getTransformFromProjections(this.mapProjection_, userProjection);\n }\n this.transform_(coordinate, coordinate);\n var coordinateFormat = this.getCoordinateFormat();\n if (coordinateFormat) {\n html = coordinateFormat(coordinate);\n }\n else {\n html = coordinate.toString();\n }\n }\n }\n if (!this.renderedHTML_ || html !== this.renderedHTML_) {\n this.element.innerHTML = html;\n this.renderedHTML_ = html;\n }\n };\n return MousePosition;\n}(Control));\n/**\n * Update the projection. Rendering of the coordinates is done in\n * `handleMouseMove` and `handleMouseUp`.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @this {MousePosition}\n * @api\n */\nexport function render(mapEvent) {\n var frameState = mapEvent.frameState;\n if (!frameState) {\n this.mapProjection_ = null;\n }\n else {\n if (this.mapProjection_ != frameState.viewState.projection) {\n this.mapProjection_ = frameState.viewState.projection;\n this.transform_ = null;\n }\n }\n}\nexport default MousePosition;\n//# sourceMappingURL=MousePosition.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/OverviewMap\n */\nimport PluggableMap from '../PluggableMap.js';\nimport CompositeMapRenderer from '../renderer/Composite.js';\nimport MapEventType from '../MapEventType.js';\nimport MapProperty from '../MapProperty.js';\nimport { getChangeEventType } from '../Object.js';\nimport ObjectEventType from '../ObjectEventType.js';\nimport Overlay from '../Overlay.js';\nimport OverlayPositioning from '../OverlayPositioning.js';\nimport ViewProperty from '../ViewProperty.js';\nimport Control from './Control.js';\nimport { fromExtent as polygonFromExtent } from '../geom/Polygon.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE, CLASS_COLLAPSED } from '../css.js';\nimport { replaceNode } from '../dom.js';\nimport { listen, listenOnce } from '../events.js';\nimport EventType from '../events/EventType.js';\nimport { containsExtent, equals as equalsExtent, getBottomRight, getTopLeft, scaleFromCenter } from '../extent.js';\n/**\n * Maximum width and/or height extent ratio that determines when the overview\n * map should be zoomed out.\n * @type {number}\n */\nvar MAX_RATIO = 0.75;\n/**\n * Minimum width and/or height extent ratio that determines when the overview\n * map should be zoomed in.\n * @type {number}\n */\nvar MIN_RATIO = 0.1;\nvar ControlledMap = /** @class */ (function (_super) {\n __extends(ControlledMap, _super);\n function ControlledMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ControlledMap.prototype.createRenderer = function () {\n return new CompositeMapRenderer(this);\n };\n return ControlledMap;\n}(PluggableMap));\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-overviewmap'] CSS class name.\n * @property {boolean} [collapsed=true] Whether the control should start collapsed or not (expanded).\n * @property {string|HTMLElement} [collapseLabel='«'] Text label to use for the\n * expanded overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {boolean} [collapsible=true] Whether the control can be collapsed or not.\n * @property {string|HTMLElement} [label='»'] Text label to use for the collapsed\n * overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {Array<import(\"../layer/Layer.js\").default>|import(\"../Collection.js\").default<import(\"../layer/Layer.js\").default>} [layers]\n * Layers for the overview map.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when the control\n * should be re-rendered. This is called in a `requestAnimationFrame` callback.\n * @property {boolean} [rotateWithView=false] Whether the control view should rotate with the main map view.\n * @property {HTMLElement|string} [target] Specify a target if you want the control\n * to be rendered outside of the map's viewport.\n * @property {string} [tipLabel='Overview map'] Text label to use for the button tip.\n * @property {import(\"../View.js\").default} [view] Custom view for the overview map. If not provided,\n * a default view with an EPSG:3857 projection will be used.\n */\n/**\n * Create a new control with a map acting as an overview map for another\n * defined map.\n *\n * @api\n */\nvar OverviewMap = /** @class */ (function (_super) {\n __extends(OverviewMap, _super);\n /**\n * @param {Options=} opt_options OverviewMap options.\n */\n function OverviewMap(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render || render,\n target: options.target\n }) || this;\n /**\n * @private\n */\n _this.boundHandleRotationChanged_ = _this.handleRotationChanged_.bind(_this);\n /**\n * @type {boolean}\n * @private\n */\n _this.collapsed_ = options.collapsed !== undefined ? options.collapsed : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.collapsible_ = options.collapsible !== undefined ?\n options.collapsible : true;\n if (!_this.collapsible_) {\n _this.collapsed_ = false;\n }\n /**\n * @private\n * @type {boolean}\n */\n _this.rotateWithView_ = options.rotateWithView !== undefined ?\n options.rotateWithView : false;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent|undefined}\n */\n _this.viewExtent_ = undefined;\n var className = options.className !== undefined ? options.className : 'ol-overviewmap';\n var tipLabel = options.tipLabel !== undefined ? options.tipLabel : 'Overview map';\n var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\\u00AB';\n if (typeof collapseLabel === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.collapseLabel_ = document.createElement('span');\n _this.collapseLabel_.textContent = collapseLabel;\n }\n else {\n _this.collapseLabel_ = collapseLabel;\n }\n var label = options.label !== undefined ? options.label : '\\u00BB';\n if (typeof label === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.label_ = document.createElement('span');\n _this.label_.textContent = label;\n }\n else {\n _this.label_ = label;\n }\n var activeLabel = (_this.collapsible_ && !_this.collapsed_) ?\n _this.collapseLabel_ : _this.label_;\n var button = document.createElement('button');\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(activeLabel);\n button.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n /**\n * @type {HTMLElement}\n * @private\n */\n _this.ovmapDiv_ = document.createElement('div');\n _this.ovmapDiv_.className = 'ol-overviewmap-map';\n /**\n * @type {ControlledMap}\n * @private\n */\n _this.ovmap_ = new ControlledMap({\n view: options.view\n });\n var ovmap = _this.ovmap_;\n if (options.layers) {\n options.layers.forEach(function (layer) {\n ovmap.addLayer(layer);\n });\n }\n var box = document.createElement('div');\n box.className = 'ol-overviewmap-box';\n box.style.boxSizing = 'border-box';\n /**\n * @type {import(\"../Overlay.js\").default}\n * @private\n */\n _this.boxOverlay_ = new Overlay({\n position: [0, 0],\n positioning: OverlayPositioning.CENTER_CENTER,\n element: box\n });\n _this.ovmap_.addOverlay(_this.boxOverlay_);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL +\n (_this.collapsed_ && _this.collapsible_ ? ' ' + CLASS_COLLAPSED : '') +\n (_this.collapsible_ ? '' : ' ol-uncollapsible');\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(_this.ovmapDiv_);\n element.appendChild(button);\n /* Interactive map */\n var scope = _this;\n var overlay = _this.boxOverlay_;\n var overlayBox = _this.boxOverlay_.getElement();\n /* Functions definition */\n var computeDesiredMousePosition = function (mousePosition) {\n return {\n clientX: mousePosition.clientX,\n clientY: mousePosition.clientY\n };\n };\n var move = function (event) {\n var position = /** @type {?} */ (computeDesiredMousePosition(event));\n var coordinates = ovmap.getEventCoordinateInternal(/** @type {Event} */ (position));\n overlay.setPosition(coordinates);\n };\n var endMoving = function (event) {\n var coordinates = ovmap.getEventCoordinateInternal(event);\n scope.getMap().getView().setCenterInternal(coordinates);\n window.removeEventListener('mousemove', move);\n window.removeEventListener('mouseup', endMoving);\n };\n /* Binding */\n overlayBox.addEventListener('mousedown', function () {\n window.addEventListener('mousemove', move);\n window.addEventListener('mouseup', endMoving);\n });\n return _this;\n }\n /**\n * @inheritDoc\n * @api\n */\n OverviewMap.prototype.setMap = function (map) {\n var oldMap = this.getMap();\n if (map === oldMap) {\n return;\n }\n if (oldMap) {\n var oldView = oldMap.getView();\n if (oldView) {\n this.unbindView_(oldView);\n }\n this.ovmap_.setTarget(null);\n }\n _super.prototype.setMap.call(this, map);\n if (map) {\n this.ovmap_.setTarget(this.ovmapDiv_);\n this.listenerKeys.push(listen(map, ObjectEventType.PROPERTYCHANGE, this.handleMapPropertyChange_, this));\n var view = map.getView();\n if (view) {\n this.bindView_(view);\n if (view.isDef()) {\n this.ovmap_.updateSize();\n this.resetExtent_();\n }\n }\n }\n };\n /**\n * Handle map property changes. This only deals with changes to the map's view.\n * @param {import(\"../Object.js\").ObjectEvent} event The propertychange event.\n * @private\n */\n OverviewMap.prototype.handleMapPropertyChange_ = function (event) {\n if (event.key === MapProperty.VIEW) {\n var oldView = /** @type {import(\"../View.js\").default} */ (event.oldValue);\n if (oldView) {\n this.unbindView_(oldView);\n }\n var newView = this.getMap().getView();\n this.bindView_(newView);\n }\n };\n /**\n * Register listeners for view property changes.\n * @param {import(\"../View.js\").default} view The view.\n * @private\n */\n OverviewMap.prototype.bindView_ = function (view) {\n view.addEventListener(getChangeEventType(ViewProperty.ROTATION), this.boundHandleRotationChanged_);\n };\n /**\n * Unregister listeners for view property changes.\n * @param {import(\"../View.js\").default} view The view.\n * @private\n */\n OverviewMap.prototype.unbindView_ = function (view) {\n view.removeEventListener(getChangeEventType(ViewProperty.ROTATION), this.boundHandleRotationChanged_);\n };\n /**\n * Handle rotation changes to the main map.\n * @private\n */\n OverviewMap.prototype.handleRotationChanged_ = function () {\n if (this.rotateWithView_) {\n this.ovmap_.getView().setRotation(this.getMap().getView().getRotation());\n }\n };\n /**\n * Reset the overview map extent if the box size (width or\n * height) is less than the size of the overview map size times minRatio\n * or is greater than the size of the overview size times maxRatio.\n *\n * If the map extent was not reset, the box size can fits in the defined\n * ratio sizes. This method then checks if is contained inside the overview\n * map current extent. If not, recenter the overview map to the current\n * main map center location.\n * @private\n */\n OverviewMap.prototype.validateExtent_ = function () {\n var map = this.getMap();\n var ovmap = this.ovmap_;\n if (!map.isRendered() || !ovmap.isRendered()) {\n return;\n }\n var mapSize = /** @type {import(\"../size.js\").Size} */ (map.getSize());\n var view = map.getView();\n var extent = view.calculateExtentInternal(mapSize);\n if (this.viewExtent_ && equalsExtent(extent, this.viewExtent_)) {\n // repeats of the same extent may indicate constraint conflicts leading to an endless cycle\n return;\n }\n this.viewExtent_ = extent;\n var ovmapSize = /** @type {import(\"../size.js\").Size} */ (ovmap.getSize());\n var ovview = ovmap.getView();\n var ovextent = ovview.calculateExtentInternal(ovmapSize);\n var topLeftPixel = ovmap.getPixelFromCoordinateInternal(getTopLeft(extent));\n var bottomRightPixel = ovmap.getPixelFromCoordinateInternal(getBottomRight(extent));\n var boxWidth = Math.abs(topLeftPixel[0] - bottomRightPixel[0]);\n var boxHeight = Math.abs(topLeftPixel[1] - bottomRightPixel[1]);\n var ovmapWidth = ovmapSize[0];\n var ovmapHeight = ovmapSize[1];\n if (boxWidth < ovmapWidth * MIN_RATIO ||\n boxHeight < ovmapHeight * MIN_RATIO ||\n boxWidth > ovmapWidth * MAX_RATIO ||\n boxHeight > ovmapHeight * MAX_RATIO) {\n this.resetExtent_();\n }\n else if (!containsExtent(ovextent, extent)) {\n this.recenter_();\n }\n };\n /**\n * Reset the overview map extent to half calculated min and max ratio times\n * the extent of the main map.\n * @private\n */\n OverviewMap.prototype.resetExtent_ = function () {\n if (MAX_RATIO === 0 || MIN_RATIO === 0) {\n return;\n }\n var map = this.getMap();\n var ovmap = this.ovmap_;\n var mapSize = /** @type {import(\"../size.js\").Size} */ (map.getSize());\n var view = map.getView();\n var extent = view.calculateExtentInternal(mapSize);\n var ovview = ovmap.getView();\n // get how many times the current map overview could hold different\n // box sizes using the min and max ratio, pick the step in the middle used\n // to calculate the extent from the main map to set it to the overview map,\n var steps = Math.log(MAX_RATIO / MIN_RATIO) / Math.LN2;\n var ratio = 1 / (Math.pow(2, steps / 2) * MIN_RATIO);\n scaleFromCenter(extent, ratio);\n ovview.fitInternal(polygonFromExtent(extent));\n };\n /**\n * Set the center of the overview map to the map center without changing its\n * resolution.\n * @private\n */\n OverviewMap.prototype.recenter_ = function () {\n var map = this.getMap();\n var ovmap = this.ovmap_;\n var view = map.getView();\n var ovview = ovmap.getView();\n ovview.setCenterInternal(view.getCenterInternal());\n };\n /**\n * Update the box using the main map extent\n * @private\n */\n OverviewMap.prototype.updateBox_ = function () {\n var map = this.getMap();\n var ovmap = this.ovmap_;\n if (!map.isRendered() || !ovmap.isRendered()) {\n return;\n }\n var mapSize = /** @type {import(\"../size.js\").Size} */ (map.getSize());\n var view = map.getView();\n var ovview = ovmap.getView();\n var rotation = this.rotateWithView_ ? 0 : -view.getRotation();\n var overlay = this.boxOverlay_;\n var box = this.boxOverlay_.getElement();\n var center = view.getCenterInternal();\n var resolution = view.getResolution();\n var ovresolution = ovview.getResolution();\n var width = mapSize[0] * resolution / ovresolution;\n var height = mapSize[1] * resolution / ovresolution;\n // set position using center coordinates\n overlay.setPosition(center);\n // set box size calculated from map extent size and overview map resolution\n if (box) {\n box.style.width = width + 'px';\n box.style.height = height + 'px';\n var transform = 'rotate(' + rotation + 'rad)';\n box.style.transform = transform;\n }\n };\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n OverviewMap.prototype.handleClick_ = function (event) {\n event.preventDefault();\n this.handleToggle_();\n };\n /**\n * @private\n */\n OverviewMap.prototype.handleToggle_ = function () {\n this.element.classList.toggle(CLASS_COLLAPSED);\n if (this.collapsed_) {\n replaceNode(this.collapseLabel_, this.label_);\n }\n else {\n replaceNode(this.label_, this.collapseLabel_);\n }\n this.collapsed_ = !this.collapsed_;\n // manage overview map if it had not been rendered before and control\n // is expanded\n var ovmap = this.ovmap_;\n if (!this.collapsed_) {\n if (ovmap.isRendered()) {\n this.viewExtent_ = undefined;\n ovmap.render();\n return;\n }\n ovmap.updateSize();\n this.resetExtent_();\n listenOnce(ovmap, MapEventType.POSTRENDER, function (event) {\n this.updateBox_();\n }, this);\n }\n };\n /**\n * Return `true` if the overview map is collapsible, `false` otherwise.\n * @return {boolean} True if the widget is collapsible.\n * @api\n */\n OverviewMap.prototype.getCollapsible = function () {\n return this.collapsible_;\n };\n /**\n * Set whether the overview map should be collapsible.\n * @param {boolean} collapsible True if the widget is collapsible.\n * @api\n */\n OverviewMap.prototype.setCollapsible = function (collapsible) {\n if (this.collapsible_ === collapsible) {\n return;\n }\n this.collapsible_ = collapsible;\n this.element.classList.toggle('ol-uncollapsible');\n if (!collapsible && this.collapsed_) {\n this.handleToggle_();\n }\n };\n /**\n * Collapse or expand the overview map according to the passed parameter. Will\n * not do anything if the overview map isn't collapsible or if the current\n * collapsed state is already the one requested.\n * @param {boolean} collapsed True if the widget is collapsed.\n * @api\n */\n OverviewMap.prototype.setCollapsed = function (collapsed) {\n if (!this.collapsible_ || this.collapsed_ === collapsed) {\n return;\n }\n this.handleToggle_();\n };\n /**\n * Determine if the overview map is collapsed.\n * @return {boolean} The overview map is collapsed.\n * @api\n */\n OverviewMap.prototype.getCollapsed = function () {\n return this.collapsed_;\n };\n /**\n * Return `true` if the overview map view can rotate, `false` otherwise.\n * @return {boolean} True if the control view can rotate.\n * @api\n */\n OverviewMap.prototype.getRotateWithView = function () {\n return this.rotateWithView_;\n };\n /**\n * Set whether the overview map view should rotate with the main map view.\n * @param {boolean} rotateWithView True if the control view should rotate.\n * @api\n */\n OverviewMap.prototype.setRotateWithView = function (rotateWithView) {\n if (this.rotateWithView_ === rotateWithView) {\n return;\n }\n this.rotateWithView_ = rotateWithView;\n if (this.getMap().getView().getRotation() !== 0) {\n if (this.rotateWithView_) {\n this.handleRotationChanged_();\n }\n else {\n this.ovmap_.getView().setRotation(0);\n }\n this.viewExtent_ = undefined;\n this.validateExtent_();\n this.updateBox_();\n }\n };\n /**\n * Return the overview map.\n * @return {import(\"../PluggableMap.js\").default} Overview map.\n * @api\n */\n OverviewMap.prototype.getOverviewMap = function () {\n return this.ovmap_;\n };\n return OverviewMap;\n}(Control));\n/**\n * Update the overview map element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @this {OverviewMap}\n * @api\n */\nexport function render(mapEvent) {\n this.validateExtent_();\n this.updateBox_();\n}\nexport default OverviewMap;\n//# sourceMappingURL=OverviewMap.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/ScaleLine\n */\nimport { getChangeEventType } from '../Object.js';\nimport { assert } from '../asserts.js';\nimport Control from './Control.js';\nimport { CLASS_UNSELECTABLE } from '../css.js';\nimport { getPointResolution, METERS_PER_UNIT } from '../proj.js';\nimport ProjUnits from '../proj/Units.js';\n/**\n * @type {string}\n */\nvar UNITS_PROP = 'units';\n/**\n * Units for the scale line. Supported values are `'degrees'`, `'imperial'`,\n * `'nautical'`, `'metric'`, `'us'`.\n * @enum {string}\n */\nexport var Units = {\n DEGREES: 'degrees',\n IMPERIAL: 'imperial',\n NAUTICAL: 'nautical',\n METRIC: 'metric',\n US: 'us'\n};\n/**\n * @const\n * @type {Array<number>}\n */\nvar LEADING_DIGITS = [1, 2, 5];\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-scale-line'] CSS Class name.\n * @property {number} [minWidth=64] Minimum width in pixels.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when the control\n * should be re-rendered. This is called in a `requestAnimationFrame` callback.\n * @property {HTMLElement|string} [target] Specify a target if you want the control\n * to be rendered outside of the map's viewport.\n * @property {Units|string} [units='metric'] Units.\n * @property {boolean} [bar=false] Render scalebars instead of a line.\n * @property {number} [steps=4] Number of steps the scalebar should use. Use even numbers\n * for best results. Only applies when `bar` is `true`.\n * @property {boolean} [text=false] Render the text scale above of the scalebar. Only applies\n * when `bar` is `true`.\n */\n/**\n * @classdesc\n * A control displaying rough y-axis distances, calculated for the center of the\n * viewport. For conformal projections (e.g. EPSG:3857, the default view\n * projection in OpenLayers), the scale is valid for all directions.\n * No scale line will be shown when the y-axis distance of a pixel at the\n * viewport center cannot be calculated in the view projection.\n * By default the scale line will show in the bottom left portion of the map,\n * but this can be changed by using the css selector `.ol-scale-line`.\n * When specifying `bar` as `true`, a scalebar will be rendered instead\n * of a scaleline.\n *\n * @api\n */\nvar ScaleLine = /** @class */ (function (_super) {\n __extends(ScaleLine, _super);\n /**\n * @param {Options=} opt_options Scale line options.\n */\n function ScaleLine(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var className = options.className !== undefined ? options.className :\n options.bar ? 'ol-scale-bar' : 'ol-scale-line';\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render || render,\n target: options.target\n }) || this;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.innerElement_ = document.createElement('div');\n _this.innerElement_.className = className + '-inner';\n _this.element.className = className + ' ' + CLASS_UNSELECTABLE;\n _this.element.appendChild(_this.innerElement_);\n /**\n * @private\n * @type {?import(\"../View.js\").State}\n */\n _this.viewState_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.minWidth_ = options.minWidth !== undefined ? options.minWidth : 64;\n /**\n * @private\n * @type {boolean}\n */\n _this.renderedVisible_ = false;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.renderedWidth_ = undefined;\n /**\n * @private\n * @type {string}\n */\n _this.renderedHTML_ = '';\n _this.addEventListener(getChangeEventType(UNITS_PROP), _this.handleUnitsChanged_);\n _this.setUnits(options.units || Units.METRIC);\n /**\n * @private\n * @type {boolean}\n */\n _this.scaleBar_ = options.bar || false;\n /**\n * @private\n * @type {number}\n */\n _this.scaleBarSteps_ = options.steps || 4;\n /**\n * @private\n * @type {boolean}\n */\n _this.scaleBarText_ = options.text || false;\n return _this;\n }\n /**\n * Return the units to use in the scale line.\n * @return {Units} The units\n * to use in the scale line.\n * @observable\n * @api\n */\n ScaleLine.prototype.getUnits = function () {\n return this.get(UNITS_PROP);\n };\n /**\n * @private\n */\n ScaleLine.prototype.handleUnitsChanged_ = function () {\n this.updateElement_();\n };\n /**\n * Set the units to use in the scale line.\n * @param {Units} units The units to use in the scale line.\n * @observable\n * @api\n */\n ScaleLine.prototype.setUnits = function (units) {\n this.set(UNITS_PROP, units);\n };\n /**\n * @private\n */\n ScaleLine.prototype.updateElement_ = function () {\n var viewState = this.viewState_;\n if (!viewState) {\n if (this.renderedVisible_) {\n this.element.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n var center = viewState.center;\n var projection = viewState.projection;\n var units = this.getUnits();\n var pointResolutionUnits = units == Units.DEGREES ?\n ProjUnits.DEGREES :\n ProjUnits.METERS;\n var pointResolution = getPointResolution(projection, viewState.resolution, center, pointResolutionUnits);\n var nominalCount = this.minWidth_ * pointResolution;\n var suffix = '';\n if (units == Units.DEGREES) {\n var metersPerDegree = METERS_PER_UNIT[ProjUnits.DEGREES];\n nominalCount *= metersPerDegree;\n if (nominalCount < metersPerDegree / 60) {\n suffix = '\\u2033'; // seconds\n pointResolution *= 3600;\n }\n else if (nominalCount < metersPerDegree) {\n suffix = '\\u2032'; // minutes\n pointResolution *= 60;\n }\n else {\n suffix = '\\u00b0'; // degrees\n }\n }\n else if (units == Units.IMPERIAL) {\n if (nominalCount < 0.9144) {\n suffix = 'in';\n pointResolution /= 0.0254;\n }\n else if (nominalCount < 1609.344) {\n suffix = 'ft';\n pointResolution /= 0.3048;\n }\n else {\n suffix = 'mi';\n pointResolution /= 1609.344;\n }\n }\n else if (units == Units.NAUTICAL) {\n pointResolution /= 1852;\n suffix = 'nm';\n }\n else if (units == Units.METRIC) {\n if (nominalCount < 0.001) {\n suffix = 'μm';\n pointResolution *= 1000000;\n }\n else if (nominalCount < 1) {\n suffix = 'mm';\n pointResolution *= 1000;\n }\n else if (nominalCount < 1000) {\n suffix = 'm';\n }\n else {\n suffix = 'km';\n pointResolution /= 1000;\n }\n }\n else if (units == Units.US) {\n if (nominalCount < 0.9144) {\n suffix = 'in';\n pointResolution *= 39.37;\n }\n else if (nominalCount < 1609.344) {\n suffix = 'ft';\n pointResolution /= 0.30480061;\n }\n else {\n suffix = 'mi';\n pointResolution /= 1609.3472;\n }\n }\n else {\n assert(false, 33); // Invalid units\n }\n var i = 3 * Math.floor(Math.log(this.minWidth_ * pointResolution) / Math.log(10));\n var count, width, decimalCount;\n while (true) {\n decimalCount = Math.floor(i / 3);\n var decimal = Math.pow(10, decimalCount);\n count = LEADING_DIGITS[((i % 3) + 3) % 3] * decimal;\n width = Math.round(count / pointResolution);\n if (isNaN(width)) {\n this.element.style.display = 'none';\n this.renderedVisible_ = false;\n return;\n }\n else if (width >= this.minWidth_) {\n break;\n }\n ++i;\n }\n var html;\n if (this.scaleBar_) {\n html = this.createScaleBar(width, count, suffix);\n }\n else {\n html = count.toFixed(decimalCount < 0 ? -decimalCount : 0) + ' ' + suffix;\n }\n if (this.renderedHTML_ != html) {\n this.innerElement_.innerHTML = html;\n this.renderedHTML_ = html;\n }\n if (this.renderedWidth_ != width) {\n this.innerElement_.style.width = width + 'px';\n this.renderedWidth_ = width;\n }\n if (!this.renderedVisible_) {\n this.element.style.display = '';\n this.renderedVisible_ = true;\n }\n };\n /**\n * @private\n * @param {number} width The current width of the scalebar.\n * @param {number} scale The current scale.\n * @param {string} suffix The suffix to append to the scale text.\n * @returns {string} The stringified HTML of the scalebar.\n */\n ScaleLine.prototype.createScaleBar = function (width, scale, suffix) {\n var mapScale = '1 : ' + Math.round(this.getScaleForResolution()).toLocaleString();\n var scaleSteps = [];\n var stepWidth = width / this.scaleBarSteps_;\n var backgroundColor = '#ffffff';\n for (var i = 0; i < this.scaleBarSteps_; i++) {\n if (i === 0) {\n // create the first marker at position 0\n scaleSteps.push(this.createMarker('absolute', i));\n }\n scaleSteps.push('<div>' +\n '<div ' +\n 'class=\"ol-scale-singlebar\" ' +\n 'style=' +\n '\"width: ' + stepWidth + 'px;' +\n 'background-color: ' + backgroundColor + ';\"' +\n '>' +\n '</div>' +\n this.createMarker('relative', i) +\n /*render text every second step, except when only 2 steps */\n (i % 2 === 0 || this.scaleBarSteps_ === 2 ?\n this.createStepText(i, width, false, scale, suffix) :\n '') +\n '</div>');\n if (i === this.scaleBarSteps_ - 1) {\n { /*render text at the end */ }\n scaleSteps.push(this.createStepText(i + 1, width, true, scale, suffix));\n }\n // switch colors of steps between black and white\n if (backgroundColor === '#ffffff') {\n backgroundColor = '#000000';\n }\n else {\n backgroundColor = '#ffffff';\n }\n }\n var scaleBarText;\n if (this.scaleBarText_) {\n scaleBarText = '<div ' +\n 'class=\"ol-scale-text\" ' +\n 'style=\"width: ' + width + 'px;\">' +\n mapScale +\n '</div>';\n }\n else {\n scaleBarText = '';\n }\n var container = '<div ' +\n 'style=\"display: flex;\">' +\n scaleBarText +\n scaleSteps.join('') +\n '</div>';\n return container;\n };\n /**\n * Creates a marker at given position\n * @param {string} position - The position, absolute or relative\n * @param {number} i - The iterator\n * @returns {string} The stringified div containing the marker\n */\n ScaleLine.prototype.createMarker = function (position, i) {\n var top = position === 'absolute' ? 3 : -10;\n return '<div ' +\n 'class=\"ol-scale-step-marker\" ' +\n 'style=\"position: ' + position + ';' +\n 'top: ' + top + 'px;\"' +\n '></div>';\n };\n /**\n * Creates the label for a marker marker at given position\n * @param {number} i - The iterator\n * @param {number} width - The width the scalebar will currently use\n * @param {boolean} isLast - Flag indicating if we add the last step text\n * @param {number} scale - The current scale for the whole scalebar\n * @param {string} suffix - The suffix for the scale\n * @returns {string} The stringified div containing the step text\n */\n ScaleLine.prototype.createStepText = function (i, width, isLast, scale, suffix) {\n var length = i === 0 ? 0 : Math.round((scale / this.scaleBarSteps_ * i) * 100) / 100;\n var lengthString = length + (i === 0 ? '' : ' ' + suffix);\n var margin = i === 0 ? -3 : width / this.scaleBarSteps_ * -1;\n var minWidth = i === 0 ? 0 : width / this.scaleBarSteps_ * 2;\n return '<div ' +\n 'class=\"ol-scale-step-text\" ' +\n 'style=\"' +\n 'margin-left: ' + margin + 'px;' +\n 'text-align: ' + (i === 0 ? 'left' : 'center') + '; ' +\n 'min-width: ' + minWidth + 'px;' +\n 'left: ' + (isLast ? width + 'px' : 'unset') + ';\"' +\n '>' +\n lengthString +\n '</div>';\n };\n /**\n * Returns the appropriate scale for the given resolution and units.\n * @return {number} The appropriate scale.\n */\n ScaleLine.prototype.getScaleForResolution = function () {\n var resolution = this.getMap().getView().getResolution();\n var dpi = 25.4 / 0.28;\n var mpu = this.viewState_.projection.getMetersPerUnit();\n var inchesPerMeter = 39.37;\n return parseFloat(resolution.toString()) * mpu * inchesPerMeter * dpi;\n };\n return ScaleLine;\n}(Control));\n/**\n * Update the scale line element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @this {ScaleLine}\n * @api\n */\nexport function render(mapEvent) {\n var frameState = mapEvent.frameState;\n if (!frameState) {\n this.viewState_ = null;\n }\n else {\n this.viewState_ = frameState.viewState;\n }\n this.updateElement_();\n}\nexport default ScaleLine;\n//# sourceMappingURL=ScaleLine.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/ZoomSlider\n */\nimport Control from './Control.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE } from '../css.js';\nimport { easeOut } from '../easing.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport { stopPropagation } from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport { clamp } from '../math.js';\nimport PointerEventType from '../pointer/EventType.js';\nimport '@openlayers/pepjs';\n/**\n * The enum for available directions.\n *\n * @enum {number}\n */\nvar Direction = {\n VERTICAL: 0,\n HORIZONTAL: 1\n};\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-zoomslider'] CSS class name.\n * @property {number} [duration=200] Animation duration in milliseconds.\n * @property {function(import(\"../MapEvent.js\").default)} [render] Function called when the control\n * should be re-rendered. This is called in a `requestAnimationFrame` callback.\n */\n/**\n * @classdesc\n * A slider type of control for zooming.\n *\n * Example:\n *\n * map.addControl(new ZoomSlider());\n *\n * @api\n */\nvar ZoomSlider = /** @class */ (function (_super) {\n __extends(ZoomSlider, _super);\n /**\n * @param {Options=} opt_options Zoom slider options.\n */\n function ZoomSlider(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render || render\n }) || this;\n /**\n * @type {!Array.<import(\"../events.js\").EventsKey>}\n * @private\n */\n _this.dragListenerKeys_ = [];\n /**\n * Will hold the current resolution of the view.\n *\n * @type {number|undefined}\n * @private\n */\n _this.currentResolution_ = undefined;\n /**\n * The direction of the slider. Will be determined from actual display of the\n * container and defaults to Direction.VERTICAL.\n *\n * @type {Direction}\n * @private\n */\n _this.direction_ = Direction.VERTICAL;\n /**\n * @type {boolean}\n * @private\n */\n _this.dragging_;\n /**\n * @type {number}\n * @private\n */\n _this.heightLimit_ = 0;\n /**\n * @type {number}\n * @private\n */\n _this.widthLimit_ = 0;\n /**\n * @type {number|undefined}\n * @private\n */\n _this.startX_;\n /**\n * @type {number|undefined}\n * @private\n */\n _this.startY_;\n /**\n * The calculated thumb size (border box plus margins). Set when initSlider_\n * is called.\n * @type {import(\"../size.js\").Size}\n * @private\n */\n _this.thumbSize_ = null;\n /**\n * Whether the slider is initialized.\n * @type {boolean}\n * @private\n */\n _this.sliderInitialized_ = false;\n /**\n * @type {number}\n * @private\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 200;\n var className = options.className !== undefined ? options.className : 'ol-zoomslider';\n var thumbElement = document.createElement('button');\n thumbElement.setAttribute('type', 'button');\n thumbElement.className = className + '-thumb ' + CLASS_UNSELECTABLE;\n var containerElement = _this.element;\n containerElement.setAttribute('touch-action', 'none');\n containerElement.className = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n containerElement.appendChild(thumbElement);\n containerElement.addEventListener(PointerEventType.POINTERDOWN, _this.handleDraggerStart_.bind(_this), false);\n containerElement.addEventListener(PointerEventType.POINTERMOVE, _this.handleDraggerDrag_.bind(_this), false);\n containerElement.addEventListener(PointerEventType.POINTERUP, _this.handleDraggerEnd_.bind(_this), false);\n containerElement.addEventListener(EventType.CLICK, _this.handleContainerClick_.bind(_this), false);\n thumbElement.addEventListener(EventType.CLICK, stopPropagation, false);\n return _this;\n }\n /**\n * @inheritDoc\n */\n ZoomSlider.prototype.setMap = function (map) {\n _super.prototype.setMap.call(this, map);\n if (map) {\n map.render();\n }\n };\n /**\n * Initializes the slider element. This will determine and set this controls\n * direction_ and also constrain the dragging of the thumb to always be within\n * the bounds of the container.\n *\n * @private\n */\n ZoomSlider.prototype.initSlider_ = function () {\n var container = this.element;\n var containerSize = {\n width: container.offsetWidth, height: container.offsetHeight\n };\n var thumb = /** @type {HTMLElement} */ (container.firstElementChild);\n var computedStyle = getComputedStyle(thumb);\n var thumbWidth = thumb.offsetWidth +\n parseFloat(computedStyle['marginRight']) +\n parseFloat(computedStyle['marginLeft']);\n var thumbHeight = thumb.offsetHeight +\n parseFloat(computedStyle['marginTop']) +\n parseFloat(computedStyle['marginBottom']);\n this.thumbSize_ = [thumbWidth, thumbHeight];\n if (containerSize.width > containerSize.height) {\n this.direction_ = Direction.HORIZONTAL;\n this.widthLimit_ = containerSize.width - thumbWidth;\n }\n else {\n this.direction_ = Direction.VERTICAL;\n this.heightLimit_ = containerSize.height - thumbHeight;\n }\n this.sliderInitialized_ = true;\n };\n /**\n * @param {PointerEvent} event The browser event to handle.\n * @private\n */\n ZoomSlider.prototype.handleContainerClick_ = function (event) {\n var view = this.getMap().getView();\n var relativePosition = this.getRelativePosition_(event.offsetX - this.thumbSize_[0] / 2, event.offsetY - this.thumbSize_[1] / 2);\n var resolution = this.getResolutionForPosition_(relativePosition);\n var zoom = view.getConstrainedZoom(view.getZoomForResolution(resolution));\n view.animateInternal({\n zoom: zoom,\n duration: this.duration_,\n easing: easeOut\n });\n };\n /**\n * Handle dragger start events.\n * @param {PointerEvent} event The drag event.\n * @private\n */\n ZoomSlider.prototype.handleDraggerStart_ = function (event) {\n if (!this.dragging_ && event.target === this.element.firstElementChild) {\n var element = /** @type {HTMLElement} */ (this.element.firstElementChild);\n this.getMap().getView().beginInteraction();\n this.startX_ = event.clientX - parseFloat(element.style.left);\n this.startY_ = event.clientY - parseFloat(element.style.top);\n this.dragging_ = true;\n if (this.dragListenerKeys_.length === 0) {\n var drag = this.handleDraggerDrag_;\n var end = this.handleDraggerEnd_;\n this.dragListenerKeys_.push(listen(document, PointerEventType.POINTERMOVE, drag, this), listen(document, PointerEventType.POINTERUP, end, this));\n }\n }\n };\n /**\n * Handle dragger drag events.\n *\n * @param {PointerEvent} event The drag event.\n * @private\n */\n ZoomSlider.prototype.handleDraggerDrag_ = function (event) {\n if (this.dragging_) {\n var deltaX = event.clientX - this.startX_;\n var deltaY = event.clientY - this.startY_;\n var relativePosition = this.getRelativePosition_(deltaX, deltaY);\n this.currentResolution_ = this.getResolutionForPosition_(relativePosition);\n this.getMap().getView().setResolution(this.currentResolution_);\n }\n };\n /**\n * Handle dragger end events.\n * @param {PointerEvent} event The drag event.\n * @private\n */\n ZoomSlider.prototype.handleDraggerEnd_ = function (event) {\n if (this.dragging_) {\n var view = this.getMap().getView();\n view.endInteraction();\n this.dragging_ = false;\n this.startX_ = undefined;\n this.startY_ = undefined;\n this.dragListenerKeys_.forEach(unlistenByKey);\n this.dragListenerKeys_.length = 0;\n }\n };\n /**\n * Positions the thumb inside its container according to the given resolution.\n *\n * @param {number} res The res.\n * @private\n */\n ZoomSlider.prototype.setThumbPosition_ = function (res) {\n var position = this.getPositionForResolution_(res);\n var thumb = /** @type {HTMLElement} */ (this.element.firstElementChild);\n if (this.direction_ == Direction.HORIZONTAL) {\n thumb.style.left = this.widthLimit_ * position + 'px';\n }\n else {\n thumb.style.top = this.heightLimit_ * position + 'px';\n }\n };\n /**\n * Calculates the relative position of the thumb given x and y offsets. The\n * relative position scales from 0 to 1. The x and y offsets are assumed to be\n * in pixel units within the dragger limits.\n *\n * @param {number} x Pixel position relative to the left of the slider.\n * @param {number} y Pixel position relative to the top of the slider.\n * @return {number} The relative position of the thumb.\n * @private\n */\n ZoomSlider.prototype.getRelativePosition_ = function (x, y) {\n var amount;\n if (this.direction_ === Direction.HORIZONTAL) {\n amount = x / this.widthLimit_;\n }\n else {\n amount = y / this.heightLimit_;\n }\n return clamp(amount, 0, 1);\n };\n /**\n * Calculates the corresponding resolution of the thumb given its relative\n * position (where 0 is the minimum and 1 is the maximum).\n *\n * @param {number} position The relative position of the thumb.\n * @return {number} The corresponding resolution.\n * @private\n */\n ZoomSlider.prototype.getResolutionForPosition_ = function (position) {\n var fn = this.getMap().getView().getResolutionForValueFunction();\n return fn(1 - position);\n };\n /**\n * Determines the relative position of the slider for the given resolution. A\n * relative position of 0 corresponds to the minimum view resolution. A\n * relative position of 1 corresponds to the maximum view resolution.\n *\n * @param {number} res The resolution.\n * @return {number} The relative position value (between 0 and 1).\n * @private\n */\n ZoomSlider.prototype.getPositionForResolution_ = function (res) {\n var fn = this.getMap().getView().getValueForResolutionFunction();\n return clamp(1 - fn(res), 0, 1);\n };\n return ZoomSlider;\n}(Control));\n/**\n * Update the zoomslider element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @this {ZoomSlider}\n * @api\n */\nexport function render(mapEvent) {\n if (!mapEvent.frameState) {\n return;\n }\n if (!this.sliderInitialized_) {\n this.initSlider_();\n }\n var res = mapEvent.frameState.viewState.resolution;\n this.currentResolution_ = res;\n this.setThumbPosition_(res);\n}\nexport default ZoomSlider;\n//# sourceMappingURL=ZoomSlider.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/ZoomToExtent\n */\nimport EventType from '../events/EventType.js';\nimport { fromExtent as polygonFromExtent } from '../geom/Polygon.js';\nimport Control from './Control.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE } from '../css.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-zoom-extent'] Class name.\n * @property {HTMLElement|string} [target] Specify a target if you want the control\n * to be rendered outside of the map's viewport.\n * @property {string|HTMLElement} [label='E'] Text label to use for the button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.\n * @property {import(\"../extent.js\").Extent} [extent] The extent to zoom to. If undefined the validity\n * extent of the view projection is used.\n */\n/**\n * @classdesc\n * A button control which, when pressed, changes the map view to a specific\n * extent. To style this control use the css selector `.ol-zoom-extent`.\n *\n * @api\n */\nvar ZoomToExtent = /** @class */ (function (_super) {\n __extends(ZoomToExtent, _super);\n /**\n * @param {Options=} opt_options Options.\n */\n function ZoomToExtent(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n target: options.target\n }) || this;\n /**\n * @type {?import(\"../extent.js\").Extent}\n * @protected\n */\n _this.extent = options.extent ? options.extent : null;\n var className = options.className !== undefined ? options.className : 'ol-zoom-extent';\n var label = options.label !== undefined ? options.label : 'E';\n var tipLabel = options.tipLabel !== undefined ? options.tipLabel : 'Fit to extent';\n var button = document.createElement('button');\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(typeof label === 'string' ? document.createTextNode(label) : label);\n button.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(button);\n return _this;\n }\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n ZoomToExtent.prototype.handleClick_ = function (event) {\n event.preventDefault();\n this.handleZoomToExtent();\n };\n /**\n * @protected\n */\n ZoomToExtent.prototype.handleZoomToExtent = function () {\n var map = this.getMap();\n var view = map.getView();\n var extent = !this.extent ? view.getProjection().getExtent() : this.extent;\n view.fitInternal(polygonFromExtent(extent));\n };\n return ZoomToExtent;\n}(Control));\nexport default ZoomToExtent;\n//# sourceMappingURL=ZoomToExtent.js.map","import $ol$Collection from './ol/Collection';\nimport $ol$Feature from './ol/Feature';\nimport $ol$Geolocation from './ol/Geolocation';\nimport $ol$Kinetic from './ol/Kinetic';\nimport $ol$Map from './ol/Map';\nimport $ol$Object from './ol/Object';\nimport $ol$Observable from './ol/Observable';\nimport {unByKey as _ol_Observable$unByKey} from './ol/Observable';\nimport $ol$Overlay from './ol/Overlay';\nimport $ol$PluggableMap from './ol/PluggableMap';\nimport $ol$View from './ol/View';\nimport {stableSort as _ol_array$stableSort} from './ol/array';\nimport {asString as _ol_color$asString} from './ol/color';\nimport {asArray as _ol_color$asArray} from './ol/color';\nimport {asColorLike as _ol_colorlike$asColorLike} from './ol/colorlike';\nimport {defaults as _ol_control$defaults} from './ol/control';\nimport {add as _ol_coordinate$add} from './ol/coordinate';\nimport {createStringXY as _ol_coordinate$createStringXY} from './ol/coordinate';\nimport {format as _ol_coordinate$format} from './ol/coordinate';\nimport {rotate as _ol_coordinate$rotate} from './ol/coordinate';\nimport {toStringHDMS as _ol_coordinate$toStringHDMS} from './ol/coordinate';\nimport {toStringXY as _ol_coordinate$toStringXY} from './ol/coordinate';\nimport {easeIn as _ol_easing$easeIn} from './ol/easing';\nimport {easeOut as _ol_easing$easeOut} from './ol/easing';\nimport {inAndOut as _ol_easing$inAndOut} from './ol/easing';\nimport {linear as _ol_easing$linear} from './ol/easing';\nimport {upAndDown as _ol_easing$upAndDown} from './ol/easing';\nimport {boundingExtent as _ol_extent$boundingExtent} from './ol/extent';\nimport {buffer as _ol_extent$buffer} from './ol/extent';\nimport {containsCoordinate as _ol_extent$containsCoordinate} from './ol/extent';\nimport {containsExtent as _ol_extent$containsExtent} from './ol/extent';\nimport {containsXY as _ol_extent$containsXY} from './ol/extent';\nimport {createEmpty as _ol_extent$createEmpty} from './ol/extent';\nimport {equals as _ol_extent$equals} from './ol/extent';\nimport {extend as _ol_extent$extend} from './ol/extent';\nimport {getArea as _ol_extent$getArea} from './ol/extent';\nimport {getBottomLeft as _ol_extent$getBottomLeft} from './ol/extent';\nimport {getBottomRight as _ol_extent$getBottomRight} from './ol/extent';\nimport {getCenter as _ol_extent$getCenter} from './ol/extent';\nimport {getHeight as _ol_extent$getHeight} from './ol/extent';\nimport {getIntersection as _ol_extent$getIntersection} from './ol/extent';\nimport {getSize as _ol_extent$getSize} from './ol/extent';\nimport {getTopLeft as _ol_extent$getTopLeft} from './ol/extent';\nimport {getTopRight as _ol_extent$getTopRight} from './ol/extent';\nimport {getWidth as _ol_extent$getWidth} from './ol/extent';\nimport {intersects as _ol_extent$intersects} from './ol/extent';\nimport {isEmpty as _ol_extent$isEmpty} from './ol/extent';\nimport {applyTransform as _ol_extent$applyTransform} from './ol/extent';\nimport {xhr as _ol_featureloader$xhr} from './ol/featureloader';\nimport {setWithCredentials as _ol_featureloader$setWithCredentials} from './ol/featureloader';\nimport {DEVICE_PIXEL_RATIO as _ol_has$DEVICE_PIXEL_RATIO} from './ol/has';\nimport {defaults as _ol_interaction$defaults} from './ol/interaction';\nimport {all as _ol_loadingstrategy$all} from './ol/loadingstrategy';\nimport {bbox as _ol_loadingstrategy$bbox} from './ol/loadingstrategy';\nimport {tile as _ol_loadingstrategy$tile} from './ol/loadingstrategy';\nimport {addProjection as _ol_proj$addProjection} from './ol/proj';\nimport {get as _ol_proj$get} from './ol/proj';\nimport {getPointResolution as _ol_proj$getPointResolution} from './ol/proj';\nimport {addEquivalentProjections as _ol_proj$addEquivalentProjections} from './ol/proj';\nimport {addCoordinateTransforms as _ol_proj$addCoordinateTransforms} from './ol/proj';\nimport {fromLonLat as _ol_proj$fromLonLat} from './ol/proj';\nimport {toLonLat as _ol_proj$toLonLat} from './ol/proj';\nimport {equivalent as _ol_proj$equivalent} from './ol/proj';\nimport {getTransform as _ol_proj$getTransform} from './ol/proj';\nimport {transform as _ol_proj$transform} from './ol/proj';\nimport {transformExtent as _ol_proj$transformExtent} from './ol/proj';\nimport {toContext as _ol_render$toContext} from './ol/render';\nimport {getVectorContext as _ol_render$getVectorContext} from './ol/render';\nimport {getRenderPixel as _ol_render$getRenderPixel} from './ol/render';\nimport {toSize as _ol_size$toSize} from './ol/size';\nimport {getDistance as _ol_sphere$getDistance} from './ol/sphere';\nimport {getLength as _ol_sphere$getLength} from './ol/sphere';\nimport {getArea as _ol_sphere$getArea} from './ol/sphere';\nimport {createXYZ as _ol_tilegrid$createXYZ} from './ol/tilegrid';\nimport {getUid as _ol_util$getUid} from './ol/util';\nimport {ARRAY_BUFFER as _ol_webgl$ARRAY_BUFFER} from './ol/webgl';\nimport {ELEMENT_ARRAY_BUFFER as _ol_webgl$ELEMENT_ARRAY_BUFFER} from './ol/webgl';\nimport {STREAM_DRAW as _ol_webgl$STREAM_DRAW} from './ol/webgl';\nimport {STATIC_DRAW as _ol_webgl$STATIC_DRAW} from './ol/webgl';\nimport {DYNAMIC_DRAW as _ol_webgl$DYNAMIC_DRAW} from './ol/webgl';\nimport {getAllTextContent as _ol_xml$getAllTextContent} from './ol/xml';\nimport {parse as _ol_xml$parse} from './ol/xml';\nimport $ol$webgl$Buffer from './ol/webgl/Buffer';\nimport $ol$webgl$Helper from './ol/webgl/Helper';\nimport {computeAttributesStride as _ol_webgl_Helper$computeAttributesStride} from './ol/webgl/Helper';\nimport $ol$webgl$PostProcessingPass from './ol/webgl/PostProcessingPass';\nimport $ol$webgl$RenderTarget from './ol/webgl/RenderTarget';\nimport $ol$tilegrid$TileGrid from './ol/tilegrid/TileGrid';\nimport $ol$tilegrid$WMTS from './ol/tilegrid/WMTS';\nimport {createFromCapabilitiesMatrixSet as _ol_tilegrid_WMTS$createFromCapabilitiesMatrixSet} from './ol/tilegrid/WMTS';\nimport $ol$style$Circle from './ol/style/Circle';\nimport $ol$style$Fill from './ol/style/Fill';\nimport $ol$style$Icon from './ol/style/Icon';\nimport {shared as _ol_style_IconImageCache$shared} from './ol/style/IconImageCache';\nimport $ol$style$Image from './ol/style/Image';\nimport $ol$style$RegularShape from './ol/style/RegularShape';\nimport $ol$style$Stroke from './ol/style/Stroke';\nimport $ol$style$Style from './ol/style/Style';\nimport $ol$style$Text from './ol/style/Text';\nimport $ol$source$BingMaps from './ol/source/BingMaps';\nimport $ol$source$CartoDB from './ol/source/CartoDB';\nimport $ol$source$Cluster from './ol/source/Cluster';\nimport $ol$source$IIIF from './ol/source/IIIF';\nimport $ol$source$Image from './ol/source/Image';\nimport $ol$source$ImageArcGISRest from './ol/source/ImageArcGISRest';\nimport $ol$source$ImageCanvas from './ol/source/ImageCanvas';\nimport $ol$source$ImageMapGuide from './ol/source/ImageMapGuide';\nimport $ol$source$ImageStatic from './ol/source/ImageStatic';\nimport $ol$source$ImageWMS from './ol/source/ImageWMS';\nimport {ATTRIBUTION as _ol_source_OSM$ATTRIBUTION} from './ol/source/OSM';\nimport $ol$source$OSM from './ol/source/OSM';\nimport $ol$source$Raster from './ol/source/Raster';\nimport $ol$source$Source from './ol/source/Source';\nimport $ol$source$Stamen from './ol/source/Stamen';\nimport $ol$source$Tile from './ol/source/Tile';\nimport $ol$source$TileArcGISRest from './ol/source/TileArcGISRest';\nimport $ol$source$TileDebug from './ol/source/TileDebug';\nimport $ol$source$TileImage from './ol/source/TileImage';\nimport $ol$source$TileJSON from './ol/source/TileJSON';\nimport $ol$source$TileWMS from './ol/source/TileWMS';\nimport $ol$source$UTFGrid from './ol/source/UTFGrid';\nimport $ol$source$Vector from './ol/source/Vector';\nimport $ol$source$VectorTile from './ol/source/VectorTile';\nimport $ol$source$WMTS from './ol/source/WMTS';\nimport {optionsFromCapabilities as _ol_source_WMTS$optionsFromCapabilities} from './ol/source/WMTS';\nimport $ol$source$XYZ from './ol/source/XYZ';\nimport $ol$source$Zoomify from './ol/source/Zoomify';\nimport $ol$renderer$Composite from './ol/renderer/Composite';\nimport $ol$renderer$webgl$PointsLayer from './ol/renderer/webgl/PointsLayer';\nimport $ol$renderer$canvas$ImageLayer from './ol/renderer/canvas/ImageLayer';\nimport $ol$renderer$canvas$TileLayer from './ol/renderer/canvas/TileLayer';\nimport $ol$renderer$canvas$VectorImageLayer from './ol/renderer/canvas/VectorImageLayer';\nimport $ol$renderer$canvas$VectorLayer from './ol/renderer/canvas/VectorLayer';\nimport $ol$renderer$canvas$VectorTileLayer from './ol/renderer/canvas/VectorTileLayer';\nimport $ol$render$VectorContext from './ol/render/VectorContext';\nimport {labelCache as _ol_render_canvas$labelCache} from './ol/render/canvas';\nimport $ol$proj$Projection from './ol/proj/Projection';\nimport {METERS_PER_UNIT as _ol_proj_Units$METERS_PER_UNIT} from './ol/proj/Units';\nimport {register as _ol_proj_proj4$register} from './ol/proj/proj4';\nimport $ol$layer$Base from './ol/layer/Base';\nimport $ol$layer$BaseImage from './ol/layer/BaseImage';\nimport $ol$layer$BaseTile from './ol/layer/BaseTile';\nimport $ol$layer$BaseVector from './ol/layer/BaseVector';\nimport $ol$layer$Graticule from './ol/layer/Graticule';\nimport $ol$layer$Group from './ol/layer/Group';\nimport $ol$layer$Heatmap from './ol/layer/Heatmap';\nimport $ol$layer$Image from './ol/layer/Image';\nimport $ol$layer$Layer from './ol/layer/Layer';\nimport $ol$layer$Tile from './ol/layer/Tile';\nimport $ol$layer$Vector from './ol/layer/Vector';\nimport $ol$layer$VectorImage from './ol/layer/VectorImage';\nimport $ol$layer$VectorTile from './ol/layer/VectorTile';\nimport $ol$interaction$DoubleClickZoom from './ol/interaction/DoubleClickZoom';\nimport $ol$interaction$DragAndDrop from './ol/interaction/DragAndDrop';\nimport $ol$interaction$DragBox from './ol/interaction/DragBox';\nimport $ol$interaction$DragPan from './ol/interaction/DragPan';\nimport $ol$interaction$DragRotate from './ol/interaction/DragRotate';\nimport $ol$interaction$DragRotateAndZoom from './ol/interaction/DragRotateAndZoom';\nimport $ol$interaction$DragZoom from './ol/interaction/DragZoom';\nimport $ol$interaction$Draw from './ol/interaction/Draw';\nimport {createRegularPolygon as _ol_interaction_Draw$createRegularPolygon} from './ol/interaction/Draw';\nimport {createBox as _ol_interaction_Draw$createBox} from './ol/interaction/Draw';\nimport $ol$interaction$Extent from './ol/interaction/Extent';\nimport $ol$interaction$Interaction from './ol/interaction/Interaction';\nimport $ol$interaction$KeyboardPan from './ol/interaction/KeyboardPan';\nimport $ol$interaction$KeyboardZoom from './ol/interaction/KeyboardZoom';\nimport $ol$interaction$Modify from './ol/interaction/Modify';\nimport $ol$interaction$MouseWheelZoom from './ol/interaction/MouseWheelZoom';\nimport $ol$interaction$PinchRotate from './ol/interaction/PinchRotate';\nimport $ol$interaction$PinchZoom from './ol/interaction/PinchZoom';\nimport $ol$interaction$Pointer from './ol/interaction/Pointer';\nimport $ol$interaction$Select from './ol/interaction/Select';\nimport $ol$interaction$Snap from './ol/interaction/Snap';\nimport $ol$interaction$Translate from './ol/interaction/Translate';\nimport $ol$geom$Circle from './ol/geom/Circle';\nimport $ol$geom$Geometry from './ol/geom/Geometry';\nimport $ol$geom$GeometryCollection from './ol/geom/GeometryCollection';\nimport $ol$geom$LineString from './ol/geom/LineString';\nimport $ol$geom$LinearRing from './ol/geom/LinearRing';\nimport $ol$geom$MultiLineString from './ol/geom/MultiLineString';\nimport $ol$geom$MultiPoint from './ol/geom/MultiPoint';\nimport $ol$geom$MultiPolygon from './ol/geom/MultiPolygon';\nimport $ol$geom$Point from './ol/geom/Point';\nimport $ol$geom$Polygon from './ol/geom/Polygon';\nimport {circular as _ol_geom_Polygon$circular} from './ol/geom/Polygon';\nimport {fromExtent as _ol_geom_Polygon$fromExtent} from './ol/geom/Polygon';\nimport {fromCircle as _ol_geom_Polygon$fromCircle} from './ol/geom/Polygon';\nimport $ol$geom$SimpleGeometry from './ol/geom/SimpleGeometry';\nimport $ol$format$EsriJSON from './ol/format/EsriJSON';\nimport $ol$format$Feature from './ol/format/Feature';\nimport $ol$format$GML from './ol/format/GML';\nimport $ol$format$GML2 from './ol/format/GML2';\nimport $ol$format$GML3 from './ol/format/GML3';\nimport $ol$format$GML32 from './ol/format/GML32';\nimport $ol$format$GPX from './ol/format/GPX';\nimport $ol$format$GeoJSON from './ol/format/GeoJSON';\nimport $ol$format$IGC from './ol/format/IGC';\nimport $ol$format$IIIFInfo from './ol/format/IIIFInfo';\nimport $ol$format$KML from './ol/format/KML';\nimport $ol$format$MVT from './ol/format/MVT';\nimport $ol$format$OSMXML from './ol/format/OSMXML';\nimport $ol$format$Polyline from './ol/format/Polyline';\nimport {encodeDeltas as _ol_format_Polyline$encodeDeltas} from './ol/format/Polyline';\nimport {decodeDeltas as _ol_format_Polyline$decodeDeltas} from './ol/format/Polyline';\nimport {encodeFloats as _ol_format_Polyline$encodeFloats} from './ol/format/Polyline';\nimport {decodeFloats as _ol_format_Polyline$decodeFloats} from './ol/format/Polyline';\nimport $ol$format$TopoJSON from './ol/format/TopoJSON';\nimport $ol$format$WFS from './ol/format/WFS';\nimport {writeFilter as _ol_format_WFS$writeFilter} from './ol/format/WFS';\nimport $ol$format$WKT from './ol/format/WKT';\nimport $ol$format$WMSCapabilities from './ol/format/WMSCapabilities';\nimport $ol$format$WMSGetFeatureInfo from './ol/format/WMSGetFeatureInfo';\nimport $ol$format$WMTSCapabilities from './ol/format/WMTSCapabilities';\nimport {and as _ol_format_filter$and} from './ol/format/filter';\nimport {or as _ol_format_filter$or} from './ol/format/filter';\nimport {not as _ol_format_filter$not} from './ol/format/filter';\nimport {bbox as _ol_format_filter$bbox} from './ol/format/filter';\nimport {contains as _ol_format_filter$contains} from './ol/format/filter';\nimport {intersects as _ol_format_filter$intersects} from './ol/format/filter';\nimport {within as _ol_format_filter$within} from './ol/format/filter';\nimport {equalTo as _ol_format_filter$equalTo} from './ol/format/filter';\nimport {notEqualTo as _ol_format_filter$notEqualTo} from './ol/format/filter';\nimport {lessThan as _ol_format_filter$lessThan} from './ol/format/filter';\nimport {lessThanOrEqualTo as _ol_format_filter$lessThanOrEqualTo} from './ol/format/filter';\nimport {greaterThan as _ol_format_filter$greaterThan} from './ol/format/filter';\nimport {greaterThanOrEqualTo as _ol_format_filter$greaterThanOrEqualTo} from './ol/format/filter';\nimport {isNull as _ol_format_filter$isNull} from './ol/format/filter';\nimport {between as _ol_format_filter$between} from './ol/format/filter';\nimport {like as _ol_format_filter$like} from './ol/format/filter';\nimport {during as _ol_format_filter$during} from './ol/format/filter';\nimport $ol$format$filter$Bbox from './ol/format/filter/Bbox';\nimport $ol$format$filter$Contains from './ol/format/filter/Contains';\nimport $ol$format$filter$During from './ol/format/filter/During';\nimport $ol$format$filter$EqualTo from './ol/format/filter/EqualTo';\nimport $ol$format$filter$GreaterThan from './ol/format/filter/GreaterThan';\nimport $ol$format$filter$GreaterThanOrEqualTo from './ol/format/filter/GreaterThanOrEqualTo';\nimport $ol$format$filter$Intersects from './ol/format/filter/Intersects';\nimport $ol$format$filter$IsBetween from './ol/format/filter/IsBetween';\nimport $ol$format$filter$IsLike from './ol/format/filter/IsLike';\nimport $ol$format$filter$IsNull from './ol/format/filter/IsNull';\nimport $ol$format$filter$LessThan from './ol/format/filter/LessThan';\nimport $ol$format$filter$LessThanOrEqualTo from './ol/format/filter/LessThanOrEqualTo';\nimport $ol$format$filter$Not from './ol/format/filter/Not';\nimport $ol$format$filter$NotEqualTo from './ol/format/filter/NotEqualTo';\nimport $ol$format$filter$Or from './ol/format/filter/Or';\nimport $ol$format$filter$Within from './ol/format/filter/Within';\nimport {altKeyOnly as _ol_events_condition$altKeyOnly} from './ol/events/condition';\nimport {altShiftKeysOnly as _ol_events_condition$altShiftKeysOnly} from './ol/events/condition';\nimport {focus as _ol_events_condition$focus} from './ol/events/condition';\nimport {always as _ol_events_condition$always} from './ol/events/condition';\nimport {click as _ol_events_condition$click} from './ol/events/condition';\nimport {never as _ol_events_condition$never} from './ol/events/condition';\nimport {pointerMove as _ol_events_condition$pointerMove} from './ol/events/condition';\nimport {singleClick as _ol_events_condition$singleClick} from './ol/events/condition';\nimport {doubleClick as _ol_events_condition$doubleClick} from './ol/events/condition';\nimport {noModifierKeys as _ol_events_condition$noModifierKeys} from './ol/events/condition';\nimport {platformModifierKeyOnly as _ol_events_condition$platformModifierKeyOnly} from './ol/events/condition';\nimport {shiftKeyOnly as _ol_events_condition$shiftKeyOnly} from './ol/events/condition';\nimport {targetNotEditable as _ol_events_condition$targetNotEditable} from './ol/events/condition';\nimport {mouseOnly as _ol_events_condition$mouseOnly} from './ol/events/condition';\nimport {touchOnly as _ol_events_condition$touchOnly} from './ol/events/condition';\nimport {penOnly as _ol_events_condition$penOnly} from './ol/events/condition';\nimport {primaryAction as _ol_events_condition$primaryAction} from './ol/events/condition';\nimport $ol$control$Attribution from './ol/control/Attribution';\nimport {render as _ol_control_Attribution$render} from './ol/control/Attribution';\nimport $ol$control$Control from './ol/control/Control';\nimport $ol$control$FullScreen from './ol/control/FullScreen';\nimport $ol$control$MousePosition from './ol/control/MousePosition';\nimport {render as _ol_control_MousePosition$render} from './ol/control/MousePosition';\nimport $ol$control$OverviewMap from './ol/control/OverviewMap';\nimport {render as _ol_control_OverviewMap$render} from './ol/control/OverviewMap';\nimport $ol$control$Rotate from './ol/control/Rotate';\nimport {render as _ol_control_Rotate$render} from './ol/control/Rotate';\nimport $ol$control$ScaleLine from './ol/control/ScaleLine';\nimport {render as _ol_control_ScaleLine$render} from './ol/control/ScaleLine';\nimport $ol$control$Zoom from './ol/control/Zoom';\nimport $ol$control$ZoomSlider from './ol/control/ZoomSlider';\nimport {render as _ol_control_ZoomSlider$render} from './ol/control/ZoomSlider';\nimport $ol$control$ZoomToExtent from './ol/control/ZoomToExtent';\n\nvar ol = {};\n\nol.array = {};\nol.color = {};\nol.colorlike = {};\nol.control = {};\nol.coordinate = {};\nol.easing = {};\nol.events = {};\nol.events.condition = {};\nol.extent = {};\nol.featureloader = {};\nol.format = {};\nol.format.filter = {};\nol.geom = {};\nol.has = {};\nol.interaction = {};\nol.layer = {};\nol.loadingstrategy = {};\nol.proj = {};\nol.proj.Units = {};\nol.proj.proj4 = {};\nol.render = {};\nol.render.canvas = {};\nol.renderer = {};\nol.renderer.canvas = {};\nol.renderer.webgl = {};\nol.size = {};\nol.source = {};\nol.sphere = {};\nol.style = {};\nol.style.IconImageCache = {};\nol.tilegrid = {};\nol.util = {};\nol.webgl = {};\nol.xml = {};\nol.Collection = $ol$Collection;\nol.Feature = $ol$Feature;\nol.Geolocation = $ol$Geolocation;\nol.Kinetic = $ol$Kinetic;\nol.Map = $ol$Map;\nol.Object = $ol$Object;\nol.Observable = $ol$Observable;\nol.Observable.unByKey = _ol_Observable$unByKey;\nol.Overlay = $ol$Overlay;\nol.PluggableMap = $ol$PluggableMap;\nol.View = $ol$View;\nol.array.stableSort = _ol_array$stableSort;\nol.color.asArray = _ol_color$asArray;\nol.color.asString = _ol_color$asString;\nol.colorlike.asColorLike = _ol_colorlike$asColorLike;\nol.control.Attribution = $ol$control$Attribution;\nol.control.Attribution.render = _ol_control_Attribution$render;\nol.control.Control = $ol$control$Control;\nol.control.FullScreen = $ol$control$FullScreen;\nol.control.MousePosition = $ol$control$MousePosition;\nol.control.MousePosition.render = _ol_control_MousePosition$render;\nol.control.OverviewMap = $ol$control$OverviewMap;\nol.control.OverviewMap.render = _ol_control_OverviewMap$render;\nol.control.Rotate = $ol$control$Rotate;\nol.control.Rotate.render = _ol_control_Rotate$render;\nol.control.ScaleLine = $ol$control$ScaleLine;\nol.control.ScaleLine.render = _ol_control_ScaleLine$render;\nol.control.Zoom = $ol$control$Zoom;\nol.control.ZoomSlider = $ol$control$ZoomSlider;\nol.control.ZoomSlider.render = _ol_control_ZoomSlider$render;\nol.control.ZoomToExtent = $ol$control$ZoomToExtent;\nol.control.defaults = _ol_control$defaults;\nol.coordinate.add = _ol_coordinate$add;\nol.coordinate.createStringXY = _ol_coordinate$createStringXY;\nol.coordinate.format = _ol_coordinate$format;\nol.coordinate.rotate = _ol_coordinate$rotate;\nol.coordinate.toStringHDMS = _ol_coordinate$toStringHDMS;\nol.coordinate.toStringXY = _ol_coordinate$toStringXY;\nol.easing.easeIn = _ol_easing$easeIn;\nol.easing.easeOut = _ol_easing$easeOut;\nol.easing.inAndOut = _ol_easing$inAndOut;\nol.easing.linear = _ol_easing$linear;\nol.easing.upAndDown = _ol_easing$upAndDown;\nol.events.condition.altKeyOnly = _ol_events_condition$altKeyOnly;\nol.events.condition.altShiftKeysOnly = _ol_events_condition$altShiftKeysOnly;\nol.events.condition.always = _ol_events_condition$always;\nol.events.condition.click = _ol_events_condition$click;\nol.events.condition.doubleClick = _ol_events_condition$doubleClick;\nol.events.condition.focus = _ol_events_condition$focus;\nol.events.condition.mouseOnly = _ol_events_condition$mouseOnly;\nol.events.condition.never = _ol_events_condition$never;\nol.events.condition.noModifierKeys = _ol_events_condition$noModifierKeys;\nol.events.condition.penOnly = _ol_events_condition$penOnly;\nol.events.condition.platformModifierKeyOnly = _ol_events_condition$platformModifierKeyOnly;\nol.events.condition.pointerMove = _ol_events_condition$pointerMove;\nol.events.condition.primaryAction = _ol_events_condition$primaryAction;\nol.events.condition.shiftKeyOnly = _ol_events_condition$shiftKeyOnly;\nol.events.condition.singleClick = _ol_events_condition$singleClick;\nol.events.condition.targetNotEditable = _ol_events_condition$targetNotEditable;\nol.events.condition.touchOnly = _ol_events_condition$touchOnly;\nol.extent.applyTransform = _ol_extent$applyTransform;\nol.extent.boundingExtent = _ol_extent$boundingExtent;\nol.extent.buffer = _ol_extent$buffer;\nol.extent.containsCoordinate = _ol_extent$containsCoordinate;\nol.extent.containsExtent = _ol_extent$containsExtent;\nol.extent.containsXY = _ol_extent$containsXY;\nol.extent.createEmpty = _ol_extent$createEmpty;\nol.extent.equals = _ol_extent$equals;\nol.extent.extend = _ol_extent$extend;\nol.extent.getArea = _ol_extent$getArea;\nol.extent.getBottomLeft = _ol_extent$getBottomLeft;\nol.extent.getBottomRight = _ol_extent$getBottomRight;\nol.extent.getCenter = _ol_extent$getCenter;\nol.extent.getHeight = _ol_extent$getHeight;\nol.extent.getIntersection = _ol_extent$getIntersection;\nol.extent.getSize = _ol_extent$getSize;\nol.extent.getTopLeft = _ol_extent$getTopLeft;\nol.extent.getTopRight = _ol_extent$getTopRight;\nol.extent.getWidth = _ol_extent$getWidth;\nol.extent.intersects = _ol_extent$intersects;\nol.extent.isEmpty = _ol_extent$isEmpty;\nol.featureloader.setWithCredentials = _ol_featureloader$setWithCredentials;\nol.featureloader.xhr = _ol_featureloader$xhr;\nol.format.EsriJSON = $ol$format$EsriJSON;\nol.format.Feature = $ol$format$Feature;\nol.format.GML = $ol$format$GML;\nol.format.GML2 = $ol$format$GML2;\nol.format.GML3 = $ol$format$GML3;\nol.format.GML32 = $ol$format$GML32;\nol.format.GPX = $ol$format$GPX;\nol.format.GeoJSON = $ol$format$GeoJSON;\nol.format.IGC = $ol$format$IGC;\nol.format.IIIFInfo = $ol$format$IIIFInfo;\nol.format.KML = $ol$format$KML;\nol.format.MVT = $ol$format$MVT;\nol.format.OSMXML = $ol$format$OSMXML;\nol.format.Polyline = $ol$format$Polyline;\nol.format.Polyline.decodeDeltas = _ol_format_Polyline$decodeDeltas;\nol.format.Polyline.decodeFloats = _ol_format_Polyline$decodeFloats;\nol.format.Polyline.encodeDeltas = _ol_format_Polyline$encodeDeltas;\nol.format.Polyline.encodeFloats = _ol_format_Polyline$encodeFloats;\nol.format.TopoJSON = $ol$format$TopoJSON;\nol.format.WFS = $ol$format$WFS;\nol.format.WFS.writeFilter = _ol_format_WFS$writeFilter;\nol.format.WKT = $ol$format$WKT;\nol.format.WMSCapabilities = $ol$format$WMSCapabilities;\nol.format.WMSGetFeatureInfo = $ol$format$WMSGetFeatureInfo;\nol.format.WMTSCapabilities = $ol$format$WMTSCapabilities;\nol.format.filter.Bbox = $ol$format$filter$Bbox;\nol.format.filter.Contains = $ol$format$filter$Contains;\nol.format.filter.During = $ol$format$filter$During;\nol.format.filter.EqualTo = $ol$format$filter$EqualTo;\nol.format.filter.GreaterThan = $ol$format$filter$GreaterThan;\nol.format.filter.GreaterThanOrEqualTo = $ol$format$filter$GreaterThanOrEqualTo;\nol.format.filter.Intersects = $ol$format$filter$Intersects;\nol.format.filter.IsBetween = $ol$format$filter$IsBetween;\nol.format.filter.IsLike = $ol$format$filter$IsLike;\nol.format.filter.IsNull = $ol$format$filter$IsNull;\nol.format.filter.LessThan = $ol$format$filter$LessThan;\nol.format.filter.LessThanOrEqualTo = $ol$format$filter$LessThanOrEqualTo;\nol.format.filter.Not = $ol$format$filter$Not;\nol.format.filter.NotEqualTo = $ol$format$filter$NotEqualTo;\nol.format.filter.Or = $ol$format$filter$Or;\nol.format.filter.Within = $ol$format$filter$Within;\nol.format.filter.and = _ol_format_filter$and;\nol.format.filter.bbox = _ol_format_filter$bbox;\nol.format.filter.between = _ol_format_filter$between;\nol.format.filter.contains = _ol_format_filter$contains;\nol.format.filter.during = _ol_format_filter$during;\nol.format.filter.equalTo = _ol_format_filter$equalTo;\nol.format.filter.greaterThan = _ol_format_filter$greaterThan;\nol.format.filter.greaterThanOrEqualTo = _ol_format_filter$greaterThanOrEqualTo;\nol.format.filter.intersects = _ol_format_filter$intersects;\nol.format.filter.isNull = _ol_format_filter$isNull;\nol.format.filter.lessThan = _ol_format_filter$lessThan;\nol.format.filter.lessThanOrEqualTo = _ol_format_filter$lessThanOrEqualTo;\nol.format.filter.like = _ol_format_filter$like;\nol.format.filter.not = _ol_format_filter$not;\nol.format.filter.notEqualTo = _ol_format_filter$notEqualTo;\nol.format.filter.or = _ol_format_filter$or;\nol.format.filter.within = _ol_format_filter$within;\nol.geom.Circle = $ol$geom$Circle;\nol.geom.Geometry = $ol$geom$Geometry;\nol.geom.GeometryCollection = $ol$geom$GeometryCollection;\nol.geom.LineString = $ol$geom$LineString;\nol.geom.LinearRing = $ol$geom$LinearRing;\nol.geom.MultiLineString = $ol$geom$MultiLineString;\nol.geom.MultiPoint = $ol$geom$MultiPoint;\nol.geom.MultiPolygon = $ol$geom$MultiPolygon;\nol.geom.Point = $ol$geom$Point;\nol.geom.Polygon = $ol$geom$Polygon;\nol.geom.Polygon.circular = _ol_geom_Polygon$circular;\nol.geom.Polygon.fromCircle = _ol_geom_Polygon$fromCircle;\nol.geom.Polygon.fromExtent = _ol_geom_Polygon$fromExtent;\nol.geom.SimpleGeometry = $ol$geom$SimpleGeometry;\nol.has.DEVICE_PIXEL_RATIO = _ol_has$DEVICE_PIXEL_RATIO;\nol.interaction.DoubleClickZoom = $ol$interaction$DoubleClickZoom;\nol.interaction.DragAndDrop = $ol$interaction$DragAndDrop;\nol.interaction.DragBox = $ol$interaction$DragBox;\nol.interaction.DragPan = $ol$interaction$DragPan;\nol.interaction.DragRotate = $ol$interaction$DragRotate;\nol.interaction.DragRotateAndZoom = $ol$interaction$DragRotateAndZoom;\nol.interaction.DragZoom = $ol$interaction$DragZoom;\nol.interaction.Draw = $ol$interaction$Draw;\nol.interaction.Draw.createBox = _ol_interaction_Draw$createBox;\nol.interaction.Draw.createRegularPolygon = _ol_interaction_Draw$createRegularPolygon;\nol.interaction.Extent = $ol$interaction$Extent;\nol.interaction.Interaction = $ol$interaction$Interaction;\nol.interaction.KeyboardPan = $ol$interaction$KeyboardPan;\nol.interaction.KeyboardZoom = $ol$interaction$KeyboardZoom;\nol.interaction.Modify = $ol$interaction$Modify;\nol.interaction.MouseWheelZoom = $ol$interaction$MouseWheelZoom;\nol.interaction.PinchRotate = $ol$interaction$PinchRotate;\nol.interaction.PinchZoom = $ol$interaction$PinchZoom;\nol.interaction.Pointer = $ol$interaction$Pointer;\nol.interaction.Select = $ol$interaction$Select;\nol.interaction.Snap = $ol$interaction$Snap;\nol.interaction.Translate = $ol$interaction$Translate;\nol.interaction.defaults = _ol_interaction$defaults;\nol.layer.Base = $ol$layer$Base;\nol.layer.BaseImage = $ol$layer$BaseImage;\nol.layer.BaseTile = $ol$layer$BaseTile;\nol.layer.BaseVector = $ol$layer$BaseVector;\nol.layer.Graticule = $ol$layer$Graticule;\nol.layer.Group = $ol$layer$Group;\nol.layer.Heatmap = $ol$layer$Heatmap;\nol.layer.Image = $ol$layer$Image;\nol.layer.Layer = $ol$layer$Layer;\nol.layer.Tile = $ol$layer$Tile;\nol.layer.Vector = $ol$layer$Vector;\nol.layer.VectorImage = $ol$layer$VectorImage;\nol.layer.VectorTile = $ol$layer$VectorTile;\nol.loadingstrategy.all = _ol_loadingstrategy$all;\nol.loadingstrategy.bbox = _ol_loadingstrategy$bbox;\nol.loadingstrategy.tile = _ol_loadingstrategy$tile;\nol.proj.Projection = $ol$proj$Projection;\nol.proj.Units.METERS_PER_UNIT = _ol_proj_Units$METERS_PER_UNIT;\nol.proj.addCoordinateTransforms = _ol_proj$addCoordinateTransforms;\nol.proj.addEquivalentProjections = _ol_proj$addEquivalentProjections;\nol.proj.addProjection = _ol_proj$addProjection;\nol.proj.equivalent = _ol_proj$equivalent;\nol.proj.fromLonLat = _ol_proj$fromLonLat;\nol.proj.get = _ol_proj$get;\nol.proj.getPointResolution = _ol_proj$getPointResolution;\nol.proj.getTransform = _ol_proj$getTransform;\nol.proj.proj4.register = _ol_proj_proj4$register;\nol.proj.toLonLat = _ol_proj$toLonLat;\nol.proj.transform = _ol_proj$transform;\nol.proj.transformExtent = _ol_proj$transformExtent;\nol.render.VectorContext = $ol$render$VectorContext;\nol.render.canvas.labelCache = _ol_render_canvas$labelCache;\nol.render.getRenderPixel = _ol_render$getRenderPixel;\nol.render.getVectorContext = _ol_render$getVectorContext;\nol.render.toContext = _ol_render$toContext;\nol.renderer.Composite = $ol$renderer$Composite;\nol.renderer.canvas.ImageLayer = $ol$renderer$canvas$ImageLayer;\nol.renderer.canvas.TileLayer = $ol$renderer$canvas$TileLayer;\nol.renderer.canvas.VectorImageLayer = $ol$renderer$canvas$VectorImageLayer;\nol.renderer.canvas.VectorLayer = $ol$renderer$canvas$VectorLayer;\nol.renderer.canvas.VectorTileLayer = $ol$renderer$canvas$VectorTileLayer;\nol.renderer.webgl.PointsLayer = $ol$renderer$webgl$PointsLayer;\nol.size.toSize = _ol_size$toSize;\nol.source.BingMaps = $ol$source$BingMaps;\nol.source.CartoDB = $ol$source$CartoDB;\nol.source.Cluster = $ol$source$Cluster;\nol.source.IIIF = $ol$source$IIIF;\nol.source.Image = $ol$source$Image;\nol.source.ImageArcGISRest = $ol$source$ImageArcGISRest;\nol.source.ImageCanvas = $ol$source$ImageCanvas;\nol.source.ImageMapGuide = $ol$source$ImageMapGuide;\nol.source.ImageStatic = $ol$source$ImageStatic;\nol.source.ImageWMS = $ol$source$ImageWMS;\nol.source.OSM = $ol$source$OSM;\nol.source.OSM.ATTRIBUTION = _ol_source_OSM$ATTRIBUTION;\nol.source.Raster = $ol$source$Raster;\nol.source.Source = $ol$source$Source;\nol.source.Stamen = $ol$source$Stamen;\nol.source.Tile = $ol$source$Tile;\nol.source.TileArcGISRest = $ol$source$TileArcGISRest;\nol.source.TileDebug = $ol$source$TileDebug;\nol.source.TileImage = $ol$source$TileImage;\nol.source.TileJSON = $ol$source$TileJSON;\nol.source.TileWMS = $ol$source$TileWMS;\nol.source.UTFGrid = $ol$source$UTFGrid;\nol.source.Vector = $ol$source$Vector;\nol.source.VectorTile = $ol$source$VectorTile;\nol.source.WMTS = $ol$source$WMTS;\nol.source.WMTS.optionsFromCapabilities = _ol_source_WMTS$optionsFromCapabilities;\nol.source.XYZ = $ol$source$XYZ;\nol.source.Zoomify = $ol$source$Zoomify;\nol.sphere.getArea = _ol_sphere$getArea;\nol.sphere.getDistance = _ol_sphere$getDistance;\nol.sphere.getLength = _ol_sphere$getLength;\nol.style.Circle = $ol$style$Circle;\nol.style.Fill = $ol$style$Fill;\nol.style.Icon = $ol$style$Icon;\nol.style.IconImageCache.shared = _ol_style_IconImageCache$shared;\nol.style.Image = $ol$style$Image;\nol.style.RegularShape = $ol$style$RegularShape;\nol.style.Stroke = $ol$style$Stroke;\nol.style.Style = $ol$style$Style;\nol.style.Text = $ol$style$Text;\nol.tilegrid.TileGrid = $ol$tilegrid$TileGrid;\nol.tilegrid.WMTS = $ol$tilegrid$WMTS;\nol.tilegrid.WMTS.createFromCapabilitiesMatrixSet = _ol_tilegrid_WMTS$createFromCapabilitiesMatrixSet;\nol.tilegrid.createXYZ = _ol_tilegrid$createXYZ;\nol.util.getUid = _ol_util$getUid;\nol.webgl.ARRAY_BUFFER = _ol_webgl$ARRAY_BUFFER;\nol.webgl.Buffer = $ol$webgl$Buffer;\nol.webgl.DYNAMIC_DRAW = _ol_webgl$DYNAMIC_DRAW;\nol.webgl.ELEMENT_ARRAY_BUFFER = _ol_webgl$ELEMENT_ARRAY_BUFFER;\nol.webgl.Helper = $ol$webgl$Helper;\nol.webgl.Helper.computeAttributesStride = _ol_webgl_Helper$computeAttributesStride;\nol.webgl.PostProcessingPass = $ol$webgl$PostProcessingPass;\nol.webgl.RenderTarget = $ol$webgl$RenderTarget;\nol.webgl.STATIC_DRAW = _ol_webgl$STATIC_DRAW;\nol.webgl.STREAM_DRAW = _ol_webgl$STREAM_DRAW;\nol.xml.getAllTextContent = _ol_xml$getAllTextContent;\nol.xml.parse = _ol_xml$parse;\n\nexport default ol;","/**\n * @module ol/proj/proj4\n */\nimport { addCoordinateTransforms, addProjection, addEquivalentProjections, get } from '../proj.js';\nimport { get as getTransform } from './transforms.js';\nimport Projection from './Projection.js';\n/**\n * Make projections defined in proj4 (with `proj4.defs()`) available in\n * OpenLayers.\n *\n * This function should be called whenever changes are made to the proj4\n * registry, e.g. after calling `proj4.defs()`. Existing transforms will not be\n * modified by this function.\n *\n * @param {?} proj4 Proj4.\n * @api\n */\nexport function register(proj4) {\n var projCodes = Object.keys(proj4.defs);\n var len = projCodes.length;\n var i, j;\n for (i = 0; i < len; ++i) {\n var code = projCodes[i];\n if (!get(code)) {\n var def = proj4.defs(code);\n addProjection(new Projection({\n code: code,\n axisOrientation: def.axis,\n metersPerUnit: def.to_meter,\n units: def.units\n }));\n }\n }\n for (i = 0; i < len; ++i) {\n var code1 = projCodes[i];\n var proj1 = get(code1);\n for (j = 0; j < len; ++j) {\n var code2 = projCodes[j];\n var proj2 = get(code2);\n if (!getTransform(code1, code2)) {\n if (proj4.defs[code1] === proj4.defs[code2]) {\n addEquivalentProjections([proj1, proj2]);\n }\n else {\n var transform = proj4(code1, code2);\n addCoordinateTransforms(proj1, proj2, transform.forward, transform.inverse);\n }\n }\n }\n }\n}\n//# sourceMappingURL=proj4.js.map"],"sourceRoot":""} |