UNPKG

openlayers

Version:

Build tools and sources for developing OpenLayers based mapping applications

2,010 lines (1,573 loc) 194 kB
/** * @type {Object} */ var olx; /* typedefs for object literals provided by applications */ /** * @typedef {{html: string, * tileRanges: (Object.<string, Array.<ol.TileRange>>|undefined)}} */ olx.AttributionOptions; /** * HTML markup for this attribution. * @type {string} * @api stable */ olx.AttributionOptions.prototype.html; /** * @typedef {{tracking: (boolean|undefined)}} */ olx.DeviceOrientationOptions; /** * Start tracking. Default is `false`. * @type {boolean|undefined} * @api */ olx.DeviceOrientationOptions.prototype.tracking; /** * @typedef {{tracking: (boolean|undefined), * trackingOptions: (GeolocationPositionOptions|undefined), * projection: ol.ProjectionLike}} */ olx.GeolocationOptions; /** * Start Tracking. Default is `false`. * @type {boolean|undefined} * @api stable */ olx.GeolocationOptions.prototype.tracking; /** * Tracking options. See * {@link http://www.w3.org/TR/geolocation-API/#position_options_interface}. * @type {GeolocationPositionOptions|undefined} * @api stable */ olx.GeolocationOptions.prototype.trackingOptions; /** * The projection the position is reported in. * @type {ol.ProjectionLike} * @api stable */ olx.GeolocationOptions.prototype.projection; /** * Object literal with config options for the map logo. * @typedef {{href: (string), src: (string)}} */ olx.LogoOptions; /** * Link url for the logo. Will be followed when the logo is clicked. * @type {string} * @api */ olx.LogoOptions.prototype.href; /** * Image src for the logo. * @type {string} * @api */ olx.LogoOptions.prototype.src; /** * @typedef {{map: (ol.Map|undefined), * maxLines: (number|undefined), * strokeStyle: (ol.style.Stroke|undefined), * targetSize: (number|undefined)}} */ olx.GraticuleOptions; /** * Reference to an `ol.Map` object. * @type {ol.Map|undefined} * @api */ olx.GraticuleOptions.prototype.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. * @type {number|undefined} * @api */ olx.GraticuleOptions.prototype.maxLines; /** * 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. * * @type {ol.style.Stroke|undefined} * @api */ olx.GraticuleOptions.prototype.strokeStyle; /** * The target size of the graticule cells, in pixels. Default * value is 100 pixels. * @type {number|undefined} * @api */ olx.GraticuleOptions.prototype.targetSize; /** * Object literal with config options for interactions. * @typedef {{handleEvent: function(ol.MapBrowserEvent):boolean}} */ olx.interaction.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. * @type {function(ol.MapBrowserEvent):boolean} * @api */ olx.interaction.InteractionOptions.prototype.handleEvent; /** * Object literal with config options for the map. * @typedef {{controls: (ol.Collection.<ol.control.Control>|Array.<ol.control.Control>|undefined), * pixelRatio: (number|undefined), * interactions: (ol.Collection.<ol.interaction.Interaction>|Array.<ol.interaction.Interaction>|undefined), * keyboardEventTarget: (Element|Document|string|undefined), * layers: (Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined), * loadTilesWhileAnimating: (boolean|undefined), * loadTilesWhileInteracting: (boolean|undefined), * logo: (boolean|string|olx.LogoOptions|Element|undefined), * overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined), * renderer: (ol.renderer.Type|Array.<ol.renderer.Type>|undefined), * target: (Element|string|undefined), * view: (ol.View|undefined)}} */ olx.MapOptions; /** * Controls initially added to the map. If not specified, * {@link ol.control.defaults ol.control.defaults()} is used. * @type {ol.Collection.<ol.control.Control>|Array.<ol.control.Control>|undefined} * @api stable */ olx.MapOptions.prototype.controls; /** * The ratio between physical pixels and device-independent pixels (dips) on the * device. If `undefined` then it gets set by using `window.devicePixelRatio`. * @type {number|undefined} * @api */ olx.MapOptions.prototype.pixelRatio; /** * Interactions that are initially added to the map. If not specified, * {@link ol.interaction.defaults ol.interaction.defaults()} is used. * @type {ol.Collection.<ol.interaction.Interaction>|Array.<ol.interaction.Interaction>|undefined} * @api stable */ olx.MapOptions.prototype.interactions; /** * 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. * @type {Element|Document|string|undefined} * @api */ olx.MapOptions.prototype.keyboardEventTarget; /** * 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. * @type {Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined} * @api stable */ olx.MapOptions.prototype.layers; /** * 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`. * @type {boolean|undefined} * @api */ olx.MapOptions.prototype.loadTilesWhileAnimating; /** * 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`. * @type {boolean|undefined} * @api */ olx.MapOptions.prototype.loadTilesWhileInteracting; /** * 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. If an element is provided, * the element will be used. To disable the map logo, set the option to * `false`. By default, the OpenLayers 3 logo is shown. * @type {boolean|string|olx.LogoOptions|Element|undefined} * @api stable */ olx.MapOptions.prototype.logo; /** * Overlays initially added to the map. By default, no overlays are added. * @type {ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined} * @api stable */ olx.MapOptions.prototype.overlays; /** * Renderer. By default, Canvas and WebGL renderers are tested for support * in that order, and the first supported used. Specify a * {@link ol.renderer.Type} here to use a specific renderer. * Note that the Canvas renderer fully supports vector data, but WebGL can only * render Point geometries. * @type {ol.renderer.Type|Array.<ol.renderer.Type>|undefined} * @api stable */ olx.MapOptions.prototype.renderer; /** * The container for the map, either the element itself or the `id` of the * element. If not specified at construction time, {@link ol.Map#setTarget} * must be called for the map to be rendered. * @type {Element|string|undefined} * @api stable */ olx.MapOptions.prototype.target; /** * The map's view. No layer sources will be fetched unless this is specified at * construction time or through {@link ol.Map#setView}. * @type {ol.View|undefined} * @api stable */ olx.MapOptions.prototype.view; /** * Object literal with options for the {@link ol.Map#forEachFeatureAtPixel} and * {@link ol.Map#hasFeatureAtPixel} methods. * @typedef {{layerFilter: ((function(ol.layer.Layer): boolean)|undefined), * hitTolerance: (number|undefined)}} */ olx.AtPixelOptions; /** * Layer filter function. The filter function will receive one argument, the * {@link ol.layer.Layer 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. * @type {((function(ol.layer.Layer): boolean)|undefined)} * @api stable */ olx.AtPixelOptions.prototype.layerFilter; /** * Hit-detection tolerance in pixels. Pixels inside the radius around the given position * will be checked for features. This only works for the canvas renderer and * not for WebGL. * @type {number|undefined} * @api */ olx.AtPixelOptions.prototype.hitTolerance; /** * Object literal with config options for the overlay. * @typedef {{id: (number|string|undefined), * element: (Element|undefined), * offset: (Array.<number>|undefined), * position: (ol.Coordinate|undefined), * positioning: (ol.Overlay.Positioning|string|undefined), * stopEvent: (boolean|undefined), * insertFirst: (boolean|undefined), * autoPan: (boolean|undefined), * autoPanAnimation: (olx.OverlayPanOptions|undefined), * autoPanMargin: (number|undefined)}} */ olx.OverlayOptions; /** * Set the overlay id. The overlay id can be used with the * {@link ol.Map#getOverlayById} method. * @type {number|string|undefined} * @api */ olx.OverlayOptions.prototype.id; /** * The overlay element. * @type {Element|undefined} * @api stable */ olx.OverlayOptions.prototype.element; /** * Offsets in pixels used when positioning the overlay. The first 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]`. * @type {Array.<number>|undefined} * @api stable */ olx.OverlayOptions.prototype.offset; /** * The overlay position in map projection. * @type {ol.Coordinate|undefined} * @api stable */ olx.OverlayOptions.prototype.position; /** * 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'`. * @type {ol.Overlay.Positioning|string|undefined} * @api stable */ olx.OverlayOptions.prototype.positioning; /** * 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`. * @type {boolean|undefined} * @api stable */ olx.OverlayOptions.prototype.stopEvent; /** * 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. * @type {boolean|undefined} * @api stable */ olx.OverlayOptions.prototype.insertFirst; /** * 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`. * @type {boolean|undefined} * @api */ olx.OverlayOptions.prototype.autoPan; /** * The animation options used to pan the overlay into view. This animation * is only used when `autoPan` is enabled. A `duration` and `easing` may be * provided to customize the animation. * @type {olx.OverlayPanOptions|undefined} * @api */ olx.OverlayOptions.prototype.autoPanAnimation; /** * The margin (in pixels) between the overlay and the borders of the map when * autopanning. The default is `20`. * @type {number|undefined} * @api */ olx.OverlayOptions.prototype.autoPanMargin; /** * @typedef {{ * duration: (number|undefined), * easing: (undefined|function(number):number) * }} */ olx.OverlayPanOptions; /** * The duration of the animation in milliseconds. Default is `1000`. * @type {number|undefined} * @api */ olx.OverlayPanOptions.prototype.duration; /** * The easing function to use. Can be an {@link ol.easing} or a custom function. * Default is {@link ol.easing.inAndOut}. * @type {undefined|function(number):number} * @api */ olx.OverlayPanOptions.prototype.easing; /** * Object literal with config options for the projection. * @typedef {{code: string, * units: (ol.proj.Units|string|undefined), * extent: (ol.Extent|undefined), * axisOrientation: (string|undefined), * global: (boolean|undefined), * metersPerUnit: (number|undefined), * worldExtent: (ol.Extent|undefined), * getPointResolution: (function(number, ol.Coordinate):number|undefined) }} */ olx.ProjectionOptions; /** * The SRS identifier code, e.g. `EPSG:4326`. * @type {string} * @api stable */ olx.ProjectionOptions.prototype.code; /** * Units. Required unless a proj4 projection is defined for `code`. * @type {ol.proj.Units|string|undefined} * @api stable */ olx.ProjectionOptions.prototype.units; /** * The validity extent for the SRS. * @type {ol.Extent|undefined} * @api stable */ olx.ProjectionOptions.prototype.extent; /** * The axis orientation as specified in Proj4. The default is `enu`. * @type {string|undefined} * @api stable */ olx.ProjectionOptions.prototype.axisOrientation; /** * Whether the projection is valid for the whole globe. Default is `false`. * @type {boolean|undefined} * @api stable */ olx.ProjectionOptions.prototype.global; /** * The meters per unit for the SRS. If not provided, the `units` are used to get * the meters per unit from the {@link ol.proj.METERS_PER_UNIT} lookup table. * @type {number|undefined} * @api */ olx.ProjectionOptions.prototype.metersPerUnit; /** * The world extent for the SRS. * @type {ol.Extent|undefined} * @api */ olx.ProjectionOptions.prototype.worldExtent; /** * 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. * @type {(function(number, ol.Coordinate):number|undefined)} * @api */ olx.ProjectionOptions.prototype.getPointResolution; /** * Object literal with config options for the view. * @typedef {{center: (ol.Coordinate|undefined), * constrainRotation: (boolean|number|undefined), * enableRotation: (boolean|undefined), * extent: (ol.Extent|undefined), * minResolution: (number|undefined), * maxResolution: (number|undefined), * minZoom: (number|undefined), * maxZoom: (number|undefined), * projection: ol.ProjectionLike, * resolution: (number|undefined), * resolutions: (Array.<number>|undefined), * rotation: (number|undefined), * zoom: (number|undefined), * zoomFactor: (number|undefined)}} */ olx.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. * @type {ol.Coordinate|undefined} * @api stable */ olx.ViewOptions.prototype.center; /** * 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`. * @type {boolean|number|undefined} * @api */ olx.ViewOptions.prototype.constrainRotation; /** * 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`. * @type {boolean|undefined} * @api */ olx.ViewOptions.prototype.enableRotation; /** * The extent that constrains the center, in other words, center cannot be set * outside this extent. Default is `undefined`. * @type {ol.Extent|undefined} * @api */ olx.ViewOptions.prototype.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`. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.maxResolution; /** * 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`. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.minResolution; /** * 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`. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.maxZoom; /** * 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`. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.minZoom; /** * The projection. Default is `EPSG:3857` (Spherical Mercator). * @type {ol.ProjectionLike} * @api stable */ olx.ViewOptions.prototype.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. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.resolution; /** * Resolutions to determine the resolution constraint. If set the * `maxResolution`, `minResolution`, `minZoom`, `maxZoom`, and `zoomFactor` * options are ignored. * @type {Array.<number>|undefined} * @api stable */ olx.ViewOptions.prototype.resolutions; /** * The initial rotation for the view in radians (positive rotation clockwise). * Default is `0`. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.rotation; /** * 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. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.zoom; /** * The zoom factor used to determine the resolution constraint. Default is `2`. * @type {number|undefined} * @api stable */ olx.ViewOptions.prototype.zoomFactor; /** * @typedef {{ * center: (ol.Coordinate|undefined), * zoom: (number|undefined), * resolution: (number|undefined), * rotation: (number|undefined), * anchor: (ol.Coordinate|undefined), * duration: (number|undefined), * easing: (undefined|function(number):number) * }} */ olx.AnimationOptions; /** * The center of the view at the end of the animation. * @type {ol.Coordinate|undefined} * @api */ olx.AnimationOptions.prototype.center; /** * The zoom level of the view at the end of the animation. This takes * precedence over `resolution`. * @type {number|undefined} * @api */ olx.AnimationOptions.prototype.zoom; /** * The resolution of the view at the end of the animation. If `zoom` is also * provided, this option will be ignored. * @type {number|undefined} * @api */ olx.AnimationOptions.prototype.resolution; /** * The rotation of the view at the end of the animation. * @type {number|undefined} * @api */ olx.AnimationOptions.prototype.rotation; /** * Optional anchor to remained fixed during a rotation or resolution animation. * @type {ol.Coordinate|undefined} * @api */ olx.AnimationOptions.prototype.anchor; /** * The duration of the animation in milliseconds (defaults to `1000`). * @type {number|undefined} * @api */ olx.AnimationOptions.prototype.duration; /** * The easing function used during the animation (defaults to {@link ol.easing.inAndOut}). * The function will be called for each frame with a number representing a * fraction of the animation's duration. The function should return a number * between 0 and 1 representing the progress toward the destination state. * @type {undefined|function(number):number} * @api */ olx.AnimationOptions.prototype.easing; /** * Namespace. * @type {Object} */ olx.animation; /** * @typedef {{resolution: number, * start: (number|undefined), * duration: (number|undefined), * easing: (undefined|function(number):number)}} */ olx.animation.BounceOptions; /** * The resolution to start the bounce from, typically * `map.getView().getResolution()`. * @type {number} * @api */ olx.animation.BounceOptions.prototype.resolution; /** * The start time of the animation. Default is immediately. * @type {number|undefined} * @api */ olx.animation.BounceOptions.prototype.start; /** * The duration of the animation in milliseconds. Default is `1000`. * @type {number|undefined} * @api */ olx.animation.BounceOptions.prototype.duration; /** * The easing function to use. Can be an {@link ol.easing} or a custom function. * Default is {@link ol.easing.upAndDown}. * @type {undefined|function(number):number} * @api */ olx.animation.BounceOptions.prototype.easing; /** * @typedef {{source: ol.Coordinate, * start: (number|undefined), * duration: (number|undefined), * easing: (undefined|function(number):number)}} */ olx.animation.PanOptions; /** * The location to start panning from, typically `map.getView().getCenter()`. * @type {ol.Coordinate} * @api */ olx.animation.PanOptions.prototype.source; /** * The start time of the animation. Default is immediately. * @type {number|undefined} * @api */ olx.animation.PanOptions.prototype.start; /** * The duration of the animation in milliseconds. Default is `1000`. * @type {number|undefined} * @api */ olx.animation.PanOptions.prototype.duration; /** * The easing function to use. Can be an {@link ol.easing} or a custom function. * Default is {@link ol.easing.inAndOut}. * @type {undefined|function(number):number} * @api */ olx.animation.PanOptions.prototype.easing; /** * @typedef {{rotation: (number|undefined), * anchor: (ol.Coordinate|undefined), * start: (number|undefined), * duration: (number|undefined), * easing: (undefined|function(number):number)}} */ olx.animation.RotateOptions; /** * The rotation value (in radians) to begin rotating from, typically * `map.getView().getRotation()`. If `undefined` then `0` is assumed. * @type {number|undefined} * @api */ olx.animation.RotateOptions.prototype.rotation; /** * The rotation center/anchor. The map rotates around the center of the view * if unspecified. * @type {ol.Coordinate|undefined} * @api */ olx.animation.RotateOptions.prototype.anchor; /** * The start time of the animation. Default is immediately. * @type {number|undefined} * @api */ olx.animation.RotateOptions.prototype.start; /** * The duration of the animation in milliseconds. Default is `1000`. * @type {number|undefined} * @api */ olx.animation.RotateOptions.prototype.duration; /** * The easing function to use. Can be an {@link ol.easing} or a custom function. * Default is {@link ol.easing.inAndOut}. * @type {undefined|function(number):number} * @api */ olx.animation.RotateOptions.prototype.easing; /** * @typedef {{resolution: number, * start: (number|undefined), * duration: (number|undefined), * easing: (undefined|function(number):number)}} */ olx.animation.ZoomOptions; /** * number The resolution to begin zooming from, typically * `map.getView().getResolution()`. * @type {number} * @api */ olx.animation.ZoomOptions.prototype.resolution; /** * The start time of the animation. Default is immediately. * @type {number|undefined} * @api */ olx.animation.ZoomOptions.prototype.start; /** * The duration of the animation in milliseconds. Default is `1000`. * @type {number|undefined} * @api */ olx.animation.ZoomOptions.prototype.duration; /** * The easing function to use. Can be an {@link ol.easing} or a custom function. * Default is {@link ol.easing.inAndOut}. * @type {undefined|function(number):number} * @api */ olx.animation.ZoomOptions.prototype.easing; /** * Namespace. * @type {Object} */ olx.control; /** * @typedef {{className: (string|undefined), * collapsible: (boolean|undefined), * collapsed: (boolean|undefined), * tipLabel: (string|undefined), * label: (string|Node|undefined), * collapseLabel: (string|Node|undefined), * render: (function(ol.MapEvent)|undefined), * target: (Element|undefined)}} */ olx.control.AttributionOptions; /** * CSS class name. Default is `ol-attribution`. * @type {string|undefined} * @api */ olx.control.AttributionOptions.prototype.className; /** * Target. * @type {Element|undefined} * @api */ olx.control.AttributionOptions.prototype.target; /** * Specify if attributions can be collapsed. If you use an OSM source, * should be set to `false` — see * {@link https://www.openstreetmap.org/copyright OSM Copyright} — * Default is `true`. * @type {boolean|undefined} * @api */ olx.control.AttributionOptions.prototype.collapsible; /** * Specify if attributions should be collapsed at startup. Default is `true`. * @type {boolean|undefined} * @api */ olx.control.AttributionOptions.prototype.collapsed; /** * Text label to use for the button tip. Default is `Attributions` * @type {string|undefined} * @api */ olx.control.AttributionOptions.prototype.tipLabel; /** * 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. * @type {string|Node|undefined} * @api */ olx.control.AttributionOptions.prototype.label; /** * 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. * @type {string|Node|undefined} * @api */ olx.control.AttributionOptions.prototype.collapseLabel; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.AttributionOptions.prototype.render; /** * @typedef {{element: (Element|undefined), * render: (function(ol.MapEvent)|undefined), * target: (Element|string|undefined)}} */ olx.control.ControlOptions; /** * The element is the control's container element. This only needs to be * specified if you're developing a custom control. * @type {Element|undefined} * @api stable */ olx.control.ControlOptions.prototype.element; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.ControlOptions.prototype.render; /** * Specify a target if you want the control to be rendered outside of the map's * viewport. * @type {Element|string|undefined} * @api stable */ olx.control.ControlOptions.prototype.target; /** * @typedef {{attribution: (boolean|undefined), * attributionOptions: (olx.control.AttributionOptions|undefined), * rotate: (boolean|undefined), * rotateOptions: (olx.control.RotateOptions|undefined), * zoom: (boolean|undefined), * zoomOptions: (olx.control.ZoomOptions|undefined)}} */ olx.control.DefaultsOptions; /** * Attribution. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.control.DefaultsOptions.prototype.attribution; /** * Attribution options. * @type {olx.control.AttributionOptions|undefined} * @api */ olx.control.DefaultsOptions.prototype.attributionOptions; /** * Rotate. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.control.DefaultsOptions.prototype.rotate; /** * Rotate options. * @type {olx.control.RotateOptions|undefined} * @api */ olx.control.DefaultsOptions.prototype.rotateOptions; /** * Zoom. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.control.DefaultsOptions.prototype.zoom; /** * Zoom options. * @type {olx.control.ZoomOptions|undefined} * @api */ olx.control.DefaultsOptions.prototype.zoomOptions; /** * @typedef {{className: (string|undefined), * label: (string|Node|undefined), * labelActive: (string|Node|undefined), * tipLabel: (string|undefined), * keys: (boolean|undefined), * target: (Element|undefined), * source: (Element|string|undefined)}} */ olx.control.FullScreenOptions; /** * CSS class name. Default is `ol-full-screen`. * @type {string|undefined} * @api */ olx.control.FullScreenOptions.prototype.className; /** * Text label to use for the button. Default is `\u2922` (NORTH EAST AND SOUTH WEST ARROW). * Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|Node|undefined} * @api */ olx.control.FullScreenOptions.prototype.label; /** * Text label to use for the button when full-screen is active. * Default is `\u00d7` (a cross). * Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|Node|undefined} * @api */ olx.control.FullScreenOptions.prototype.labelActive; /** * Text label to use for the button tip. Default is `Toggle full-screen` * @type {string|undefined} * @api */ olx.control.FullScreenOptions.prototype.tipLabel; /** * Full keyboard access. * @type {boolean|undefined} * @api */ olx.control.FullScreenOptions.prototype.keys; /** * Target. * @type {Element|undefined} * @api */ olx.control.FullScreenOptions.prototype.target; /** * The element to be displayed fullscreen. When not provided, the element containing the map viewport will be displayed fullscreen. * @type {Element|string|undefined} * @api */ olx.control.FullScreenOptions.prototype.source; /** * @typedef {{className: (string|undefined), * coordinateFormat: (ol.CoordinateFormatType|undefined), * projection: ol.ProjectionLike, * render: (function(ol.MapEvent)|undefined), * target: (Element|undefined), * undefinedHTML: (string|undefined)}} */ olx.control.MousePositionOptions; /** * CSS class name. Default is `ol-mouse-position`. * @type {string|undefined} * @api stable */ olx.control.MousePositionOptions.prototype.className; /** * Coordinate format. * @type {ol.CoordinateFormatType|undefined} * @api stable */ olx.control.MousePositionOptions.prototype.coordinateFormat; /** * Projection. * @type {ol.ProjectionLike} * @api stable */ olx.control.MousePositionOptions.prototype.projection; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.MousePositionOptions.prototype.render; /** * Target. * @type {Element|undefined} * @api stable */ olx.control.MousePositionOptions.prototype.target; /** * Markup for undefined coordinates. Default is `` (empty string). * @type {string|undefined} * @api stable */ olx.control.MousePositionOptions.prototype.undefinedHTML; /** * @typedef {{collapsed: (boolean|undefined), * collapseLabel: (string|Node|undefined), * collapsible: (boolean|undefined), * label: (string|Node|undefined), * layers: (Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>|undefined), * render: (function(ol.MapEvent)|undefined), * target: (Element|undefined), * tipLabel: (string|undefined), * view: (ol.View|undefined)}} */ olx.control.OverviewMapOptions; /** * Whether the control should start collapsed or not (expanded). * Default to `true`. * @type {boolean|undefined} * @api */ olx.control.OverviewMapOptions.prototype.collapsed; /** * 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. * @type {string|Node|undefined} * @api */ olx.control.OverviewMapOptions.prototype.collapseLabel; /** * Whether the control can be collapsed or not. Default to `true`. * @type {boolean|undefined} * @api */ olx.control.OverviewMapOptions.prototype.collapsible; /** * 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. * @type {string|Node|undefined} * @api */ olx.control.OverviewMapOptions.prototype.label; /** * Layers for the overview map. If not set, then all main map layers are used * instead. * @type {Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>|undefined} * @api */ olx.control.OverviewMapOptions.prototype.layers; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.OverviewMapOptions.prototype.render; /** * Specify a target if you want the control to be rendered outside of the map's * viewport. * @type {Element|undefined} * @api */ olx.control.OverviewMapOptions.prototype.target; /** * Text label to use for the button tip. Default is `Overview map` * @type {string|undefined} * @api */ olx.control.OverviewMapOptions.prototype.tipLabel; /** * Custom view for the overview map. If not provided, a default view with * an EPSG:3857 projection will be used. * @type {ol.View|undefined} * @api */ olx.control.OverviewMapOptions.prototype.view; /** * @typedef {{className: (string|undefined), * minWidth: (number|undefined), * render: (function(ol.MapEvent)|undefined), * target: (Element|undefined), * units: (ol.control.ScaleLine.Units|string|undefined)}} */ olx.control.ScaleLineOptions; /** * CSS Class name. Default is `ol-scale-line`. * @type {string|undefined} * @api stable */ olx.control.ScaleLineOptions.prototype.className; /** * Minimum width in pixels. Default is `64`. * @type {number|undefined} * @api stable */ olx.control.ScaleLineOptions.prototype.minWidth; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.ScaleLineOptions.prototype.render; /** * Target. * @type {Element|undefined} * @api stable */ olx.control.ScaleLineOptions.prototype.target; /** * Units. Default is `metric`. * @type {ol.control.ScaleLine.Units|string|undefined} * @api stable */ olx.control.ScaleLineOptions.prototype.units; /** * @typedef {{duration: (number|undefined), * className: (string|undefined), * label: (string|Element|undefined), * tipLabel: (string|undefined), * target: (Element|undefined), * render: (function(ol.MapEvent)|undefined), * resetNorth: (function()|undefined), * autoHide: (boolean|undefined)}} */ olx.control.RotateOptions; /** * CSS class name. Default is `ol-rotate`. * @type {string|undefined} * @api stable */ olx.control.RotateOptions.prototype.className; /** * Text label to use for the rotate button. Default is `⇧`. * Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|Element|undefined} * @api stable */ olx.control.RotateOptions.prototype.label; /** * Text label to use for the rotate tip. Default is `Reset rotation` * @type {string|undefined} * @api stable */ olx.control.RotateOptions.prototype.tipLabel; /** * Animation duration in milliseconds. Default is `250`. * @type {number|undefined} * @api stable */ olx.control.RotateOptions.prototype.duration; /** * Hide the control when rotation is 0. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.control.RotateOptions.prototype.autoHide; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.RotateOptions.prototype.render; /** * Function called when the control is clicked. This will override the * default resetNorth. * @type {function()|undefined} * @api */ olx.control.RotateOptions.prototype.resetNorth; /** * Target. * @type {Element|undefined} * @api stable */ olx.control.RotateOptions.prototype.target; /** * @typedef {{duration: (number|undefined), * className: (string|undefined), * zoomInLabel: (string|Node|undefined), * zoomOutLabel: (string|Node|undefined), * zoomInTipLabel: (string|undefined), * zoomOutTipLabel: (string|undefined), * delta: (number|undefined), * target: (Element|undefined)}} */ olx.control.ZoomOptions; /** * Animation duration in milliseconds. Default is `250`. * @type {number|undefined} * @api stable */ olx.control.ZoomOptions.prototype.duration; /** * CSS class name. Default is `ol-zoom`. * @type {string|undefined} * @api stable */ olx.control.ZoomOptions.prototype.className; /** * Text label to use for the zoom-in button. Default is `+`. * Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|Node|undefined} * @api stable */ olx.control.ZoomOptions.prototype.zoomInLabel; /** * Text label to use for the zoom-out button. Default is `-`. * Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|Node|undefined} * @api stable */ olx.control.ZoomOptions.prototype.zoomOutLabel; /** * Text label to use for the button tip. Default is `Zoom in` * @type {string|undefined} * @api stable */ olx.control.ZoomOptions.prototype.zoomInTipLabel; /** * Text label to use for the button tip. Default is `Zoom out` * @type {string|undefined} * @api stable */ olx.control.ZoomOptions.prototype.zoomOutTipLabel; /** * The zoom delta applied on each click. * @type {number|undefined} * @api stable */ olx.control.ZoomOptions.prototype.delta; /** * Target. * @type {Element|undefined} * @api stable */ olx.control.ZoomOptions.prototype.target; /** * @typedef {{className: (string|undefined), * duration: (number|undefined), * maxResolution: (number|undefined), * minResolution: (number|undefined), * render: (function(ol.MapEvent)|undefined)}} */ olx.control.ZoomSliderOptions; /** * CSS class name. * @type {string|undefined} * @api stable */ olx.control.ZoomSliderOptions.prototype.className; /** * Animation duration in milliseconds. Default is `200`. * @type {number|undefined} * @api */ olx.control.ZoomSliderOptions.prototype.duration; /** * Maximum resolution. * @type {number|undefined} * @api stable */ olx.control.ZoomSliderOptions.prototype.maxResolution; /** * Minimum resolution. * @type {number|undefined} * @api stable */ olx.control.ZoomSliderOptions.prototype.minResolution; /** * Function called when the control should be re-rendered. This is called * in a requestAnimationFrame callback. * @type {function(ol.MapEvent)|undefined} * @api */ olx.control.ZoomSliderOptions.prototype.render; /** * @typedef {{className: (string|undefined), * target: (Element|undefined), * label: (string|Node|undefined), * tipLabel: (string|undefined), * extent: (ol.Extent|undefined)}} */ olx.control.ZoomToExtentOptions; /** * Class name. Default is `ol-zoom-extent`. * @type {string|undefined} * @api stable */ olx.control.ZoomToExtentOptions.prototype.className; /** * Target. * @type {Element|undefined} * @api stable */ olx.control.ZoomToExtentOptions.prototype.target; /** * Text label to use for the button. Default is `E`. * Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|Node|undefined} * @api stable */ olx.control.ZoomToExtentOptions.prototype.label; /** * Text label to use for the button tip. Default is `Zoom to extent` * @type {string|undefined} * @api stable */ olx.control.ZoomToExtentOptions.prototype.tipLabel; /** * The extent to zoom to. If undefined the validity extent of the view * projection is used. * @type {ol.Extent|undefined} * @api stable */ olx.control.ZoomToExtentOptions.prototype.extent; /** * Namespace. * @type {Object} */ olx.format; /** * @typedef {{dataProjection: ol.ProjectionLike, * featureProjection: ol.ProjectionLike, * rightHanded: (boolean|undefined)}} */ olx.format.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. * @type {ol.ProjectionLike} * @api stable */ olx.format.ReadOptions.prototype.dataProjection; /** * Projection of the feature geometries created by the format reader. If not * provided, features will be returned in the `dataProjection`. * @type {ol.ProjectionLike} * @api stable */ olx.format.ReadOptions.prototype.featureProjection; /** * @typedef {{dataProjection: ol.ProjectionLike, * featureProjection: ol.ProjectionLike, * rightHanded: (boolean|undefined), * decimals: (number|undefined)}} */ olx.format.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`. * @type {ol.ProjectionLike} * @api stable */ olx.format.WriteOptions.prototype.dataProjection; /** * Projection of the feature geometries that will be serialized by the format * writer. If not provided, geometries are assumed to be in the * `dataProjection` if that is set; in other words, they are not transformed. * @type {ol.ProjectionLike} * @api stable */ olx.format.WriteOptions.prototype.featureProjection; /** * 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. * * @type {boolean|undefined} * @api stable */ olx.format.WriteOptions.prototype.rightHanded; /** * Maximum number of decimal places for coordinates. Coordinates are stored * internally as floats, but floating-point arithmetic can create coordinates * with a large number of decimal places, not generally wanted on output. * Set a number here to round coordinates. Can also be used to ensure that * coordinates read in can be written back out with the same number of decimals. * Default is no rounding. * * @type {number|undefined} * @api */ olx.format.WriteOptions.prototype.decimals; /** * @typedef {{defaultDataProjection: ol.ProjectionLike, * geometryName: (string|undefined), * featureProjection: ol.ProjectionLike}} */ olx.format.GeoJSONOptions; /** * Default data projection. Default is `EPSG:4326`. * @type {ol.ProjectionLike} * @api stable */ olx.format.GeoJSONOptions.prototype.defaultDataProjection; /** * Projection for features read or written by the format. Options passed to * read or write methods will take precedence. * @type {ol.ProjectionLike} * @api stable */ olx.format.GeoJSONOptions.prototype.featureProjection; /** * Geometry name to use when creating features. * @type {string|undefined} * @api stable */ olx.format.GeoJSONOptions.prototype.geometryName; /** * @typedef {{geometryName: (string|undefined)}} */ olx.format.EsriJSONOptions; /** * Geometry name to use when creating features. * @type {string|undefined} * @api */ olx.format.EsriJSONOptions.prototype.geometryName; /** * @typedef {{featureClass: (function((ol.geom.Geometry|Object.<string, *>)=)| * function(ol.geom.GeometryType,Array.<number>, * (Array.<number>|Array.<Array.<number>>),Object.<string, *>)| * undefined), * geometryName: (string|undefined), * layers: (Array.<string>|undefined), * layerName: (string|undefined)}} */ olx.format.MVTOptions; /** * Class for features returned by {@link ol.format.MVT#readFeatures}. Set to * {@link ol.Feature} to get full editing and geometry support at the cost of * decreased rendering performance. The default is {@link ol.render.Feature}, * which is optimized for rendering and hit detection. * @type {undefined|function((ol.geom.Geometry|Object.<string, *>)=)| * function(ol.geom.GeometryType,Array.<number>, * (Array.<number>|Array.<Array.<number>>),Object.<string, *>)} * @api */ olx.format.MVTOptions.prototype.featureClass; /** * Geometry name to use when creating features. Default is 'geometry'. * @type {string|undefined} * @api */ olx.format.MVTOptions.prototype.geometryName; /** * Name of the feature attribute that holds the layer name. Default is 'layer'. * @type {string|undefined} * @api */ olx.format.MVTOptions.prototype.layerName; /** * Layers to read features from. If not provided, features will be read from all * layers. * @type {Array.<string>|undefined} * @api */ olx.format.MVTOptions.prototype.layers; /** * @typedef {{factor: (number|undefined), * geometryLayout: (ol.geom.GeometryLayout|undefined)}} */ olx.format.PolylineOptions; /** * The factor by which the coordinates values will be scaled. * Default is `1e5`. * @type {number|undefined} * @api stable */ olx.format.PolylineOptions.prototype.factor; /** * Layout of the feature geometries created by the format reader. * Default is `ol.geom.GeometryLayout.XY`. * @type {ol.geom.GeometryLayout|undefined} * @api */ olx.format.PolylineOptions.prototype.geometryLayout; /** * @typedef {{defaultDataProjection: ol.ProjectionLike}} */ olx.format.TopoJSONOptions; /** * Default data projection. Default is `EPSG:4326`. * @type {ol.ProjectionLike} * @api stable */ olx.format.TopoJSONOptions.prototype.defaultDataProjection; /** * @typedef {{altitudeMode: (ol.format.IGC.Z|undefined)}} */ olx.format.IGCOptions; /** * Altitude mode. Possible values are `barometric`, `gps`, and `none`. Default * is `none`. * @type {ol.format.IGC.Z|undefined} * @api */ olx.format.IGCOptions.prototype.altitudeMode; /** * @typedef {{extractStyles: (boolean|undefined), * defaultStyle: (Array.<ol.style.Style>|undefined), * showPointNames: (boolean|undefined), * writeStyles: (boolean|undefined)}} */ olx.format.KMLOptions; /** * Extract styles from the KML. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.format.KMLOptions.prototype.extractStyles; /** * Show names as labels for placemarks which contain points. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.format.KMLOptions.prototype.showPointNames; /** * Default style. The default default style is the same as Google Earth. * @type {Array.<ol.style.Style>|undefined} * @api stable */ olx.format.KMLOptions.prototype.defaultStyle; /** * Write styles into KML. Default is `true`. * @type {boolean|undefined} * @api stable */ olx.format.KMLOptions.prototype.writeStyles; /** * @typedef {{featureNS: (Object.<string, string>|string|undefined), * featureType: (Array.<string>|string|undefined), * srsName: string, * surface: (boolean|undefined), * curve: (boolean|undefined), * multiCurve: (boolean|undefined), * multiSurface: (boolean|undefined), * schemaLocation: (string|undefined)}} */ olx.format.GMLOptions; /** * Feature namespace. If not defined will be derived from GML. If multiple * feature types have been configured which come from different feature * namespaces, this will be an object with the keys being the prefixes used * in the entries of featureType array. The values of the object will be the * feature namespaces themselves. So for instance there might be a featureType * item `topp:states` in the `featureType` array and then there will be a key * `topp` in the featureNS object with value `http://www.openpla