Re-order functions alphabetically
This commit is contained in:
@@ -11,22 +11,6 @@ goog.require('ol.Coordinate');
|
||||
ol.CoordinateFormatType;
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {number} degrees Degrees.
|
||||
* @param {string} hemispheres Hemispheres.
|
||||
* @return {string} String.
|
||||
*/
|
||||
ol.CoordinateFormat.degreesToHDMS_ = function(degrees, hemispheres) {
|
||||
var normalizedDegrees = goog.math.modulo(degrees + 180, 360) - 180;
|
||||
var x = Math.abs(Math.round(3600 * normalizedDegrees));
|
||||
return Math.floor(x / 3600) + '\u00b0 ' +
|
||||
Math.floor((x / 60) % 60) + '\u2032 ' +
|
||||
Math.floor(x % 60) + '\u2033 ' +
|
||||
hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} precision Precision.
|
||||
* @return {ol.CoordinateFormatType} Coordinate format.
|
||||
@@ -43,6 +27,22 @@ ol.CoordinateFormat.createXY = function(precision) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {number} degrees Degrees.
|
||||
* @param {string} hemispheres Hemispheres.
|
||||
* @return {string} String.
|
||||
*/
|
||||
ol.CoordinateFormat.degreesToHDMS_ = function(degrees, hemispheres) {
|
||||
var normalizedDegrees = goog.math.modulo(degrees + 180, 360) - 180;
|
||||
var x = Math.abs(Math.round(3600 * normalizedDegrees));
|
||||
return Math.floor(x / 3600) + '\u00b0 ' +
|
||||
Math.floor((x / 60) % 60) + '\u2032 ' +
|
||||
Math.floor(x % 60) + '\u2033 ' +
|
||||
hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate|undefined} coordinate Coordinate.
|
||||
* @return {string} Coordinate format.
|
||||
|
||||
@@ -69,14 +69,6 @@ ol.LayerRenderer.prototype.getLayer = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.MapRenderer} Map renderer.
|
||||
*/
|
||||
ol.LayerRenderer.prototype.getMapRenderer = function() {
|
||||
return this.mapRenderer_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Map} Map.
|
||||
*/
|
||||
@@ -85,6 +77,14 @@ ol.LayerRenderer.prototype.getMap = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.MapRenderer} Map renderer.
|
||||
*/
|
||||
ol.LayerRenderer.prototype.getMapRenderer = function() {
|
||||
return this.mapRenderer_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
@@ -106,13 +106,13 @@ ol.LayerRenderer.prototype.handleLayerHueChange = goog.nullFunction;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.LayerRenderer.prototype.handleLayerOpacityChange = goog.nullFunction;
|
||||
ol.LayerRenderer.prototype.handleLayerLoad = goog.nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.LayerRenderer.prototype.handleLayerLoad = goog.nullFunction;
|
||||
ol.LayerRenderer.prototype.handleLayerOpacityChange = goog.nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,6 +96,30 @@ ol.MapRenderer = function(target, map) {
|
||||
goog.inherits(ol.MapRenderer, goog.Disposable);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.addLayer = function(layer) {
|
||||
var layerRenderer = this.createLayerRenderer(layer);
|
||||
this.setLayerRenderer(layer, layerRenderer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Can rotate.
|
||||
*/
|
||||
ol.MapRenderer.prototype.canRotate = goog.functions.FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @protected
|
||||
* @return {ol.LayerRenderer} layerRenderer Layer renderer.
|
||||
*/
|
||||
ol.MapRenderer.prototype.createLayerRenderer = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -128,10 +152,14 @@ ol.MapRenderer.prototype.forEachReadyVisibleLayer = function(f, opt_obj) {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Map} Map.
|
||||
* @param {ol.Pixel} pixel Pixel.
|
||||
* @return {ol.Coordinate} Coordinate.
|
||||
*/
|
||||
ol.MapRenderer.prototype.getMap = function() {
|
||||
return this.map;
|
||||
ol.MapRenderer.prototype.getCoordinateFromPixel = function(pixel) {
|
||||
this.updateMatrices_();
|
||||
var vec3 = [pixel.x, pixel.y, 0];
|
||||
goog.vec.Mat4.multVec3(this.pixelToCoordinateMatrix_, vec3, vec3);
|
||||
return new ol.Coordinate(vec3[0], vec3[1]);
|
||||
};
|
||||
|
||||
|
||||
@@ -149,21 +177,23 @@ ol.MapRenderer.prototype.getLayerRenderer = function(layer) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.LayerRenderer} layerRenderer Layer renderer.
|
||||
* @protected
|
||||
* @return {ol.Map} Map.
|
||||
*/
|
||||
ol.MapRenderer.prototype.setLayerRenderer = function(layer, layerRenderer) {
|
||||
var key = goog.getUid(layer);
|
||||
goog.asserts.assert(!(key in this.layerRenderers));
|
||||
this.layerRenderers[key] = layerRenderer;
|
||||
ol.MapRenderer.prototype.getMap = function() {
|
||||
return this.map;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Can rotate.
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @return {ol.Pixel} Pixel.
|
||||
*/
|
||||
ol.MapRenderer.prototype.canRotate = goog.functions.FALSE;
|
||||
ol.MapRenderer.prototype.getPixelFromCoordinate = function(coordinate) {
|
||||
this.updateMatrices_();
|
||||
var vec3 = [coordinate.x, coordinate.y, 0];
|
||||
goog.vec.Mat4.multVec3(this.coordinateToPixelMatrix_, vec3, vec3);
|
||||
return new ol.Pixel(vec3[0], vec3[1]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -179,6 +209,16 @@ ol.MapRenderer.prototype.handleCenterChanged = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.CollectionEvent} collectionEvent Collection event.
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleLayersAdd = function(collectionEvent) {
|
||||
var layer = /** @type {ol.Layer} */ collectionEvent.elem;
|
||||
this.addLayer(layer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
@@ -205,34 +245,6 @@ ol.MapRenderer.prototype.handleLayersChanged = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.CollectionEvent} collectionEvent Collection event.
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleLayersAdd = function(collectionEvent) {
|
||||
var layer = /** @type {ol.Layer} */ collectionEvent.elem;
|
||||
this.addLayer(layer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.addLayer = function(layer) {
|
||||
var layerRenderer = this.createLayerRenderer(layer);
|
||||
this.setLayerRenderer(layer, layerRenderer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @protected
|
||||
* @return {ol.LayerRenderer} layerRenderer Layer renderer.
|
||||
*/
|
||||
ol.MapRenderer.prototype.createLayerRenderer = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.CollectionEvent} collectionEvent Collection event.
|
||||
* @protected
|
||||
@@ -243,6 +255,30 @@ ol.MapRenderer.prototype.handleLayersRemove = function(collectionEvent) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleResolutionChanged = function() {
|
||||
this.matricesDirty_ = true;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleRotationChanged = function() {
|
||||
this.matricesDirty_ = true;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleSizeChanged = function() {
|
||||
this.matricesDirty_ = true;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @protected
|
||||
@@ -269,30 +305,6 @@ ol.MapRenderer.prototype.removeLayerRenderer = function(layer) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleResolutionChanged = function() {
|
||||
this.matricesDirty_ = true;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleRotationChanged = function() {
|
||||
this.matricesDirty_ = true;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.handleSizeChanged = function() {
|
||||
this.matricesDirty_ = true;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Animating.
|
||||
*/
|
||||
@@ -307,6 +319,18 @@ ol.MapRenderer.prototype.render = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.LayerRenderer} layerRenderer Layer renderer.
|
||||
* @protected
|
||||
*/
|
||||
ol.MapRenderer.prototype.setLayerRenderer = function(layer, layerRenderer) {
|
||||
var key = goog.getUid(layer);
|
||||
goog.asserts.assert(!(key in this.layerRenderers));
|
||||
this.layerRenderers[key] = layerRenderer;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@@ -350,27 +374,3 @@ ol.MapRenderer.prototype.updateMatrices_ = function() {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Pixel} pixel Pixel.
|
||||
* @return {ol.Coordinate} Coordinate.
|
||||
*/
|
||||
ol.MapRenderer.prototype.getCoordinateFromPixel = function(pixel) {
|
||||
this.updateMatrices_();
|
||||
var vec3 = [pixel.x, pixel.y, 0];
|
||||
goog.vec.Mat4.multVec3(this.pixelToCoordinateMatrix_, vec3, vec3);
|
||||
return new ol.Coordinate(vec3[0], vec3[1]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @return {ol.Pixel} Pixel.
|
||||
*/
|
||||
ol.MapRenderer.prototype.getPixelFromCoordinate = function(coordinate) {
|
||||
this.updateMatrices_();
|
||||
var vec3 = [coordinate.x, coordinate.y, 0];
|
||||
goog.vec.Mat4.multVec3(this.coordinateToPixelMatrix_, vec3, vec3);
|
||||
return new ol.Pixel(vec3[0], vec3[1]);
|
||||
};
|
||||
|
||||
@@ -37,6 +37,27 @@ ol.Object = function(opt_values) {
|
||||
goog.inherits(ol.Object, goog.events.EventTarget);
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>}
|
||||
*/
|
||||
ol.Object.changedEventTypeCache_ = {};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>}
|
||||
*/
|
||||
ol.Object.getterNameCache_ = {};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>}
|
||||
*/
|
||||
ol.Object.setterNameCache_ = {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} str String.
|
||||
* @return {string} Capitalized string.
|
||||
@@ -62,10 +83,13 @@ ol.Object.create = function(arg) {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>}
|
||||
* @param {ol.Object} obj Object.
|
||||
* @return {Object.<string, {target: ol.Object, key: string}>} Accessors.
|
||||
*/
|
||||
ol.Object.changedEventTypeCache_ = {};
|
||||
ol.Object.getAccessors = function(obj) {
|
||||
return obj[ol.ObjectProperty.ACCESSORS] ||
|
||||
(obj[ol.ObjectProperty.ACCESSORS] = {});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,13 +102,6 @@ ol.Object.getChangedEventType = function(key) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>}
|
||||
*/
|
||||
ol.Object.getterNameCache_ = {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} key String.
|
||||
* @return {string} Getter name.
|
||||
@@ -96,10 +113,13 @@ ol.Object.getGetterName = function(key) {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>}
|
||||
* @param {ol.Object} obj Object.
|
||||
* @return {Object.<string, ?number>} Listeners.
|
||||
*/
|
||||
ol.Object.setterNameCache_ = {};
|
||||
ol.Object.getListeners = function(obj) {
|
||||
return obj[ol.ObjectProperty.BINDINGS] ||
|
||||
(obj[ol.ObjectProperty.BINDINGS] = {});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -112,26 +132,6 @@ ol.Object.getSetterName = function(key) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Object} obj Object.
|
||||
* @return {Object.<string, {target: ol.Object, key: string}>} Accessors.
|
||||
*/
|
||||
ol.Object.getAccessors = function(obj) {
|
||||
return obj[ol.ObjectProperty.ACCESSORS] ||
|
||||
(obj[ol.ObjectProperty.ACCESSORS] = {});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Object} obj Object.
|
||||
* @return {Object.<string, ?number>} Listeners.
|
||||
*/
|
||||
ol.Object.getListeners = function(obj) {
|
||||
return obj[ol.ObjectProperty.BINDINGS] ||
|
||||
(obj[ol.ObjectProperty.BINDINGS] = {});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} key Key.
|
||||
* @param {ol.Object} target Target.
|
||||
|
||||
Reference in New Issue
Block a user