Correct types

This commit is contained in:
Tim Schaub
2017-08-15 15:30:10 -04:00
parent 8e90976bf2
commit 8a08ab6463
29 changed files with 67 additions and 67 deletions

View File

@@ -124,7 +124,7 @@ goog.require('ol.source.OSM');
/**
* @type {ol.Map}
* @type {ol.PluggableMap}
*/
app.map = new ol.Map({
target: 'map',

View File

@@ -9,7 +9,7 @@ goog.require('ol.source.OSM');
* Helper method for map-creation.
*
* @param {string} divId The id of the div for the map.
* @return {ol.Map} The ol.Map instance.
* @return {ol.PluggableMap} The ol.Map instance.
*/
var createMap = function(divId) {
var source, layer, map, zoomslider;

View File

@@ -181,7 +181,7 @@ oli.MapEvent = function() {};
/**
* @type {ol.Map}
* @type {ol.PluggableMap}
*/
oli.MapEvent.prototype.map;
@@ -229,7 +229,7 @@ oli.control.Control = function() {};
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @return {undefined} Undefined.
*/
oli.control.Control.prototype.setMap = function(map) {};

View File

@@ -109,7 +109,7 @@ olx.LogoOptions.prototype.src;
/**
* @typedef {{map: (ol.Map|undefined),
* @typedef {{map: (ol.PluggableMap|undefined),
* maxLines: (number|undefined),
* strokeStyle: (ol.style.Stroke|undefined),
* targetSize: (number|undefined),
@@ -126,7 +126,7 @@ olx.GraticuleOptions;
/**
* Reference to an `ol.Map` object.
* @type {ol.Map|undefined}
* @type {ol.PluggableMap|undefined}
* @api
*/
olx.GraticuleOptions.prototype.map;
@@ -4011,7 +4011,7 @@ olx.layer.HeatmapOptions.prototype.zIndex;
/**
* @typedef {{opacity: (number|undefined),
* map: (ol.Map|undefined),
* map: (ol.PluggableMap|undefined),
* source: (ol.source.Image|undefined),
* visible: (boolean|undefined),
* extent: (ol.Extent|undefined),
@@ -4043,7 +4043,7 @@ olx.layer.ImageOptions.prototype.source;
* layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it
* managed by the map is to use {@link ol.Map#addLayer}.
* @type {ol.Map|undefined}
* @type {ol.PluggableMap|undefined}
* @api
*/
olx.layer.ImageOptions.prototype.map;
@@ -4095,7 +4095,7 @@ olx.layer.ImageOptions.prototype.zIndex;
* @typedef {{opacity: (number|undefined),
* preload: (number|undefined),
* source: (ol.source.Tile|undefined),
* map: (ol.Map|undefined),
* map: (ol.PluggableMap|undefined),
* visible: (boolean|undefined),
* extent: (ol.Extent|undefined),
* minResolution: (number|undefined),
@@ -4136,7 +4136,7 @@ olx.layer.TileOptions.prototype.source;
* layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it
* managed by the map is to use {@link ol.Map#addLayer}.
* @type {ol.Map|undefined}
* @type {ol.PluggableMap|undefined}
* @api
*/
olx.layer.TileOptions.prototype.map;
@@ -4199,7 +4199,7 @@ olx.layer.TileOptions.prototype.zIndex;
* opacity: (number|undefined),
* renderBuffer: (number|undefined),
* source: (ol.source.Vector|undefined),
* map: (ol.Map|undefined),
* map: (ol.PluggableMap|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
* updateWhileAnimating: (boolean|undefined),
* updateWhileInteracting: (boolean|undefined),
@@ -4224,7 +4224,7 @@ olx.layer.VectorOptions.prototype.renderOrder;
* layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it
* managed by the map is to use {@link ol.Map#addLayer}.
* @type {ol.Map|undefined}
* @type {ol.PluggableMap|undefined}
* @api
*/
olx.layer.VectorOptions.prototype.map;
@@ -4330,7 +4330,7 @@ olx.layer.VectorOptions.prototype.zIndex;
/**
* @typedef {{extent: (ol.Extent|undefined),
* map: (ol.Map|undefined),
* map: (ol.PluggableMap|undefined),
* minResolution: (number|undefined),
* maxResolution: (number|undefined),
* opacity: (number|undefined),
@@ -4392,7 +4392,7 @@ olx.layer.VectorTileOptions.prototype.renderOrder;
* layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it
* managed by the map is to use {@link ol.Map#addLayer}.
* @type {ol.Map|undefined}
* @type {ol.PluggableMap|undefined}
* @api
*/
olx.layer.VectorTileOptions.prototype.map;
@@ -8294,7 +8294,7 @@ olx.style.AtlasManagerOptions.prototype.space;
/**
* @typedef {{handles: function(ol.renderer.Type):boolean,
* create: function(Element, ol.Map):ol.renderer.Map}}
* create: function(Element, ol.PluggableMap):ol.renderer.Map}}
*/
olx.MapRendererPlugin;
@@ -8309,7 +8309,7 @@ olx.MapRendererPlugin.prototype.handles;
/**
* Create the map renderer.
* @type {function(Element, ol.Map):ol.renderer.Map}
* @type {function(Element, ol.PluggableMap):ol.renderer.Map}
* @api
*/
olx.MapRendererPlugin.prototype.create;

View File

@@ -53,7 +53,7 @@ For custom subclasses in applications, which can be created using `ol.inherits`,
oli.control.Control = function() {};
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @return {undefined} Undefined.
*/
oli.control.Control.prototype.setMap = function(map) {};
@@ -74,7 +74,7 @@ ol.control.Control = function(options) {
/**
* Application subclasses may override this.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @api
*/
ol.control.Control.prototype.setMap = function(map) {

View File

@@ -54,7 +54,7 @@ ol.control.Control = function(options) {
/**
* @private
* @type {ol.Map}
* @type {ol.PluggableMap}
*/
this.map_ = null;
@@ -88,7 +88,7 @@ ol.control.Control.prototype.disposeInternal = function() {
/**
* Get the map associated with this control.
* @return {ol.Map} Map.
* @return {ol.PluggableMap} Map.
* @api
*/
ol.control.Control.prototype.getMap = function() {
@@ -100,7 +100,7 @@ ol.control.Control.prototype.getMap = function() {
* Remove the control from its current map and attach it to the new map.
* Subclasses may set up event handlers to get notified about changes to
* the map here.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @override
* @api
*/

View File

@@ -2,7 +2,7 @@ goog.provide('ol.control.OverviewMap');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.Map');
goog.require('ol.PluggableMap');
goog.require('ol.MapEventType');
goog.require('ol.MapProperty');
goog.require('ol.Object');
@@ -97,10 +97,10 @@ ol.control.OverviewMap = function(opt_options) {
this.ovmapDiv_.className = 'ol-overviewmap-map';
/**
* @type {ol.Map}
* @type {ol.PluggableMap}
* @private
*/
this.ovmap_ = new ol.Map({
this.ovmap_ = new ol.PluggableMap({
controls: new ol.Collection(),
interactions: new ol.Collection(),
view: options.view
@@ -551,7 +551,7 @@ ol.control.OverviewMap.prototype.getCollapsed = function() {
/**
* Return the overview map.
* @return {ol.Map} Overview map.
* @return {ol.PluggableMap} Overview map.
* @api
*/
ol.control.OverviewMap.prototype.getOverviewMap = function() {

View File

@@ -24,7 +24,7 @@ ol.Graticule = function(opt_options) {
var options = opt_options || {};
/**
* @type {ol.Map}
* @type {ol.PluggableMap}
* @private
*/
this.map_ = null;
@@ -469,7 +469,7 @@ ol.Graticule.prototype.getInterval_ = function(resolution) {
/**
* Get the map associated with this graticule.
* @return {ol.Map} The map.
* @return {ol.PluggableMap} The map.
* @api
*/
ol.Graticule.prototype.getMap = function() {
@@ -642,7 +642,7 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) {
/**
* Set the map for this graticule. The graticule will be rendered on the
* provided map.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @api
*/
ol.Graticule.prototype.setMap = function(map) {

View File

@@ -306,7 +306,7 @@ ol.interaction.Extent.getSegments_ = function(extent) {
/**
* @param {ol.Pixel} pixel cursor location
* @param {ol.Map} map map
* @param {ol.PluggableMap} map map
* @returns {ol.Coordinate|null} snapped vertex on extent
* @private
*/

View File

@@ -31,7 +31,7 @@ ol.interaction.Interaction = function(options) {
/**
* @private
* @type {ol.Map}
* @type {ol.PluggableMap}
*/
this.map_ = null;
@@ -60,7 +60,7 @@ ol.interaction.Interaction.prototype.getActive = function() {
/**
* Get the map associated with this interaction.
* @return {ol.Map} Map.
* @return {ol.PluggableMap} Map.
* @api
*/
ol.interaction.Interaction.prototype.getMap = function() {
@@ -83,7 +83,7 @@ ol.interaction.Interaction.prototype.setActive = function(active) {
* Remove the interaction from its current map and attach it to the new map.
* Subclasses may set up event handlers to get notified about changes to
* the map here.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
*/
ol.interaction.Interaction.prototype.setMap = function(map) {
this.map_ = map;

View File

@@ -839,7 +839,7 @@ ol.interaction.Modify.prototype.handlePointerMove_ = function(evt) {
/**
* @param {ol.Pixel} pixel Pixel
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @private
*/
ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {

View File

@@ -244,7 +244,7 @@ ol.interaction.MouseWheelZoom.prototype.decrementInteractingHint_ = function() {
/**
* @private
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
*/
ol.interaction.MouseWheelZoom.prototype.handleWheelZoom_ = function(map) {
var view = map.getView();

View File

@@ -304,7 +304,7 @@ ol.interaction.Select.prototype.setHitTolerance = function(hitTolerance) {
/**
* Remove the interaction from its current map, if any, and attach it to a new
* map, if any. Pass `null` to just remove the interaction from the current map.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @override
* @api
*/

View File

@@ -336,7 +336,7 @@ ol.interaction.Snap.prototype.shouldStopEvent = ol.functions.FALSE;
/**
* @param {ol.Pixel} pixel Pixel
* @param {ol.Coordinate} pixelCoordinate Coordinate
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @return {ol.SnapResultType} Snap result
*/
ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {

View File

@@ -185,7 +185,7 @@ ol.interaction.Translate.handleMoveEvent_ = function(event) {
* Tests to see if the given coordinates intersects any of our selected
* features.
* @param {ol.Pixel} pixel Pixel coordinate to test for intersection.
* @param {ol.Map} map Map to test the intersection on.
* @param {ol.PluggableMap} map Map to test the intersection on.
* @return {ol.Feature} Returns the feature found at the specified pixel
* coordinates.
* @private
@@ -245,7 +245,7 @@ ol.interaction.Translate.prototype.handleActiveChanged_ = function() {
/**
* @param {ol.Map} oldMap Old map.
* @param {ol.PluggableMap} oldMap Old map.
* @private
*/
ol.interaction.Translate.prototype.updateState_ = function(oldMap) {

View File

@@ -161,7 +161,7 @@ ol.layer.Layer.prototype.handleSourcePropertyChange_ = function() {
*
* To add the layer to a map and have it managed by the map, use
* {@link ol.Map#addLayer} instead.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @api
*/
ol.layer.Layer.prototype.setMap = function(map) {

View File

@@ -13,7 +13,7 @@ goog.require('ol.MapEvent');
* @extends {ol.MapEvent}
* @implements {oli.MapBrowserEvent}
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {Event} browserEvent Browser event.
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?olx.FrameState=} opt_frameState Frame state.

View File

@@ -11,7 +11,7 @@ goog.require('ol.pointer.PointerEventHandler');
/**
* @param {ol.Map} map The map with the viewport to listen to events on.
* @param {ol.PluggableMap} map The map with the viewport to listen to events on.
* @param {number|undefined} moveTolerance The minimal distance the pointer must travel to trigger a move.
* @constructor
* @extends {ol.events.EventTarget}
@@ -22,7 +22,7 @@ ol.MapBrowserEventHandler = function(map, moveTolerance) {
/**
* This is the element that we will listen to the real events on.
* @type {ol.Map}
* @type {ol.PluggableMap}
* @private
*/
this.map_ = map;

View File

@@ -8,7 +8,7 @@ goog.require('ol.MapBrowserEvent');
* @constructor
* @extends {ol.MapBrowserEvent}
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?olx.FrameState=} opt_frameState Frame state.

View File

@@ -13,7 +13,7 @@ goog.require('ol.events.Event');
* @extends {ol.events.Event}
* @implements {oli.MapEvent}
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {?olx.FrameState=} opt_frameState Frame state.
*/
ol.MapEvent = function(type, map, opt_frameState) {
@@ -22,7 +22,7 @@ ol.MapEvent = function(type, map, opt_frameState) {
/**
* The map where the event occurred.
* @type {ol.Map}
* @type {ol.PluggableMap}
* @api
*/
this.map = map;

View File

@@ -166,12 +166,12 @@ ol.Overlay.prototype.getId = function() {
/**
* Get the map associated with this overlay.
* @return {ol.Map|undefined} The map that the overlay is part of.
* @return {ol.PluggableMap|undefined} The map that the overlay is part of.
* @observable
* @api
*/
ol.Overlay.prototype.getMap = function() {
return /** @type {ol.Map|undefined} */ (
return /** @type {ol.PluggableMap|undefined} */ (
this.get(ol.Overlay.Property_.MAP));
};
@@ -299,7 +299,7 @@ ol.Overlay.prototype.setElement = function(element) {
/**
* Set the map to be associated with this overlay.
* @param {ol.Map|undefined} map The map that the overlay is part of.
* @param {ol.PluggableMap|undefined} map The map that the overlay is part of.
* @observable
* @api
*/

View File

@@ -291,7 +291,7 @@ ol.PluggableMap = function(options) {
this.controls.forEach(
/**
* @param {ol.control.Control} control Control.
* @this {ol.Map}
* @this {ol.PluggableMap}
*/
function(control) {
control.setMap(this);
@@ -316,7 +316,7 @@ ol.PluggableMap = function(options) {
this.interactions.forEach(
/**
* @param {ol.interaction.Interaction} interaction Interaction.
* @this {ol.Map}
* @this {ol.PluggableMap}
*/
function(interaction) {
interaction.setMap(this);

View File

@@ -30,7 +30,7 @@ ol.render.Box = function(className) {
/**
* @private
* @type {ol.Map}
* @type {ol.PluggableMap}
*/
this.map_ = null;
@@ -74,7 +74,7 @@ ol.render.Box.prototype.render_ = function() {
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
*/
ol.render.Box.prototype.setMap = function(map) {
if (this.map_) {

View File

@@ -21,7 +21,7 @@ goog.require('ol.source.State');
* @constructor
* @extends {ol.renderer.Map}
* @param {Element} container Container.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @api
*/
ol.renderer.canvas.Map = function(container, map) {
@@ -75,7 +75,7 @@ ol.renderer.canvas.Map['handles'] = function(type) {
/**
* Create the map renderer.
* @param {Element} container Container.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @return {ol.renderer.canvas.Map} The map renderer.
*/
ol.renderer.canvas.Map['create'] = function(container, map) {

View File

@@ -147,7 +147,7 @@ ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSourc
if (tileSource.canExpireCache()) {
/**
* @param {ol.source.Tile} tileSource Tile source.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {olx.FrameState} frameState Frame state.
*/
var postRenderFunction = function(tileSource, map, frameState) {

View File

@@ -17,7 +17,7 @@ goog.require('ol.transform');
* @abstract
* @extends {ol.Disposable}
* @param {Element} container Container.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @struct
*/
ol.renderer.Map = function(container, map) {
@@ -27,7 +27,7 @@ ol.renderer.Map = function(container, map) {
/**
* @private
* @type {ol.Map}
* @type {ol.PluggableMap}
*/
this.map_ = map;
@@ -78,7 +78,7 @@ ol.renderer.Map.prototype.disposeInternal = function() {
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {olx.FrameState} frameState Frame state.
* @private
*/
@@ -249,7 +249,7 @@ ol.renderer.Map.prototype.getLayerRenderers = function() {
/**
* @return {ol.Map} Map.
* @return {ol.PluggableMap} Map.
*/
ol.renderer.Map.prototype.getMap = function() {
return this.map_;
@@ -296,7 +296,7 @@ ol.renderer.Map.prototype.renderFrame = ol.nullFunction;
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {olx.FrameState} frameState Frame state.
* @private
*/

View File

@@ -28,7 +28,7 @@ if (ol.ENABLE_WEBGL) {
* @constructor
* @extends {ol.renderer.Map}
* @param {Element} container Container.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @api
*/
ol.renderer.webgl.Map = function(container, map) {
@@ -133,7 +133,7 @@ if (ol.ENABLE_WEBGL) {
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} false.
* @this {ol.renderer.webgl.Map}
@@ -177,7 +177,7 @@ if (ol.ENABLE_WEBGL) {
/**
* Create the map renderer.
* @param {Element} container Container.
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @return {ol.renderer.webgl.Map} The map renderer.
*/
ol.renderer.webgl.Map['create'] = function(container, map) {
@@ -301,7 +301,7 @@ if (ol.ENABLE_WEBGL) {
/**
* @param {ol.Map} map Map.
* @param {ol.PluggableMap} map Map.
* @param {olx.FrameState} frameState Frame state.
* @private
*/

View File

@@ -404,7 +404,7 @@ ol.Pixel;
/**
* @typedef {function(ol.Map, ?olx.FrameState): boolean}
* @typedef {function(ol.PluggableMap, ?olx.FrameState): boolean}
*/
ol.PostRenderFunction;
@@ -414,7 +414,7 @@ ol.PostRenderFunction;
* with the {@link ol.Map} as first and an optional {@link olx.FrameState} as
* second argument. Return `true` to keep this function for the next frame,
* `false` to remove it.
* @typedef {function(ol.Map, ?olx.FrameState): boolean}
* @typedef {function(ol.PluggableMap, ?olx.FrameState): boolean}
*/
ol.PreRenderFunction;

View File

@@ -445,7 +445,7 @@
/**
* Assert that the given map resembles a reference image.
*
* @param {ol.Map} map A map using the canvas renderer.
* @param {ol.PluggableMap} map A map using the canvas renderer.
* @param {string} referenceImage Path to the reference image.
* @param {number} tolerance The accepted mismatch tolerance.
* @param {function} done A callback to indicate that the test is done.