diff --git a/openlayers/openlayers-3.6.0-tests.ts b/openlayers/openlayers-3.6.0-tests.ts
new file mode 100644
index 0000000000..52d7535710
--- /dev/null
+++ b/openlayers/openlayers-3.6.0-tests.ts
@@ -0,0 +1,563 @@
+///
+
+// Basic type variables for test functions
+var voidValue: void;
+var numberValue: number;
+var booleanValue: boolean;
+var stringValue: string;
+var jsonValue: JSON;
+
+// Callback predefinitions for OpenLayers
+var preRenderFunction: ol.PreRenderFunction;
+var transformFunction: ol.TransformFunction;
+var coordinateFormatType: ol.CoordinateFormatType;
+var featureStyleFunction: ol.FeatureStyleFunction;
+var featureLoader: ol.FeatureLoader;
+var easingFunction: (t: number) => number;
+
+// Type variables for OpenLayers
+var circle: ol.geom.Circle;
+var color: ol.Color;
+var coordinate: ol.Coordinate;
+var coordinatesArray: Array
;
+var coordinatesArrayDim2: Array>;
+var extent: ol.Extent;
+var boundingCoordinates: Array;
+var size: ol.Size;
+var style: ol.style.Style;
+var styleArray: Array;
+var feature: ol.Feature;
+var featureArray: Array;
+var graticule: ol.Graticule
+var geometry: ol.geom.Geometry;
+var geometriesArray: Array;
+var feature: ol.Feature;
+var featureArray: Array;
+var featureFormat: ol.format.Feature;
+var geometry: ol.geom.Geometry;
+var geometryCollection: ol.geom.GeometryCollection;
+var geometryLayout: ol.geom.GeometryLayout;
+var geometryType: ol.geom.GeometryType;
+var linearRing: ol.geom.LinearRing;
+var lineString: ol.geom.LineString;
+var loadingstrategy: ol.LoadingStrategy;
+var multiLineString: ol.geom.MultiLineString;
+var multiPoint: ol.geom.MultiPoint;
+var multiPolygon: ol.geom.MultiPolygon;
+var point: ol.geom.Point;
+var polygon: ol.geom.Polygon;
+var simpleGeometry: ol.geom.SimpleGeometry;
+var tilegrid: ol.tilegrid.TileGrid;
+var vector: ol.source.Vector;
+var projection: ol.proj.Projection;
+var projectionLike: ol.proj.ProjectionLike;
+var transformFn: ol.TransformFunction;
+
+//
+// ol.Attribution
+//
+
+var attribution: ol.Attribution = new ol.Attribution({
+ html: stringValue,
+});
+
+//
+// ol.color
+//
+color = ol.color.asArray(color);
+color = ol.color.asArray(stringValue);
+stringValue = ol.color.asString(color);
+stringValue = ol.color.asString(stringValue);
+
+//
+// ol.extent
+//
+transformFunction = function (input: number[]) {
+ var returnData: number[];
+ return returnData;
+};
+transformFunction = function (input: number[], output: number[]) {
+ var returnData: number[];
+ return returnData;
+};
+transformFunction = function (input: number[], output: number[], dimension: number) {
+ var returnData: number[];
+ return returnData;
+}
+extent = ol.extent.applyTransform(extent, transformFunction);
+ol.extent.applyTransform(extent, transformFunction, extent);
+extent = ol.extent.boundingExtent(boundingCoordinates)
+extent = ol.extent.buffer(extent, numberValue);
+ol.extent.buffer(extent, numberValue, extent);
+booleanValue = ol.extent.containsCoordinate(extent, coordinate);
+booleanValue = ol.extent.containsExtent(extent, extent);
+booleanValue = ol.extent.containsXY(extent, numberValue, numberValue);
+extent = ol.extent.createEmpty();
+booleanValue = ol.extent.equals(extent, extent);
+extent = ol.extent.extend(extent, extent);
+coordinate = ol.extent.getBottomLeft(extent);
+coordinate = ol.extent.getBottomRight(extent);
+coordinate = ol.extent.getCenter(extent);
+numberValue = ol.extent.getHeight(extent);
+extent = ol.extent.getIntersection(extent, extent);
+ol.extent.getIntersection(extent, extent, extent);
+size = ol.extent.getSize(extent);
+coordinate = ol.extent.getTopLeft(extent);
+coordinate = ol.extent.getTopRight(extent);
+numberValue = ol.extent.getWidth(extent);
+booleanValue = ol.extent.intersects(extent, extent);
+booleanValue = ol.extent.isEmpty(extent);
+
+//
+// ol.featureloader
+//
+featureLoader = ol.featureloader.xhr(stringValue, featureFormat);
+
+//
+// ol.loadingstrategy
+//
+loadingstrategy = ol.loadingstrategy.all;
+loadingstrategy = ol.loadingstrategy.bbox;
+loadingstrategy = ol.loadingstrategy.tile(tilegrid);
+
+//
+//
+// ol.geom.Circle
+//
+booleanValue = circle.intersectsExtent(extent);
+circle = circle.transform(projectionLike, projectionLike);
+
+//
+//
+// ol.geom.Geometry
+//
+var geometryResult: ol.geom.Geometry;
+coordinate = geometryResult.getClosestPoint(coordinate);
+geometryResult.getClosestPoint(coordinate, coordinate);
+extent = geometryResult.getExtent();
+geometryResult.getExtent(extent);
+geometryResult.transform(projection, projection);
+
+//
+//
+// ol.geom.GeometryCollection
+//
+geometryCollection = new ol.geom.GeometryCollection(geometriesArray)
+geometryCollection = new ol.geom.GeometryCollection();
+voidValue = geometryCollection.applyTransform(transformFn);
+geometryCollection = geometryCollection.clone();
+geometriesArray = geometryCollection.getGeometries();
+geometryType = geometryCollection.getType();
+booleanValue = geometryCollection.intersectsExtent(extent);
+voidValue = geometryCollection.setGeometries(geometriesArray);
+
+//
+//
+// ol.geom.LinearRing
+//
+linearRing = new ol.geom.LinearRing(coordinatesArray);
+linearRing = new ol.geom.LinearRing(coordinatesArray, geometryLayout);
+linearRing = linearRing.clone();
+numberValue = linearRing.getArea();
+coordinatesArray = linearRing.getCoordinates();
+geometryType = linearRing.getType();
+voidValue = linearRing.setCoordinates(coordinatesArray);
+voidValue = linearRing.setCoordinates(coordinatesArray, geometryLayout);
+
+//
+//
+// ol.geom.LineString
+//
+lineString = new ol.geom.LineString(coordinatesArray);
+lineString = new ol.geom.LineString(coordinatesArray, geometryLayout);
+voidValue = lineString.appendCoordinate(coordinate);
+lineString = lineString.clone();
+coordinate = lineString.getCoordinateAtM(numberValue);
+coordinate = lineString.getCoordinateAtM(numberValue, booleanValue);
+coordinatesArray = lineString.getCoordinates();
+numberValue = lineString.getLength();
+geometryType = lineString.getType();
+booleanValue = lineString.intersectsExtent(extent);
+voidValue = lineString.setCoordinates(coordinatesArray);
+voidValue = lineString.setCoordinates(coordinatesArray, geometryLayout);
+
+//
+//
+// ol.geom.MultiLineString
+//
+var lineStringsArray: Array;
+
+multiLineString = new ol.geom.MultiLineString(coordinatesArrayDim2);
+multiLineString = new ol.geom.MultiLineString(coordinatesArrayDim2, geometryLayout);
+voidValue = multiLineString.appendLineString(lineString);
+multiLineString = multiLineString.clone();
+coordinate = multiLineString.getCoordinateAtM(numberValue);
+coordinate = multiLineString.getCoordinateAtM(numberValue, booleanValue);
+coordinate = multiLineString.getCoordinateAtM(numberValue, booleanValue, booleanValue);
+coordinatesArrayDim2 = multiLineString.getCoordinates();
+lineString = multiLineString.getLineString(numberValue);
+lineStringsArray = multiLineString.getLineStrings();
+geometryType = multiLineString.getType();
+booleanValue = multiLineString.intersectsExtent(extent);
+voidValue = multiLineString.setCoordinates(coordinatesArrayDim2);
+voidValue = multiLineString.setCoordinates(coordinatesArrayDim2, geometryLayout);
+
+//
+//
+// ol.geom.MultiPoint
+//
+var pointsArray: Array;
+
+multiPoint = new ol.geom.MultiPoint(coordinatesArray);
+multiPoint = new ol.geom.MultiPoint(coordinatesArray, geometryLayout);
+voidValue = multiPoint.appendPoint(point);
+multiPoint = multiPoint.clone();
+coordinatesArray = multiPoint.getCoordinates();
+point = multiPoint.getPoint(numberValue);
+pointsArray = multiPoint.getPoints();
+geometryType = multiPoint.getType();
+booleanValue = multiPoint.intersectsExtent(extent);
+voidValue = multiPoint.setCoordinates(coordinatesArray);
+voidValue = multiPoint.setCoordinates(coordinatesArray, geometryLayout);
+
+//
+//
+// ol.geom.MultiPolygon
+//
+var coordinatesArrayDim3: Array>>;
+var polygonsArray: Array;
+
+multiPolygon = new ol.geom.MultiPolygon(coordinatesArrayDim3);
+multiPolygon = new ol.geom.MultiPolygon(coordinatesArrayDim3, geometryLayout);
+voidValue = multiPolygon.appendPolygon(polygon);
+multiPolygon = multiPolygon.clone();
+numberValue = multiPolygon.getArea();
+coordinatesArrayDim3 = multiPolygon.getCoordinates();
+coordinatesArrayDim3 = multiPolygon.getCoordinates(booleanValue);
+multiPoint = multiPolygon.getInteriorPoints();
+polygon = multiPolygon.getPolygon(numberValue);
+polygonsArray = multiPolygon.getPolygons();
+geometryType = multiPolygon.getType();
+booleanValue = multiPolygon.intersectsExtent(extent);
+voidValue = multiPolygon.setCoordinates(coordinatesArrayDim3);
+voidValue = multiPolygon.setCoordinates(coordinatesArrayDim3, geometryLayout);
+
+//
+//
+// ol.geom.Point
+//
+point = new ol.geom.Point(coordinate);
+point = new ol.geom.Point(coordinate, geometryLayout);
+point = point.clone();
+coordinate = point.getCoordinates();
+geometryType = point.getType();
+booleanValue = point.intersectsExtent(extent);
+voidValue = point.setCoordinates(coordinate);
+voidValue = point.setCoordinates(coordinate, geometryLayout);
+
+//
+//
+// ol.geom.Polygon
+//
+var localSphere: ol.Sphere;
+var linearRingsArray: Array;
+
+polygon = new ol.geom.Polygon(coordinatesArrayDim2);
+polygon = new ol.geom.Polygon(coordinatesArrayDim2, geometryLayout);
+polygon = ol.geom.Polygon.circular(localSphere, coordinate, numberValue);
+polygon = ol.geom.Polygon.circular(localSphere, coordinate, numberValue, numberValue);
+voidValue = polygon.appendLinearRing(linearRing);
+polygon = polygon.clone();
+numberValue = polygon.getArea();
+coordinatesArrayDim2 = polygon.getCoordinates();
+coordinatesArrayDim2 = polygon.getCoordinates(booleanValue);
+point = polygon.getInteriorPoint();
+linearRing = polygon.getLinearRing(numberValue);
+linearRingsArray = polygon.getLinearRings();
+geometryType = polygon.getType();
+booleanValue = polygon.intersectsExtent(extent);
+
+//
+//
+// ol.geom.SimpleGeometry
+//
+simpleGeometry.applyTransform(transformFn);
+coordinate = simpleGeometry.getFirstCoordinate();
+coordinate = simpleGeometry.getLastCoordinate();
+geometryLayout = simpleGeometry.getLayout();
+voidValue = simpleGeometry.translate(numberValue, numberValue);
+
+//
+// ol.source
+//
+vector = new ol.source.Vector({
+ features: [feature]
+});
+
+//
+// ol.Feature
+//
+feature = new ol.Feature();
+feature = new ol.Feature(geometry);
+feature = new ol.Feature({
+ geometry: geometry
+});
+feature = feature.clone();
+geometry = feature.getGeometry();
+stringValue = feature.getGeometryName();
+var featureGetId: string | number = feature.getId();
+var featureGetStyle: ol.style.Style | Array | ol.FeatureStyleFunction = feature.getStyle();
+featureStyleFunction = feature.getStyleFunction();
+voidValue = feature.setGeometry(geometry);
+voidValue = feature.setGeometryName(stringValue);
+voidValue = feature.setId(stringValue);
+voidValue = feature.setId(numberValue);
+voidValue = feature.setStyle(style);
+voidValue = feature.setStyle(styleArray);
+voidValue = feature.setStyle(featureStyleFunction);
+
+//
+// ol.View
+//
+
+var view: ol.View = new ol.View({
+ center: [0, 0],
+ zoom: numberValue,
+});
+
+//
+// ol.layer.Tile
+//
+var tileLayer: ol.layer.Tile = new ol.layer.Tile({
+ source: new ol.source.MapQuest({ layer: 'osm' })
+});
+
+//
+// ol.proj
+//
+projection = new ol.proj.Projection({
+ code:stringValue,
+});
+projection.setExtent(projection.getExtent());
+
+//
+// ol.Map
+//
+
+var map: ol.Map = new ol.Map({
+ view: view,
+ layers: [tileLayer],
+ target: stringValue
+});
+map.beforeRender(preRenderFunction);
+
+//
+// ol.source.ImageWMS
+//
+var imageWMS: ol.source.ImageWMS = new ol.source.ImageWMS({
+ serverType: stringValue,
+ url:stringValue
+});
+
+//
+// ol.source.Source
+//
+const source = imageWMS as ol.source.Source;
+voidValue = source.refresh();
+projection = source.getProjection();
+
+//
+// ol.source.TileWMS
+//
+var tileWMS: ol.source.TileWMS = new ol.source.TileWMS({
+ params: {},
+ serverType: stringValue,
+ url:stringValue
+});
+
+tileWMS.updateParams(tileWMS.getParams());
+stringValue = tileWMS.getGetFeatureInfoUrl([0, 0], 1, "EPSG:4326", {});
+
+//
+// ol.source.WMTS
+//
+var wmts: ol.source.WMTS = new ol.source.WMTS({
+ tileGrid: new ol.tilegrid.WMTS({}),
+ layer: "",
+ style: "",
+ matrixSet: "",
+ wrapX: true
+});
+
+//
+// ol.animation
+//
+var bounceOptions: olx.animation.BounceOptions;
+bounceOptions.duration = numberValue;
+bounceOptions.start = numberValue;
+bounceOptions.resolution = numberValue;
+bounceOptions.easing = easingFunction;
+preRenderFunction = ol.animation.bounce(bounceOptions);
+
+var panOptions: olx.animation.PanOptions;
+panOptions.duration = numberValue;
+panOptions.start = numberValue;
+panOptions.source = coordinate;
+panOptions.easing = easingFunction;
+preRenderFunction = ol.animation.pan(panOptions);
+
+var rotateOptions: olx.animation.RotateOptions;
+rotateOptions.duration = numberValue;
+rotateOptions.start = numberValue;
+rotateOptions.anchor = coordinate;
+rotateOptions.rotation = numberValue;
+rotateOptions.easing = easingFunction;
+preRenderFunction = ol.animation.rotate(rotateOptions);
+
+var zoomOptions: olx.animation.ZoomOptions;
+zoomOptions.duration = numberValue;
+zoomOptions.start = numberValue;
+zoomOptions.resolution = numberValue;
+zoomOptions.easing = easingFunction;
+preRenderFunction = ol.animation.zoom(zoomOptions);
+map.beforeRender(preRenderFunction);
+
+//
+// ol.coordinate
+//
+coordinate = ol.coordinate.add(coordinate, coordinate);
+coordinateFormatType = ol.coordinate.createStringXY();
+coordinateFormatType = ol.coordinate.createStringXY(numberValue);
+stringValue = ol.coordinate.format(coordinate, stringValue);
+stringValue = ol.coordinate.format(coordinate, stringValue, numberValue);
+coordinate = ol.coordinate.rotate(coordinate, numberValue);
+stringValue = ol.coordinate.toStringHDMS();
+stringValue = ol.coordinate.toStringHDMS(coordinate);
+stringValue = ol.coordinate.toStringXY();
+stringValue = ol.coordinate.toStringXY(coordinate);
+stringValue = ol.coordinate.toStringXY(coordinate, numberValue);
+
+//
+// ol.easing
+//
+easingFunction = ol.easing.easeIn;
+easingFunction = ol.easing.easeOut;
+easingFunction = ol.easing.inAndOut;
+easingFunction = ol.easing.linear;
+easingFunction = ol.easing.upAndDown;
+
+//
+// ol.Geolocation
+//
+var geolocation: ol.Geolocation = new ol.Geolocation({
+ projection: projection
+});
+geolocation.on('change', function (evt) {
+ window.console.log(geolocation.getPosition());
+});
+
+//
+// ol.Graticule
+//
+
+graticule = new ol.Graticule();
+graticule = new ol.Graticule({
+ map: map,
+});
+var graticuleMap: ol.Map = graticule.getMap();
+var graticuleMeridians: Array = graticule.getMeridians();
+var graticuleParallels: Array = graticule.getParallels();
+graticule.setMap(graticuleMap);
+
+//
+// ol.DeviceOrientation
+//
+
+var deviceOrientation: ol.DeviceOrientation = new ol.DeviceOrientation({
+ tracking: true,
+});
+deviceOrientation.on('change', function (evt) {
+ window.console.log(deviceOrientation.getHeading());
+});
+
+//
+// ol.Overlay
+//
+
+var popup: ol.Overlay = new ol.Overlay({
+ element: document.getElementById('popup')
+});
+map.addOverlay(popup);
+var popupElement: Element = popup.getElement();
+var popupMap: ol.Map = popup.getMap();
+var popupOffset: Array = popup.getOffset();
+coordinate = popup.getPosition();
+var popupPositioning: ol.OverlayPositioning = popup.getPositioning();
+popup.setElement(popupElement);
+popup.setMap(popupMap);
+popup.setOffset(popupOffset);
+popup.setPosition(coordinate);
+popup.setPositioning(popupPositioning);
+
+
+//
+// ol.format.GeoJSON
+//
+
+var geojsonOptions: olx.format.GeoJSONOptions;
+geojsonOptions.defaultDataProjection = "EPSG";
+geojsonOptions.defaultDataProjection = projection;
+geojsonOptions.geometryName = "geom";
+
+var geojsonFormat: ol.format.GeoJSON;
+geojsonFormat = new ol.format.GeoJSON();
+geojsonFormat = new ol.format.GeoJSON(geojsonOptions);
+
+// Test options
+var readOptions: olx.format.ReadOptions;
+readOptions.dataProjection = "EPSG";
+readOptions.dataProjection = projection;
+readOptions.featureProjection = "EPSG";
+readOptions.featureProjection = projection;
+
+var writeOptions: olx.format.WriteOptions;
+writeOptions.dataProjection = "EPSG";
+writeOptions.dataProjection = projection;
+writeOptions.featureProjection = "EPSG";
+writeOptions.featureProjection = projection;
+writeOptions.rightHanded = false;
+
+// Test functions
+feature = geojsonFormat.readFeature("json");
+feature = geojsonFormat.readFeature("json", readOptions);
+featureArray = geojsonFormat.readFeatures("json");
+featureArray = geojsonFormat.readFeatures("json", readOptions);
+geometry = geojsonFormat.readGeometry("geometry");
+geometry = geojsonFormat.readGeometry("geometry", readOptions);
+stringValue = geojsonFormat.writeFeature(feature);
+stringValue = geojsonFormat.writeFeature(feature, writeOptions);
+stringValue = geojsonFormat.writeFeatures(featureArray);
+stringValue = geojsonFormat.writeFeatures(featureArray, writeOptions);
+stringValue = geojsonFormat.writeGeometry(geometry);
+stringValue = geojsonFormat.writeGeometry(geometry, writeOptions);
+jsonValue = geojsonFormat.writeFeatureObject(feature);
+jsonValue = geojsonFormat.writeFeatureObject(feature, writeOptions);
+jsonValue = geojsonFormat.writeFeaturesObject(featureArray);
+jsonValue = geojsonFormat.writeFeaturesObject(featureArray, writeOptions);
+jsonValue = geojsonFormat.writeGeometryObject(geometry);
+jsonValue = geojsonFormat.writeGeometryObject(geometry, writeOptions);
+
+//
+// ol.interactions
+//
+var modify: ol.interaction.Modify = new ol.interaction.Modify({
+ features: new ol.Collection(featureArray)
+});
+
+var draw: ol.interaction.Draw = new ol.interaction.Draw({
+ type: "Point"
+})
+
+const select: ol.interaction.Select = new ol.interaction.Select({
+ layers: (layer: ol.layer.Layer) => true,
+});
diff --git a/openlayers/openlayers-3.6.0.d.ts b/openlayers/openlayers-3.6.0.d.ts
new file mode 100644
index 0000000000..91b822d6b6
--- /dev/null
+++ b/openlayers/openlayers-3.6.0.d.ts
@@ -0,0 +1,5403 @@
+// Type definitions for OpenLayers v3.6.0
+// Project: http://openlayers.org/
+// Definitions by: Wouter Goedhart
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare namespace olx {
+ interface StaticImageOptions {
+
+ /** Attributions */
+ attributions?: Array
+
+ /*** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */
+ crossOrigin?: string
+
+ /*** Extent of the image in map coordinates. This is the [left, bottom, right, top] map coordinates of your image.*/
+ imageExtent: ol.Extent;
+
+ /*** Size of the image in pixels.*/
+ imageSize?: ol.Size;
+
+ /*** experimental Optional function to load an image given a URL.*/
+ imageLoadFunction?: ol.TileLoadFunctionType;
+
+ /*** Optional logo.*/
+ logo?: olx.LogoOptions;
+
+ /*** experimental Projection.*/
+ projection: ol.proj.Projection;
+
+ /*** Image URL.*/
+ url: string;
+ }
+
+ interface ZoomToExtentOptions {
+ /*** Class name. Default is ol-zoom-extent.*/
+ className?: string;
+
+ /*** Target.*/
+ target?: Element;
+
+ /*** Text label to use for the button. Default is E. Instead of text, also a Node (e.g. a span element) can be used.*/
+ label?: string | Node;
+
+ /*** Text label to use for the button tip. Default is Zoom to extent.*/
+ tipLabel?: string;
+
+ /*** The extent to zoom to. If undefined the validity extent of the view projection is used.*/
+ extent: ol.Extent;
+ }
+
+ interface OverviewMapOptions {
+ /*** Whether the control should start collapsed or not (expanded). Default to true.*/
+ collapsed?: boolean;
+ /*** Text label to use for the expanded overviewmap button. Default is «. Instead of text, also a Node (e.g. a span element) can be used.*/
+ collapseLabel? :string | Node;
+ /*** Whether the control can be collapsed or not. Default to true.*/
+ collapsible?: boolean;
+ /*** Text label to use for the collapsed overviewmap button. Default is ». Instead of text, also a Node (e.g. a span element) can be used.*/
+ label?: string | Node;
+ /*** Layers for the overview map. If not set, then all main map layers are used instead.*/
+ layers?: ol.layer.Layer[] | ol.Collection;
+ /*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/
+ render?: Function;
+ /*** Specify a target if you want the control to be rendered outside of the map's viewport.*/
+ target?: Element;
+ /*** Text label to use for the button tip. Default is Overview map*/
+ tipLabel?: string;
+ /*** Custom view for the overview map. If not provided, a default view with an EPSG:3857 projection will be used.*/
+ view?: ol.View;
+ }
+
+ interface RotateOptions {
+ /*** CSS class name. Default is ol-rotate.*/
+ className?: string;
+ /*** Text label to use for the rotate button. Default is ⇧. Instead of text, also a Node (e.g. a span element) can be used.*/
+ label?: string | Element;
+ /*** Text label to use for the rotate tip. Default is Reset rotation.*/
+ tipLabel?: string;
+ /*** Animation duration in milliseconds. Default is 250.*/
+ duration?: number;
+ /*** Hide the control when rotation is 0. Default is true.*/
+ autoHide?: boolean;
+ /*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/
+ render?: Function;
+ /*** Function called when the control is clicked. This will override the default resetNorth.*/
+ resetNorth?: Function;
+ /*** Target.*/
+ target?: Element;
+ }
+
+ interface AttributionOptions {
+
+ /** HTML markup for this attribution. */
+ html: string;
+ }
+
+ interface DeviceOrientationOptions {
+
+ /**
+ * Start tracking. Default is false.
+ */
+ tracking?: boolean;
+ }
+
+ interface FrameState {
+
+ /**
+ *
+ */
+ pixelRatio: number;
+
+ /**
+ *
+ */
+ time: number;
+
+ /**
+ *
+ */
+ viewState: olx.ViewState;
+ }
+
+ interface FeatureOverlayOptions {
+
+ /**
+ * Features
+ */
+ features?: Array | ol.Collection | ol.style.StyleFunction;
+
+ /**
+ * Map
+ */
+ map: ol.Map;
+
+ /**
+ * Style
+ */
+ style: ol.style.Style | Array;
+ }
+
+ interface GeolocationOptions {
+
+ /**
+ * Start Tracking. Default is false.
+ */
+ tracking?: boolean;
+
+ /**
+ * Tracking options. See http://www.w3.org/TR/geolocation-API/#position_options_interface.
+ */
+ trackingOptions?: PositionOptions;
+
+ /**
+ * The projection the position is reported in.
+ */
+ projection?: ol.proj.ProjectionLike | ol.proj.Projection;
+ }
+
+ interface GraticuleOptions {
+
+ /** Reference to an ol.Map object. */
+ map?: ol.Map;
+
+ /** The maximum number of meridians and parallels from the center of the map. The default value is 100, which means that at most 200 meridians and 200 parallels will be displayed. The default value is appropriate for conformal projections like Spherical Mercator. If you increase the value more lines will be drawn and the drawing performance will decrease. */
+ maxLines?: number;
+
+ /** The stroke style to use for drawing the graticule. If not provided, the lines will be drawn with rgba(0,0,0,0.2), a not fully opaque black. */
+ strokeStyle?: ol.style.Stroke;
+
+ /** The target size of the graticule cells, in pixels. Default value is 100 pixels. */
+ targetSize?: number;
+ }
+
+ interface BaseWMSOptions {
+
+ /** Attributions. */
+ attributions?: Array;
+
+ /** WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. */
+ params?: any;
+
+ /** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */
+ crossOrigin?: string;
+
+ /** experimental Use the ol.Map#pixelRatio value when requesting the image from the remote server. Default is true. */
+ hidpi?: boolean;
+
+ /** experimental The type of the remote WMS server: mapserver, geoserver or qgis. Only needed if hidpi is true. Default is undefined. */
+ serverType?: ol.source.wms.ServerType;
+
+ /** WMS service URL. */
+ url?: string;
+
+ /** Logo. */
+ logo?: olx.LogoOptions;
+
+ /** experimental Projection. */
+ projection?: ol.proj.ProjectionLike;
+ }
+
+ interface ImageWMSOptions extends BaseWMSOptions {
+
+ /** experimental Optional function to load an image given a URL. */
+ imageLoadFunction?: ol.ImageLoadFunctionType;
+
+ /** Ratio. 1 means image requests are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher. Default is 1.5. */
+ ratio?: number;
+
+ /** Resolutions. If specified, requests will be made for these resolutions only. */
+ resolutions?: Array;
+ }
+
+ interface TileWMSOptions {
+
+ attributions?: Array;
+
+ /**WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. Required.*/
+ params: Object;
+ /**The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.*/
+ crossOrigin?: string;
+
+ /** The size in pixels of the gutter around image tiles to ignore. By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter. Defaults to zero. Using a non-zero value allows artifacts of rendering at tile edges to be ignored. If you control the WMS service it is recommended to address "artifacts at tile edges" issues by properly configuring the WMS service. For example, MapServer has a tile_map_edge_buffer configuration parameter for this. See http://mapserver.org/output/tile_mode.html. */
+ gutter?: number;
+
+ /** Use the ol.Map#pixelRatio value when requesting the image from the remote server. Default is true.*/
+ hidpi?: boolean;
+
+ logo?: string | olx.LogoOptions;
+
+ /** Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used. */
+ tileGrid?: ol.tilegrid.TileGrid;
+
+ /** experimental Maximum zoom. */
+ maxZoom?: number;
+
+ projection?: ol.proj.ProjectionLike;
+ reprojectionErrorThreshold?: number;
+
+ /** experimental Optional function to load a tile given a URL. */
+ tileLoadFunction?: ol.TileLoadFunctionType;
+
+ /** WMS service URL. */
+ url?: string;
+
+ /** WMS service urls. Use this instead of url when the WMS supports multiple urls for GetMap requests. */
+ urls?: Array;
+
+ /** experimental The type of the remote WMS server. Currently only used when hidpi is true. Default is undefined. */
+ serverType?: ol.source.wms.ServerType;
+
+ /** experimental Whether to wrap the world horizontally. When set to false, only one world will be rendered. When true, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds. The default is true. */
+ wrapX?: boolean;
+ }
+ interface OSMOptions {
+ /** Attributions */
+ attributions?: ol.AttributionLike;
+ /** Cache size. Default is 2048. */
+ cacheSize?: number;
+ /**
+ * The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL
+ * renderer or if you want to access pixel data with the Canvas renderer.
+ * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. Default is anonymous.
+ */
+ crossOrigin?: string;
+ /** Max zoom. Default is 19. */
+ maxZoom?: number;
+ /** Whether the layer is opaque. Default is true. */
+ opaque?: boolean;
+ /** Maximum allowed reprojection error (in pixels). Default is 0.5. Higher values can increase reprojection performance, but decrease precision. */
+ reprojectionErrorThreshold?: number;
+ /** Optional function to load a tile given a URL. */
+ tileLoadFunction?: ol.TileLoadFunctionType;
+ /** URL template. Must include {x}, {y} or {-y}, and {z} placeholders. Default is https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png. */
+ url?: string;
+ /** Whether to wrap the world horizontally. Default is true. */
+ wrapX?: boolean;
+ }
+ /**
+ * Object literal with config options for the map logo.
+ */
+ interface LogoOptions {
+ /**
+ * Link url for the logo. Will be followed when the logo is clicked.
+ */
+ href: string;
+
+ /**
+ * Image src for the logo
+ */
+ src: string;
+
+ }
+
+ interface MapOptions {
+
+ /** Controls initially added to the map. If not specified, ol.control.defaults() is used. */
+ controls?: any;
+
+ /** The ratio between physical pixels and device-independent pixels (dips) on the device. If undefined then it gets set by using window.devicePixelRatio. */
+ pixelRatio?: number;
+
+ /** Interactions that are initially added to the map. If not specified, ol.interaction.defaults() is used. */
+ interactions?: any;
+
+ /** The element to listen to keyboard events on. This determines when the KeyboardPan and KeyboardZoom interactions trigger. For example, if this option is set to document the keyboard interactions will always trigger. If this option is not specified, the element the library listens to keyboard events on is the map target (i.e. the user-provided div for the map). If this is not document the target element needs to be focused for key events to be emitted, requiring that the target element has a tabindex attribute. */
+ keyboardEventTarget?: any;
+
+ /** Layers. If this is not defined, a map with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer. */
+ layers?: Array
+
+ /** When set to true, tiles will be loaded during animations. This may improve the user experience, but can also make animations stutter on devices with slow memory. Default is false. */
+ loadTilesWhileAnimating?: boolean;
+
+ /** When set to true, tiles will be loaded while interacting with the map. This may improve the user experience, but can also make map panning and zooming choppy on devices with slow memory. Default is false. */
+ loadTilesWhileInteracting?: boolean;
+
+ /** The map logo. A logo to be displayed on the map at all times. If a string is provided, it will be set as the image source of the logo. If an object is provided, the src property should be the URL for an image and the href property should be a URL for creating a link. To disable the map logo, set the option to false. By default, the OpenLayers 3 logo is shown. */
+ logo?: any;
+
+ /** Overlays initially added to the map. By default, no overlays are added. */
+ overlays?: any;
+
+ /** Renderer. By default, Canvas, DOM and WebGL renderers are tested for support in that order, and the first supported used. Specify a ol.RendererType here to use a specific renderer. Note that at present only the Canvas renderer supports vector data. */
+ renderer?: any;
+
+ /** The container for the map, either the element itself or the id of the element. If not specified at construction time, ol.Map#setTarget must be called for the map to be rendered. */
+ target?: any;
+
+ /** The map's view. No layer sources will be fetched unless this is specified at construction time or through ol.Map#setView. */
+ view?: ViewOptions;
+ }
+
+ interface OverlayOptions {
+
+ /**
+ * The overlay element.
+ */
+ element?: Element;
+
+ /**
+ * Offsets in pixels used when positioning the overlay. The fist element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is [0, 0].
+ */
+ offset?: Array;
+
+ /**
+ * The overlay position in map projection.
+ */
+ position?: ol.Coordinate;
+
+ /**
+ * Defines how the overlay is actually positioned with respect to its position property. Possible values are 'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', and 'top-right'. Default is 'top-left'.
+ */
+ positioning?: ol.OverlayPositioning;
+
+ /**
+ * Whether event propagation to the map viewport should be stopped. Default is true. If true the overlay is placed in the same container as that of the controls (CSS class name ol-overlaycontainer-stopevent); if false it is placed in the container with CSS class name ol-overlaycontainer.
+ */
+ stopEvent?: boolean;
+
+ /**
+ * Whether the overlay is inserted first in the overlay container, or appended. Default is true. If the overlay is placed in the same container as that of the controls (see the stopEvent option) you will probably set insertFirst to true so the overlay is displayed below the controls.
+ */
+ insertFirst?: boolean;
+
+ /**
+ * If set to true the map is panned when calling setPosition, so that the overlay is entirely visible in the current viewport. The default is false.
+ */
+ autoPan?: boolean;
+
+ /**
+ * The options used to create a ol.animation.pan animation. This animation is only used when autoPan is enabled. By default the default options for ol.animation.pan are used. If set to null the panning is not animated.
+ */
+ autoPanAnimation?: olx.animation.PanOptions;
+
+ /**
+ * The margin (in pixels) between the overlay and the borders of the map when autopanning. The default is 20.
+ */
+ autoPanMargin?: number;
+ }
+
+ interface ViewOptions {
+
+ /** The initial center for the view. The coordinate system for the center is specified with the projection option. Default is undefined, and layer sources will not be fetched if this is not set. */
+ center?: ol.Coordinate;
+
+ /** Rotation constraint. false means no constraint. true means no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example, 4 will constrain the rotation to 0, 90, 180, and 270 degrees. The default is true. */
+ constrainRotation?: boolean;
+
+ /** Enable rotation. Default is true. If false a rotation constraint that always sets the rotation to zero is used. The constrainRotation option has no effect if enableRotation is false. */
+ enableRotation?: boolean;
+
+ /**The extent that constrains the center, in other words, center cannot be set outside this extent. Default is undefined. */
+ extent?: ol.Extent;
+
+ /** The maximum resolution used to determine the resolution constraint. It is used together with minResolution (or maxZoom) and zoomFactor. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) then maxResolution defaults to 40075016.68557849 / 256 = 156543.03392804097. */
+ maxResolution?: number;
+
+ /** The minimum resolution used to determine the resolution constraint. It is used together with maxResolution (or minZoom) and zoomFactor. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) then minResolution defaults to 40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253. */
+ minResolution?: number;
+
+ /** The maximum zoom level used to determine the resolution constraint. It is used together with minZoom (or maxResolution) and zoomFactor. Default is 28. Note that if minResolution is also provided, it is given precedence over maxZoom. */
+ maxZoom?: number;
+
+ /** The minimum zoom level used to determine the resolution constraint. It is used together with maxZoom (or minResolution) and zoomFactor. Default is 0. Note that if maxResolution is also provided, it is given precedence over minZoom. */
+ minZoom?: number;
+
+ /** The projection. Default is EPSG:3857 (Spherical Mercator). */
+ projection?: ol.proj.ProjectionLike | ol.proj.Projection;
+
+ /** The initial resolution for the view. The units are projection units per pixel (e.g. meters per pixel). An alternative to setting this is to set zoom. Default is undefined, and layer sources will not be fetched if neither this nor zoom are defined. */
+ resolution?: number;
+
+ /** Resolutions to determine the resolution constraint. If set the maxResolution, minResolution, minZoom, maxZoom, and zoomFactor options are ignored. */
+ resolutions?: Array;
+
+ /** The initial rotation for the view in radians (positive rotation clockwise). Default is 0. */
+ rotation?: number;
+
+ /** Only used if resolution is not defined. Zoom level used to calculate the initial resolution for the view. The initial resolution is determined using the ol.View#constrainResolution method. */
+ zoom?: number;
+
+ /** The zoom factor used to determine the resolution constraint. Default is 2. */
+ zoomFactor?: number;
+ }
+
+ interface ViewState {
+
+ /**
+ *
+ */
+ center: ol.Coordinate;
+
+ /**
+ *
+ */
+ projection: ol.proj.Projection;
+
+ /**
+ *
+ */
+ resolution: number;
+
+ /**
+ *
+ */
+ rotation: number;
+ }
+
+ interface Projection {
+ /**
+ * The SRS identifier code, e.g. EPSG:4326.
+ */
+ code: string;
+
+ /**
+ * Units. Required unless a proj4 projection is defined for code.
+ */
+ units?: ol.proj.Units;
+
+ /**
+ * The validity extent for the SRS.
+ */
+ extent?: Array;
+
+ /**
+ * The axis orientation as specified in Proj4. The default is enu.
+ */
+ axisOrientation?: string;
+
+ /**
+ * Whether the projection is valid for the whole globe. Default is false.
+ */
+ global?: boolean;
+
+ /**
+ * experimental The world extent for the SRS.
+ */
+ worldExtent?: ol.Extent;
+
+ /**
+ * experimental Function to determine resolution at a point. The function is called with
+ * a {number} view resolution and an {ol.Coordinate} as arguments, and returns the {number}
+ * resolution at the passed coordinate.
+ */
+ getPointResolution?: (resolution: number, coordinate: ol.Coordinate) => number;
+ }
+
+ namespace animation {
+
+ interface BounceOptions {
+
+ /**
+ * The resolution to start the bounce from, typically map.getView().getResolution().
+ */
+ resolution: number;
+
+ /**
+ * The start time of the animation. Default is immediately.
+ */
+ start?: number;
+
+ /**
+ * The duration of the animation in milliseconds. Default is 1000.
+ */
+ duration?: number;
+
+ /**
+ * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown.
+ */
+ easing?: (t: number) => number;
+ }
+
+ interface PanOptions {
+
+ /**
+ * The resolution to start the bounce from, typically map.getView().getResolution().
+ */
+ source: ol.Coordinate;
+
+ /**
+ * The start time of the animation. Default is immediately.
+ */
+ start?: number;
+
+ /**
+ * The duration of the animation in milliseconds. Default is 1000.
+ */
+ duration?: number;
+
+ /**
+ * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown.
+ */
+ easing?: (t: number) => number;
+ }
+
+ interface RotateOptions {
+
+ /**
+ * The rotation value (in radians) to begin rotating from, typically map.getView().getRotation(). If undefined then 0 is assumed.
+ */
+ rotation?: number;
+
+ /**
+ * The rotation center/anchor. The map rotates around the center of the view if unspecified.
+ */
+ anchor?: ol.Coordinate;
+
+ /**
+ * The start time of the animation. Default is immediately.
+ */
+ start?: number;
+
+ /**
+ * The duration of the animation in milliseconds. Default is 1000.
+ */
+ duration?: number;
+
+ /**
+ * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown.
+ */
+ easing?: (t: number) => number
+ }
+
+ interface ZoomOptions {
+
+ /**
+ * The resolution to begin zooming from, typically map.getView().getResolution().
+ */
+ resolution: number;
+
+ /**
+ * The start time of the animation. Default is immediately.
+ */
+ start?: number;
+
+ /**
+ * The duration of the animation in milliseconds. Default is 1000.
+ */
+ duration?: number;
+
+ /**
+ * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown.
+ */
+ easing?: (t: number) => number
+ }
+ }
+
+ namespace control {
+
+ interface DefaultsOptions {
+
+ /**
+ * Attribution. Default is true.
+ */
+ attribution?: boolean;
+
+ /**
+ * Attribution options.
+ */
+ //TODO: Replace with olx.control.AttributionOptions
+ attributionOptions?: any;
+
+ /**
+ * Rotate. Default is true;
+ */
+ rotate?: boolean;
+
+ /**
+ * Rotate options
+ */
+ //TODO: Replace with olx.control.RotateOptions
+ rotateOptions?: any;
+
+ /**
+ * Zoom. Default is true
+ */
+ zoom?: boolean;
+
+ /**
+ *
+ */
+ //TODO: Replace with olx.control.ZoomOptions
+ zoomOptions?: any;
+ }
+ }
+
+ namespace interaction {
+ interface DefaultsOptions {
+ /*** Whether Alt-Shift-drag rotate is desired. Default is true.*/
+ altShiftDragRotate?: boolean;
+ /*** Whether double click zoom is desired. Default is true.*/
+ doubleClickZoom?: boolean;
+ /*** Whether keyboard interaction is desired. Default is true.*/
+ keyboard?: boolean;
+ /*** Whether mousewheel zoom is desired. Default is true.*/
+ mouseWheelZoom?: boolean;
+ /*** Whether Shift-drag zoom is desired. Default is true.*/
+ shiftDragZoom?: boolean;
+ /*** Whether drag pan is desired. Default is true.*/
+ dragPan?: boolean;
+ /*** Whether pinch rotate is desired. Default is true.*/
+ pinchRotate?: boolean;
+ /*** Whether pinch zoom is desired. Default is true.*/
+ pinchZoom?: boolean;
+ /*** Zoom delta*/
+ zoomDelta?: number;
+ /*** Zoom duration*/
+ zoomDuration?: number;
+ }
+ interface InteractionOptions {
+ /**
+ * Method called by the map to notify the interaction that a browser event was dispatched to the map.
+ * The function may return false to prevent the propagation of the event to other interactions in
+ * the map's interactions chain. Required.
+ */
+ handleEvent: Function;
+ }
+ interface ModifyOptions {
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event will
+ * be considered to add or move a vertex to the sketch. Default is ol.events.condition.primaryAction.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should
+ * be handled. By default, ol.events.condition.singleClick with ol.events.condition.noModifierKeys results
+ * in a vertex deletion.
+ */
+ deleteCondition?: ol.events.ConditionType;
+ /*** Pixel tolerance for considering the pointer close enough to a segment or vertex for editing. Default is 10.*/
+ pixelTolerance?: number;
+ /*** Style used for the features being modified. By default the default edit style is used (see ol.style).*/
+ style?: ol.style.Style | Array | ol.style.StyleFunction;
+ /*** The features the interaction works on. Required.*/
+ features: ol.Collection;
+ /*** Wrap the world horizontally on the sketch overlay. Default is false.*/
+ wrapX?: boolean;
+ }
+ interface DragBoxOptions {
+ /*** CSS class name for styling the box. The default is ol-dragbox.*/
+ className?: string;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.always.
+ */
+ condition?: ol.events.ConditionType;
+ /*** A function that takes a ol.MapBrowserEvent and two ol.Pixels to indicate whether a boxend event should be fired.*/
+ boxEndCondition?: ol.interaction.DragBoxEndConditionType;
+ }
+ interface DrawOptions {
+ /**
+ * The maximum distance in pixels between "down" and "up" for a "up" event to be considered a "click" event and actually
+ * add a point/vertex to the geometry being drawn. Default is 6 pixels. That value was chosen for the draw interaction
+ * to behave correctly on mouse as well as on touch devices.
+ */
+ clickTolerance?: number;
+ /**
+ * Destination collection for the drawn features.
+ */
+ features?: ol.Collection;
+ /**
+ * Destination source for the drawn features.
+ */
+ source?: ol.source.Vector;
+ /**
+ * Pixel distance for snapping to the drawing finish. Default is 12.
+ */
+ snapTolerance?: number;
+ /**
+ * Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Required.
+ */
+ type: ol.geom.GeometryType;
+ /**
+ * The number of points that can be drawn before a polygon ring or line string is finished. The default is no restriction.
+ */
+ maxPoints?: number;
+ /**
+ * The number of points that must be drawn before a polygon ring or line string can be finished. Default is 3 for polygon
+ * rings and 2 for line strings.
+ */
+ minPoints?: number;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether the drawing can be finished.
+ */
+ finishCondition?: ol.events.ConditionType;
+ /**
+ * Style for sketch features.
+ */
+ style?: ol.style.Style | Array | ol.style.StyleFunction;
+ /**
+ * Function that is called when a geometry's coordinates are updated.
+ */
+ geometryFunction?: ol.interaction.DrawGeometryFunctionType;
+ /**
+ * Geometry name to use for features created by the draw interaction.
+ */
+ geometryName?: string;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * By default ol.events.condition.noModifierKeys, i.e. a click, adds a vertex or deactivates freehand drawing.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * Condition that activates freehand drawing for lines and polygons. This function takes an ol.MapBrowserEvent and returns
+ * a boolean to indicate whether that event should be handled. The default is ol.events.condition.shiftKeyOnly, meaning that
+ * the Shift key activates freehand drawing.
+ */
+ freehandCondition?: ol.events.ConditionType;
+ /**
+ * Wrap the world horizontally on the sketch overlay. Default is false.
+ */
+ wrapX?: boolean;
+ }
+ interface DoubleClickZoomOptions {
+ /**
+ * Animation duration in milliseconds. Default is 250.
+ */
+ duration?: number;
+ /**
+ * The zoom delta applied on each double click, default is 1.
+ */
+ delta?: number;
+ }
+ interface DragAndDropOptions {
+ /**
+ * Format constructors.
+ */
+ formatConstructors?: Array;
+ /**
+ * Target projection. By default, the map's view's projection is used.
+ */
+ projection: ol.proj.ProjectionLike;
+ /**
+ * The element that is used as the drop target, default is the viewport element.
+ */
+ target?: Element;
+ }
+ interface DragPanOptions {
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.noModifierKeys.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * Kinetic inertia to apply to the pan.
+ */
+ kinetic?: ol.Kinetic;
+ }
+ interface DragRotateOptions {
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.altShiftKeysOnly.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * Animation duration in milliseconds. Default is 250.
+ */
+ duration?: number;
+ }
+ interface DragRotateAndZoomOptions {
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.shiftKeyOnly.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * Animation duration in milliseconds. Default is 400.
+ */
+ duration?: number;
+ }
+ interface DragZoomOptions {
+ /**
+ * CSS class name for styling the box. The default is ol-dragzoom.
+ */
+ className?: string;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.shiftKeyOnly.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * Animation duration in milliseconds. Default is 200.
+ */
+ duration?: number;
+ /**
+ * Use interaction for zooming out. Default is false.
+ */
+ out?: boolean;
+ }
+ interface KeyboardPanOptions {
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.noModifierKeys and ol.events.condition.targetNotEditable.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * Animation duration in milliseconds. Default is 100.
+ */
+ duration?: number;
+ /**
+ * Pixel The amount to pan on each key press. Default is 128 pixels.
+ */
+ pixelDelta?: number;
+ }
+ interface KeyboardZoomOptions {
+ /**
+ * Animation duration in milliseconds. Default is 100.
+ */
+ duration?: number;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * Default is ol.events.condition.targetNotEditable.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * The amount to zoom on each key press. Default is 1.
+ */
+ delta?: number;
+ }
+ interface MouseWheelZoomOptions {
+ /**
+ * Animation duration in milliseconds. Default is 250.
+ */
+ duration?: number;
+ /**
+ * Enable zooming using the mouse's location as the anchor. Default is true.
+ * When set to false, zooming in and out will zoom to the center of the screen instead of zooming on the mouse's location.
+ */
+ useAnchor?: boolean;
+ }
+ interface PinchRotateOptions {
+ /**
+ * The duration of the animation in milliseconds. Default is 250.
+ */
+ duration?: number;
+ /**
+ * Minimal angle in radians to start a rotation. Default is 0.3.
+ */
+ threshold?: number;
+ }
+ interface PinchZoomOptions {
+ /**
+ * Animation duration in milliseconds. Default is 400.
+ */
+ duration?: number;
+ }
+ interface PointerOptions {
+ /**
+ * Function handling "down" events. If the function returns true then a drag sequence is started.
+ */
+ handleDownEvent?: Function;
+ /**
+ * Function handling "drag" events. This function is called on "move" events during a drag sequence.
+ */
+ handleDragEvent?: Function;
+ /**
+ * Method called by the map to notify the interaction that a browser event was dispatched to the map.
+ * The function may return false to prevent the propagation of the event to other interactions in the map's interactions chain.
+ */
+ handleEvent?: Function;
+ /**
+ * Function handling "move" events. This function is called on "move" events, also during a drag sequence
+ * (so during a drag sequence both the handleDragEvent function and this function are called).
+ */
+ handleMoveEvent?: Function;
+ /**
+ * Function handling "up" events. If the function returns false then the current drag sequence is stopped.
+ */
+ handleUpEvent?: Function;
+ }
+ interface SnapOptions {
+ /**
+ * Snap to these features. Either this option or source should be provided.
+ */
+ features?: ol.Collection;
+ /**
+ * Snap to edges. Default is true.
+ */
+ edge?: boolean;
+ /**
+ * Snap to vertices. Default is true.
+ */
+ vertex?: boolean;
+ /**
+ * Pixel tolerance for considering the pointer close enough to a segment or vertex for snapping. Default is 10 pixels.
+ */
+ pixelTolerance?: number;
+ /**
+ * Snap to features from this source. Either this option or features should be provided.
+ */
+ source?: ol.source.Vector;
+ }
+ interface SelectOptions {
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * By default, this is ol.events.condition.never.
+ * Use this if you want to use different events for add and remove instead of toggle.
+ */
+ addCondition?: ol.events.ConditionType;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * This is the event for the selected features as a whole. By default, this is ol.events.condition.singleClick.
+ * Clicking on a feature selects that feature and removes any that were in the selection.
+ * Clicking outside any feature removes all from the selection.
+ * See toggle, add, remove options for adding/removing extra features to/ from the selection.
+ */
+ condition?: ol.events.ConditionType;
+ /**
+ * A list of layers from which features should be selected. Alternatively, a filter function can be provided.
+ * The function will be called for each layer in the map and should return true for layers that you want to be selectable.
+ * If the option is absent, all visible layers will be considered selectable.
+ */
+ layers?: Array | ((layer: ol.layer.Layer) => boolean);
+ /**
+ * Style for the selected features. By default the default edit style is used (see ol.style).
+ */
+ style?: ol.style.Style | Array | ol.style.StyleFunction;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * By default, this is ol.events.condition.never.
+ * Use this if you want to use different events for add and remove instead of toggle.
+ */
+ removeCondition?: ol.events.ConditionType;
+ /**
+ * A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled.
+ * This is in addition to the condition event. By default, ol.events.condition.shiftKeyOnly,
+ * i.e. pressing shift as well as the condition event, adds that feature to the current selection if it is not currently
+ * selected, and removes it if it is. See add and remove if you want to use different events instead of a toggle.
+ */
+ toggleCondition?: ol.events.ConditionType;
+ /**
+ * A boolean that determines if the default behaviour should select only single features or all (overlapping)
+ * features at the clicked map position. Default is false i.e single select
+ */
+ multi?: boolean;
+ /**
+ * Collection where the interaction will place selected features. Optional. If not set the interaction will create a collection.
+ * In any case the collection used by the interaction is returned by ol.interaction.Select#getFeatures.
+ */
+ features?: ol.Collection;
+ /**
+ * A function that takes an ol.Feature and an ol.layer.Layer and returns true if the feature may be selected or false otherwise.
+ */
+ filter?: ol.interaction.SelectFilterFunction;
+ /**
+ * Wrap the world horizontally on the selection overlay. Default is true.
+ */
+ wrapX?: boolean;
+ }
+ }
+
+ namespace layer {
+
+ interface BaseOptions {
+ /**
+ * Opacity (0, 1). Default is 1.
+ */
+ opacity?: number;
+
+ /**
+ * Visibility. Default is true.
+ */
+ visible?: boolean;
+
+ /**
+ * The bounding extent for layer rendering. The layer will not be rendered outside of this extent.
+ */
+ extent?: ol.Extent;
+
+ zIndex?: number;
+ /**
+ * The minimum resolution (inclusive) at which this layer will be visible.
+ */
+ minResolution?: number;
+
+ /**
+ * The maximum resolution (exclusive) below which this layer will be visible.
+ */
+ maxResolution?: number;
+ }
+
+ interface GroupOptions extends BaseOptions {
+
+ /**
+ * Child layers
+ */
+ layers?: Array | ol.Collection;
+ }
+
+ interface HeatmapOptions extends VectorOptions {
+
+ /**
+ * The color gradient of the heatmap, specified as an array of CSS color strings. Default is ['#00f', '#0ff', '#0f0', '#ff0', '#f00'].
+ */
+ gradient?: Array;
+
+ /**
+ * Radius size in pixels. Default is 8.
+ */
+ radius?: number;
+
+ /**
+ * Blur size in pixels. Default is 15.
+ */
+ blur?: number;
+
+ /**
+ * Shadow size in pixels. Default is 250.
+ */
+ shadow?: number;
+ }
+
+ interface ImageOptions extends LayerOptions {
+ }
+
+ interface LayerOptions extends BaseOptions {
+
+ /**
+ * The layer source (or null if not yet set).
+ */
+ source?: ol.source.Source;
+ }
+
+ interface TileOptions extends LayerOptions {
+
+ /**
+ * Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading.
+ */
+ preload?: number;
+
+ /**
+ * Source for this layer.
+ */
+ source?: ol.source.Tile;
+
+ /**
+ * Use interim tiles on error. Default is true.
+ */
+ useInterimTilesOnError?: boolean;
+ }
+
+ interface VectorOptions extends LayerOptions {
+
+ /**
+ * When set to true, feature batches will be recreated during animations. This means that no vectors will be shown clipped, but the setting will have a performance impact for large amounts of vector data. When set to false, batches will be recreated when no animation is active. Default is false.
+ */
+ updateWhileAnimating?: boolean;
+
+ /**
+ * When set to true, feature batches will be recreated during interactions. See also updateWhileInteracting. Default is false.
+ */
+ updateWhileInteracting?: boolean;
+
+ /**
+ * Render order. Function to be used when sorting features before rendering. By default features are drawn in the order that they are created. Use null to avoid the sort, but get an undefined draw order.
+ */
+ // TODO: replace any with the expected function, unclear in documentation what the parameters are
+ renderOrder?: any;
+
+ /**
+ * The buffer around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection. Recommended value: the size of the largest symbol, line width or label. Default is 100 pixels.
+ */
+ renderBuffer?: number;
+
+ /**
+ * Source.
+ */
+ source?: ol.source.Vector;
+
+ /**
+ * Layer style. See ol.style for default style which will be used if this is not defined.
+ */
+ style?: ol.style.Style | Array | any;
+ }
+ }
+
+ namespace source {
+
+ interface VectorOptions {
+ /**
+ * Attributions.
+ */
+ attributions?: Array;
+
+ /**
+ * Features. If provided as {@link ol.Collection}, the features in the source
+ * and the collection will stay in sync.
+ */
+ features?: Array | ol.Collection;
+
+ /**
+ * The feature format used by the XHR feature loader when `url` is set.
+ * Required if `url` is set, otherwise ignored. Default is `undefined`.
+ */
+ format?: ol.format.Feature;
+
+ /**
+ * The loader function used to load features, from a remote source for example.
+ * Note that the source will create and use an XHR feature loader when `url` is
+ * set.
+ */
+ loader?: ol.FeatureLoader;
+
+ /**
+ * Logo.
+ */
+ logo?: string | olx.LogoOptions;
+
+ /**
+ * The loading strategy to use. By default an {@link ol.loadingstrategy.all}
+ * strategy is used, a one-off strategy which loads all features at once.
+ */
+ strategy?: ol.LoadingStrategy;
+
+ /**
+ * Setting this option instructs the source to use an XHR loader (see
+ * {@link ol.featureloader.xhr}) and an {@link ol.loadingstrategy.all} for a
+ * one-off download of all features from that URL.
+ * Requires `format` to be set as well.
+ */
+ url?: string;
+
+ /**
+ * By default, an RTree is used as spatial index. When features are removed and
+ * added frequently, and the total number of features is low, setting this to
+ * `false` may improve performance.
+ */
+ useSpatialIndex?: boolean;
+
+ /**
+ * Wrap the world horizontally. Default is `true`. For vector editing across the
+ * -180° and 180° meridians to work properly, this should be set to `false`. The
+ * resulting geometry coordinates will then exceed the world bounds.
+ */
+ wrapX?: boolean;
+ }
+
+ interface ClusterOptions extends VectorOptions{
+
+ /**
+ * Minimum distance in pixels between clusters. Default is 20.
+ */
+ distance?: number;
+
+ extent?: ol.Extent;
+
+ geometryFunction?: any;
+
+ projection?: ol.proj.ProjectionLike;
+
+ source: ol.source.Vector;
+
+ }
+
+ interface WMTSOptions {
+ attributions?: Array;
+ crossOrigin?: string;
+ logo?: string | olx.LogoOptions;
+ tileGrid: ol.tilegrid.WMTS; // REQUIRED !
+ projection?: ol.proj.ProjectionLike;
+ reprojectionErrorThreshold?: number;
+ requestEncoding?: ol.source.WMTSRequestEncoding;
+ layer: string; //REQUIRED
+ style: string; //REQUIRED
+ tileClass?: Function;
+ tilePixelRatio?: number;
+ version?: string;
+ format?: string;
+ matrixSet: string; //REQUIRED
+ dimensions?: Object;
+ url?: string;
+ maxZoom?: number;
+ tileLoadFunction?: ol.TileLoadFunctionType;
+ urls?: Array;
+ wrapX: boolean;
+ }
+ }
+
+ namespace style {
+
+ interface FillOptions {
+ color?: ol.Color | string;
+ }
+
+ interface StyleOptions {
+ geometry?: string | ol.geom.Geometry | ol.style.GeometryFunction;
+ fill?: ol.style.Fill;
+ image?: ol.style.Image;
+ stroke?: ol.style.Stroke;
+ text?: ol.style.Text;
+ zIndex?: number;
+ }
+
+ interface TextOptions {
+ font?: string;
+ offsetX?: number;
+ offsetY?: number;
+ scale?: number;
+ rotation?: number;
+ text?: string;
+ textAlign?: string;
+ textBaseline?: string;
+ fill?: ol.style.Fill;
+ stroke?: ol.style.Stroke;
+ }
+ interface StrokeOptions {
+ color?: ol.Color | string;
+ lineCap?: string;
+ lineJoin?: string;
+ lineDash?: Array;
+ miterLimit?: number;
+ width?: number;
+ }
+ interface IconOptions {
+ anchor?: Array;
+ anchorOrigin?: string;
+ anchorXUnits?: string;
+ anchorYUnits?: string;
+ crossOrigin?: string;
+ img?: ol.Image | HTMLCanvasElement;
+ offset?: Array;
+ offsetOrigin?: string;
+ opacity?: number;
+ scale?: number;
+ snapToPixel?: boolean;
+ rotateWithView?: boolean;
+ rotation?: number;
+ size?: ol.Size;
+ imgSize?: ol.Size;
+ src?: string;
+ }
+ interface CircleOptions {
+ fill?: ol.style.Fill;
+ radius: number;
+ snapToPixel?: boolean;
+ stroke?: ol.style.Stroke;
+ }
+ }
+
+ namespace tilegrid {
+
+ interface TileGridOptions {
+
+ /**
+ * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.Tile sources. When no origin or origins are configured, the origin will be set to the bottom-left corner of the extent. When no sizes are configured, they will be calculated from the extent.
+ */
+ extent?: ol.Extent;
+
+ /**
+ * Minimum zoom. Default is 0.
+ */
+ minZoom?: number;
+
+ /**
+ * Origin, i.e. the bottom-left corner of the grid. Default is null.
+ */
+ origin?: ol.Coordinate;
+
+ /**
+ * Origins, i.e. the bottom-left corners of the grid for each zoom level. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different origin.
+ */
+ origins?: Array;
+
+ /**
+ * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1.
+ */
+ resolutions?: Array;
+
+ /**
+ * Tile size. Default is [256, 256].
+ */
+ tileSize?: number | ol.Size;
+
+ /**
+ * Tile sizes. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different tile size.
+ */
+ tileSizes?: Array;
+ }
+
+ interface WMTSOptions {
+
+ /**
+ * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.WMTS sources. When no origin or origins are configured, the origin will be calculated from the extent. When no sizes are configured, they will be calculated from the extent.
+ */
+ extent?: ol.Extent;
+
+ /**
+ * Origin, i.e. the top-left corner of the grid.
+ */
+ origin?: ol.Coordinate;
+
+ /**
+ * Origins, i.e. the top-left corners of the grid for each zoom level. The length of this array needs to match the length of the resolutions array.
+ */
+ origins?: Array;
+
+ /**
+ * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1
+ */
+ resolutions?: Array;
+
+ /**
+ * matrix IDs. The length of this array needs to match the length of the resolutions array.
+ */
+ matrixIds?: Array;
+
+ /**
+ * Number of tile rows and columns of the grid for each zoom level. The values here are the TileMatrixWidth and TileMatrixHeight advertised in the GetCapabilities response of the WMTS, and define the grid's extent together with the origin. An extent can be configured in addition, and will further limit the extent for which tile requests are made by sources.
+ */
+ sizes?: Array;
+
+ /**
+ * Tile size.
+ */
+ tileSize?: number | ol.Size;
+
+ /**
+ * Tile sizes. The length of this array needs to match the length of the resolutions array.
+ */
+ tileSizes?: Array;
+
+ /**
+ * Number of tile columns that cover the grid's extent for each zoom level. Only required when used with a source that has wrapX set to true, and only when the grid's origin differs from the one of the projection's extent. The array length has to match the length of the resolutions array, i.e. each resolution will have a matching entry here.
+ */
+ widths?: Array;
+ }
+
+ interface XYZOptions {
+
+ /**
+ * Extent for the tile grid. The origin for an XYZ tile grid is the top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the provided extent. If not provided, the extent of the EPSG:3857 projection is used.
+ */
+ extent?: ol.Extent;
+
+ /**
+ * Maximum zoom. The default is ol.DEFAULT_MAX_ZOOM. This determines the number of levels in the grid set. For example, a maxZoom of 21 means there are 22 levels in the grid set.
+ */
+ maxZoom?: number;
+
+ /**
+ * Minimum zoom. Default is 0.
+ */
+ minZoom?: number;
+
+ /**
+ * Tile size in pixels. Default is [256, 256].
+ */
+ tileSize?: number | ol.Size;
+ }
+
+ interface ZoomifyOptions {
+
+ /**
+ * Resolutions
+ */
+ resolutions: Array;
+ }
+ }
+
+ namespace view {
+
+ interface FitGeometryOptions {
+
+ /**
+ * Padding (in pixels) to be cleared inside the view. Values in the array are top, right, bottom and left padding. Default is [0, 0, 0, 0].
+ */
+ padding?: Array;
+
+ /**
+ * Constrain the resolution. Default is true.
+ */
+ constrainResolution?: boolean;
+
+ /**
+ * Get the nearest extent. Default is false.
+ */
+ nearest?: boolean;
+
+ /**
+ * Minimum resolution that we zoom to. Default is 0.
+ */
+ minResolution?: number;
+
+ /**
+ * Maximum zoom level that we zoom to. If minResolution is given, this property is ignored.
+ */
+ maxZoom?: number;
+ }
+ }
+
+ namespace format {
+ interface WKTOptions {
+ /**
+ * Whether to split GeometryCollections into multiple features on reading. Default is false.
+ */
+ splitCollection?: boolean;
+ }
+
+ interface GeoJSONOptions {
+
+ /**
+ * Default data projection.
+ */
+ defaultDataProjection?: ol.proj.ProjectionLike | ol.proj.Projection;
+
+ /**
+ * Geometry name to use when creating features
+ */
+ geometryName?: string;
+ }
+
+ interface ReadOptions {
+
+ /**
+ * Projection of the data we are reading. If not provided, the projection will be derived from the data (where possible) or the defaultDataProjection of the format is assigned (where set). If the projection can not be derived from the data and if no defaultDataProjection is set for a format, the features will not be reprojected.
+ */
+ dataProjection?: ol.proj.ProjectionLike | ol.proj.Projection;
+
+ /**
+ * Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.
+ */
+ featureProjection?: ol.proj.ProjectionLike | ol.proj.Projection;
+ }
+
+ interface WriteOptions {
+
+ /**
+ * Projection of the data we are writing. If not provided, the defaultDataProjection of the format is assigned (where set). If no defaultDataProjection is set for a format, the features will be returned in the featureProjection.
+ */
+ dataProjection?: ol.proj.ProjectionLike | ol.proj.Projection;
+
+ /**
+ * Projection of the feature geometries that will be serialized by the format writer.
+ */
+ featureProjection?: ol.proj.ProjectionLike | ol.proj.Projection;
+
+ /**
+ * When writing geometries, follow the right-hand rule for linear ring orientation. This means that polygons will have counter-clockwise exterior rings and clockwise interior rings. By default, coordinates are serialized as they are provided at construction. If true, the right-hand rule will be applied. If false, the left-hand rule will be applied (clockwise for exterior and counter-clockwise for interior rings). Note that not all formats support this. The GeoJSON format does use this property when writing geometries.
+ */
+ rightHanded?: boolean;
+ }
+ }
+
+ namespace control {
+ interface ControlOptions {
+ /**
+ * The element is the control's container element. This only needs to be specified if you're developing a custom control.
+ */
+ element?: Element;
+
+ /**
+ * Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.
+ */
+ render?: any;
+
+ /**
+ * Specify a target if you want the control to be rendered outside of the map's viewport.
+ */
+ target?: Element | string;
+ }
+ }
+}
+
+/**
+ * A high-performance, feature-packed library for all your mapping needs.
+ */
+declare namespace ol {
+
+ interface TileLoadFunctionType { (image: ol.Image, url: string): void }
+
+ interface ImageLoadFunctionType { (image: ol.Image, url: string): void }
+
+ type AttributionLike = string | Array | ol.Attribution | Array
+
+ /**
+ * An attribution for a layer source.
+ */
+ class Attribution {
+ /**
+ * @constructor
+ * @param options Attribution options.
+ */
+ constructor(options: olx.AttributionOptions);
+
+ /**
+ * Get the attribution markup.
+ * @returns The attribution HTML.
+ */
+ getHTML(): string;
+ }
+
+ /**
+ * An expanded version of standard JS Array, adding convenience methods for manipulation. Add and remove changes to the Collection trigger a Collection event. Note that this does not cover changes to the objects within the Collection; they trigger events on the appropriate object, not on the Collection as a whole.
+ */
+ class Collection extends ol.Object {
+
+ /**
+ * @constructor
+ * @param values Array.
+ */
+ constructor(values: Array)
+
+ /**
+ * Remove all elements from the collection.
+ */
+ clear(): void;
+
+ /**
+ * Add elements to the collection. This pushes each item in the provided array to the end of the collection.
+ * @param arr Array.
+ * @returns This collection.
+ */
+ extend(arr: Array): Collection;
+
+ /**
+ * Iterate over each element, calling the provided callback.
+ * @param f The function to call for every element. This function takes 3 arguments (the element, the index and the array).
+ * @param ref The object to use as this in f.
+ */
+ forEach(f: (element: T, index: number, array: Array) => void, ref?: any): void;
+
+ /**
+ * Get a reference to the underlying Array object. Warning: if the array is mutated, no events will be dispatched by the collection, and the collection's "length" property won't be in sync with the actual length of the array.
+ * @returns Array.
+ */
+ getArray(): Array;
+
+ /**
+ * Get the length of this collection.
+ * @returns The length of the array.
+ */
+ getLength(): number;
+
+ /**
+ * Insert an element at the provided index.
+ * @param index Index.
+ * @param elem Element.
+ */
+ insertAt(index: number, elem: T): void;
+
+ /**
+ * Get the element at the provided index.
+ * @param index Index.
+ * @returns Element.
+ */
+ item(index: number): T;
+
+ /**
+ * Remove the last element of the collection and return it. Return undefined if the collection is empty.
+ * @returns Element
+ */
+ pop(): T;
+
+ /**
+ * Insert the provided element at the end of the collection.
+ * @param Element.
+ * @returns Length.
+ */
+ push(elem: T): number;
+
+ /**
+ * Remove the first occurrence of an element from the collection.
+ * @param elem Element.
+ * @returns The removed element or undefined if none found.
+ */
+ remove(elem: T): T;
+
+ /**
+ * Remove the element at the provided index and return it. Return undefined if the collection does not contain this index.
+ * @param index Index.
+ * @returns Value.
+ */
+ removeAt(index: number): T;
+
+ /**
+ * Set the element at the provided index.
+ * @param index Index.
+ * @param elem Element.
+ */
+ setAt(index: number, elem: T): void;
+ }
+
+ /**
+ * Events emitted by ol.Collection instances are instances of this type.
+ */
+ class CollectionEvent extends ol.events.Event {
+
+ /**
+ * The element that is added to or removed from the collection.
+ */
+ element: T;
+ }
+
+ /**
+ * The ol.DeviceOrientation class provides access to information from DeviceOrientation events.
+ */
+ class DeviceOrientation extends ol.Object {
+
+ /**
+ * @constructor
+ * @param options Options.
+ */
+ constructor(options?: olx.DeviceOrientationOptions);
+
+ /**
+ * Rotation around the device z-axis (in radians).
+ * @returns The euler angle in radians of the device from the standard Z axis.
+ */
+ getAlpha(): number;
+
+ /**
+ * Rotation around the device x-axis (in radians).
+ * @returns The euler angle in radians of the device from the planar X axis.
+ */
+ getBeta(): number;
+
+ /**
+ * Rotation around the device y-axis (in radians).
+ * @returns The euler angle in radians of the device from the planar Y axis.
+ */
+ getGamma(): number;
+
+ /**
+ * The heading of the device relative to north (in radians).
+ * @returns The heading of the device relative to north, in radians, normalizing for different browser behavior.
+ */
+ getHeading(): number;
+
+ /**
+ * Determine if orientation is being tracked.
+ * @returns Changes in device orientation are being tracked.
+ */
+ getTracking(): boolean;
+
+ /**
+ * Enable or disable tracking of device orientation events.
+ * @param tracking The status of tracking changes to alpha, beta and gamma. If true, changes are tracked and reported immediately.
+ */
+ setTracking(tracking: boolean): void;
+ }
+
+ /**
+ * Events emitted by ol.interaction.DragBox instances are instances of this type.
+ */
+ class DragBoxEvent extends ol.events.Event {
+
+ /**
+ * The coordinate of the drag event.
+ */
+ coordinate: ol.Coordinate;
+ }
+
+ /**
+ * A vector object for geographic features with a geometry and other attribute properties, similar to the features in vector file formats like GeoJSON.
+ */
+ class Feature extends ol.Object {
+
+ /**
+ * @constructor
+ * @param geometry Geometry.
+ */
+ // TODO: replace any with Object
+ constructor(geometryOrProperties?: ol.geom.Geometry | any);
+
+ /**
+ * Clone this feature. If the original feature has a geometry it is also cloned. The feature id is not set in the clone.
+ * @returns The clone.
+ */
+ clone(): Feature;
+
+ /**
+ * Get the feature's default geometry. A feature may have any number of named geometries. The "default" geometry (the one that is rendered by default) is set when calling ol.Feature#setGeometry.
+ * @returns The default geometry for the feature.
+ */
+ getGeometry(): ol.geom.Geometry;
+
+ /**
+ * Get the name of the feature's default geometry. By default, the default geometry is named geometry.
+ * @returns Get the property name associated with the default geometry for this feature.
+ */
+ getGeometryName(): string;
+
+ /**
+ * @returns Id.
+ */
+ getId(): string | number;
+
+ /**
+ * Get the feature's style. This return for this method depends on what was provided to the ol.Feature#setStyle method.
+ * The feature style.
+ */
+ getStyle(): ol.style.Style | Array | ol.FeatureStyleFunction;
+
+ /**
+ * Get the feature's style function.
+ * @returns Return a function representing the current style of this feature.
+ */
+ getStyleFunction(): ol.FeatureStyleFunction;
+
+ /**
+ * Set the default geometry for the feature. This will update the property with the name returned by ol.Feature#getGeometryName.
+ * @param geometry The new geometry.
+ */
+ setGeometry(geometry: ol.geom.Geometry): void;
+
+ /**
+ * Set the property name to be used when getting the feature's default geometry. When calling ol.Feature#getGeometry, the value of the property with this name will be returned.
+ * @param name The property name of the default geometry.
+ */
+ setGeometryName(name: string): void;
+
+ /**
+ * Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the ol.source.Vector#getFeatureById method.
+ * @param id The feature id.
+ */
+ setId(id: string | number): void;
+
+ /**
+ * Set the style for the feature. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. If it is null the feature has no style (a null style).
+ * @param style Style for this feature.
+ */
+ setStyle(style: ol.style.Style): void;
+
+ /**
+ * Set the style for the feature. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. If it is null the feature has no style (a null style).
+ * @param style Style for this feature.
+ */
+ setStyle(style: Array): void;
+
+ /**
+ * Set the style for the feature. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. If it is null the feature has no style (a null style).
+ * @param style Style for this feature.
+ */
+ setStyle(style: ol.FeatureStyleFunction): void;
+ }
+
+ /**
+ * A mechanism for changing the style of a small number of features on a temporary basis, for example highlighting.
+ */
+ class FeatureOverlay {
+
+ /**
+ * @constructor
+ * @param options Options.
+ */
+ constructor(options?: olx.FeatureOverlayOptions);
+
+ /**
+ * Add a feature to the overlay.
+ * @param feature Feature.
+ */
+ addFeature(feature: ol.Feature): void;
+
+ /**
+ * Get the features on the overlay.
+ * @returns Features collection.
+ */
+ getFeatures: ol.Collection;
+
+ /**
+ * Get the map associated with the overlay.
+ * @returns The map with which this feature overlay is associated.
+ */
+ getMap(): ol.Map;
+
+ /**
+ * Get the style for features. This returns whatever was passed to the style option at construction or to the setStyle method.
+ * @returns Overlay style.
+ */
+ getStyle(): ol.style.Style | Array | ol.style.StyleFunction;
+
+ /**
+ * Get the style function
+ * @returns Style function
+ */
+ getStyleFunction(): ol.style.StyleFunction;
+
+ /**
+ * Remove a feature from the overlay.
+ * @param feature The feature to be removed.
+ */
+ removeFeature(feature: ol.Feature): void;
+
+ /**
+ * Set the features for the overlay.
+ * @param features Features collection.
+ */
+ setFeatures(features: ol.Collection): void;
+
+ /**
+ * Set the map for the overlay.
+ * @param map Map.
+ */
+ setMap(map: ol.Map): void;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles.
+ * @param style Overlay style
+ */
+ setStyle(style: ol.style.Style): void;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles.
+ * @param style Overlay style
+ */
+ setStyle(style: Array): void;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles.
+ * @param style Overlay style
+ */
+ setStyle(style: ol.style.StyleFunction): void;
+ }
+
+ /**
+ * Helper class for providing HTML5 Geolocation capabilities. The Geolocation API is used to locate a user's position.
+ */
+ class Geolocation extends ol.Object {
+
+ /**
+ * @constructor
+ * @param options Options.
+ */
+ constructor(options?: olx.GeolocationOptions);
+
+ /**
+ * Get the accuracy of the position in meters.
+ * @returns The accuracy of the position measurement in meters.
+ */
+ getAccuracy(): number;
+
+ /**
+ * Get a geometry of the position accuracy.
+ * @returns A geometry of the position accuracy.
+ */
+ getAccuracyGeometry(): ol.geom.Geometry;
+
+ /**
+ * Get the altitude associated with the position.
+ * @returns The altitude of the position in meters above mean sea level.
+ */
+ getAltitude(): number;
+
+ /**
+ * Get the altitude accuracy of the position.
+ * @returns The accuracy of the altitude measurement in meters.
+ */
+ getAltitudeAccuracy(): number;
+
+ /**
+ * Get the heading as radians clockwise from North.
+ * @returns The heading of the device in radians from north.
+ */
+ getHeading(): number;
+
+ /**
+ * Get the position of the device.
+ * @returns The current position of the device reported in the current projection.
+ */
+ getPosition(): ol.Coordinate;
+
+ /**
+ * Get the projection associated with the position.
+ * @returns The projection the position is reported in.
+ */
+ getProjection(): ol.proj.Projection;
+
+ /**
+ * Get the speed in meters per second.
+ * @returns The instantaneous speed of the device in meters per second.
+ */
+ getSpeed(): number;
+
+ /**
+ * Determine if the device location is being tracked.
+ * @returns The device location is being tracked.
+ */
+ getTracking(): boolean;
+
+ /**
+ * Get the tracking options.
+ * @returns PositionOptions as defined by the HTML5 Geolocation spec.
+ */
+ getTrackingOptions(): PositionOptions;
+
+ /**
+ * Set the projection to use for transforming the coordinates.
+ * @param projection The projection the position is reported in.
+ */
+ setProjection(projection: ol.proj.Projection): void;
+
+ /**
+ * Enable or disable tracking.
+ * @param tracking Enable tracking
+ */
+ setTracking(tracking: boolean): void;
+
+ /**
+ * Set the tracking options.
+ * @param PositionOptions as defined by the HTML5 Geolocation spec.
+ */
+ setTrackingOptions(options: PositionOptions): void;
+ }
+
+ /**
+ * Render a grid for a coordinate system on a map.
+ */
+ class Graticule {
+ /**
+ * @constructor
+ * @param options Options.
+ */
+ constructor(options?: olx.GraticuleOptions);
+
+ /**
+ * Get the map associated with this graticule.
+ * @returns The map.
+ */
+ getMap(): Map;
+
+ /**
+ * Get the list of meridians. Meridians are lines of equal longitude.
+ * @returns The meridians.
+ */
+ getMeridians(): Array;
+
+ /**
+ * Get the list of parallels. Pallels are lines of equal latitude.
+ * @returns The parallels.
+ */
+ getParallels(): Array;
+
+ /**
+ * Set the map for this graticule.The graticule will be rendered on the provided map.
+ * @param map Map
+ */
+ setMap(map: Map): void;
+ }
+
+ /**
+ *
+ */
+ class Image extends ol.ImageBase {
+
+ /**
+ * Get the HTML image element (may be a Canvas, Image, or Video).
+ * @param context Object.
+ * @returns Image.
+ */
+ getImage(context: HTMLCanvasElement): Image;
+
+ /**
+ * Get the HTML image element (may be a Canvas, Image, or Video).
+ * @param context Object.
+ * @returns Image.
+ */
+ getImage(context: HTMLImageElement): Image;
+
+ /**
+ * Get the HTML image element (may be a Canvas, Image, or Video).
+ * @param context Object.
+ * @returns Image.
+ */
+ getImage(context: HTMLVideoElement): Image;
+ }
+
+ /**
+ *
+ */
+ class ImageBase {
+ }
+
+ /**
+ *
+ */
+ class ImageTile extends ol.Tile {
+
+ /**
+ * Get the HTML image element for this tile (may be a Canvas, Image, or Video).
+ * @param context Object.
+ * @returns Image.
+ */
+ getImage(context: HTMLCanvasElement): Image;
+
+ /**
+ * Get the HTML image element for this tile (may be a Canvas, Image, or Video).
+ * @param context Object.
+ * @returns Image.
+ */
+ getImage(context: HTMLImageElement): Image;
+
+ /**
+ * Get the HTML image element for this tile (may be a Canvas, Image, or Video).
+ * @param context Object.
+ * @returns Image.
+ */
+ getImage(context: HTMLVideoElement): Image;
+
+ }
+
+ /**
+ * Implementation of inertial deceleration for map movement.
+ */
+ class Kinetic {
+
+ /**
+ * @constructor
+ * @param decay Rate of decay (must be negative).
+ * @param Minimum velocity (pixels/millisecond).
+ * @param Delay to consider to calculate the kinetic initial values (milliseconds).
+ */
+ constructor(decay: number, minVelocity: number, delay: number);
+ }
+
+ /**
+ * The map is the core component of OpenLayers. For a map to render, a view, one or more layers, and a target container are needed.
+ */
+ class Map extends ol.Object {
+
+ /**
+ * @constructor
+ * @params options Options.
+ */
+ constructor(options: olx.MapOptions);
+
+ /**
+ * Add the given control to the map.
+ * @param control Control.
+ */
+ addControl(control: ol.control.Control): void;
+
+ /**
+ * Add the given interaction to the map.
+ * @param interaction Interaction to add.
+ */
+ addInteraction(interaction: ol.interaction.Interaction): void;
+
+ /**
+ * Adds the given layer to the top of this map. If you want to add a layer elsewhere in the stack, use getLayers() and the methods available on ol.Collection.
+ * @param Layer.
+ */
+ addLayer(layer: ol.layer.Base): void;
+
+ /**
+ * Add the given overlay to the map.
+ * @param overlay Overlay.
+ */
+ addOverlay(overlay: ol.Overlay): void;
+
+ /**
+ * Add functions to be called before rendering. This can be used for attaching animations before updating the map's view. The ol.animation namespace provides several static methods for creating prerender functions.
+ * @param var_args Any number of pre-render functions.
+ */
+ beforeRender(var_args: ol.PreRenderFunction): void;
+
+ /**
+ * Detect features that intersect a pixel on the viewport, and execute a callback with each intersecting feature. Layers included in the detection can be configured through opt_layerFilter. Feature overlays will always be included in the detection.
+ * @param pixel Pixel.
+ * @param callback Feature callback. The callback will be called with two arguments. The first argument is one feature at the pixel, the second is the layer of the feature. If the detected feature is not on a layer, but on a ol.FeatureOverlay, then the second argument to this function will be null. To stop detection, callback functions can return a truthy value.
+ * @param ref Value to use as this when executing callback.
+ * @param layerFilter Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested. Feature overlays will always be tested.
+ * @param ref2 Value to use as this when executing layerFilter.
+ * @returns Callback result, i.e. the return value of last callback execution, or the first truthy callback return value.
+ */
+ forEachFeatureAtPixel(pixel: ol.Pixel, callback: (feature: ol.Feature, layer: ol.layer.Layer) => any, ref?: any, layerFilter?: (layerCandidate: ol.layer.Layer) => boolean, ref2?: any): void;
+
+ /**
+ * Detect layers that have a color value at a pixel on the viewport, and execute a callback with each matching layer. Layers included in the detection can be configured through opt_layerFilter. Feature overlays will always be included in the detection.
+ * @param pixel Pixel.
+ * @param callback Layer callback. Will receive one argument, the layer that contains the color pixel. If the detected color value is not from a layer, but from a ol.FeatureOverlay, then the argument to this function will be null. To stop detection, callback functions can return a truthy value.
+ * @param ref Value to use as this when executing callback.
+ * @param layerFilter Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested. Feature overlays will always be tested.
+ * @param ref2 Value to use as this when executing layerFilter.
+ * @returns Callback result, i.e. the return value of last callback execution, or the first truthy callback return value.
+ */
+ forEachLayerAtPixel(pixel: ol.Pixel, callback: (layer: ol.layer.Layer) => any, ref?: any, layerFilter?: (layerCandidate: ol.layer.Layer) => boolean, ref2?: any): void;
+
+ /**
+ * Get the map controls. Modifying this collection changes the controls associated with the map.
+ * @returns Controls.
+ */
+ getControls(): ol.Collection;
+
+ /**
+ * Get the coordinate for a given pixel. This returns a coordinate in the map view projection.
+ * @param pixel Pixel position in the map viewport.
+ * @returns The coordinate for the pixel position.
+ */
+ getCoordinateFromPixel(pixel: ol.Pixel): ol.Coordinate;
+
+ /**
+ * Returns the geographical coordinate for a browser event.
+ * @param event Event.
+ * @returns Coordinate.
+ */
+ getEventCoordinate(event: Event): ol.Coordinate;
+
+ /**
+ * Returns the map pixel position for a browser event relative to the viewport.
+ * @param event Event.
+ * @returns Pixel.
+ */
+ getEventPixel(event: Event): ol.Pixel;
+
+ /**
+ * Get the map interactions. Modifying this collection changes the interactions associated with the map.
+ * @returns Interactions
+ */
+ getInteractions(): ol.Collection;
+
+ /**
+ * Get the layergroup associated with this map.
+ * @returns A layer group containing the layers in this map.
+ */
+ getLayerGroup(): ol.layer.Group;
+
+ /**
+ * Get the collection of layers associated with this map.
+ * @returns Layers.
+ */
+ getLayers(): ol.Collection;
+
+ /**
+ * Get the map overlays. Modifying this collection changes the overlays associated with the map.
+ * @returns Overlays.
+ */
+ getOverlays(): ol.Collection;
+
+ /**
+ * Get the pixel for a coordinate. This takes a coordinate in the map view projection and returns the corresponding pixel.
+ * @param coordinate A map coordinate.
+ * @returns A pixel position in the map viewport.
+ */
+ getPixelFromCoordinate(coordinate: ol.Coordinate): ol.Pixel;
+
+ /**
+ * Get the size of this map.
+ * @returns The size in pixels of the map in the DOM.
+ */
+ getSize(): ol.Size;
+
+ /**
+ * Get the target in which this map is rendered. Note that this returns what is entered as an option or in setTarget: if that was an element, it returns an element; if a string, it returns that.
+ * @returns The Element or id of the Element that the map is rendered in.
+ */
+ getTarget(): Element | string;
+
+ /**
+ * Get the DOM element into which this map is rendered. In contrast to getTarget this method always return an Element, or null if the map has no target.
+ * @returns The element that the map is rendered in.
+ */
+ getTargetElement(): Element;
+
+ /**
+ * Get the view associated with this map. A view manages properties such as center and resolution.
+ * @returns The view that controls this map.
+ */
+ getView(): View;
+
+ /**
+ * Get the element that serves as the map viewport.
+ * @returns Viewport.
+ */
+ getViewport(): Element;
+
+ /**
+ * Detect if features intersect a pixel on the viewport. Layers included in the detection can be configured through opt_layerFilter. Feature overlays will always be included in the detection.
+ * @param pixel Pixel.
+ * @param layerFilter Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested. Feature overlays will always be tested.
+ * @param ref Value to use as this when executing layerFilter.
+ * @returns Is there a feature at the given pixel?
+ */
+ hasFeatureAtPixel(pixel: ol.Pixel, layerFilter?: (layer: ol.layer.Layer) => boolean, ref?: any): boolean;
+
+ /**
+ * Remove the given control from the map.
+ * @param Control.
+ * @returns The removed control (or undefined if the control was not found).
+ */
+ removeControl(control: ol.control.Control): ol.control.Control;
+
+ /**
+ * Remove the given interaction from the map.
+ * @param interaction Interaction to remove.
+ * @returns The removed interaction (or undefined if the interaction was not found).
+ */
+ removeInteraction(interaction: ol.interaction.Interaction): ol.interaction.Interaction;
+
+ /**
+ * Removes the given layer from the map.
+ * @param Layer.
+ * @returns The removed layer (or undefined if the layer was not found).
+ */
+ removeLayer(layer: ol.layer.Base): ol.layer.Base;
+
+ /**
+ * Remove the given overlay from the map.
+ * @param Overlay.
+ * @returns The removed overlay (or undefined if the overlay was not found).
+ */
+ removeOverlay(overlay: ol.Overlay): ol.Overlay;
+
+ /**
+ * Request a map rendering (at the next animation frame).
+ */
+ render(): void;
+
+ /**
+ * Requests an immediate render in a synchronous manner.
+ */
+ renderSync(): void;
+
+ /**
+ * Sets the layergroup of this map.
+ * @param layerGroup A layer group containing the layers in this map.
+ */
+ setLayerGroup(layerGroup: ol.layer.Group): void;
+
+ /**
+ * Set the size of this map.
+ * @param size The size in pixels of the map in the DOM.
+ */
+ setSize(size: ol.Size): void;
+
+ /**
+ * Set the target element to render this map into.
+ * @param target The Element that the map is rendered in.
+ */
+ setTarget(target: Element): void;
+
+ /**
+ * Set the target element to render this map into.
+ * @param target The id of the element that the map is rendered in.
+ */
+ setTarget(target: string): void;
+
+ /**
+ * Set the view for this map.
+ * @param view The view that controls this map.
+ */
+ setView(view: View): void;
+
+ /**
+ * Force a recalculation of the map viewport size. This should be called when third-party code changes the size of the map viewport.
+ * */
+ updateSize(): void;
+ }
+
+ /**
+ * Events emitted as map browser events are instances of this type. See ol.Map for which events trigger a map browser event.
+ */
+ class MapBrowserEvent extends MapEvent {
+
+ /**
+ * The coordinate of the original browser event
+ */
+ coordinate: Coordinate;
+
+ /**
+ * Indicates if the map is currently being dragged. Only set for POINTERDRAG and POINTERMOVE events. Default is false.
+ */
+ dragging: boolean;
+
+ /**
+ * The frame state at the time of the event
+ */
+ frameState: olx.FrameState;
+
+ /**
+ * The map where the event occured
+ */
+ map: Map;
+
+ /**
+ * The original browser event
+ */
+ originalEvent: Event;
+
+ /**
+ * The pixel of the original browser event.
+ */
+ pixel: Pixel;
+
+
+ // Methods
+
+ /**
+ * Prevents the default browser action.
+ */
+ preventDefault(): void;
+
+ /**
+ * Prevents further propagation of the current event.
+ */
+ stopPropagation(): void;
+ }
+
+ /**
+ * Events emitted as map events are instances of this type. See ol.Map for which events trigger a map event.
+ */
+ class MapEvent extends ol.events.Event {
+
+ /**
+ * The frame state at the time of the event.
+ */
+ frameState: olx.FrameState;
+
+ /**
+ * The map where the event occurred.
+ */
+ map: Map;
+ }
+
+ /**
+ * Abstract base class; normally only used for creating subclasses and not instantiated in apps. Most non-trivial classes inherit from this.
+ */
+ class Object extends Observable {
+
+ /**
+ * @constructor
+ * @param values An object with key-value pairs.
+ */
+ constructor(values?: Object);
+
+ /**
+ * Gets a value.
+ * @param key Key name.
+ * @returns Value.
+ */
+ get(key: string): any;
+
+ /**
+ * Get a list of object property names.
+ * @returns List of property names.
+ */
+ getKeys(): Array;
+
+ /**
+ * Get an object of all property names and values.
+ * @returns Object.
+ */
+ getProperties(): Object;
+
+ /**
+ * @returns Revision.
+ */
+ getRevision(): number;
+
+ /**
+ * Sets a value.
+ * @param key Key name.
+ * @param value Value.
+ */
+ set(key: string, value: any): void;
+
+ /**
+ * Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
+ * @param Values.
+ */
+ setProperties(values: Object): void;
+
+ /**
+ * Unsets a property.
+ */
+ unset(key: string): void;
+ }
+
+ /**
+ * Events emitted by ol.Object instances are instances of this type.
+ */
+ class ObjectEvent extends ol.events.Event {
+
+ /**
+ * The name of the property whose value is changing.
+ */
+ key: string;
+
+ /**
+ * The old value. To get the new value use e.target.get(e.key) where e is the event object.
+ */
+ oldValue: any;
+ }
+
+ /**
+ * Abstract base class; normally only used for creating subclasses and not instantiated in apps. An event target providing convenient methods for listener registration and unregistration. A generic change event is always available through ol.Observable#changed.
+ */
+ class Observable {
+
+ /**
+ * Removes an event listener using the key returned by on() or once().
+ */
+ unByKey(key: any): void;
+
+ /**
+ * Increases the revision counter and dispatches a 'change' event.
+ */
+ changed(): void;
+
+ /**
+ * @returns Revision.
+ */
+ getRevision(): number;
+
+ /**
+ * Listen for a certain type of event.
+ * @param type The event type.
+ * @param listener The listener function.
+ * @param ref The object to use as this in listener.
+ * @returns Unique key for the listener.
+ */
+ on(type: string, listener: (event: ol.events.Event) => void, ref?: any): any;
+
+ /**
+ * Listen for a certain type of event.
+ * @param type The array of event types.
+ * @param listener The listener function.
+ * @param ref The object to use as this in listener.
+ * @returns Unique key for the listener.
+ */
+ on(type: Array, listener: (event: ol.events.Event) => void, ref?: any): any;
+
+ /**
+ * Listen once for a certain type of event.
+ * @param type The event type.
+ * @param listener The listener function.
+ * @param ref The object to use as this in listener.
+ * @returns Unique key for the listener.
+ */
+ once(type: string, listener: (event: ol.events.Event) => void, ref?: any): any;
+
+ /**
+ * Listen once for a certain type of event.
+ * @param type The array of event types.
+ * @param listener The listener function.
+ * @param ref The object to use as this in listener.
+ * @returns Unique key for the listener.
+ */
+ once(type: Array, listener: (event: ol.events.Event) => void, ref?: any): any;
+
+ /**
+ * Unlisten for a certain type of event.
+ * @param type The array of event types.
+ * @param listener The listener function.
+ * @param ref The object to use as this in listener.
+ * @returns Unique key for the listener.
+ */
+ un(type: Array, listener: (event: ol.events.Event) => void, ref?: any): any;
+
+ /**
+ * Removes an event listener using the key returned by on() or once(). Note that using the ol.Observable.unByKey static function is to be preferred.
+ * @param key The key returned by on() or once()
+ */
+ unByKey(key: any): void;
+ }
+
+ /**
+ * An element to be displayed over the map and attached to a single map location.
+ */
+ class Overlay extends ol.Object {
+
+ /**
+ * @constructor
+ * @param options Overlay options.
+ */
+ constructor(options: olx.OverlayOptions);
+
+ /**
+ * Get the DOM element of this overlay.
+ * @returns The Element containing the overlay.
+ */
+ getElement(): Element;
+
+ /**
+ * Get the map associated with this overlay.
+ * @returns The map that the overlay is part of.
+ */
+ getMap(): ol.Map;
+
+ /**
+ * Get the offset of this overlay.
+ * @returns The offset.
+ */
+ getOffset(): Array;
+
+ /**
+ * Get the current position of this overlay.
+ * @returns The spatial point that the overlay is anchored at.
+ */
+ getPosition(): ol.Coordinate;
+
+ /**
+ * Get the current positioning of this overlay.
+ * @returns How the overlay is positioned relative to its point on the map.
+ */
+ getPositioning(): ol.OverlayPositioning;
+
+ /**
+ * Set the DOM element to be associated with this overlay.
+ * @param element The element containing the overlay.
+ */
+ setElement(element: Element): void;
+
+ /**
+ * Set the map to be associated with this overlay.
+ * @param map The map that the overlay is part of.
+ */
+ setMap(map: Map): void;
+
+ /**
+ * Set the offset for this overlay.
+ * @param offset Offset.
+ */
+ setOffset(offset: Array): void;
+
+ /**
+ * Set the position for this overlay. If the position is undefined the overlay is hidden.
+ * @param position The spatial point that the overlay is anchored at.
+ */
+ setPosition(position: ol.Coordinate): void;
+
+ /**
+ * Set the positioning for this overlay.
+ * @param How the overlay is positioned relative to its point on the map.
+ */
+ setPositioning(positioning: ol.OverlayPositioning): void;
+ }
+
+ /**
+ * Events emitted by ol.interaction.Select instances are instances of this type.
+ */
+ class SelectEvent extends ol.events.Event {
+
+ /**
+ * Deselected features array.
+ */
+ deselected: Array;
+
+ /**
+ * Associated ol.MapBrowserEvent;
+ */
+ mapBrowserEvent: ol.MapBrowserEvent;
+
+ /**
+ * Selected features array.
+ */
+ selected: Array
+ }
+
+ /**
+ * Class to create objects that can be used with ol.geom.Polygon.circular.
+ */
+ class Sphere {
+
+ /**
+ * @constructor
+ * @param radius Radius.
+ */
+ constructor(radius: number);
+
+ /**
+ * Returns the geodesic area for a list of coordinates.
+ * @param coordinates List of coordinates of a linear ring. If the ring is oriented clockwise, the area will be positive, otherwise it will be negative.
+ * @returns Area.
+ */
+ geodesicArea(coordinates: Array): number;
+
+ /**
+ * Returns the distance from c1 to c2 using the haversine formula.
+ * @param c1 Coordinate 1.
+ * @param c2 Coordinate 2.
+ * @returns Haversine distance.
+ */
+ haversineDistance(c1: ol.Coordinate, c2: ol.Coordinate): number;
+ }
+
+ /**
+ * Base class for tiles.
+ */
+ class Tile {
+
+ /**
+ * Get the tile coordinate for this tile.
+ * @returns TileCoord.
+ */
+ getTileCoord(): ol.TileCoord;
+ }
+
+ /**
+ * An ol.View object represents a simple 2D view of the map.
+ */
+ class View extends ol.Object {
+
+ /**
+ * @constructor
+ * @param options Options.
+ */
+ constructor(options?: olx.ViewOptions);
+
+ /**
+ * Calculate the extent for the current view state and the passed size. The size is the pixel dimensions of the box into which the calculated extent should fit. In most cases you want to get the extent of the entire map, that is map.getSize().
+ * @param size Box pixel size
+ * @returns Extent.
+ */
+ calculateExtent(size: ol.Size): ol.Extent;
+
+ /**
+ * Center on coordinate and view position.
+ * @param coordinate Coordinate.
+ * @param size Box pixel size
+ * @param position Position on the view to center on
+ */
+ centerOn(coordinate: ol.Coordinate, size: ol.Size, position: ol.Pixel): void;
+
+ /**
+ * Get the constrained center of this view.
+ * @param center Center.
+ * @returns Constrained center.
+ */
+ constrainCenter(center: ol.Coordinate): ol.Coordinate;
+
+ /**
+ * Get the constrained resolution of this view.
+ * @param resolution: Resolution.
+ * @param delta Delta. Default is 0.
+ * @param direction Direction. Default is 0.
+ * @returns Constrained resolution
+ */
+ constrainResolution(resolution: number, delta?: number, direction?: number): number;
+
+ /**
+ * Fit the map view to the passed extent and size. The size is pixel dimensions of the box to fit the extent into. In most cases you will want to use the map size, that is map.getSize().
+ * @param extent Extent.
+ * @param size Box pixel size.
+ * @param options Options
+ */
+ fit(geometry: ol.geom.SimpleGeometry | ol.Extent, size: ol.Size, opt_options?: olx.view.FitGeometryOptions): void;
+
+ /**
+ * Get the view center.
+ * @returns The center of the view.
+ */
+ getCenter(): ol.Coordinate;
+
+ /**
+ * Get the view projection
+ * @returns The projection of the view.
+ */
+ getProjection(): ol.proj.Projection;
+
+ /**
+ * Get the view resolution
+ * @returns The resolution of the view.
+ */
+ getResolution(): number;
+
+ /**
+ * Get the view rotation
+ * @returns The rotation of the view in radians
+ */
+ getRotation(): number;
+
+ /**
+ * Get the current zoom level. Return undefined if the current resolution is undefined or not a "constrained resolution".
+ * @returns Zoom.
+ */
+ getZoom(): number;
+
+ /**
+ * Rotate the view around a given coordinate.
+ * @param rotation New rotation value for the view.
+ * @param anchor The rotation center.
+ */
+ rotate(rotation: number, anchor: ol.Coordinate): void;
+
+ /**
+ * Set the center of the current view.
+ * @param center The center of the view.
+ */
+ setCenter(center: ol.Coordinate): void;
+
+ /**
+ * Set the resolution for this view.
+ * @param resolution The resolution of the view.
+ */
+ setResolution(resolution: number): void;
+
+ /**
+ * Set the rotation for this view.
+ * @param rotation The rotation of the view in radians.
+ */
+ setRotation(rotation: number): void;
+
+ /**
+ * Zoom to a specific zoom level.
+ * @param zoom Zoom level.
+ */
+ setZoom(zoom: number): void;
+ }
+
+ // NAMESPACES
+
+ /**
+ * The animation static methods are designed to be used with the ol.Map#beforeRender method.
+ */
+ namespace animation {
+
+ /**
+ * Generate an animated transition that will "bounce" the resolution as it approaches the final value.
+ * @param options Bounce options.
+ */
+ function bounce(options: olx.animation.BounceOptions): ol.PreRenderFunction;
+
+ /**
+ * Generate an animated transition while updating the view center.
+ * @param options Pan options.
+ */
+ function pan(options: olx.animation.PanOptions): ol.PreRenderFunction;
+
+ /**
+ * Generate an animated transition while updating the view rotation.
+ * @param options Rotate options.
+ */
+ function rotate(options: olx.animation.RotateOptions): ol.PreRenderFunction;
+
+ /**
+ * Generate an animated transition while updating the view resolution.
+ * @param options Zoom options.
+ */
+ function zoom(options: olx.animation.ZoomOptions): ol.PreRenderFunction;
+ }
+
+ /**
+ * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified.
+ */
+ namespace color {
+
+ /**
+ * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified.
+ * @param color Color.
+ */
+ function asArray(color: ol.Color): ol.Color;
+
+ /**
+ * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified.
+ * @param color Color.
+ */
+ function asArray(color: string): ol.Color;
+
+ /**
+ * Return the color as an rgba string.
+ * @param color Color.
+ */
+ function asString(color: ol.Color): string;
+
+ /**
+ * Return the color as an rgba string.
+ * @param color Color.
+ */
+ function asString(color: string): string;
+ }
+
+ namespace control {
+
+ /**
+ * Set of controls included in maps by default. Unless configured otherwise, this returns a collection containing an instance of each of the following controls: ol.control.Zoom, ol.control.Rotate, ol.control.Attribution
+ * @param options Defaults options
+ * @returns Control.s
+ */
+ function defaults(options?: olx.control.DefaultsOptions): ol.Collection;
+
+ namespace ScaleLine {
+
+ /**
+ * Units for the scale line. Supported values are 'degrees', 'imperial', 'nautical', 'metric', 'us'.
+ */
+ type Units = 'degrees' | 'imperial' | 'nautical' | 'metric' | 'us';
+ }
+
+ class Control extends ol.Object{
+ constructor(options: olx.control.ControlOptions);
+
+ /**
+ * Get the map associated with this control.
+ */
+ getMap():ol.Map;
+
+ /**
+ * Remove the control from its current map and attach it to the new map.
+ * Subclasses may set up event handlers to get notified about changes to the map here.
+ */
+ setMap(map: ol.Map):void;
+
+ /**
+ * This function is used to set a target element for the control.
+ * It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control).
+ * If no target is set in the options passed to the control constructor and if setTarget is not called then the control is
+ * added to the map's overlay container.
+ */
+ setTarget(target: Element | string):void;
+
+
+ }
+
+ class Attribution extends Control {
+ }
+
+ class FullScreen extends Control {
+ }
+
+ class MousePosition extends Control {
+ }
+
+ class OverviewMap extends Control {
+ constructor(options?: olx.OverviewMapOptions);
+
+ /**
+ * Update the overview map element.
+ * @param mapEvent
+ */
+ render(mapEvent: ol.MapEvent): void;
+
+ /**
+ * Determine if the overview map is collapsed.
+ */
+ getCollapsed(): boolean;
+
+ /**
+ * Return true if the overview map is collapsible, false otherwise.
+ */
+ getCollapsible(): boolean;
+
+ /**
+ * Return the overview map.
+ */
+ getOverviewMap(): ol.Map;
+
+ /**
+ * Collapse or expand the overview map according to the passed parameter. Will not do anything if the overview map isn't collapsible or if the current collapsed state is already the one requested.
+ * @param collapsed
+ */
+ setCollapsed(collapsed: boolean): void;
+
+ /**
+ * Set whether the overview map should be collapsible.
+ * @param collapsible
+ */
+ setCollapsible(collapsible: boolean): void;
+ }
+
+ class Rotate extends Control {
+ constructor(opt_options?: olx.RotateOptions);
+ }
+
+ class ScaleLine extends Control {
+
+ /**
+ * Return the units to use in the scale line.
+ */
+ getUnits(): ScaleLine.Units;
+
+ /**
+ * Set the units to use in the scale line.
+ */
+ setUnits(units: ScaleLine.Units): void;
+
+ }
+
+ class Zoom extends Control{
+ }
+
+ class ZoomSlider extends Control{
+ }
+
+ class ZoomToExtent extends Control{
+ constructor(options?: olx.ZoomToExtentOptions);
+ }
+ }
+
+ namespace coordinate {
+
+ /**
+ * Add delta to coordinate. coordinate is modified in place and returned by the function.
+ * @param coordinate Coordinate
+ * @param delta Delta
+ * @returns The input coordinate adjusted by the given delta.
+ */
+ function add(coordinate: ol.Coordinate, delta: ol.Coordinate): ol.Coordinate;
+
+ /**
+ * Returns a ol.CoordinateFormatType function that can be used to format a {ol.Coordinate} to a string.
+ * @param fractionDigits The number of digits to include after the decimal point. Default is 0.
+ * @returns Coordinate format
+ */
+ function createStringXY(fractionDigits?: number): ol.CoordinateFormatType;
+
+ /**
+ * Transforms the given ol.Coordinate to a string using the given string template. The strings {x} and {y} in the template will be replaced with the first and second coordinate values respectively.
+ * @param coordinate Coordinate
+ * @param template A template string with {x} and {y} placeholders that will be replaced by first and second coordinate values.
+ * @param fractionDigits The number of digits to include after the decimal point. Default is 0.
+ * @returns Formatted coordinate
+ */
+ function format(coordinate: ol.Coordinate, template: string, fractionDigits?: number): string;
+
+ /**
+ * Rotate coordinate by angle. coordinate is modified in place and returned by the function.
+ * @param coordinate Coordinate
+ * @param angle Angle in radian
+ * @returns Coordinatee
+ */
+ function rotate(coordinate: ol.Coordinate, angle: number): ol.Coordinate;
+
+ /**
+ * Format a geographic coordinate with the hemisphere, degrees, minutes, and seconds.
+ * @param coordinate COordinate
+ * @returns Hemisphere, degrees, minutes and seconds.
+ */
+ function toStringHDMS(coordinate?: ol.Coordinate): string;
+
+ /**
+ * Format a coordinate as a comma delimited string.
+ * @param coordinate Coordinate
+ * @param fractionDigits The number of digits to include after the decimal point. Default is 0.
+ * @returns XY
+ */
+ function toStringXY(coordinate?: ol.Coordinate, fractionDigits?: number): string;
+ }
+
+ /**
+ * Easing functions for ol.animation.
+ */
+ namespace easing {
+
+ /**
+ * Start slow and speed up.
+ * @param number Input between 0 and 1
+ * @returns Output between 0 and 1
+ */
+ function easeIn(t: number): number;
+
+ /**
+ * Start fast and slow down.
+ * @param number Input between 0 and 1
+ * @returns Output between 0 and 1
+ */
+ function easeOut(t: number): number;
+
+ /**
+ * Start slow, speed up, and then slow down again.
+ * @param number Input between 0 and 1
+ * @returns Output between 0 and 1
+ */
+ function inAndOut(t: number): number;
+
+ /**
+ * Maintain a constant speed over time.
+ * @param number Input between 0 and 1
+ * @returns Output between 0 and 1
+ */
+ function linear(t: number): number;
+
+ /**
+ * Start slow, speed up, and at the very end slow down again. This has the same general behavior as ol.easing.inAndOut, but the final slowdown is delayed.
+ * @param number Input between 0 and 1
+ * @returns Output between 0 and 1
+ */
+ function upAndDown(t: number): number;
+ }
+
+ namespace events {
+ namespace condition {
+ function altKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function altShiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function always(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function click(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function doubleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function mouseOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function never(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function noModifierKeys(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function platformModifierKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function pointerMove(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function shiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function singleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ function targetNotEditable(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+ }
+ interface ConditionType { (mapBrowseEvent: ol.MapBrowserEvent): boolean; }
+ class Event {
+ target: any;
+ type: string;
+ preventDefault(): void;
+ stopPropagation(): void;
+ }
+ }
+
+ namespace extent {
+
+ /**
+ * Apply a transform function to the extent.
+ * @param extent Extent
+ * @param transformFn Transform function. Called with [minX, minY, maxX, maxY] extent coordinates.
+ * @param destinationExtent Destination Extent
+ * @returns Extent
+ */
+ function applyTransform(extent: ol.Extent, transformFn: ol.TransformFunction, destinationExtent?: ol.Extent): ol.Extent;
+
+ /**
+ * Build an extent that includes all given coordinates.
+ * @param coordinates Coordinates
+ * @returns Bounding extent
+ */
+ function boundingExtent(coordinates: Array): ol.Extent;
+
+ /**
+ * Return extent increased by the provided value.
+ * @param extent Extent
+ * @param value The amount by which the extent should be buffered.
+ * @param destinationExtent Destination Extent
+ * @returns Extent
+ */
+ function buffer(extent: ol.Extent, value: number, destinationExtent?: ol.Extent): ol.Extent;
+
+ /**
+ * Check if the passed coordinate is contained or on the edge of the extent.
+ * @param extent Extent
+ * @param coordinate Coordinate
+ * @returns The coordinate is contained in the extent
+ */
+ function containsCoordinate(extent: ol.Extent, coordinate: ol.Coordinate): boolean;
+
+ /**
+ * Check if one extent contains another. An extent is deemed contained if it lies completely within the other extent, including if they share one or more edges.
+ * @param extent1 Extent 1
+ * @param extent2 Extent 2
+ * @returns The second extent is contained by or on the edge of the first
+ */
+ function containsExtent(extent1: ol.Extent, extent2: ol.Extent): boolean;
+
+ /**
+ * Check if the passed coordinate is contained or on the edge of the extent.
+ * @param extent Extent
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @returns The x, y values are contained in the extent.
+ */
+ function containsXY(extent: ol.Extent, x: number, y: number): boolean;
+
+ /**
+ * Create an empty extent.
+ * @returns Empty extent
+ */
+ function createEmpty(): ol.Extent;
+
+ /**
+ * Determine if two extents are equivalent.
+ * @param extent1 Extent 1
+ * @param extent2 Extent 2
+ * @returns The two extents are equivalent
+ */
+ function equals(extent1: ol.Extent, extent2: ol.Extent): boolean;
+
+ /**
+ * Modify an extent to include another extent.
+ * @param extent1 The extent to be modified.
+ * @param extent2 The extent that will be included in the first.
+ * @returns A reference to the first (extended) extent.
+ */
+ function extend(extent1: ol.Extent, extent2: ol.Extent): ol.Extent;
+
+ /**
+ * Get the bottom left coordinate of an extent.
+ * @param extent Extent
+ * @returns Bottom left coordinate
+ */
+ function getBottomLeft(extent: ol.Extent): ol.Coordinate;
+
+ /**
+ * Get the bottom right coordinate of an extent.
+ * @param extent Extent
+ * @returns Bottom right coordinate
+ */
+ function getBottomRight(extent: ol.Extent): ol.Coordinate;
+
+ /**
+ * Get the center coordinate of an extent.
+ * @param extent Extent
+ * @returns Center
+ */
+ function getCenter(extent: ol.Extent): ol.Coordinate;
+
+ /**
+ * Get the height of an extent.
+ * @param extent Extent
+ * @returns Height
+ */
+ function getHeight(extent: ol.Extent): number;
+
+ /**
+ * Get the intersection of two extents.
+ * @param extent1 Extent 1
+ * @param extent2 Extent 2
+ * @param extent Optional extent to populate with intersection.
+ * @returns Intersecting extent
+ */
+ function getIntersection(extent1: ol.Extent, extent2: ol.Extent, extent?: ol.Extent): ol.Extent;
+
+ /**
+ * Get the size (width, height) of an extent.
+ * @param extent Extent
+ * @returns The extent size
+ */
+ function getSize(extent: ol.Extent): ol.Size;
+
+ /**
+ * Get the top left coordinate of an extent.
+ * @param extent Extent
+ * @returns Top left coordinate
+ */
+ function getTopLeft(extent: ol.Extent): ol.Coordinate;
+
+ /**
+ * Get the top right coordinate of an extent.
+ * @param extent Extent
+ * @returns Top right coordinate
+ */
+ function getTopRight(extent: ol.Extent): ol.Coordinate;
+
+ /**
+ * Get the width of an extent.
+ * @param extent Extent
+ * @returns Width
+ */
+ function getWidth(extent: ol.Extent): number;
+
+ /**
+ * Determine if one extent intersects another.
+ * @param extent1 Extent 1
+ * @param extent2 Extent 2
+ * @returns The two extents intersects
+ */
+ function intersects(extent1: ol.Extent, extent2: ol.Extent): boolean;
+
+ /**
+ * Determine if an extent is empty.
+ * @param extent Extent
+ * @returns Is empty
+ */
+ function isEmpty(extent: ol.Extent): boolean;
+ }
+
+ /**
+ * Loading mechanisms for vector data.
+ */
+ namespace featureloader {
+
+ /**
+ * Create an XHR feature loader for a url and format. The feature loader loads features (with XHR), parses the features, and adds them to the vector source.
+ * @param url Feature URL Service
+ * @param format Feature format
+ * @returns The feature loader
+ */
+ function xhr(url: string, format: ol.format.Feature): ol.FeatureLoader;
+ }
+
+ namespace format {
+
+ // Type definitions
+ interface IGCZ extends String { }
+
+ // Classes
+ class EsriJSON {
+ }
+
+ class Feature {
+ }
+
+ /**
+ * Feature format for reading and writing data in the GeoJSON format.
+ */
+ class GeoJSON extends ol.format.JSONFeature {
+
+ /**
+ * @constructor
+ * @param Options
+ */
+ constructor(options?: olx.format.GeoJSONOptions);
+
+ /**
+ * Read a feature from a GeoJSON Feature source. Only works for Feature, use readFeatures to read FeatureCollection source.
+ * @param source Source
+ * @param options Read options
+ * @returns Feature
+ */
+ readFeature(source: Document | Node | JSON | string, options?: olx.format.ReadOptions): ol.Feature;
+
+ /**
+ * Read all features from a GeoJSON source. Works with both Feature and FeatureCollection sources.
+ * @param source Source
+ * @param options Read options
+ * @returns Features
+ */
+ readFeatures(source: Document | Node | JSON | string, options?: olx.format.ReadOptions): Array;
+
+ /**
+ * Read a geometry from a GeoJSON source.
+ * @param source Source
+ * @param options Read options
+ * @returns Geometry
+ */
+ readGeometry(source: Document | Node | JSON | string, options?: olx.format.ReadOptions): ol.geom.Geometry;
+
+ /**
+ * Read the projection from a GeoJSON source.
+ * @param Source
+ * @returns Projection
+ */
+ readProjection(source: Document | Node | JSON | string): ol.proj.Projection;
+
+ /**
+ * Encode a feature as a GeoJSON Feature string.
+ * @param feature Feature
+ * @param options Write options
+ * @returns GeoJSON
+ */
+ writeFeature(feature: ol.Feature, options?: olx.format.WriteOptions): string;
+
+ /**
+ * Encode a feature as a GeoJSON Feature object.
+ * @param feature Feature
+ * @param options Write options
+ * @returns GeoJSON object
+ */
+ writeFeatureObject(feature: ol.Feature, options?: olx.format.WriteOptions): JSON;
+
+ /**
+ * Encode an array of features as GeoJSON.
+ * @param features Features
+ * @param options Write options
+ * @returns GeoJSON
+ */
+ writeFeatures(features: Array, options?: olx.format.WriteOptions): string;
+
+ /**
+ * Encode an array of features as a GeoJSON object.
+ * @param features Features
+ * @param options Write options
+ * @returns GeoJSON object
+ */
+ writeFeaturesObject(features: Array, options?: olx.format.WriteOptions): JSON;
+
+ /**
+ * Encode a geometry as a GeoJSON string.
+ * @param geometry Geometry
+ * @param options Write options
+ * @returns GeoJSON
+ */
+ writeGeometry(geometry: ol.geom.Geometry, options?: olx.format.WriteOptions): string;
+
+ /**
+ * Encode a geometry as a GeoJSON object.
+ * @param geometry Geometry
+ * @options Write options
+ * @returns GeoJSON object
+ */
+ writeGeometryObject(geometry: ol.geom.Geometry, options?: olx.format.WriteOptions): JSON;
+ }
+
+ class GML {
+ }
+
+ class GML2 {
+ }
+
+ class GML3 {
+ }
+
+ class GMLBase {
+ }
+
+ class GPX {
+ }
+
+ class IGC {
+ }
+
+ class JSONFeature {
+ }
+
+ class KML {
+ }
+
+ class OSMXML {
+ }
+
+ class Polyline {
+ }
+
+ class TextFeature {
+ }
+
+ class TopoJSON {
+ }
+
+ class WFS {
+ readFeatures(source: Document | Node | Object | string, option?: olx.format.ReadOptions): Array;
+ }
+
+ class WKT {
+ constructor(opt_options?: olx.format.WKTOptions);
+
+ /**
+ * Read a feature from a WKT source.
+ * @param source Source
+ * @param options Read options
+ * @returns Feature
+ */
+ readFeature(source: Document | Node | JSON | string, opt_options?: olx.format.ReadOptions): ol.Feature;
+
+ /**
+ * Read all features from a WKT source.
+ * @param source Source
+ * @param options Read options
+ * @returns Features
+ */
+ readFeatures(source: Document | Node | JSON | string, options?: olx.format.ReadOptions): Array;
+
+ /**
+ * Read a geometry from a GeoJSON source.
+ * @param source Source
+ * @param options Read options
+ * @returns Geometry
+ */
+ readGeometry(source: Document | Node | JSON | string, options?: olx.format.ReadOptions): ol.geom.Geometry;
+
+ /**
+ * Encode a feature as a WKT string.
+ * @param feature Feature
+ * @param options Write options
+ * @returns GeoJSON
+ */
+ writeFeature(feature: ol.Feature, options?: olx.format.WriteOptions): string;
+
+ /**
+ * Encode an array of features as a WKT string.
+ * @param features Features
+ * @param options Write options
+ * @returns GeoJSON
+ */
+ writeFeatures(features: Array, options?: olx.format.WriteOptions): string;
+
+ /**
+ * Write a single geometry as a WKT string.
+ * @param geometry Geometry
+ * @param options Write options
+ * @returns GeoJSON
+ */
+ writeGeometry(geometry: ol.geom.Geometry, options?: olx.format.WriteOptions): string;
+ }
+
+ class WMSCapabilities {
+ }
+
+ class WMSGetFeatureInfo {
+ }
+
+ class WMTSCapabilities {
+ }
+
+ class XML {
+ }
+
+ class XMLFeature {
+ }
+ }
+
+ namespace geom {
+
+ // Type definitions
+ interface GeometryLayout extends String { }
+ interface GeometryType extends String { }
+
+ /**
+ * Abstract base class; only used for creating subclasses; do not instantiate
+ * in apps, as cannot be rendered.
+ */
+ class Circle extends ol.geom.SimpleGeometry {
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Transform each coordinate of the circle from one coordinate reference system
+ * to another. The geometry is modified in place.
+ * If you do not want the geometry modified in place, first clone() it and
+ * then use this function on the clone.
+ *
+ * Internally a circle is currently represented by two points: the center of
+ * the circle `[cx, cy]`, and the point to the right of the circle
+ * `[cx + r, cy]`. This `transform` function just transforms these two points.
+ * So the resulting geometry is also a circle, and that circle does not
+ * correspond to the shape that would be obtained by transforming every point
+ * of the original circle.
+ * @param source The current projection. Can be a string identifier or a {@link ol.proj.Projection} object.
+ * @param destination The desired projection. Can be a string identifier or a {@link ol.proj.Projection} object.
+ * @returns This geometry. Note that original geometry is modified in place.
+ */
+ transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike): ol.geom.Circle;
+ }
+
+ /**
+ * Abstract base class; normally only used for creating subclasses and not instantiated in apps. Base class for vector geometries.
+ */
+ class Geometry extends ol.Object {
+
+ /**
+ * Return the closest point of the geometry to the passed point as coordinate.
+ * @param point Point
+ * @param closestPoint Closest Point
+ * @returns Closest Point
+ */
+ getClosestPoint(point: ol.Coordinate, closestPoint?: ol.Coordinate): ol.Coordinate;
+
+ /**
+ * Get the extent of the geometry.
+ * @param Extent
+ * @returns Extent
+ */
+ getExtent(extent?: ol.Extent): ol.Extent;
+
+ /**
+ * Transform each coordinate of the geometry from one coordinate reference system to another.
+ * The geometry is modified in place. For example, a line will be transformed to a line and a
+ * circle to a circle. If you do not want the geometry modified in place, first clone() it and
+ * then use this function on the clone.
+ * @param source The current projection. Can be a string identifier or a ol.proj.Projection object.
+ * @param destination The desired projection. Can be a string identifier or a ol.proj.Projection object.
+ * @return This geometry. Note that original geometry is modified in place.
+ */
+ transform(source: ol.proj.ProjectionLike | ol.proj.Projection, destination: ol.proj.ProjectionLike | ol.proj.Projection): ol.geom.Geometry;
+ }
+
+ /**
+ * An array of ol.geom.Geometry objects.
+ */
+ class GeometryCollection extends ol.geom.Geometry {
+
+ /**
+ * constructor
+ * @param geometries Geometries.
+ */
+ constructor(geometries?: Array);
+
+ /**
+ * Apply a transform function to each coordinate of the geometry. The geometry is modified in place.
+ * If you do not want the geometry modified in place, first clone() it and then use this function on the clone.
+ * @param transformFn TransformFunction
+ */
+ applyTransform(transformFn: ol.TransformFunction): void;
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.GeometryCollection;
+
+ /**
+ * Return the geometries that make up this geometry collection.
+ * @returns Geometries.
+ */
+ getGeometries(): Array;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the geometries that make up this geometry collection.
+ * @param geometries Geometries.
+ */
+ setGeometries(geometries: Array): void;
+
+ }
+
+ /**
+ * Linear ring geometry. Only used as part of polygon; cannot be rendered
+ * on its own.
+ */
+ class LinearRing extends SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: Array, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.LinearRing;
+
+ /**
+ * Return the area of the linear ring on projected plane.
+ * @returns Area (on projected plane).
+ */
+ getArea(): number;
+
+ /**
+ * Return the coordinates of the linear ring.
+ * @returns Coordinates.
+ */
+ getCoordinates(): Array;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * @Set the coordinates of the linear ring
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: Array, layout?: any): void;
+
+ }
+
+ /**
+ * Linestring geometry.
+ */
+ class LineString extends ol.geom.SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: Array, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Append the passed coordinate to the coordinates of the linestring.
+ * @param coordinate Coordinate.
+ */
+ appendCoordinate(coordinate: ol.Coordinate): void;
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.LineString;
+
+ /**
+ * Returns the coordinate at `m` using linear interpolation, or `null` if no
+ * such coordinate exists.
+ *
+ * `extrapolate` controls extrapolation beyond the range of Ms in the
+ * MultiLineString. If `extrapolate` is `true` then Ms less than the first
+ * M will return the first coordinate and Ms greater than the last M will
+ * return the last coordinate.
+ *
+ * @param m M.
+ * @param extrapolate Extrapolate. Default is `false`.
+ * @returns Coordinate.
+ */
+ getCoordinateAtM(m: number, extrapolate?: boolean): ol.Coordinate;
+
+ /**
+ * Return the coordinates of the linestring.
+ * @returns Coordinates.
+ */
+ getCoordinates(): Array;
+
+ /**
+ * Return the length of the linestring on projected plane.
+ * @returns Length (on projected plane).
+ */
+ getLength(): number;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the coordinates of the linestring.
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: Array, layout?: ol.geom.GeometryLayout): void;
+ }
+
+ /**
+ * Multi-linestring geometry.
+ */
+ class MultiLineString extends ol.geom.SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: Array>, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Append the passed linestring to the multilinestring.
+ * @param lineString LineString.
+ */
+ appendLineString(lineString: ol.geom.LineString): void;
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.MultiLineString;
+
+ /**
+ * Returns the coordinate at `m` using linear interpolation, or `null` if no
+ * such coordinate exists.
+ *
+ * `extrapolate` controls extrapolation beyond the range of Ms in the
+ * MultiLineString. If `extrapolate` is `true` then Ms less than the first
+ * M will return the first coordinate and Ms greater than the last M will
+ * return the last coordinate.
+ *
+ * `interpolate` controls interpolation between consecutive LineStrings
+ * within the MultiLineString. If `interpolate` is `true` the coordinates
+ * will be linearly interpolated between the last coordinate of one LineString
+ * and the first coordinate of the next LineString. If `interpolate` is
+ * `false` then the function will return `null` for Ms falling between
+ * LineStrings.
+ *
+ * @param m M.
+ * @param extrapolate Extrapolate. Default is `false`.
+ * @param interpolate Interpolate. Default is `false`.
+ * @returns Coordinate.
+ */
+ getCoordinateAtM(m: number, extrapolate?: boolean, interpolate?: boolean): ol.Coordinate;
+
+ /**
+ * Return the coordinates of the multilinestring.
+ * @returns Coordinates.
+ */
+ getCoordinates(): Array>;
+
+ /**
+ * Return the linestring at the specified index.
+ * @param index Index.
+ * @returns LineString.
+ */
+ getLineString(index: number): ol.geom.LineString;
+
+ /**
+ * Return the linestrings of this multilinestring.
+ * @returns LineStrings.
+ */
+ getLineStrings(): Array;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the coordinates of the multilinestring.
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: Array>, layout?: ol.geom.GeometryLayout): void;
+ }
+
+ /**
+ * Multi-point geometry.
+ */
+ class MultiPoint extends ol.geom.SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: Array, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Append the passed point to this multipoint.
+ * @param {ol.geom.Point} point Point.
+ */
+ appendPoint(point: ol.geom.Point): void;
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.MultiPoint;
+
+ /**
+ * Return the coordinates of the multipoint.
+ * @returns Coordinates.
+ */
+ getCoordinates(): Array;
+
+ /**
+ * Return the point at the specified index.
+ * @param index Index.
+ * @returns Point.
+ */
+ getPoint(index: number): ol.geom.Point;
+
+ /**
+ * Return the points of this multipoint.
+ * @returns Points.
+ */
+ getPoints(): Array;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the coordinates of the multipoint.
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: Array, layout?: ol.geom.GeometryLayout): void;
+ }
+
+ /**
+ * Multi-polygon geometry.
+ */
+ class MultiPolygon extends ol.geom.SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: Array>>, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Append the passed polygon to this multipolygon.
+ * @param polygon Polygon.
+ */
+ appendPolygon(polygon: ol.geom.Polygon): void;
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.MultiPolygon;
+
+ /**
+ * Return the area of the multipolygon on projected plane.
+ * @returns Area (on projected plane).
+ */
+ getArea(): number;
+
+ /**
+ * Get the coordinate array for this geometry. This array has the structure
+ * of a GeoJSON coordinate array for multi-polygons.
+ *
+ * @param right Orient coordinates according to the right-hand
+ * rule (counter-clockwise for exterior and clockwise for interior rings).
+ * If `false`, coordinates will be oriented according to the left-hand rule
+ * (clockwise for exterior and counter-clockwise for interior rings).
+ * By default, coordinate orientation will depend on how the geometry was
+ * constructed.
+ * @returns Coordinates.
+ */
+ getCoordinates(right?: boolean): Array>>;
+
+ /**
+ * Return the interior points as {@link ol.geom.MultiPoint multipoint}.
+ * @returns Interior points.
+ */
+ getInteriorPoints(): ol.geom.MultiPoint;
+
+ /**
+ * Return the polygon at the specified index.
+ * @param index Index.
+ * @returns Polygon.
+ */
+ getPolygon(index: number): ol.geom.Polygon;
+
+ /**
+ * Return the polygons of this multipolygon.
+ * @returns Polygons.
+ */
+ getPolygons(): Array;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the coordinates of the multipolygon.
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: Array>>, layout?: ol.geom.GeometryLayout): void;
+ }
+
+ /**
+ * Point geometry.
+ */
+ class Point extends SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: ol.Coordinate, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.Point;
+
+ /**
+ * Return the coordinate of the point.
+ * @returns Coordinates.
+ */
+ getCoordinates(): ol.Coordinate;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the coordinate of the point.
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: ol.Coordinate, layout?: ol.geom.GeometryLayout): void;
+ }
+
+ /**
+ * Polygon geometry.
+ */
+ class Polygon extends SimpleGeometry {
+
+ /**
+ * constructor
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ constructor(coordinates: Array>, layout?: ol.geom.GeometryLayout);
+
+ /**
+ * Create an approximation of a circle on the surface of a sphere.
+ * @param sphere The sphere.
+ * @param center Center (`[lon, lat]` in degrees).
+ * @param radius The great-circle distance from the center to the polygon vertices.
+ * @param n Optional number of vertices for the resulting polygon. Default is `32`.
+ * @returns The "circular" polygon.
+ */
+ static circular(sphere: ol.Sphere, center: ol.Coordinate, radius: number, n?: number): ol.geom.Polygon;
+
+ /**
+ * Append the passed linear ring to this polygon.
+ * @param linearRing Linear ring.
+ */
+ appendLinearRing(linearRing: ol.geom.LinearRing): void;
+
+ /**
+ * Make a complete copy of the geometry.
+ * @returns Clone.
+ */
+ clone(): ol.geom.Polygon;
+
+ /**
+ * Return the area of the polygon on projected plane.
+ * @returns Area (on projected plane).
+ */
+ getArea(): number;
+
+ /**
+ * Get the coordinate array for this geometry. This array has the structure
+ * of a GeoJSON coordinate array for polygons.
+ *
+ * @param right Orient coordinates according to the right-hand
+ * rule (counter-clockwise for exterior and clockwise for interior rings).
+ * If `false`, coordinates will be oriented according to the left-hand rule
+ * (clockwise for exterior and counter-clockwise for interior rings).
+ * By default, coordinate orientation will depend on how the geometry was
+ * constructed.
+ * @returns Coordinates.
+ */
+ getCoordinates(right?: boolean): Array>;
+
+ /**
+ * Return an interior point of the polygon.
+ * @returns Interior point.
+ */
+ getInteriorPoint(): ol.geom.Point;
+
+ /**
+ * Return the Nth linear ring of the polygon geometry. Return `null` if the
+ * given index is out of range.
+ * The exterior linear ring is available at index `0` and the interior rings
+ * at index `1` and beyond.
+ *
+ * @param index Index.
+ * @returns Linear ring.
+ */
+ getLinearRing(index: number): ol.geom.LinearRing;
+
+ /**
+ * Return the linear rings of the polygon.
+ * @returns Linear rings.
+ */
+ getLinearRings(): Array;
+
+ /**
+ * Get the type of this geometry.
+ * @returns Geometry type
+ */
+ getType(): ol.geom.GeometryType;
+
+ /**
+ * Test if the geometry and the passed extent intersect.
+ * @param extent Extent
+ * @returns true if the geometry and the extent intersect.
+ */
+ intersectsExtent(extent: ol.Extent): boolean;
+
+ /**
+ * Set the coordinates of the polygon.
+ * @param coordinates Coordinates.
+ * @param layout Layout.
+ */
+ setCoordinates(coordinates: Array>, layout?: ol.geom.GeometryLayout): void;
+ }
+ /**
+ * Abstract base class; only used for creating subclasses; do not instantiate
+ * in apps, as cannot be rendered.
+ */
+ class SimpleGeometry extends ol.geom.Geometry {
+
+ /**
+ * Apply a transform function to each coordinate of the geometry. The geometry is modified in place.
+ * If you do not want the geometry modified in place, first clone() it and then use this function on the clone.
+ * @param transformFn TransformFunction
+ */
+ applyTransform(transformFn: ol.TransformFunction): void;
+
+ /**
+ * Return the first coordinate of the geometry.
+ * @returns First coordinate.
+ */
+ getFirstCoordinate(): ol.Coordinate;
+
+ /**
+ * Return the last coordinate of the geometry.
+ * @returns Last point.
+ */
+ getLastCoordinate(): ol.Coordinate;
+
+ /**
+ * Return the {@link ol.geom.GeometryLayout layout} of the geometry.
+ * @returns Layout.
+ */
+ getLayout(): ol.geom.GeometryLayout;
+
+ /**
+ * Translate the geometry. This modifies the geometry coordinates in place.
+ * If instead you want a new geometry, first clone() this geometry.
+ * @param deltaX Delta X
+ * @param deltaY Delta Y
+ */
+ translate(deltaX: number, deltaY: number): void;
+ }
+ }
+
+ namespace has {
+ }
+
+ namespace interaction {
+ /**
+ * Allows the user to zoom by double-clicking on the map.
+ */
+ class DoubleClickZoom extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.DoubleClickZoomOptions);
+ }
+ /**
+ * Handles input of vector data by drag and drop.
+ */
+ class DragAndDrop extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.DragAndDropOptions);
+ }
+ /**
+ * Events emitted by ol.interaction.DragAndDrop instances are instances of this type.
+ */
+ class DragAndDropEvent extends ol.events.Event {
+ }
+ /**
+ * Allows the user to draw a vector box by clicking and dragging on the map,
+ * normally combined with an ol.events.condition that limits it to when the shift or other key is held down.
+ * This is used, for example, for zooming to a specific area of the map
+ * (see ol.interaction.DragZoom and ol.interaction.DragRotateAndZoom).
+ *
+ * This interaction is only supported for mouse devices.
+ */
+ class DragBox extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.DragBoxOptions);
+ /**
+ * Returns geometry of last drawn box.
+ */
+ getGeometry(): ol.geom.Polygon;
+ }
+ /**
+ * Allows the user to pan the map by dragging the map.
+ */
+ class DragPan extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.DragPanOptions);
+ }
+ /**
+ * Allows the user to rotate the map by clicking and dragging on the map,
+ * normally combined with an ol.events.condition that limits it to when the alt and shift keys are held down.
+ *
+ * This interaction is only supported for mouse devices.
+ */
+ class DragRotate extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.DragRotateOptions);
+ }
+ /**
+ * Allows the user to zoom and rotate the map by clicking and dragging on the map.
+ * By default, this interaction is limited to when the shift key is held down.
+ *
+ * This interaction is only supported for mouse devices.
+ *
+ * And this interaction is not included in the default interactions.
+ */
+ class DragRotateAndZoom extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.DragRotateAndZoomOptions);
+ }
+ /**
+ * Allows the user to zoom the map by clicking and dragging on the map,
+ * normally combined with an ol.events.condition that limits it to when a key, shift by default, is held down.
+ *
+ * To change the style of the box, use CSS and the .ol-dragzoom selector, or your custom one configured with className.
+ */
+ class DragZoom extends ol.interaction.DragBox {
+ constructor(opt_options?: olx.interaction.DragZoomOptions);
+ }
+ /**
+ * Interaction for drawing feature geometries.
+ */
+ class Draw extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.DrawOptions);
+ }
+ /**
+ * Events emitted by ol.interaction.Draw instances are instances of this type.
+ */
+ class DrawEvent extends ol.events.Event {
+ /**
+ * The feature being drawn.
+ */
+ feature: ol.Feature;
+ /**
+ * The event target.
+ */
+ target: ol.Object;
+ /**
+ * The event type.
+ */
+ type: string;
+ }
+ /**
+ * Abstract base class; normally only used for creating subclasses and not instantiated in apps.
+ * User actions that change the state of the map. Some are similar to controls, but are not associated with a DOM element.
+ * For example, ol.interaction.KeyboardZoom is functionally the same as ol.control.Zoom, but triggered by a keyboard event
+ * not a button element event. Although interactions do not have a DOM element,
+ * some of them do render vectors and so are visible on the screen.
+ */
+ class Interaction extends ol.Object {
+ constructor (options: olx.interaction.InteractionOptions)
+ /**
+ * Return whether the interaction is currently active.
+ */
+ getActive (): boolean;
+ /**
+ * Get the map associated with this interaction.
+ */
+ getMap (): ol.Map;
+ /**
+ * Activate or deactivate the interaction.
+ */
+ setActive (active: boolean): void;
+ }
+ /**
+ * Allows the user to pan the map using keyboard arrows. Note that, although this interaction is by default included in maps,
+ * the keys can only be used when browser focus is on the element to which the keyboard events are attached.
+ * By default, this is the map div, though you can change this with the keyboardEventTarget in ol.Map.
+ * document never loses focus but, for any other element, focus will have to be on, and returned to,
+ * this element if the keys are to function. See also ol.interaction.KeyboardZoom.
+ */
+ class KeyboardPan extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.KeyboardPanOptions);
+ }
+ /**
+ * Allows the user to zoom the map using keyboard + and -. Note that, although this interaction is by default included in maps,
+ * the keys can only be used when browser focus is on the element to which the keyboard events are attached. By default,
+ * this is the map div, though you can change this with the keyboardEventTarget in ol.Map. document never loses focus but,
+ * for any other element, focus will have to be on, and returned to, this element if the keys are to function.
+ * See also ol.interaction.KeyboardPan.
+ */
+ class KeyboardZoom extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.KeyboardZoomOptions);
+ }
+ /**
+ * Interaction for modifying feature geometries.
+ */
+ class Modify extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.ModifyOptions);
+ }
+ /**
+ * Allows the user to zoom the map by scrolling the mouse wheel.
+ */
+ class MouseWheelZoom extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.MouseWheelZoomOptions);
+ }
+ /**
+ * Allows the user to rotate the map by twisting with two fingers on a touch screen.
+ */
+ class PinchRotate extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.PinchRotateOptions);
+ }
+ /**
+ * Allows the user to zoom the map by pinching with two fingers on a touch screen.
+ */
+ class PinchZoom extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.PinchZoomOptions);
+ }
+ /**
+ * Base class that calls user-defined functions on down, move and up events. This class also manages "drag sequences".
+ *
+ * When the handleDownEvent user function returns true a drag sequence is started. During a drag sequence the handleDragEvent
+ * user function is called on move events. The drag sequence ends when the handleUpEvent user function is called and returns false.
+ */
+ class Pointer extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.PointerOptions);
+ }
+ /**
+ * Interaction for selecting vector features. By default, selected features are styled differently, so this interaction can be used
+ * for visual highlighting, as well as selecting features for other actions, such as modification or output. There are three ways of
+ * controlling which features are selected: using the browser event as defined by the condition and optionally the toggle,
+ * add/remove, and multi options; a layers filter; and a further feature filter using the filter option.
+ *
+ * Selected features are added to an internal unmanaged layer.
+ */
+ class Select extends ol.interaction.Interaction {
+ constructor(opt_options?: olx.interaction.SelectOptions);
+ /**
+ * Returns the associated vectorlayer of the (last) selected feature.
+ * Note that this will not work with any programmatic method like pushing features to collection.
+ */
+ getLayer(): ol.layer.Layer;
+ /**
+ * Get the selected features.
+ */
+ getFeatures(): ol.Collection;
+ }
+ /**
+ * Events emitted by ol.interaction.Select instances are instances of this type.
+ */
+ class SelectEvent extends ol.events.Event {
+ /**
+ * Deselectd features array.
+ */
+ deselected: Array;
+ /**
+ * Associated ol.MapBrowserEvent.
+ */
+ mapBrowserEvent: ol.MapBrowserEvent;
+ /**
+ * Selected features array.
+ */
+ selected: Array;
+ /**
+ * The event target.
+ */
+ target: ol.Object;
+ /**
+ * The event type.
+ */
+ type: string;
+ /**
+ * Stop event propagation.
+ */
+ preventDefault(): void;
+ /**
+ * Stop event propagation.
+ */
+ stopPropagation(): void;
+ }
+ /**
+ * Handles snapping of vector features while modifying or drawing them. The features can come from a ol.source.Vector or
+ * ol.Collection Any interaction object that allows the user to interact with the features using the mouse can benefit
+ * from the snapping, as long as it is added before.
+ *
+ *The snap interaction modifies map browser event coordinate and pixel properties to force the snap to occur
+ * to any interaction that them.
+ */
+ class Snap extends ol.interaction.Pointer {
+ constructor(opt_options?: olx.interaction.SnapOptions);
+ }
+ /**
+ * Set of interactions included in maps by default. Specific interactions can be excluded by setting the appropriate option
+ * to false in the constructor options, but the order of the interactions is fixed. If you want to specify a different order for
+ * interactions, you will need to create your own ol.interaction.Interaction instances and insert them into a ol.Collection in
+ * the order you want before creating your ol.Map instance.
+ */
+ function defaults(opts: olx.interaction.DefaultsOptions): ol.Collection;
+ /**
+ * Function that takes coordinates and an optional existing geometry as arguments, and returns a geometry.
+ * The optional existing geometry is the geometry that is returned when the function is called without a second argument.
+ */
+ interface DrawGeometryFunctionType { (coordinates: ol.Coordinate, geom?: ol.geom.Geometry): ol.geom.Geometry; }
+ /**
+ * A function that takes an ol.Feature or ol.render.Feature and an ol.layer.Layer and returns true if the feature
+ * may be selected or false otherwise.
+ */
+ interface SelectFilterFunction { (feature: ol.Feature | ol.render.Feature, layer: ol.layer.Layer): boolean; }
+ /**
+ * A function that takes a ol.MapBrowserEvent and two ol.Pixels and returns a {boolean}.
+ * If the condition is met, true should be returned.
+ */
+ interface DragBoxEndConditionType {
+ (evt: ol.MapBrowserEvent, startPixel: ol.Pixel, endPixel: ol.Pixel): boolean
+ }
+ }
+
+ namespace layer {
+ /**
+ * Abstract base class; normally only used for creating subclasses and not instantiated in apps. Note that with ol.layer.Base and all its subclasses, any property set in the options is set as a ol.Object property on the layer object, so is observable, and has get/set accessors.
+ */
+ class Base extends ol.Object {
+
+ /**
+ * @constructor
+ * @param options Layer options.
+ */
+ constructor(options?: olx.layer.BaseOptions);
+
+ /**
+ * Return the brightness of the layer.
+ * @returns The brightness of the layer.
+ */
+ getBrightness(): number;
+
+ /**
+ * Return the contrast of the layer.
+ * @returns The contrast of the layer.
+ */
+ getContrast(): number;
+
+ /**
+ * Return the extent of the layer or undefined if it will be visible regardless of extent.
+ * @returns The layer extent.
+ */
+ getExtent(): ol.Extent;
+
+ /**
+ * Return the hue of the layer.
+ * @returns The hue of the layer
+ */
+ getHue(): number;
+
+ /**
+ * Return the maximum resolution of the layer.
+ * @returns The maximum resolution of the layer
+ */
+ getMaxResolution(): number;
+
+ /**
+ * Return the minimum resolution of the layer.
+ * @returns The minimum resolution of the layer.
+ */
+ getMinResolution(): number;
+
+ /**
+ * Return the opacity of the layer (between 0 and 1).
+ * @returns The opacity of the layer.
+ */
+ getOpacity(): number;
+
+ /**
+ * Return the saturation of the layer.
+ * @returns The saturation of the layer.
+ */
+ getSaturation(): number;
+
+ /**
+ * Return the visibility of the layer (true or false).
+ * The visibility of the layer
+ */
+ getVisible(): boolean;
+
+ /**
+ * Adjust the layer brightness. A value of -1 will render the layer completely black. A value of 0 will leave the brightness unchanged. A value of 1 will render the layer completely white. Other values are linear multipliers on the effect (values are clamped between -1 and 1).
+ * @param brightness The brightness of the layer
+ */
+ setBrightness(brigthness: number): void;
+
+ /**
+ * Adjust the layer contrast. A value of 0 will render the layer completely grey. A value of 1 will leave the contrast unchanged. Other values are linear multipliers on the effect (and values over 1 are permitted).
+ * @param contrast The contrast of the layer
+ */
+ setContrast(contrast: number): void;
+
+ /**
+ * Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents.
+ * @param extent The extent of the layer
+ */
+ setExtent(extent?: ol.Extent): void;
+
+ /**
+ * Apply a hue-rotation to the layer. A value of 0 will leave the hue unchanged. Other values are radians around the color circle.
+ * @param hue The hue of the layer
+ */
+ setHue(hue: number): void;
+
+ /**
+ * Set the maximum resolution at which the layer is visible.
+ * @param maxResolution The maximum resolution of the layer.
+ */
+ setMaxResolution(maxResolution: number): void;
+
+ /**
+ * Set the minimum resolution at which the layer is visible.
+ * @param minResolution The minimum resolution of the layer.
+ */
+ setMinResolution(minResolution: number): void;
+
+ /**
+ * Set the opacity of the layer, allowed values range from 0 to 1.
+ * @param opactity The opacity of the layer.
+ */
+ setOpacity(opacity: number): void;
+
+ /**
+ * Adjust layer saturation. A value of 0 will render the layer completely unsaturated. A value of 1 will leave the saturation unchanged. Other values are linear multipliers of the effect (and values over 1 are permitted).
+ * @param saturation The saturation of the layer.
+ */
+ setSaturation(saturation: number): void;
+
+ /**
+ * Set the visibility of the layer (true or false).
+ * @param visible The visibility of the layer.
+ */
+ setVisible(visible: boolean): void;
+ }
+
+ /**
+ * A ol.Collection of layers that are handled together.
+ */
+ class Group extends ol.layer.Base {
+
+ /**
+ * @constructor
+ * @param options Layer options.
+ */
+ constructor(options?: olx.layer.GroupOptions);
+
+ /**
+ * Returns the collection of layers in this group.
+ * @returns Collection of layers that are part of this group.
+ */
+ getLayers(): ol.Collection;
+
+ /**
+ * Set the collection of layers in this group.
+ * @param layers Collection of layers that are part of this group.
+ */
+ setLayers(layers: ol.Collection): void;
+ }
+
+ /**
+ * Layer for rendering vector data as a heatmap. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors.
+ */
+ class Heatmap extends ol.layer.Vector {
+
+ /**
+ * @constructor
+ * @param options Options
+ */
+ constructor(options?: olx.layer.HeatmapOptions);
+
+ /**
+ * Return the blur size in pixels.
+ * @returns Blur size in pixels
+ */
+ getBlur(): number;
+
+ /**
+ * Return the gradient colors as array of strings.
+ * @returns Colors
+ */
+ getGradient(): Array;
+
+ /**
+ * Return the size of the radius in pixels.
+ * @returns Radius size in pixel
+ */
+ getRadius(): number;
+
+ /**
+ * Set the blur size in pixels.
+ * @param blur Blur size in pixels
+ */
+ setBlur(blur: number): void;
+
+ /**
+ * Set the gradient colors as array of strings.
+ * @param colors Gradient
+ */
+ setGradient(colors: Array): void;
+
+ /**
+ * Set the size of the radius in pixels.
+ * @param radius Radius size in pixels
+ */
+ setRadius(radius: number): void;
+ }
+
+ /**
+ * Server-rendered images that are available for arbitrary extents and resolutions. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors.
+ */
+ class Image extends ol.layer.Layer {
+
+ /**
+ * @constructor
+ * @param options Layer options
+ */
+ constructor(options?: olx.layer.ImageOptions);
+
+ /**
+ * Return the associated source of the image layer.
+ * @returns Source.
+ */
+ getSource(): ol.source.Image;
+ }
+
+ /**
+ * Abstract base class; normally only used for creating subclasses and not instantiated in apps. A visual representation of raster or vector map data. Layers group together those properties that pertain to how the data is to be displayed, irrespective of the source of that data.
+ */
+ class Layer extends ol.layer.Base {
+
+ /**
+ * @constructor
+ * @param options Layer options
+ */
+ constructor(options?: olx.layer.LayerOptions);
+
+ /**
+ * Get the layer source.
+ * @returns The layer source (or null if not yet set)
+ */
+ getSource(): ol.source.Source;
+
+ /**
+ * Set the layer source.
+ * @param source The layer source.
+ */
+ setSource(source: ol.source.Source): void;
+ }
+
+ /**
+ * For layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors.
+ */
+ class Tile extends ol.layer.Layer {
+
+ /**
+ * @constructor
+ * @param options Tile layer options.
+ */
+ constructor(options?: olx.layer.TileOptions);
+
+ /**
+ * Return the level as number to which we will preload tiles up to.
+ * @retruns The level to preload tiled up to.
+ */
+ getPreload(): number;
+
+ /**
+ * Return the associated tilesource of the layer.
+ * @returns Source
+ */
+ getSource(): ol.source.Tile;
+
+ /**
+ * Whether we use interim tiles on error.
+ * @returns Use interim tiles on error.
+ */
+ getUseInterimTilesOnError(): boolean;
+
+ /**
+ * Set the level as number to which we will preload tiles up to.
+ * @param preload The level to preload tiled up to
+ */
+ setPreload(preload: number): void;
+
+ /**
+ * Set whether we use interim tiles on error.
+ * @param useInterimTilesOnError Use interim tiles on error.
+ */
+ setUseInterimTilesOnError(useInterimTilesOnError: boolean): void;
+ }
+
+ /**
+ * Vector data that is rendered client-side. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors.
+ */
+ class Vector extends ol.layer.Layer {
+
+ /**
+ * @constructor
+ * @param options Options
+ */
+ constructor(options?: olx.layer.VectorOptions);
+
+ /**
+ * Return the associated vectorsource of the layer.
+ * @returns Source.
+ */
+ getSource(): ol.source.Vector;
+
+ /**
+ * Get the style for features. This returns whatever was passed to the style option at construction or to the setStyle method.
+ */
+ getStyle(): ol.style.Style | Array | ol.style.StyleFunction;
+
+ /**
+ * Get the style function.
+ * @returns Layer style function
+ */
+ getStyleFunction(): ol.style.StyleFunction;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style.
+ */
+ setStyle(): void;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style.
+ * @param layer Layer style
+ */
+ setStyle(style: ol.style.Style): void;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style.
+ * @param layer Layer style
+ */
+ setStyle(style: Array): void;
+
+ /**
+ * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style.
+ * @param Layer style
+ */
+ setStyle(style: ol.style.StyleFunction): void;
+
+ /**
+ * Sets the layer to be rendered on top of other layers on a map. The map will not manage this layer
+ * in its layers collection, and the callback in ol.Map#forEachLayerAtPixel will receive null as
+ * layer. This is useful for temporary layers. To remove an unmanaged layer from the map, use #setMap(null).
+ * To add the layer to a map and have it managed by the map, use ol.Map#addLayer instead.
+ * @argument map.
+ */
+ setMap(map: ol.Map): void;
+
+ /**
+ * Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.
+ */
+ setZIndex(zIndex: number): void;
+ }
+ }
+
+ namespace loadingstrategy {
+
+ /**
+ * Strategy function for loading all features with a single request.
+ * @param extent Extent
+ * @param resolution Resolution
+ * @returns Extents
+ */
+ function all(extent: ol.Extent, resolution: number): Array;
+
+ /**
+ * Strategy function for loading features based on the view's extent and resolution.
+ * @param extent Extent
+ * @param resolution Resolution
+ * @returns Extents
+ */
+ function bbox(extent: ol.Extent, resolution: number): Array;
+
+ /**
+ * Creates a strategy function for loading features based on a tile grid.
+ * @param tilegrid Tile grid
+ * @returns Loading strategy
+ */
+ function tile(tileGrid: ol.tilegrid.TileGrid): ol.LoadingStrategy;
+ }
+
+ namespace proj {
+
+ // Type definitions
+ interface ProjectionLike extends String { }
+ interface Units extends String { }
+
+ // Methods
+
+ /**
+ * Meters per unit lookup table.
+ */
+ //TODO: validate!
+ var METERS_PER_UNIT: Object;
+
+ /**
+ * Registers coordinate transform functions to convert coordinates between the source projection and the destination projection. The forward and inverse functions convert coordinate pairs; this function converts these into the functions used internally which also handle extents and coordinate arrays.
+ * @param source Source projection
+ * @param destination Destination projection
+ * @param forward The forward transform function (that is, from the source projection to the destination projection) that takes a ol.Coordinate as argument and returns the transformed ol.Coordinate.
+ * @param inverse The inverse transform function (that is, from the destination projection to the source projection) that takes a ol.Coordinate as argument and returns the transformed ol.Coordinate.
+ */
+ function addCoordinateTransforms(source: ProjectionLike, destination: ProjectionLike, forward: (coordinate: Coordinate) => Coordinate, inverse: (coordinate: Coordinate) => Coordinate): void;
+
+ /**
+ * Registers transformation functions that don't alter coordinates. Those allow to transform between projections with equal meaning.
+ * @param projections Projections.
+ */
+ function addEquivalentProjections(projections: Array): void;
+
+ /**
+ * Add a Projection object to the list of supported projections that can be looked up by their code.
+ * @param projection Projection instance.
+ */
+ function addProjection(projection: Projection): void;
+
+ /**
+ * Transforms a coordinate from longitude/latitude to a different projection.
+ * @param coordinate Coordinate as longitude and latitude, i.e. an array with longitude as 1st and latitude as 2nd element.
+ * @param projection Target projection. The default is Web Mercator, i.e. 'EPSG:3857'.
+ */
+ function fromLonLat(coordinate: Coordinate, opt_projection: ProjectionLike): Coordinate;
+
+ /**
+ * Fetches a Projection object for the code specified.
+ * @param projectionLike Either a code string which is a combination of authority and identifier such as "EPSG:4326", or an existing projection object, or undefined.
+ * @returns Projection object, or null if not in list.
+ */
+ function get(projectionLike: ProjectionLike): Projection;
+
+ /**
+ * Given the projection-like objects, searches for a transformation function to convert a coordinates array from the source projection to the destination projection.
+ * @param source Source.
+ * @param destination Destination.
+ * @returns Transform function.
+ */
+ function getTransform(source: ProjectionLike, destination: ProjectionLike): ol.TransformFunction;
+
+ /**
+ * Transforms a coordinate to longitude/latitude.
+ * @param coordinate Projected coordinate.
+ * @param projection Projection of the coordinate. The default is Web Mercator, i.e. 'EPSG:3857'.
+ * @returns Coordinate as longitude and latitude, i.e. an array with longitude as 1st and latitude as 2nd element.
+ */
+ function toLonLat(coordinate: Coordinate, projection: ProjectionLike): Coordinate;
+
+ /**
+ * Transforms a coordinate from source projection to destination projection. This returns a new coordinate (and does not modify the original).
+ * @param coordinate Coordinate.
+ * @param source Source projection-like.
+ * @param destination Destination projection-like.
+ * @returns Coordinate.
+ */
+ function transform(coordinate: Coordinate, source: ProjectionLike, destination: ProjectionLike): Coordinate;
+
+ /**
+ * Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original).
+ * @param extent The extent to transform.
+ * @param source Source projection-like.
+ * @param destination Destination projection-like.
+ * @returns The transformed extent.
+ */
+ function transformExtent(extent: Extent, source: ProjectionLike, destination: ProjectionLike): Extent;
+
+ class Projection {
+ constructor(options: olx.Projection);
+
+ getExtent(): Extent;
+
+ /**
+ * Set the validity extent for this projection.
+ * @param extent The new extent of the projection.
+ */
+ setExtent(extent: Extent): void;
+ }
+ }
+
+ namespace render {
+
+ class Event extends ol.events.Event {
+ }
+
+ class VectorContext {
+ }
+ class Feature {
+ get(key: string): any;
+ getExtent(): ol.Extent;
+ getGeometry(): ol.geom.Geometry;
+ getProperties: Object[];
+ getType(): ol.geom.GeometryType;
+ }
+ namespace canvas {
+ class Immediate {
+ }
+ }
+ }
+
+ namespace source {
+
+ class BingMaps extends TileImage {
+ }
+
+ class CartoDB extends XYZ {
+ }
+
+ class Cluster extends Vector {
+ constructor(options: olx.source.ClusterOptions);
+ }
+
+ class Image extends Source {
+ }
+
+ class ImageArcGISRest extends Image {
+ }
+
+ class ImageCanvas extends Image {
+ }
+
+ class ImageEvent extends ol.events.Event {
+ }
+
+ class ImageMapGuide extends Image {
+ }
+
+ class ImageStatic extends ol.source.Image {
+ constructor(options?: olx.StaticImageOptions);
+ }
+
+ class ImageVector extends ImageCanvas {
+ }
+
+ class ImageWMS extends Image {
+ constructor(options: olx.ImageWMSOptions);
+ }
+
+ class MapQuest extends XYZ {
+ constructor(options: any);
+ }
+
+ class OSM extends XYZ {
+ constructor(opt_options?: olx.OSMOptions);
+ }
+
+ class Source extends ol.Object {
+
+ constructor(options: any);
+
+ /**
+ * Get the projection of the source.
+ * @return Projection.
+ */
+ getProjection(): ol.proj.Projection;
+
+ /**
+ * Refreshes the source and finally dispatches a 'change' event.
+ */
+ refresh(): void;
+ }
+
+ class Stamen extends XYZ {
+ }
+
+ class Tile extends Source {
+ }
+
+ class TileArcGISRest extends TileImage {
+ }
+
+ class TileDebug extends Tile {
+ }
+
+ class TileEvent extends ol.events.Event {
+ }
+
+ class TileImage extends UrlTile {
+ }
+
+ class TileJSON extends TileImage {
+ }
+
+ class TileUTFGrid extends Tile {
+ }
+
+ class TileWMS extends TileImage {
+ constructor(options: olx.TileWMSOptions);
+
+ /**
+ * Update the user-provided (WMS request) parameters.
+ */
+ updateParams(params: any): void;
+
+ /**
+ * Get the user-provided (WMS request) params, i.e. those passed to the constructor through the "params" option, and possibly updated using the updateParams method.
+ */
+ getParams(): any;
+
+ /**
+ * Return the GetFeatureInfo URL for the passed coordinate, resolution, and
+ * projection. Return `undefined` if the GetFeatureInfo URL cannot be
+ * constructed.
+ * @param coordinate Coordinate.
+ * @param resolution Resolution.
+ * @param rojection Projection.
+ * @param params GetFeatureInfo params. `INFO_FORMAT` at least should
+ * be provided. If `QUERY_LAYERS` is not provided then the layers specified
+ * in the `LAYERS` parameter will be used. `VERSION` should not be
+ * specified here.
+ * @return GetFeatureInfo URL.
+ */
+ getGetFeatureInfoUrl(coordinate: ol.Coordinate, resolution: number, projection: ol.proj.ProjectionLike, params: {}): string;
+ }
+
+ class UrlTile extends Tile {
+ }
+
+ class Vector extends Source {
+ constructor(opts?: olx.source.VectorOptions)
+ /**
+ * Add a single feature to the source. If you want to add a batch of features at once,
+ * call source.addFeatures() instead.
+ */
+ addFeature(feature: ol.Feature): void;
+
+ /**
+ * Add a batch of features to the source.
+ */
+ addFeatures(features: ol.Feature[]): void;
+
+ /**
+ * Remove all features from the source.
+ * @param Skip dispatching of removefeature events.
+ */
+ clear(fast?: boolean): void;
+ /**
+ * Get the extent of the features currently in the source.
+ */
+ getExtent(): ol.Extent;
+
+ /**
+ * Get all features in the provided extent. Note that this returns all features whose bounding boxes
+ * intersect the given extent (so it may include features whose geometries do not intersect the extent).
+ * This method is not available when the source is configured with useSpatialIndex set to false.
+ */
+ getFeaturesInExtent(extent: ol.Extent): ol.Feature[];
+
+ /**
+ * Get all features on the source
+ */
+ getFeatures(): ol.Feature[];
+
+ /**
+ * Get all features whose geometry intersects the provided coordinate.
+ */
+ getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[];
+ }
+
+ class VectorEvent extends ol.events.Event {
+ }
+
+ class VectorTile extends UrlTile {
+ }
+
+ class WMTS extends TileImage {
+ constructor(options: olx.source.WMTSOptions);
+ }
+
+ class XYZ extends TileImage {
+ }
+
+ class Zoomify extends TileImage {
+ }
+
+ // Namespaces
+ namespace wms {
+ interface ServerType extends String { }
+ }
+
+ // Type definitions
+ interface State extends String { }
+ interface WMTSRequestEncoding extends String { }
+ }
+
+ namespace style {
+
+ class AtlasManager {
+ }
+
+ class Circle extends Image {
+ constructor(opt_options?: olx.style.CircleOptions);
+ }
+
+ /**
+ * Set fill style for vector features.
+ */
+ class Fill {
+
+ constructor(opt_options?: olx.style.FillOptions);
+
+ getColor(): ol.Color | string;
+
+ /**
+ * Set the color.
+ */
+ setColor(color: ol.Color | string): void;
+
+ getChecksum(): string;
+ }
+
+ class Icon extends Image {
+ constructor(option: olx.style.IconOptions)
+ }
+
+ class Image {
+ getOpacity(): number;
+ getRotateWithView(): boolean;
+ getRotation(): number;
+ getScale(): number;
+ getSnapToPiexl(): boolean;
+
+ setOpacity(opacity: number): void;
+ setRotation(rotation: number): void;
+ setScale(scale: number): void;
+ }
+
+ interface GeometryFunction {
+ (feature: Feature): ol.geom.Geometry
+ }
+
+ class RegularShape {
+ }
+
+ class Stroke {
+ constructor(opts?: olx.style.StrokeOptions);
+ getColor(): ol.Color | string;
+ getLineCap(): string;
+ getLineDash(): number[];
+ getLineJoin(): string;
+ getMitterLimit(): number;
+ getWidth(): number;
+ setColor(color: ol.Color | string): void;
+ setLineCap(lineCap: string): void;
+ setLineDash(lineDash: number[]): void;
+ setLineJoin(lineJoin: string): void;
+ setMiterLimit(miterLimit: number): void;
+ setWidth(width: number): void;
+ }
+
+ /**
+ * Container for vector feature rendering styles. Any changes made to the style
+ * or its children through `set*()` methods will not take effect until the
+ * feature, layer or FeatureOverlay that uses the style is re-rendered.
+ */
+ class Style {
+ constructor(opts: olx.style.StyleOptions);
+
+ getFill(): ol.style.Fill;
+ /***
+ * Get the geometry to be rendered.
+ * @return Feature property or geometry or function that returns the geometry that will
+ * be rendered with this style.
+ */
+ getGeometry(): string | ol.geom.Geometry | ol.style.GeometryFunction;
+ getGeometryFunction(): ol.style.GeometryFunction;
+ getImage(): ol.style.Image;
+ getStroke(): ol.style.Stroke;
+ getText(): ol.style.Text;
+ getZIndex(): number;
+
+ setGeometry(geometry: string | ol.geom.Geometry | ol.style.GeometryFunction): void;
+ setZIndex(zIndex: number): void;
+ }
+
+ /**
+ * Set text style for vector features.
+ */
+ class Text {
+ constructor(opt?: olx.style.TextOptions);
+
+ getFont(): string;
+ getOffsetX(): number;
+ getOffsetY(): number;
+ getFill(): Fill;
+ getRotation(): number;
+ getScale(): number;
+ getStroke(): Stroke;
+ getText(): string;
+ getTextAlign(): string;
+ getTextBaseline(): string;
+
+ /**
+ * Set the font.
+ */
+ setFont(font: string): void;
+
+ /**
+ * Set the x offset.
+ */
+ setOffsetX(offsetX: number): void;
+
+ /**
+ * Set the y offset.
+ */
+ setOffsetY(offsetY: number): void;
+
+ /**
+ * Set the fill.
+ */
+ setFill(fill: Fill): void;
+
+ /**
+ * Set the rotation.
+ */
+ setRotation(rotation: number): void;
+
+ /**
+ * Set the scale.
+ */
+ setScale(scale: number): void;
+
+ /**
+ * Set the stroke.
+ *
+ */
+ setStroke(stroke: Stroke): void;
+
+ /**
+ * Set the text.
+ */
+ setText(text: string): void;
+
+ /**
+ * Set the text alignment.
+ */
+ setTextAlign(textAlign: string): void;
+
+ /**
+ * Set the text baseline.
+ */
+ setTextBaseline(textBaseline: string): void;
+ }
+
+ /**
+ * A function that takes an ol.Feature and a {number} representing the view's resolution. The function should return an array of ol.style.Style. This way e.g. a vector layer can be styled.
+ */
+ interface StyleFunction { (feature: ol.Feature, resolution: number): ol.style.Style }
+ }
+
+ namespace tilegrid {
+
+ /**
+ * Base class for setting the grid pattern for sources accessing tiled-image servers.
+ */
+ class TileGrid {
+
+ /**
+ * @constructor
+ * @param options Tile grid options
+ */
+ constructor(options: olx.tilegrid.TileGridOptions);
+
+ /**
+ * Creates a TileCoord transform function for use with this tile grid. Transforms the internal tile coordinates with bottom-left origin to the tile coordinates used by the ol.TileUrlFunction. The returned function expects an ol.TileCoord as first and an ol.proj.Projection as second argument and returns a transformed ol.TileCoord.
+ */
+ createTileCoordTransform(): { (tilecoord: ol.TileCoord, projection: ol.proj.Projection): ol.TileCoord };
+
+ /**
+ * Get the maximum zoom level for the grid.
+ * @returns Max zoom
+ */
+ getMaxZoom(): number;
+
+ /**
+ * Get the minimum zoom level for the grid.
+ * @returns Min zoom
+ */
+ getMinZoom(): number;
+
+ /**
+ * Get the origin for the grid at the given zoom level.
+ * @param z Z
+ * @returns Origin
+ */
+ getOrigin(z: number): ol.Coordinate;
+
+ /**
+ * Get the list of resolutions for the tile grid.
+ * @param z Z
+ * @returns Resolution
+ */
+ getResolution(z: number): number;
+
+ /**
+ * Get the list of resolutions for the tile grid.
+ * @returns Resolutions
+ */
+ getResolutions(): Array;
+
+ /**
+ * Get the tile coordinate for the given map coordinate and resolution. This method considers that coordinates that intersect tile boundaries should be assigned the higher tile coordinate.
+ * @param coordinate Coordinate
+ * @param resolution Resolution
+ * @param tileCoord Destination ol.TileCoord object.
+ * @returns Tile coordinate
+ */
+ getTileCoordForCoordAndResolution(coordinate: ol.Coordinate, resolution: number, tileCoord?: ol.TileCoord): ol.TileCoord;
+
+ /**
+ * Get a tile coordinate given a map coordinate and zoom level.
+ * @param coordinate Coordinate
+ * @param z Zoom level
+ * @param tileCoord Destination ol.TileCoord object
+ * @returns Tile coordinate
+ */
+ getTileCoordForCoordAndZ(coordinate: ol.Coordinate, z: number, tileCoord?: ol.TileCoord): ol.TileCoord;
+
+ /**
+ * Get the tile size for a zoom level. The type of the return value matches the tileSize or tileSizes that the tile grid was configured with. To always get an ol.Size, run the result through ol.size.toSize().
+ * @param z Z
+ * @returns Tile size
+ */
+ getTileSize(z: number): number | ol.Size;
+ }
+
+ /**
+ * Set the grid pattern for sources accessing WMTS tiled-image servers.
+ */
+ class WMTS extends TileGrid {
+
+ /**
+ * @constructor
+ * @param options WMTS options
+ */
+ constructor(options: olx.tilegrid.WMTSOptions);
+
+ /**
+ * Create a tile grid from a WMTS capabilities matrix set.
+ * @param matrixSet An object representing a matrixSet in the capabilities document.
+ * @param extent An optional extent to restrict the tile ranges the server provides.
+ * @returns WMTS tilegrid instance
+ */
+ createFromCapabilitiesMatrixSet(matrixSet: any, extent: ol.Extent): ol.tilegrid.WMTS;
+
+ /**
+ * Get the list of matrix identifiers.
+ * @returns MatrixIds
+ */
+ getMatrixIds(): Array;
+ }
+
+ /**
+ * Set the grid pattern for sources accessing Zoomify tiled-image servers.
+ */
+ class Zoomify extends TileGrid {
+
+ /**
+ * @constructor
+ * @param options Options
+ */
+ constructor(options?: olx.tilegrid.ZoomifyOptions);
+ }
+
+ /**
+ * Creates a tile grid with a standard XYZ tiling scheme.
+ * @param options Tile grid options.
+ * @returns The grid instance
+ */
+ function createXYZ(options?: olx.tilegrid.XYZOptions): ol.tilegrid.TileGrid;
+ }
+
+ namespace webgl {
+
+ class Context {
+
+ /**
+ * @constructor
+ * @param canvas HTML Canvas Element
+ * @param gl WebGL Rendering context
+ */
+ constructor(canvas: HTMLCanvasElement, gl: WebGLRenderingContext);
+
+ /**
+ Get the WebGL rendering context
+ @returns The rendering context.
+ */
+ getGL(): WebGLRenderingContext;
+
+ /**
+ * Get the frame buffer for hit detection.
+ * @returns The hit detection frame buffer.
+ */
+ getHitDetectionFramebuffer(): WebGLFramebuffer;
+
+ /**
+ * Use a program. If the program is already in use, this will return false.
+ * @param program Program.
+ * @returns Changed.
+ */
+ useProgram(program: WebGLProgram): boolean;
+ }
+ }
+
+ // Type definitions
+
+ /**
+ * A function returning the canvas element ({HTMLCanvasElement}) used by the source as an image. The arguments passed to the function are: ol.Extent the image extent, {number} the image resolution, {number} the device pixel ratio, ol.Size the image size, and ol.proj.Projection the image projection. The canvas returned by this function is cached by the source. The this keyword inside the function references the ol.source.ImageCanvas.
+ */
+ function CanvasFunctionType(extent: Extent, resolution: number, pixelRatio: number, size: Size, projection: proj.Projection): HTMLCanvasElement;
+
+ /**
+ * A color represented as a short array [red, green, blue, alpha]. red, green, and blue should be integers in the range 0..255 inclusive. alpha should be a float in the range 0..1 inclusive.
+ */
+ interface Color extends Array { }
+
+ /**
+ * An array of numbers representing an xy coordinate. Example: [16, 48].
+ */
+ interface Coordinate extends Array { }
+
+ /**
+ * An array of numbers representing an extent: [minx, miny, maxx, maxy].
+ */
+ interface Extent extends Array { }
+
+ /**
+ * Overlay position: 'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', 'top-right'
+ */
+ interface OverlayPositioning extends String { }
+
+ /**
+ * An array with two elements, representing a pixel. The first element is the x-coordinate, the second the y-coordinate of the pixel.
+ */
+ interface Pixel extends Array { }
+
+ /**
+ * Available renderers: 'canvas', 'dom' or 'webgl'.
+ */
+ interface RendererType extends String { }
+
+ /**
+ * An array of numbers representing a size: [width, height].
+ */
+ interface Size extends Array { }
+
+ /**
+ * An array of three numbers representing the location of a tile in a tile grid. The order is z, x, and y. z is the zoom level.
+ */
+ interface TileCoord extends Array { }
+
+ // Functions
+
+ /**
+ * A function that takes a ol.Coordinate and transforms it into a {string}.
+ */
+ interface CoordinateFormatType { (coordinate?: Coordinate): string; }
+
+ /**
+ * Implementation based on the code of OpenLayers, no documentation available (yet). If it is incorrect, please create an issue and I will change it.
+ */
+ interface FeatureLoader { (extent: ol.Extent, number: number, projection: ol.proj.Projection): string }
+
+ /**
+ * A function that returns a style given a resolution. The this keyword inside the function references the ol.Feature to be styled.
+ */
+ interface FeatureStyleFunction { (resolution: number): ol.style.Style }
+
+ /**
+ * Loading strategy
+ */
+ interface LoadingStrategy { (extent: ol.Extent, resolution: number): Array }
+
+ /**
+ * Function to perform manipulations before rendering. This function is called with the ol.Map as first and an optional olx.FrameState as second argument. Return true to keep this function for the next frame, false to remove it.
+ */
+ interface PreRenderFunction { (map: ol.Map, frameState?: olx.FrameState): boolean }
+
+ /**
+ * A transform function accepts an array of input coordinate values, an optional output array, and an optional dimension (default should be 2). The function transforms the input coordinate values, populates the output array, and returns the output array.
+ */
+ interface TransformFunction { (input: Array, output?: Array, dimension?: number): Array }
+}
+
+declare module "openlayers" {
+ export = ol;
+}
diff --git a/openlayers/openlayers-tests.ts b/openlayers/openlayers-tests.ts
index 4937d52516..5c1f6d46c8 100644
--- a/openlayers/openlayers-tests.ts
+++ b/openlayers/openlayers-tests.ts
@@ -1,11 +1,17 @@
-///
+///
// Basic type variables for test functions
+var anyValue: any;
var voidValue: void;
var numberValue: number;
var booleanValue: boolean;
var stringValue: string;
+var stringArray: Array;
var jsonValue: JSON;
+var voidOrBooleanValue: void | boolean;
+var domEventTarget: EventTarget;
+var fn: Function;
+var object: Object;
// Callback predefinitions for OpenLayers
var preRenderFunction: ol.PreRenderFunction;
@@ -14,44 +20,55 @@ var coordinateFormatType: ol.CoordinateFormatType;
var featureStyleFunction: ol.FeatureStyleFunction;
var featureLoader: ol.FeatureLoader;
var easingFunction: (t: number) => number;
+var drawGeometryFunction: ol.DrawGeometryFunctionType;
// Type variables for OpenLayers
+var attribution: ol.Attribution;
+var boundingCoordinates: Array;
var circle: ol.geom.Circle;
var color: ol.Color;
var coordinate: ol.Coordinate;
var coordinatesArray: Array;
var coordinatesArrayDim2: Array>;
var extent: ol.Extent;
-var boundingCoordinates: Array;
-var size: ol.Size;
-var style: ol.style.Style;
-var styleArray: Array;
-var feature: ol.Feature;
-var featureArray: Array;
-var graticule: ol.Graticule
-var geometry: ol.geom.Geometry;
-var geometriesArray: Array;
+var olEvent: ol.events.Event;
+var eventKey: ol.EventsKey;
+var eventKeyArray: Array;
+var eventKeyMixed: ol.EventsKey | Array;
+var eventTarget: ol.events.EventTarget;
var feature: ol.Feature;
var featureArray: Array;
+var featureCollection: ol.Collection;
var featureFormat: ol.format.Feature;
+var featureUrlFunction: ol.FeatureUrlFunction;
+var graticule: ol.Graticule;
+var geometriesArray: Array;
var geometry: ol.geom.Geometry;
var geometryCollection: ol.geom.GeometryCollection;
var geometryLayout: ol.geom.GeometryLayout;
var geometryType: ol.geom.GeometryType;
var linearRing: ol.geom.LinearRing;
var lineString: ol.geom.LineString;
-var loadingstrategy: ol.LoadingStrategy;
+var loadingStrategy: ol.LoadingStrategy;
+var logoOptions: olx.LogoOptions;
+var mapBrowserEvent: ol.MapBrowserEvent;
var multiLineString: ol.geom.MultiLineString;
var multiPoint: ol.geom.MultiPoint;
var multiPolygon: ol.geom.MultiPolygon;
var point: ol.geom.Point;
var polygon: ol.geom.Polygon;
-var simpleGeometry: ol.geom.SimpleGeometry;
-var tilegrid: ol.tilegrid.TileGrid;
-var vector: ol.source.Vector;
var projection: ol.proj.Projection;
-var projectionLike: ol.proj.ProjectionLike;
+var projectionLike: ol.ProjectionLike;
+var simpleGeometry: ol.geom.SimpleGeometry;
+var size: ol.Size;
+var style: ol.style.Style;
+var styleArray: Array;
+var styleFunction: ol.StyleFunction;
+var tilegrid: ol.tilegrid.TileGrid;
var transformFn: ol.TransformFunction;
+var vectorSource: ol.source.Vector;
+var units: ol.proj.Units;
+var styleRegularShape: ol.style.RegularShape;
//
// ol.Attribution
@@ -116,16 +133,16 @@ featureLoader = ol.featureloader.xhr(stringValue, featureFormat);
//
// ol.loadingstrategy
//
-loadingstrategy = ol.loadingstrategy.all;
-loadingstrategy = ol.loadingstrategy.bbox;
-loadingstrategy = ol.loadingstrategy.tile(tilegrid);
+loadingStrategy = ol.loadingstrategy.all;
+loadingStrategy = ol.loadingstrategy.bbox;
+loadingStrategy = ol.loadingstrategy.tile(tilegrid);
//
//
// ol.geom.Circle
//
booleanValue = circle.intersectsExtent(extent);
-circle = circle.transform(projectionLike, projectionLike);
+circle = circle.transform(projectionLike, projectionLike);
//
//
@@ -136,7 +153,7 @@ coordinate = geometryResult.getClosestPoint(coordinate);
geometryResult.getClosestPoint(coordinate, coordinate);
extent = geometryResult.getExtent();
geometryResult.getExtent(extent);
-geometryResult.transform(projection, projection);
+geometryResult.transform(projectionLike, projectionLike);
//
//
@@ -266,6 +283,10 @@ polygon = new ol.geom.Polygon(coordinatesArrayDim2);
polygon = new ol.geom.Polygon(coordinatesArrayDim2, geometryLayout);
polygon = ol.geom.Polygon.circular(localSphere, coordinate, numberValue);
polygon = ol.geom.Polygon.circular(localSphere, coordinate, numberValue, numberValue);
+polygon = ol.geom.Polygon.fromCircle(circle);
+polygon = ol.geom.Polygon.fromCircle(circle, numberValue);
+polygon = ol.geom.Polygon.fromCircle(circle, numberValue, numberValue);
+polygon = ol.geom.Polygon.fromExtent(extent);
voidValue = polygon.appendLinearRing(linearRing);
polygon = polygon.clone();
numberValue = polygon.getArea();
@@ -273,9 +294,12 @@ coordinatesArrayDim2 = polygon.getCoordinates();
coordinatesArrayDim2 = polygon.getCoordinates(booleanValue);
point = polygon.getInteriorPoint();
linearRing = polygon.getLinearRing(numberValue);
+numberValue = polygon.getLinearRingCount();
linearRingsArray = polygon.getLinearRings();
geometryType = polygon.getType();
booleanValue = polygon.intersectsExtent(extent);
+voidValue = polygon.setCoordinates([[coordinate]]);
+voidValue = polygon.setCoordinates([[coordinate]], geometryLayout);
//
//
@@ -290,9 +314,42 @@ voidValue = simpleGeometry.translate(numberValue, numberValue);
//
// ol.source
//
-vector = new ol.source.Vector({
- features: [feature]
+var featureCallback: (f: ol.Feature) => any;
+vectorSource = new ol.source.Vector({
+ attributions: [attribution],
+ features: featureCollection,
+ format: featureFormat,
+ loader: featureLoader,
+ logo: logoOptions,
+ strategy: loadingStrategy,
+ url: stringValue,
+ useSpatialIndex: booleanValue,
+ wrapX: booleanValue
});
+vectorSource = new ol.source.Vector({
+ features: featureArray
+});
+vectorSource = new ol.source.Vector({
+ url: featureUrlFunction,
+ loader: featureLoader
+});
+voidValue = vectorSource.addFeature(feature);
+voidValue = vectorSource.addFeatures(featureArray);
+voidValue = vectorSource.clear();
+voidValue = vectorSource.clear(booleanValue);
+anyValue = vectorSource.forEachFeature(featureCallback);
+anyValue = vectorSource.forEachFeature(featureCallback, object);
+anyValue = vectorSource.forEachFeatureInExtent(extent, featureCallback, object);
+anyValue = vectorSource.forEachFeatureIntersectingExtent(extent, featureCallback, object);
+feature = vectorSource.getClosestFeatureToCoordinate(coordinate);
+extent = vectorSource.getExtent();
+feature = vectorSource.getFeatureById(stringValue);
+feature = vectorSource.getFeatureById(numberValue);
+featureArray = vectorSource.getFeatures();
+featureArray = vectorSource.getFeaturesAtCoordinate(coordinate);
+featureCollection = vectorSource.getFeaturesCollection();
+featureArray = vectorSource.getFeaturesInExtent(extent);
+voidValue = vectorSource.removeFeature(feature);
//
// ol.Feature
@@ -300,7 +357,11 @@ vector = new ol.source.Vector({
feature = new ol.Feature();
feature = new ol.Feature(geometry);
feature = new ol.Feature({
- geometry: geometry
+ geometry: geometry,
+ a: numberValue,
+ b: stringValue,
+ c: null,
+ d: object
});
feature = feature.clone();
geometry = feature.getGeometry();
@@ -315,6 +376,7 @@ voidValue = feature.setId(numberValue);
voidValue = feature.setStyle(style);
voidValue = feature.setStyle(styleArray);
voidValue = feature.setStyle(featureStyleFunction);
+voidValue = feature.setProperties(object);
//
// ol.View
@@ -329,19 +391,71 @@ var view: ol.View = new ol.View({
// ol.layer.Tile
//
var tileLayer: ol.layer.Tile = new ol.layer.Tile({
- source: new ol.source.MapQuest({ layer: 'osm' })
+ source: new ol.source.OSM()
});
+//
+// ol.Object
+//
+var olObject: ol.Object = new ol.Object({
+ a: numberValue,
+ b: stringValue,
+ c: booleanValue,
+ d: voidValue,
+ e: object,
+ f: fn
+});
+anyValue = olObject.get(stringValue);
+stringArray = olObject.getKeys();
+object = olObject.getProperties();
+voidValue = olObject.set(stringValue, anyValue);
+voidValue = olObject.set(stringValue, anyValue, booleanValue);
+voidValue = olObject.setProperties(object, booleanValue);
+voidValue = olObject.unset(stringValue, booleanValue);
+
+//
+// ol.Observable
+//
+ol.Observable.unByKey(eventKey);
+var observable: ol.Observable = new ol.Observable();
+voidValue = observable.changed();
+voidOrBooleanValue = observable.dispatchEvent({type: stringValue});
+voidOrBooleanValue = observable.dispatchEvent({type: stringValue, target: domEventTarget});
+voidOrBooleanValue = observable.dispatchEvent({type: stringValue, target: eventTarget});
+voidOrBooleanValue = observable.dispatchEvent({type: stringValue, a: numberValue, b: stringValue, c: booleanValue, d: null, e: {}});
+voidOrBooleanValue = observable.dispatchEvent(olEvent);
+voidOrBooleanValue = observable.dispatchEvent(stringValue);
+numberValue = observable.getRevision();
+eventKeyMixed = observable.on(stringValue, fn);
+eventKeyMixed = observable.on([stringValue, stringValue], fn, {});
+eventKeyMixed = observable.once(stringValue, fn);
+eventKeyMixed = observable.once([stringValue, stringValue], fn, {});
+voidValue = observable.un(stringValue, fn);
+voidValue = observable.un([stringValue, stringValue], fn, {});
+voidValue = observable.unByKey(eventKey);
+voidValue = observable.unByKey(eventKeyArray);
+
//
// ol.proj
//
+var getPointResolutionFn: (n: number, c: ol.Coordinate) => number;
projection = new ol.proj.Projection({
- code:stringValue,
+ code:stringValue,
});
-projection.setExtent(projection.getExtent());
+stringValue = projection.getCode();
+extent = projection.getExtent();
+numberValue = projection.getMetersPerUnit();
+numberValue = projection.getPointResolution(numberValue, coordinate);
+units = projection.getUnits();
+extent = projection.getWorldExtent();
+booleanValue = projection.isGlobal();
+voidValue = projection.setExtent(extent);
+voidValue = projection.setGetPointResolution(getPointResolutionFn);
+voidValue = projection.setGlobal(booleanValue);
+voidValue = projection.setWorldExtent(extent);
//
-// ol.Map
+// ol.Map
//
var map: ol.Map = new ol.Map({
@@ -349,12 +463,14 @@ var map: ol.Map = new ol.Map({
layers: [tileLayer],
target: stringValue
});
-map.beforeRender(preRenderFunction);
+voidValue = map.beforeRender(preRenderFunction);
//
// ol.source.ImageWMS
//
var imageWMS: ol.source.ImageWMS = new ol.source.ImageWMS({
+ params: {},
+ projection: projection,
serverType: stringValue,
url:stringValue
});
@@ -363,7 +479,6 @@ var imageWMS: ol.source.ImageWMS = new ol.source.ImageWMS({
// ol.source.Source
//
const source = imageWMS as ol.source.Source;
-voidValue = source.refresh();
projection = source.getProjection();
//
@@ -371,22 +486,27 @@ projection = source.getProjection();
//
var tileWMS: ol.source.TileWMS = new ol.source.TileWMS({
params: {},
+ projection: projection,
serverType: stringValue,
url:stringValue
});
-tileWMS.updateParams(tileWMS.getParams());
+voidValue = tileWMS.updateParams(tileWMS.getParams());
stringValue = tileWMS.getGetFeatureInfoUrl([0, 0], 1, "EPSG:4326", {});
//
// ol.source.WMTS
//
var wmts: ol.source.WMTS = new ol.source.WMTS({
- tileGrid: new ol.tilegrid.WMTS({}),
- layer: "",
- style: "",
- matrixSet: "",
- wrapX: true
+ layer: "",
+ projection: projection,
+ matrixSet: "",
+ style: "",
+ tileGrid: new ol.tilegrid.WMTS({
+ matrixIds: [],
+ resolutions: [],
+ }),
+ wrapX: true,
});
//
@@ -420,7 +540,7 @@ zoomOptions.start = numberValue;
zoomOptions.resolution = numberValue;
zoomOptions.easing = easingFunction;
preRenderFunction = ol.animation.zoom(zoomOptions);
-map.beforeRender(preRenderFunction);
+voidValue = map.beforeRender(preRenderFunction);
//
// ol.coordinate
@@ -433,6 +553,7 @@ stringValue = ol.coordinate.format(coordinate, stringValue, numberValue);
coordinate = ol.coordinate.rotate(coordinate, numberValue);
stringValue = ol.coordinate.toStringHDMS();
stringValue = ol.coordinate.toStringHDMS(coordinate);
+stringValue = ol.coordinate.toStringHDMS(coordinate, numberValue);
stringValue = ol.coordinate.toStringXY();
stringValue = ol.coordinate.toStringXY(coordinate);
stringValue = ol.coordinate.toStringXY(coordinate, numberValue);
@@ -452,9 +573,7 @@ easingFunction = ol.easing.upAndDown;
var geolocation: ol.Geolocation = new ol.Geolocation({
projection: projection
});
-geolocation.on('change', function (evt) {
- window.console.log(geolocation.getPosition());
-});
+coordinate = geolocation.getPosition();
//
// ol.Graticule
@@ -467,7 +586,7 @@ graticule = new ol.Graticule({
var graticuleMap: ol.Map = graticule.getMap();
var graticuleMeridians: Array = graticule.getMeridians();
var graticuleParallels: Array = graticule.getParallels();
-graticule.setMap(graticuleMap);
+voidValue = graticule.setMap(graticuleMap);
//
// ol.DeviceOrientation
@@ -476,9 +595,7 @@ graticule.setMap(graticuleMap);
var deviceOrientation: ol.DeviceOrientation = new ol.DeviceOrientation({
tracking: true,
});
-deviceOrientation.on('change', function (evt) {
- window.console.log(deviceOrientation.getHeading());
-});
+numberValue = deviceOrientation.getHeading();
//
// ol.Overlay
@@ -487,17 +604,17 @@ deviceOrientation.on('change', function (evt) {
var popup: ol.Overlay = new ol.Overlay({
element: document.getElementById('popup')
});
-map.addOverlay(popup);
+voidValue = map.addOverlay(popup);
var popupElement: Element = popup.getElement();
var popupMap: ol.Map = popup.getMap();
var popupOffset: Array = popup.getOffset();
coordinate = popup.getPosition();
var popupPositioning: ol.OverlayPositioning = popup.getPositioning();
-popup.setElement(popupElement);
-popup.setMap(popupMap);
-popup.setOffset(popupOffset);
-popup.setPosition(coordinate);
-popup.setPositioning(popupPositioning);
+voidValue = popup.setElement(popupElement);
+voidValue = popup.setMap(popupMap);
+voidValue = popup.setOffset(popupOffset);
+voidValue = popup.setPosition(coordinate);
+voidValue = popup.setPositioning(popupPositioning);
//
@@ -555,9 +672,76 @@ var modify: ol.interaction.Modify = new ol.interaction.Modify({
});
var draw: ol.interaction.Draw = new ol.interaction.Draw({
- type: "Point"
-})
+ type: "Point",
+ clickTolerance: numberValue,
+ features: new ol.Collection([]),
+ source: vectorSource,
+ snapTolerance: numberValue,
+ maxPoints: numberValue,
+ minPoints: numberValue,
+ style: style,
+ geometryFunction: drawGeometryFunction,
+ geometryName: stringValue,
+ condition: ol.events.condition.never,
+ freehandCondition: ol.events.condition.never,
+ wrapX: booleanValue
+});
+draw = new ol.interaction.Draw({
+ type: "Point",
+ style: styleArray
+});
+draw = new ol.interaction.Draw({
+ type: "Point",
+ style: styleFunction
+});
+var styleFunctionAsStyle = function(feature: ol.Feature, resolution: number): ol.style.Style { return style; }
+draw = new ol.interaction.Draw({
+ type: "Point",
+ style: styleFunctionAsStyle
+});
+var styleFunctionAsArray = function(feature: ol.Feature, resolution: number): ol.style.Style[] { return styleArray; }
+draw = new ol.interaction.Draw({
+ type: "Point",
+ style: styleFunctionAsArray
+});
+
+var dragbox: ol.interaction.DragBox = new ol.interaction.DragBox({
+ className: stringValue,
+ condition: ol.events.condition.always,
+ boxEndCondition: function (mapBrowserEvent: ol.MapBrowserEvent, startPixel: ol.Pixel, endPixel: ol.Pixel) {
+ var width: number = endPixel[0] - startPixel[0];
+ var height: number = endPixel[1] - startPixel[1];
+ return booleanValue;
+ }
+});
+polygon = dragbox.getGeometry();
+
+var interaction: ol.interaction.Interaction = new ol.interaction.Interaction({
+ handleEvent: function (e: ol.MapBrowserEvent) {
+ return booleanValue;
+ }
+});
+booleanValue = interaction.getActive();
+map = interaction.getMap();
+voidValue = interaction.setActive(true);
+
+
const select: ol.interaction.Select = new ol.interaction.Select({
layers: (layer: ol.layer.Layer) => true,
});
+
+//
+// ol.style.RegularShape
+//
+
+styleRegularShape = new ol.style.RegularShape({
+ fill: new ol.style.Fill({color: 'red'}),
+ points: 4,
+});
+
+//
+// ol.proj
+//
+
+let value = ol.proj.METERS_PER_UNIT['degrees'];
diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts
index 36026fa70d..ed3c8e9e21 100644
--- a/openlayers/openlayers.d.ts
+++ b/openlayers/openlayers.d.ts
@@ -1,1265 +1,13443 @@
// Type definitions for OpenLayers v3.18.2
// Project: http://openlayers.org/
-// Definitions by: Wouter Goedhart
+// Definitions by: Olivier Sechet
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// Definitions partially generated using tsd-jsdoc (https://github.com/englercj/tsd-jsdoc)
-declare namespace olx {
- interface StaticImageOptions {
+declare type GlobalObject = Object;
- /** Attributions */
- attributions?: Array
-
- /*** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */
- crossOrigin?: string
-
- /*** Extent of the image in map coordinates. This is the [left, bottom, right, top] map coordinates of your image.*/
- imageExtent: ol.Extent;
-
- /*** Size of the image in pixels.*/
- imageSize?: ol.Size;
-
- /*** experimental Optional function to load an image given a URL.*/
- imageLoadFunction?: ol.TileLoadFunctionType;
-
- /*** Optional logo.*/
- logo?: olx.LogoOptions;
-
- /*** experimental Projection.*/
- projection: ol.proj.Projection;
-
- /*** Image URL.*/
- url: string;
- }
-
- interface ZoomToExtentOptions {
- /*** Class name. Default is ol-zoom-extent.*/
- className?: string;
-
- /*** Target.*/
- target?: Element;
-
- /*** Text label to use for the button. Default is E. Instead of text, also a Node (e.g. a span element) can be used.*/
- label?: string | Node;
-
- /*** Text label to use for the button tip. Default is Zoom to extent.*/
- tipLabel?: string;
-
- /*** The extent to zoom to. If undefined the validity extent of the view projection is used.*/
- extent: ol.Extent;
- }
-
- interface OverviewMapOptions {
- /*** Whether the control should start collapsed or not (expanded). Default to true.*/
- collapsed?: boolean;
- /*** Text label to use for the expanded overviewmap button. Default is «. Instead of text, also a Node (e.g. a span element) can be used.*/
- collapseLabel? :string | Node;
- /*** Whether the control can be collapsed or not. Default to true.*/
- collapsible?: boolean;
- /*** Text label to use for the collapsed overviewmap button. Default is ». Instead of text, also a Node (e.g. a span element) can be used.*/
- label?: string | Node;
- /*** Layers for the overview map. If not set, then all main map layers are used instead.*/
- layers?: ol.layer.Layer[] | ol.Collection;
- /*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/
- render?: Function;
- /*** Specify a target if you want the control to be rendered outside of the map's viewport.*/
- target?: Element;
- /*** Text label to use for the button tip. Default is Overview map*/
- tipLabel?: string;
- /*** Custom view for the overview map. If not provided, a default view with an EPSG:3857 projection will be used.*/
- view?: ol.View;
- }
-
- interface RotateOptions {
- /*** CSS class name. Default is ol-rotate.*/
- className?: string;
- /*** Text label to use for the rotate button. Default is ⇧. Instead of text, also a Node (e.g. a span element) can be used.*/
- label?: string | Element;
- /*** Text label to use for the rotate tip. Default is Reset rotation.*/
- tipLabel?: string;
- /*** Animation duration in milliseconds. Default is 250.*/
- duration?: number;
- /*** Hide the control when rotation is 0. Default is true.*/
- autoHide?: boolean;
- /*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/
- render?: Function;
- /*** Function called when the control is clicked. This will override the default resetNorth.*/
- resetNorth?: Function;
- /*** Target.*/
- target?: Element;
- }
-
- interface AttributionControlOptions {
- /*** CSS class name. Default is ol-attribution.*/
- className?: string;
- /*** Target.*/
- target?: Element;
+/**
+ * @namespace ol
+ */
+declare module ol {
+ /**
+ * The animation static methods are designed to be used with the
+ * {@link ol.Map#beforeRender} method. For example:
+ *
+ * var map = new ol.Map({ ... });
+ * var zoom = ol.animation.zoom({
+ * resolution: map.getView().getResolution()
+ * });
+ * map.beforeRender(zoom);
+ * map.getView().setResolution(map.getView().getResolution() * 2);
+ *
+ * @namespace ol.animation
+ */
+ module animation {
/**
- * Specify if attributions can be collapsed. If you use an OSM source,
- * should be set to false — see OSM Copyright — Default is true.
+ * Generate an animated transition that will "bounce" the resolution as it
+ * approaches the final value.
+ * @param {olx.animation.BounceOptions} options Bounce options.
+ * @return {ol.PreRenderFunction} Pre-render function.
+ * @api
*/
- collapsible?: boolean;
- /*** Specify if attributions should be collapsed at startup. Default is true.*/
- collapsed?: boolean;
- /*** Text label to use for the button tip. Default is "Attributions".*/
- tipLabel?: Array | ol.Collection;
+ function bounce(options: olx.animation.BounceOptions): ol.PreRenderFunction;
+
/**
- * Text label to use for the collapsed attributions button. Default is i.
- * Instead of text, also a Node (e.g. a span element) can be used.
+ * Generate an animated transition while updating the view center.
+ * @param {olx.animation.PanOptions} options Pan options.
+ * @return {ol.PreRenderFunction} Pre-render function.
+ * @api
*/
- label?: string | Node;
+ function pan(options: olx.animation.PanOptions): ol.PreRenderFunction;
+
/**
- * Text label to use for the expanded attributions button. Default is ».
- * Instead of text, also a Node (e.g. a span element) can be used.
+ * Generate an animated transition while updating the view rotation.
+ * @param {olx.animation.RotateOptions} options Rotate options.
+ * @return {ol.PreRenderFunction} Pre-render function.
+ * @api
*/
- collapseLabel?: string | Node;
- /*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/
- render?: Function;
+ function rotate(options: olx.animation.RotateOptions): ol.PreRenderFunction;
+
+ /**
+ * Generate an animated transition while updating the view resolution.
+ * @param {olx.animation.ZoomOptions} options Zoom options.
+ * @return {ol.PreRenderFunction} Pre-render function.
+ * @api
+ */
+ function zoom(options: olx.animation.ZoomOptions): ol.PreRenderFunction;
+
}
- interface AttributionOptions {
-
- /** HTML markup for this attribution. */
- html: string;
- }
-
- interface DeviceOrientationOptions {
-
+ /**
+ * Error object thrown when an assertion failed. This is an ECMA-262 Error,
+ * extended with a `code` property.
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error}
+ * @constructor
+ * @extends {Error}
+ * @implements {oli.AssertionError}
+ * @param {number} code Error code.
+ */
+ class AssertionError extends Error {
/**
- * Start tracking. Default is false.
+ * Error object thrown when an assertion failed. This is an ECMA-262 Error,
+ * extended with a `code` property.
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error}
+ * @constructor
+ * @extends {Error}
+ * @implements {oli.AssertionError}
+ * @param {number} code Error code.
*/
- tracking?: boolean;
- }
-
- interface FrameState {
+ constructor(code: number);
/**
+ * Error code. The meaning of the code can be found on
+ * {@link http://openlayers.org/en/latest/errors.html} (replace `latest` with
+ * the version found in the OpenLayers script's header comment if a version
+ * other than the latest is used).
+ * @type {number}
+ * @api
+ */
+ code: number;
+
+ }
+
+ /**
+ * @classdesc
+ * An attribution for a layer source.
+ *
+ * Example:
+ *
+ * source: new ol.source.OSM({
+ * attributions: [
+ * new ol.Attribution({
+ * html: 'All maps © ' +
+ * 'OpenCycleMap'
+ * }),
+ * ol.source.OSM.ATTRIBUTION
+ * ],
+ * ..
+ *
+ * @constructor
+ * @param {olx.AttributionOptions} options Attribution options.
+ * @struct
+ * @api stable
+ */
+ class Attribution {
+ /**
+ * @classdesc
+ * An attribution for a layer source.
*
+ * Example:
+ *
+ * source: new ol.source.OSM({
+ * attributions: [
+ * new ol.Attribution({
+ * html: 'All maps © ' +
+ * 'OpenCycleMap'
+ * }),
+ * ol.source.OSM.ATTRIBUTION
+ * ],
+ * ..
+ *
+ * @constructor
+ * @param {olx.AttributionOptions} options Attribution options.
+ * @struct
+ * @api stable
*/
- pixelRatio: number;
+ constructor(options: olx.AttributionOptions);
/**
- *
+ * Get the attribution markup.
+ * @return {string} The attribution HTML.
+ * @api stable
*/
- time: number;
+ getHTML(): string;
- /**
- *
- */
- viewState: olx.ViewState;
}
- interface FeatureOverlayOptions {
-
+ /**
+ * @classdesc
+ * An expanded version of standard JS Array, adding convenience methods for
+ * manipulation. Add and remove changes to the Collection trigger a Collection
+ * event. Note that this does not cover changes to the objects _within_ the
+ * Collection; they trigger events on the appropriate object, not on the
+ * Collection as a whole.
+ *
+ * @constructor
+ * @extends {ol.Object}
+ * @fires ol.Collection.Event
+ * @param {!Array.=} opt_array Array.
+ * @template T
+ * @api stable
+ */
+ class Collection extends ol.Object {
/**
- * Features
+ * @classdesc
+ * An expanded version of standard JS Array, adding convenience methods for
+ * manipulation. Add and remove changes to the Collection trigger a Collection
+ * event. Note that this does not cover changes to the objects _within_ the
+ * Collection; they trigger events on the appropriate object, not on the
+ * Collection as a whole.
+ *
+ * @constructor
+ * @extends {ol.Object}
+ * @fires ol.Collection.Event
+ * @param {!Array.=} opt_array Array.
+ * @template T
+ * @api stable
*/
- features?: Array | ol.Collection | ol.style.StyleFunction;
+ constructor(opt_array?: T[]);
/**
- * Map
+ * Remove all elements from the collection.
+ * @api stable
+ */
+ clear(): void;
+
+ /**
+ * Add elements to the collection. This pushes each item in the provided array
+ * to the end of the collection.
+ * @param {!Array.} arr Array.
+ * @return {ol.Collection.} This collection.
+ * @api stable
+ */
+ extend(arr: T[]): ol.Collection;
+
+ /**
+ * Iterate over each element, calling the provided callback.
+ * @param {function(this: S, T, number, Array.): *} f The function to call
+ * for every element. This function takes 3 arguments (the element, the
+ * index and the array). The return value is ignored.
+ * @param {S=} opt_this The object to use as `this` in `f`.
+ * @template S
+ * @api stable
+ */
+ forEach(f: ((self: S, item: T, index: number, array: T[]) => any), opt_this?: S): void;
+
+ /**
+ * Get a reference to the underlying Array object. Warning: if the array
+ * is mutated, no events will be dispatched by the collection, and the
+ * collection's "length" property won't be in sync with the actual length
+ * of the array.
+ * @return {!Array.} Array.
+ * @api stable
+ */
+ getArray(): T[];
+
+ /**
+ * Get the element at the provided index.
+ * @param {number} index Index.
+ * @return {T} Element.
+ * @api stable
+ */
+ item(index: number): T;
+
+ /**
+ * Get the length of this collection.
+ * @return {number} The length of the array.
+ * @observable
+ * @api stable
+ */
+ getLength(): number;
+
+ /**
+ * Insert an element at the provided index.
+ * @param {number} index Index.
+ * @param {T} elem Element.
+ * @api stable
+ */
+ insertAt(index: number, elem: T): void;
+
+ /**
+ * Remove the last element of the collection and return it.
+ * Return `undefined` if the collection is empty.
+ * @return {T|undefined} Element.
+ * @api stable
+ */
+ pop(): (T);
+
+ /**
+ * Insert the provided element at the end of the collection.
+ * @param {T} elem Element.
+ * @return {number} Length.
+ * @api stable
+ */
+ push(elem: T): number;
+
+ /**
+ * Remove the first occurrence of an element from the collection.
+ * @param {T} elem Element.
+ * @return {T|undefined} The removed element or undefined if none found.
+ * @api stable
+ */
+ remove(elem: T): (T);
+
+ /**
+ * Remove the element at the provided index and return it.
+ * Return `undefined` if the collection does not contain this index.
+ * @param {number} index Index.
+ * @return {T|undefined} Value.
+ * @api stable
+ */
+ removeAt(index: number): (T);
+
+ /**
+ * Set the element at the provided index.
+ * @param {number} index Index.
+ * @param {T} elem Element.
+ * @api stable
+ */
+ setAt(index: number, elem: T): void;
+
+ }
+
+ module Collection {
+
+ type EventType = string;
+
+ /**
+ * @classdesc
+ * Events emitted by {@link ol.Collection} instances are instances of this
+ * type.
+ *
+ * @constructor
+ * @extends {ol.events.Event}
+ * @implements {oli.Collection.Event}
+ * @param {ol.Collection.EventType} type Type.
+ * @param {*=} opt_element Element.
+ */
+ class Event extends ol.events.Event {
+ /**
+ * @classdesc
+ * Events emitted by {@link ol.Collection} instances are instances of this
+ * type.
+ *
+ * @constructor
+ * @extends {ol.events.Event}
+ * @implements {oli.Collection.Event}
+ * @param {ol.Collection.EventType} type Type.
+ * @param {*=} opt_element Element.
+ */
+ constructor(type: ol.Collection.EventType, opt_element?: any);
+
+ /**
+ * The element that is added to or removed from the collection.
+ * @type {*}
+ * @api stable
+ */
+ element: any;
+
+ }
+ }
+
+ /**
+ * Colors can be defined as a {@link ol.Color} array, or as strings in
+ * `rgb(r,g,b)` or `rgba(r,g,b,a)` format, or in hex `#rrggbb` or `#rgb` format.
+ * Color names, like 'red', 'blue' or 'green', may also be used with the
+ * Canvas renderer.
+ *
+ * @namespace ol.color
+ */
+ module color {
+ /**
+ * Return the color as an array. This function maintains a cache of calculated
+ * arrays which means the result should not be modified.
+ * @param {ol.Color|string} color Color.
+ * @return {ol.Color} Color.
+ * @api
+ */
+ function asArray(color: (ol.Color | string)): ol.Color;
+
+ /**
+ * Return the color as an rgba string.
+ * @param {ol.Color|string} color Color.
+ * @return {string} Rgba string.
+ * @api
+ */
+ function asString(color: (ol.Color | string)): string;
+
+ }
+
+ /**
+ * An {@link ol.ColorLike} can be a color, gradient or pattern accepted by
+ * [CanvasRenderingContext2D.fillStyle](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle).
+ * @namespace ol.colorlike
+ */
+ module colorlike {
+ /**
+ * @param {ol.Color|ol.ColorLike} color Color.
+ * @return {ol.ColorLike} The color as an ol.ColorLike
+ * @api
+ */
+ function asColorLike(color: (ol.Color | ol.ColorLike)): ol.ColorLike;
+
+ }
+
+ /**
+ * @namespace ol.control
+ */
+ module control {
+ /**
+ * @classdesc
+ * Control to show all the attributions associated with the layer sources
+ * in the map. This control is one of the default controls included in maps.
+ * By default it will show in the bottom right portion of the map, but this can
+ * be changed by using a css selector for `.ol-attribution`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.AttributionOptions=} opt_options Attribution options.
+ * @api stable
+ */
+ class Attribution extends ol.control.Control {
+ /**
+ * @classdesc
+ * Control to show all the attributions associated with the layer sources
+ * in the map. This control is one of the default controls included in maps.
+ * By default it will show in the bottom right portion of the map, but this can
+ * be changed by using a css selector for `.ol-attribution`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.AttributionOptions=} opt_options Attribution options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.AttributionOptions);
+
+ /**
+ * Update the attribution element.
+ * @param {ol.MapEvent} mapEvent Map event.
+ * @this {ol.control.Attribution}
+ * @api
+ */
+ static render(mapEvent: ol.MapEvent): void;
+
+ /**
+ * Return `true` if the attribution is collapsible, `false` otherwise.
+ * @return {boolean} True if the widget is collapsible.
+ * @api stable
+ */
+ getCollapsible(): boolean;
+
+ /**
+ * Set whether the attribution should be collapsible.
+ * @param {boolean} collapsible True if the widget is collapsible.
+ * @api stable
+ */
+ setCollapsible(collapsible: boolean): void;
+
+ /**
+ * Collapse or expand the attribution according to the passed parameter. Will
+ * not do anything if the attribution isn't collapsible or if the current
+ * collapsed state is already the one requested.
+ * @param {boolean} collapsed True if the widget is collapsed.
+ * @api stable
+ */
+ setCollapsed(collapsed: boolean): void;
+
+ /**
+ * Return `true` when the attribution is currently collapsed or `false`
+ * otherwise.
+ * @return {boolean} True if the widget is collapsed.
+ * @api stable
+ */
+ getCollapsed(): boolean;
+
+ }
+
+ /**
+ * @classdesc
+ * A control is a visible widget with a DOM element in a fixed position on the
+ * screen. They can involve user input (buttons), or be informational only;
+ * the position is determined using CSS. By default these are placed in the
+ * container with CSS class name `ol-overlaycontainer-stopevent`, but can use
+ * any outside DOM element.
+ *
+ * This is the base class for controls. You can use it for simple custom
+ * controls by creating the element with listeners, creating an instance:
+ * ```js
+ * var myControl = new ol.control.Control({element: myElement});
+ * ```
+ * and then adding this to the map.
+ *
+ * The main advantage of having this as a control rather than a simple separate
+ * DOM element is that preventing propagation is handled for you. Controls
+ * will also be `ol.Object`s in a `ol.Collection`, so you can use their
+ * methods.
+ *
+ * You can also extend this base for your own control class. See
+ * examples/custom-controls for an example of how to do this.
+ *
+ * @constructor
+ * @extends {ol.Object}
+ * @implements {oli.control.Control}
+ * @param {olx.control.ControlOptions} options Control options.
+ * @api stable
+ */
+ class Control extends ol.Object {
+ /**
+ * @classdesc
+ * A control is a visible widget with a DOM element in a fixed position on the
+ * screen. They can involve user input (buttons), or be informational only;
+ * the position is determined using CSS. By default these are placed in the
+ * container with CSS class name `ol-overlaycontainer-stopevent`, but can use
+ * any outside DOM element.
+ *
+ * This is the base class for controls. You can use it for simple custom
+ * controls by creating the element with listeners, creating an instance:
+ * ```js
+ * var myControl = new ol.control.Control({element: myElement});
+ * ```
+ * and then adding this to the map.
+ *
+ * The main advantage of having this as a control rather than a simple separate
+ * DOM element is that preventing propagation is handled for you. Controls
+ * will also be `ol.Object`s in a `ol.Collection`, so you can use their
+ * methods.
+ *
+ * You can also extend this base for your own control class. See
+ * examples/custom-controls for an example of how to do this.
+ *
+ * @constructor
+ * @extends {ol.Object}
+ * @implements {oli.control.Control}
+ * @param {olx.control.ControlOptions} options Control options.
+ * @api stable
+ */
+ constructor(options: olx.control.ControlOptions);
+
+ /**
+ * Get the map associated with this control.
+ * @return {ol.Map} Map.
+ * @api stable
+ */
+ getMap(): ol.Map;
+
+ /**
+ * Remove the control from its current map and attach it to the new map.
+ * Subclasses may set up event handlers to get notified about changes to
+ * the map here.
+ * @param {ol.Map} map Map.
+ * @api stable
+ */
+ setMap(map: ol.Map): void;
+
+ /**
+ * This function is used to set a target element for the control. It has no
+ * effect if it is called after the control has been added to the map (i.e.
+ * after `setMap` is called on the control). If no `target` is set in the
+ * options passed to the control constructor and if `setTarget` is not called
+ * then the control is added to the map's overlay container.
+ * @param {Element|string} target Target.
+ * @api
+ */
+ setTarget(target: (Element | string)): void;
+
+ }
+
+ /**
+ * @classdesc
+ * Provides a button that when clicked fills up the full screen with the map.
+ * The full screen source element is by default the element containing the map viewport unless
+ * overriden by providing the `source` option. In which case, the dom
+ * element introduced using this parameter will be displayed in full screen.
+ *
+ * When in full screen mode, a close button is shown to exit full screen mode.
+ * The [Fullscreen API](http://www.w3.org/TR/fullscreen/) is used to
+ * toggle the map in full screen mode.
+ *
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.FullScreenOptions=} opt_options Options.
+ * @api stable
+ */
+ class FullScreen extends ol.control.Control {
+ /**
+ * @classdesc
+ * Provides a button that when clicked fills up the full screen with the map.
+ * The full screen source element is by default the element containing the map viewport unless
+ * overriden by providing the `source` option. In which case, the dom
+ * element introduced using this parameter will be displayed in full screen.
+ *
+ * When in full screen mode, a close button is shown to exit full screen mode.
+ * The [Fullscreen API](http://www.w3.org/TR/fullscreen/) is used to
+ * toggle the map in full screen mode.
+ *
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.FullScreenOptions=} opt_options Options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.FullScreenOptions);
+
+ }
+
+ /**
+ * Set of controls included in maps by default. Unless configured otherwise,
+ * this returns a collection containing an instance of each of the following
+ * controls:
+ * * {@link ol.control.Zoom}
+ * * {@link ol.control.Rotate}
+ * * {@link ol.control.Attribution}
+ *
+ * @param {olx.control.DefaultsOptions=} opt_options Defaults options.
+ * @return {ol.Collection.} Controls.
+ * @api stable
+ */
+ function defaults(opt_options?: olx.control.DefaultsOptions): ol.Collection;
+
+ /**
+ * @classdesc
+ * A control to show the 2D coordinates of the mouse cursor. By default, these
+ * are in the view projection, but can be in any supported projection.
+ * By default the control is shown in the top right corner of the map, but this
+ * can be changed by using the css selector `.ol-mouse-position`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.MousePositionOptions=} opt_options Mouse position
+ * options.
+ * @api stable
+ */
+ class MousePosition extends ol.control.Control {
+ /**
+ * @classdesc
+ * A control to show the 2D coordinates of the mouse cursor. By default, these
+ * are in the view projection, but can be in any supported projection.
+ * By default the control is shown in the top right corner of the map, but this
+ * can be changed by using the css selector `.ol-mouse-position`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.MousePositionOptions=} opt_options Mouse position
+ * options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.MousePositionOptions);
+
+ /**
+ * Update the mouseposition element.
+ * @param {ol.MapEvent} mapEvent Map event.
+ * @this {ol.control.MousePosition}
+ * @api
+ */
+ static render(mapEvent: ol.MapEvent): void;
+
+ /**
+ * Return the coordinate format type used to render the current position or
+ * undefined.
+ * @return {ol.CoordinateFormatType|undefined} The format to render the current
+ * position in.
+ * @observable
+ * @api stable
+ */
+ getCoordinateFormat(): (ol.CoordinateFormatType);
+
+ /**
+ * Return the projection that is used to report the mouse position.
+ * @return {ol.proj.Projection|undefined} The projection to report mouse
+ * position in.
+ * @observable
+ * @api stable
+ */
+ getProjection(): (ol.proj.Projection);
+
+ /**
+ * Set the coordinate format type used to render the current position.
+ * @param {ol.CoordinateFormatType} format The format to render the current
+ * position in.
+ * @observable
+ * @api stable
+ */
+ setCoordinateFormat(format: ol.CoordinateFormatType): void;
+
+ /**
+ * Set the projection that is used to report the mouse position.
+ * @param {ol.proj.Projection} projection The projection to report mouse
+ * position in.
+ * @observable
+ * @api stable
+ */
+ setProjection(projection: ol.proj.Projection): void;
+
+ }
+
+ /**
+ * Create a new control with a map acting as an overview map for an other
+ * defined map.
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.OverviewMapOptions=} opt_options OverviewMap options.
+ * @api
+ */
+ class OverviewMap extends ol.control.Control {
+ /**
+ * Create a new control with a map acting as an overview map for an other
+ * defined map.
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.OverviewMapOptions=} opt_options OverviewMap options.
+ * @api
+ */
+ constructor(opt_options?: olx.control.OverviewMapOptions);
+
+ /**
+ * Update the overview map element.
+ * @param {ol.MapEvent} mapEvent Map event.
+ * @this {ol.control.OverviewMap}
+ * @api
+ */
+ static render(mapEvent: ol.MapEvent): void;
+
+ /**
+ * Return `true` if the overview map is collapsible, `false` otherwise.
+ * @return {boolean} True if the widget is collapsible.
+ * @api stable
+ */
+ getCollapsible(): boolean;
+
+ /**
+ * Set whether the overview map should be collapsible.
+ * @param {boolean} collapsible True if the widget is collapsible.
+ * @api stable
+ */
+ setCollapsible(collapsible: boolean): void;
+
+ /**
+ * Collapse or expand the overview map according to the passed parameter. Will
+ * not do anything if the overview map isn't collapsible or if the current
+ * collapsed state is already the one requested.
+ * @param {boolean} collapsed True if the widget is collapsed.
+ * @api stable
+ */
+ setCollapsed(collapsed: boolean): void;
+
+ /**
+ * Determine if the overview map is collapsed.
+ * @return {boolean} The overview map is collapsed.
+ * @api stable
+ */
+ getCollapsed(): boolean;
+
+ /**
+ * Return the overview map.
+ * @return {ol.Map} Overview map.
+ * @api
+ */
+ getOverviewMap(): ol.Map;
+
+ }
+
+ /**
+ * @classdesc
+ * A button control to reset rotation to 0.
+ * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css
+ * selector is added to the button when the rotation is 0.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.RotateOptions=} opt_options Rotate options.
+ * @api stable
+ */
+ class Rotate extends ol.control.Control {
+ /**
+ * @classdesc
+ * A button control to reset rotation to 0.
+ * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css
+ * selector is added to the button when the rotation is 0.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.RotateOptions=} opt_options Rotate options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.RotateOptions);
+
+ /**
+ * Update the rotate control element.
+ * @param {ol.MapEvent} mapEvent Map event.
+ * @this {ol.control.Rotate}
+ * @api
+ */
+ static render(mapEvent: ol.MapEvent): void;
+
+ }
+
+ /**
+ * @classdesc
+ * A control displaying rough y-axis distances, calculated for the center of the
+ * viewport. For conformal projections (e.g. EPSG:3857, the default view
+ * projection in OpenLayers), the scale is valid for all directions.
+ * No scale line will be shown when the y-axis distance of a pixel at the
+ * viewport center cannot be calculated in the view projection.
+ * By default the scale line will show in the bottom left portion of the map,
+ * but this can be changed by using the css selector `.ol-scale-line`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ScaleLineOptions=} opt_options Scale line options.
+ * @api stable
+ */
+ class ScaleLine extends ol.control.Control {
+ /**
+ * @classdesc
+ * A control displaying rough y-axis distances, calculated for the center of the
+ * viewport. For conformal projections (e.g. EPSG:3857, the default view
+ * projection in OpenLayers), the scale is valid for all directions.
+ * No scale line will be shown when the y-axis distance of a pixel at the
+ * viewport center cannot be calculated in the view projection.
+ * By default the scale line will show in the bottom left portion of the map,
+ * but this can be changed by using the css selector `.ol-scale-line`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ScaleLineOptions=} opt_options Scale line options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.ScaleLineOptions);
+
+ /**
+ * Return the units to use in the scale line.
+ * @return {ol.control.ScaleLine.Units|undefined} The units to use in the scale
+ * line.
+ * @observable
+ * @api stable
+ */
+ getUnits(): (ol.control.ScaleLine.Units);
+
+ /**
+ * Update the scale line element.
+ * @param {ol.MapEvent} mapEvent Map event.
+ * @this {ol.control.ScaleLine}
+ * @api
+ */
+ static render(mapEvent: ol.MapEvent): void;
+
+ /**
+ * Set the units to use in the scale line.
+ * @param {ol.control.ScaleLine.Units} units The units to use in the scale line.
+ * @observable
+ * @api stable
+ */
+ setUnits(units: ol.control.ScaleLine.Units): void;
+ }
+
+ module ScaleLine {
+ /**
+ * @enum {string}
+ * @api
+ */
+ type Property = string;
+
+ /**
+ * Units for the scale line. Supported values are `'degrees'`, `'imperial'`,
+ * `'nautical'`, `'metric'`, `'us'`.
+ * @enum {string}
+ */
+ type Units = string;
+ }
+
+ /**
+ * @classdesc
+ * A control with 2 buttons, one for zoom in and one for zoom out.
+ * This control is one of the default controls of a map. To style this control
+ * use css selectors `.ol-zoom-in` and `.ol-zoom-out`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ZoomOptions=} opt_options Zoom options.
+ * @api stable
+ */
+ class Zoom extends ol.control.Control {
+ /**
+ * @classdesc
+ * A control with 2 buttons, one for zoom in and one for zoom out.
+ * This control is one of the default controls of a map. To style this control
+ * use css selectors `.ol-zoom-in` and `.ol-zoom-out`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ZoomOptions=} opt_options Zoom options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.ZoomOptions);
+
+ }
+
+ /**
+ * @classdesc
+ * A slider type of control for zooming.
+ *
+ * Example:
+ *
+ * map.addControl(new ol.control.ZoomSlider());
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options.
+ * @api stable
+ */
+ class ZoomSlider extends ol.control.Control {
+ /**
+ * @classdesc
+ * A slider type of control for zooming.
+ *
+ * Example:
+ *
+ * map.addControl(new ol.control.ZoomSlider());
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.ZoomSliderOptions);
+
+ /**
+ * Update the zoomslider element.
+ * @param {ol.MapEvent} mapEvent Map event.
+ * @this {ol.control.ZoomSlider}
+ * @api
+ */
+ static render(mapEvent: ol.MapEvent): void;
+
+ }
+
+ /**
+ * @classdesc
+ * A button control which, when pressed, changes the map view to a specific
+ * extent. To style this control use the css selector `.ol-zoom-extent`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ZoomToExtentOptions=} opt_options Options.
+ * @api stable
+ */
+ class ZoomToExtent extends ol.control.Control {
+ /**
+ * @classdesc
+ * A button control which, when pressed, changes the map view to a specific
+ * extent. To style this control use the css selector `.ol-zoom-extent`.
+ *
+ * @constructor
+ * @extends {ol.control.Control}
+ * @param {olx.control.ZoomToExtentOptions=} opt_options Options.
+ * @api stable
+ */
+ constructor(opt_options?: olx.control.ZoomToExtentOptions);
+
+ }
+
+ }
+
+ /**
+ * @namespace ol.coordinate
+ */
+ module coordinate {
+ /**
+ * Add `delta` to `coordinate`. `coordinate` is modified in place and returned
+ * by the function.
+ *
+ * Example:
+ *
+ * var coord = [7.85, 47.983333];
+ * ol.coordinate.add(coord, [-2, 4]);
+ * // coord is now [5.85, 51.983333]
+ *
+ * @param {ol.Coordinate} coordinate Coordinate.
+ * @param {ol.Coordinate} delta Delta.
+ * @return {ol.Coordinate} The input coordinate adjusted by the given delta.
+ * @api stable
+ */
+ function add(coordinate: ol.Coordinate, delta: ol.Coordinate): ol.Coordinate;
+
+ /**
+ * Returns a {@link ol.CoordinateFormatType} function that can be used to format
+ * a {ol.Coordinate} to a string.
+ *
+ * Example without specifying the fractional digits:
+ *
+ * var coord = [7.85, 47.983333];
+ * var stringifyFunc = ol.coordinate.createStringXY();
+ * var out = stringifyFunc(coord);
+ * // out is now '8, 48'
+ *
+ * Example with explicitly specifying 2 fractional digits:
+ *
+ * var coord = [7.85, 47.983333];
+ * var stringifyFunc = ol.coordinate.createStringXY(2);
+ * var out = stringifyFunc(coord);
+ * // out is now '7.85, 47.98'
+ *
+ * @param {number=} opt_fractionDigits The number of digits to include
+ * after the decimal point. Default is `0`.
+ * @return {ol.CoordinateFormatType} Coordinate format.
+ * @api stable
+ */
+ function createStringXY(opt_fractionDigits?: number): ol.CoordinateFormatType;
+
+ /**
+ * Transforms the given {@link ol.Coordinate} to a string using the given string
+ * template. The strings `{x}` and `{y}` in the template will be replaced with
+ * the first and second coordinate values respectively.
+ *
+ * Example without specifying the fractional digits:
+ *
+ * var coord = [7.85, 47.983333];
+ * var template = 'Coordinate is ({x}|{y}).';
+ * var out = ol.coordinate.format(coord, template);
+ * // out is now 'Coordinate is (8|48).'
+ *
+ * Example explicitly specifying the fractional digits:
+ *
+ * var coord = [7.85, 47.983333];
+ * var template = 'Coordinate is ({x}|{y}).';
+ * var out = ol.coordinate.format(coord, template, 2);
+ * // out is now 'Coordinate is (7.85|47.98).'
+ *
+ * @param {ol.Coordinate|undefined} coordinate Coordinate.
+ * @param {string} template A template string with `{x}` and `{y}` placeholders
+ * that will be replaced by first and second coordinate values.
+ * @param {number=} opt_fractionDigits The number of digits to include
+ * after the decimal point. Default is `0`.
+ * @return {string} Formatted coordinate.
+ * @api stable
+ */
+ function format(coordinate: (ol.Coordinate), template: string, opt_fractionDigits?: number): string;
+
+ /**
+ * Rotate `coordinate` by `angle`. `coordinate` is modified in place and
+ * returned by the function.
+ *
+ * Example:
+ *
+ * var coord = [7.85, 47.983333];
+ * var rotateRadians = Math.PI / 2; // 90 degrees
+ * ol.coordinate.rotate(coord, rotateRadians);
+ * // coord is now [-47.983333, 7.85]
+ *
+ * @param {ol.Coordinate} coordinate Coordinate.
+ * @param {number} angle Angle in radian.
+ * @return {ol.Coordinate} Coordinate.
+ * @api stable
+ */
+ function rotate(coordinate: ol.Coordinate, angle: number): ol.Coordinate;
+
+ /**
+ * Format a geographic coordinate with the hemisphere, degrees, minutes, and
+ * seconds.
+ *
+ * Example without specifying fractional digits:
+ *
+ * var coord = [7.85, 47.983333];
+ * var out = ol.coordinate.toStringHDMS(coord);
+ * // out is now '47° 58′ 60″ N 7° 50′ 60″ E'
+ *
+ * Example explicitly specifying 1 fractional digit:
+ *
+ * var coord = [7.85, 47.983333];
+ * var out = ol.coordinate.toStringHDMS(coord, 1);
+ * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'
+ *
+ * @param {ol.Coordinate|undefined} coordinate Coordinate.
+ * @param {number=} opt_fractionDigits The number of digits to include
+ * after the decimal point. Default is `0`.
+ * @return {string} Hemisphere, degrees, minutes and seconds.
+ * @api stable
+ */
+ function toStringHDMS(coordinate?: ol.Coordinate, opt_fractionDigits?: number): string;
+
+ /**
+ * Format a coordinate as a comma delimited string.
+ *
+ * Example without specifying fractional digits:
+ *
+ * var coord = [7.85, 47.983333];
+ * var out = ol.coordinate.toStringXY(coord);
+ * // out is now '8, 48'
+ *
+ * Example explicitly specifying 1 fractional digit:
+ *
+ * var coord = [7.85, 47.983333];
+ * var out = ol.coordinate.toStringXY(coord, 1);
+ * // out is now '7.8, 48.0'
+ *
+ * @param {ol.Coordinate|undefined} coordinate Coordinate.
+ * @param {number=} opt_fractionDigits The number of digits to include
+ * after the decimal point. Default is `0`.
+ * @return {string} XY.
+ * @api stable
+ */
+ function toStringXY(coordinate?: ol.Coordinate, opt_fractionDigits?: number): string;
+
+ }
+
+ /**
+ * @classdesc
+ * The ol.DeviceOrientation class provides access to information from
+ * DeviceOrientation events. See the [HTML 5 DeviceOrientation Specification](
+ * http://www.w3.org/TR/orientation-event/) for more details.
+ *
+ * Many new computers, and especially mobile phones
+ * and tablets, provide hardware support for device orientation. Web
+ * developers targeting mobile devices will be especially interested in this
+ * class.
+ *
+ * Device orientation data are relative to a common starting point. For mobile
+ * devices, the starting point is to lay your phone face up on a table with the
+ * top of the phone pointing north. This represents the zero state. All
+ * angles are then relative to this state. For computers, it is the same except
+ * the screen is open at 90 degrees.
+ *
+ * Device orientation is reported as three angles - `alpha`, `beta`, and
+ * `gamma` - relative to the starting position along the three planar axes X, Y
+ * and Z. The X axis runs from the left edge to the right edge through the
+ * middle of the device. Similarly, the Y axis runs from the bottom to the top
+ * of the device through the middle. The Z axis runs from the back to the front
+ * through the middle. In the starting position, the X axis points to the
+ * right, the Y axis points away from you and the Z axis points straight up
+ * from the device lying flat.
+ *
+ * The three angles representing the device orientation are relative to the
+ * three axes. `alpha` indicates how much the device has been rotated around the
+ * Z axis, which is commonly interpreted as the compass heading (see note
+ * below). `beta` indicates how much the device has been rotated around the X
+ * axis, or how much it is tilted from front to back. `gamma` indicates how
+ * much the device has been rotated around the Y axis, or how much it is tilted
+ * from left to right.
+ *
+ * For most browsers, the `alpha` value returns the compass heading so if the
+ * device points north, it will be 0. With Safari on iOS, the 0 value of
+ * `alpha` is calculated from when device orientation was first requested.
+ * ol.DeviceOrientation provides the `heading` property which normalizes this
+ * behavior across all browsers for you.
+ *
+ * It is important to note that the HTML 5 DeviceOrientation specification
+ * indicates that `alpha`, `beta` and `gamma` are in degrees while the
+ * equivalent properties in ol.DeviceOrientation are in radians for consistency
+ * with all other uses of angles throughout OpenLayers.
+ *
+ * To get notified of device orientation changes, register a listener for the
+ * generic `change` event on your `ol.DeviceOrientation` instance.
+ *
+ * @see {@link http://www.w3.org/TR/orientation-event/}
+ *
+ * @constructor
+ * @extends {ol.Object}
+ * @param {olx.DeviceOrientationOptions=} opt_options Options.
+ * @api
+ */
+ class DeviceOrientation extends ol.Object {
+ /**
+ * @classdesc
+ * The ol.DeviceOrientation class provides access to information from
+ * DeviceOrientation events. See the [HTML 5 DeviceOrientation Specification](
+ * http://www.w3.org/TR/orientation-event/) for more details.
+ *
+ * Many new computers, and especially mobile phones
+ * and tablets, provide hardware support for device orientation. Web
+ * developers targeting mobile devices will be especially interested in this
+ * class.
+ *
+ * Device orientation data are relative to a common starting point. For mobile
+ * devices, the starting point is to lay your phone face up on a table with the
+ * top of the phone pointing north. This represents the zero state. All
+ * angles are then relative to this state. For computers, it is the same except
+ * the screen is open at 90 degrees.
+ *
+ * Device orientation is reported as three angles - `alpha`, `beta`, and
+ * `gamma` - relative to the starting position along the three planar axes X, Y
+ * and Z. The X axis runs from the left edge to the right edge through the
+ * middle of the device. Similarly, the Y axis runs from the bottom to the top
+ * of the device through the middle. The Z axis runs from the back to the front
+ * through the middle. In the starting position, the X axis points to the
+ * right, the Y axis points away from you and the Z axis points straight up
+ * from the device lying flat.
+ *
+ * The three angles representing the device orientation are relative to the
+ * three axes. `alpha` indicates how much the device has been rotated around the
+ * Z axis, which is commonly interpreted as the compass heading (see note
+ * below). `beta` indicates how much the device has been rotated around the X
+ * axis, or how much it is tilted from front to back. `gamma` indicates how
+ * much the device has been rotated around the Y axis, or how much it is tilted
+ * from left to right.
+ *
+ * For most browsers, the `alpha` value returns the compass heading so if the
+ * device points north, it will be 0. With Safari on iOS, the 0 value of
+ * `alpha` is calculated from when device orientation was first requested.
+ * ol.DeviceOrientation provides the `heading` property which normalizes this
+ * behavior across all browsers for you.
+ *
+ * It is important to note that the HTML 5 DeviceOrientation specification
+ * indicates that `alpha`, `beta` and `gamma` are in degrees while the
+ * equivalent properties in ol.DeviceOrientation are in radians for consistency
+ * with all other uses of angles throughout OpenLayers.
+ *
+ * To get notified of device orientation changes, register a listener for the
+ * generic `change` event on your `ol.DeviceOrientation` instance.
+ *
+ * @see {@link http://www.w3.org/TR/orientation-event/}
+ *
+ * @constructor
+ * @extends {ol.Object}
+ * @param {olx.DeviceOrientationOptions=} opt_options Options.
+ * @api
+ */
+ constructor(opt_options?: olx.DeviceOrientationOptions);
+
+ /**
+ * Rotation around the device z-axis (in radians).
+ * @return {number|undefined} The euler angle in radians of the device from the
+ * standard Z axis.
+ * @observable
+ * @api
+ */
+ getAlpha(): (number);
+
+ /**
+ * Rotation around the device x-axis (in radians).
+ * @return {number|undefined} The euler angle in radians of the device from the
+ * planar X axis.
+ * @observable
+ * @api
+ */
+ getBeta(): (number);
+
+ /**
+ * Rotation around the device y-axis (in radians).
+ * @return {number|undefined} The euler angle in radians of the device from the
+ * planar Y axis.
+ * @observable
+ * @api
+ */
+ getGamma(): (number);
+
+ /**
+ * The heading of the device relative to north (in radians).
+ * @return {number|undefined} The heading of the device relative to north, in
+ * radians, normalizing for different browser behavior.
+ * @observable
+ * @api
+ */
+ getHeading(): (number);
+
+ /**
+ * Determine if orientation is being tracked.
+ * @return {boolean} Changes in device orientation are being tracked.
+ * @observable
+ * @api
+ */
+ getTracking(): boolean;
+
+ /**
+ * Enable or disable tracking of device orientation events.
+ * @param {boolean} tracking The status of tracking changes to alpha, beta and
+ * gamma. If true, changes are tracked and reported immediately.
+ * @observable
+ * @api
+ */
+ setTracking(tracking: boolean): void;
+
+ }
+
+ /**
+ * Objects that need to clean up after themselves.
+ * @constructor
+ */
+ class Disposable {
+ /**
+ * Objects that need to clean up after themselves.
+ * @constructor
+ */
+ constructor();
+
+ }
+
+ /**
+ * Easing functions for {@link ol.animation}.
+ * @namespace ol.easing
+ */
+ module easing {
+ /**
+ * Start slow and speed up.
+ * @param {number} t Input between 0 and 1.
+ * @return {number} Output between 0 and 1.
+ * @api
+ */
+ function easeIn(t: number): number;
+
+ /**
+ * Start fast and slow down.
+ * @param {number} t Input between 0 and 1.
+ * @return {number} Output between 0 and 1.
+ * @api
+ */
+ function easeOut(t: number): number;
+
+ /**
+ * Start slow, speed up, and then slow down again.
+ * @param {number} t Input between 0 and 1.
+ * @return {number} Output between 0 and 1.
+ * @api
+ */
+ function inAndOut(t: number): number;
+
+ /**
+ * Maintain a constant speed over time.
+ * @param {number} t Input between 0 and 1.
+ * @return {number} Output between 0 and 1.
+ * @api
+ */
+ function linear(t: number): number;
+
+ /**
+ * Start slow, speed up, and at the very end slow down again. This has the
+ * same general behavior as {@link ol.easing.inAndOut}, but the final slowdown
+ * is delayed.
+ * @param {number} t Input between 0 and 1.
+ * @return {number} Output between 0 and 1.
+ * @api
+ */
+ function upAndDown(t: number): number;
+
+ }
+
+ /**
+ * Applications do not normally create event instances. They register (and
+ * unregister) event listener functions, which, when called by the library as
+ * the result of an event being dispatched, are passed event instances as their
+ * first argument. Listeners can be registered and unregistered on all objects
+ * descending from {@link ol.Observable}. All event instances have a `target`
+ * property, which corresponds to the object on which the event was dispatched.
+ * By default, `this` within the listener also refers to the target, though
+ * this can be configured in the listener registration function.
+ * Some classes have their own event type, which return additional
+ * properties; see the specific event class page for details.
+ *
+ * @namespace ol.events
+ */
+ module events {
+ /**
+ * @namespace ol.events.condition
+ */
+ module condition {
+ /**
+ * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
+ * additionally the shift-key is pressed).
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if only the alt key is pressed.
+ * @api stable
+ */
+ function altKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise
+ * (e.g. when additionally the platform-modifier-key is pressed).
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if only the alt and shift keys are pressed.
+ * @api stable
+ */
+ function altShiftKeysOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return always true.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True.
+ * @function
+ * @api stable
+ */
+ function always(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if the event is a `click` event, `false` otherwise.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if the event is a map `click` event.
+ * @api stable
+ */
+ function click(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return always false.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} False.
+ * @function
+ * @api stable
+ */
+ function never(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if the browser event is a `pointermove` event, `false`
+ * otherwise.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if the browser event is a `pointermove` event.
+ * @api
+ */
+ function pointerMove(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if the event is a map `singleclick` event, `false` otherwise.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if the event is a map `singleclick` event.
+ * @api stable
+ */
+ function singleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if the event is a map `dblclick` event, `false` otherwise.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if the event is a map `dblclick` event.
+ * @api stable
+ */
+ function doubleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
+ * pressed.
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True only if there no modifier keys are pressed.
+ * @api stable
+ */
+ function noModifierKeys(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if only the platform-modifier-key (the meta-key on Mac,
+ * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally
+ * the shift-key is pressed).
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if only the platform modifier key is pressed.
+ * @api stable
+ */
+ function platformModifierKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
+ * additionally the alt-key is pressed).
+ *
+ * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
+ * @return {boolean} True if only the shift key is pressed.
+ * @api stable
+ */
+ function shiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
+
+ /**
+ * Return `true` if the target element is not editable, i.e. not a ``-,
+ * `