Redistribute a few types and docs
This commit is contained in:
-407
@@ -5,57 +5,6 @@
|
||||
var olx;
|
||||
|
||||
|
||||
/* typedefs for object literals provided by applications */
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{unique: (boolean|undefined)}}
|
||||
*/
|
||||
olx.CollectionOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Disallow the same item from being added to the collection twice. Default is
|
||||
* false.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.CollectionOptions.prototype.unique;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{tracking: (boolean|undefined),
|
||||
* trackingOptions: (GeolocationPositionOptions|undefined),
|
||||
* projection: ol.ProjectionLike}}
|
||||
*/
|
||||
olx.GeolocationOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Start Tracking. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GeolocationOptions.prototype.tracking;
|
||||
|
||||
|
||||
/**
|
||||
* Tracking options. See
|
||||
* {@link http://www.w3.org/TR/geolocation-API/#position_options_interface}.
|
||||
* @type {GeolocationPositionOptions|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GeolocationOptions.prototype.trackingOptions;
|
||||
|
||||
|
||||
/**
|
||||
* The projection the position is reported in.
|
||||
* @type {ol.ProjectionLike}
|
||||
* @api
|
||||
*/
|
||||
olx.GeolocationOptions.prototype.projection;
|
||||
|
||||
|
||||
/**
|
||||
* Object literal with config options for the map logo.
|
||||
* @typedef {{href: (string), src: (string)}}
|
||||
@@ -79,362 +28,6 @@ olx.LogoOptions.prototype.href;
|
||||
olx.LogoOptions.prototype.src;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{map: (ol.PluggableMap|undefined),
|
||||
* maxLines: (number|undefined),
|
||||
* strokeStyle: (ol.style.Stroke|undefined),
|
||||
* targetSize: (number|undefined),
|
||||
* showLabels: (boolean|undefined),
|
||||
* lonLabelFormatter: (undefined|function(number):string),
|
||||
* latLabelFormatter: (undefined|function(number):string),
|
||||
* lonLabelPosition: (number|undefined),
|
||||
* latLabelPosition: (number|undefined),
|
||||
* lonLabelStyle: (ol.style.Text|undefined),
|
||||
* latLabelStyle: (ol.style.Text|undefined)}}
|
||||
*/
|
||||
olx.GraticuleOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Reference to an `ol.Map` object.
|
||||
* @type {ol.PluggableMap|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;
|
||||
|
||||
|
||||
/**
|
||||
* Render a label with the respective latitude/longitude for each graticule
|
||||
* line. Default is false.
|
||||
*
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.showLabels;
|
||||
|
||||
|
||||
/**
|
||||
* Label formatter for longitudes. This function is called with the longitude as
|
||||
* argument, and should return a formatted string representing the longitude.
|
||||
* By default, labels are formatted as degrees, minutes, seconds and hemisphere.
|
||||
*
|
||||
* @type {undefined|function(number):string}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.lonLabelFormatter;
|
||||
|
||||
|
||||
/**
|
||||
* Label formatter for latitudes. This function is called with the latitude as
|
||||
* argument, and should return a formatted string representing the latitude.
|
||||
* By default, labels are formatted as degrees, minutes, seconds and hemisphere.
|
||||
*
|
||||
* @type {undefined|function(number):string}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.latLabelFormatter;
|
||||
|
||||
|
||||
/**
|
||||
* Longitude label position in fractions (0..1) of view extent. 0 means at the
|
||||
* bottom of the viewport, 1 means at the top. Default is 0.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.lonLabelPosition;
|
||||
|
||||
|
||||
/**
|
||||
* Latitude label position in fractions (0..1) of view extent. 0 means at the
|
||||
* left of the viewport, 1 means at the right. Default is 1.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.latLabelPosition;
|
||||
|
||||
|
||||
/**
|
||||
* Longitude label text style. The default is
|
||||
* ```js
|
||||
* new ol.style.Text({
|
||||
* font: '12px Calibri,sans-serif',
|
||||
* textBaseline: 'bottom',
|
||||
* fill: new ol.style.Fill({
|
||||
* color: 'rgba(0,0,0,1)'
|
||||
* }),
|
||||
* stroke: new ol.style.Stroke({
|
||||
* color: 'rgba(255,255,255,1)',
|
||||
* width: 3
|
||||
* })
|
||||
* });
|
||||
* ```
|
||||
* Note that the default's `textBaseline` configuration will not work well for
|
||||
* `lonLabelPosition` configurations that position labels close to the top of
|
||||
* the viewport.
|
||||
*
|
||||
* @type {ol.style.Text|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.lonLabelStyle;
|
||||
|
||||
|
||||
/**
|
||||
* Latitude label text style. The default is
|
||||
* ```js
|
||||
* new ol.style.Text({
|
||||
* font: '12px Calibri,sans-serif',
|
||||
* textAlign: 'end',
|
||||
* fill: new ol.style.Fill({
|
||||
* color: 'rgba(0,0,0,1)'
|
||||
* }),
|
||||
* stroke: new ol.style.Stroke({
|
||||
* color: 'rgba(255,255,255,1)',
|
||||
* width: 3
|
||||
* })
|
||||
* });
|
||||
* ```
|
||||
* Note that the default's `textAlign` configuration will not work well for
|
||||
* `latLabelPosition` configurations that position labels close to the left of
|
||||
* the viewport.
|
||||
*
|
||||
* @type {ol.style.Text|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.GraticuleOptions.prototype.latLabelStyle;
|
||||
|
||||
|
||||
/**
|
||||
* 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. If the function returns a falsy value,
|
||||
* propagation of the event to other interactions in the map's interactions
|
||||
* chain will be prevented (this includes functions with no explicit return). See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy}
|
||||
* @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),
|
||||
* moveTolerance: (number|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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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 logo is shown.
|
||||
* @type {boolean|string|olx.LogoOptions|Element|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.MapOptions.prototype.logo;
|
||||
|
||||
|
||||
/**
|
||||
* The minimum distance in pixels the cursor must move to be detected
|
||||
* as a map move event instead of a click. Increasing this value can make it
|
||||
* easier to click on the map.
|
||||
* Default is `1`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.MapOptions.prototype.moveTolerance;
|
||||
|
||||
|
||||
/**
|
||||
* Overlays initially added to the map. By default, no overlays are added.
|
||||
* @type {ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined}
|
||||
* @api
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
olx.MapOptions.prototype.view;
|
||||
|
||||
|
||||
/**
|
||||
* Object literal with options for the {@link ol.Sphere.getLength} or
|
||||
* {@link ol.Sphere.getArea} functions.
|
||||
* @typedef {{projection: (ol.ProjectionLike|undefined),
|
||||
* radius: (number|undefined)}}
|
||||
*/
|
||||
olx.SphereMetricOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Projection of the geometry. By default, the geometry is assumed to be in
|
||||
* EPSG:3857 (Web Mercator).
|
||||
* @type {(ol.ProjectionLike|undefined)}
|
||||
* @api
|
||||
*/
|
||||
olx.SphereMetricOptions.prototype.projection;
|
||||
|
||||
|
||||
/**
|
||||
* Sphere radius. By default, the radius of the earth is used (Clarke 1866
|
||||
* Authalic Sphere).
|
||||
* @type {(number|undefined)}
|
||||
* @api
|
||||
*/
|
||||
olx.SphereMetricOptions.prototype.radius;
|
||||
|
||||
|
||||
/**
|
||||
* Options for tile constructors.
|
||||
* @typedef {{transition: (number|undefined)}}
|
||||
|
||||
Reference in New Issue
Block a user