Refactor exports and externs

This commit is contained in:
Tom Payne
2012-10-03 14:49:10 +02:00
parent d35df1d53b
commit 9d253ab6bb
17 changed files with 605 additions and 228 deletions

View File

@@ -4,7 +4,6 @@
// FIXME check clean-up code
goog.provide('ol.control.Attribution');
goog.provide('ol.control.AttributionOptions');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
@@ -19,13 +18,6 @@ goog.require('ol.control.Control');
goog.require('ol.layer.Layer');
/**
* @typedef {{map: (ol.Map|undefined),
* target: (Element|undefined)}}
*/
ol.control.AttributionOptions;
/**
* @constructor

View File

@@ -1,7 +1,6 @@
// FIXME should listen on appropriate pane, once it is defined
goog.provide('ol.control.MousePosition');
goog.provide('ol.control.MousePositionOptions');
goog.require('goog.events');
goog.require('goog.events.EventType');
@@ -13,16 +12,6 @@ goog.require('ol.TransformFunction');
goog.require('ol.control.Control');
/**
* @typedef {{coordinateFormat: (ol.CoordinateFormatType|undefined),
* map: (ol.Map|undefined),
* projection: (ol.Projection|undefined),
* target: (Element|undefined),
* undefinedHtml: (string|undefined)}}
*/
ol.control.MousePositionOptions;
/**
* @constructor

View File

@@ -1,5 +1,4 @@
goog.provide('ol.control.Zoom');
goog.provide('ol.control.ZoomOptions');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
@@ -10,14 +9,6 @@ goog.require('ol.Projection');
goog.require('ol.control.Control');
/**
* @typedef {{delta: (number|undefined),
* map: (ol.Map|undefined),
* target: (Element|undefined)}}
*/
ol.control.ZoomOptions;
/**
* @constructor

View File

@@ -1,3 +1,5 @@
@exportProperty ol.MapBrowserEvent.prototype.getCoordinate
@exportSymbol ol.Collection
@exportProperty ol.Collection.prototype.clear
@exportProperty ol.Collection.prototype.forEach
@@ -12,9 +14,40 @@
@exportSymbol ol.Coordinate
@exportSymbol ol.CoordinateFormat
@exportProperty ol.CoordinateFormat.hdms
@exportSymbol ol.Extent
@exportSymbol ol.Map
@exportObjectLiteral ol.MapOptions
@exportObjectLiteralProperty ol.MapOptions.center ol.Coordinate|undefined
@exportObjectLiteralProperty ol.MapOptions.controls ol.Collection|undefined
@exportObjectLiteralProperty ol.MapOptions.doubleClickZoom boolean|undefined
@exportObjectLiteralProperty ol.MapOptions.dragPan boolean|undefined
@exportObjectLiteralProperty ol.MapOptions.interactions ol.Collection|undefined
@exportObjectLiteralProperty ol.MapOptions.keyboard boolean|undefined
@exportObjectLiteralProperty ol.MapOptions.keyboardPanOffset number|undefined
@exportObjectLiteralProperty ol.MapOptions.layers ol.Collection|undefined
@exportObjectLiteralProperty ol.MapOptions.maxResolution number|undefined
@exportObjectLiteralProperty ol.MapOptions.mouseWheelZoom boolean|undefined
@exportObjectLiteralProperty ol.MapOptions.mouseWheelZoomDelta number|undefined
@exportObjectLiteralProperty ol.MapOptions.numZoomLevels number|undefined
@exportObjectLiteralProperty ol.MapOptions.projection ol.Projection|string|undefined
@exportObjectLiteralProperty ol.MapOptions.renderer ol.RendererHint|undefined
@exportObjectLiteralProperty ol.MapOptions.renderers Array.<ol.RendererHint>|undefined
@exportObjectLiteralProperty ol.MapOptions.resolution number|undefined
@exportObjectLiteralProperty ol.MapOptions.resolutions Array.<number>|undefined
@exportObjectLiteralProperty ol.MapOptions.rotate boolean|undefined
@exportObjectLiteralProperty ol.MapOptions.shiftDragZoom boolean|undefined
@exportObjectLiteralProperty ol.MapOptions.target Element|string
@exportObjectLiteralProperty ol.MapOptions.userProjection ol.Projection|string|undefined
@exportObjectLiteralProperty ol.MapOptions.zoom number|undefined
@exportObjectLiteralProperty ol.MapOptions.zoomDelta number|undefined
@exportObjectLiteralProperty ol.MapOptions.zoomFactor number|undefined
@exportClass ol.Map ol.MapOptions
@exportProperty ol.Map.prototype.getControls
@exportProperty ol.Map.prototype.getInteractions
@exportSymbol ol.Object
@exportProperty ol.Object.prototype.bindTo
@@ -32,13 +65,61 @@
@exportProperty ol.Projection.getTransform
@exportProperty ol.Projection.getTransformFromCodes
@exportProperty ol.Projection.transform
@exportProperty ol.Projection.transformWithCodes
@exportProperty ol.Projection.prototype.getCode
@exportProperty ol.Projection.prototype.getExtent
@exportProperty ol.Projection.prototype.getUnits
@exportSymbol ol.layer.TileLayer
@exportSymbol ol.RendererHint
@exportProperty ol.RendererHint.DOM
@exportProperty ol.RendererHint.WEBGL
@exportSymbol ol.overlay.Overlay
@exportObjectLiteral ol.control.AttributionOptions
@exportObjectLiteralProperty ol.control.AttributionOptions.map ol.Map|undefined
@exportObjectLiteralProperty ol.control.AttributionOptions.target Element|undefined
@exportClass ol.control.Attribution ol.control.AttributionOptions
@exportObjectLiteral ol.control.MousePositionOptions
@exportObjectLiteralProperty ol.control.MousePositionOptions.coordinateFormat ol.CoordinateFormatType|undefined
@exportObjectLiteralProperty ol.control.MousePositionOptions.map ol.Map|undefined
@exportObjectLiteralProperty ol.control.MousePositionOptions.projection ol.Projection|undefined
@exportObjectLiteralProperty ol.control.MousePositionOptions.target Element|undefined
@exportObjectLiteralProperty ol.control.MousePositionOptions.undefinedHtml string|undefined
@exportClass ol.control.MousePosition ol.control.MousePositionOptions
@exportObjectLiteral ol.control.ZoomOptions
@exportObjectLiteralProperty ol.control.ZoomOptions.delta number|undefined
@exportObjectLiteralProperty ol.control.ZoomOptions.map ol.Map|undefined
@exportObjectLiteralProperty ol.control.ZoomOptions.target Element|undefined
@exportClass ol.control.Zoom ol.control.ZoomOptions
@exportObjectLiteral ol.layer.LayerOptions
@exportObjectLiteralProperty ol.layer.LayerOptions.brightness number|undefined
@exportObjectLiteralProperty ol.layer.LayerOptions.contrast number|undefined
@exportObjectLiteralProperty ol.layer.LayerOptions.hue number|undefined
@exportObjectLiteralProperty ol.layer.LayerOptions.opacity number|undefined
@exportObjectLiteralProperty ol.layer.LayerOptions.saturation number|undefined
@exportObjectLiteralProperty ol.layer.LayerOptions.source ol.source.Source
@exportObjectLiteralProperty ol.layer.LayerOptions.visible boolean|undefined
@exportSymbol ol.interaction.Keyboard
@exportProperty ol.interaction.Keyboard.prototype.addCallback
@exportClass ol.layer.TileLayer ol.layer.LayerOptions
@exportObjectLiteral ol.overlay.OverlayOptions
@exportObjectLiteralProperty ol.overlay.OverlayOptions.coordinate ol.Coordinate|undefined
@exportObjectLiteralProperty ol.overlay.OverlayOptions.element Element|undefined
@exportObjectLiteralProperty ol.overlay.OverlayOptions.map ol.Map|undefined
@exportObjectLiteralProperty ol.overlay.OverlayOptions.positioning Array.<string>|undefined
@exportClass ol.overlay.Overlay ol.overlay.OverlayOptions
@exportProperty ol.overlay.Overlay.prototype.getElement
@exportProperty ol.overlay.Overlay.prototype.setCoordinate
@exportProperty ol.overlay.Overlay.prototype.setMap
@exportSymbol ol.source.BingMaps

View File

@@ -25,7 +25,7 @@ ol.layer.LayerProperty = {
/**
* @constructor
* @extends {ol.Object}
* @param {olx.layer.LayerOptions} layerOptions LayerOptions.
* @param {ol.layer.LayerOptions} layerOptions LayerOptions.
*/
ol.layer.Layer = function(layerOptions) {

View File

@@ -8,7 +8,7 @@ goog.require('ol.source.TileSource');
/**
* @constructor
* @extends {ol.layer.Layer}
* @param {olx.layer.LayerOptions} layerOptions Layer options.
* @param {ol.layer.LayerOptions} layerOptions Layer options.
*/
ol.layer.TileLayer = function(layerOptions) {
goog.base(this, layerOptions);

View File

@@ -115,7 +115,7 @@ ol.MapProperty = {
* @constructor
* @extends {ol.Object}
* @implements {goog.fx.anim.Animated}
* @param {olx.MapOptions} mapOptions Map options.
* @param {ol.MapOptions} mapOptions Map options.
*/
ol.Map = function(mapOptions) {
@@ -956,7 +956,7 @@ ol.MapOptionsInternal;
/**
* @param {olx.MapOptions} mapOptions Map options.
* @param {ol.MapOptions} mapOptions Map options.
* @return {ol.MapOptionsInternal} Map options.
*/
ol.Map.createOptionsInternal = function(mapOptions) {
@@ -1063,7 +1063,7 @@ ol.Map.createOptionsInternal = function(mapOptions) {
/**
* @private
* @param {olx.MapOptions} mapOptions Map options.
* @param {ol.MapOptions} mapOptions Map options.
* @return {ol.Constraints} Map constraints.
*/
ol.Map.createConstraints_ = function(mapOptions) {
@@ -1097,7 +1097,7 @@ ol.Map.createConstraints_ = function(mapOptions) {
/**
* @private
* @param {olx.MapOptions} mapOptions Map options.
* @param {ol.MapOptions} mapOptions Map options.
* @return {ol.Collection} Controls.
*/
ol.Map.createControls_ = function(mapOptions) {
@@ -1119,7 +1119,7 @@ ol.Map.createControls_ = function(mapOptions) {
/**
* @private
* @param {olx.MapOptions} mapOptions Map options.
* @param {ol.MapOptions} mapOptions Map options.
* @return {ol.Collection} Interactions.
*/
ol.Map.createInteractions_ = function(mapOptions) {

View File

@@ -1,20 +1,10 @@
goog.provide('ol.overlay.Overlay');
goog.provide('ol.overlay.OverlayOptions');
goog.provide('ol.overlay.OverlayPositioning');
goog.require('goog.events');
goog.require('goog.style');
/**
* @typedef {{coordinate: (ol.Coordinate|undefined),
* element: (Element|undefined),
* map: (ol.Map|undefined),
* positioning: (Array.<string>|undefined)}}
*/
ol.overlay.OverlayOptions;
/**
* @constructor

View File

@@ -1,34 +0,0 @@
@exportType olx.MapOptions
center: ol.Coordinate|undefined
controls: ol.Collection|undefined
doubleClickZoom: boolean|undefined
dragPan: boolean|undefined
interactions: ol.Collection|undefined
keyboard: boolean|undefined
keyboardPanOffset: number|undefined
layers: ol.Collection|undefined
maxResolution: number|undefined
mouseWheelZoom: boolean|undefined
mouseWheelZoomDelta: number|undefined
numZoomLevels: number|undefined
projection: ol.Projection|string|undefined
renderer: ol.RendererHint|undefined
renderers: Array.<ol.RendererHint>|undefined
resolution: number|undefined
resolutions: Array.<number>|undefined
rotate: boolean|undefined
shiftDragZoom: boolean|undefined
target: Element|string
userProjection: ol.Projection|string|undefined
zoom: number|undefined
zoomDelta: number|undefined
zoomFactor: number|undefined
@exportType olx.layer.LayerOptions
brightness: number|undefined
contrast: number|undefined
hue: number|undefined
opacity: number|undefined
saturation: number|undefined
source: ol.source.Source
visible: boolean|undefined