Merge remote-tracking branch 'openlayers/master' into vector-api

This commit is contained in:
Tom Payne
2013-12-13 20:22:06 +01:00
39 changed files with 555 additions and 420 deletions

View File

@@ -1,7 +1,6 @@
goog.provide('ol.layer.Image');
goog.require('ol.layer.Layer');
goog.require('ol.source.Image');
@@ -15,11 +14,3 @@ ol.layer.Image = function(options) {
goog.base(this, options);
};
goog.inherits(ol.layer.Image, ol.layer.Layer);
/**
* @return {ol.source.Image} Single image source.
*/
ol.layer.Image.prototype.getImageSource = function() {
return /** @type {ol.source.Image} */ (this.getSource());
};

View File

@@ -84,10 +84,11 @@ ol.layer.Base.prototype.dispatchChangeEvent = function() {
/**
* @return {number} Brightness.
* @return {number|undefined} Brightness.
*/
ol.layer.Base.prototype.getBrightness = function() {
return /** @type {number} */ (this.get(ol.layer.LayerProperty.BRIGHTNESS));
return /** @type {number|undefined} */ (
this.get(ol.layer.LayerProperty.BRIGHTNESS));
};
goog.exportProperty(
ol.layer.Base.prototype,
@@ -96,10 +97,11 @@ goog.exportProperty(
/**
* @return {number} Contrast.
* @return {number|undefined} Contrast.
*/
ol.layer.Base.prototype.getContrast = function() {
return /** @type {number} */ (this.get(ol.layer.LayerProperty.CONTRAST));
return /** @type {number|undefined} */ (
this.get(ol.layer.LayerProperty.CONTRAST));
};
goog.exportProperty(
ol.layer.Base.prototype,
@@ -108,10 +110,10 @@ goog.exportProperty(
/**
* @return {number} Hue.
* @return {number|undefined} Hue.
*/
ol.layer.Base.prototype.getHue = function() {
return /** @type {number} */ (this.get(ol.layer.LayerProperty.HUE));
return /** @type {number|undefined} */ (this.get(ol.layer.LayerProperty.HUE));
};
goog.exportProperty(
ol.layer.Base.prototype,
@@ -168,10 +170,10 @@ ol.layer.Base.prototype.getLayerStatesArray = goog.abstractMethod;
/**
* @return {number} MaxResolution.
* @return {number|undefined} MaxResolution.
*/
ol.layer.Base.prototype.getMaxResolution = function() {
return /** @type {number} */ (
return /** @type {number|undefined} */ (
this.get(ol.layer.LayerProperty.MAX_RESOLUTION));
};
goog.exportProperty(
@@ -181,10 +183,10 @@ goog.exportProperty(
/**
* @return {number} MinResolution.
* @return {number|undefined} MinResolution.
*/
ol.layer.Base.prototype.getMinResolution = function() {
return /** @type {number} */ (
return /** @type {number|undefined} */ (
this.get(ol.layer.LayerProperty.MIN_RESOLUTION));
};
goog.exportProperty(
@@ -194,10 +196,11 @@ goog.exportProperty(
/**
* @return {number} Opacity.
* @return {number|undefined} Opacity.
*/
ol.layer.Base.prototype.getOpacity = function() {
return /** @type {number} */ (this.get(ol.layer.LayerProperty.OPACITY));
return /** @type {number|undefined} */ (
this.get(ol.layer.LayerProperty.OPACITY));
};
goog.exportProperty(
ol.layer.Base.prototype,
@@ -206,10 +209,11 @@ goog.exportProperty(
/**
* @return {number} Saturation.
* @return {number|undefined} Saturation.
*/
ol.layer.Base.prototype.getSaturation = function() {
return /** @type {number} */ (this.get(ol.layer.LayerProperty.SATURATION));
return /** @type {number|undefined} */ (
this.get(ol.layer.LayerProperty.SATURATION));
};
goog.exportProperty(
ol.layer.Base.prototype,
@@ -224,10 +228,11 @@ ol.layer.Base.prototype.getSourceState = goog.abstractMethod;
/**
* @return {boolean} Visible.
* @return {boolean|undefined} Visible.
*/
ol.layer.Base.prototype.getVisible = function() {
return /** @type {boolean} */ (this.get(ol.layer.LayerProperty.VISIBLE));
return /** @type {boolean|undefined} */ (
this.get(ol.layer.LayerProperty.VISIBLE));
};
goog.exportProperty(
ol.layer.Base.prototype,
@@ -253,7 +258,7 @@ goog.exportProperty(
* [2] https://github.com/WebKit/webkit/commit/8f4765e569
* [3] https://www.w3.org/Bugs/Public/show_bug.cgi?id=15647
*
* @param {number} brightness Brightness.
* @param {number|undefined} brightness Brightness.
*/
ol.layer.Base.prototype.setBrightness = function(brightness) {
this.set(ol.layer.LayerProperty.BRIGHTNESS, brightness);
@@ -269,7 +274,7 @@ goog.exportProperty(
* grey. A value of 1 will leave the contrast unchanged. Other values are
* linear multipliers on the effect (and values over 1 are permitted).
*
* @param {number} contrast Contrast.
* @param {number|undefined} contrast Contrast.
*/
ol.layer.Base.prototype.setContrast = function(contrast) {
this.set(ol.layer.LayerProperty.CONTRAST, contrast);
@@ -283,7 +288,7 @@ goog.exportProperty(
/**
* Apply a hue-rotation to the layer. A value of 0 will leave the hue
* unchanged. Other values are radians around the color circle.
* @param {number} hue Hue.
* @param {number|undefined} hue Hue.
*/
ol.layer.Base.prototype.setHue = function(hue) {
this.set(ol.layer.LayerProperty.HUE, hue);
@@ -295,7 +300,7 @@ goog.exportProperty(
/**
* @param {number} maxResolution MaxResolution.
* @param {number|undefined} maxResolution MaxResolution.
*/
ol.layer.Base.prototype.setMaxResolution = function(maxResolution) {
this.set(ol.layer.LayerProperty.MAX_RESOLUTION, maxResolution);
@@ -307,7 +312,7 @@ goog.exportProperty(
/**
* @param {number} minResolution MinResolution.
* @param {number|undefined} minResolution MinResolution.
*/
ol.layer.Base.prototype.setMinResolution = function(minResolution) {
this.set(ol.layer.LayerProperty.MIN_RESOLUTION, minResolution);
@@ -319,7 +324,7 @@ goog.exportProperty(
/**
* @param {number} opacity Opacity.
* @param {number|undefined} opacity Opacity.
*/
ol.layer.Base.prototype.setOpacity = function(opacity) {
this.set(ol.layer.LayerProperty.OPACITY, opacity);
@@ -336,7 +341,7 @@ goog.exportProperty(
* values are linear multipliers of the effect (and values over 1 are
* permitted).
*
* @param {number} saturation Saturation.
* @param {number|undefined} saturation Saturation.
*/
ol.layer.Base.prototype.setSaturation = function(saturation) {
this.set(ol.layer.LayerProperty.SATURATION, saturation);
@@ -348,7 +353,7 @@ goog.exportProperty(
/**
* @param {boolean} visible Visible.
* @param {boolean|undefined} visible Visible.
*/
ol.layer.Base.prototype.setVisible = function(visible) {
this.set(ol.layer.LayerProperty.VISIBLE, visible);

View File

@@ -10,6 +10,7 @@ goog.require('ol.Collection');
goog.require('ol.CollectionEvent');
goog.require('ol.CollectionEventType');
goog.require('ol.Object');
goog.require('ol.ObjectEventType');
goog.require('ol.layer.Base');
goog.require('ol.source.State');
@@ -104,7 +105,8 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) {
for (i = 0, ii = layersArray.length; i < ii; i++) {
layer = layersArray[i];
this.listenerKeys_[goog.getUid(layer).toString()] =
goog.events.listen(layer, goog.events.EventType.CHANGE,
goog.events.listen(layer,
[ol.ObjectEventType.PROPERTYCHANGE, goog.events.EventType.CHANGE],
this.handleLayerChange_, false, this);
}
}
@@ -120,8 +122,8 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) {
ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) {
var layer = /** @type {ol.layer.Base} */ (collectionEvent.getElement());
this.listenerKeys_[goog.getUid(layer).toString()] = goog.events.listen(
layer, goog.events.EventType.CHANGE, this.handleLayerChange_, false,
this);
layer, [ol.ObjectEventType.PROPERTYCHANGE, goog.events.EventType.CHANGE],
this.handleLayerChange_, false, this);
this.dispatchChangeEvent();
};
@@ -140,11 +142,11 @@ ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) {
/**
* @return {ol.Collection} Collection of layers.
* @return {ol.Collection|undefined} Collection of layers.
* @todo stability experimental
*/
ol.layer.Group.prototype.getLayers = function() {
return /** @type {ol.Collection} */ (this.get(
return /** @type {ol.Collection|undefined} */ (this.get(
ol.layer.GroupProperty.LAYERS));
};
goog.exportProperty(
@@ -154,7 +156,7 @@ goog.exportProperty(
/**
* @param {ol.Collection} layers Collection of layers.
* @param {ol.Collection|undefined} layers Collection of layers.
* @todo stability experimental
*/
ol.layer.Group.prototype.setLayers = function(layers) {

View File

@@ -1,7 +1,6 @@
goog.provide('ol.layer.Tile');
goog.require('ol.layer.Layer');
goog.require('ol.source.Tile');
/**
@@ -44,14 +43,6 @@ goog.exportProperty(
ol.layer.Tile.prototype.getPreload);
/**
* @return {ol.source.Tile} Source.
*/
ol.layer.Tile.prototype.getTileSource = function() {
return /** @type {ol.source.Tile} */ (this.getSource());
};
/**
* @param {number} preload Preload.
* @todo stability experimental