Merge pull request #8736 from fredj/misc

Typescript misc fixes
This commit is contained in:
Frédéric Junod
2018-10-01 08:29:02 +02:00
committed by GitHub
11 changed files with 11 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ class ZoomSlider extends Control {
}); });
/** /**
* @type {!Array.<ol.EventsKey>} * @type {!Array.<import("../events.js").EventsKey>}
* @private * @private
*/ */
this.dragListenerKeys_ = []; this.dragListenerKeys_ = [];

View File

@@ -104,7 +104,6 @@ class LayerGroup extends BaseLayer {
} }
/** /**
* @param {import("../events/Event.js").default} event Event.
* @private * @private
*/ */
handleLayersChanged_() { handleLayersChanged_() {

View File

@@ -1035,7 +1035,7 @@ class WebGLPolygonReplay extends WebGLReplay {
} else { } else {
const nullStrokeStyle = new Stroke({ const nullStrokeStyle = new Stroke({
color: [0, 0, 0, 0], color: [0, 0, 0, 0],
lineWidth: 0 width: 0
}); });
this.lineStringReplay.setFillStrokeStyle(null, nullStrokeStyle); this.lineStringReplay.setFillStrokeStyle(null, nullStrokeStyle);
} }

View File

@@ -59,10 +59,9 @@ class LayerRenderer extends Observable {
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate. * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
* @param {import("../PluggableMap.js").FrameState} frameState Frame state. * @param {import("../PluggableMap.js").FrameState} frameState Frame state.
* @param {number} hitTolerance Hit tolerance in pixels. * @param {number} hitTolerance Hit tolerance in pixels.
* @param {function(this: S, (import("../Feature.js").default|import("../render/Feature.js").default), import("../layer/Layer.js").default): T} callback Feature callback. * @param {function((import("../Feature.js").default|import("../render/Feature.js").default), import("../layer/Layer.js").default): T} callback Feature callback.
* @param {S} thisArg Value to use as `this` when executing `callback`.
* @return {T|void} Callback result. * @return {T|void} Callback result.
* @template S,T * @template T
*/ */
forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback) {} forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback) {}

View File

@@ -154,7 +154,7 @@ class MapRenderer extends Disposable {
if (layer.getSource()) { if (layer.getSource()) {
result = layerRenderer.forEachFeatureAtCoordinate( result = layerRenderer.forEachFeatureAtCoordinate(
layer.getSource().getWrapX() ? translatedCoordinate : coordinate, layer.getSource().getWrapX() ? translatedCoordinate : coordinate,
frameState, hitTolerance, forEachFeatureAtCoordinate, thisArg); frameState, hitTolerance, forEachFeatureAtCoordinate);
} }
if (result) { if (result) {
return result; return result;

View File

@@ -102,7 +102,7 @@ class CanvasLayerRenderer extends LayerRenderer {
* @template S,T,U * @template S,T,U
*/ */
forEachLayerAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg) { forEachLayerAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg) {
const hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, TRUE, this); const hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, TRUE);
if (hasFeature) { if (hasFeature) {
return callback.call(thisArg, this.getLayer(), null); return callback.call(thisArg, this.getLayer(), null);

View File

@@ -506,7 +506,7 @@ class WebGLMapRenderer extends MapRenderer {
layerFilter.call(thisArg2, layer)) { layerFilter.call(thisArg2, layer)) {
const layerRenderer = this.getLayerRenderer(layer); const layerRenderer = this.getLayerRenderer(layer);
result = layerRenderer.forEachFeatureAtCoordinate( result = layerRenderer.forEachFeatureAtCoordinate(
coordinate, frameState, hitTolerance, callback, thisArg); coordinate, frameState, hitTolerance, callback);
if (result) { if (result) {
return result; return result;
} }

View File

@@ -18,7 +18,6 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {import("./Source.js").AttributionLike} [attributions] Attributions. * @property {import("./Source.js").AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {import("../extent.js").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
@@ -71,7 +70,6 @@ class TileImage extends UrlTile {
super({ super({
attributions: options.attributions, attributions: options.attributions,
cacheSize: options.cacheSize, cacheSize: options.cacheSize,
extent: options.extent,
opaque: options.opaque, opaque: options.opaque,
projection: options.projection, projection: options.projection,
state: options.state, state: options.state,

View File

@@ -12,7 +12,6 @@ import {getKeyZXY} from '../tilecoord.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {import("./Source.js").AttributionLike} [attributions] * @property {import("./Source.js").AttributionLike} [attributions]
* @property {number} [cacheSize] * @property {number} [cacheSize]
* @property {import("../extent.js").Extent} [extent]
* @property {boolean} [opaque] * @property {boolean} [opaque]
* @property {import("../proj.js").ProjectionLike} [projection] * @property {import("../proj.js").ProjectionLike} [projection]
* @property {import("./State.js").default} [state] * @property {import("./State.js").default} [state]
@@ -42,7 +41,6 @@ class UrlTile extends TileSource {
super({ super({
attributions: options.attributions, attributions: options.attributions,
cacheSize: options.cacheSize, cacheSize: options.cacheSize,
extent: options.extent,
opaque: options.opaque, opaque: options.opaque,
projection: options.projection, projection: options.projection,
state: options.state, state: options.state,

View File

@@ -91,7 +91,6 @@ class VectorTile extends UrlTile {
super({ super({
attributions: options.attributions, attributions: options.attributions,
cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128, cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128,
extent: extent,
opaque: false, opaque: false,
projection: projection, projection: projection,
state: options.state, state: options.state,

4
types/dom.d.ts vendored
View File

@@ -27,3 +27,7 @@ interface Element {
msRequestFullscreen(): Promise<void>; msRequestFullscreen(): Promise<void>;
webkitRequestFullscreen(allowKeyboardInput?: number): Promise<void>; webkitRequestFullscreen(allowKeyboardInput?: number): Promise<void>;
} }
interface CSSStyleDeclaration {
msTransform: string | null;
}