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

View File

@@ -615,7 +615,7 @@ class PluggableMap extends BaseObject {
if (!this.frameState_) {
return;
}
const options = opt_options || {};
const options = opt_options || /** @type {module:ol/PluggableMap~AtPixelOptions} */ ({});
const hitTolerance = options.hitTolerance !== undefined ?
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
const layerFilter = options.layerFilter || TRUE;

View File

@@ -80,8 +80,7 @@ export {default as Translate} from './interaction/Translate.js';
* * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
* * {@link module:ol/interaction/DragZoom~DragZoom}
*
* @param {module:ol/interaction/Interaction~DefaultsOptions=} opt_options
* Defaults options.
* @param {module:ol/interaction~DefaultsOptions=} opt_options Defaults options.
* @return {module:ol/Collection<module:ol/interaction/Interaction>}
* A collection of interactions to be used with the {@link module:ol/Map~Map}
* constructor's `interactions` option.

View File

@@ -57,7 +57,7 @@ class ImageArcGISRest extends ImageSource {
*/
constructor(opt_options) {
const options = opt_options || {};
const options = opt_options || /** @type {module:ol/source/ImageArcGISRest~Options} */ ({});
super({
attributions: options.attributions,

View File

@@ -64,7 +64,7 @@ class ImageWMS extends ImageSource {
*/
constructor(opt_options) {
const options = opt_options || {};
const options = opt_options || /** @type {module:ol/source/ImageWMS~Options} */ ({});
super({
attributions: options.attributions,

View File

@@ -18,6 +18,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
* @typedef {Object} Options
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size.
* @property {module:ol/extent~Extent} [extent]
* @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
@@ -63,7 +64,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
*/
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) {

View File

@@ -82,7 +82,7 @@ class TileWMS extends TileImage {
*/
constructor(opt_options) {
const options = opt_options || {};
const options = opt_options || /** @type {module:ol/source/TileWMS~Options} */ ({});
const params = options.params || {};

View File

@@ -112,11 +112,11 @@ export class VectorSourceEvent extends Event {
* @property {module:ol/source/Vector~LoadingStrategy} [strategy] The loading strategy to use.
* By default an {@link module:ol/loadingstrategy~all}
* 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
* (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
* 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.
* Requires `format` to be set as well.
* When default XHR feature loader is provided, the features will

View File

@@ -14,6 +14,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* @typedef {Object} Options
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @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 {boolean} [overlaps=true] This source may have overlapping geometries. Setting this
* 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 {
/**
* @param {module:ol/source/VectorTile~Options=} options Vector tile options.
* @param {!module:ol/source/VectorTile~Options} options Vector tile options.
*/
constructor(options) {
const projection = options.projection || 'EPSG:3857';

View File

@@ -27,7 +27,7 @@ class CircleStyle extends RegularShape {
*/
constructor(opt_options) {
const options = opt_options || {};
const options = opt_options || /** @type {module:ol/style/Circle~Options} */ ({});
super({
points: Infinity,