Remove sub-namespaces from all remaining typedefs

This commit is contained in:
Peter Robins
2016-06-09 09:21:23 +00:00
parent 09202cf95d
commit 2c29512c80
47 changed files with 492 additions and 479 deletions

View File

@@ -60,7 +60,7 @@ ol.control.Control = function(options) {
/**
* @protected
* @type {!Array.<ol.events.Key>}
* @type {!Array.<ol.EventsKey>}
*/
this.listenerKeys = [];

View File

@@ -58,7 +58,7 @@ ol.control.ZoomSlider = function(opt_options) {
this.dragging_;
/**
* @type {!Array.<ol.events.Key>}
* @type {!Array.<ol.EventsKey>}
* @private
*/
this.dragListenerKeys_ = [];

View File

@@ -83,7 +83,7 @@ ol.DeviceOrientation = function(opt_options) {
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.listenerKey_ = null;

View File

@@ -3,7 +3,7 @@ goog.provide('ol.events.EventType');
goog.provide('ol.events.KeyCode');
goog.require('ol.object');
goog.require('ol.events.EventTargetLike');
goog.require('ol.EventTargetLike');
/**
@@ -63,8 +63,8 @@ ol.events.LISTENER_MAP_PROP_ = 'olm_' + ((Math.random() * 1e4) | 0);
/**
* @param {ol.events.Key} listenerObj Listener object.
* @return {ol.events.ListenerFunctionType} Bound listener.
* @param {ol.EventsKey} listenerObj Listener object.
* @return {ol.EventsListenerFunctionType} Bound listener.
*/
ol.events.bindListener_ = function(listenerObj) {
var boundListener = function(evt) {
@@ -81,15 +81,15 @@ ol.events.bindListener_ = function(listenerObj) {
/**
* Finds the matching {@link ol.events.Key} in the given listener
* Finds the matching {@link ol.EventsKey} in the given listener
* array.
*
* @param {!Array<!ol.events.Key>} listeners Array of listeners.
* @param {!Array<!ol.EventsKey>} listeners Array of listeners.
* @param {!Function} listener The listener function.
* @param {Object=} opt_this The `this` value inside the listener.
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
* listener, for {@link ol.events.unlistenByKey}.
* @return {ol.events.Key|undefined} The matching listener object.
* @return {ol.EventsKey|undefined} The matching listener object.
* @private
*/
ol.events.findListener_ = function(listeners, listener, opt_this,
@@ -110,9 +110,9 @@ ol.events.findListener_ = function(listeners, listener, opt_this,
/**
* @param {ol.events.EventTargetLike} target Target.
* @param {ol.EventTargetLike} target Target.
* @param {string} type Type.
* @return {Array.<ol.events.Key>|undefined} Listeners.
* @return {Array.<ol.EventsKey>|undefined} Listeners.
*/
ol.events.getListeners = function(target, type) {
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
@@ -123,8 +123,8 @@ ol.events.getListeners = function(target, type) {
/**
* Get the lookup of listeners. If one does not exist on the target, it is
* created.
* @param {ol.events.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.events.Key>>} Map of
* @param {ol.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.EventsKey>>} Map of
* listeners by event type.
* @private
*/
@@ -141,7 +141,7 @@ ol.events.getListenerMap_ = function(target) {
* Clean up all listener objects of the given type. All properties on the
* listener objects will be removed, and if no listeners remain in the listener
* map, it will be removed from the target.
* @param {ol.events.EventTargetLike} target Target.
* @param {ol.EventTargetLike} target Target.
* @param {string} type Type.
* @private
*/
@@ -171,13 +171,13 @@ ol.events.removeListeners_ = function(target, type) {
* This function efficiently binds a `listener` to a `this` object, and returns
* a key for use with {@link ol.events.unlistenByKey}.
*
* @param {ol.events.EventTargetLike} target Event target.
* @param {ol.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @param {boolean=} opt_once If true, add the listener as one-off listener.
* @return {ol.events.Key} Unique key for the listener.
* @return {ol.EventsKey} Unique key for the listener.
*/
ol.events.listen = function(target, type, listener, opt_this, opt_once) {
var listenerMap = ol.events.getListenerMap_(target);
@@ -193,7 +193,7 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
listenerObj.callOnce = false;
}
} else {
listenerObj = /** @type {ol.events.Key} */ ({
listenerObj = /** @type {ol.EventsKey} */ ({
bindTo: opt_this,
callOnce: !!opt_once,
listener: listener,
@@ -221,12 +221,12 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
* function, the self-unregistering listener will be turned into a permanent
* listener.
*
* @param {ol.events.EventTargetLike} target Event target.
* @param {ol.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @return {ol.events.Key} Key for unlistenByKey.
* @return {ol.EventsKey} Key for unlistenByKey.
*/
ol.events.listenOnce = function(target, type, listener, opt_this) {
return ol.events.listen(target, type, listener, opt_this, true);
@@ -240,9 +240,9 @@ ol.events.listenOnce = function(target, type, listener, opt_this) {
* To return a listener, this function needs to be called with the exact same
* arguments that were used for a previous {@link ol.events.listen} call.
*
* @param {ol.events.EventTargetLike} target Event target.
* @param {ol.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
*/
@@ -265,7 +265,7 @@ ol.events.unlisten = function(target, type, listener, opt_this) {
* The argument passed to this function is the key returned from
* {@link ol.events.listen} or {@link ol.events.listenOnce}.
*
* @param {ol.events.Key} key The key.
* @param {ol.EventsKey} key The key.
*/
ol.events.unlistenByKey = function(key) {
if (key && key.target) {
@@ -289,7 +289,7 @@ ol.events.unlistenByKey = function(key) {
* Unregisters all event listeners on an event target. Inspired by
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* @param {ol.events.EventTargetLike} target Target.
* @param {ol.EventTargetLike} target Target.
*/
ol.events.unlistenAll = function(target) {
var listenerMap = ol.events.getListenerMap_(target);

View File

@@ -41,7 +41,7 @@ ol.events.EventTarget = function() {
/**
* @private
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
* @type {!Object.<string, Array.<ol.EventsListenerFunctionType>>}
*/
this.listeners_ = {};
@@ -51,7 +51,7 @@ ol.inherits(ol.events.EventTarget, ol.Disposable);
/**
* @param {string} type Type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
*/
ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
var listeners = this.listeners_[type];
@@ -116,7 +116,7 @@ ol.events.EventTarget.prototype.disposeInternal = function() {
* order that they will be called in.
*
* @param {string} type Type.
* @return {Array.<ol.events.ListenerFunctionType>} Listeners.
* @return {Array.<ol.EventsListenerFunctionType>} Listeners.
*/
ol.events.EventTarget.prototype.getListeners = function(type) {
return this.listeners_[type];
@@ -137,7 +137,7 @@ ol.events.EventTarget.prototype.hasListener = function(opt_type) {
/**
* @param {string} type Type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
*/
ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
var listeners = this.listeners_[type];

View File

@@ -86,7 +86,7 @@ ol.Feature = function(opt_geometryOrProperties) {
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.geometryChangeKey_ = null;

View File

@@ -6,7 +6,6 @@ goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.SimpleGeometry');
goog.require('ol.geom.flat.deflate');
goog.require('ol.proj');
/**
@@ -244,9 +243,9 @@ ol.geom.Circle.prototype.setRadius = function(radius) {
* correspond to the shape that would be obtained by transforming every point
* of the original circle.
*
* @param {ol.proj.ProjectionLike} source The current projection. Can be a
* @param {ol.ProjectionLike} source The current projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @param {ol.proj.ProjectionLike} destination The desired projection. Can be a
* @param {ol.ProjectionLike} destination The desired projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @return {ol.geom.Circle} This geometry. Note that original geometry is
* modified in place.

View File

@@ -251,9 +251,9 @@ ol.geom.Geometry.prototype.translate = goog.abstractMethod;
* If you do not want the geometry modified in place, first `clone()` it and
* then use this function on the clone.
*
* @param {ol.proj.ProjectionLike} source The current projection. Can be a
* @param {ol.ProjectionLike} source The current projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @param {ol.proj.ProjectionLike} destination The desired projection. Can be a
* @param {ol.ProjectionLike} destination The desired projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @return {ol.geom.Geometry} This geometry. Note that original geometry is
* modified in place.

View File

@@ -49,7 +49,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src,
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.imageListenerKeys_ = null;

View File

@@ -46,7 +46,7 @@ ol.ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction) {
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.imageListenerKeys_ = null;

View File

@@ -46,7 +46,7 @@ ol.interaction.DragAndDrop = function(opt_options) {
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.dropListenKeys_ = null;

View File

@@ -120,14 +120,14 @@ ol.interaction.DragBox = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.always;
/**
* @private
* @type {ol.interaction.DragBoxEndConditionType}
* @type {ol.DragBoxEndConditionType}
*/
this.boxEndCondition_ = options.boxEndCondition ?
options.boxEndCondition : ol.interaction.DragBox.defaultBoxEndCondition;

View File

@@ -48,7 +48,7 @@ ol.interaction.DragPan = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.noModifierKeys;

View File

@@ -34,7 +34,7 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.shiftKeyOnly;

View File

@@ -33,7 +33,7 @@ ol.interaction.DragRotate = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.altShiftKeysOnly;

View File

@@ -161,7 +161,7 @@ ol.interaction.Draw = function(options) {
/**
* A function to decide if a potential finish coordinate is permissable
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.finishCondition_ = options.finishCondition ? options.finishCondition : ol.functions.TRUE;
@@ -213,7 +213,7 @@ ol.interaction.Draw = function(options) {
}
/**
* @type {ol.interaction.DrawGeometryFunctionType}
* @type {ol.DrawGeometryFunctionType}
* @private
*/
this.geometryFunction_ = geometryFunction;
@@ -294,14 +294,14 @@ ol.interaction.Draw = function(options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.noModifierKeys;
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.freehandCondition_ = options.freehandCondition ?
options.freehandCondition : ol.events.condition.shiftKeyOnly;
@@ -315,7 +315,7 @@ ol.inherits(ol.interaction.Draw, ol.interaction.Pointer);
/**
* @return {ol.style.StyleFunction} Styles.
* @return {ol.StyleFunction} Styles.
*/
ol.interaction.Draw.getDefaultStyleFunction = function() {
var styles = ol.style.createDefaultEditingStyles();
@@ -795,7 +795,7 @@ ol.interaction.Draw.prototype.updateState_ = function() {
* @param {number=} opt_angle Angle of the first point in radians. 0 means East.
* Default is the angle defined by the heading from the center of the
* regular polygon to the current pointer position.
* @return {ol.interaction.DrawGeometryFunctionType} Function that draws a
* @return {ol.DrawGeometryFunctionType} Function that draws a
* polygon.
* @api
*/

View File

@@ -46,7 +46,7 @@ ol.interaction.KeyboardPan = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition !== undefined ?
options.condition : this.defaultCondition_

View File

@@ -33,7 +33,7 @@ ol.interaction.KeyboardZoom = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ? options.condition :
ol.events.condition.targetNotEditable;

View File

@@ -103,7 +103,7 @@ ol.interaction.Modify = function(options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.primaryAction;
@@ -120,7 +120,7 @@ ol.interaction.Modify = function(options) {
}
/**
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
* @private
*/
this.deleteCondition_ = options.deleteCondition ?
@@ -162,7 +162,7 @@ ol.interaction.Modify = function(options) {
/**
* Segment RTree for each layer
* @type {ol.structs.RBush.<ol.interaction.SegmentDataType>}
* @type {ol.structs.RBush.<ol.ModifySegmentDataType>}
* @private
*/
this.rBush_ = new ol.structs.RBush();
@@ -302,10 +302,10 @@ ol.interaction.Modify.prototype.removeFeature_ = function(feature) {
*/
ol.interaction.Modify.prototype.removeFeatureSegmentData_ = function(feature) {
var rBush = this.rBush_;
var /** @type {Array.<ol.interaction.SegmentDataType>} */ nodesToRemove = [];
var /** @type {Array.<ol.ModifySegmentDataType>} */ nodesToRemove = [];
rBush.forEach(
/**
* @param {ol.interaction.SegmentDataType} node RTree node.
* @param {ol.ModifySegmentDataType} node RTree node.
*/
function(node) {
if (feature === node.feature) {
@@ -369,7 +369,7 @@ ol.interaction.Modify.prototype.handleFeatureRemove_ = function(evt) {
*/
ol.interaction.Modify.prototype.writePointGeometry_ = function(feature, geometry) {
var coordinates = geometry.getCoordinates();
var segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
var segmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
segment: [coordinates, coordinates]
@@ -388,7 +388,7 @@ ol.interaction.Modify.prototype.writeMultiPointGeometry_ = function(feature, geo
var coordinates, i, ii, segmentData;
for (i = 0, ii = points.length; i < ii; ++i) {
coordinates = points[i];
segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
segmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
depth: [i],
@@ -410,7 +410,7 @@ ol.interaction.Modify.prototype.writeLineStringGeometry_ = function(feature, geo
var i, ii, segment, segmentData;
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
segmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
index: i,
@@ -433,7 +433,7 @@ ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ = function(feature
coordinates = lines[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
segmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
depth: [j],
@@ -458,7 +458,7 @@ ol.interaction.Modify.prototype.writePolygonGeometry_ = function(feature, geomet
coordinates = rings[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
segmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
depth: [j],
@@ -485,7 +485,7 @@ ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ = function(feature, g
coordinates = rings[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SegmentDataType} */ ({
segmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
depth: [j, k],
@@ -533,8 +533,8 @@ ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ = function(coordina
/**
* @param {ol.interaction.SegmentDataType} a The first segment data.
* @param {ol.interaction.SegmentDataType} b The second segment data.
* @param {ol.ModifySegmentDataType} a The first segment data.
* @param {ol.ModifySegmentDataType} b The second segment data.
* @return {number} The difference in indexes.
* @private
*/
@@ -808,7 +808,7 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
/**
* @param {ol.interaction.SegmentDataType} segmentData Segment data.
* @param {ol.ModifySegmentDataType} segmentData Segment data.
* @param {ol.Coordinate} vertex Vertex.
* @private
*/
@@ -859,7 +859,7 @@ ol.interaction.Modify.prototype.insertVertex_ = function(segmentData, vertex) {
rTree.remove(segmentData);
goog.asserts.assert(index !== undefined, 'index should be defined');
this.updateSegmentIndices_(geometry, index, depth, 1);
var newSegmentData = /** @type {ol.interaction.SegmentDataType} */ ({
var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
segment: [segment[0], vertex],
feature: feature,
geometry: geometry,
@@ -870,7 +870,7 @@ ol.interaction.Modify.prototype.insertVertex_ = function(segmentData, vertex) {
newSegmentData);
this.dragSegments_.push([newSegmentData, 1]);
var newSegmentData2 = /** @type {ol.interaction.SegmentDataType} */ ({
var newSegmentData2 = /** @type {ol.ModifySegmentDataType} */ ({
segment: [vertex, segment[1]],
feature: feature,
geometry: geometry,
@@ -998,7 +998,7 @@ ol.interaction.Modify.prototype.removeVertex_ = function() {
if (left !== undefined && right !== undefined) {
goog.asserts.assert(newIndex >= 0, 'newIndex should be larger than 0');
var newSegmentData = /** @type {ol.interaction.SegmentDataType} */ ({
var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
depth: segmentData.depth,
feature: segmentData.feature,
geometry: segmentData.geometry,
@@ -1053,7 +1053,7 @@ ol.interaction.Modify.prototype.updateSegmentIndices_ = function(
/**
* @return {ol.style.StyleFunction} Styles.
* @return {ol.StyleFunction} Styles.
*/
ol.interaction.Modify.getDefaultStyleFunction = function() {
var style = ol.style.createDefaultEditingStyles();

View File

@@ -99,28 +99,28 @@ ol.interaction.Select = function(opt_options) {
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.singleClick;
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.addCondition_ = options.addCondition ?
options.addCondition : ol.events.condition.never;
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.removeCondition_ = options.removeCondition ?
options.removeCondition : ol.events.condition.never;
/**
* @private
* @type {ol.events.ConditionType}
* @type {ol.EventsConditionType}
*/
this.toggleCondition_ = options.toggleCondition ?
options.toggleCondition : ol.events.condition.shiftKeyOnly;
@@ -133,7 +133,7 @@ ol.interaction.Select = function(opt_options) {
/**
* @private
* @type {ol.interaction.SelectFilterFunction}
* @type {ol.SelectFilterFunction}
*/
this.filter_ = options.filter ? options.filter :
ol.functions.TRUE;
@@ -355,7 +355,7 @@ ol.interaction.Select.prototype.setMap = function(map) {
/**
* @return {ol.style.StyleFunction} Styles.
* @return {ol.StyleFunction} Styles.
*/
ol.interaction.Select.getDefaultStyleFunction = function() {
var styles = ol.style.createDefaultEditingStyles();

View File

@@ -80,19 +80,19 @@ ol.interaction.Snap = function(opt_options) {
this.features_ = options.features ? options.features : null;
/**
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
* @private
*/
this.featuresListenerKeys_ = [];
/**
* @type {Object.<number, ol.events.Key>}
* @type {Object.<number, ol.EventsKey>}
* @private
*/
this.geometryChangeListenerKeys_ = {};
/**
* @type {Object.<number, ol.events.Key>}
* @type {Object.<number, ol.EventsKey>}
* @private
*/
this.geometryModifyListenerKeys_ = {};
@@ -129,7 +129,7 @@ ol.interaction.Snap = function(opt_options) {
options.pixelTolerance : 10;
/**
* @type {function(ol.interaction.SnapSegmentDataType, ol.interaction.SnapSegmentDataType): number}
* @type {function(ol.SnapSegmentDataType, ol.SnapSegmentDataType): number}
* @private
*/
this.sortByDistance_ = ol.interaction.Snap.sortByDistance.bind(this);
@@ -137,7 +137,7 @@ ol.interaction.Snap = function(opt_options) {
/**
* Segment RTree for each layer
* @type {ol.structs.RBush.<ol.interaction.SnapSegmentDataType>}
* @type {ol.structs.RBush.<ol.SnapSegmentDataType>}
* @private
*/
this.rBush_ = new ol.structs.RBush();
@@ -377,7 +377,7 @@ ol.interaction.Snap.prototype.shouldStopEvent = ol.functions.FALSE;
* @param {ol.Pixel} pixel Pixel
* @param {ol.Coordinate} pixelCoordinate Coordinate
* @param {ol.Map} map Map.
* @return {ol.interaction.SnapResultType} Snap result
* @return {ol.SnapResultType} Snap result
*/
ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
@@ -436,7 +436,7 @@ ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
vertexPixel = [Math.round(vertexPixel[0]), Math.round(vertexPixel[1])];
}
}
return /** @type {ol.interaction.SnapResultType} */ ({
return /** @type {ol.SnapResultType} */ ({
snapped: snapped,
vertex: vertex,
vertexPixel: vertexPixel
@@ -478,7 +478,7 @@ ol.interaction.Snap.prototype.writeLineStringGeometry_ = function(feature, geome
var i, ii, segment, segmentData;
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
segmentData = /** @type {ol.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -499,7 +499,7 @@ ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ = function(feature,
coordinates = lines[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
segmentData = /** @type {ol.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -519,7 +519,7 @@ ol.interaction.Snap.prototype.writeMultiPointGeometry_ = function(feature, geome
var coordinates, i, ii, segmentData;
for (i = 0, ii = points.length; i < ii; ++i) {
coordinates = points[i];
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
segmentData = /** @type {ol.SnapSegmentDataType} */ ({
feature: feature,
segment: [coordinates, coordinates]
});
@@ -542,7 +542,7 @@ ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geo
coordinates = rings[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
segmentData = /** @type {ol.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -560,7 +560,7 @@ ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geo
*/
ol.interaction.Snap.prototype.writePointGeometry_ = function(feature, geometry) {
var coordinates = geometry.getCoordinates();
var segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
var segmentData = /** @type {ol.SnapSegmentDataType} */ ({
feature: feature,
segment: [coordinates, coordinates]
});
@@ -580,7 +580,7 @@ ol.interaction.Snap.prototype.writePolygonGeometry_ = function(feature, geometry
coordinates = rings[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
segmentData = /** @type {ol.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -625,8 +625,8 @@ ol.interaction.Snap.handleUpEvent_ = function(evt) {
/**
* Sort segments by distance, helper function
* @param {ol.interaction.SnapSegmentDataType} a The first segment data.
* @param {ol.interaction.SnapSegmentDataType} b The second segment data.
* @param {ol.SnapSegmentDataType} a The first segment data.
* @param {ol.SnapSegmentDataType} b The second segment data.
* @return {number} The difference in distance.
* @this {ol.interaction.Snap}
*/

View File

@@ -41,19 +41,19 @@ ol.layer.Layer = function(options) {
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.mapPrecomposeKey_ = null;
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.mapRenderKey_ = null;
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.sourceChangeKey_ = null;

View File

@@ -46,13 +46,13 @@ ol.layer.Group = function(opt_options) {
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.layersListenerKeys_ = [];
/**
* @private
* @type {Object.<string, Array.<ol.events.Key>>}
* @type {Object.<string, Array.<ol.EventsKey>>}
*/
this.listenerKeys_ = {};

View File

@@ -55,14 +55,14 @@ ol.layer.Vector = function(opt_options) {
/**
* User provided style.
* @type {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction}
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* @private
*/
this.style_ = null;
/**
* Style function for use within the library.
* @type {ol.style.StyleFunction|undefined}
* @type {ol.StyleFunction|undefined}
* @private
*/
this.styleFunction_ = undefined;
@@ -117,7 +117,7 @@ ol.layer.Vector.prototype.getSource;
/**
* Get the style for features. This returns whatever was passed to the `style`
* option at construction or to the `setStyle` method.
* @return {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction}
* @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* Layer style.
* @api stable
*/
@@ -128,7 +128,7 @@ ol.layer.Vector.prototype.getStyle = function() {
/**
* Get the style function.
* @return {ol.style.StyleFunction|undefined} Layer style function.
* @return {ol.StyleFunction|undefined} Layer style function.
* @api stable
*/
ol.layer.Vector.prototype.getStyleFunction = function() {
@@ -174,7 +174,7 @@ ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
* it is `null` the layer has no style (a `null` style), so only features
* that have their own styles will be rendered in the layer. See
* {@link ol.style} for information on the default style.
* @param {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|null|undefined}
* @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|null|undefined}
* style Layer style.
* @api stable
*/

View File

@@ -235,13 +235,13 @@ ol.Map = function(options) {
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.viewPropertyListenerKey_ = null;
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.layerGroupPropertyListenerKeys_ = null;
@@ -307,7 +307,7 @@ ol.Map = function(options) {
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.keyHandlerKeys_ = null;

View File

@@ -145,7 +145,7 @@ ol.MapBrowserEventHandler = function(map) {
this.dragging_ = false;
/**
* @type {!Array.<ol.events.Key>}
* @type {!Array.<ol.EventsKey>}
* @private
*/
this.dragListenerKeys_ = [];
@@ -191,7 +191,7 @@ ol.MapBrowserEventHandler = function(map) {
this.documentPointerEventHandler_ = null;
/**
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
* @private
*/
this.pointerdownListenerKey_ = ol.events.listen(this.pointerEventHandler_,
@@ -199,7 +199,7 @@ ol.MapBrowserEventHandler = function(map) {
this.handlePointerDown_, this);
/**
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
* @private
*/
this.relayedListenerKey_ = ol.events.listen(this.pointerEventHandler_,

View File

@@ -35,7 +35,7 @@ ol.inherits(ol.Observable, ol.events.EventTarget);
/**
* Removes an event listener using the key returned by `on()` or `once()`.
* @param {ol.events.Key|Array.<ol.events.Key>} key The key returned by `on()`
* @param {ol.EventsKey|Array.<ol.EventsKey>} key The key returned by `on()`
* or `once()` (or an array of keys).
* @api stable
*/
@@ -45,7 +45,7 @@ ol.Observable.unByKey = function(key) {
ol.events.unlistenByKey(key[i]);
}
} else {
ol.events.unlistenByKey(/** @type {ol.events.Key} */ (key));
ol.events.unlistenByKey(/** @type {ol.EventsKey} */ (key));
}
};
@@ -97,7 +97,7 @@ ol.Observable.prototype.getRevision = function() {
* @param {string|Array.<string>} type The event type or array of event types.
* @param {function(?): ?} listener The listener function.
* @param {Object=} opt_this The object to use as `this` in `listener`.
* @return {ol.events.Key|Array.<ol.events.Key>} Unique key for the listener. If
* @return {ol.EventsKey|Array.<ol.EventsKey>} Unique key for the listener. If
* called with an array of event types as the first argument, the return
* will be an array of keys.
* @api stable
@@ -122,7 +122,7 @@ ol.Observable.prototype.on = function(type, listener, opt_this) {
* @param {string|Array.<string>} type The event type or array of event types.
* @param {function(?): ?} listener The listener function.
* @param {Object=} opt_this The object to use as `this` in `listener`.
* @return {ol.events.Key|Array.<ol.events.Key>} Unique key for the listener. If
* @return {ol.EventsKey|Array.<ol.EventsKey>} Unique key for the listener. If
* called with an array of event types as the first argument, the return
* will be an array of keys.
* @api stable
@@ -166,7 +166,7 @@ ol.Observable.prototype.un = function(type, listener, opt_this) {
* Removes an event listener using the key returned by `on()` or `once()`.
* Note that using the {@link ol.Observable.unByKey} static function is to
* be preferred.
* @param {ol.events.Key|Array.<ol.events.Key>} key The key returned by `on()`
* @param {ol.EventsKey|Array.<ol.EventsKey>} key The key returned by `on()`
* or `once()` (or an array of keys).
* @function
* @api stable

View File

@@ -135,7 +135,7 @@ ol.Overlay = function(options) {
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.mapPostrenderListenerKey_ = null;

View File

@@ -44,7 +44,7 @@ ol.proj.METERS_PER_UNIT[ol.proj.Units.USFEET] = 1200 / 3937;
* Projection definition class. One of these is created for each projection
* supported in the application and stored in the {@link ol.proj} namespace.
* You can use these in applications, but this is not required, as API params
* and options use {@link ol.proj.ProjectionLike} which means the simple string
* and options use {@link ol.ProjectionLike} which means the simple string
* code will suffice.
*
* You can use {@link ol.proj.get} to retrieve the object for a particular
@@ -543,8 +543,8 @@ ol.proj.addTransform = function(source, destination, transformFn) {
* converts these into the functions used internally which also handle
* extents and coordinate arrays.
*
* @param {ol.proj.ProjectionLike} source Source projection.
* @param {ol.proj.ProjectionLike} destination Destination projection.
* @param {ol.ProjectionLike} source Source projection.
* @param {ol.ProjectionLike} destination Destination projection.
* @param {function(ol.Coordinate): ol.Coordinate} forward The forward transform
* function (that is, from the source projection to the destination
* projection) that takes a {@link ol.Coordinate} as argument and returns
@@ -628,7 +628,7 @@ ol.proj.removeTransform = function(source, destination) {
* Transforms a coordinate from longitude/latitude to a different projection.
* @param {ol.Coordinate} coordinate Coordinate as longitude and latitude, i.e.
* an array with longitude as 1st and latitude as 2nd element.
* @param {ol.proj.ProjectionLike=} opt_projection Target projection. The
* @param {ol.ProjectionLike=} opt_projection Target projection. The
* default is Web Mercator, i.e. 'EPSG:3857'.
* @return {ol.Coordinate} Coordinate projected to the target projection.
* @api stable
@@ -642,7 +642,7 @@ ol.proj.fromLonLat = function(coordinate, opt_projection) {
/**
* Transforms a coordinate to longitude/latitude.
* @param {ol.Coordinate} coordinate Projected coordinate.
* @param {ol.proj.ProjectionLike=} opt_projection Projection of the coordinate.
* @param {ol.ProjectionLike=} opt_projection Projection of the coordinate.
* The default is Web Mercator, i.e. 'EPSG:3857'.
* @return {ol.Coordinate} Coordinate as longitude and latitude, i.e. an array
* with longitude as 1st and latitude as 2nd element.
@@ -657,7 +657,7 @@ ol.proj.toLonLat = function(coordinate, opt_projection) {
/**
* Fetches a Projection object for the code specified.
*
* @param {ol.proj.ProjectionLike} projectionLike Either a code string which is
* @param {ol.ProjectionLike} projectionLike Either a code string which is
* a combination of authority and identifier such as "EPSG:4326", or an
* existing projection object, or undefined.
* @return {ol.proj.Projection} Projection object, or null if not in list.
@@ -715,8 +715,8 @@ ol.proj.equivalent = function(projection1, projection2) {
* function to convert a coordinates array from the source projection to the
* destination projection.
*
* @param {ol.proj.ProjectionLike} source Source.
* @param {ol.proj.ProjectionLike} destination Destination.
* @param {ol.ProjectionLike} source Source.
* @param {ol.ProjectionLike} destination Destination.
* @return {ol.TransformFunction} Transform function.
* @api stable
*/
@@ -802,8 +802,8 @@ ol.proj.cloneTransform = function(input, opt_output, opt_dimension) {
* geometry transforms.
*
* @param {ol.Coordinate} coordinate Coordinate.
* @param {ol.proj.ProjectionLike} source Source projection-like.
* @param {ol.proj.ProjectionLike} destination Destination projection-like.
* @param {ol.ProjectionLike} source Source projection-like.
* @param {ol.ProjectionLike} destination Destination projection-like.
* @return {ol.Coordinate} Coordinate.
* @api stable
*/
@@ -818,8 +818,8 @@ ol.proj.transform = function(coordinate, source, destination) {
* returns a new extent (and does not modify the original).
*
* @param {ol.Extent} extent The extent to transform.
* @param {ol.proj.ProjectionLike} source Source projection-like.
* @param {ol.proj.ProjectionLike} destination Destination projection-like.
* @param {ol.ProjectionLike} source Source projection-like.
* @param {ol.ProjectionLike} destination Destination projection-like.
* @return {ol.Extent} The transformed extent.
* @api stable
*/

View File

@@ -52,7 +52,7 @@ ol.renderer.Map = function(container, map) {
/**
* @private
* @type {Object.<string, ol.events.Key>}
* @type {Object.<string, ol.EventsKey>}
*/
this.layerRendererListeners_ = {};

View File

@@ -95,7 +95,7 @@ ol.reproj.Image = function(sourceProj, targetProj,
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.sourceListenerKey_ = null;

View File

@@ -96,7 +96,7 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.sourcesListenerKeys_ = null;

View File

@@ -75,14 +75,14 @@ ol.source.ImageVector = function(options) {
/**
* User provided style.
* @type {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction}
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* @private
*/
this.style_ = null;
/**
* Style function for use within the library.
* @type {ol.style.StyleFunction|undefined}
* @type {ol.StyleFunction|undefined}
* @private
*/
this.styleFunction_ = undefined;
@@ -188,7 +188,7 @@ ol.source.ImageVector.prototype.getSource = function() {
/**
* Get the style for features. This returns whatever was passed to the `style`
* option at construction or to the `setStyle` method.
* @return {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction}
* @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* Layer style.
* @api stable
*/
@@ -199,7 +199,7 @@ ol.source.ImageVector.prototype.getStyle = function() {
/**
* Get the style function.
* @return {ol.style.StyleFunction|undefined} Layer style function.
* @return {ol.StyleFunction|undefined} Layer style function.
* @api stable
*/
ol.source.ImageVector.prototype.getStyleFunction = function() {
@@ -284,7 +284,7 @@ ol.source.ImageVector.prototype.renderFeature_ = function(feature, resolution, p
* it is `null` the layer has no style (a `null` style), so only features
* that have their own styles will be rendered in the layer. See
* {@link ol.style} for information on the default style.
* @param {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined}
* @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
* style Layer style.
* @api stable
*/

View File

@@ -126,7 +126,7 @@ ol.source.ImageWMS.GETFEATUREINFO_IMAGE_SIZE_ = [101, 101];
* constructed.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {number} resolution Resolution.
* @param {ol.proj.ProjectionLike} projection Projection.
* @param {ol.ProjectionLike} projection Projection.
* @param {!Object} params GetFeatureInfo params. `INFO_FORMAT` at least should
* be provided. If `QUERY_LAYERS` is not provided then the layers specified
* in the `LAYERS` parameter will be used. `VERSION` should not be

View File

@@ -345,7 +345,7 @@ ol.source.TileImage.prototype.setRenderReprojectionEdges = function(render) {
* (e.g. projection has no extent defined) or
* for optimization reasons (custom tile size, resolutions, ...).
*
* @param {ol.proj.ProjectionLike} projection Projection.
* @param {ol.ProjectionLike} projection Projection.
* @param {ol.tilegrid.TileGrid} tilegrid Tile grid to use for the projection.
* @api
*/

View File

@@ -108,7 +108,7 @@ ol.inherits(ol.source.TileWMS, ol.source.TileImage);
* constructed.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {number} resolution Resolution.
* @param {ol.proj.ProjectionLike} projection Projection.
* @param {ol.ProjectionLike} projection Projection.
* @param {!Object} params GetFeatureInfo params. `INFO_FORMAT` at least should
* be provided. If `QUERY_LAYERS` is not provided then the layers specified
* in the `LAYERS` parameter will be used. `VERSION` should not be

View File

@@ -155,7 +155,7 @@ ol.source.Vector = function(opt_options) {
/**
* @private
* @type {Object.<string, Array.<ol.events.Key>>}
* @type {Object.<string, Array.<ol.EventsKey>>}
*/
this.featureChangeKeys_ = {};

View File

@@ -75,17 +75,17 @@ ol.style.AtlasManager = function(opt_options) {
/**
* @param {string} id The identifier of the entry to check.
* @return {?ol.style.AtlasManagerInfo} The position and atlas image for the
* @return {?ol.AtlasManagerInfo} The position and atlas image for the
* entry, or `null` if the entry is not part of the atlas manager.
*/
ol.style.AtlasManager.prototype.getInfo = function(id) {
/** @type {?ol.style.AtlasInfo} */
/** @type {?ol.AtlasInfo} */
var info = this.getInfo_(this.atlases_, id);
if (!info) {
return null;
}
/** @type {?ol.style.AtlasInfo} */
/** @type {?ol.AtlasInfo} */
var hitInfo = this.getInfo_(this.hitAtlases_, id);
goog.asserts.assert(hitInfo, 'hitInfo must not be null');
@@ -97,7 +97,7 @@ ol.style.AtlasManager.prototype.getInfo = function(id) {
* @private
* @param {Array.<ol.style.Atlas>} atlases The atlases to search.
* @param {string} id The identifier of the entry to check.
* @return {?ol.style.AtlasInfo} The position and atlas image for the entry,
* @return {?ol.AtlasInfo} The position and atlas image for the entry,
* or `null` if the entry is not part of the atlases.
*/
ol.style.AtlasManager.prototype.getInfo_ = function(atlases, id) {
@@ -115,10 +115,10 @@ ol.style.AtlasManager.prototype.getInfo_ = function(atlases, id) {
/**
* @private
* @param {ol.style.AtlasInfo} info The info for the real image.
* @param {ol.style.AtlasInfo} hitInfo The info for the hit-detection
* @param {ol.AtlasInfo} info The info for the real image.
* @param {ol.AtlasInfo} hitInfo The info for the hit-detection
* image.
* @return {?ol.style.AtlasManagerInfo} The position and atlas image for the
* @return {?ol.AtlasManagerInfo} The position and atlas image for the
* entry, or `null` if the entry is not part of the atlases.
*/
ol.style.AtlasManager.prototype.mergeInfos_ = function(info, hitInfo) {
@@ -126,7 +126,7 @@ ol.style.AtlasManager.prototype.mergeInfos_ = function(info, hitInfo) {
'in order to merge, offsetX of info and hitInfo must be equal');
goog.asserts.assert(info.offsetY === hitInfo.offsetY,
'in order to merge, offsetY of info and hitInfo must be equal');
return /** @type {ol.style.AtlasManagerInfo} */ ({
return /** @type {ol.AtlasManagerInfo} */ ({
offsetX: info.offsetX,
offsetY: info.offsetY,
image: info.image,
@@ -154,7 +154,7 @@ ol.style.AtlasManager.prototype.mergeInfos_ = function(info, hitInfo) {
* detection atlas image.
* @param {Object=} opt_this Value to use as `this` when executing
* `renderCallback` and `renderHitCallback`.
* @return {?ol.style.AtlasManagerInfo} The position and atlas image for the
* @return {?ol.AtlasManagerInfo} The position and atlas image for the
* entry, or `null` if the image is too big.
*/
ol.style.AtlasManager.prototype.add = function(id, width, height,
@@ -164,7 +164,7 @@ ol.style.AtlasManager.prototype.add = function(id, width, height,
return null;
}
/** @type {?ol.style.AtlasInfo} */
/** @type {?ol.AtlasInfo} */
var info = this.add_(false,
id, width, height, renderCallback, opt_this);
if (!info) {
@@ -177,7 +177,7 @@ ol.style.AtlasManager.prototype.add = function(id, width, height,
var renderHitCallback = opt_renderHitCallback !== undefined ?
opt_renderHitCallback : ol.nullFunction
/** @type {?ol.style.AtlasInfo} */
/** @type {?ol.AtlasInfo} */
var hitInfo = this.add_(true,
id, width, height, renderHitCallback, opt_this);
goog.asserts.assert(hitInfo, 'hitInfo must not be null');
@@ -196,7 +196,7 @@ ol.style.AtlasManager.prototype.add = function(id, width, height,
* Called to render the new image onto an atlas image.
* @param {Object=} opt_this Value to use as `this` when executing
* `renderCallback` and `renderHitCallback`.
* @return {?ol.style.AtlasInfo} The position and atlas image for the entry,
* @return {?ol.AtlasInfo} The position and atlas image for the entry,
* or `null` if the image is too big.
*/
ol.style.AtlasManager.prototype.add_ = function(isHitAtlas, id, width, height,
@@ -256,13 +256,13 @@ ol.style.Atlas = function(size, space) {
/**
* @private
* @type {Array.<ol.style.AtlasBlock>}
* @type {Array.<ol.AtlasBlock>}
*/
this.emptyBlocks_ = [{x: 0, y: 0, width: size, height: size}];
/**
* @private
* @type {Object.<string, ol.style.AtlasInfo>}
* @type {Object.<string, ol.AtlasInfo>}
*/
this.entries_ = {};
@@ -282,7 +282,7 @@ ol.style.Atlas = function(size, space) {
/**
* @param {string} id The identifier of the entry to check.
* @return {?ol.style.AtlasInfo} The atlas info.
* @return {?ol.AtlasInfo} The atlas info.
*/
ol.style.Atlas.prototype.get = function(id) {
return this.entries_[id] || null;
@@ -297,7 +297,7 @@ ol.style.Atlas.prototype.get = function(id) {
* Called to render the new image onto an atlas image.
* @param {Object=} opt_this Value to use as `this` when executing
* `renderCallback`.
* @return {?ol.style.AtlasInfo} The position and atlas image for the entry.
* @return {?ol.AtlasInfo} The position and atlas image for the entry.
*/
ol.style.Atlas.prototype.add = function(id, width, height, renderCallback, opt_this) {
var block, i, ii;
@@ -332,7 +332,7 @@ ol.style.Atlas.prototype.add = function(id, width, height, renderCallback, opt_t
/**
* @private
* @param {number} index The index of the block.
* @param {ol.style.AtlasBlock} block The block to split.
* @param {ol.AtlasBlock} block The block to split.
* @param {number} width The width of the entry to insert.
* @param {number} height The height of the entry to insert.
*/
@@ -340,9 +340,9 @@ ol.style.Atlas.prototype.split_ = function(index, block, width, height) {
var deltaWidth = block.width - width;
var deltaHeight = block.height - height;
/** @type {ol.style.AtlasBlock} */
/** @type {ol.AtlasBlock} */
var newBlock1;
/** @type {ol.style.AtlasBlock} */
/** @type {ol.AtlasBlock} */
var newBlock2;
if (deltaWidth > deltaHeight) {
@@ -391,8 +391,8 @@ ol.style.Atlas.prototype.split_ = function(index, block, width, height) {
* blocks (that are potentially smaller) are filled first.
* @private
* @param {number} index The index of the block to remove.
* @param {ol.style.AtlasBlock} newBlock1 The 1st block to add.
* @param {ol.style.AtlasBlock} newBlock2 The 2nd block to add.
* @param {ol.AtlasBlock} newBlock1 The 1st block to add.
* @param {ol.AtlasBlock} newBlock2 The 2nd block to add.
*/
ol.style.Atlas.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) {
var args = [index, 1];

View File

@@ -252,7 +252,7 @@ ol.style.Circle.prototype.render_ = function(atlasManager) {
var size = 2 * (this.radius_ + strokeWidth) + 1;
/** @type {ol.style.CircleRenderOptions} */
/** @type {ol.CircleRenderOptions} */
var renderOptions = {
strokeStyle: strokeStyle,
strokeWidth: strokeWidth,
@@ -313,7 +313,7 @@ ol.style.Circle.prototype.render_ = function(atlasManager) {
/**
* @private
* @param {ol.style.CircleRenderOptions} renderOptions Render options.
* @param {ol.CircleRenderOptions} renderOptions Render options.
* @param {CanvasRenderingContext2D} context The rendering context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).
@@ -348,7 +348,7 @@ ol.style.Circle.prototype.draw_ = function(renderOptions, context, x, y) {
/**
* @private
* @param {ol.style.CircleRenderOptions} renderOptions Render options.
* @param {ol.CircleRenderOptions} renderOptions Render options.
*/
ol.style.Circle.prototype.createHitDetectionCanvas_ = function(renderOptions) {
this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size];
@@ -368,7 +368,7 @@ ol.style.Circle.prototype.createHitDetectionCanvas_ = function(renderOptions) {
/**
* @private
* @param {ol.style.CircleRenderOptions} renderOptions Render options.
* @param {ol.CircleRenderOptions} renderOptions Render options.
* @param {CanvasRenderingContext2D} context The context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).

View File

@@ -414,7 +414,7 @@ ol.style.IconImage_ = function(image, src, size, crossOrigin, imageState,
/**
* @private
* @type {Array.<ol.events.Key>}
* @type {Array.<ol.EventsKey>}
*/
this.imageListenerKeys_ = null;

View File

@@ -20,7 +20,7 @@ ol.style.ImageState = {
* {@link ol.style.RegularShape}.
*
* @constructor
* @param {ol.style.ImageOptions} options Options.
* @param {ol.StyleImageOptions} options Options.
* @api
*/
ol.style.Image = function(options) {
@@ -223,7 +223,7 @@ ol.style.Image.prototype.setSnapToPixel = function(snapToPixel) {
/**
* @param {function(this: T, ol.events.Event)} listener Listener function.
* @param {T} thisArg Value to use as `this` when executing `listener`.
* @return {ol.events.Key|undefined} Listener key.
* @return {ol.EventsKey|undefined} Listener key.
* @template T
*/
ol.style.Image.prototype.listenImageChange = goog.abstractMethod;

View File

@@ -328,7 +328,7 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
var size = 2 * (this.radius_ + strokeWidth) + 1;
/** @type {ol.style.RegularShapeRenderOptions} */
/** @type {ol.RegularShapeRenderOptions} */
var renderOptions = {
strokeStyle: strokeStyle,
strokeWidth: strokeWidth,
@@ -391,7 +391,7 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
/**
* @private
* @param {ol.style.RegularShapeRenderOptions} renderOptions Render options.
* @param {ol.RegularShapeRenderOptions} renderOptions Render options.
* @param {CanvasRenderingContext2D} context The rendering context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).
@@ -436,7 +436,7 @@ ol.style.RegularShape.prototype.draw_ = function(renderOptions, context, x, y) {
/**
* @private
* @param {ol.style.RegularShapeRenderOptions} renderOptions Render options.
* @param {ol.RegularShapeRenderOptions} renderOptions Render options.
*/
ol.style.RegularShape.prototype.createHitDetectionCanvas_ = function(renderOptions) {
this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size];
@@ -456,7 +456,7 @@ ol.style.RegularShape.prototype.createHitDetectionCanvas_ = function(renderOptio
/**
* @private
* @param {ol.style.RegularShapeRenderOptions} renderOptions Render options.
* @param {ol.RegularShapeRenderOptions} renderOptions Render options.
* @param {CanvasRenderingContext2D} context The context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).

View File

@@ -27,13 +27,13 @@ ol.style.Style = function(opt_options) {
/**
* @private
* @type {string|ol.geom.Geometry|ol.style.GeometryFunction}
* @type {string|ol.geom.Geometry|ol.StyleGeometryFunction}
*/
this.geometry_ = null;
/**
* @private
* @type {!ol.style.GeometryFunction}
* @type {!ol.StyleGeometryFunction}
*/
this.geometryFunction_ = ol.style.defaultGeometryFunction;
@@ -76,7 +76,7 @@ ol.style.Style = function(opt_options) {
/**
* Get the geometry to be rendered.
* @return {string|ol.geom.Geometry|ol.style.GeometryFunction}
* @return {string|ol.geom.Geometry|ol.StyleGeometryFunction}
* Feature property or geometry or function that returns the geometry that will
* be rendered with this style.
* @api
@@ -88,7 +88,7 @@ ol.style.Style.prototype.getGeometry = function() {
/**
* Get the function used to generate a geometry for rendering.
* @return {!ol.style.GeometryFunction} Function that is called with a feature
* @return {!ol.StyleGeometryFunction} Function that is called with a feature
* and returns the geometry to render instead of the feature's geometry.
* @api
*/
@@ -150,7 +150,7 @@ ol.style.Style.prototype.getZIndex = function() {
/**
* Set a geometry that is rendered instead of the feature's geometry.
*
* @param {string|ol.geom.Geometry|ol.style.GeometryFunction} geometry
* @param {string|ol.geom.Geometry|ol.StyleGeometryFunction} geometry
* Feature property or geometry or function returning a geometry to render
* for this style.
* @api
@@ -195,9 +195,9 @@ ol.style.Style.prototype.setZIndex = function(zIndex) {
* Convert the provided object into a style function. Functions passed through
* unchanged. Arrays of ol.style.Style or single style objects wrapped in a
* new style function.
* @param {ol.style.StyleFunction|Array.<ol.style.Style>|ol.style.Style} obj
* @param {ol.StyleFunction|Array.<ol.style.Style>|ol.style.Style} obj
* A style function, a single style, or an array of styles.
* @return {ol.style.StyleFunction} A style function.
* @return {ol.StyleFunction} A style function.
*/
ol.style.createStyleFunction = function(obj) {
var styleFunction;

View File

@@ -589,7 +589,7 @@ ol.tilegrid.resolutionsFromExtent = function(extent, opt_maxZoom, opt_tileSize)
/**
* @param {ol.proj.ProjectionLike} projection Projection.
* @param {ol.ProjectionLike} projection Projection.
* @param {number=} opt_maxZoom Maximum zoom level (default is
* ol.DEFAULT_MAX_ZOOM).
* @param {ol.Size=} opt_tileSize Tile size (default uses ol.DEFAULT_TILE_SIZE).
@@ -607,7 +607,7 @@ ol.tilegrid.createForProjection = function(projection, opt_maxZoom, opt_tileSize
/**
* Generate a tile grid extent from a projection. If the projection has an
* extent, it is used. If not, a global extent is assumed.
* @param {ol.proj.ProjectionLike} projection Projection.
* @param {ol.ProjectionLike} projection Projection.
* @return {ol.Extent} Extent.
*/
ol.tilegrid.extentFromProjection = function(projection) {

View File

@@ -10,23 +10,40 @@
* in type-defining comments used by the Closure compiler, and so should not
* appear in module code.
*
* When the code is converted to ES6 modules, the namespace structure will
* disappear, and these typedefs will have to be renamed accordingly, but the
* namespace structure is maintained for the present for backwards compatibility.
* They are now all in the `ol` namespace.
*
* In principle, typedefs should not have a `goog.provide` nor should files which
* refer to a typedef in comments need a `goog.require`. However, goog.provides
* are needed for 2 cases, both to prevent compiler errors/warnings:
* - the 1st two for specific errors
* - each sub-namespace needs at least one so the namespace is created when not
* used in the code, as when application code is compiled with the library.
* are needed for 2 cases, both to prevent compiler errors/warnings.
*/
goog.provide('ol.Extent');
goog.provide('ol.events.EventTargetLike');
goog.provide('ol.EventTargetLike');
goog.provide('ol.interaction.DragBoxEndConditionType');
goog.provide('ol.proj.ProjectionLike');
goog.provide('ol.style.AtlasBlock');
/**
* @typedef {{x: number, y: number, width: number, height: number}}
*/
ol.AtlasBlock;
/**
* Provides information for an image inside an atlas.
* `offsetX` and `offsetY` are the position of the image inside
* the atlas image `image`.
* @typedef {{offsetX: number, offsetY: number, image: HTMLCanvasElement}}
*/
ol.AtlasInfo;
/**
* Provides information for an image inside an atlas manager.
* `offsetX` and `offsetY` is the position of the image inside
* the atlas image `image` and the position of the hit-detection image
* inside the hit-detection atlas image `hitImage`.
* @typedef {{offsetX: number, offsetY: number, image: HTMLCanvasElement,
* hitImage: HTMLCanvasElement}}
*/
ol.AtlasManagerInfo;
/**
@@ -81,6 +98,13 @@ ol.CanvasTextState;
ol.CenterConstraintType;
/**
* @typedef {{strokeStyle: (string|undefined), strokeWidth: number,
* size: number, lineDash: Array.<number>}}
*/
ol.CircleRenderOptions;
/**
* A color represented as a short array [red, green, blue, alpha].
* red, green, and blue should be integers in the range 0..255 inclusive.
@@ -116,6 +140,68 @@ ol.Coordinate;
ol.CoordinateFormatType;
/**
* A function that takes a {@link ol.MapBrowserEvent} and two
* {@link ol.Pixel}s and returns a `{boolean}`. If the condition is met,
* true should be returned.
* @typedef {function(ol.MapBrowserEvent, ol.Pixel, ol.Pixel):boolean}
*/
ol.DragBoxEndConditionType;
/**
* Function that takes coordinates and an optional existing geometry as
* arguments, and returns a geometry. The optional existing geometry is the
* geometry that is returned when the function is called without a second
* argument.
* @typedef {function(!(ol.Coordinate|Array.<ol.Coordinate>|
* Array.<Array.<ol.Coordinate>>), ol.geom.SimpleGeometry=):
* ol.geom.SimpleGeometry}
*/
ol.DrawGeometryFunctionType;
/**
* @typedef {EventTarget|ol.events.EventTarget|
* {addEventListener: function(string, Function, boolean=),
* removeEventListener: function(string, Function, boolean=),
* dispatchEvent: function(string)}}
*/
ol.EventTargetLike;
/**
* A function that takes an {@link ol.MapBrowserEvent} and returns a
* `{boolean}`. If the condition is met, true should be returned.
*
* @typedef {function(ol.MapBrowserEvent): boolean}
*/
ol.EventsConditionType;
/**
* Key to use with {@link ol.Observable#unByKey}.
*
* @typedef {{bindTo: (Object|undefined),
* boundListener: (ol.EventsListenerFunctionType|undefined),
* callOnce: boolean,
* deleteIndex: (number|undefined),
* listener: ol.EventsListenerFunctionType,
* target: (EventTarget|ol.events.EventTarget),
* type: string}}
*/
ol.EventsKey;
/**
* Listener function. This function is called with an event object as argument.
* When the function returns `false`, event propagation will stop.
*
* @typedef {function(ol.events.Event)|function(ol.events.Event): boolean}
*/
ol.EventsListenerFunctionType;
/**
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
* @typedef {Array.<number>}
@@ -252,6 +338,16 @@ ol.LRUCacheEntry;
ol.MapOptionsInternal;
/**
* @typedef {{depth: (Array.<number>|undefined),
* feature: ol.Feature,
* geometry: ol.geom.SimpleGeometry,
* index: (number|undefined),
* segment: Array.<ol.Extent>}}
*/
ol.ModifySegmentDataType;
/**
* An array with two elements, representing a pixel. The first element is the
* x-coordinate, the second the y-coordinate of the pixel.
@@ -276,6 +372,14 @@ ol.PostRenderFunction;
ol.PreRenderFunction;
/**
* A projection as {@link ol.proj.Projection}, SRS identifier string or
* undefined.
* @typedef {ol.proj.Projection|string|undefined} ol.ProjectionLike
*/
ol.ProjectionLike;
/**
* A function that takes an array of input data, performs some operation, and
* returns an array of ouput data.
@@ -296,6 +400,20 @@ ol.PreRenderFunction;
ol.RasterOperation;
/**
* @typedef {{
* strokeStyle: (string|undefined),
* strokeWidth: number,
* size: number,
* lineCap: string,
* lineDash: Array.<number>,
* lineJoin: string,
* miterLimit: number
* }}
*/
ol.RegularShapeRenderOptions;
/**
* @typedef {function(ol.Extent, number, number) : ol.ImageBase}
*/
@@ -329,6 +447,16 @@ ol.ResolutionConstraintType;
ol.RotationConstraintType;
/**
* A function that takes an {@link ol.Feature} or {@link ol.render.Feature} and
* an {@link ol.layer.Layer} and returns `true` if the feature may be selected
* or `false` otherwise.
* @typedef {function((ol.Feature|ol.render.Feature), ol.layer.Layer):
* boolean}
*/
ol.SelectFilterFunction;
/**
* An array of numbers representing a size: `[width, height]`.
* @typedef {Array.<number>}
@@ -336,11 +464,30 @@ ol.RotationConstraintType;
ol.Size;
/**
* @typedef {{
* snapped: {boolean},
* vertex: (ol.Coordinate|null),
* vertexPixel: (ol.Pixel|null)
* }}
*/
ol.SnapResultType;
/**
* @typedef {{
* feature: ol.Feature,
* segment: Array.<ol.Coordinate>
* }}
*/
ol.SnapSegmentDataType;
/**
* @typedef {{attributions: (ol.AttributionLike|undefined),
* extent: (null|ol.Extent|undefined),
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
* projection: ol.ProjectionLike,
* resolutions: (Array.<number>|undefined),
* state: (ol.source.State|undefined)}}
*/
@@ -358,7 +505,7 @@ ol.SourceRasterRenderedState;
/**
* @typedef {{attributions: (ol.AttributionLike|undefined),
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
* projection: ol.ProjectionLike,
* state: (ol.source.State|undefined),
* wrapX: (boolean|undefined)}}
*/
@@ -372,7 +519,7 @@ ol.SourceSourceOptions;
* logo: (string|olx.LogoOptions|undefined),
* opaque: (boolean|undefined),
* tilePixelRatio: (number|undefined),
* projection: ol.proj.ProjectionLike,
* projection: ol.ProjectionLike,
* state: (ol.source.State|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),
* wrapX: (boolean|undefined)}}
@@ -386,7 +533,7 @@ ol.SourceTileOptions;
* extent: (ol.Extent|undefined),
* logo: (string|olx.LogoOptions|undefined),
* opaque: (boolean|undefined),
* projection: ol.proj.ProjectionLike,
* projection: ol.ProjectionLike,
* state: (ol.source.State|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),
* tileLoadFunction: ol.TileLoadFunctionType,
@@ -399,6 +546,37 @@ ol.SourceTileOptions;
ol.SourceUrlTileOptions;
/**
* A function that takes an {@link ol.Feature} and a `{number}` representing
* the view's resolution. The function should return a {@link ol.style.Style}
* or an array of them. This way e.g. a vector layer can be styled.
*
* @typedef {function((ol.Feature|ol.render.Feature), number):
* (ol.style.Style|Array.<ol.style.Style>)}
*/
ol.StyleFunction;
/**
* A function that takes an {@link ol.Feature} as argument and returns an
* {@link ol.geom.Geometry} that will be rendered and styled for the feature.
*
* @typedef {function((ol.Feature|ol.render.Feature)):
* (ol.geom.Geometry|ol.render.Feature|undefined)}
*/
ol.StyleGeometryFunction;
/**
* @typedef {{opacity: number,
* rotateWithView: boolean,
* rotation: number,
* scale: number,
* snapToPixel: boolean}}
*/
ol.StyleImageOptions;
/**
* An array of three numbers representing the location of a tile in a tile
* grid. The order is `z`, `x`, and `y`. `z` is the zoom level.
@@ -517,190 +695,3 @@ ol.XmlParser;
* @typedef {function(Node, *, Array.<*>)}
*/
ol.XmlSerializer;
/**
* A function that takes an {@link ol.MapBrowserEvent} and returns a
* `{boolean}`. If the condition is met, true should be returned.
*
* @typedef {function(ol.MapBrowserEvent): boolean}
*/
ol.events.ConditionType;
/**
* @typedef {EventTarget|ol.events.EventTarget|
* {addEventListener: function(string, Function, boolean=),
* removeEventListener: function(string, Function, boolean=),
* dispatchEvent: function(string)}}
*/
ol.events.EventTargetLike;
/**
* Key to use with {@link ol.Observable#unByKey}.
*
* @typedef {{bindTo: (Object|undefined),
* boundListener: (ol.events.ListenerFunctionType|undefined),
* callOnce: boolean,
* deleteIndex: (number|undefined),
* listener: ol.events.ListenerFunctionType,
* target: (EventTarget|ol.events.EventTarget),
* type: string}}
*/
ol.events.Key;
/**
* Listener function. This function is called with an event object as argument.
* When the function returns `false`, event propagation will stop.
*
* @typedef {function(ol.events.Event)|function(ol.events.Event): boolean}
*/
ol.events.ListenerFunctionType;
/**
* A function that takes a {@link ol.MapBrowserEvent} and two
* {@link ol.Pixel}s and returns a `{boolean}`. If the condition is met,
* true should be returned.
* @typedef {function(ol.MapBrowserEvent, ol.Pixel, ol.Pixel):boolean}
*/
ol.interaction.DragBoxEndConditionType;
/**
* Function that takes coordinates and an optional existing geometry as
* arguments, and returns a geometry. The optional existing geometry is the
* geometry that is returned when the function is called without a second
* argument.
* @typedef {function(!(ol.Coordinate|Array.<ol.Coordinate>|
* Array.<Array.<ol.Coordinate>>), ol.geom.SimpleGeometry=):
* ol.geom.SimpleGeometry}
*/
ol.interaction.DrawGeometryFunctionType;
/**
* @typedef {{depth: (Array.<number>|undefined),
* feature: ol.Feature,
* geometry: ol.geom.SimpleGeometry,
* index: (number|undefined),
* segment: Array.<ol.Extent>}}
*/
ol.interaction.SegmentDataType;
/**
* A function that takes an {@link ol.Feature} or {@link ol.render.Feature} and
* an {@link ol.layer.Layer} and returns `true` if the feature may be selected
* or `false` otherwise.
* @typedef {function((ol.Feature|ol.render.Feature), ol.layer.Layer):
* boolean}
*/
ol.interaction.SelectFilterFunction;
/**
* @typedef {{
* snapped: {boolean},
* vertex: (ol.Coordinate|null),
* vertexPixel: (ol.Pixel|null)
* }}
*/
ol.interaction.SnapResultType;
/**
* @typedef {{
* feature: ol.Feature,
* segment: Array.<ol.Coordinate>
* }}
*/
ol.interaction.SnapSegmentDataType;
/**
* A projection as {@link ol.proj.Projection}, SRS identifier string or
* undefined.
* @typedef {ol.proj.Projection|string|undefined} ol.proj.ProjectionLike
*/
ol.proj.ProjectionLike;
/**
* @typedef {{x: number, y: number, width: number, height: number}}
*/
ol.style.AtlasBlock;
/**
* Provides information for an image inside an atlas.
* `offsetX` and `offsetY` are the position of the image inside
* the atlas image `image`.
* @typedef {{offsetX: number, offsetY: number, image: HTMLCanvasElement}}
*/
ol.style.AtlasInfo;
/**
* Provides information for an image inside an atlas manager.
* `offsetX` and `offsetY` is the position of the image inside
* the atlas image `image` and the position of the hit-detection image
* inside the hit-detection atlas image `hitImage`.
* @typedef {{offsetX: number, offsetY: number, image: HTMLCanvasElement,
* hitImage: HTMLCanvasElement}}
*/
ol.style.AtlasManagerInfo;
/**
* @typedef {{strokeStyle: (string|undefined), strokeWidth: number,
* size: number, lineDash: Array.<number>}}
*/
ol.style.CircleRenderOptions;
/**
* @typedef {{opacity: number,
* rotateWithView: boolean,
* rotation: number,
* scale: number,
* snapToPixel: boolean}}
*/
ol.style.ImageOptions;
/**
* A function that takes an {@link ol.Feature} as argument and returns an
* {@link ol.geom.Geometry} that will be rendered and styled for the feature.
*
* @typedef {function((ol.Feature|ol.render.Feature)):
* (ol.geom.Geometry|ol.render.Feature|undefined)}
*/
ol.style.GeometryFunction;
/**
* @typedef {{
* strokeStyle: (string|undefined),
* strokeWidth: number,
* size: number,
* lineCap: string,
* lineDash: Array.<number>,
* lineJoin: string,
* miterLimit: number
* }}
*/
ol.style.RegularShapeRenderOptions;
/**
* A function that takes an {@link ol.Feature} and a `{number}` representing
* the view's resolution. The function should return a {@link ol.style.Style}
* or an array of them. This way e.g. a vector layer can be styled.
*
* @typedef {function((ol.Feature|ol.render.Feature), number):
* (ol.style.Style|Array.<ol.style.Style>)}
*/
ol.style.StyleFunction;