From 27f86babec71d42aa3db688cf135d0094ed5aa1b Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Wed, 28 Mar 2018 14:48:00 +0200 Subject: [PATCH] Move olx.source.CartoDBOptions to ol/source/CartoDBOptions --- externs/olx.js | 106 --------------------------------------- src/ol/source/CartoDB.js | 27 +++++++++- 2 files changed, 26 insertions(+), 107 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 27676f1392..a569214a05 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -2166,112 +2166,6 @@ olx.source.XYZOptions.prototype.wrapX; olx.source.XYZOptions.prototype.transition; -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * cacheSize: (number|undefined), - * crossOrigin: (null|string|undefined), - * projection: ol.ProjectionLike, - * maxZoom: (number|undefined), - * minZoom: (number|undefined), - * wrapX: (boolean|undefined), - * config: (Object|undefined), - * map: (string|undefined), - * account: string}} - */ -olx.source.CartoDBOptions; - - -/** - * Attributions. - * @type {ol.AttributionLike|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.attributions; - - -/** - * Cache size. Default is `2048`. - * @type {number|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.cacheSize; - - -/** - * 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. - * @type {null|string|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.crossOrigin; - - -/** - * Projection. Default is `EPSG:3857`. - * @type {ol.ProjectionLike} - * @api - */ -olx.source.CartoDBOptions.prototype.projection; - - -/** - * Optional max zoom level. Default is `18`. - * @type {number|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.maxZoom; - - -/** - * Minimum zoom. - * @type {number|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.minZoom; - - -/** - * Whether to wrap the world horizontally. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.wrapX; - - -/** - * If using anonymous maps, the CartoDB config to use. See - * {@link http://docs.cartodb.com/cartodb-platform/maps-api/anonymous-maps/} - * for more detail. - * If using named maps, a key-value lookup with the template parameters. - * See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/} - * for more detail. - * @type {Object|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.config; - - -/** - * If using named maps, this will be the name of the template to load. - * See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/} - * for more detail. - * @type {string|undefined} - * @api - */ -olx.source.CartoDBOptions.prototype.map; - - -/** - * CartoDB account name - * @type {string} - * @api - */ -olx.source.CartoDBOptions.prototype.account; - - /** * @typedef {{attributions: (ol.AttributionLike|undefined), * cacheSize: (number|undefined), diff --git a/src/ol/source/CartoDB.js b/src/ol/source/CartoDB.js index a262b79539..d9e7a257de 100644 --- a/src/ol/source/CartoDB.js +++ b/src/ol/source/CartoDB.js @@ -6,13 +6,38 @@ import {assign} from '../obj.js'; import SourceState from '../source/State.js'; import XYZ from '../source/XYZ.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 {ol.ProjectionLike} [projection='EPSG:3857'] Projection. + * @property {number} [maxZoom=18] Max zoom. + * @property {number} [minZoom] Minimum zoom. + * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. + * @property {Object} [config] If using anonymous maps, the CartoDB config to use. See + * {@link http://docs.cartodb.com/cartodb-platform/maps-api/anonymous-maps/} + * for more detail. + * If using named maps, a key-value lookup with the template parameters. + * See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/} + * for more detail. + * @property {string} [map] If using named maps, this will be the name of the template to load. + * See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/} + * for more detail. + * @property {string} account If using named maps, this will be the name of the template to load. + */ + + /** * @classdesc * Layer source for the CartoDB Maps API. * * @constructor * @extends {ol.source.XYZ} - * @param {olx.source.CartoDBOptions} options CartoDB options. + * @param {module:ol/source/CartoDB~Options=} options CartoDB options. * @api */ const CartoDB = function(options) {