Stricter typing for ol.Collection
This commit is contained in:
@@ -15,7 +15,7 @@ goog.require('ol.control.Zoom');
|
||||
* * {@link ol.control.Attribution}
|
||||
*
|
||||
* @param {olx.control.DefaultsOptions=} opt_options Defaults options.
|
||||
* @return {ol.Collection} Controls.
|
||||
* @return {ol.Collection.<ol.control.Control>} Controls.
|
||||
* @api
|
||||
*/
|
||||
ol.control.defaults = function(opt_options) {
|
||||
|
||||
@@ -33,7 +33,7 @@ ol.FeatureOverlay = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Collection}
|
||||
* @type {ol.Collection.<ol.Feature>}
|
||||
*/
|
||||
this.features_ = null;
|
||||
|
||||
@@ -104,7 +104,7 @@ ol.FeatureOverlay.prototype.addFeature = function(feature) {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Collection} Features collection.
|
||||
* @return {ol.Collection.<ol.Feature>} Features collection.
|
||||
* @api
|
||||
*/
|
||||
ol.FeatureOverlay.prototype.getFeatures = function() {
|
||||
@@ -212,7 +212,7 @@ ol.FeatureOverlay.prototype.render_ = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Collection} features Features collection.
|
||||
* @param {ol.Collection.<ol.Feature>} features Features collection.
|
||||
* @api
|
||||
*/
|
||||
ol.FeatureOverlay.prototype.setFeatures = function(features) {
|
||||
|
||||
@@ -95,7 +95,7 @@ ol.interaction.Draw = function(options) {
|
||||
|
||||
/**
|
||||
* Target collection for drawn features.
|
||||
* @type {ol.Collection}
|
||||
* @type {ol.Collection.<ol.Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = goog.isDef(options.features) ? options.features : null;
|
||||
|
||||
@@ -35,8 +35,8 @@ goog.require('ol.interaction.PinchZoom');
|
||||
* should be excluded if you want a build with no vector support.
|
||||
*
|
||||
* @param {olx.interaction.DefaultsOptions=} opt_options Defaults options.
|
||||
* @return {ol.Collection} A collection of interactions to be used with
|
||||
* the ol.Map constructor's interactions option.
|
||||
* @return {ol.Collection.<ol.interaction.Interaction>} A collection of
|
||||
* interactions to be used with the ol.Map constructor's interactions option.
|
||||
* @api stable
|
||||
*/
|
||||
ol.interaction.defaults = function(opt_options) {
|
||||
|
||||
@@ -133,7 +133,7 @@ ol.interaction.Modify = function(options) {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {ol.Collection}
|
||||
* @type {ol.Collection.<ol.Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = options.features;
|
||||
|
||||
@@ -106,7 +106,7 @@ goog.inherits(ol.interaction.Select, ol.interaction.Interaction);
|
||||
|
||||
/**
|
||||
* Get the selected features.
|
||||
* @return {ol.Collection} Features collection.
|
||||
* @return {ol.Collection.<ol.Feature>} Features collection.
|
||||
* @api stable
|
||||
*/
|
||||
ol.interaction.Select.prototype.getFeatures = function() {
|
||||
|
||||
@@ -145,12 +145,12 @@ ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Collection|undefined} Collection of {@link ol.layer.Layer layers}
|
||||
* that are part of this group.
|
||||
* @return {ol.Collection.<ol.layer.Base>|undefined} Collection of
|
||||
* {@link ol.layer.Layer layers} that are part of this group.
|
||||
* @observable
|
||||
*/
|
||||
ol.layer.Group.prototype.getLayers = function() {
|
||||
return /** @type {ol.Collection|undefined} */ (this.get(
|
||||
return /** @type {ol.Collection.<ol.layer.Base>|undefined} */ (this.get(
|
||||
ol.layer.GroupProperty.LAYERS));
|
||||
};
|
||||
goog.exportProperty(
|
||||
@@ -160,7 +160,7 @@ goog.exportProperty(
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Collection|undefined} layers Collection of
|
||||
* @param {ol.Collection.<ol.layer.Base>|undefined} layers Collection of
|
||||
* {@link ol.layer.Layer layers} that are part of this group.
|
||||
* @observable
|
||||
*/
|
||||
|
||||
+10
-10
@@ -296,7 +296,7 @@ ol.Map = function(options) {
|
||||
this.registerDisposable(mouseWheelHandler);
|
||||
|
||||
/**
|
||||
* @type {ol.Collection}
|
||||
* @type {ol.Collection.<ol.control.Control>}
|
||||
* @private
|
||||
*/
|
||||
this.controls_ = optionsInternal.controls;
|
||||
@@ -308,13 +308,13 @@ ol.Map = function(options) {
|
||||
this.deviceOptions_ = optionsInternal.deviceOptions;
|
||||
|
||||
/**
|
||||
* @type {ol.Collection}
|
||||
* @type {ol.Collection.<ol.interaction.Interaction>}
|
||||
* @private
|
||||
*/
|
||||
this.interactions_ = optionsInternal.interactions;
|
||||
|
||||
/**
|
||||
* @type {ol.Collection}
|
||||
* @type {ol.Collection.<ol.Overlay>}
|
||||
* @private
|
||||
*/
|
||||
this.overlays_ = optionsInternal.overlays;
|
||||
@@ -653,7 +653,7 @@ ol.Map.prototype.getCoordinateFromPixel = function(pixel) {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Collection} Controls.
|
||||
* @return {ol.Collection.<ol.control.Control>} Controls.
|
||||
* @api stable
|
||||
*/
|
||||
ol.Map.prototype.getControls = function() {
|
||||
@@ -662,7 +662,7 @@ ol.Map.prototype.getControls = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Collection} Overlays.
|
||||
* @return {ol.Collection.<ol.Overlay>} Overlays.
|
||||
* @api stable
|
||||
*/
|
||||
ol.Map.prototype.getOverlays = function() {
|
||||
@@ -676,7 +676,7 @@ ol.Map.prototype.getOverlays = function() {
|
||||
* associated with the map.
|
||||
*
|
||||
* Interactions are used for e.g. pan, zoom and rotate.
|
||||
* @return {ol.Collection} {@link ol.interaction.Interaction Interactions}.
|
||||
* @return {ol.Collection.<ol.interaction.Interaction>} Interactions.
|
||||
* @api stable
|
||||
*/
|
||||
ol.Map.prototype.getInteractions = function() {
|
||||
@@ -701,7 +701,7 @@ goog.exportProperty(
|
||||
|
||||
/**
|
||||
* Get the collection of layers associated with this map.
|
||||
* @return {ol.Collection|undefined} Layers.
|
||||
* @return {ol.Collection.<ol.layer.Base>|undefined} Layers.
|
||||
* @api stable
|
||||
*/
|
||||
ol.Map.prototype.getLayers = function() {
|
||||
@@ -1377,12 +1377,12 @@ ol.Map.prototype.unskipFeature = function(feature) {
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{controls: ol.Collection,
|
||||
* @typedef {{controls: ol.Collection.<ol.control.Control>,
|
||||
* deviceOptions: olx.DeviceOptions,
|
||||
* interactions: ol.Collection,
|
||||
* interactions: ol.Collection.<ol.interaction.Interaction>,
|
||||
* keyboardEventTarget: (Element|Document),
|
||||
* logos: Object,
|
||||
* overlays: ol.Collection,
|
||||
* overlays: ol.Collection.<ol.Overlay>,
|
||||
* rendererConstructor:
|
||||
* function(new: ol.renderer.Map, Element, ol.Map),
|
||||
* values: Object.<string, *>}}
|
||||
|
||||
Reference in New Issue
Block a user