Feature docs

This commit is contained in:
Tim Schaub
2015-04-04 11:04:51 +02:00
parent 044ea054b1
commit 16c6ccf40c
+26 -24
View File
@@ -137,10 +137,10 @@ ol.Feature.prototype.clone = function() {
/** /**
* @return {ol.geom.Geometry|undefined} Returns the Geometry associated * Get the feature's default geometry. A feature may have any number of named
* with this feature using the current geometry name property. By * geometries. The "default" geometry (the one that is rendered by default) is
* default, this is `geometry` but it may be changed by calling * set when calling {@link ol.Feature#setGeometry}.
* `setGeometryName`. * @return {ol.geom.Geometry|undefined} The default geometry for the feature.
* @api stable * @api stable
* @observable * @observable
*/ */
@@ -164,9 +164,10 @@ ol.Feature.prototype.getId = function() {
/** /**
* @return {string} Get the property name associated with the geometry for * Get the name of the feature's default geometry. By default, the default
* this feature. By default, this is `geometry` but it may be changed by * geometry is named `geometry`.
* calling `setGeometryName`. * @return {string} Get the property name associated with the default geometry
* for this feature.
* @api stable * @api stable
*/ */
ol.Feature.prototype.getGeometryName = function() { ol.Feature.prototype.getGeometryName = function() {
@@ -175,11 +176,10 @@ ol.Feature.prototype.getGeometryName = function() {
/** /**
* Get the feature's style. This return for this method depends on what was
* provided to the {@link ol.Feature#setStyle} method.
* @return {ol.style.Style|Array.<ol.style.Style>| * @return {ol.style.Style|Array.<ol.style.Style>|
* ol.feature.FeatureStyleFunction} Return the style as set by `setStyle` * ol.feature.FeatureStyleFunction} The feature style.
* in the same format that it was provided in. If `setStyle` has not been
* called, or if it was called with `null`, then `getStyle()` will return
* `null`.
* @api stable * @api stable
*/ */
ol.Feature.prototype.getStyle = function() { ol.Feature.prototype.getStyle = function() {
@@ -188,6 +188,7 @@ ol.Feature.prototype.getStyle = function() {
/** /**
* Get the feature's style function.
* @return {ol.feature.FeatureStyleFunction|undefined} Return a function * @return {ol.feature.FeatureStyleFunction|undefined} Return a function
* representing the current style of this feature. * representing the current style of this feature.
* @api stable * @api stable
@@ -223,10 +224,9 @@ ol.Feature.prototype.handleGeometryChanged_ = function() {
/** /**
* @param {ol.geom.Geometry|undefined} geometry Set the geometry for this * Set the default geometry for the feature. This will update the property
* feature. This will update the property associated with the current * with the name returned by {@link ol.Feature#getGeometryName}.
* geometry property name. By default, this is `geometry` but it can be * @param {ol.geom.Geometry|undefined} geometry The new geometry.
* changed by calling `setGeometryName`.
* @api stable * @api stable
* @observable * @observable
*/ */
@@ -256,9 +256,11 @@ ol.Feature.prototype.setStyle = function(style) {
/** /**
* @param {number|string|undefined} id Set a unique id for this feature. * Set the feature id. The feature id is considered stable and may be used when
* The id may be used to retrieve a feature from a vector source with the * requesting features or comparing identifiers returned from a remote source.
* {@link ol.source.Vector#getFeatureById} method. * The feature id can be used with the {@link ol.source.Vector#getFeatureById}
* method.
* @param {number|string|undefined} id The feature id.
* @api stable * @api stable
*/ */
ol.Feature.prototype.setId = function(id) { ol.Feature.prototype.setId = function(id) {
@@ -268,8 +270,10 @@ ol.Feature.prototype.setId = function(id) {
/** /**
* @param {string} name Set the property name from which this feature's * Set the property name to be used when getting the feature's default geometry.
* geometry will be fetched when calling `getGeometry`. * When calling {@link ol.Feature#getGeometry}, the value of the property with
* this name will be returned.
* @param {string} name The property name of the default geometry.
* @api stable * @api stable
*/ */
ol.Feature.prototype.setGeometryName = function(name) { ol.Feature.prototype.setGeometryName = function(name) {
@@ -285,10 +289,8 @@ ol.Feature.prototype.setGeometryName = function(name) {
/** /**
* A function that takes a `{number}` representing the view's resolution. It * A function that returns a style given a resolution. The `this` keyword inside
* returns an Array of {@link ol.style.Style}. This way individual features * the function references the {@link ol.Feature} to be styled.
* can be styled. The this keyword inside the function references the
* {@link ol.Feature} to be styled.
* *
* @typedef {function(this: ol.Feature, number): Array.<ol.style.Style>} * @typedef {function(this: ol.Feature, number): Array.<ol.style.Style>}
* @api stable * @api stable