From 0c35d50fed4d5b19c9af5bc4e1e9f379fc5b3882 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Fri, 3 Aug 2012 10:37:17 +0200 Subject: [PATCH] Export properties so libary can be used in compiled mode --- src/ol/base/layer.js | 49 +++++++++++++++++++++++++++ src/ol/base/map.js | 79 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) diff --git a/src/ol/base/layer.js b/src/ol/base/layer.js index 8c7e1ab95a..47aa57e70b 100644 --- a/src/ol/base/layer.js +++ b/src/ol/base/layer.js @@ -57,6 +57,10 @@ goog.inherits(ol.Layer, ol.Object); ol.Layer.prototype.getBrightness = function() { return /** @type {number} */ this.get(ol.LayerProperty.BRIGHTNESS); }; +goog.exportProperty( + ol.Layer.prototype, + 'getBrightness', + ol.Layer.prototype.getBrightness); /** @@ -65,6 +69,11 @@ ol.Layer.prototype.getBrightness = function() { ol.Layer.prototype.getContrast = function() { return /** @type {number} */ this.get(ol.LayerProperty.CONTRAST); }; +goog.exportProperty( + ol.Layer.prototype, + 'getContrast', + ol.Layer.prototype.getContrast); + /** @@ -73,6 +82,10 @@ ol.Layer.prototype.getContrast = function() { ol.Layer.prototype.getHue = function() { return /** @type {number} */ this.get(ol.LayerProperty.HUE); }; +goog.exportProperty( + ol.Layer.prototype, + 'getHue', + ol.Layer.prototype.getHue); /** @@ -81,6 +94,10 @@ ol.Layer.prototype.getHue = function() { ol.Layer.prototype.getOpacity = function() { return /** @type {number} */ this.get(ol.LayerProperty.OPACITY); }; +goog.exportProperty( + ol.Layer.prototype, + 'getOpacity', + ol.Layer.prototype.getOpacity); /** @@ -89,6 +106,10 @@ ol.Layer.prototype.getOpacity = function() { ol.Layer.prototype.getSaturation = function() { return /** @type {number} */ this.get(ol.LayerProperty.SATURATION); }; +goog.exportProperty( + ol.Layer.prototype, + 'getSaturation', + ol.Layer.prototype.getSaturation); /** @@ -105,6 +126,10 @@ ol.Layer.prototype.getStore = function() { ol.Layer.prototype.getVisible = function() { return /** @type {boolean} */ this.get(ol.LayerProperty.VISIBLE); }; +goog.exportProperty( + ol.Layer.prototype, + 'getVisible', + ol.Layer.prototype.getVisible); /** @@ -124,6 +149,10 @@ ol.Layer.prototype.setBrightness = function(brightness) { this.set(ol.LayerProperty.BRIGHTNESS, brightness); } }; +goog.exportProperty( + ol.Layer.prototype, + 'setBrightness', + ol.Layer.prototype.setBrightness); /** @@ -135,6 +164,10 @@ ol.Layer.prototype.setContrast = function(contrast) { this.set(ol.LayerProperty.CONTRAST, contrast); } }; +goog.exportProperty( + ol.Layer.prototype, + 'setContrast', + ol.Layer.prototype.setContrast); /** @@ -145,6 +178,10 @@ ol.Layer.prototype.setHue = function(hue) { this.set(ol.LayerProperty.HUE, hue); } }; +goog.exportProperty( + ol.Layer.prototype, + 'setHue', + ol.Layer.prototype.setHue); /** @@ -156,6 +193,10 @@ ol.Layer.prototype.setOpacity = function(opacity) { this.set(ol.LayerProperty.OPACITY, opacity); } }; +goog.exportProperty( + ol.Layer.prototype, + 'setOpacity', + ol.Layer.prototype.setOpacity); /** @@ -167,6 +208,10 @@ ol.Layer.prototype.setSaturation = function(saturation) { this.set(ol.LayerProperty.SATURATION, saturation); } }; +goog.exportProperty( + ol.Layer.prototype, + 'setSaturation', + ol.Layer.prototype.setSaturation); /** @@ -178,3 +223,7 @@ ol.Layer.prototype.setVisible = function(visible) { this.set(ol.LayerProperty.VISIBLE, visible); } }; +goog.exportProperty( + ol.Layer.prototype, + 'setVisible', + ol.Layer.prototype.setVisible); diff --git a/src/ol/base/map.js b/src/ol/base/map.js index 00b191c3ea..3107b42706 100644 --- a/src/ol/base/map.js +++ b/src/ol/base/map.js @@ -330,6 +330,10 @@ ol.Map.prototype.getBackgroundColor = function() { return /** @type {ol.Color|undefined} */ ( this.get(ol.MapProperty.BACKGROUND_COLOR)); }; +goog.exportProperty( + ol.Map.prototype, + 'getBackgroundColor', + ol.Map.prototype.getBackgroundColor); /** @@ -338,6 +342,10 @@ ol.Map.prototype.getBackgroundColor = function() { ol.Map.prototype.getCenter = function() { return /** @type {ol.Coordinate} */ this.get(ol.MapProperty.CENTER); }; +goog.exportProperty( + ol.Map.prototype, + 'getCenter', + ol.Map.prototype.getCenter); /** @@ -346,6 +354,10 @@ ol.Map.prototype.getCenter = function() { ol.Map.prototype.getControls = function() { return /** @type {ol.Collection} */ this.get(ol.MapProperty.CONTROLS); }; +goog.exportProperty( + ol.Map.prototype, + 'getControls', + ol.Map.prototype.getControls); /** @@ -426,6 +438,10 @@ ol.Map.prototype.getPixelFromCoordinate = function(coordinate) { ol.Map.prototype.getProjection = function() { return /** @type {ol.Projection} */ this.get(ol.MapProperty.PROJECTION); }; +goog.exportProperty( + ol.Map.prototype, + 'getProjection', + ol.Map.prototype.getProjection); /** @@ -434,6 +450,10 @@ ol.Map.prototype.getProjection = function() { ol.Map.prototype.getResolution = function() { return /** @type {number} */ this.get(ol.MapProperty.RESOLUTION); }; +goog.exportProperty( + ol.Map.prototype, + 'getResolution', + ol.Map.prototype.getResolution); /** @@ -483,6 +503,10 @@ ol.Map.prototype.getRotatedExtent = function() { ol.Map.prototype.getRotation = function() { return /** @type {number|undefined} */ this.get(ol.MapProperty.ROTATION); }; +goog.exportProperty( + ol.Map.prototype, + 'getRotation', + ol.Map.prototype.getRotation); /** @@ -491,6 +515,10 @@ ol.Map.prototype.getRotation = function() { ol.Map.prototype.getSize = function() { return /** @type {ol.Size|undefined} */ this.get(ol.MapProperty.SIZE); }; +goog.exportProperty( + ol.Map.prototype, + 'getSize', + ol.Map.prototype.getSize); /** @@ -528,11 +556,16 @@ ol.Map.prototype.getUserExtent = function() { /** + * @export * @return {ol.Projection|undefined} Projection. */ ol.Map.prototype.getUserProjection = function() { return /** @type {ol.Projection} */ this.get(ol.MapProperty.USER_PROJECTION); }; +goog.exportProperty( + ol.Map.prototype, + 'getUserProjection', + ol.Map.prototype.getUserProjection); /** @@ -759,6 +792,10 @@ ol.Map.prototype.removeLayerRenderer = function(layer) { ol.Map.prototype.setBackgroundColor = function(backgroundColor) { this.set(ol.MapProperty.BACKGROUND_COLOR, backgroundColor); }; +goog.exportProperty( + ol.Map.prototype, + 'setBackgroundColor', + ol.Map.prototype.setBackgroundColor); /** @@ -767,6 +804,10 @@ ol.Map.prototype.setBackgroundColor = function(backgroundColor) { ol.Map.prototype.setCenter = function(center) { this.set(ol.MapProperty.CENTER, center); }; +goog.exportProperty( + ol.Map.prototype, + 'setCenter', + ol.Map.prototype.setCenter); /** @@ -775,6 +816,10 @@ ol.Map.prototype.setCenter = function(center) { ol.Map.prototype.setControls = function(controls) { this.set(ol.MapProperty.CONTROLS, controls); }; +goog.exportProperty( + ol.Map.prototype, + 'setControls', + ol.Map.prototype.setControls); /** @@ -790,27 +835,42 @@ ol.Map.prototype.setLayerRenderer = function(layer, layerRenderer) { /** + * @export * @param {ol.Collection} layers Layers. */ ol.Map.prototype.setLayers = function(layers) { this.set(ol.MapProperty.LAYERS, layers); }; +goog.exportProperty( + ol.Map.prototype, + 'setLayers', + ol.Map.prototype.setLayers); /** + * @export * @param {number|undefined} resolution Resolution. */ ol.Map.prototype.setResolution = function(resolution) { this.set(ol.MapProperty.RESOLUTION, resolution); }; +goog.exportProperty( + ol.Map.prototype, + 'setResolution', + ol.Map.prototype.setResolution); /** + * @export * @param {number|undefined} rotation Rotation. */ ol.Map.prototype.setRotation = function(rotation) { this.set(ol.MapProperty.ROTATION, rotation); }; +goog.exportProperty( + ol.Map.prototype, + 'setRotation', + ol.Map.prototype.setRotation); /** @@ -822,30 +882,49 @@ ol.Map.prototype.setSize = function(size) { this.set(ol.MapProperty.SIZE, size); } }; +goog.exportProperty( + ol.Map.prototype, + 'setSize', + ol.Map.prototype.setSize); /** + * @export * @param {ol.Projection} projection Projection. */ ol.Map.prototype.setProjection = function(projection) { this.set(ol.MapProperty.PROJECTION, projection); }; +goog.exportProperty( + ol.Map.prototype, + 'setProjection', + ol.Map.prototype.setProjection); /** + * @export * @param {ol.Coordinate} userCenter Center in user projection. */ ol.Map.prototype.setUserCenter = function(userCenter) { this.setCenter(this.userToMapTransform_(userCenter)); }; +goog.exportProperty( + ol.Map.prototype, + 'setUserCenter', + ol.Map.prototype.setUserCenter); /** + * @export * @param {ol.Projection} userProjection User projection. */ ol.Map.prototype.setUserProjection = function(userProjection) { this.set(ol.MapProperty.USER_PROJECTION, userProjection); }; +goog.exportProperty( + ol.Map.prototype, + 'setUserProjection', + ol.Map.prototype.setUserProjection); /**