Whitespace changes only.
This commit is contained in:
+10
-10
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.geom.collection');
|
||||
goog.provide('ol.geom.collection');
|
||||
|
||||
goog.require('ol.geom.Collection');
|
||||
goog.require('ol.geom.point');
|
||||
goog.require('ol.geom.point');
|
||||
goog.require('ol.projection');
|
||||
|
||||
/**
|
||||
@@ -10,11 +10,11 @@ goog.require('ol.projection');
|
||||
* @return {ol.geom.Collection} Collection.
|
||||
*/
|
||||
ol.geom.collection = function(opt_arg){
|
||||
|
||||
|
||||
if (opt_arg instanceof ol.geom.Collection) {
|
||||
return opt_arg;
|
||||
}
|
||||
|
||||
|
||||
var components = [];
|
||||
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||
if (goog.isArray(opt_arg)) {
|
||||
@@ -35,7 +35,7 @@ ol.geom.collection = function(opt_arg){
|
||||
throw new Error('ol.geom.collection');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var c = new ol.geom.Collection(components);
|
||||
return c;
|
||||
};
|
||||
@@ -50,7 +50,7 @@ ol.geom.Collection.prototype.components = function(opt_arg){
|
||||
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||
var components = [],
|
||||
allValid = false;
|
||||
|
||||
|
||||
allValid = goog.array.every(opt_arg, function(geom){
|
||||
if (geom instanceof ol.geom.Geometry) {
|
||||
components.push(geom);
|
||||
@@ -90,23 +90,23 @@ ol.geom.Collection.prototype.add = function(geom, opt_index){
|
||||
* @export
|
||||
* @param {Array.<ol.geom.Geometry>} components Some point specifications.
|
||||
* @param {number=} opt_index An optional index to add the components at. If not
|
||||
* provided, the components will be added to the end of the list of
|
||||
* provided, the components will be added to the end of the list of
|
||||
* components.
|
||||
* @return {ol.geom.Collection} The Collection instance.
|
||||
*/
|
||||
ol.geom.Collection.prototype.addAll = function(components, opt_index){
|
||||
var index = this.components_.length;
|
||||
|
||||
|
||||
if (arguments.length == 2 && goog.isDef(opt_index)) {
|
||||
index = opt_index;
|
||||
}
|
||||
|
||||
|
||||
goog.array.every(components, function(c){
|
||||
this.addComponent(c, index);
|
||||
index++;
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
goog.provide('ol.geom.geometry');
|
||||
goog.provide('ol.geom.geometry');
|
||||
|
||||
goog.require('ol.geom.Geometry');
|
||||
|
||||
@@ -14,7 +14,7 @@ ol.geom.geometry = function(){
|
||||
/**
|
||||
* @export
|
||||
* @param {ol.Bounds=} opt_arg new Bounds.
|
||||
* @return {ol.geom.Geometry|ol.Bounds|undefined} either a Geometry (when used as
|
||||
* @return {ol.geom.Geometry|ol.Bounds|undefined} either a Geometry (when used as
|
||||
* setter) or a Bounds/undefined (if used as getter).
|
||||
*/
|
||||
ol.geom.Geometry.prototype.bounds = function(opt_arg) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.geom.linestring');
|
||||
goog.provide('ol.geom.linestring');
|
||||
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.point');
|
||||
goog.require('ol.geom.point');
|
||||
goog.require('ol.projection');
|
||||
|
||||
/**
|
||||
@@ -10,11 +10,11 @@ goog.require('ol.projection');
|
||||
* @return {ol.geom.LineString} LineString.
|
||||
*/
|
||||
ol.geom.linestring = function(opt_arg){
|
||||
|
||||
|
||||
if (opt_arg instanceof ol.geom.LineString) {
|
||||
return opt_arg;
|
||||
}
|
||||
|
||||
|
||||
var vertices = [];
|
||||
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||
if (goog.isArray(opt_arg)) {
|
||||
@@ -36,7 +36,7 @@ ol.geom.linestring = function(opt_arg){
|
||||
throw new Error('ol.geom.linestring');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var ls = new ol.geom.LineString(vertices);
|
||||
return ls;
|
||||
};
|
||||
@@ -99,18 +99,18 @@ ol.geom.LineString.prototype.add = function(vertex, opt_index){
|
||||
ol.geom.LineString.prototype.addAll = function(vertices, opt_index){
|
||||
var index = this.vertices_.length,
|
||||
v;
|
||||
|
||||
|
||||
if (arguments.length == 2 && goog.isDef(opt_index)) {
|
||||
index = opt_index;
|
||||
}
|
||||
|
||||
|
||||
goog.array.every(vertices, function(vertexSpec){
|
||||
v = ol.geom.point(vertexSpec);
|
||||
this.addVertex(v, index);
|
||||
index++;
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
+10
-10
@@ -1,8 +1,8 @@
|
||||
goog.provide('ol.geom.multipoint');
|
||||
goog.provide('ol.geom.multipoint');
|
||||
|
||||
goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.point');
|
||||
goog.require('ol.geom.collection');
|
||||
goog.require('ol.geom.point');
|
||||
goog.require('ol.geom.collection');
|
||||
goog.require('ol.projection');
|
||||
|
||||
/**
|
||||
@@ -11,11 +11,11 @@ goog.require('ol.projection');
|
||||
* @return {ol.geom.MultiPoint} MultiPoint.
|
||||
*/
|
||||
ol.geom.multipoint = function(opt_arg){
|
||||
|
||||
|
||||
if (opt_arg instanceof ol.geom.MultiPoint) {
|
||||
return opt_arg;
|
||||
}
|
||||
|
||||
|
||||
var points = [];
|
||||
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||
if (goog.isArray(opt_arg)) {
|
||||
@@ -37,7 +37,7 @@ ol.geom.multipoint = function(opt_arg){
|
||||
throw new Error('ol.geom.multipoint');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var mp = new ol.geom.MultiPoint(points);
|
||||
return mp;
|
||||
};
|
||||
@@ -99,18 +99,18 @@ ol.geom.MultiPoint.prototype.add = function(point, opt_index){
|
||||
ol.geom.MultiPoint.prototype.addAll = function(points, opt_index){
|
||||
var index = this.getPoints().length,
|
||||
p;
|
||||
|
||||
|
||||
if (arguments.length == 2 && goog.isDef(opt_index)) {
|
||||
index = opt_index;
|
||||
}
|
||||
|
||||
|
||||
goog.array.every(points, function(pointSpec){
|
||||
p = ol.geom.point(pointSpec);
|
||||
this.addPoint(p, index);
|
||||
index++;
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -132,6 +132,6 @@ ol.geom.MultiPoint.prototype.remove = function(points){
|
||||
this.removePoint(p);
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
+22
-22
@@ -6,16 +6,16 @@ goog.require('ol.Projection');
|
||||
goog.require('ol.base');
|
||||
|
||||
/**
|
||||
* Creates ol.geom.Collection objects.
|
||||
*
|
||||
* Creates ol.geom.Collection objects.
|
||||
*
|
||||
* @export
|
||||
* @extends {ol.geom.Geometry}
|
||||
* @param {Array.<ol.geom.Geometry>} components An array of components.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
ol.geom.Collection = function(components) {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Function>}
|
||||
@@ -23,19 +23,19 @@ ol.geom.Collection = function(components) {
|
||||
this.typeBlacklist_ = [
|
||||
ol.geom.Collection
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Function>}
|
||||
*/
|
||||
this.typeWhitelist_ = [];
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<ol.geom.Geometry>}
|
||||
*/
|
||||
this.components_ = [];
|
||||
|
||||
|
||||
if (arguments.length === 1 && goog.isDef(components)) {
|
||||
this.setComponents(components);
|
||||
}
|
||||
@@ -44,14 +44,14 @@ ol.geom.Collection = function(components) {
|
||||
goog.inherits(ol.geom.Collection, ol.geom.Geometry);
|
||||
|
||||
/**
|
||||
* Sets the list of disallowed types for the collection.
|
||||
* Sets the list of disallowed types for the collection.
|
||||
* @param {Array.<Function>} typeBlacklist Array of constructors to disallow.
|
||||
*/
|
||||
ol.geom.Collection.prototype.setTypeBlacklist = function(typeBlacklist){
|
||||
this.typeBlacklist_ = typeBlacklist;
|
||||
};
|
||||
/**
|
||||
* Gets the list of disallowed types for the collection.
|
||||
* Gets the list of disallowed types for the collection.
|
||||
* @return {Array.<Function>} Array of constructors to disallow.
|
||||
*/
|
||||
ol.geom.Collection.prototype.getTypeBlacklist = function(){
|
||||
@@ -59,14 +59,14 @@ ol.geom.Collection.prototype.getTypeBlacklist = function(){
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the list of always allowed types for the collection.
|
||||
* Sets the list of always allowed types for the collection.
|
||||
* @param {Array.<Function>} typeWhitelist Array of constructors to allow.
|
||||
*/
|
||||
ol.geom.Collection.prototype.setTypeWhitelist = function(typeWhitelist){
|
||||
this.typeWhitelist_ = typeWhitelist;
|
||||
};
|
||||
/**
|
||||
* Gets the list of always allowed types for the collection.
|
||||
* Gets the list of always allowed types for the collection.
|
||||
* @return {Array.<Function>} Array of constructors to allow.
|
||||
*/
|
||||
ol.geom.Collection.prototype.getTypeWhitelist = function(){
|
||||
@@ -76,7 +76,7 @@ ol.geom.Collection.prototype.getTypeWhitelist = function(){
|
||||
|
||||
/**
|
||||
* Sets the Collection's components.
|
||||
*
|
||||
*
|
||||
* @return {Array.<ol.geom.Geometry>} An array of components.
|
||||
*/
|
||||
ol.geom.Collection.prototype.getComponents = function() {
|
||||
@@ -85,12 +85,12 @@ ol.geom.Collection.prototype.getComponents = function() {
|
||||
|
||||
/**
|
||||
* Gets the Collection's components.
|
||||
*
|
||||
*
|
||||
* @param {Array.<ol.geom.Geometry>} components An array of components.
|
||||
*/
|
||||
ol.geom.Collection.prototype.setComponents = function(components) {
|
||||
var allValidTypes = goog.array.every(
|
||||
components,
|
||||
components,
|
||||
this.isAllowedComponent,
|
||||
this
|
||||
);
|
||||
@@ -105,7 +105,7 @@ ol.geom.Collection.prototype.setComponents = function(components) {
|
||||
|
||||
/**
|
||||
* Adds the given component to the list of components at the specified index.
|
||||
*
|
||||
*
|
||||
* @param {ol.geom.Geometry} component A component to be added.
|
||||
* @param {number} index The index where to add.
|
||||
*/
|
||||
@@ -121,14 +121,14 @@ ol.geom.Collection.prototype.addComponent = function(component, index) {
|
||||
/**
|
||||
* Checks whether the passed component is an instance of any of the constructors
|
||||
* listed in the passed list.
|
||||
*
|
||||
*
|
||||
* @param {ol.geom.Geometry} component The component to check.
|
||||
* @param {Array.<Function>} list The List of constructors to check the
|
||||
* @param {Array.<Function>} list The List of constructors to check the
|
||||
* component against.
|
||||
*
|
||||
* @return {boolean} Whether the passed component is an instance of any of the
|
||||
*
|
||||
* @return {boolean} Whether the passed component is an instance of any of the
|
||||
* constructors listed in the passed list.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
ol.geom.Collection.prototype.isOnList = function(component, list) {
|
||||
@@ -143,9 +143,9 @@ ol.geom.Collection.prototype.isOnList = function(component, list) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether the passed component is allowed according to the black and
|
||||
* Checks whether the passed component is allowed according to the black and
|
||||
* whitelists.
|
||||
*
|
||||
*
|
||||
* @param {ol.geom.Geometry} component The component to check.
|
||||
* @return {boolean} Whether the passed component is allowed as part of this
|
||||
* collection according to black- and whitelist.
|
||||
|
||||
@@ -2,17 +2,18 @@ goog.provide('ol.geom.LineString');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.geom.Collection');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.Projection');
|
||||
|
||||
/**
|
||||
* Creates ol.geom.LineString objects.
|
||||
*
|
||||
* Creates ol.geom.LineString objects.
|
||||
*
|
||||
* @export
|
||||
* @extends {ol.geom.Geometry}
|
||||
* @param {Array.<ol.geom.Point>} vertices An array of points building the
|
||||
* @param {Array.<ol.geom.Point>} vertices An array of points building the
|
||||
* linestrings vertices.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
ol.geom.LineString = function(vertices) {
|
||||
@@ -21,14 +22,14 @@ ol.geom.LineString = function(vertices) {
|
||||
* @type {Array.<ol.geom.Point>}
|
||||
*/
|
||||
this.vertices_ = vertices;
|
||||
|
||||
|
||||
};
|
||||
|
||||
goog.inherits(ol.geom.LineString, ol.geom.Geometry);
|
||||
|
||||
/**
|
||||
* Sets the LineString's points.
|
||||
*
|
||||
*
|
||||
* @return {Array.<ol.geom.Point>} An array of points.
|
||||
*/
|
||||
ol.geom.LineString.prototype.getVertices = function() {
|
||||
@@ -37,7 +38,7 @@ ol.geom.LineString.prototype.getVertices = function() {
|
||||
|
||||
/**
|
||||
* Gets the LineString's points.
|
||||
*
|
||||
*
|
||||
* @param {Array.<ol.geom.Point>} vertices An array of points.
|
||||
*/
|
||||
ol.geom.LineString.prototype.setVertices = function(vertices) {
|
||||
@@ -46,7 +47,7 @@ ol.geom.LineString.prototype.setVertices = function(vertices) {
|
||||
|
||||
/**
|
||||
* Adds the given vertex to the list of vertices at the specified index.
|
||||
*
|
||||
*
|
||||
* @param {ol.geom.Point} vertex A point to be added.
|
||||
* @param {number} index The index where to add.
|
||||
*/
|
||||
|
||||
@@ -4,12 +4,12 @@ goog.require('goog.array');
|
||||
goog.require('ol.geom.Collection');
|
||||
|
||||
/**
|
||||
* Creates ol.geom.MultiPoint objects.
|
||||
*
|
||||
* Creates ol.geom.MultiPoint objects.
|
||||
*
|
||||
* @export
|
||||
* @extends {ol.geom.Collection}
|
||||
* @param {Array.<ol.geom.Point>} points An array of points.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
ol.geom.MultiPoint = function(points) {
|
||||
@@ -18,14 +18,14 @@ ol.geom.MultiPoint = function(points) {
|
||||
if (arguments.length === 1 && goog.isDef(points)) {
|
||||
this.setPoints(points);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
goog.inherits(ol.geom.MultiPoint, ol.geom.Collection);
|
||||
|
||||
/**
|
||||
* Sets the MultiPoint's points.
|
||||
*
|
||||
*
|
||||
* @return {Array.<ol.geom.Point>} An array of points.
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.getPoints = function() {
|
||||
@@ -34,7 +34,7 @@ ol.geom.MultiPoint.prototype.getPoints = function() {
|
||||
|
||||
/**
|
||||
* Gets the MultiPoint's points.
|
||||
*
|
||||
*
|
||||
* @param {Array.<ol.geom.Point>} points An array of points.
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.setPoints = function(points) {
|
||||
@@ -43,7 +43,7 @@ ol.geom.MultiPoint.prototype.setPoints = function(points) {
|
||||
|
||||
/**
|
||||
* Adds the given point to the list of points at the specified index.
|
||||
*
|
||||
*
|
||||
* @param {ol.geom.Point} point A point to be added.
|
||||
* @param {number} index The index where to add.
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ ol.geom.MultiPoint.prototype.addPoint = function(point, index) {
|
||||
|
||||
/**
|
||||
* Removes the given point from the list of points.
|
||||
*
|
||||
*
|
||||
* @param {ol.geom.Point} point A point to be removed.
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.removePoint = function(point) {
|
||||
|
||||
Reference in New Issue
Block a user