Merge pull request #8098 from tschaub/goodbye-olx

Remove externs/olx.js and src/ol/typedefs.js
This commit is contained in:
Tim Schaub
2018-04-20 02:38:46 -06:00
committed by GitHub
35 changed files with 523 additions and 1770 deletions

View File

@@ -38,7 +38,7 @@ const TranslateEventType = {
/**
* @typedef {Object} interaction_TranslateOptions
* @typedef {Object} Options
* @property {module:ol/Collection~Collection.<module:ol/Feature~Feature>} [features] Only features contained in this collection will be able to be translated. If
* not specified, all features on the map will be able to be translated.
* @property {Array.<module:ol/layer/Layer~Layer>|function(module:ol/layer/Layer~Layer): boolean} [layers] A list of layers from which features should be
@@ -94,7 +94,7 @@ inherits(TranslateEvent, Event);
* @constructor
* @extends {module:ol/interaction/Pointer~Pointer}
* @fires module:ol/interaction/Translate~TranslateEvent
* @param {olx.interaction.TranslateOptions=} opt_options Options.
* @param {module:ol/interaction/Translate~Options=} opt_options Options.
* @api
*/
const Translate = function(opt_options) {

View File

@@ -10,6 +10,47 @@ import TileImage from '../source/TileImage.js';
import {hash as tileCoordHash} from '../tilecoord.js';
import {appendParams} from '../uri.js';
/**
* @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] 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
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image}
* for more detail.
* @property {Object.<string,*>} [params] ArcGIS Rest parameters. This field is optional. Service defaults will be
* used for any fields not specified. `FORMAT` is `PNG32` by default. `F` is `IMAGE` by
* default. `TRANSPARENT` is `true` by default. `BBOX, `SIZE`, `BBOXSR`,
* and `IMAGESR` will be set dynamically. Set `LAYERS` to
* override the default service layer visibility. See
* {@link http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/}
* for further reference.
* @property {ol.tilegrid.TileGrid} [tileGrid] 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.
* @property {ol.ProjectionLike} projection Projection.
* @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
* Higher values can increase reprojection performance, but decrease precision.
* @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL.
* The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @property {string} [url] ArcGIS Rest service URL for a Map Service or Image Service. The
* url should include /MapServer or /ImageServer.
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
* @property {number} [transition] Duration of the opacity transition for rendering. To disable the opacity
* transition, pass `transition: 0`.
* @property {Array.<string>} urls ArcGIS Rest service urls. Use this instead of `url` when the ArcGIS
* Service supports multiple urls for export requests.
*/
/**
* @classdesc
* Layer source for tile data from ArcGIS Rest services. Map and Image
@@ -20,8 +61,7 @@ import {appendParams} from '../uri.js';
*
* @constructor
* @extends {module:ol/source/TileImage~TileImage}
* @param {olx.source.TileArcGISRestOptions=} opt_options Tile ArcGIS Rest
* options.
* @param {module:ol/source/TileArcGISRest~Options=} opt_options Tile ArcGIS Rest options.
* @api
*/
const TileArcGISRest = function(opt_options) {

View File

@@ -21,6 +21,15 @@ import SourceState from '../source/State.js';
import VectorEventType from '../source/VectorEventType.js';
import RBush from '../structs/RBush.js';
/**
* A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and
* returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this
* is one of the standard {@link ol.loadingstrategy} strategies.
*
* @typedef {function(module:ol/extent~Extent, number): Array.<module:ol/extent~Extent>} LoadingStrategy
* @api
*/
/**
* @classdesc
@@ -95,7 +104,7 @@ inherits(VectorSourceEvent, Event);
* Setting this to `false` (e.g. for sources with polygons that represent administrative
* boundaries or TopoJSON sources) allows the renderer to optimise fill and
* stroke operations.
* @property {ol.LoadingStrategy} [strategy] The loading strategy to use.
* @property {module:ol/source/Vector~LoadingStrategy} [strategy] 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.
* @property {string|module:ol/Feature~FeatureUrlFunction} [url]
@@ -191,7 +200,7 @@ const VectorSource = function(opt_options) {
/**
* @private
* @type {ol.LoadingStrategy}
* @type {module:ol/source/Vector~LoadingStrategy}
*/
this.strategy_ = options.strategy !== undefined ? options.strategy : allStrategy;

View File

@@ -352,7 +352,7 @@ WMTS.prototype.updateDimensions = function(dimensions) {
* - format - {string} Image format for the layer. Default is the first
* format returned in the GetCapabilities response.
* - crossOrigin - {string|null|undefined} Cross origin. Default is `undefined`.
* @return {?olx.source.WMTSOptions} WMTS source options object or `null` if the layer was not found.
* @return {?module:ol/source/WMTS~Options} WMTS source options object or `null` if the layer was not found.
* @api
*/
export function optionsFromCapabilities(wmtsCap, config) {

View File

@@ -1,31 +0,0 @@
/**
* @module ol/typedefs
*/
//FIXME Remove when reworking typedefs, export typedefs as variables instead
const ol = {};
/**
* File for all typedefs used by the compiler, and referenced by JSDoc.
*
* These look like vars (or var properties), but in fact are simply identifiers
* for the Closure compiler. Originally they were included in the appropriate
* namespace file, but with the move away from Closure namespaces and towards
* self-contained standard modules are now all in this file.
* Unlike the other type definitions - enums and constructor functions - they
* are not code and so are not imported or exported. They are only referred to
* in type-defining comments used by the Closure compiler, and so should not
* appear in module code.
*
* They are now all in the `ol` namespace.
*/
/**
* A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and
* returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this
* is one of the standard {@link ol.loadingstrategy} strategies.
*
* @typedef {function(module:ol/extent~Extent, number): Array.<module:ol/extent~Extent>}
*/
ol.LoadingStrategy;

View File

@@ -1,39 +0,0 @@
/**
* @namespace olx
*/
/**
* @namespace olx.control
*/
/**
* @namespace olx.format
*/
/**
* @namespace olx.interaction
*/
/**
* @namespace olx.layer
*/
/**
* @namespace olx.parser
*/
/**
* @namespace olx.render
*/
/**
* @namespace olx.source
*/
/**
* @namespace olx.style
*/
/**
* @namespace olx.tilegrid
*/