lostplaces-backend/django_lostplaces/lostplaces/static/maps/ol.js.map

1 line
3.6 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack://ol/webpack/universalModuleDefinition","webpack://ol/webpack/bootstrap","webpack://ol/./node_modules/rbush/rbush.js","webpack://ol/./node_modules/elm-pep/dist/elm-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/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/tilegrid/common.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/control/Control.js","webpack://ol/./build/ol/css.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/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/structs/LRUCache.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/WMSServerType.js","webpack://ol/./build/ol/source/ImageWMS.js","webpack://ol/./build/ol/source/common.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","quickselect","arr","k","left","right","compare","quickselectStep","z","Math","log","exp","sd","sqrt","newLeft","max","floor","newRight","min","j","swap","length","defaultCompare","tmp","a","b","RBush","maxEntries","this","_maxEntries","_minEntries","ceil","clear","findItem","item","items","equalsFn","indexOf","calcBBox","node","toBBox","distBBox","children","destNode","createNode","minX","Infinity","minY","maxX","maxY","child","extend","leaf","compareNodeMinX","compareNodeMinY","bboxArea","bboxMargin","contains","intersects","height","multiSelect","stack","pop","mid","push","all","_all","data","search","bbox","result","nodesToSearch","childBBox","collides","load","insert","_build","slice","_splitRoot","tmpNode","_insert","remove","parent","goingUp","path","indexes","index","splice","_condense","compareMinX","compareMinY","toJSON","fromJSON","apply","N","M","pow","N2","N1","right2","right3","_chooseSubtree","level","minArea","minEnlargement","targetNode","area","enlargement","isNode","insertPath","_split","_adjustParentBBoxes","_chooseSplitAxis","splitIndex","_chooseSplitIndex","newNode","minOverlap","bbox1","bbox2","overlap","_allDistMargin","sort","leftBBox","rightBBox","margin","i$1","child$1","siblings","primaryTouchId","mouseCaptureTarget","addMouseToPointerListener","target","mouseType","pointerType","addEventListener","mouseEvent","pointerEvent","MouseEvent","pointerId","isPrimary","width","tiltX","tiltY","buttons","pressure","dispatchEvent","defaultPrevented","preventDefault","addTouchToPointerListener","touchType","touchEvent","changedTouches","nbTouches","CustomEvent","bubbles","cancelable","ctrlKey","shiftKey","altKey","metaKey","touch","clientX","clientY","screenX","screenY","pageX","pageY","rect","getBoundingClientRect","offsetX","offsetY","top","identifier","button","movementX","movementY","region","relatedTarget","x","y","Element","setPointerCapture","setCapture","releasePointerCapture","releaseCapture","document","Pbf","ieee754","buf","ArrayBuffer","isView","Uint8Array","pos","type","Varint","Fixed64","Bytes","Fixed32","utf8TextDecoder","TextDecoder","readPackedEnd","pbf","readVarint","toNum","low","high","isSigned","makeRoomForExtraLength","startPos","len","extraLen","LN2","realloc","writePackedVarint","writeVarint","writePackedSVarint","writeSVarint","writePackedFloat","writeFloat","writePackedDouble","writeDouble","writePackedBoolean","writeBoolean","writePackedFixed32","writeFixed32","writePackedSFixed32","writeSFixed32","writePackedFixed64","writeFixed64","writePackedSFixed64","writeSFixed64","readUInt32","writeInt32","val","readInt32","destroy","readFields","readField","end","tag","skip","readMessage","readFixed32","readSFixed32","readFixed64","readSFixed64","readFloat","read","readDouble","h","Error","readVarintRemainder","readVarint64","readSVarint","num","readBoolean","Boolean","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","set","finish","writeBigVarintLow","lsb","writeBigVarintHigh","writeBigVarint","writeString","lead","charCodeAt","writeUtf8","write","writeBytes","writeRawMessage","fn","obj","writeMessage","writeBytesField","writeFixed32Field","writeSFixed32Field","writeFixed64Field","writeSFixed64Field","writeVarintField","writeSVarintField","writeStringField","writeFloatField","writeDoubleField","writeBooleanField","Processor","offset","isLE","mLen","nBytes","e","eLen","eMax","eBias","nBits","NaN","rt","abs","isNaN","newImageData","createMinion","operation","workerHasImageData","ImageData","_","newWorkerImageData","output","buffers","meta","imageOps","numBuffers","numBytes","byteLength","images","Array","Uint8ClampedArray","arrays","pixels","array","pixel","createWorker","config","onMessage","lines","keys","lib","map","toString","concat","blob","Blob","source","URL","createObjectURL","worker","Worker","threads","_imageOps","workers","_onWorkerMessage","minion","postMessage","setTimeout","createFauxWorker","_workers","_queue","_maxQueueLength","queue","_running","_dataLookup","_job","process","inputs","callback","_enqueue","_dispatch","_destroyed","job","shift","input","segmentLength","slices","jj","event","_resolveJob","hasImageData","context","createElement","getContext","imageData","createImageData","uidCounter_","getUid","ol_uid","extendStatics","__extends","setPrototypeOf","__proto__","__","constructor","_super","AssertionError","code","_this","message","split","assign","var_sources","TypeError","ii","arguments","getValues","values","isEmpty","listen","listener","opt_this","opt_once","originalListener_1","removeEventListener","eventsKey","listenOnce","unlistenByKey","Disposable","disposed_","dispose","disposeInternal","numberSafeCompareFunction","includes","linearFindNearest","direction","reverseSubArray","begin","extension","isArray","find","func","equals","arr1","arr2","len1","findIndex","every","el","idx","TRUE","FALSE","VOID","stopPropagation","evt","BaseEvent","propagationStopped","Target","opt_target","eventTarget_","pendingRemovals_","dispatching_","listeners_","listeners","Event","propagate","handleEvent","pendingRemovals","getListeners","hasListener","opt_type","Observable","revision_","changed","EventType","getRevision","on","once","un","ObjectEvent","oldValue","BaseObject","opt_values","values_","undefined","setProperties","getKeys","getProperties","notify","eventType","getChangeEventType","ObjectEventType","opt_silent","unset","changeEventTypeCache","Property","CollectionEvent","opt_element","opt_index","element","Collection","opt_array","opt_options","options","unique_","unique","array_","assertUnique_","updateLength_","getLength","forEach","f","getArray","insertAt","elem","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","id","boundingExtent","coordinates","extent","createEmpty","extendCoordinate","opt_extent","closestSquaredDistanceXY","dx","dy","containsCoordinate","coordinate","containsXY","containsExtent","extent1","extent2","coordinateRelationship","relationship","Relationship","createOrUpdate","createOrUpdateEmpty","createOrUpdateFromCoordinate","createOrUpdateFromFlatCoordinates","flatCoordinates","stride","extendFlatCoordinates","extendCoordinates","extendXY","forEachCorner","getBottomLeft","getBottomRight","getTopRight","getTopLeft","getArea","getWidth","getHeight","getCenter","getCorner","corner","Corner","getForViewAndSize","center","resolution","rotation","size","cosRotation","cos","sinRotation","sin","xCos","xSin","yCos","ySin","x0","x1","x2","x3","y0","y1","y2","y3","getIntersection","intersection","scaleFromCenter","deltaX","deltaY","applyTransform","transformFn","opt_stops","xs","ys","_boundingExtentXYs","projection","projectionExtent","getExtent","canWrapX","worldWidth","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","PI","toRadians","angleInDegrees","modulo","lerp","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","getCode","getUnits","getMetersPerUnit","getWorldExtent","getAxisOrientation","isGlobal","setGlobal","getDefaultTileGrid","setDefaultTileGrid","tileGrid","setExtent","setWorldExtent","setGetPointResolution","getPointResolutionFunc","HALF_SIZE","EXTENT","WORLD_EXTENT","EPSG3857Projection","units","point","PROJECTIONS","fromEPSG4326","opt_output","opt_dimension","dimension","halfSize","tan","toEPSG4326","atan","EPSG4326Projection","opt_axisOrientation","destination","sourceCode","destinationCode","cloneTransform","identityTransform","addProjection","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","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","ret","point1","point2","intersectsLineString","coordinatesExtent","start","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","GeolocationError","error","Geolocation","position_","transform_","watchId_","handleProjectionChanged_","handleTrackingChanged_","setProjection","trackingOptions","setTrackingOptions","setTracking","tracking","getProjection","navigator","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","WORKER_OFFSCREEN_CANVAS","WorkerGlobalScope","OffscreenCanvas","self","IMAGE_DECODE","Image","PASSIVE_EVENT_LISTENERS","passive","SINGLECLICK","CLICK","DBLCLICK","POINTERDRAG","POINTERMOVE","POINTERDOWN","POINTERUP","POINTEROVER","POINTEROUT","POINTERENTER","POINTERLEAVE","POINTERCANCEL","MapBrowserPointerEvent","MapBrowserEventHandler","moveTolerance","map_","clickTimeoutId_","dragging_","dragListenerKeys_","moveTolerance_","down_","getViewport","activePointers_","trackedTouches_","element_","pointerdownListenerKey_","handlePointerDown_","originalPointerMoveEvent_","relayedListenerKey_","relayEvent_","boundHandleTouchMove_","handleTouchMove_","emulateClick_","newEvent","MapBrowserEventType","clearTimeout","updateActivePointers_","handlePointerUp_","isMouseActionButton_","handlePointerMove_","isMoving_","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","createExtent","onlyCenter","smooth","opt_isMoving","viewWidth","viewHeight","ratio","none","getViewportClampedResolution","maxExtent","viewportSize","showFullExtent","xResolution","yResolution","getSmoothClampedResolution","maxResolution","minResolution","createMinMaxResolution","opt_smooth","opt_maxExtent","opt_showFullExtent","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","worldsAway","easeIn","easeOut","inAndOut","linear","animationCallback","returnValue","isNoopAnimation","animation","sourceCenter","targetCenter","sourceResolution","targetResolution","sourceRotation","targetRotation","View","hints_","animations_","updateAnimationKey_","projection_","viewportSize_","targetCenter_","targetResolution_","targetRotation_","cancelAnchor_","applyOptions_","resolutionConstraintInfo","resolutionConstraint","minZoom","maxZoom","zoomFactor","multiWorld","smoothResolutionConstraint","projExtent","constrainOnlyCenter","resolutions","constrainResolution","capped","createSnapToResolutions","defaultMaxResolution","defaultMinResolution","defaultMaxZoom","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","options_","getUpdatedOptions_","newOptions","getResolution","getZoom","getCenterInternal","getRotation","animate","var_args","isDef","getAnimating","resolveConstraints","args","animateInternal","animationCount","series","complete","easing","getResolutionForZoom","setHint","ViewHint","updateAnimations_","getInteracting","cancelAnimations","cancelAnimationFrame","more","seriesComplete","elapsed","fraction","progress","getViewportSize_","constrainedResolution","calculateCenterZoom","applyTargetState_","constrainedRotation","calculateCenterRotate","filter","requestAnimationFrame","currentCenter","currentResolution","opt_rotation","w","setViewportSize","opt_size","ViewProperty","getConstraints","getConstrainResolution","getHints","opt_hints","calculateExtent","calculateExtentInternal","getMaxResolution","getMinResolution","getMaxZoom","getZoomForResolution","setMaxZoom","getMinZoom","setMinZoom","setConstrainResolution","enabled","getResolutions","getResolutionForExtent","getResolutionForExtentInternal","getResolutionForValueFunction","opt_power","getConstrainedResolution","getValueForResolutionFunction","logPower","nearest","baseLevel","fit","geometryOrExtent","userProjection","fitInternal","padding","minRotX","minRotY","maxRotX","maxRotY","rotX","rotY","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","opt_canvasPool","canvas","offsetWidth","getComputedStyle","marginLeft","marginRight","offsetHeight","marginTop","marginBottom","replaceNode","oldNode","parentNode","replaceChild","removeNode","removeChild","removeChildren","lastChild","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","LayerGroup","baseOptions","layers","layersListenerKeys_","listenerKeys_","handleLayersChanged_","setLayers","handleLayerChange_","getLayers","handleLayersAdd_","handleLayersRemove_","layersArray","collectionEvent","states","ownLayerState","layerState","toSize","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_","appendChild","overlayContainerStopEvent_","mapBrowserEventHandler_","handleMapBrowserEvent","keyboardEventTarget_","keyHandlerKeys_","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","eventPosition","getTarget","getTargetElement","getView","pixelToCoordinateTransform","getOverlayById","getLoading","layerStatesArray","getSource","loading","getPixelFromCoordinate","viewCoordinate","getPixelFromCoordinateInternal","coordinateToPixelTransform","getRenderer","getSize","getOverlayContainer","getOverlayContainerStopEvent","tileSourceKey","tileCenter","tileResolution","wantedTiles","viewState","mapBrowserEvent","body","getRootNode","interactionsArray","getActive","handlePostRender","tileQueue","hints","viewHints","lowOnFrameBudget","time","dispatchRenderEvent","postRenderFunctions","render","targetElement","updateSize","handleViewPropertyChanged_","updateViewportSize_","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","render_","getMap","mapEvent","fontRegEx","RegExp","fontRegExMatchIndex","getFontParameters","fontSpec","match","lineHeight","weight","variant","families","family","inView","Layer","mapPrecomposeKey_","mapRenderKey_","sourceChangeKey_","handleSourcePropertyChange_","setSource","handleSourceChange_","getFeatures","layerRenderer","prepareFrame","some","arrayLayerState","updateElement_","Attribution","ulElement_","collapsed_","collapsed","overrideCollapsible_","collapsible","collapsible_","tipLabel","collapseLabel","collapseLabel_","textContent","label","label_","activeLabel","setAttribute","title","handleClick_","cssClasses","renderedAttributions_","renderedVisible_","collectSourceAttributions_","lookup","visibleAttributions","attributionGetter","getAttributions","attributions","getAttributionsCollapsible","setCollapsible","display","innerHTML","handleToggle_","classList","toggle","getCollapsible","setCollapsed","getCollapsed","rotation_","autoHide_","add","Rotate","callResetNorth_","resetNorth","duration_","autoHide","resetNorth_","Zoom","zoomInLabel","zoomOutLabel","zoomInTipLabel","zoomOutTipLabel","inElement","createTextNode","outElement","zoomByDelta_","currentZoom","newZoom","defaults","zoomOptions","rotateOptions","attribution","attributionOptions","zoomByDelta","Interaction","setActive","active","stopEvent","delta_","DoubleClickZoom","altKeyOnly","altShiftKeysOnly","activeElement","always","mouseActionButton","never","singleClick","noModifierKeys","shiftKeyOnly","targetNotEditable","tagName","mouseOnly","primaryAction","pointerEvents","Pointer","PointerInteraction","handleDownEvent","handleDragEvent","handleMoveEvent","handleUpEvent","stopDown","handlingDownUpSequence","trackedPointers_","targetPointers","getPointerCount","updateTrackedPointers_","handledUp","handled","isPointerDraggingEvent","event_1","defaultCondition","DragPan","kinetic_","kinetic","lastCentroid","lastPointersCount_","panning_","condition_","condition","noKinetic_","conditionInternal_","pass","hasAttribute","centroid","centerpx","DragRotate","lastAngle_","RenderBox","geometry_","startPixel_","endPixel_","startPixel","endPixel","setPixels","createOrUpdateGeometry","DragBoxEventType","DragBoxEvent","DragBox","box_","minArea_","onBoxEnd_","onBoxEnd","boxEndCondition_","boxEndCondition","defaultBoxEndCondition","out_","mapExtent","boxPixelExtent","DragZoom","out","keyCode","KeyCode","mapUnitsDelta","pixelDelta_","pan","KeyboardPan","defaultCondition_","pixelDelta","charCode","KeyboardZoom","Mode","MouseWheelZoom","totalDelta_","lastDelta_","timeout_","timeout","useAnchor_","useAnchor","lastAnchor_","startTime_","timeoutId_","mode_","trackpadEventGap_","trackpadTimeoutId_","deltaPerZoom_","endInteraction_","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","rgb","cache","cacheSize","fromString","g","exec","hasAlpha","substr","normalize","Number","fromStringInternal_","asArray","IconImageCache","cache_","cacheSize_","maxCacheSize_","canExpireCache","expire","iconImage","src","crossOrigin","maxCacheSize","shared","asColorLike","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","defaultLineDash","defaultPadding","checkedFonts","labelCache","console","warn","measureFont","div","heights","measureContext","textHeights","registerFont","interval","referenceWidth","referenceFonts","text","isAvailable","fontStyle","fontWeight","fontFamily","available","referenceFont","measureTextWidth","check","done","fonts","font","clearInterval","setInterval","measureTextHeight","metrics","measureText","actualBoundingBoxAscent","actualBoundingBoxDescent","rotateAtOffset","drawImageOrLabel","labelOrImage","originX","originY","save","globalAlpha","setTransform","contextInstructions","executeLabelInstructions","drawImage","restore","createTransformStringCanvas","createTransformString","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","alpha","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","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","renderFeatureInternal","getVectorContext","userTransform","renderDeclutterItems","declutterTree","zIndexItems","renderDeclutter","expireIconCache","MapRenderer","declutterTree_","calculateMatrices2D","thisArg","thisArg2","translatedCoordinate","offsets","declutteredFeatures","numLayers","entry","tmpCoord","getWrapX","callback_1","scheduleExpireIconCache","Composite","CompositeMapRenderer","fontChangeListenerKey_","CLASS_UNSELECTABLE","container","insertBefore","firstChild","children_","previousElement","oldChildren","childNodes","oldChild","newChild","replaceChildren","getDataAtPixel","Map","Overlay","insertFirst","autoPan","autoPanAnimation","autoPanMargin","rendered","mapPostrenderListenerKey","handleElementChanged","handleMapChanged","handleOffsetChanged","handlePositionChanged","handlePositioningChanged","setElement","setOffset","setPositioning","positioning","OverlayPositioning","setPosition","getElement","getOffset","getPositioning","updatePixelPosition","performAutoPan","panIntoView","panIntoViewOptions","mapRect","getRect","overlayRect","myMargin","offsetLeft","offsetRight","offsetTop","offsetBottom","centerPx","newCenterPx","panOptions","box","pageXOffset","pageYOffset","mapSize","updateRenderedPosition","posX","posY","msTransform","getOptions","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","fromKey","hash","tmpTileCoord","TileGrid","opt_strict","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_maxResolution","opt_corner","createForExtent","extentFromProjection","half","supportedExtensions","CONTEXT_IDS","opt_attributes","XML_SCHEMA_INSTANCE_URI","createElementNS","namespaceURI","qualifiedName","getDocument","getAllTextContent","normalizeWhitespace","getAllTextContent_","accumulator","nodeType","Node","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","xmlSerializer_","document_","implementation","createDocument","BufferUsage","getArrayClassForType","Float32Array","Uint32Array","WebGLArrayBuffer","opt_usage","usage","ofSize","fromArray","from","fromArrayBuffer","getUsage","fromTransform","mat4","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","ARRAY_BUFFER","bufferData","STATIC_DRAW","renderTargetAttribLocation_","getAttribLocation","renderTargetUniformLocation_","getUniformLocation","renderTargetTextureLocation_","uniforms_","uniforms","location","getGL","init","textureSize","drawingBufferWidth","drawingBufferHeight","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","AttributeType","UNSIGNED_SHORT","UNSIGNED_INT","computeAttributesStride","attributes","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","prevValue","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_","displacement_","displacement","getDisplacement","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","ImageBase","getPixelRatio","listenImage","image","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","globalCompositeOperation","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","styles","white","blue","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","startCharCode","stopCharCode","stop_1","jsonp","opt_errback","opt_callbackParam","script","cleanup","async","timer","getElementsByTagName","Tile","interimTile","transition_","transition","transitionStarts_","release","getInterimTile","refreshInterimChain","getTileCoord","setState","getAlpha","inTransition","endTransition","ImageTile","tileLoadFunction","tileLoadFunction_","naturalWidth","naturalHeight","LRUCache","opt_highWaterMark","highWaterMark","count_","entries_","oldest_","newest_","containsKey","value_","key_","newer","older","peekLast","peekLastKey","peekFirstKey","TileCache","expireCache","pruneExceptNewestZ","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","p0","p1","p2","clip","Triangulation","maxSourceExtent","errorThreshold","opt_destinationResolution","sourceProj_","targetProj_","transformInvCache","transformInv","transformInv_","maxSourceExtent_","errorThresholdSquared_","triangles_","wrapsXInSource_","canWrapXInSource_","sourceWorldWidth_","targetWorldWidth_","destinationTopLeft","destinationTopRight","destinationBottomRight","destinationBottomLeft","sourceTopLeft","sourceTopRight","sourceBottomRight","sourceBottomLeft","maxSubdivision","log2","addQuad_","leftBound_1","newTriangle","addTriangle_","aSrc","bSrc","cSrc","dSrc","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","reproject_","leftToLoad_1","sourceListenKey_1","unlistenSources_","adaptAttributions","attributionLike","Source","attributions_","attributionsCollapsible_","attributionsCollapsible","wrapX_","wrapX","refresh","setAttributions","TileSource","opaque_","opaque","tilePixelRatio_","tilePixelRatio","canUseScreen","screen","availWidth","availHeight","minCacheSize","tileCache","tmpSize","tileOptions","zDirection","getTileCacheForProjection","forEachLoadedTile","tileCoordKey","loaded","covered","getGutterForProjection","setKey","getOpaque","getTile","getTileGrid","getTileGridForProjection","thisProj","getTilePixelRatio","getTilePixelSize","getTileCoordForTileUrlFunction","opt_projection","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","XYZ","CartoDB","account_","account","mapId_","config_","templateCache_","initializeMap_","getConfig","updateConfig","setConfig","paramHash","JSON","stringify","applyTemplate_","mapUrl","client","handleInitResponse_","handleInitError_","setRequestHeader","err","tilesUrl","cdn_url","https","layergroupid","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","boundRefresh_","cluster","setDistance","mapDistance","clustered","neighbors","neighbor","createCluster","TierSizeCalculation","CustomTile","zoomifyImage_","Zoomify","tierSizeCalculation","tierSizeInTiles","tileSizeForTierSizeCalculation","reverse","tileCountUpToTier","tileCoordZ","tileIndex","localContext_1","ZoomifyTileClass","testTileUrl","Versions","IIIF_PROFILE_VALUES","supports","formats","qualities","COMPLIANCE_VERSION1","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","reduce","acc","extraFeatures","extraQualities","IIIFInfo","setImageInfo","getImageApiVersion","getComplianceLevelEntryFromProfile","version","test","getComplianceLevelFromProfile","complianceLevel","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","GETFEATUREINFO_IMAGE_SIZE","ImageWMS","v13_","updateV13_","serverType_","getFeatureInfoUrl","projectionObj","sourceProjectionObj","getLegendUrl","LAYERS","mpu","viewExtent","requestExtent","WMSServerType","ATTRIBUTION","OSM","BaseImage","BaseImageLayer","LayerRenderer","boundHandleImageChange_","handleImageChange_","layer_","loadedTileCallback","createLoadedTileFinder","getLayer","renderIfReadyAndVisible","loadImage","CanvasLayerRenderer","renderedResolution","tempTransform_","pixelTransform","containerReused","useContainer","layerClassName","transformOrigin","topLeft","topRight","bottomRight","bottomLeft","clipUnrotated","inverted","dispatchRenderEvent_","preRender","postRender","getRenderTransform","renderPixel","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","scheduleExpireCache","getTileImage","tileAlpha","alphaChanged","postRenderFunction","opt_tileCallback","TileLayer","RasterEventType","RasterOperationType","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","canvasPool","VectorRenderTile","getSourceTiles","executorGroups","loadingSourceTiles","errorSourceTileKeys","hitDetectionImageData","replayState_","sourceTiles","wantedResolution","sourceZ","hasContext","getReplayState","dirty","renderedRenderOrder","renderedTileResolution","renderedTileRevision","renderedZ","renderedTileZ","VectorTile","features_","onLoad","setFeatures","onError","defaultLoadFunction","loadingTiles_","sourceTileCache","tileGrids_","sourceTile","tileFeatures","candidate","loadedZ","previousSourceTiles","sourceTileCoord","listenChange","sourceTileKey","errorTileCount","coordKey","empty","WMTS","requestEncoding","WMTSRequestEncoding","version_","dimensions_","dimensions","matrixSet_","requestEncoding_","getKeyForDimensions_","createFromWMTSTemplate","getDimensions","getMatrixSet","getRequestEncoding","getVersion","updateDimensions","WebGLWorkerMessageType","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_","handleSourceFeatureClear_","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","replay","Constructor","lineStringLength","drawTextOnPath","startM","measureAndCacheTextWidth","previousAngle","numChars","segmentM","angleChanged","char","charLength","charM","segmentPos","interpolate","p3","p4","Executor","alignFill_","coordinateCache_","renderedTransform_","widths_","createLabel","align","numLines","widths","currentWidth","measureTextWidths","renderWidth","OffscreenCanvasRenderingContext2D","CanvasRenderingContext2D","leftRight","replayTextBackground_","strokeInstruction","setStrokeStyle_","replayImageOrLabel_","imageOrLabel","snapToPixel","fillStroke","boxW","boxH","boxX","boxY","strokePadding","declutterArgs","repeatSize","groupCount","declutterData","currentAlpha","drawLabelWithPointPlacement_","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","loadExtents","loadExtent","userExtent","replayGroupInstructions","executorGroup","CanvasVectorImageLayerRenderer","vectorRenderer_","layerImageRatio_","getImageRatio","coordinateToVectorPixelTransform_","renderedPixelToCoordinateTransform_","vectorPixel","vectorRenderer","imageFrameState_1","image_1","IMAGE_REPLAYS","VECTOR_REPLAYS","CanvasVectorTileLayerRenderer","renderedLayerRevision_","renderTileImageQueue_","tileListenerKeys_","tmpTransform_","prepareTile","tileUid","updateExecutorGroup_","tileImageNeedsRender_","listenerKey","getRenderMode","VectorTileRenderType","renderTileImage_","layerRevision","builderState","layerUid","tt","sourceTileExtent","sharedExtent","bufferedExtent","executorGroupInstructions","replayExtent","renderingReplayGroup","found","_loop_2","tileContainsCoordinate","extent_1","tilePixel","renderQueuedTileImages_","renderMode","replayTypes","worldOffset","replayState","renderPixelRatio","renderScale","pixelScale","VectorLayer","interpolatePoint","pointY","cumulativeLengths","haystack","needle","opt_comparator","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_","maxX_","maxY_","minX_","minY_","targetSize_","maxLines_","meridians_","parallels_","strokeStyle_","fromLonLatTransform_","toLonLatTransform_","projectionCenterLonLat_","bottomLeft_","bottomRight_","topLeft_","topRight_","meridiansLabels_","parallelsLabels_","lonLabelFormatter_","latLabelFormatter_","lonLabelPosition_","latLabelPosition_","lonLabelStyleBase_","lonLabelStyle_","latLabelStyleBase_","latLabelStyle_","drawLabels_","intervals_","loaderFunction","strategyFunction","featurePool_","lineStyle_","loadedExtent_","realWorldExtent","renderExtent","updateProjectionInfo_","createGraticule_","featuresColl","poolIndex","addMeridian_","lon","minLat","maxLat","lineString","getMeridian_","geom","addParallel_","minLon","maxLon","getParallel_","rotationCenter","rotationExtent","cr","sr","unrotatedWidth","unrotatedHeight","startWorld","endWorld","labelsAtStart","vectorContext","textPoint","getMeridianPoint_","getParallelPoint_","getInterval_","validCenterP","centerLonLat","cnt","centerLon","centerLat","validExtentP","validExtent","clampedLat","frac","meridian","bottom","clampedBottom","clampedTop","getMeridians","lon2","parallel","clampedLeft","clampedRight","getParallels","toLonLatTransform","split_1","lonLatCoordinates","worldExtentP","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","move","addToDrawing_","startDrawing_","circleMode","finishDrawing","atFinish_","abortDrawing","downPx","clickPx","modifyDrawing_","createOrUpdateSketchPoint_","at","potentiallyDone","potentiallyFinishCoordinates","sketchCoords","finishCoordinate","finishPixel","updateSketchFeatures_","sketchLineGeom","ring","removeLastPoint","sketchFeature","abortDrawing_","appendCoordinates","ending","sketchFeatures","overlaySource","ExtentEventType","ExtentEvent","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_","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_","opt_coordinate","nodes","vertexSegments","rTree","updateSegmentIndices_","newSegmentData","newSegmentData2","removeVertex_","component","newIndex","dragSegments","segmentsByFeature","deleted","SelectEventType","SelectEvent","selected","deselected","originalFeatureStyles","addCondition_","removeCondition_","toggleCondition_","featureLayerAssociation_","filter_","addFeatureLayerAssociation_","multi_","layerFilter_","hitTolerance_","removeFeatureLayerAssociation_","Select","boundAddFeature_","boundRemoveFeature_","addCondition","removeCondition","toggleCondition","multi","layers_1","getHitTolerance","setHitTolerance","restorePreviousStyle_","applySelectedStyle_","selectInteractions","getFeatureFromEvent","Snap","vertex_","edge_","featuresListenerKeys_","featureChangeListenerKeys_","indexedFeaturesExtents_","pendingFeatures_","opt_listen","register","feature_uid","segmentWriter","forEachFeatureAdd_","forEachFeatureRemove_","getFeatures_","snapTo","snapped","updateFeature_","featuresToUpdate","opt_unlisten","unregister","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","getGeometriesArrayRecursive","geometriesArray","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","doc","readFeatureFromDocument","readFeatureFromNode","readFeaturesFromDocument","readFeaturesFromNode","ELEMENT_NODE","readGeometryFromDocument","readGeometryFromNode","readProjectionFromDocument","readProjectionFromNode","writeFeatureNode","serializeToString","writeFeaturesNode","writeGeometryNode","GMLNS","ONLY_WHITESPACE_RE","GMLBase","featureType","featureNS","srsName","schemaLocation","FEATURE_COLLECTION_PARSERS","namespace","readFeaturesInternal","ft","featureTypes","readFeatureElement","readGeometryElement","getAttribute","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","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","TEXTAREA","DEFAULT_STYLE_ARRAY","KML","defaultStyle_","defaultStyle","extractStyles_","extractStyles","writeStyles_","writeStyles","sharedStyles_","showPointNames_","showPointNames","readDocumentOrFolder_","readPlacemark_","readSharedStyle_","readSharedStyleMap_","styleUrl","sharedStyles","drawName","multiGeometryPoints","featureStyle","findStyle","styleValue","nameStyle","foundStyle","textOffset","imageScale","createNameStyleFunction","createFeatureStyleFunction","styleUri","baseURI","fs","readName","readNameFromDocument","readNameFromNode","name_2","readNetworkLinks","networkLinks","readNetworkLinksFromDocument","readNetworkLinksFromNode","readRegion","regions","readRegionFromDocument","readRegionFromNode","kml","xmlnsUri","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","pointStyles","lineStyles","polyStyles","STYLE_SEQUENCE","STYLE_SERIALIZERS","PLACEMARK_SEQUENCE","EXTENDEDDATA_NODE_FACTORY","v","styleArray","PRIMITIVE_GEOMETRY_SEQUENCE","PRIMITIVE_GEOMETRY_SERIALIZERS","POLY_STYLE_SEQUENCE","POLYGON_SERIALIZERS","INNER_BOUNDARY_NODE_FACTORY","OUTER_BOUNDARY_NODE_FACTORY","POLY_STYLE_SERIALIZERS","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","OGCNS","SCHEMA_LOCATIONS","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","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","readHref","XML","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","events","FullScreenEventType","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_","view_","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","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","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","has","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","toContext","PointsLayer","ImageStatic","optionsFromCapabilities","wmtsCap","tileMatrixSets","supportedCRS","matrixSetObj","projConfig","matrix0","TileMatrix","ScaleDenominator","TopLeftCorner","tileSpanX","TileWidth","tileSpanY","TileHeight","MatrixHeight","MatrixWidth","gets","encodings","composeCssTransform","Buffer","DYNAMIC_DRAW","ELEMENT_ARRAY_BUFFER","Helper","PostProcessingPass","RenderTarget","STREAM_DRAW","registerDocument","registerXMLSerializer","xmlSerializer"],"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,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GA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F,YtLniBgB,MsLoiBzBm4F,GAAGK,MAAM+E,YtL3iBgB,MsL4iBzBpF,GAAGx9F,IAAIZ,kBAAoB,GAC3Bo+F,GAAGx9F,IAAID,MAAQ,GACfy9F,GAAGx9F,IAAI6iG,iBrL7HA,SAA0BxlK,GAC7BolE,GAAYplE,GqL6HhBmgK,GAAGx9F,IAAI8iG,sBrLlJA,SAA+BC,GAClCvgG,GAAiBugG,GqLmJN,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 (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\ntypeof define === 'function' && define.amd ? define(factory) :\n(global = global || self, global.RBush = factory());\n}(this, function () { 'use strict';\n\nfunction quickselect(arr, k, left, right, compare) {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) { swap(arr, left, right); }\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) { i++; }\n while (compare(arr[j], t) > 0) { j--; }\n }\n\n if (compare(arr[left], t) === 0) { swap(arr, left, j); }\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) { left = j + 1; }\n if (k <= j) { right = j - 1; }\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nvar RBush = function RBush(maxEntries) {\n if ( maxEntries === void 0 ) maxEntries = 9;\n\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n this.clear();\n};\n\nRBush.prototype.all = function all () {\n return this._all(this.data, []);\n};\n\nRBush.prototype.search = function search (bbox) {\n var node = this.data;\n var result = [];\n\n if (!intersects(bbox, node)) { return result; }\n\n var toBBox = this.toBBox;\n var nodesToSearch = [];\n\n while (node) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n var childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) { result.push(child); }\n else if (contains(bbox, childBBox)) { this._all(child, result); }\n else { nodesToSearch.push(child); }\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n};\n\nRBush.prototype.collides = function collides (bbox) {\n var node = this.data;\n\n if (!intersects(bbox, node)) { return false; }\n\n var nodesToSearch = [];\n while (node) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n var childBBox = node.leaf ? this.toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) { return true; }\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n};\n\nRBush.prototype.load = function load (data) {\n if (!(data && data.length)) { return this; }\n\n if (data.length < this._minEntries) {\n for (var i = 0; i < data.length; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n var tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n};\n\nRBush.prototype.insert = function insert (item) {\n if (item) { this._insert(item, this.data.height - 1); }\n return this;\n};\n\nRBush.prototype.clear = function clear () {\n this.data = createNode([]);\n return this;\n};\n\nRBush.prototype.remove = function remove (item, equalsFn) {\n if (!item) { return this; }\n\n var node = this.data;\n var bbox = this.toBBox(item);\n var path = [];\n var indexes = [];\n var i, parent, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n var index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else { node = null; } // nothing found\n }\n\n return this;\n};\n\nRBush.prototype.toBBox = function toBBox (item) { return item; };\n\nRBush.prototype.compareMinX = function compareMinX (a, b) { return a.minX - b.minX; };\nRBush.prototype.compareMinY = function compareMinY (a, b) { return a.minY - b.minY; };\n\nRBush.prototype.toJSON = function toJSON () { return this.data; };\n\nRBush.prototype.fromJSON = function fromJSON (data) {\n this.data = data;\n return this;\n};\n\nRBush.prototype._all = function _all (node, result) {\n var nodesToSearch = [];\n while (node) {\n if (node.leaf) { result.push.apply(result, node.children); }\n else { nodesToSearch.push.apply(nodesToSearch, node.children); }\n\n node = nodesToSearch.pop();\n }\n return result;\n};\n\nRBush.prototype._build = function _build (items, left, right, height) {\n\n var N = right - left + 1;\n var M = this._maxEntries;\n var node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n var N2 = Math.ceil(N / M);\n var N1 = N2 * Math.ceil(Math.sqrt(M));\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (var i = left; i <= right; i += N1) {\n\n var right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (var j = i; j <= right2; j += N2) {\n\n var right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n};\n\nRBush.prototype._chooseSubtree = function _chooseSubtree (bbox, node, level, path) {\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) { break; }\n\n var minArea = Infinity;\n var minEnlargement = Infinity;\n var targetNode = (void 0);\n\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n var area = bboxArea(child);\n var enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n};\n\nRBush.prototype._insert = function _insert (item, level, isNode) {\n var bbox = isNode ? item : this.toBBox(item);\n var insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else { break; }\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n};\n\n// split overflowed node into two\nRBush.prototype._split = function _split (insertPath, level) {\n var node = insertPath[level];\n var M = node.children.length;\n var m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n var splitIndex = this._chooseSplitIndex(node, m, M);\n\n var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) { insertPath[level - 1].children.push(newNode); }\n else { this._splitRoot(node, newNode); }\n};\n\nRBush.prototype._splitRoot = function _splitRoot (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n};\n\nRBush.prototype._chooseSplitIndex = function _chooseSplitIndex (node, m, M) {\n var index;\n var minOverlap = Infinity;\n var minArea = Infinity;\n\n for (var i = m; i <= M - m; i++) {\n var bbox1 = distBBox(node, 0, i, this.toBBox);\n var bbox2 = distBBox(node, i, M, this.toBBox);\n\n var overlap = intersectionArea(bbox1, bbox2);\n var area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index || M - m;\n};\n\n// sorts node children by the best axis for split\nRBush.prototype._chooseSplitAxis = function _chooseSplitAxis (node, m, M) {\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n var compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n var xMargin = this._allDistMargin(node, m, M, compareMinX);\n var yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) { node.children.sort(compareMinX); }\n};\n\n// total margin of all possible split distributions where each node is at least m full\nRBush.prototype._allDistMargin = function _allDistMargin (node, m, M, compare) {\n node.children.sort(compare);\n\n var toBBox = this.toBBox;\n var leftBBox = distBBox(node, 0, m, toBBox);\n var rightBBox = distBBox(node, M - m, M, toBBox);\n var margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n for (var i = m; i < M - m; i++) {\n var child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (var i$1 = M - m - 1; i$1 >= m; i$1--) {\n var child$1 = node.children[i$1];\n extend(rightBBox, node.leaf ? toBBox(child$1) : child$1);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n};\n\nRBush.prototype._adjustParentBBoxes = function _adjustParentBBoxes (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (var i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n};\n\nRBush.prototype._condense = function _condense (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (var i = path.length - 1, siblings = (void 0); i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else { this.clear(); }\n\n } else { calcBBox(path[i], this.toBBox); }\n }\n};\n\nfunction findItem(item, items, equalsFn) {\n if (!equalsFn) { return items.indexOf(item); }\n\n for (var i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) { return i; }\n }\n return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n if (!destNode) { destNode = createNode(null); }\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (var i = k; i < p; i++) {\n var child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n}\n\nfunction extend(a, b) {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n var minX = Math.max(a.minX, b.minX);\n var minY = Math.max(a.minY, b.minY);\n var maxX = Math.min(a.maxX, b.maxX);\n var maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n return b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n return {\n children: children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n var stack = [left, right];\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) { continue; }\n\n var mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n\nreturn RBush;\n\n}));\n","// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at http://mozilla.org/MPL/2.0/\n// Variable to hold current primary touch event identifier.\n// iOS needs this since it does not attribute\n// identifier 0 to primary touch event.\nvar primaryTouchId = null;\n// Variable to hold mouse pointer captures.\nvar mouseCaptureTarget = null;\nif (!(\"PointerEvent\" in window)) {\n // Define {set,release}PointerCapture\n definePointerCapture();\n // Create Pointer polyfill from mouse events only on non-touch device\n if (!(\"TouchEvent\" in window)) {\n addMouseToPointerListener(document, \"mousedown\", \"pointerdown\");\n addMouseToPointerListener(document, \"mousemove\", \"pointermove\");\n addMouseToPointerListener(document, \"mouseup\", \"pointerup\");\n }\n // Define Pointer polyfill from touch events\n addTouchToPointerListener(document, \"touchstart\", \"pointerdown\");\n addTouchToPointerListener(document, \"touchmove\", \"pointermove\");\n addTouchToPointerListener(document, \"touchend\", \"pointerup\");\n}\n// Function defining {set,release}PointerCapture from {set,releas}Capture\nfunction definePointerCapture() {\n Element.prototype.setPointerCapture = Element.prototype.setCapture;\n Element.prototype.releasePointerCapture = Element.prototype.releaseCapture;\n}\n// Function converting a Mouse event to a Pointer event.\nfunction addMouseToPointerListener(target, mouseType, pointerType) {\n target.addEventListener(mouseType, function (mouseEvent) {\n var pointerEvent = new MouseEvent(pointerType, mouseEvent);\n pointerEvent.pointerId = 1;\n pointerEvent.isPrimary = true;\n pointerEvent.pointerType = \"mouse\";\n pointerEvent.width = 1;\n pointerEvent.height = 1;\n pointerEvent.tiltX = 0;\n pointerEvent.tiltY = 0;\n // pressure is 0.5 if a button is holded\n \"buttons\" in mouseEvent && mouseEvent.buttons !== 0\n ? (pointerEvent.pressure = 0.5)\n : (pointerEvent.pressure = 0);\n // if already capturing mouse event, transfer target\n // and don't forget implicit release on mouseup.\n var target = mouseEvent.target;\n if (mouseCaptureTarget !== null) {\n target = mouseCaptureTarget;\n if (mouseType === \"mouseup\") {\n mouseCaptureTarget = null;\n }\n }\n target.dispatchEvent(pointerEvent);\n if (pointerEvent.defaultPrevented) {\n mouseEvent.preventDefault();\n }\n });\n}\n// Function converting a Touch event to a Pointer event.\nfunction addTouchToPointerListener(target, touchType, pointerType) {\n target.addEventListener(touchType, function (touchEvent) {\n var changedTouches = touchEvent.changedTouches;\n var nbTouches = changedTouches.length;\n for (var t = 0; t < nbTouches; t++) {\n var pointerEvent = new CustomEvent(pointerType, {\n bubbles: true,\n cancelable: true\n });\n pointerEvent.ctrlKey = touchEvent.ctrlKey;\n pointerEvent.shiftKey = touchEvent.shiftKey;\n pointerEvent.altKey = touchEvent.altKey;\n pointerEvent.metaKey = touchEvent.metaKey;\n var touch = changedTouches.item(t);\n pointerEvent.clientX = touch.clientX;\n pointerEvent.clientY = touch.clientY;\n pointerEvent.screenX = touch.screenX;\n pointerEvent.screenY = touch.screenY;\n pointerEvent.pageX = touch.pageX;\n pointerEvent.pageY = touch.pageY;\n var rect = touch.target.getBoundingClientRect();\n pointerEvent.offsetX = touch.clientX - rect.left;\n pointerEvent.offsetY = touch.clientY - rect.top;\n pointerEvent.pointerId = 1 + touch.identifier;\n // Default values for standard MouseEvent fields.\n pointerEvent.button = 0;\n pointerEvent.buttons = 1;\n pointerEvent.movementX = 0;\n pointerEvent.movementY = 0;\n pointerEvent.region = null;\n pointerEvent.relatedTarget = null;\n pointerEvent.x = pointerEvent.clientX;\n pointerEvent.y = pointerEvent.clientY;\n // Pointer event details\n pointerEvent.pointerType = \"touch\";\n pointerEvent.width = 1;\n pointerEvent.height = 1;\n pointerEvent.tiltX = 0;\n pointerEvent.tiltY = 0;\n pointerEvent.pressure = 1;\n // First touch is the primary pointer event.\n if (touchType === \"touchstart\" && primaryTouchId === null) {\n primaryTouchId = touch.identifier;\n }\n pointerEvent.isPrimary = touch.identifier === primaryTouchId;\n // If first touch ends, reset primary touch id.\n if (touchType === \"touchend\" && pointerEvent.isPrimary) {\n primaryTouchId = null;\n }\n touchEvent.target.dispatchEvent(pointerEvent);\n if (pointerEvent.defaultPrevented) {\n touchEvent.preventDefault();\n }\n }\n });\n}\n//# sourceMappingURL=elm-pep.js.map","'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.3.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 * @typedef {Object} ListenerObject\n * @property {ListenerFunction} handleEvent\n */\n/**\n * @typedef {ListenerFunction|ListenerObject} Listener\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\").Listener>>}\n */\n _this.listeners_ = {};\n return _this;\n }\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} 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 {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 /** @type {import(\"./Event.js\").default|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 ('handleEvent' in listeners[i]) {\n propagate = /** @type {import(\"../events.js\").ListenerObject} */ (listeners[i]).handleEvent(evt);\n }\n else {\n propagate = /** @type {import(\"../events.js\").ListenerFunction} */ (listeners[i]).call(this, evt);\n }\n if (propagate === 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\").Listener>} 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\").Listener} 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 TOUCHMOVE: 'touchmove',\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 {import(\"./events.js\").ListenerFunction} 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 * Determine if two extents are approximately equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {number} tolerance Tolerance in extent coordinate units.\n * @return {boolean} The two extents differ by less than the tolerance.\n */\nexport function approximatelyEquals(extent1, extent2, tolerance) {\n return Math.abs(extent1[0] - extent2[0]) < tolerance && Math.abs(extent1[2] - extent2[2]) < tolerance &&\n Math.abs(extent1[1] - extent2[1]) < tolerance && Math.abs(extent1[3] - extent2[3]) < tolerance;\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 * @param {number=} opt_stops Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {Extent} Extent.\n * @api\n */\nexport function applyTransform(extent, transformFn, opt_extent, opt_stops) {\n var coordinates = [];\n if (opt_stops > 1) {\n var width = extent[2] - extent[0];\n var height = extent[3] - extent[1];\n for (var i = 0; i < opt_stops; ++i) {\n coordinates.push(extent[0] + width * i / opt_stops, extent[1], extent[2], extent[1] + height * i / opt_stops, extent[2] - width * i / opt_stops, extent[3], extent[0], extent[3] - height * i / opt_stops);\n }\n }\n else {\n coordinates = [\n extent[0], extent[1],\n extent[2], extent[1],\n extent[2], extent[3],\n extent[0], extent[3]\n ];\n }\n transformFn(coordinates, coordinates, 2);\n var xs = [];\n var ys = [];\n for (var i = 0, l = coordinates.length; i < l; i += 2) {\n xs.push(coordinates[i]);\n ys.push(coordinates[i + 1]);\n }\n return _boundingExtentXYs(xs, ys, opt_extent);\n}\n/**\n * Modifies the provided extent in-place to be within the real world\n * extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Extent} The extent within the real world extent.\n */\nexport function wrapX(extent, projection) {\n var projectionExtent = projection.getExtent();\n var center = getCenter(extent);\n if (projection.canWrapX() && (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])) {\n var worldWidth = getWidth(projectionExtent);\n var worldsAway = Math.floor((center[0] - projectionExtent[0]) / worldWidth);\n var offset = (worldsAway * worldWidth);\n extent[0] -= offset;\n extent[2] -= offset;\n }\n return 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 * @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 * @param {number=} opt_stops Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {import(\"./extent.js\").Extent} The transformed extent.\n * @api\n */\nexport function transformExtent(extent, source, destination, opt_stops) {\n var transformFunc = getTransform(source, destination);\n return applyTransform(extent, transformFunc, undefined, opt_stops);\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 * @api\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 * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative). The resulting transform\n * string can be applied as `transform` porperty of an HTMLElement's style.\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 {string} The composite css transform.\n * @api\n */\nexport function composeCssTransform(dx1, dy1, sx, sy, angle, dx2, dy2) {\n return toString(compose(create(), dx1, dy1, sx, sy, angle, dx2, dy2));\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 = typeof devicePixelRatio !== 'undefined' ? devicePixelRatio : 1;\n/**\n * The execution context is a worker with OffscreenCanvas available.\n * @const\n * @type {boolean}\n */\nexport var WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope !== 'undefined' && typeof OffscreenCanvas !== 'undefined' &&\n self instanceof WorkerGlobalScope; //eslint-disable-line\n/**\n * Image.prototype.decode() is supported.\n * @type {boolean}\n */\nexport var IMAGE_DECODE = typeof Image !== 'undefined' && Image.prototype.decode;\n/**\n * @type {boolean}\n */\nexport var PASSIVE_EVENT_LISTENERS = (function () {\n var passive = false;\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function () {\n passive = true;\n }\n });\n window.addEventListener('_', null, options);\n window.removeEventListener('_', null, options);\n }\n catch (error) {\n // passive not supported\n }\n return passive;\n})();\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 'elm-pep';\nimport { DEVICE_PIXEL_RATIO, PASSIVE_EVENT_LISTENERS } 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';\nimport EventType from './events/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 {PointerEvent}\n * @private\n */\n _this.originalPointerMoveEvent_;\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n _this.relayedListenerKey_ = listen(element, PointerEventType.POINTERMOVE, _this.relayEvent_, _this);\n /**\n * @private\n */\n _this.boundHandleTouchMove_ = _this.handleTouchMove_.bind(_this);\n _this.element_.addEventListener(EventType.TOUCHMOVE, _this.boundHandleTouchMove_, PASSIVE_EVENT_LISTENERS ? { passive: false } : false);\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 this.originalPointerMoveEvent_ = pointerEvent;\n var dragging = !!(this.down_ && this.isMoving_(pointerEvent));\n this.dispatchEvent(new MapBrowserPointerEvent(pointerEvent.type, this.map_, pointerEvent, dragging));\n };\n /**\n * Flexible handling of a `touch-action: none` css equivalent: because calling\n * `preventDefault()` on a `pointermove` event does not stop native page scrolling\n * and zooming, we also listen for `touchmove` and call `preventDefault()` on it\n * when an interaction (currently `DragPan` handles the event.\n * @param {TouchEvent} event Event.\n * @private\n */\n MapBrowserEventHandler.prototype.handleTouchMove_ = function (event) {\n // Due to https://github.com/mpizenberg/elm-pep/issues/2, `this.originalPointerMoveEvent_`\n // may not be initialized yet when we get here on a platform without native pointer events.\n if (!this.originalPointerMoveEvent_ || this.originalPointerMoveEvent_.defaultPrevented) {\n event.preventDefault();\n }\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 this.element_.removeEventListener(EventType.TOUCHMOVE, this.boundHandleTouchMove_);\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};\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, { DROP } 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 || state === TileState.EMPTY) {\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 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.IDLE && !(tileKey in this.tilesLoadingKeys_)) {\n this.tilesLoadingKeys_[tileKey] = true;\n ++this.tilesLoading_;\n ++newLoads;\n tile.load();\n }\n }\n };\n return TileQueue;\n}(PriorityQueue));\nexport default TileQueue;\n/**\n * @param {import('./PluggableMap.js').FrameState} frameState Frame state.\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 */\nexport function getTilePriority(frameState, 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 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//# sourceMappingURL=TileQueue.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 account 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 * @param {boolean} showFullExtent Whether to show the full extent.\n * @return {number} Capped resolution.\n */\nfunction getViewportClampedResolution(resolution, maxExtent, viewportSize, showFullExtent) {\n var xResolution = getWidth(maxExtent) / viewportSize[0];\n var yResolution = getHeight(maxExtent) / viewportSize[1];\n if (showFullExtent) {\n return Math.min(resolution, Math.max(xResolution, yResolution));\n }\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 * @param {boolean=} opt_showFullExtent If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nexport function createSnapToResolutions(resolutions, opt_smooth, opt_maxExtent, opt_showFullExtent) {\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, opt_showFullExtent) :\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 * @param {boolean=} opt_showFullExtent If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nexport function createSnapToPower(power, maxResolution, opt_minResolution, opt_smooth, opt_maxExtent, opt_showFullExtent) {\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, opt_showFullExtent) :\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 * @param {boolean=} opt_showFullExtent If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nexport function createMinMaxResolution(maxResolution, minResolution, opt_smooth, opt_maxExtent, opt_showFullExtent) {\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, opt_showFullExtent) :\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';\nimport { getWidth } from './extent.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/**\n * Modifies the provided coordinate in-place to be within the real world\n * extent. The lower projection extent boundary is inclusive, the upper one\n * exclusive.\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Coordinate} The coordinate within the real world extent.\n */\nexport function wrapX(coordinate, projection) {\n var projectionExtent = projection.getExtent();\n if (projection.canWrapX() && (coordinate[0] < projectionExtent[0] || coordinate[0] >= projectionExtent[2])) {\n var worldWidth = getWidth(projectionExtent);\n var worldsAway = Math.floor((coordinate[0] - projectionExtent[0]) / worldWidth);\n coordinate[0] -= (worldsAway * worldWidth);\n }\n return coordinate;\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 { 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 {boolean} [showFullExtent=false] Allow the view to be zoomed out to\n * show the full configured extent. By default, when a view is configured with an\n * extent, users will not be able to zoom out so the viewport exceeds the extent in\n * either dimension. This means the full extent may not be visible if the viewport\n * is taller or wider than the aspect ratio of the configured extent. If\n * showFullExtent is true, the user will be able to zoom out so that the viewport\n * exceeds the height or width of the configured extent, but not both, allowing the\n * full extent to be shown.\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(\"./size.js\").Size}\n */\n _this.viewportSize_ = [100, 100];\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 /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate|undefined}\n */\n _this.cancelAnchor_ = undefined;\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.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 var anchor;\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 if (!anchor) {\n for (var j = 0, jj = series.length; j < jj; ++j) {\n var animation = series[j];\n if (!animation.complete) {\n anchor = animation.anchor;\n break;\n }\n }\n }\n }\n this.animations_.length = 0;\n this.cancelAnchor_ = anchor;\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.getViewportSize_(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 * Returns the current viewport size.\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.getViewportSize_ = function (opt_rotation) {\n var size = this.viewportSize_;\n if (opt_rotation) {\n var w = size[0];\n var h = size[1];\n return [\n Math.abs(w * Math.cos(opt_rotation)) + Math.abs(h * Math.sin(opt_rotation)),\n Math.abs(w * Math.sin(opt_rotation)) + Math.abs(h * Math.cos(opt_rotation))\n ];\n }\n else {\n return size;\n }\n };\n /**\n * Stores the viewport size on the view. The viewport size is not read every time from the DOM\n * to avoid performance hit and layout reflow.\n * This should be done on map size change.\n * @param {import(\"./size.js\").Size=} opt_size Viewport size; if undefined, [100, 100] is assumed\n */\n View.prototype.setViewportSize = function (opt_size) {\n this.viewportSize_ = Array.isArray(opt_size) ? opt_size.slice() : [100, 100];\n this.resolveConstraints(0);\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 * @return {boolean} Resolution constraint is set\n */\n View.prototype.getConstrainResolution = function () {\n return this.options_.constrainResolution;\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\n * of the 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.getViewportSize_();\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.getViewportSize_();\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.getConstrainedResolution(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 logPower = Math.log(opt_power || 2);\n var maxResolution = this.getConstrainedResolution(this.maxResolution_);\n var minResolution = this.minResolution_;\n var max = Math.log(maxResolution / minResolution) / logPower;\n return (\n /**\n * @param {number} resolution Resolution.\n * @return {number} Value.\n */\n function (resolution) {\n var value = (Math.log(maxResolution / resolution) / logPower) / 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.getViewportSize_() }, 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} */ (geometryOrExtent.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.getViewportSize_();\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.getViewportSize_(this.getRotation());\n var newResolution = this.constraints_.resolution(this.targetResolution_ * ratio, 0, size, isMoving);\n if (opt_anchor) {\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) {\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.getViewportSize_(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 this.cancelAnchor_ = undefined;\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.getViewportSize_(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 && !this.cancelAnchor_) {\n this.targetResolution_ = newResolution;\n this.targetRotation_ = newRotation;\n this.targetCenter_ = newCenter;\n this.applyTargetState_();\n return;\n }\n var anchor = opt_anchor || (duration === 0 ? this.cancelAnchor_ : undefined);\n this.cancelAnchor_ = undefined;\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: 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.getViewportSize_(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.getViewportSize_(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 showFullExtent = options.showFullExtent !== undefined ? options.showFullExtent : false;\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, showFullExtent);\n }\n else {\n resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\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, showFullExtent);\n }\n else {\n resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\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/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","import { WORKER_OFFSCREEN_CANVAS } from './has.js';\n/**\n * @module ol/dom\n */\n//FIXME Move this function to the canvas module\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number=} opt_width Canvas width.\n * @param {number=} opt_height Canvas height.\n * @param {Array<HTMLCanvasElement>=} opt_canvasPool Canvas pool to take existing canvas from.\n * @return {CanvasRenderingContext2D} The context.\n */\nexport function createCanvasContext2D(opt_width, opt_height, opt_canvasPool) {\n var canvas = opt_canvasPool && opt_canvasPool.length ?\n opt_canvasPool.shift() :\n WORKER_OFFSCREEN_CANVAS ?\n new OffscreenCanvas(opt_width || 300, opt_height || 300) :\n document.createElement('canvas');\n if (opt_width) {\n canvas.width = opt_width;\n }\n if (opt_height) {\n canvas.height = opt_height;\n }\n //FIXME Allow OffscreenCanvasRenderingContext2D as return type\n return /** @type {CanvasRenderingContext2D} */ (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 {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 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, { getTilePriority } 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, PASSIVE_EVENT_LISTENERS } from './has.js';\nimport LayerGroup from './layer/Group.js';\nimport { hasArea } from './size.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 * @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 var handleBrowserEvent = _this.handleBrowserEvent.bind(_this);\n _this.viewport_.addEventListener(EventType.CONTEXTMENU, handleBrowserEvent, false);\n _this.viewport_.addEventListener(EventType.WHEEL, handleBrowserEvent, PASSIVE_EVENT_LISTENERS ? { passive: false } : 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 return getTilePriority(this.frameState_, tile, tileSourceKey, tileCenter, 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 = /** @type {Node} */ (mapBrowserEvent.originalEvent.target);\n if (!mapBrowserEvent.dragging) {\n if (this.overlayContainerStopEvent_.contains(target) || !(document.body.contains(target) || this.viewport_.getRootNode && this.viewport_.getRootNode().contains(target))) {\n // Abort if the event target is a child of the container that doesn't allow\n // event propagation or is no longer in the page. It's possible for the target to no longer\n // be in the page if it has been removed in an event listener, this might happen in a Control\n // that recreates it's content based on user interaction either manually or via a render\n // in something like https://reactjs.org/\n return;\n }\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.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 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.updateViewportSize_();\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 this.updateViewportSize_();\n };\n /**\n * Recomputes the viewport size and save it on the view object (if any)\n * @private\n */\n PluggableMap.prototype.updateViewportSize_ = function () {\n var view = this.getView();\n if (view) {\n var size = undefined;\n var computedStyle = getComputedStyle(this.viewport_);\n if (computedStyle.width && computedStyle.height) {\n size = [\n parseInt(computedStyle.width, 10),\n parseInt(computedStyle.height, 10)\n ];\n }\n view.setViewportSize(size);\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","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 * @private\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 * Update the projection. Rendering of the coordinates is done in\n * `handleMouseMove` and `handleMouseUp`.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @api\n */\n Control.prototype.render = function (mapEvent) {\n this.render_.call(this, mapEvent);\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","/**\n * @module ol/css\n */\n/**\n * @typedef {Object} FontParameters\n * @property {string} style\n * @property {string} variant\n * @property {string} weight\n * @property {string} size\n * @property {string} lineHeight\n * @property {string} family\n * @property {Array<string>} families\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 * From http://stackoverflow.com/questions/10135697/regex-to-parse-any-css-font\n * @type {RegExp}\n */\nvar fontRegEx = new RegExp([\n '^\\\\s*(?=(?:(?:[-a-z]+\\\\s*){0,2}(italic|oblique))?)',\n '(?=(?:(?:[-a-z]+\\\\s*){0,2}(small-caps))?)',\n '(?=(?:(?:[-a-z]+\\\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)',\n '(?:(?:normal|\\\\1|\\\\2|\\\\3)\\\\s*){0,3}((?:xx?-)?',\n '(?:small|large)|medium|smaller|larger|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx]))',\n '(?:\\\\s*\\\\/\\\\s*(normal|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx])?))',\n '?\\\\s*([-,\\\\\"\\\\\\'\\\\sa-z]+?)\\\\s*$'\n].join(''), 'i');\nvar fontRegExMatchIndex = [\n 'style',\n 'variant',\n 'weight',\n 'size',\n 'lineHeight',\n 'family'\n];\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} fontSpec The CSS font property.\n * @return {FontParameters} The font parameters (or null if the input spec is invalid).\n */\nexport var getFontParameters = function (fontSpec) {\n var match = fontSpec.match(fontRegEx);\n if (!match) {\n return null;\n }\n var style = /** @type {FontParameters} */ ({\n lineHeight: 'normal',\n size: '1.2em',\n style: 'normal',\n weight: 'normal',\n variant: 'normal'\n });\n for (var i = 0, ii = fontRegExMatchIndex.length; i < ii; ++i) {\n var value = match[i + 1];\n if (value !== undefined) {\n style[fontRegExMatchIndex[i]] = value;\n }\n }\n style.families = style.family.split(/,\\s?/);\n return style;\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/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';\nimport { assert } from '../asserts.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 {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 {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 var layerStatesArray = renderEvent.frameState.layerStatesArray;\n var layerState = this.getLayerState(false);\n // A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.\n assert(!layerStatesArray.some(function (arrayLayerState) {\n return arrayLayerState.layer === layerState.layer;\n }), 67);\n layerStatesArray.push(layerState);\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 */\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 var rotation = view.getRotation();\n if (rotation !== undefined) {\n if (this.duration_ > 0 && rotation % (2 * Math.PI) !== 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 */\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 originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n var tagName = /** @type {Element} */ (originalEvent.target).tagName;\n return tagName !== 'INPUT' && tagName !== 'SELECT' && 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 * Returns the current number of pointers involved in the interaction,\n * e.g. `2` when two fingers are used.\n * @return {number} The number of pointers.\n * @api\n */\n PointerInteraction.prototype.getPointerCount = function () {\n return this.targetPointers.length;\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 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, focus } 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 * In addition, if there is a `tabindex` attribute on the map element,\n * {@link module:ol/events/condition~focus} will also be applied.\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 * @private\n * @param {import(\"../MapBrowserEvent\").default} mapBrowserEvent Event.\n * @return {boolean} Condition passes.\n */\n DragPan.prototype.conditionInternal_ = function (mapBrowserEvent) {\n var pass = true;\n if (mapBrowserEvent.map.getTargetElement().hasAttribute('tabindex')) {\n pass = focus(mapBrowserEvent);\n }\n return pass && this.condition_(mapBrowserEvent);\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 mapBrowserEvent.originalEvent.preventDefault();\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.conditionInternal_(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 { 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~mouseActionButton}.\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 * @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 : mouseActionButton;\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 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 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 (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, focus } 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 * In addition, if there is a `tabindex` attribute on the map element,\n * {@link module:ol/events/condition~focus} will also be applied.\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.deltaPerZoom_ = 300;\n return _this;\n }\n /**\n * @private\n * @param {import(\"../MapBrowserEvent\").default} mapBrowserEvent Event.\n * @return {boolean} Condition passes.\n */\n MouseWheelZoom.prototype.conditionInternal_ = function (mapBrowserEvent) {\n var pass = true;\n if (mapBrowserEvent.map.getTargetElement().hasAttribute('tabindex')) {\n pass = focus(mapBrowserEvent);\n }\n return pass && this.condition_(mapBrowserEvent);\n };\n /**\n * @private\n */\n MouseWheelZoom.prototype.endInteraction_ = function () {\n this.trackpadTimeoutId_ = undefined;\n var view = this.getMap().getView();\n view.endInteraction(undefined, this.lastDelta_ ? (this.lastDelta_ > 0 ? 1 : -1) : 0, 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.conditionInternal_(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 var view = map.getView();\n if (this.mode_ === Mode.TRACKPAD && !view.getConstrainResolution()) {\n if (this.trackpadTimeoutId_) {\n clearTimeout(this.trackpadTimeoutId_);\n }\n else {\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.beginInteraction();\n }\n this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.timeout_);\n view.adjustZoom(-delta / this.deltaPerZoom_, 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.deltaPerZoom_, this.maxDelta_ * this.deltaPerZoom_) / this.deltaPerZoom_;\n if (view.getConstrainResolution()) {\n // view has a zoom constraint, zoom by 1\n delta = delta ? delta > 0 ? 1 : -1 : 0;\n }\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 BaseObject from '../Object.js';\nimport EventTarget from '../events/Target.js';\nimport { WORKER_OFFSCREEN_CANVAS } from '../has.js';\nimport { toString } from '../transform.js';\n/**\n * @typedef {Object} FillState\n * @property {import(\"../colorlike.js\").ColorLike} fillStyle\n */\n/**\n * @typedef Label\n * @property {number} width\n * @property {number} height\n * @property {Array<string|number>} contextInstructions\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 * @type {BaseObject}\n */\nexport var checkedFonts = new BaseObject();\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 * Deprecated - there is no label cache any more.\n * @type {?}\n * @api\n * @deprecated\n */\nexport var labelCache = new EventTarget();\nlabelCache.setSize = function () {\n console.warn('labelCache is deprecated.'); //eslint-disable-line\n};\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 registerFont = (function () {\n var retries = 100;\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 available = true;\n for (var i = 0; i < len; ++i) {\n var referenceFont = referenceFonts[i];\n referenceWidth = measureTextWidth(fontStyle + ' ' + fontWeight + ' ' + size + referenceFont, text);\n if (fontFamily != referenceFont) {\n var width = measureTextWidth(fontStyle + ' ' + fontWeight + ' ' + size + fontFamily + ',' + referenceFont, text);\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 var fonts = checkedFonts.getKeys();\n for (var i = 0, ii = fonts.length; i < ii; ++i) {\n var font = fonts[i];\n if (checkedFonts.get(font) < retries) {\n if (isAvailable.apply(this, font.split('\\n'))) {\n clear(textHeights);\n // Make sure that loaded fonts are picked up by Safari\n measureContext = null;\n measureFont = undefined;\n checkedFonts.set(font, retries);\n }\n else {\n checkedFonts.set(font, checkedFonts.get(font) + 1, true);\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 (checkedFonts.get(key) === undefined) {\n checkedFonts.set(key, retries, true);\n if (!isAvailable(font.style, font.weight, family)) {\n checkedFonts.set(key, 0, true);\n if (interval === undefined) {\n interval = setInterval(check, 32);\n }\n }\n }\n }\n };\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 (fontSpec) {\n var height = heights[fontSpec];\n if (height == undefined) {\n if (WORKER_OFFSCREEN_CANVAS) {\n var font = getFontParameters(fontSpec);\n var metrics = measureText(fontSpec, 'Žg');\n var lineHeight = isNaN(Number(font.lineHeight)) ? 1.2 : Number(font.lineHeight);\n textHeights[fontSpec] = lineHeight * (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent);\n }\n else {\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 = fontSpec;\n document.body.appendChild(div);\n height = div.offsetHeight;\n heights[fontSpec] = height;\n document.body.removeChild(div);\n }\n }\n return height;\n };\n})();\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {TextMetrics} Text metrics.\n */\nfunction measureText(font, text) {\n if (!measureContext) {\n measureContext = createCanvasContext2D(1, 1);\n }\n if (font != measureFont) {\n measureContext.font = font;\n measureFont = measureContext.font;\n }\n return measureContext.measureText(text);\n}\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {number} Width.\n */\nexport function measureTextWidth(font, text) {\n return measureText(font, 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}\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../transform.js\").Transform|null} transform Transform.\n * @param {number} opacity Opacity.\n * @param {Label|HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} labelOrImage Label.\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 drawImageOrLabel(context, transform, opacity, labelOrImage, originX, originY, w, h, x, y, scale) {\n context.save();\n if (opacity !== 1) {\n context.globalAlpha *= opacity;\n }\n if (transform) {\n context.setTransform.apply(context, transform);\n }\n if (( /** @type {*} */(labelOrImage).contextInstructions)) {\n // label\n context.translate(x, y);\n context.scale(scale, scale);\n executeLabelInstructions(/** @type {Label} */ (labelOrImage), context);\n }\n else {\n // image\n context.drawImage(/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage), originX, originY, w, h, x, y, w * scale, h * scale);\n }\n context.restore();\n}\n/**\n * @param {Label} label Label.\n * @param {CanvasRenderingContext2D} context Context.\n */\nfunction executeLabelInstructions(label, context) {\n var contextInstructions = label.contextInstructions;\n for (var i = 0, ii = contextInstructions.length; i < ii; i += 2) {\n if (Array.isArray(contextInstructions[i + 1])) {\n context[contextInstructions[i]].apply(context, contextInstructions[i + 1]);\n }\n else {\n context[contextInstructions[i]] = contextInstructions[i + 1];\n }\n }\n}\n/**\n * @type {HTMLCanvasElement}\n * @private\n */\nvar createTransformStringCanvas = null;\n/**\n * @param {import(\"../transform.js\").Transform} transform Transform.\n * @return {string} CSS transform.\n */\nexport function createTransformString(transform) {\n if (WORKER_OFFSCREEN_CANVAS) {\n return toString(transform);\n }\n else {\n if (!createTransformStringCanvas) {\n createTransformStringCanvas = createCanvasContext2D(1, 1).canvas;\n }\n createTransformStringCanvas.style.transform = toString(transform);\n return createTransformStringCanvas.style.transform;\n }\n}\n//# sourceMappingURL=canvas.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';\nimport { wrapX } from '../coordinate.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 = wrapX(coordinate.slice(), projection);\n var offsets = [[0, 0]];\n if (projection.canWrapX() && checkWrapped) {\n var projectionExtent = projection.getExtent();\n var worldWidth = getWidth(projectionExtent);\n offsets.push([-worldWidth, 0], [worldWidth, 0]);\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 { listen, unlistenByKey } from '../events.js';\nimport { checkedFonts } from '../render/canvas.js';\nimport ObjectEventType from '../ObjectEventType.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.fontChangeListenerKey_ = listen(checkedFonts, ObjectEventType.PROPERTYCHANGE, 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.fontChangeListenerKey_);\n this.element_.parentNode.removeChild(this.element_);\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 {PanIntoViewOptions|boolean} [autoPan=false] Pan the map when calling\n * `setPosition`, so that the overlay is entirely visible in the current viewport?\n * If `true` (deprecated), then `autoPanAnimation` and `autoPanMargin` will be\n * used to determine the panning parameters; if an object is supplied then other\n * parameters are ignored.\n * @property {PanOptions} [autoPanAnimation] The animation options used to pan\n * the overlay into view. This animation is only used when `autoPan` is enabled.\n * A `duration` and `easing` may be provided to customize the animation.\n * Deprecated and ignored if `autoPan` is supplied as an object.\n * @property {number} [autoPanMargin=20] The margin (in pixels) between the\n * overlay and the borders of the map when autopanning. Deprecated and ignored\n * if `autoPan` is supplied as an object.\n * @property {PanIntoViewOptions} [autoPanOptions] The options to use for the\n * autoPan. This is only used when `autoPan` is enabled and has preference over\n * the individual `autoPanMargin` and `autoPanOptions`.\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 * @typedef {Object} PanIntoViewOptions\n * @property {PanOptions} [animation={}] The animation parameters for the pan\n * @property {number} [margin=20] The margin (in pixels) between the\n * overlay and the borders of the map when panning into view.\n */\n/**\n * @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 var autoPan = options.autoPan;\n if (autoPan && ('object' !== typeof autoPan)) {\n autoPan = {\n animation: options.autoPanAnimation,\n margin: options.autoPanMargin\n };\n }\n /**\n * @protected\n * @type {PanIntoViewOptions|false}\n */\n _this.autoPan = /** @type {PanIntoViewOptions} */ (autoPan) || false;\n /**\n * @protected\n * @type {{transform_: string,\n * visible: boolean}}\n */\n _this.rendered = {\n transform_: '',\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 this.performAutoPan();\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 this.performAutoPan();\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 visisble in the current viewport\n * (if necessary) using the configured autoPan parameters\n * @protected\n */\n Overlay.prototype.performAutoPan = function () {\n if (this.autoPan) {\n this.panIntoView(this.autoPan);\n }\n };\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary).\n * @param {PanIntoViewOptions|undefined} panIntoViewOptions Options for the pan action\n * @api\n */\n Overlay.prototype.panIntoView = function (panIntoViewOptions) {\n var map = this.getMap();\n if (!map || !map.getTargetElement() || !this.get(Property.POSITION)) {\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 myMargin = (panIntoViewOptions.margin === undefined) ? 20 : panIntoViewOptions.margin;\n if (!containsExtent(mapRect, overlayRect)) {\n // the overlay is not completely inside the viewport, so pan the map\n 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 - myMargin;\n }\n else if (offsetRight < 0) {\n // move map to the right\n delta[0] = Math.abs(offsetRight) + myMargin;\n }\n if (offsetTop < 0) {\n // move map up\n delta[1] = offsetTop - myMargin;\n }\n else if (offsetBottom < 0) {\n // move map down\n delta[1] = Math.abs(offsetBottom) + myMargin;\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 var panOptions = panIntoViewOptions.animation || {};\n map.getView().animateInternal({\n center: map.getCoordinateFromPixelInternal(newCenterPx),\n duration: panOptions.duration,\n easing: panOptions.easing\n });\n }\n }\n };\n /**\n * 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 x = Math.round(pixel[0] + offset[0]) + 'px';\n var y = Math.round(pixel[1] + offset[1]) + 'px';\n var posX = '0%';\n var posY = '0%';\n if (positioning == OverlayPositioning.BOTTOM_RIGHT ||\n positioning == OverlayPositioning.CENTER_RIGHT ||\n positioning == OverlayPositioning.TOP_RIGHT) {\n posX = '-100%';\n }\n else if (positioning == OverlayPositioning.BOTTOM_CENTER ||\n positioning == OverlayPositioning.CENTER_CENTER ||\n positioning == OverlayPositioning.TOP_CENTER) {\n posX = '-50%';\n }\n if (positioning == OverlayPositioning.BOTTOM_LEFT ||\n positioning == OverlayPositioning.BOTTOM_CENTER ||\n positioning == OverlayPositioning.BOTTOM_RIGHT) {\n posY = '-100%';\n }\n else if (positioning == OverlayPositioning.CENTER_LEFT ||\n positioning == OverlayPositioning.CENTER_CENTER ||\n positioning == OverlayPositioning.CENTER_RIGHT) {\n posY = '-50%';\n }\n var transform = \"translate(\" + posX + \", \" + posY + \") translate(\" + x + \", \" + y + \")\";\n if (this.rendered.transform_ != transform) {\n this.rendered.transform_ = transform;\n style.transform = transform;\n // @ts-ignore IE9\n style.msTransform = transform;\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 downwards. 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 downwards. 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] Number of tile rows and columns\n * of the grid for each zoom level. If specified the values\n * define each zoom level's extent together with the `origin` or `origins`.\n * A grid `extent` can be configured in addition, and will further limit the extent\n * for which tile requests are made by sources. If the bottom-left corner of\n * an 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 * 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. If `maxResolution` is not provided the zero level of the grid is defined by the resolution\n * at which one tile fits in the provided extent. If not provided, the extent of the EPSG:3857 projection is used.\n * @property {number} [maxResolution] Resolution at level zero.\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, xyzOptions.maxResolution)\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 * @param {number=} opt_maxResolution Resolution at level zero.\n * @return {!Array<number>} Resolutions array.\n */\nfunction resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize, opt_maxResolution) {\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 = opt_maxResolution > 0 ? opt_maxResolution :\n 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 * @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 getDocument().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}\nvar xmlSerializer_ = undefined;\n/**\n * Register a XMLSerializer. Can be used to inject a XMLSerializer\n * where there is no globally available implementation.\n *\n * @param {XMLSerializer} xmlSerializer A XMLSerializer.\n * @api\n */\nexport function registerXMLSerializer(xmlSerializer) {\n xmlSerializer_ = xmlSerializer;\n}\n/**\n * @return {XMLSerializer} The XMLSerializer.\n */\nexport function getXMLSerializer() {\n if (xmlSerializer_ === undefined && typeof XMLSerializer !== 'undefined') {\n xmlSerializer_ = new XMLSerializer();\n }\n return xmlSerializer_;\n}\nvar document_ = undefined;\n/**\n * Register a Document to use when creating nodes for XML serializations. Can be used\n * to inject a Document where there is no globally available implementation.\n *\n * @param {Document} document A Document.\n * @api\n */\nexport function registerDocument(document) {\n document_ = document;\n}\n/**\n * Get a document that should be used when creating nodes for XML serializations.\n * @return {Document} The document.\n */\nexport function getDocument() {\n if (document_ === undefined && typeof document !== 'undefined') {\n document_ = document.implementation.createDocument('', '', null);\n }\n return document_;\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 \\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 *\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 textureSize = [\n gl.drawingBufferWidth * this.scaleRatio_,\n gl.drawingBufferHeight * this.scaleRatio_\n ];\n // rendering goes to my buffer\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.getFrameBuffer());\n gl.viewport(0, 0, textureSize[0], textureSize[1]);\n // if size has changed: adjust canvas & render target texture\n if (!this.renderTargetTextureSize_ ||\n this.renderTargetTextureSize_[0] !== textureSize[0] || this.renderTargetTextureSize_[1] !== textureSize[1]) {\n this.renderTargetTextureSize_ = textureSize;\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, textureSize[0], textureSize[1], 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 size = frameState.size;\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, gl.drawingBufferWidth, gl.drawingBufferHeight);\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_, size[0], size[1]);\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.prevValue = undefined;\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 && uniform.prevValue !== value) {\n uniform.prevValue = value;\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 downwards. 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 downwards. 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 each zoom level's extent together with the `origin` or `origins`.\n * A grid `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 * an 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 */\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 * @property {Array<number>} displacement\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 * @private\n * @type {Array<number>}\n */\n this.displacement_ = options.displacement;\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 displacement: this.getDisplacement().slice()\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 displacement of the shape\n * @return {Array<number>} Shape's center displacement\n * @api\n */\n ImageStyle.prototype.getDisplacement = function () {\n return this.displacement_;\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 {Array<number>} [displacement=[0,0]] Displacement of the shape\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 displacement: options.displacement !== undefined ? options.displacement : [0, 0]\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 displacement: this.getDisplacement().slice()\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 var displacement = this.getDisplacement();\n this.draw_(renderOptions, context, 0, 0);\n this.createHitDetectionCanvas_(renderOptions);\n this.anchor_ = [size / 2 - displacement[0], size / 2 + displacement[1]];\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 * @property {Array<number>} [displacement=[0,0]] displacement\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 displacement: options.displacement !== undefined ? options.displacement : [0, 0]\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 displacement: this.getDisplacement().slice()\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 /**\n * Anchor is a fraction\n * @api\n */\n FRACTION: 'fraction',\n /**\n * Anchor is in pixels\n * @api\n */\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 * @param {CanvasRenderingContext2D=} context A context with the image already drawn into.\n * @return {boolean} The image canvas is tainted.\n */\n IconImage.prototype.isTainted_ = function (context) {\n if (this.tainted_ === undefined && this.imageState_ === ImageState.LOADED) {\n if (!context) {\n context = createCanvasContext2D(1, 1);\n context.drawImage(this.image_, 0, 0);\n }\n try {\n context.getImageData(0, 0, 1, 1);\n this.tainted_ = false;\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_) {\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 if (this.isTainted_(ctx)) {\n // If reading from the canvas throws a SecurityError the same effect can be\n // achieved with globalCompositeOperation.\n // This could be used as the default, but it is not fully supported by all\n // browsers. E. g. Internet Explorer 11 does not support the multiply\n // operation and the resulting image shape will be completelly filled with\n // the provided color.\n // So this is only used as a fallback. It is still better than having no icon\n // at all.\n var c = this.color_;\n ctx.globalCompositeOperation = 'multiply';\n ctx.fillStyle = 'rgb(' + c[0] + ',' + c[1] + ',' + c[2] + ')';\n ctx.fillRect(0, 0, this.image_.width, this.image_.height);\n ctx.globalCompositeOperation = 'destination-in';\n ctx.drawImage(this.image_, 0, 0);\n return;\n }\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 /**\n * Origin is at bottom left\n * @api\n */\n BOTTOM_LEFT: 'bottom-left',\n /**\n * Origin is at bottom right\n * @api\n */\n BOTTOM_RIGHT: 'bottom-right',\n /**\n * Origin is at top left\n * @api\n */\n TOP_LEFT: 'top-left',\n /**\n * Origin is at top right\n * @api\n */\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 {Array<number>} [displacement=[0,0]] Displacement the icon\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 displacement: options.displacement !== undefined ? options.displacement : [0, 0],\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 var displacement = this.getDisplacement();\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 offset[0] += displacement[0];\n offset[1] += displacement[1];\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 `null` (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. If the function returns `undefined`, the\n * feature will not be rendered.\n *\n * @typedef {function(import(\"../Feature.js\").FeatureLike, number):(Style|Array<Style>|void)} 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 * Called by the tile cache when the tile is removed from the cache due to expiry\n */\n Tile.prototype.release = function () {\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 * 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","/**\n * @module ol/structs/LRUCache\n */\nimport { assert } from '../asserts.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 () {\n /**\n * @param {number=} opt_highWaterMark High water mark.\n */\n function LRUCache(opt_highWaterMark) {\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 }\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 };\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}());\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})();\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 function TileCache() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {!Object<string, boolean>} 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().release();\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.release();\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, getArea, 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 * @param {?number} opt_destinationResolution The (optional) resolution of the destination.\n */\n function Triangulation(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold, opt_destinationResolution) {\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 /*\n * The maxSubdivision controls how many splittings of the target area can\n * be done. The idea here is to do a linear mapping of the target areas\n * but the actual overal reprojection (can be) extremely non-linear. The\n * default value of MAX_SUBDIVISION was chosen based on mapping a 256x256\n * tile size. However this function is also called to remap canvas rendered\n * layers which can be much larger. This calculation increases the maxSubdivision\n * value by the right factor so that each 256x256 pixel area has\n * MAX_SUBDIVISION divisions.\n */\n var maxSubdivision = MAX_SUBDIVISION + (opt_destinationResolution ?\n Math.max(0, Math.ceil(Math.log2(getArea(targetExtent) /\n (opt_destinationResolution * opt_destinationResolution * 256 * 256))))\n : 0);\n this.addQuad_(destinationTopLeft, destinationTopRight, destinationBottomRight, destinationBottomLeft, sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, maxSubdivision);\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, targetResolution);\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 * 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 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 var minCacheSize = 4 * Math.ceil(width / tileSize[0]) * Math.ceil(height / tileSize[1]);\n /**\n * @protected\n * @type {import(\"../TileCache.js\").default}\n */\n _this.tileCache = new TileCache(Math.max(minCacheSize, options.cacheSize || 0));\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, boolean>} 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 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 ?\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 be ignored 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 be ignored 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 be ignored 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=42] Optional max zoom level. Not used if `tileGrid` is provided.\n * @property {number} [minZoom=0] Optional min zoom level. Not used if `tileGrid` is provided.\n * @property {number} [maxResolution] Optional tile grid resolution at level zero. Not used if `tileGrid` is provided.\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 * Not used if `tileGrid` is provided.\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 maxResolution: options.maxResolution,\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 be ignored 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/rbush.js';\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 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 *\n * If the instance is disposed without also disposing the underlying\n * source `setSource(null)` has to be called to remove the listener reference\n * from the wrapped source.\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 _this.boundRefresh_ = _this.refresh.bind(_this);\n _this.setSource(options.source || null);\n return _this;\n }\n /**\n * @override\n */\n Cluster.prototype.clear = function (opt_fast) {\n this.features.length = 0;\n _super.prototype.clear.call(this, opt_fast);\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 * Replace the wrapped source.\n * @param {VectorSource} source The new source for this instance.\n * @api\n */\n Cluster.prototype.setSource = function (source) {\n if (this.source) {\n this.source.removeEventListener(EventType.CHANGE, this.boundRefresh_);\n }\n this.source = source;\n if (source) {\n source.addEventListener(EventType.CHANGE, this.boundRefresh_);\n }\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 || !this.source) {\n return;\n }\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 { toSize } from '../size.js';\nimport TileImage from './TileImage.js';\nimport TileGrid from '../tilegrid/TileGrid.js';\nimport { getCenter } from '../extent.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 {import(\"../size.js\").Size} tileSize Full tile size.\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(tileSize, 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 * @type {import(\"../size.js\").Size}\n */\n _this.tileSize_ = tileSize;\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 be ignored 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\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] Indicate 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 */\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 tilePixelRatio = options.tilePixelRatio || 1;\n var imageWidth = size[0];\n var imageHeight = size[1];\n var tierSizeInTiles = [];\n var tileSize = options.tileSize || DEFAULT_TILE_SIZE;\n var tileSizeForTierSizeCalculation = tileSize * tilePixelRatio;\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 = [tilePixelRatio];\n var tileCountUpToTier = [0];\n for (var i = 1, ii = tierSizeInTiles.length; i < ii; i++) {\n resolutions.push(tilePixelRatio << 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: options.extent || [0, -imageHeight, imageWidth, 0],\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 var tileWidth = tileSize * tilePixelRatio;\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 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, toSize(tileSize * tilePixelRatio));\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 // Server retina tile detection (non-standard):\n // Try loading the center tile for the highest resolution. If it is not\n // available, we are dealing with retina tiles, and need to adjust the\n // tile url calculation.\n var tileUrl = tileGrid.getTileCoordForCoordAndResolution(getCenter(tileGrid.getExtent()), resolutions[resolutions.length - 1]);\n var testTileUrl = tileUrlFunction(tileUrl, 1, null);\n var image = new Image();\n image.addEventListener('error', function () {\n tileWidth = tileSize;\n this.changed();\n }.bind(_this));\n image.src = testTileUrl;\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';\nimport { toSize } from '../size.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, toSize(tileSize || 256).map(function (size) {\n return size * tilePixelRatio;\n }));\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, targetResolution);\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 */\nexport var 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. Default is the view 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. Default is the view 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. Default is the view 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/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/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/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 = '&#169; ' +\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 be ignored 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 {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 {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 } 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 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 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';\nimport { createTransformString } from '../../render/canvas.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 if (imageSource) {\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 else {\n this.image_ = null;\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 = 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} [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 {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';\nimport { createTransformString } from '../../render/canvas.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 = 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.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 * 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 be ignored 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 be ignored 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 be ignored 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 be ignored 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.EMPTY && opt_request === true) {\n this.state = TileState.IDLE;\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.LOADED;\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 else {\n this.setState(TileState.EMPTY);\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` (lazy loading), you need to pass `true` as\n * `opt_request` to the `forDataAtCoordinateAndResolution` method otherwise no\n * data 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';\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 */\n/**\n * @type {Array<HTMLCanvasElement>}\n */\nvar canvasPool = [];\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 {function(VectorRenderTile):Array<import(\"./VectorTile\").default>} getSourceTiles Function\n * to get source tiles for this tile.\n */\n function VectorRenderTile(tileCoord, state, urlTileCoord, getSourceTiles) {\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 {Object<number, ImageData>}\n */\n _this.hitDetectionImageData = {};\n /**\n * @private\n * @type {!Object<string, ReplayState>}\n */\n _this.replayState_ = {};\n /**\n * @type {Array<import(\"./VectorTile.js\").default>}\n */\n _this.sourceTiles = null;\n /**\n * @type {number}\n */\n _this.wantedResolution;\n /**\n * @type {!function():Array<import(\"./VectorTile.js\").default>}\n */\n _this.getSourceTiles = getSourceTiles.bind(undefined, _this);\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 * @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(1, 1, canvasPool);\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 /**\n * @inheritDoc\n */\n VectorRenderTile.prototype.release = function () {\n for (var key in this.context_) {\n canvasPool.push(this.context_[key].canvas);\n }\n _super.prototype.release.call(this);\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 * 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 if (this.loader_) {\n this.loader_(this.extent, this.resolution, this.projection);\n }\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, fromKey } 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 } from '../array.js';\nimport TileCache from '../TileCache.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. Not used if `tileGrid` is provided.\n * @property {number} [minZoom] Optional min zoom level. Not used if `tileGrid` is provided.\n * @property {number|import(\"../size.js\").Size} [tileSize=512] Optional tile size. Not used if `tileGrid` is provided.\n * @property {number} [maxResolution] Optional tile grid resolution at level zero. Not used if `tileGrid` is provided.\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 * If you do not need extent, resolution and projection to get the features for a tile (e.g.\n * for GeoJSON tiles), your `tileLoadFunction` does not need a `setLoader()` call. Only make sure\n * to call `setFeatures()` on the tile:\n * ```js\n * const format = new GeoJSON({featureProjection: map.getView().getProjection()});\n * async function tileLoadFunction(tile, url) {\n * const response = await fetch(url);\n * const data = await response.json();\n * tile.setFeatures(format.readFeatures(data));\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 maxResolution: options.maxResolution,\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 {TileCache}\n */\n _this.sourceTileCache = new TileCache(_this.tileCache.highWaterMark);\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 * Get features whose bounding box intersects the provided extent. Only features for cached\n * tiles for the last rendered zoom level are available in the source. So this method is only\n * suitable for requesting tiles for extents that are currently rendered.\n *\n * Features are returned in random tile order and as they are included in the tiles. This means\n * they can be clipped, duplicated across tiles, and simplified to the render resolution.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {Array<import(\"../Feature.js\").FeatureLike>} Features.\n * @api\n */\n VectorTile.prototype.getFeaturesInExtent = function (extent) {\n var features = [];\n var tileCache = this.tileCache;\n if (tileCache.getCount() === 0) {\n return features;\n }\n var z = fromKey(tileCache.peekFirstKey())[0];\n var tileGrid = this.tileGrid;\n tileCache.forEach(function (tile) {\n if (tile.tileCoord[0] !== z || tile.getState() !== TileState.LOADED) {\n return;\n }\n var sourceTiles = tile.getSourceTiles();\n for (var i = 0, ii = sourceTiles.length; i < ii; ++i) {\n var sourceTile = sourceTiles[i];\n var tileCoord = sourceTile.tileCoord;\n if (intersects(extent, tileGrid.getTileCoordExtent(tileCoord))) {\n var tileFeatures = sourceTile.getFeatures();\n if (tileFeatures) {\n for (var j = 0, jj = tileFeatures.length; j < jj; ++j) {\n var candidate = tileFeatures[j];\n var geometry = candidate.getGeometry();\n if (intersects(extent, geometry.getExtent())) {\n features.push(candidate);\n }\n }\n }\n }\n }\n });\n return features;\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.sourceTileCache.clear();\n };\n /**\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @param {!Object<string, boolean>} usedTiles Used tiles.\n */\n VectorTile.prototype.expireCache = function (projection, usedTiles) {\n _super.prototype.expireCache.call(this, projection, usedTiles);\n this.sourceTileCache.expireCache({});\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 = tile.sourceTiles;\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 tileUrl = this.tileUrlFunction(sourceTileCoord, pixelRatio, projection);\n var sourceTile;\n if (tileUrl !== undefined) {\n if (this.sourceTileCache.containsKey(tileUrl)) {\n sourceTile = this.sourceTileCache.get(tileUrl);\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 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.sourceTileCache.set(tileUrl, sourceTile);\n sourceTile.addEventListener(EventType.CHANGE, this.handleTileChange.bind(this));\n sourceTile.load();\n }\n }\n covered = covered && sourceTile && sourceTile.getState() === TileState.LOADED;\n if (!sourceTile) {\n return;\n }\n if (sourceTile.getState() !== TileState.EMPTY && tile.getState() === TileState.IDLE) {\n tile.loadingSourceTiles++;\n sourceTile.addEventListener(EventType.CHANGE, function listenChange() {\n var state = sourceTile.getState();\n var sourceTileKey = sourceTile.getKey();\n if (state === TileState.LOADED || state === TileState.ERROR) {\n if (state === TileState.LOADED) {\n sourceTile.removeEventListener(EventType.CHANGE, listenChange);\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 }\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 tile.sourceTiles = sourceTiles;\n }\n }\n return sourceTiles;\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.getSourceTiles.bind(this, pixelRatio, projection));\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 { assign } from '../obj.js';\nimport { get as getProjection, equivalent } 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 be ignored 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 OGC 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 wrapX = false;\n var matrix0 = matrixSetObj.TileMatrix[0];\n var resolution = matrix0.ScaleDenominator * 0.00028; // WMTS 1.0.0: standardized rendering pixel size\n var origin = projection === getProjection('EPSG:4326')\n ? [matrix0.TopLeftCorner[1], matrix0.TopLeftCorner[0]]\n : matrix0.TopLeftCorner;\n var tileSpanX = matrix0.TileWidth * resolution;\n var tileSpanY = matrix0.TileHeight * resolution;\n var extent = [\n origin[0],\n origin[1] - tileSpanY * matrix0.MatrixHeight,\n origin[0] + tileSpanX * matrix0.MatrixWidth,\n origin[1]\n ];\n if (projection.getExtent() === null) {\n projection.setExtent(extent);\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 {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 {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 /**\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 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 listen(source, VectorEventType.CLEAR, _this.handleSourceFeatureClear_, _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 * @private\n */\n WebGLPointsLayerRenderer.prototype.handleSourceFeatureClear_ = function () {\n this.featureCache_ = {};\n this.featureCount_ = 0;\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 { defaultTextAlign, defaultPadding, defaultLineCap, defaultLineDashOffset, defaultLineDash, defaultLineJoin, defaultFillStyle, registerFont, 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 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 registerFont(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 || '?') + (textState.textBaseline || '?');\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","/**\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 { drawImageOrLabel, 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 { defaultTextAlign, measureTextHeight, measureAndCacheTextWidth, measureTextWidths } from '../canvas.js';\nimport RBush from 'rbush/rbush.js';\nimport { WORKER_OFFSCREEN_CANVAS } from '../../has.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 */\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 () {\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 /**\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 /**\n * @private\n * @type {Object<string, import(\"../canvas.js\").Label>}\n */\n this.labels_ = {};\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 {import(\"../canvas.js\").Label} Label.\n */\n Executor.prototype.createLabel = function (text, textKey, fillKey, strokeKey) {\n var key = text + textKey + fillKey + strokeKey;\n if (this.labels_[key]) {\n return this.labels_[key];\n }\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 contextInstructions = [];\n /** @type {import(\"../canvas.js\").Label} */\n var label = {\n // make canvas 2 pixels wider to account for italic text width measurement errors\n width: Math.ceil((renderWidth + 2) * scale),\n height: Math.ceil((height + strokeWidth) * scale),\n contextInstructions: contextInstructions\n };\n if (scale != 1) {\n contextInstructions.push('scale', [scale, scale]);\n }\n contextInstructions.push('font', textState.font);\n if (strokeKey) {\n contextInstructions.push('strokeStyle', strokeState.strokeStyle);\n contextInstructions.push('lineWidth', strokeWidth);\n contextInstructions.push('lineCap', strokeState.lineCap);\n contextInstructions.push('lineJoin', strokeState.lineJoin);\n contextInstructions.push('miterLimit', strokeState.miterLimit);\n // eslint-disable-next-line\n var Context = WORKER_OFFSCREEN_CANVAS ? OffscreenCanvasRenderingContext2D : CanvasRenderingContext2D;\n if (Context.prototype.setLineDash) {\n contextInstructions.push('setLineDash', [strokeState.lineDash]);\n contextInstructions.push('lineDashOffset', strokeState.lineDashOffset);\n }\n }\n if (fillKey) {\n contextInstructions.push('fillStyle', fillState.fillStyle);\n }\n contextInstructions.push('textBaseline', 'middle');\n contextInstructions.push('textAlign', 'center');\n var leftRight = (0.5 - align);\n var x = align * renderWidth + leftRight * strokeWidth;\n var i;\n if (strokeKey) {\n for (i = 0; i < numLines; ++i) {\n contextInstructions.push('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 contextInstructions.push('fillText', [lines[i], x + leftRight * widths[i], 0.5 * (strokeWidth + lineHeight) + i * lineHeight]);\n }\n }\n this.labels_[key] = label;\n return label;\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 {import(\"../canvas.js\").Label|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} imageOrLabel 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.replayImageOrLabel_ = function (context, x, y, imageOrLabel, 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 > imageOrLabel.width) ? imageOrLabel.width - originX : width;\n var h = (height + originY > imageOrLabel.height) ? imageOrLabel.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, imageOrLabel, originX, originY, w, h, x, y, scale] :\n null;\n if (declutterArgs) {\n if (fillStroke) {\n declutterArgs.push(fillInstruction, strokeInstruction, p1.slice(0), p2.slice(0), p3.slice(0), p4.slice(0));\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 drawImageOrLabel(context, transform, opacity, imageOrLabel, 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 drawImageOrLabel.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: import(\"../canvas.js\").Label, anchorX: number, anchorY: number}} The text image and its anchor.\n */\n Executor.prototype.drawLabelWithPointPlacement_ = function (text, textKey, strokeKey, fillKey) {\n var textState = this.textStates[textKey];\n var label = this.createLabel(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 createLabel() 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.drawLabelWithPointPlacement_(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.replayImageOrLabel_(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.createLabel(chars, textKey, '', strokeKey);\n anchorX = /** @type {number} */ (part[2]) + strokeWidth;\n anchorY = baseline * label.height + (0.5 - baseline) * 2 * strokeWidth - offsetY;\n this.replayImageOrLabel_(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.createLabel(chars, textKey, fillKey, '');\n anchorX = /** @type {number} */ (part[2]);\n anchorY = baseline * label.height - offsetY;\n this.replayImageOrLabel_(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}());\nexport default Executor;\n//# sourceMappingURL=Executor.js.map","/**\n * @module ol/render/canvas/ExecutorGroup\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';\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 () {\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 /**\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 }\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 * @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}());\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.floor((256 * 256 * 256 - 1) / featureCount);\n var featuresByZIndex = {};\n for (var i = 1; i <= featureCount; ++i) {\n var feature = features[i - 1];\n var featureStyleFunction = feature.getStyleFunction() || styleFunction;\n if (!styleFunction) {\n continue;\n }\n var styles = featureStyleFunction(feature, resolution);\n if (!styles) {\n continue;\n }\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 if (!imgSize) {\n continue;\n }\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 document.body.appendChild(context.canvas);\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.floor((256 * 256 * 256 - 1) / features.length);\n if (i && i % indexFactor === 0) {\n resultFeatures.push(features[i / indexFactor - 1]);\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, wrapX as wrapExtentX } from '../../extent.js';\nimport { wrapX as wrapCoordinateX } from '../../coordinate.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 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 }\n resolve(hitDetect(pixel, this.renderedFeatures_, this.hitDetectionImageData_));\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 if (!vectorSource) {\n return false;\n }\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 loadExtents = [extent.slice()];\n var projectionExtent = projection.getExtent();\n if (vectorSource.getWrapX() && 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 wrapCoordinateX(center, projection);\n var loadExtent = wrapExtentX(loadExtents[0], projection);\n // If the extent crosses the date line, we load data for both edges of the worlds\n if (loadExtent[0] < projectionExtent[0] && loadExtent[2] < projectionExtent[2]) {\n loadExtents.push([loadExtent[0] + worldWidth, loadExtent[1], loadExtent[2] + worldWidth, loadExtent[3]]);\n }\n else if (loadExtent[0] > projectionExtent[0] && loadExtent[2] > projectionExtent[2]) {\n loadExtents.push([loadExtent[0] - worldWidth, loadExtent[1], loadExtent[2] - worldWidth, loadExtent[3]]);\n }\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 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 for (var i = 0, ii = loadExtents.length; i < ii; ++i) {\n vectorSource.loadFeatures(toUserExtent(loadExtents[i], projection), resolution, userProjection);\n }\n userTransform = getTransformFromProjections(userProjection, projection);\n }\n else {\n for (var i = 0, ii = loadExtents.length; i < ii; ++i) {\n vectorSource.loadFeatures(loadExtents[i], resolution, projection);\n }\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 extent: renderedExtent,\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 * * `'vector'`: Everything is rendered as vectors. Use this mode for improved\n * performance on vector tile layers with only a few rendered features (e.g.\n * for highlighting a subset of features of another layer with the same\n * source).\n * @api\n */\nexport default {\n IMAGE: 'image',\n HYBRID: 'hybrid',\n VECTOR: 'vector'\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, 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';\nimport { wrapX } from '../../coordinate.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 'vector': []\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 'vector': [ReplayType.POLYGON, ReplayType.CIRCLE, ReplayType.LINE_STRING, 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) || state === TileState.ERROR) &&\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 pixelRatio = frameState.pixelRatio;\n var viewState = frameState.viewState;\n var resolution = viewState.resolution;\n var projection = viewState.projection;\n var layer = this.getLayer();\n var tile = layer.getSource().getTile(z, x, y, pixelRatio, 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 && layer.getRenderMode() !== VectorTileRenderType.VECTOR) {\n this.renderTileImage_(tile, frameState);\n }\n }\n return _super.prototype.getTile.call(this, z, x, y, frameState);\n };\n /**\n * @inheritdoc\n */\n CanvasVectorTileLayerRenderer.prototype.isDrawableTile = function (tile) {\n var layer = this.getLayer();\n return _super.prototype.isDrawableTile.call(this, tile) && layer.getRenderMode() === VectorTileRenderType.VECTOR || tile.hasContext(layer);\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 delete tile.hitDetectionImageData[layerUid];\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.getRenderMode() !== VectorTileRenderType.VECTOR && 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 layerUid = getUid(layer);\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 wrapX(coordinate, projection);\n }\n break;\n }\n tile = undefined;\n }\n }\n if (!tile || tile.loadingSourceTiles > 0) {\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 var hitDetectionImageData = tile.hitDetectionImageData[layerUid];\n if (!hitDetectionImageData && !this.animatingOrInteracting_) {\n var tileSize = toSize(tileGrid.getTileSize(tileGrid.getZForResolution(resolution)));\n var size = [tileSize[0] / 2, tileSize[1] / 2];\n var rotation = this.renderedRotation_;\n var transforms = [\n this.getRenderTransform(tileGrid.getTileCoordCenter(tile.wrappedTileCoord), resolution, 0, 0.5, size[0], size[1], 0)\n ];\n hitDetectionImageData = createHitDetectionImageData(tileSize, transforms, features, layer.getStyleFunction(), tileGrid.getTileCoordExtent(tile.wrappedTileCoord), tile.getReplayState(layer).renderedResolution, rotation);\n tile.hitDetectionImageData[layerUid] = hitDetectionImageData;\n }\n resolve(hitDetect(tilePixel, features, hitDetectionImageData));\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 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 } from '../proj.js';\nimport { applyTransform, containsCoordinate, containsExtent, equals, approximatelyEquals, getCenter, getHeight, getIntersection, getWidth, intersects, isEmpty, wrapX as wrapExtentX } from '../extent.js';\nimport { clamp } from '../math.js';\nimport Style from '../style/Style.js';\nimport Feature from '../Feature.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';\nimport { getVectorContext } from '../render.js';\nimport EventType from '../render/EventType.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} [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 {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 (currently only EPSG:4326 is supported).\n * Note that the view projection must define both extent and worldExtent.\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.maxX_ = Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.maxY_ = Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.minX_ = -Infinity;\n /**\n * @type {number}\n * @private\n */\n _this.minY_ = -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 {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.bottomLeft_ = null;\n /**\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.bottomRight_ = null;\n /**\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.topLeft_ = null;\n /**\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.topRight_ = 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 _this.addEventListener(EventType.POSTRENDER, _this.drawLabels_.bind(_this));\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: _this.strategyFunction.bind(_this),\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 * @private\n */\n _this.loadedExtent_ = null;\n /**\n * @type {?import(\"../extent.js\").Extent}\n */\n _this.renderedExtent_ = null;\n _this.setRenderOrder(null);\n return _this;\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 */\n Graticule.prototype.strategyFunction = function (extent, resolution) {\n // extents may be passed in different worlds, to avoid endless loop we use only one\n var realWorldExtent = extent.slice();\n if (this.projection_ && this.getSource().getWrapX()) {\n wrapExtentX(realWorldExtent, this.projection_);\n }\n if (this.loadedExtent_) {\n if (approximatelyEquals(this.loadedExtent_, realWorldExtent, resolution)) {\n // make sure result is exactly equal to previous extent\n realWorldExtent = this.loadedExtent_.slice();\n }\n else {\n // we should not keep track of loaded extents\n this.getSource().removeLoadedExtent(this.loadedExtent_);\n }\n }\n return [realWorldExtent];\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 this.loadedExtent_ = extent;\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);\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.meridians_.length;\n }\n if (this.parallelsLabels_) {\n featureCount += this.parallels_.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 };\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 text = this.lonLabelFormatter_(lon);\n if (index in this.meridiansLabels_) {\n this.meridiansLabels_[index].text = text;\n }\n else {\n this.meridiansLabels_[index] = {\n geom: new Point([]),\n text: text\n };\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 text = this.latLabelFormatter_(lat);\n if (index in this.parallelsLabels_) {\n this.parallelsLabels_[index].text = text;\n }\n else {\n this.parallelsLabels_[index] = {\n geom: new Point([]),\n text: text\n };\n }\n }\n this.parallels_[index++] = lineString;\n }\n return index;\n };\n /**\n * @param {import(\"../render/Event.js\").default} event Render event.\n * @private\n */\n Graticule.prototype.drawLabels_ = function (event) {\n var rotation = event.frameState.viewState.rotation;\n var extent = event.frameState.extent;\n var rotationCenter = getCenter(extent);\n var rotationExtent = extent;\n if (rotation) {\n var width = getWidth(extent);\n var height = getHeight(extent);\n var cr = Math.abs(Math.cos(rotation));\n var sr = Math.abs(Math.sin(rotation));\n var unrotatedWidth = (sr * height - cr * width) / (sr * sr - cr * cr);\n var unrotatedHeight = (sr * width - cr * height) / (sr * sr - cr * cr);\n rotationExtent = [\n rotationCenter[0] - unrotatedWidth / 2, rotationCenter[1] - unrotatedHeight / 2,\n rotationCenter[0] + unrotatedWidth / 2, rotationCenter[1] + unrotatedHeight / 2\n ];\n }\n var startWorld = 0;\n var endWorld = 0;\n var labelsAtStart = this.latLabelPosition_ < 0.5;\n var projectionExtent = this.projection_.getExtent();\n var worldWidth = getWidth(projectionExtent);\n if (this.getSource().getWrapX() && this.projection_.canWrapX() && !containsExtent(projectionExtent, extent)) {\n startWorld = Math.floor((extent[0] - projectionExtent[0]) / worldWidth);\n endWorld = Math.ceil((extent[2] - projectionExtent[2]) / worldWidth);\n var inverted = Math.abs(rotation) > Math.PI / 2;\n labelsAtStart = labelsAtStart !== inverted;\n }\n var vectorContext = getVectorContext(event);\n for (var world = startWorld; world <= endWorld; ++world) {\n var poolIndex = this.meridians_.length + this.parallels_.length;\n var feature = void 0, index = void 0, l = void 0, textPoint = void 0;\n if (this.meridiansLabels_) {\n for (index = 0, l = this.meridiansLabels_.length; index < l; ++index) {\n var lineString = this.meridians_[index];\n if (!rotation && world === 0) {\n textPoint = this.getMeridianPoint_(lineString, extent, index);\n }\n else {\n var clone = lineString.clone();\n clone.translate(world * worldWidth, 0);\n clone.rotate(-rotation, rotationCenter);\n textPoint = this.getMeridianPoint_(clone, rotationExtent, index);\n textPoint.rotate(rotation, rotationCenter);\n }\n feature = this.featurePool_[poolIndex++];\n feature.setGeometry(textPoint);\n feature.set('graticule_label', this.meridiansLabels_[index].text);\n vectorContext.drawFeature(feature, this.lonLabelStyle_(feature));\n }\n }\n if (this.parallelsLabels_) {\n if (world === startWorld && labelsAtStart || world === endWorld && !labelsAtStart) {\n for (index = 0, l = this.parallels_.length; index < l; ++index) {\n var lineString = this.parallels_[index];\n if (!rotation && world === 0) {\n textPoint = this.getParallelPoint_(lineString, extent, index);\n }\n else {\n var clone = lineString.clone();\n clone.translate(world * worldWidth, 0);\n clone.rotate(-rotation, rotationCenter);\n textPoint = this.getParallelPoint_(clone, rotationExtent, index);\n textPoint.rotate(rotation, rotationCenter);\n }\n feature = this.featurePool_[poolIndex++];\n feature.setGeometry(textPoint);\n feature.set('graticule_label', this.parallelsLabels_[index].text);\n vectorContext.drawFeature(feature, this.latLabelStyle_(feature));\n }\n }\n }\n }\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 wrapX = false;\n var projectionExtent = this.projection_.getExtent();\n var worldWidth = getWidth(projectionExtent);\n if (this.getSource().getWrapX() && this.projection_.canWrapX() && !containsExtent(projectionExtent, extent)) {\n if (getWidth(extent) >= worldWidth) {\n extent[0] = projectionExtent[0];\n extent[2] = projectionExtent[2];\n }\n else {\n wrapX = true;\n }\n }\n // Constrain the center to fit into the extent available to the graticule\n var validCenterP = [\n clamp(center[0], this.minX_, this.maxX_),\n clamp(center[1], this.minY_, this.maxY_)\n ];\n // Transform the center to lon lat\n // Some projections may have a void area at the poles\n // so replace any NaN latitudes with the min or max value closest to a pole\n var centerLonLat = this.toLonLatTransform_(validCenterP);\n if (isNaN(centerLonLat[1])) {\n centerLonLat[1] = Math.abs(this.maxLat_) >= Math.abs(this.minLat_) ?\n this.maxLat_ : this.minLat_;\n }\n var centerLon = clamp(centerLonLat[0], this.minLon_, this.maxLon_);\n var centerLat = clamp(centerLonLat[1], this.minLat_, this.maxLat_);\n var maxLines = this.maxLines_;\n var cnt, idx, lat, lon;\n // Limit the extent to fit into the extent available to the graticule\n var validExtentP = extent;\n if (!wrapX) {\n validExtentP = [\n clamp(extent[0], this.minX_, this.maxX_),\n clamp(extent[1], this.minY_, this.maxY_),\n clamp(extent[2], this.minX_, this.maxX_),\n clamp(extent[3], this.minY_, this.maxY_)\n ];\n }\n // Transform the extent to get the lon lat ranges for the edges of the extent\n var validExtent = applyTransform(validExtentP, this.toLonLatTransform_, undefined, 8);\n var maxLat = validExtent[3];\n var maxLon = validExtent[2];\n var minLat = validExtent[1];\n var minLon = validExtent[0];\n if (!wrapX) {\n // Check if extremities of the world extent lie inside the extent\n // (for example the pole in a polar projection)\n // and extend the extent as appropriate\n if (containsCoordinate(validExtentP, this.bottomLeft_)) {\n minLon = this.minLon_;\n minLat = this.minLat_;\n }\n if (containsCoordinate(validExtentP, this.bottomRight_)) {\n maxLon = this.maxLon_;\n minLat = this.minLat_;\n }\n if (containsCoordinate(validExtentP, this.topLeft_)) {\n minLon = this.minLon_;\n maxLat = this.maxLat_;\n }\n if (containsCoordinate(validExtentP, this.topRight_)) {\n maxLon = this.maxLon_;\n maxLat = this.maxLat_;\n }\n // The transformed center may also extend the lon lat ranges used for rendering\n maxLat = clamp(maxLat, centerLat, this.maxLat_);\n maxLon = clamp(maxLon, centerLon, this.maxLon_);\n minLat = clamp(minLat, this.minLat_, centerLat);\n minLon = clamp(minLon, this.minLon_, centerLon);\n }\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 if (wrapX) {\n while ((lon -= interval) >= minLon && cnt++ < maxLines) {\n idx = this.addMeridian_(lon, minLat, maxLat, squaredTolerance, extent, idx);\n }\n }\n else {\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 }\n lon = clamp(centerLon, this.minLon_, this.maxLon_);\n cnt = 0;\n if (wrapX) {\n while ((lon += interval) <= maxLon && cnt++ < maxLines) {\n idx = this.addMeridian_(lon, minLat, maxLat, squaredTolerance, extent, idx);\n }\n }\n else {\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 }\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 = clamp(this.intervals_[i] / 2, 0, 90);\n // Don't attempt to transform latitudes beyond the poles!\n var clampedLat = clamp(centerLat, -90 + delta, 90 - delta);\n p1[0] = centerLon - delta;\n p1[1] = clampedLat - delta;\n p2[0] = centerLon + delta;\n p2[1] = clampedLat + 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 bottom = 1;\n var top = flatCoordinates.length - 1;\n if (flatCoordinates[bottom] > flatCoordinates[top]) {\n bottom = top;\n top = 1;\n }\n var clampedBottom = Math.max(extent[1], flatCoordinates[bottom]);\n var clampedTop = Math.min(extent[3], flatCoordinates[top]);\n var lat = clamp(extent[1] + Math.abs(extent[1] - extent[3]) * this.lonLabelPosition_, clampedBottom, clampedTop);\n var coordinate0 = flatCoordinates[bottom - 1] +\n (flatCoordinates[top - 1] - flatCoordinates[bottom - 1]) * (lat - flatCoordinates[bottom]) /\n (flatCoordinates[top] - flatCoordinates[bottom]);\n var coordinate = [coordinate0, lat];\n var point = this.meridiansLabels_[index].geom;\n point.setCoordinates(coordinate);\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 left = 0;\n var right = flatCoordinates.length - 2;\n if (flatCoordinates[left] > flatCoordinates[right]) {\n left = right;\n right = 0;\n }\n var clampedLeft = Math.max(extent[0], flatCoordinates[left]);\n var clampedRight = Math.min(extent[2], flatCoordinates[right]);\n var lon = clamp(extent[0] + Math.abs(extent[0] - extent[2]) * this.latLabelPosition_, clampedLeft, clampedRight);\n var coordinate1 = flatCoordinates[left + 1] +\n (flatCoordinates[right + 1] - flatCoordinates[left + 1]) * (lon - flatCoordinates[left]) /\n (flatCoordinates[right] - flatCoordinates[left]);\n var coordinate = [lon, coordinate1];\n var point = this.parallelsLabels_[index].geom;\n point.setCoordinates(coordinate);\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 this.maxLat_ = worldExtent[3];\n this.maxLon_ = worldExtent[2];\n this.minLat_ = worldExtent[1];\n this.minLon_ = worldExtent[0];\n // If the world extent crosses the dateline define a custom transform to\n // return longitudes which wrap the dateline\n var toLonLatTransform = getTransform(projection, epsg4326Projection);\n if (this.minLon_ < this.maxLon_) {\n this.toLonLatTransform_ = toLonLatTransform;\n }\n else {\n var split_1 = this.minLon_ + this.maxLon_ / 2;\n this.maxLon_ += 360;\n this.toLonLatTransform_ = function (coordinates, opt_output, opt_dimension) {\n var dimension = opt_dimension || 2;\n var lonLatCoordinates = toLonLatTransform(coordinates, opt_output, dimension);\n for (var i = 0, l = lonLatCoordinates.length; i < l; i += dimension) {\n if (lonLatCoordinates[i] < split_1) {\n lonLatCoordinates[i] += 360;\n }\n }\n return lonLatCoordinates;\n };\n }\n // Transform the extent to get the limits of the view projection extent\n // which should be available to the graticule\n this.fromLonLatTransform_ = getTransform(epsg4326Projection, projection);\n var worldExtentP = applyTransform([this.minLon_, this.minLat_, this.maxLon_, this.maxLat_], this.fromLonLatTransform_, undefined, 8);\n this.minX_ = worldExtentP[0];\n this.maxX_ = worldExtentP[2];\n this.minY_ = worldExtentP[1];\n this.maxY_ = worldExtentP[3];\n // Determine the view projection coordinates of the extremities of the world extent\n // as these may lie inside a view extent (for example the pole in a polar projection)\n this.bottomLeft_ = this.fromLonLatTransform_([this.minLon_, this.minLat_]);\n this.bottomRight_ = this.fromLonLatTransform_([this.maxLon_, this.minLat_]);\n this.topLeft_ = this.fromLonLatTransform_([this.minLon_, this.maxLat_]);\n this.topRight_ = this.fromLonLatTransform_([this.maxLon_, this.maxLat_]);\n // Transform the projection center to lon lat\n // Some projections may have a void area at the poles\n // so replace any NaN latitudes with the min or max value closest to a pole\n this.projectionCenterLonLat_ = this.toLonLatTransform_(getCenter(projection.getExtent()));\n if (isNaN(this.projectionCenterLonLat_[1])) {\n this.projectionCenterLonLat_[1] = Math.abs(this.maxLat_) >= Math.abs(this.minLat_) ?\n this.maxLat_ : this.minLat_;\n }\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 {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<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: function () {\n return this.gradient_;\n }.bind(this)\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 {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 {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 {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 {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 * * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector\n * tile layers with only a few rendered features (e.g. for highlighting a subset of features of\n * another layer with the same source).\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 ||\n renderMode == VectorTileRenderType.VECTOR, 28); // `renderMode` must be `'image'`, `'hybrid'` or `'vector'`.\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';\nimport { fromUserCoordinate, getUserProjection } from '../proj.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\n * and a projection as arguments, and returns a geometry. The optional existing\n * geometry is the geometry that is returned when the function is called without\n * a second argument.\n * @typedef {function(!SketchCoordType, import(\"../geom/SimpleGeometry.js\").default=,\n * import(\"../proj/Projection.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 * Triggered upon feature draw abortion\n * @event DrawEvent#drawabort\n * @api\n */\n DRAWABORT: 'drawabort'\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 * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../geom/SimpleGeometry.js\").default} A geometry.\n */\n geometryFunction = function (coordinates, opt_geometry, projection) {\n var circle = opt_geometry ? /** @type {Circle} */ (opt_geometry) :\n new Circle([NaN, NaN]);\n var center = fromUserCoordinate(coordinates[0], projection);\n var squaredLength = squaredCoordinateDistance(center, fromUserCoordinate(coordinates[1], projection));\n circle.setCenterAndRadius(center, Math.sqrt(squaredLength));\n var userProjection = getUserProjection();\n if (userProjection) {\n circle.transform(projection, userProjection);\n }\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 * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../geom/SimpleGeometry.js\").default} A geometry.\n */\n geometryFunction = function (coordinates, opt_geometry, projection) {\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.coordinate);\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.coordinate);\n }\n pass = false;\n }\n else if (this.freehand_) {\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 var projection = event.map.getView().getProjection();\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_, undefined, projection);\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 projection = event.map.getView().getProjection();\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, projection);\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 {!PointCoordType} coordinate Coordinate\n * @private\n */\n Draw.prototype.addToDrawing_ = function (coordinate) {\n var geometry = this.sketchFeature_.getGeometry();\n var projection = this.getMap().getView().getProjection();\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, projection);\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, projection);\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 projection = this.getMap().getView().getProjection();\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, projection);\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, projection);\n }\n if (coordinates.length === 0) {\n this.abortDrawing();\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 var projection = this.getMap().getView().getProjection();\n if (this.mode_ === Mode.LINE_STRING) {\n // remove the redundant last point\n coordinates.pop();\n this.geometryFunction_(coordinates, geometry, projection);\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, projection);\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 this.sketchFeature_ = null;\n this.sketchPoint_ = null;\n this.sketchLine_ = null;\n this.overlay_.getSource().clear(true);\n return sketchFeature;\n };\n /**\n * Stop drawing without adding the sketch feature to the target layer.\n * @api\n */\n Draw.prototype.abortDrawing = function () {\n var sketchFeature = this.abortDrawing_();\n if (sketchFeature) {\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWABORT, sketchFeature));\n }\n };\n /**\n * Append coordinates to the end of the geometry that is currently being drawn.\n * This can be used when drawing LineStrings or Polygons. Coordinates will\n * either be appended to the current LineString or the outer ring of the current\n * Polygon.\n * @param {!LineCoordType} coordinates Linear coordinates to be appended into\n * the coordinate array.\n * @api\n */\n Draw.prototype.appendCoordinates = function (coordinates) {\n var mode = this.mode_;\n var sketchCoords = [];\n if (mode === Mode.LINE_STRING) {\n sketchCoords = /** @type {LineCoordType} */ this.sketchCoords_;\n }\n else if (mode === Mode.POLYGON) {\n sketchCoords = this.sketchCoords_ && this.sketchCoords_.length ? /** @type {PolyCoordType} */ (this.sketchCoords_)[0] : [];\n }\n // Remove last coordinate from sketch drawing (this coordinate follows cursor position)\n var ending = sketchCoords.pop();\n // Append coordinate list\n for (var i = 0; i < coordinates.length; i++) {\n this.addToDrawing_(coordinates[i]);\n }\n // Duplicate last coordinate for sketch drawing\n this.addToDrawing_(ending);\n };\n /**\n * Initiate draw mode by starting from an existing geometry which will\n * receive new additional points. This only works on features with\n * `LineString` geometries, where the interaction will extend lines by adding\n * points to the end of the coordinates array.\n * This will change the original feature, instead of drawing a copy.\n *\n * The function will dispatch a `drawstart` event.\n *\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, projection) {\n var center = fromUserCoordinate(/** @type {LineCoordType} */ (coordinates)[0], projection);\n var end = fromUserCoordinate(/** @type {LineCoordType} */ (coordinates)[1], projection);\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 var userProjection = getUserProjection();\n if (userProjection) {\n geometry.transform(projection, userProjection);\n }\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, projection) {\n var extent = boundingExtent(/** @type {LineCoordType} */ (coordinates).map(function (coordinate) {\n return fromUserCoordinate(coordinate, projection);\n }));\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 var userProjection = getUserProjection();\n if (userProjection) {\n geometry.transform(projection, userProjection);\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 { fromCircle } from '../geom/Polygon.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 { getUserProjection, 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 var circleGeometry = /** @type {import(\"../geom/Geometry.js\").default} */ (geometry);\n var userProjection = getUserProjection();\n if (userProjection && this.getMap()) {\n var projection = this.getMap().getView().getProjection();\n circleGeometry = circleGeometry.clone().transform(userProjection, projection);\n circleGeometry = fromCircle(/** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry)).transform(projection, userProjection);\n }\n this.rBush_.insert(circleGeometry.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 var projection = evt.map.getView().getProjection();\n var radius = coordinateDistance(fromUserCoordinate(geometry.getCenter(), projection), fromUserCoordinate(vertex, projection));\n var userProjection = getUserProjection();\n if (userProjection) {\n var circleGeometry = geometry.clone().transform(userProjection, projection);\n circleGeometry.setRadius(radius);\n radius = circleGeometry.transform(projection, userProjection).getRadius();\n }\n geometry.setRadius(radius);\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 var pixelCoordinate = evt.coordinate;\n this.handlePointerAtPixel_(evt.pixel, evt.map, pixelCoordinate);\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 var circleGeometry = geometry;\n var userProjection = getUserProjection();\n if (userProjection) {\n var projection = evt.map.getView().getProjection();\n circleGeometry = circleGeometry.clone().transform(userProjection, projection);\n circleGeometry = fromCircle(circleGeometry).transform(projection, userProjection);\n }\n this.rBush_.update(circleGeometry.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, evt.coordinate);\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @param {import(\"../coordinate.js\").Coordinate=} opt_coordinate The pixel Coordinate.\n * @private\n */\n Modify.prototype.handlePointerAtPixel_ = function (pixel, map, opt_coordinate) {\n var pixelCoordinate = opt_coordinate || 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 userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry.clone().transform(userProjection, projection));\n }\n var distanceToCenterSquared = squaredCoordinateDistance(circleGeometry.getCenter(), fromUserCoordinate(pointCoordinates, projection));\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 var circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (geometry);\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry.clone().transform(userProjection, projection));\n }\n return toUserCoordinate(circleGeometry.getClosestPoint(fromUserCoordinate(pointCoordinates, projection)), projection);\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 a falsey value, 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 * Original feature styles to reset to when features are no longer selected.\n * @type {Object.<number, import(\"../style/Style.js\").default|Array.<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction>}\n */\nvar originalFeatureStyles = {};\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 */\n _this.boundAddFeature_ = _this.addFeature_.bind(_this);\n /**\n * @private\n */\n _this.boundRemoveFeature_ = _this.removeFeature_.bind(_this);\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 * @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 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.restorePreviousStyle_.bind(this));\n }\n _super.prototype.setMap.call(this, map);\n if (map) {\n this.features_.addEventListener(CollectionEventType.ADD, this.boundAddFeature_);\n this.features_.addEventListener(CollectionEventType.REMOVE, this.boundRemoveFeature_);\n if (this.style_) {\n this.features_.forEach(this.applySelectedStyle_.bind(this));\n }\n }\n else {\n this.features_.removeEventListener(CollectionEventType.ADD, this.boundAddFeature_);\n this.features_.removeEventListener(CollectionEventType.REMOVE, this.boundRemoveFeature_);\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.applySelectedStyle_(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.restorePreviousStyle_(feature);\n }\n };\n /**\n * @return {import(\"../style/Style.js\").default|Array.<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction|null} Select style.\n */\n Select.prototype.getStyle = function () {\n return this.style_;\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Select.prototype.applySelectedStyle_ = function (feature) {\n var key = getUid(feature);\n if (!(key in originalFeatureStyles)) {\n originalFeatureStyles[key] = feature.getStyle();\n }\n feature.setStyle(this.style_);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Select.prototype.restorePreviousStyle_ = function (feature) {\n var key = getUid(feature);\n var selectInteractions = /** @type {Array<Select>} */ (this.getMap().getInteractions().getArray().filter(function (interaction) {\n return interaction instanceof Select && interaction.getStyle() && interaction.getFeatures().getArray().indexOf(feature) !== -1;\n }));\n if (selectInteractions.length > 0) {\n feature.setStyle(selectInteractions[selectInteractions.length - 1].getStyle());\n }\n else {\n feature.setStyle(originalFeatureStyles[key]);\n delete originalFeatureStyles[key];\n }\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 { getUserProjection, 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 var circleGeometry = closestSegmentData.feature.getGeometry();\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = circleGeometry.clone().transform(userProjection, projection);\n }\n vertex = toUserCoordinate(closestOnCircle(projectedCoordinate, \n /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry)), projection);\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 projection = this.getMap().getView().getProjection();\n var circleGeometry = geometry;\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry.clone().transform(userProjection, projection));\n }\n var polygon = fromCircle(circleGeometry);\n if (userProjection) {\n polygon.transform(projection, userProjection);\n }\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 * @return {Array<Geometry>} Geometries.\n */\n GeometryCollection.prototype.getGeometriesArrayRecursive = function () {\n /** @type {Array<Geometry>} */\n var geometriesArray = [];\n var geometries = this.geometries_;\n for (var i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].getType() === this.getType()) {\n geometriesArray = geometriesArray.concat(/** @type {GeometryCollection} */ (geometries[i]).getGeometriesArrayRecursive());\n }\n else {\n geometriesArray.push(geometries[i]);\n }\n }\n return geometriesArray;\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, getXMLSerializer } 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_ = getXMLSerializer();\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, getDocument } 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(getDocument().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(getDocument().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(getDocument().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(getDocument().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(getDocument().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 if (crs['type'] === 'EPSG') {\n projection = getProjection('EPSG:' + crs['properties']['code']);\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 * @type {HTMLTextAreaElement}\n */\nvar TEXTAREA;\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 * @property {null|string} [crossOrigin='anonymous'] 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 */\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 /**\n * @private\n * @type {null|string}\n */\n _this.crossOrigin_ = options.crossOrigin !== undefined ?\n options.crossOrigin : 'anonymous';\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, this);\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.call(this, 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.call(this, 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 textOffset = [0, 0];\n var textAlign = 'start';\n var imageStyle = foundStyle.getImage();\n if (imageStyle) {\n var imageSize = imageStyle.getImageSize();\n if (imageSize === null) {\n imageSize = DEFAULT_IMAGE_STYLE_SIZE;\n }\n if (imageSize.length == 2) {\n var imageScale = imageStyle.getScale();\n // Offset the label to be centered to the right of the icon,\n // if there is one.\n textOffset[0] = imageScale * imageSize[0] / 2;\n textOffset[1] = -imageScale * imageSize[1] / 2;\n textAlign = 'left';\n }\n }\n var textStyle = foundStyle.getText();\n if (textStyle) {\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 textStyle = textStyle.clone();\n textStyle.setFont(textStyle.getFont() || DEFAULT_TEXT_STYLE.getFont());\n textStyle.setScale(textStyle.getScale() || DEFAULT_TEXT_STYLE.getScale());\n textStyle.setFill(textStyle.getFill() || DEFAULT_TEXT_STYLE.getFill());\n textStyle.setStroke(textStyle.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 image: imageStyle,\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} Style.\n */\n function (feature, resolution) {\n var drawName = showPointNames;\n var name = '';\n var multiGeometryPoints = [];\n if (drawName) {\n var geometry = feature.getGeometry();\n if (geometry) {\n var type = geometry.getType();\n if (type === GeometryType.GEOMETRY_COLLECTION) {\n multiGeometryPoints = geometry.getGeometriesArrayRecursive().filter(function (geometry) {\n var type = geometry.getType();\n return type === GeometryType.POINT || type === GeometryType.MULTI_POINT;\n });\n drawName = multiGeometryPoints.length > 0;\n }\n else {\n drawName = type === GeometryType.POINT || type === GeometryType.MULTI_POINT;\n }\n }\n }\n if (drawName) {\n name = /** @type {string} */ (feature.get('name'));\n drawName = drawName && !!name;\n // convert any html character codes\n if (drawName && name.search(/&[^&]+;/) > -1) {\n if (!TEXTAREA) {\n TEXTAREA = document.createElement('textarea');\n }\n TEXTAREA.innerHTML = name;\n name = TEXTAREA.value;\n }\n }\n var featureStyle = defaultStyle;\n if (style) {\n featureStyle = style;\n }\n else if (styleUrl) {\n featureStyle = findStyle(styleUrl, defaultStyle, sharedStyles);\n }\n if (drawName) {\n var nameStyle = createNameStyleFunction(featureStyle[0], name);\n if (multiGeometryPoints.length > 0) {\n // in multigeometries restrict the name style to points and create a\n // style without image or text for geometries requiring fill or stroke\n // including any polygon specific style if there is one\n nameStyle.setGeometry(new GeometryCollection(multiGeometryPoints));\n var baseStyle = new Style({\n geometry: featureStyle[0].getGeometry(),\n image: null,\n fill: featureStyle[0].getFill(),\n stroke: featureStyle[0].getStroke(),\n text: null\n });\n return [nameStyle, baseStyle].concat(featureStyle.slice(1));\n }\n return nameStyle;\n }\n return featureStyle;\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 * @this {KML}\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, this);\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 'color': makeObjectPropertySetter(readColor),\n 'heading': makeObjectPropertySetter(readDecimal),\n 'hotSpot': makeObjectPropertySetter(readVec2),\n 'scale': makeObjectPropertySetter(readScale)\n});\n/**\n * @this {KML}\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 var color = /** @type {Array<number>|undefined} */ (object['color']);\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: this.crossOrigin_,\n offset: offset,\n offsetOrigin: IconOrigin.BOTTOM_LEFT,\n rotation: rotation,\n scale: scale,\n size: size,\n src: src,\n color: color\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 * @this {KML}\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, this);\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 // if the polystyle specifies no outline two styles are needed,\n // one for non-polygon geometries where linestrings require a stroke\n // and one for polygons where there should be no stroke\n return [\n new Style({\n geometry: function (feature) {\n var geometry = feature.getGeometry();\n var type = geometry.getType();\n if (type === GeometryType.GEOMETRY_COLLECTION) {\n return new GeometryCollection(geometry.getGeometriesArrayRecursive().filter(function (geometry) {\n var type = geometry.getType();\n return type !== GeometryType.POLYGON && type !== GeometryType.MULTI_POLYGON;\n }));\n }\n else if (type !== GeometryType.POLYGON && type !== GeometryType.MULTI_POLYGON) {\n return geometry;\n }\n },\n fill: fillStyle,\n image: imageStyle,\n stroke: strokeStyle,\n text: textStyle,\n zIndex: undefined // FIXME\n }),\n new Style({\n geometry: function (feature) {\n var geometry = feature.getGeometry();\n var type = geometry.getType();\n if (type === GeometryType.GEOMETRY_COLLECTION) {\n return new GeometryCollection(geometry.getGeometriesArrayRecursive().filter(function (geometry) {\n var type = geometry.getType();\n return type === GeometryType.POLYGON || type === GeometryType.MULTI_POLYGON;\n }));\n }\n else if (type === GeometryType.POLYGON || type === GeometryType.MULTI_POLYGON) {\n return geometry;\n }\n },\n fill: fillStyle,\n stroke: null,\n zIndex: undefined // FIXME\n })\n ];\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, this);\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 * @this {KML}\n * @param {Element} node Node.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction placemarkStyleMapParser(node, objectStack) {\n var styleMapValue = readStyleMapValue.call(this, 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', 'color', '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 'color': makeChildAppender(writeColorTextNode),\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 color = style.getColor();\n if (color) {\n properties['color'] = color;\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': Number(style.getWidth()) || 1\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 /** @type {GeometryCollection} */ (geometry).getGeometriesArrayRecursive().forEach(function (geometry) {\n var type = geometry.getType();\n if (type === GeometryType.MULTI_POINT) {\n geometries = geometries.concat(/** @type {MultiPoint} */ (geometry).getPoints());\n }\n else if (type === GeometryType.MULTI_LINE_STRING) {\n geometries = geometries.concat(/** @type {MultiLineString} */ (geometry).getLineStrings());\n }\n else if (type === GeometryType.MULTI_POLYGON) {\n geometries = geometries.concat(/** @type {MultiPolygon} */ (geometry).getPolygons());\n }\n else if (type === GeometryType.POINT\n || type === GeometryType.LINE_STRING\n || type === GeometryType.POLYGON) {\n geometries.push(geometry);\n }\n else {\n assert(false, 39); // Unknown geometry type\n }\n });\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 styleArray = Array.isArray(styles) ? styles : [styles];\n var pointStyles = styleArray;\n if (feature.getGeometry()) {\n pointStyles = styleArray.filter(function (style) {\n var geometry = style.getGeometryFunction()(feature);\n if (geometry) {\n var type = geometry.getType();\n if (type === GeometryType.GEOMETRY_COLLECTION) {\n return /** @type {GeometryCollection} */ (geometry).getGeometriesArrayRecursive().filter(function (geometry) {\n var type = geometry.getType();\n return type === GeometryType.POINT || type === GeometryType.MULTI_POINT;\n }).length;\n }\n return type === GeometryType.POINT || type === GeometryType.MULTI_POINT;\n }\n });\n }\n if (this.writeStyles_) {\n var lineStyles = styleArray;\n var polyStyles = styleArray;\n if (feature.getGeometry()) {\n lineStyles = styleArray.filter(function (style) {\n var geometry = style.getGeometryFunction()(feature);\n if (geometry) {\n var type = geometry.getType();\n if (type === GeometryType.GEOMETRY_COLLECTION) {\n return /** @type {GeometryCollection} */ (geometry).getGeometriesArrayRecursive().filter(function (geometry) {\n var type = geometry.getType();\n return type === GeometryType.LINE_STRING || type === GeometryType.MULTI_LINE_STRING;\n }).length;\n }\n return type === GeometryType.LINE_STRING || type === GeometryType.MULTI_LINE_STRING;\n }\n });\n polyStyles = styleArray.filter(function (style) {\n var geometry = style.getGeometryFunction()(feature);\n if (geometry) {\n var type = geometry.getType();\n if (type === GeometryType.GEOMETRY_COLLECTION) {\n return /** @type {GeometryCollection} */ (geometry).getGeometriesArrayRecursive().filter(function (geometry) {\n var type = geometry.getType();\n return type === GeometryType.POLYGON || type === GeometryType.MULTI_POLYGON;\n }).length;\n }\n return type === GeometryType.POLYGON || type === GeometryType.MULTI_POLYGON;\n }\n });\n }\n properties['Style'] = { pointStyles: pointStyles, lineStyles: lineStyles, polyStyles: polyStyles };\n }\n if (pointStyles.length && properties['name'] === undefined) {\n var textStyle = pointStyles[0].getText();\n if (textStyle) {\n properties['name'] = textStyle.getText();\n }\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, Array<string>>}\n */\n// @ts-ignore\nvar POLY_STYLE_SEQUENCE = makeStructureNS(NAMESPACE_URIS, [\n 'color', 'fill', 'outline'\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 'fill': makeChildAppender(writeBooleanTextNode),\n 'outline': makeChildAppender(writeBooleanTextNode)\n});\n/**\n * @param {Node} node Node.\n * @param {Style} 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 var fill = style.getFill();\n var stroke = style.getStroke();\n var properties = {\n 'color': fill ? fill.getColor() : undefined,\n 'fill': fill ? undefined : false,\n 'outline': stroke ? undefined : false\n };\n var parentNode = objectStack[objectStack.length - 1].node;\n var orderedKeys = POLY_STYLE_SEQUENCE[parentNode.namespaceURI];\n var values = makeSequence(properties, orderedKeys);\n pushSerializeAndPop(context, POLY_STYLE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);\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 {Object<string, Array<Style>>} styles Styles.\n * @param {Array<*>} objectStack Object stack.\n */\nfunction writeStyle(node, styles, objectStack) {\n var /** @type {import(\"../xml.js\").NodeStackItem} */ context = { node: node };\n var properties = {};\n if (styles.pointStyles.length) {\n var textStyle = styles.pointStyles[0].getText();\n if (textStyle) {\n properties['LabelStyle'] = textStyle;\n }\n var imageStyle = styles.pointStyles[0].getImage();\n if (imageStyle && typeof /** @type {?} */ (imageStyle).getSrc === 'function') {\n properties['IconStyle'] = imageStyle;\n }\n }\n if (styles.lineStyles.length) {\n var strokeStyle = styles.lineStyles[0].getStroke();\n if (strokeStyle) {\n properties['LineStyle'] = strokeStyle;\n }\n }\n if (styles.polyStyles.length) {\n var strokeStyle = styles.polyStyles[0].getStroke();\n if (strokeStyle && !properties['LineStyle']) {\n properties['LineStyle'] = strokeStyle;\n }\n properties['PolyStyle'] = styles.polyStyles[0];\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');\n if (version) {\n version = version.trim();\n }\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 * @enum {string}\n */\nvar FullScreenEventType = {\n /**\n * Triggered after the map entered fullscreen.\n * @event FullScreenEventType#enterfullscreen\n * @api\n */\n ENTERFULLSCREEN: 'enterfullscreen',\n /**\n * Triggered after the map leave fullscreen.\n * @event FullScreenEventType#leavefullscreen\n * @api\n */\n LEAVEFULLSCREEN: 'leavefullscreen'\n};\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 * @fires FullScreenEventType#enterfullscreen\n * @fires FullScreenEventType#leavefullscreen\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 this.dispatchEvent(FullScreenEventType.ENTERFULLSCREEN);\n }\n else {\n this.setClassName_(this.button_, false);\n replaceNode(this.labelNode_, this.labelActiveNode_);\n this.dispatchEvent(FullScreenEventType.LEAVEFULLSCREEN);\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","/**\n * @module ol/control/MousePosition\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 'elm-pep';\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';\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='&#160;'] 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 `'&#160;'` (`&nbsp;`) 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 : '&#160;';\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 */\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';\nimport View from '../View.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 {View} [view] Custom view for the overview map (should use same projection as main map). If not provided,\n * a default view with the same projection as the main map 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 * Explicitly given view to be used instead of a view derived from the main map.\n * @type {View}\n * @private\n */\n _this.view_ = options.view;\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 if (!this.view_) {\n // Unless an explicit view definition was given, derive default from whatever main map uses.\n var newView = new View({\n projection: view.getProjection()\n });\n this.ovmap_.setView(newView);\n }\n view.addEventListener(getChangeEventType(ViewProperty.ROTATION), this.boundHandleRotationChanged_);\n // Sync once with the new view\n this.handleRotationChanged_();\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 */\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 */\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","/**\n * @module ol/control/ZoomSlider\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 'elm-pep';\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';\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.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 */\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 {composeCssTransform as _ol_transform$composeCssTransform} from './ol/transform';\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 {registerXMLSerializer as _ol_xml$registerXMLSerializer} from './ol/xml';\nimport {registerDocument as _ol_xml$registerDocument} 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 $ol$control$Control from './ol/control/Control';\nimport $ol$control$FullScreen from './ol/control/FullScreen';\nimport $ol$control$MousePosition from './ol/control/MousePosition';\nimport $ol$control$OverviewMap from './ol/control/OverviewMap';\nimport $ol$control$Rotate from './ol/control/Rotate';\nimport $ol$control$ScaleLine from './ol/control/ScaleLine';\nimport $ol$control$Zoom from './ol/control/Zoom';\nimport $ol$control$ZoomSlider 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.transform = {};\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.Control = $ol$control$Control;\nol.control.FullScreen = $ol$control$FullScreen;\nol.control.MousePosition = $ol$control$MousePosition;\nol.control.OverviewMap = $ol$control$OverviewMap;\nol.control.Rotate = $ol$control$Rotate;\nol.control.ScaleLine = $ol$control$ScaleLine;\nol.control.Zoom = $ol$control$Zoom;\nol.control.ZoomSlider = $ol$control$ZoomSlider;\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.transform.composeCssTransform = _ol_transform$composeCssTransform;\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;\nol.xml.registerDocument = _ol_xml$registerDocument;\nol.xml.registerXMLSerializer = _ol_xml$registerXMLSerializer;\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":""}