Merge pull request #8572 from fredj/ts_fixes

typescript misc fixes
This commit is contained in:
Frédéric Junod
2018-09-03 10:49:05 +02:00
committed by GitHub
9 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -615,7 +615,7 @@ class PluggableMap extends BaseObject {
if (!this.frameState_) { if (!this.frameState_) {
return; return;
} }
const options = opt_options || {}; const options = opt_options || /** @type {module:ol/PluggableMap~AtPixelOptions} */ ({});
const hitTolerance = options.hitTolerance !== undefined ? const hitTolerance = options.hitTolerance !== undefined ?
opt_options.hitTolerance * this.frameState_.pixelRatio : 0; opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
const layerFilter = options.layerFilter || TRUE; const layerFilter = options.layerFilter || TRUE;
+1 -2
View File
@@ -80,8 +80,7 @@ export {default as Translate} from './interaction/Translate.js';
* * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom} * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
* * {@link module:ol/interaction/DragZoom~DragZoom} * * {@link module:ol/interaction/DragZoom~DragZoom}
* *
* @param {module:ol/interaction/Interaction~DefaultsOptions=} opt_options * @param {module:ol/interaction~DefaultsOptions=} opt_options Defaults options.
* Defaults options.
* @return {module:ol/Collection<module:ol/interaction/Interaction>} * @return {module:ol/Collection<module:ol/interaction/Interaction>}
* A collection of interactions to be used with the {@link module:ol/Map~Map} * A collection of interactions to be used with the {@link module:ol/Map~Map}
* constructor's `interactions` option. * constructor's `interactions` option.
+1 -1
View File
@@ -57,7 +57,7 @@ class ImageArcGISRest extends ImageSource {
*/ */
constructor(opt_options) { constructor(opt_options) {
const options = opt_options || {}; const options = opt_options || /** @type {module:ol/source/ImageArcGISRest~Options} */ ({});
super({ super({
attributions: options.attributions, attributions: options.attributions,
+1 -1
View File
@@ -64,7 +64,7 @@ class ImageWMS extends ImageSource {
*/ */
constructor(opt_options) { constructor(opt_options) {
const options = opt_options || {}; const options = opt_options || /** @type {module:ol/source/ImageWMS~Options} */ ({});
super({ super({
attributions: options.attributions, attributions: options.attributions,
+2 -1
View File
@@ -18,6 +18,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {module:ol/extent~Extent} [extent]
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * 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 * access pixel data with the Canvas renderer. See
@@ -63,7 +64,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
*/ */
class TileImage extends UrlTile { class TileImage extends UrlTile {
/** /**
* @param {module:ol/source/TileImage~Options=} options Image tile options. * @param {!module:ol/source/TileImage~Options} options Image tile options.
*/ */
constructor(options) { constructor(options) {
+1 -1
View File
@@ -82,7 +82,7 @@ class TileWMS extends TileImage {
*/ */
constructor(opt_options) { constructor(opt_options) {
const options = opt_options || {}; const options = opt_options || /** @type {module:ol/source/TileWMS~Options} */ ({});
const params = options.params || {}; const params = options.params || {};
+2 -2
View File
@@ -112,11 +112,11 @@ export class VectorSourceEvent extends Event {
* @property {module:ol/source/Vector~LoadingStrategy} [strategy] The loading strategy to use. * @property {module:ol/source/Vector~LoadingStrategy} [strategy] The loading strategy to use.
* By default an {@link module:ol/loadingstrategy~all} * By default an {@link module:ol/loadingstrategy~all}
* strategy is used, a one-off strategy which loads all features at once. * strategy is used, a one-off strategy which loads all features at once.
* @property {string|module:ol/featureloader~FeatureUrlfunction} [url] * @property {string|module:ol/featureloader~FeatureUrlFunction} [url]
* Setting this option instructs the source to load features using an XHR loader * Setting this option instructs the source to load features using an XHR loader
* (see {@link module:ol/featureloader~xhr}). Use a `string` and an * (see {@link module:ol/featureloader~xhr}). Use a `string` and an
* {@link module:ol/loadingstrategy~all} for a one-off download of all features from * {@link module:ol/loadingstrategy~all} for a one-off download of all features from
* the given URL. Use a {@link module:ol/featureloader~FeatureUrlfunction} to generate the url with * the given URL. Use a {@link module:ol/featureloader~FeatureUrlFunction} to generate the url with
* other loading strategies. * other loading strategies.
* Requires `format` to be set as well. * Requires `format` to be set as well.
* When default XHR feature loader is provided, the features will * When default XHR feature loader is provided, the features will
+2 -1
View File
@@ -14,6 +14,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* @typedef {Object} Options * @typedef {Object} Options
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=128] Cache size. * @property {number} [cacheSize=128] Cache size.
* @property {module:ol/extent~Extent} [extent]
* @property {module:ol/format/Feature} [format] Feature format for tiles. Used and required by the default. * @property {module:ol/format/Feature} [format] Feature format for tiles. Used and required by the default.
* @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this * @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this
* to `false` (e.g. for sources with polygons that represent administrative * to `false` (e.g. for sources with polygons that represent administrative
@@ -73,7 +74,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
*/ */
class VectorTile extends UrlTile { class VectorTile extends UrlTile {
/** /**
* @param {module:ol/source/VectorTile~Options=} options Vector tile options. * @param {!module:ol/source/VectorTile~Options} options Vector tile options.
*/ */
constructor(options) { constructor(options) {
const projection = options.projection || 'EPSG:3857'; const projection = options.projection || 'EPSG:3857';
+1 -1
View File
@@ -27,7 +27,7 @@ class CircleStyle extends RegularShape {
*/ */
constructor(opt_options) { constructor(opt_options) {
const options = opt_options || {}; const options = opt_options || /** @type {module:ol/style/Circle~Options} */ ({});
super({ super({
points: Infinity, points: Infinity,