Discard documentation for attributioncontrol.js and map.js to make refactoring easier due to @elemoine's request

This commit is contained in:
Augustus Kling
2012-12-03 22:47:33 +01:00
parent f253c1bcf8
commit a73c15c988
2 changed files with 11 additions and 46 deletions
+3 -22
View File
@@ -20,19 +20,13 @@ goog.require('ol.layer.Layer');
/** /**
* Shows credits / names of data providers for shown map layers.
*
* @constructor * @constructor
* @extends {ol.control.Control} * @extends {ol.control.Control}
* @param {ol.control.AttributionOptions} attributionOptions Attribution * @param {ol.control.AttributionOptions} attributionOptions Attribution
* options. * options.
*/ */
ol.control.Attribution = function(attributionOptions) { ol.control.Attribution = function(attributionOptions) {
/**
* @private
* @type {Element} List of map's data sources. One list items gets appended
* per data source.
*/
this.ulElement_ = goog.dom.createElement(goog.dom.TagName.UL); this.ulElement_ = goog.dom.createElement(goog.dom.TagName.UL);
var element = goog.dom.createDom(goog.dom.TagName.DIV, { var element = goog.dom.createDom(goog.dom.TagName.DIV, {
@@ -41,8 +35,7 @@ ol.control.Attribution = function(attributionOptions) {
/** /**
* @private * @private
* @type {Array.<number>} Event handler identifiers to change attribution when * @type {Array.<number>}
* layers get added and removed.
*/ */
this.layersListenerKeys_ = null; this.layersListenerKeys_ = null;
@@ -66,8 +59,7 @@ ol.control.Attribution = function(attributionOptions) {
/** /**
* @private * @private
* @type {Array.<number>} Event handler identifiers for handlers that monitor * @type {Array.<number>}
* changes to the map.
*/ */
this.mapListenerKeys_ = null; this.mapListenerKeys_ = null;
@@ -82,9 +74,6 @@ goog.inherits(ol.control.Attribution, ol.control.Control);
/** /**
* Attaches handler to track visibility changes and creates attribution list
* item.
*
* @param {ol.layer.Layer} layer Layer. * @param {ol.layer.Layer} layer Layer.
* @protected * @protected
*/ */
@@ -308,8 +297,6 @@ ol.control.Attribution.prototype.handleMapChanged = function() {
/** /**
* Clears attribution and triggers refill whenever layers get added to the map
* or are removed from the map.
* @protected * @protected
*/ */
ol.control.Attribution.prototype.handleMapLayersChanged = function() { ol.control.Attribution.prototype.handleMapLayersChanged = function() {
@@ -317,19 +304,15 @@ ol.control.Attribution.prototype.handleMapLayersChanged = function() {
goog.array.forEach(this.layersListenerKeys_, goog.events.unlistenByKey); goog.array.forEach(this.layersListenerKeys_, goog.events.unlistenByKey);
this.layersListenerKeys_ = null; this.layersListenerKeys_ = null;
} }
// Clear all attributions
goog.object.forEach(this.attributionElements_, function(attributionElement) { goog.object.forEach(this.attributionElements_, function(attributionElement) {
goog.dom.removeNode(attributionElement); goog.dom.removeNode(attributionElement);
}, this); }, this);
this.attributionElements_ = {}; this.attributionElements_ = {};
this.coverageAreass_ = {}; this.coverageAreass_ = {};
var map = this.getMap(); var map = this.getMap();
var layers = map.getLayers(); var layers = map.getLayers();
if (goog.isDefAndNotNull(layers)) { if (goog.isDefAndNotNull(layers)) {
// Add attribution for layer
layers.forEach(this.addLayer, this); layers.forEach(this.addLayer, this);
this.layersListenerKeys_ = [ this.layersListenerKeys_ = [
goog.events.listen(layers, ol.CollectionEventType.ADD, goog.events.listen(layers, ol.CollectionEventType.ADD,
this.handleLayersAdd, false, this), this.handleLayersAdd, false, this),
@@ -395,8 +378,6 @@ ol.control.Attribution.prototype.setMap = function(map) {
/** /**
* Shows or hides attribution for a layer. The attribution is shown whenever the
* layer is visible to the user.
* @param {ol.layer.Layer} layer Layer. * @param {ol.layer.Layer} layer Layer.
* @param {boolean} mapIsDef Map is defined. * @param {boolean} mapIsDef Map is defined.
* @param {ol.Extent} mapExtent Map extent. * @param {ol.Extent} mapExtent Map extent.
+8 -24
View File
@@ -80,8 +80,7 @@ ol.RendererHint = {
/** /**
* @type {Array.<ol.RendererHint>} Desired renderers with most favoured renderer * @type {Array.<ol.RendererHint>}
* first.
*/ */
ol.DEFAULT_RENDERER_HINTS = [ ol.DEFAULT_RENDERER_HINTS = [
ol.RendererHint.WEBGL, ol.RendererHint.WEBGL,
@@ -114,9 +113,6 @@ ol.MapProperty = {
/** /**
* Map composed of multiple layers. Maps in OpenLayers are responsible for
* binding together the other components.
*
* @constructor * @constructor
* @extends {ol.Object} * @extends {ol.Object}
* @implements {goog.fx.anim.Animated} * @implements {goog.fx.anim.Animated}
@@ -174,7 +170,7 @@ ol.Map = function(mapOptions) {
/** /**
* @private * @private
* @type {Element} Container into which the map is painted. * @type {Element}
*/ */
this.target_ = mapOptionsInternal.target; this.target_ = mapOptionsInternal.target;
@@ -186,7 +182,7 @@ ol.Map = function(mapOptions) {
/** /**
* @private * @private
* @type {Element} Reference to the root element of the map in the DOM. * @type {Element}
*/ */
this.viewport_ = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-viewport'); this.viewport_ = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-viewport');
this.viewport_.style.position = 'relative'; this.viewport_.style.position = 'relative';
@@ -197,8 +193,7 @@ ol.Map = function(mapOptions) {
/** /**
* @private * @private
* @type {Element} Captures click events and cancels them so that interactions * @type {Element}
* within overlays don't influence the map.
*/ */
this.overlayContainer_ = goog.dom.createDom(goog.dom.TagName.DIV, this.overlayContainer_ = goog.dom.createDom(goog.dom.TagName.DIV,
'ol-overlaycontainer'); 'ol-overlaycontainer');
@@ -249,8 +244,7 @@ ol.Map = function(mapOptions) {
this.interactions_ = mapOptionsInternal.interactions; this.interactions_ = mapOptionsInternal.interactions;
/** /**
* @type {ol.renderer.Map} Most favoured renderer given the supported of the * @type {ol.renderer.Map}
* choices.
* @private * @private
*/ */
this.renderer_ = this.renderer_ =
@@ -277,7 +271,6 @@ ol.Map = function(mapOptions) {
this.handleBrowserWindowResize(); this.handleBrowserWindowResize();
// Notify all controls about the map they are assigned to
this.controls_.forEach( this.controls_.forEach(
/** /**
* @param {ol.control.Control} control Control. * @param {ol.control.Control} control Control.
@@ -299,6 +292,7 @@ ol.Map.prototype.canRotate = function() {
/** /**
*
* @inheritDoc * @inheritDoc
*/ */
ol.Map.prototype.disposeInternal = function() { ol.Map.prototype.disposeInternal = function() {
@@ -365,7 +359,7 @@ goog.exportProperty(
/** /**
* @return {Element} Container into which the map is painted. * @return {Element} Container.
*/ */
ol.Map.prototype.getTarget = function() { ol.Map.prototype.getTarget = function() {
return this.target_; return this.target_;
@@ -650,10 +644,6 @@ ol.Map.prototype.handleUserProjectionChanged = function() {
/** /**
* Adjusts the map to its new size whenever the viewport size changes.
* One should react the the resize of the map's viewport instead of the browser
* viewport but there is no API to do so.
*
* @protected * @protected
*/ */
ol.Map.prototype.handleBrowserWindowResize = function() { ol.Map.prototype.handleBrowserWindowResize = function() {
@@ -1013,16 +1003,10 @@ ol.Map.createOptionsInternal = function(mapOptions) {
*/ */
var rendererHints; var rendererHints;
if (goog.isDef(mapOptions.renderers)) { if (goog.isDef(mapOptions.renderers)) {
// Use first supported renderer of the supported ones
rendererHints = mapOptions.renderers; rendererHints = mapOptions.renderers;
} else if (goog.isDef(mapOptions.renderer)) { } else if (goog.isDef(mapOptions.renderer)) {
// Use the given renderer
// Support accepting a renderer instead of an array with a single renderer
// for mapOptions.renderers.
rendererHints = [mapOptions.renderer]; rendererHints = [mapOptions.renderer];
} else { } else {
// Use the default order of preferred renderers if user did not specify a
// preference.
rendererHints = ol.DEFAULT_RENDERER_HINTS; rendererHints = ol.DEFAULT_RENDERER_HINTS;
} }
@@ -1068,7 +1052,7 @@ ol.Map.createOptionsInternal = function(mapOptions) {
} }
/** /**
* @type {Element} Container into which the map is painted. * @type {Element}
*/ */
var target = goog.dom.getElement(mapOptions.target); var target = goog.dom.getElement(mapOptions.target);