Prefer single line assignment to 80 character limit
This commit is contained in:
@@ -44,8 +44,7 @@ ol.geom.Circle.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.Circle.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.Circle.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
var flatCoordinates = this.flatCoordinates;
|
||||
var dx = x - flatCoordinates[0];
|
||||
var dy = y - flatCoordinates[1];
|
||||
@@ -187,8 +186,7 @@ ol.geom.Circle.prototype.setCenter = function(center) {
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api
|
||||
*/
|
||||
ol.geom.Circle.prototype.setCenterAndRadius =
|
||||
function(center, radius, opt_layout) {
|
||||
ol.geom.Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
|
||||
if (!center) {
|
||||
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
|
||||
} else {
|
||||
@@ -215,8 +213,7 @@ ol.geom.Circle.prototype.setCenterAndRadius =
|
||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
ol.geom.Circle.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates) {
|
||||
ol.geom.Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ ol.geom.flat.area.linearRing = function(flatCoordinates, offset, end, stride) {
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} Area.
|
||||
*/
|
||||
ol.geom.flat.area.linearRings =
|
||||
function(flatCoordinates, offset, ends, stride) {
|
||||
ol.geom.flat.area.linearRings = function(flatCoordinates, offset, ends, stride) {
|
||||
var area = 0;
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
@@ -50,8 +49,7 @@ ol.geom.flat.area.linearRings =
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} Area.
|
||||
*/
|
||||
ol.geom.flat.area.linearRingss =
|
||||
function(flatCoordinates, offset, endss, stride) {
|
||||
ol.geom.flat.area.linearRingss = function(flatCoordinates, offset, endss, stride) {
|
||||
var area = 0;
|
||||
var i, ii;
|
||||
for (i = 0, ii = endss.length; i < ii; ++i) {
|
||||
|
||||
@@ -10,8 +10,7 @@ goog.require('ol.extent');
|
||||
* @param {number} stride Stride.
|
||||
* @return {Array.<number>} Flat centers.
|
||||
*/
|
||||
ol.geom.flat.center.linearRingss =
|
||||
function(flatCoordinates, offset, endss, stride) {
|
||||
ol.geom.flat.center.linearRingss = function(flatCoordinates, offset, endss, stride) {
|
||||
var flatCenters = [];
|
||||
var i, ii;
|
||||
var extent = ol.extent.createEmpty();
|
||||
|
||||
@@ -17,8 +17,7 @@ goog.require('ol.math');
|
||||
* @param {number} y Y.
|
||||
* @param {Array.<number>} closestPoint Closest point.
|
||||
*/
|
||||
ol.geom.flat.closest.point =
|
||||
function(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
|
||||
ol.geom.flat.closest.point = function(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
|
||||
var x1 = flatCoordinates[offset1];
|
||||
var y1 = flatCoordinates[offset1 + 1];
|
||||
var dx = flatCoordinates[offset2] - x1;
|
||||
@@ -58,8 +57,7 @@ ol.geom.flat.closest.point =
|
||||
* @param {number} maxSquaredDelta Max squared delta.
|
||||
* @return {number} Max squared delta.
|
||||
*/
|
||||
ol.geom.flat.closest.getMaxSquaredDelta =
|
||||
function(flatCoordinates, offset, end, stride, maxSquaredDelta) {
|
||||
ol.geom.flat.closest.getMaxSquaredDelta = function(flatCoordinates, offset, end, stride, maxSquaredDelta) {
|
||||
var x1 = flatCoordinates[offset];
|
||||
var y1 = flatCoordinates[offset + 1];
|
||||
for (offset += stride; offset < end; offset += stride) {
|
||||
@@ -84,8 +82,7 @@ ol.geom.flat.closest.getMaxSquaredDelta =
|
||||
* @param {number} maxSquaredDelta Max squared delta.
|
||||
* @return {number} Max squared delta.
|
||||
*/
|
||||
ol.geom.flat.closest.getsMaxSquaredDelta =
|
||||
function(flatCoordinates, offset, ends, stride, maxSquaredDelta) {
|
||||
ol.geom.flat.closest.getsMaxSquaredDelta = function(flatCoordinates, offset, ends, stride, maxSquaredDelta) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
var end = ends[i];
|
||||
@@ -105,8 +102,7 @@ ol.geom.flat.closest.getsMaxSquaredDelta =
|
||||
* @param {number} maxSquaredDelta Max squared delta.
|
||||
* @return {number} Max squared delta.
|
||||
*/
|
||||
ol.geom.flat.closest.getssMaxSquaredDelta =
|
||||
function(flatCoordinates, offset, endss, stride, maxSquaredDelta) {
|
||||
ol.geom.flat.closest.getssMaxSquaredDelta = function(flatCoordinates, offset, endss, stride, maxSquaredDelta) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = endss.length; i < ii; ++i) {
|
||||
var ends = endss[i];
|
||||
|
||||
@@ -12,8 +12,7 @@ goog.require('ol.extent');
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} Contains extent.
|
||||
*/
|
||||
ol.geom.flat.contains.linearRingContainsExtent =
|
||||
function(flatCoordinates, offset, end, stride, extent) {
|
||||
ol.geom.flat.contains.linearRingContainsExtent = function(flatCoordinates, offset, end, stride, extent) {
|
||||
var outside = ol.extent.forEachCorner(extent,
|
||||
/**
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
@@ -35,8 +34,7 @@ ol.geom.flat.contains.linearRingContainsExtent =
|
||||
* @param {number} y Y.
|
||||
* @return {boolean} Contains (x, y).
|
||||
*/
|
||||
ol.geom.flat.contains.linearRingContainsXY =
|
||||
function(flatCoordinates, offset, end, stride, x, y) {
|
||||
ol.geom.flat.contains.linearRingContainsXY = function(flatCoordinates, offset, end, stride, x, y) {
|
||||
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
||||
var contains = false;
|
||||
var x1 = flatCoordinates[end - stride];
|
||||
@@ -65,8 +63,7 @@ ol.geom.flat.contains.linearRingContainsXY =
|
||||
* @param {number} y Y.
|
||||
* @return {boolean} Contains (x, y).
|
||||
*/
|
||||
ol.geom.flat.contains.linearRingsContainsXY =
|
||||
function(flatCoordinates, offset, ends, stride, x, y) {
|
||||
ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset, ends, stride, x, y) {
|
||||
goog.asserts.assert(ends.length > 0, 'ends should not be an empty array');
|
||||
if (ends.length === 0) {
|
||||
return false;
|
||||
@@ -95,8 +92,7 @@ ol.geom.flat.contains.linearRingsContainsXY =
|
||||
* @param {number} y Y.
|
||||
* @return {boolean} Contains (x, y).
|
||||
*/
|
||||
ol.geom.flat.contains.linearRingssContainsXY =
|
||||
function(flatCoordinates, offset, endss, stride, x, y) {
|
||||
ol.geom.flat.contains.linearRingssContainsXY = function(flatCoordinates, offset, endss, stride, x, y) {
|
||||
goog.asserts.assert(endss.length > 0, 'endss should not be an empty array');
|
||||
if (endss.length === 0) {
|
||||
return false;
|
||||
|
||||
@@ -10,8 +10,7 @@ goog.require('goog.asserts');
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} offset Offset.
|
||||
*/
|
||||
ol.geom.flat.deflate.coordinate =
|
||||
function(flatCoordinates, offset, coordinate, stride) {
|
||||
ol.geom.flat.deflate.coordinate = function(flatCoordinates, offset, coordinate, stride) {
|
||||
goog.asserts.assert(coordinate.length == stride,
|
||||
'length of the coordinate array should match stride');
|
||||
var i, ii;
|
||||
@@ -29,8 +28,7 @@ ol.geom.flat.deflate.coordinate =
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} offset Offset.
|
||||
*/
|
||||
ol.geom.flat.deflate.coordinates =
|
||||
function(flatCoordinates, offset, coordinates, stride) {
|
||||
ol.geom.flat.deflate.coordinates = function(flatCoordinates, offset, coordinates, stride) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
var coordinate = coordinates[i];
|
||||
@@ -53,8 +51,7 @@ ol.geom.flat.deflate.coordinates =
|
||||
* @param {Array.<number>=} opt_ends Ends.
|
||||
* @return {Array.<number>} Ends.
|
||||
*/
|
||||
ol.geom.flat.deflate.coordinatess =
|
||||
function(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
||||
ol.geom.flat.deflate.coordinatess = function(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
||||
var ends = opt_ends ? opt_ends : [];
|
||||
var i = 0;
|
||||
var j, jj;
|
||||
@@ -77,8 +74,7 @@ ol.geom.flat.deflate.coordinatess =
|
||||
* @param {Array.<Array.<number>>=} opt_endss Endss.
|
||||
* @return {Array.<Array.<number>>} Endss.
|
||||
*/
|
||||
ol.geom.flat.deflate.coordinatesss =
|
||||
function(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
||||
ol.geom.flat.deflate.coordinatesss = function(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
||||
var endss = opt_endss ? opt_endss : [];
|
||||
var i = 0;
|
||||
var j, jj;
|
||||
|
||||
@@ -12,8 +12,7 @@ goog.require('goog.asserts');
|
||||
* @param {number=} opt_destOffset Destination offset.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
ol.geom.flat.flip.flipXY =
|
||||
function(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) {
|
||||
ol.geom.flat.flip.flipXY = function(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) {
|
||||
var dest, destOffset;
|
||||
if (opt_dest !== undefined) {
|
||||
dest = opt_dest;
|
||||
|
||||
@@ -14,8 +14,7 @@ goog.require('ol.proj');
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
ol.geom.flat.geodesic.line_ =
|
||||
function(interpolate, transform, squaredTolerance) {
|
||||
ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance) {
|
||||
// FIXME reduce garbage generation
|
||||
// FIXME optimize stack operations
|
||||
|
||||
@@ -141,8 +140,7 @@ ol.geom.flat.geodesic.greatCircleArc = function(
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
ol.geom.flat.geodesic.meridian =
|
||||
function(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
ol.geom.flat.geodesic.meridian = function(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
var epsg4326Projection = ol.proj.get('EPSG:4326');
|
||||
return ol.geom.flat.geodesic.line_(
|
||||
/**
|
||||
@@ -165,8 +163,7 @@ ol.geom.flat.geodesic.meridian =
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
ol.geom.flat.geodesic.parallel =
|
||||
function(lat, lon1, lon2, projection, squaredTolerance) {
|
||||
ol.geom.flat.geodesic.parallel = function(lat, lon1, lon2, projection, squaredTolerance) {
|
||||
var epsg4326Projection = ol.proj.get('EPSG:4326');
|
||||
return ol.geom.flat.geodesic.line_(
|
||||
/**
|
||||
|
||||
@@ -9,8 +9,7 @@ goog.provide('ol.geom.flat.inflate');
|
||||
* @param {Array.<ol.Coordinate>=} opt_coordinates Coordinates.
|
||||
* @return {Array.<ol.Coordinate>} Coordinates.
|
||||
*/
|
||||
ol.geom.flat.inflate.coordinates =
|
||||
function(flatCoordinates, offset, end, stride, opt_coordinates) {
|
||||
ol.geom.flat.inflate.coordinates = function(flatCoordinates, offset, end, stride, opt_coordinates) {
|
||||
var coordinates = opt_coordinates !== undefined ? opt_coordinates : [];
|
||||
var i = 0;
|
||||
var j;
|
||||
@@ -30,8 +29,7 @@ ol.geom.flat.inflate.coordinates =
|
||||
* @param {Array.<Array.<ol.Coordinate>>=} opt_coordinatess Coordinatess.
|
||||
* @return {Array.<Array.<ol.Coordinate>>} Coordinatess.
|
||||
*/
|
||||
ol.geom.flat.inflate.coordinatess =
|
||||
function(flatCoordinates, offset, ends, stride, opt_coordinatess) {
|
||||
ol.geom.flat.inflate.coordinatess = function(flatCoordinates, offset, ends, stride, opt_coordinatess) {
|
||||
var coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];
|
||||
var i = 0;
|
||||
var j, jj;
|
||||
@@ -55,8 +53,7 @@ ol.geom.flat.inflate.coordinatess =
|
||||
* Coordinatesss.
|
||||
* @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinatesss.
|
||||
*/
|
||||
ol.geom.flat.inflate.coordinatesss =
|
||||
function(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
|
||||
ol.geom.flat.inflate.coordinatesss = function(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
|
||||
var coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];
|
||||
var i = 0;
|
||||
var j, jj;
|
||||
|
||||
@@ -78,8 +78,7 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
|
||||
* @param {Array.<number>} flatCenters Flat centers.
|
||||
* @return {Array.<number>} Interior points.
|
||||
*/
|
||||
ol.geom.flat.interiorpoint.linearRingss =
|
||||
function(flatCoordinates, offset, endss, stride, flatCenters) {
|
||||
ol.geom.flat.interiorpoint.linearRingss = function(flatCoordinates, offset, endss, stride, flatCenters) {
|
||||
goog.asserts.assert(2 * endss.length == flatCenters.length,
|
||||
'endss.length times 2 should be flatCenters.length');
|
||||
var interiorPoints = [];
|
||||
|
||||
@@ -14,8 +14,7 @@ goog.require('goog.math');
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Destination.
|
||||
*/
|
||||
ol.geom.flat.interpolate.lineString =
|
||||
function(flatCoordinates, offset, end, stride, fraction, opt_dest) {
|
||||
ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, stride, fraction, opt_dest) {
|
||||
// FIXME interpolate extra dimensions
|
||||
goog.asserts.assert(0 <= fraction && fraction <= 1,
|
||||
'fraction should be in between 0 and 1');
|
||||
@@ -80,8 +79,7 @@ ol.geom.flat.interpolate.lineString =
|
||||
* @param {boolean} extrapolate Extrapolate.
|
||||
* @return {ol.Coordinate} Coordinate.
|
||||
*/
|
||||
ol.geom.flat.lineStringCoordinateAtM =
|
||||
function(flatCoordinates, offset, end, stride, m, extrapolate) {
|
||||
ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, stride, m, extrapolate) {
|
||||
if (end == offset) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ goog.require('ol.geom.flat.segments');
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
ol.geom.flat.intersectsextent.lineString =
|
||||
function(flatCoordinates, offset, end, stride, extent) {
|
||||
ol.geom.flat.intersectsextent.lineString = function(flatCoordinates, offset, end, stride, extent) {
|
||||
var coordinatesExtent = ol.extent.extendFlatCoordinates(
|
||||
ol.extent.createEmpty(), flatCoordinates, offset, end, stride);
|
||||
if (!ol.extent.intersects(extent, coordinatesExtent)) {
|
||||
@@ -53,8 +52,7 @@ ol.geom.flat.intersectsextent.lineString =
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
ol.geom.flat.intersectsextent.lineStrings =
|
||||
function(flatCoordinates, offset, ends, stride, extent) {
|
||||
ol.geom.flat.intersectsextent.lineStrings = function(flatCoordinates, offset, ends, stride, extent) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
if (ol.geom.flat.intersectsextent.lineString(
|
||||
@@ -75,8 +73,7 @@ ol.geom.flat.intersectsextent.lineStrings =
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
ol.geom.flat.intersectsextent.linearRing =
|
||||
function(flatCoordinates, offset, end, stride, extent) {
|
||||
ol.geom.flat.intersectsextent.linearRing = function(flatCoordinates, offset, end, stride, extent) {
|
||||
if (ol.geom.flat.intersectsextent.lineString(
|
||||
flatCoordinates, offset, end, stride, extent)) {
|
||||
return true;
|
||||
@@ -109,8 +106,7 @@ ol.geom.flat.intersectsextent.linearRing =
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
ol.geom.flat.intersectsextent.linearRings =
|
||||
function(flatCoordinates, offset, ends, stride, extent) {
|
||||
ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, ends, stride, extent) {
|
||||
goog.asserts.assert(ends.length > 0, 'ends should not be an empty array');
|
||||
if (!ol.geom.flat.intersectsextent.linearRing(
|
||||
flatCoordinates, offset, ends[0], stride, extent)) {
|
||||
@@ -138,8 +134,7 @@ ol.geom.flat.intersectsextent.linearRings =
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
ol.geom.flat.intersectsextent.linearRingss =
|
||||
function(flatCoordinates, offset, endss, stride, extent) {
|
||||
ol.geom.flat.intersectsextent.linearRingss = function(flatCoordinates, offset, endss, stride, extent) {
|
||||
goog.asserts.assert(endss.length > 0, 'endss should not be an empty array');
|
||||
var i, ii;
|
||||
for (i = 0, ii = endss.length; i < ii; ++i) {
|
||||
|
||||
@@ -8,8 +8,7 @@ goog.provide('ol.geom.flat.length');
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} Length.
|
||||
*/
|
||||
ol.geom.flat.length.lineString =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.geom.flat.length.lineString = function(flatCoordinates, offset, end, stride) {
|
||||
var x1 = flatCoordinates[offset];
|
||||
var y1 = flatCoordinates[offset + 1];
|
||||
var length = 0;
|
||||
@@ -32,8 +31,7 @@ ol.geom.flat.length.lineString =
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} Perimeter.
|
||||
*/
|
||||
ol.geom.flat.length.linearRing =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.geom.flat.length.linearRing = function(flatCoordinates, offset, end, stride) {
|
||||
var perimeter =
|
||||
ol.geom.flat.length.lineString(flatCoordinates, offset, end, stride);
|
||||
var dx = flatCoordinates[end - stride] - flatCoordinates[offset];
|
||||
|
||||
@@ -11,8 +11,7 @@ goog.require('ol.geom.flat.reverse');
|
||||
* @param {number} stride Stride.
|
||||
* @return {boolean} Is clockwise.
|
||||
*/
|
||||
ol.geom.flat.orient.linearRingIsClockwise =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.geom.flat.orient.linearRingIsClockwise = function(flatCoordinates, offset, end, stride) {
|
||||
// http://tinyurl.com/clockwise-method
|
||||
// https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrlinearring.cpp
|
||||
var edge = 0;
|
||||
@@ -42,8 +41,7 @@ ol.geom.flat.orient.linearRingIsClockwise =
|
||||
* (counter-clockwise exterior ring and clockwise interior rings).
|
||||
* @return {boolean} Rings are correctly oriented.
|
||||
*/
|
||||
ol.geom.flat.orient.linearRingsAreOriented =
|
||||
function(flatCoordinates, offset, ends, stride, opt_right) {
|
||||
ol.geom.flat.orient.linearRingsAreOriented = function(flatCoordinates, offset, ends, stride, opt_right) {
|
||||
var right = opt_right !== undefined ? opt_right : false;
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
@@ -78,8 +76,7 @@ ol.geom.flat.orient.linearRingsAreOriented =
|
||||
* (counter-clockwise exterior ring and clockwise interior rings).
|
||||
* @return {boolean} Rings are correctly oriented.
|
||||
*/
|
||||
ol.geom.flat.orient.linearRingssAreOriented =
|
||||
function(flatCoordinates, offset, endss, stride, opt_right) {
|
||||
ol.geom.flat.orient.linearRingssAreOriented = function(flatCoordinates, offset, endss, stride, opt_right) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = endss.length; i < ii; ++i) {
|
||||
if (!ol.geom.flat.orient.linearRingsAreOriented(
|
||||
@@ -104,8 +101,7 @@ ol.geom.flat.orient.linearRingssAreOriented =
|
||||
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
||||
* @return {number} End.
|
||||
*/
|
||||
ol.geom.flat.orient.orientLinearRings =
|
||||
function(flatCoordinates, offset, ends, stride, opt_right) {
|
||||
ol.geom.flat.orient.orientLinearRings = function(flatCoordinates, offset, ends, stride, opt_right) {
|
||||
var right = opt_right !== undefined ? opt_right : false;
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
@@ -137,8 +133,7 @@ ol.geom.flat.orient.orientLinearRings =
|
||||
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
||||
* @return {number} End.
|
||||
*/
|
||||
ol.geom.flat.orient.orientLinearRingss =
|
||||
function(flatCoordinates, offset, endss, stride, opt_right) {
|
||||
ol.geom.flat.orient.orientLinearRingss = function(flatCoordinates, offset, endss, stride, opt_right) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = endss.length; i < ii; ++i) {
|
||||
offset = ol.geom.flat.orient.orientLinearRings(
|
||||
|
||||
@@ -7,8 +7,7 @@ goog.provide('ol.geom.flat.reverse');
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
*/
|
||||
ol.geom.flat.reverse.coordinates =
|
||||
function(flatCoordinates, offset, end, stride) {
|
||||
ol.geom.flat.reverse.coordinates = function(flatCoordinates, offset, end, stride) {
|
||||
while (offset < end - stride) {
|
||||
var i;
|
||||
for (i = 0; i < stride; ++i) {
|
||||
|
||||
@@ -16,8 +16,7 @@ goog.provide('ol.geom.flat.segments');
|
||||
* @return {T|boolean} Value.
|
||||
* @template T,S
|
||||
*/
|
||||
ol.geom.flat.segments.forEach =
|
||||
function(flatCoordinates, offset, end, stride, callback, opt_this) {
|
||||
ol.geom.flat.segments.forEach = function(flatCoordinates, offset, end, stride, callback, opt_this) {
|
||||
var point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]];
|
||||
var point2 = [];
|
||||
var ret;
|
||||
|
||||
@@ -12,8 +12,7 @@ goog.require('goog.vec.Mat4');
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
*/
|
||||
ol.geom.flat.transform.transform2D =
|
||||
function(flatCoordinates, offset, end, stride, transform, opt_dest) {
|
||||
ol.geom.flat.transform.transform2D = function(flatCoordinates, offset, end, stride, transform, opt_dest) {
|
||||
var m00 = goog.vec.Mat4.getElement(transform, 0, 0);
|
||||
var m10 = goog.vec.Mat4.getElement(transform, 1, 0);
|
||||
var m01 = goog.vec.Mat4.getElement(transform, 0, 1);
|
||||
@@ -46,8 +45,7 @@ ol.geom.flat.transform.transform2D =
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
*/
|
||||
ol.geom.flat.transform.translate =
|
||||
function(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {
|
||||
ol.geom.flat.transform.translate = function(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {
|
||||
var dest = opt_dest ? opt_dest : [];
|
||||
var i = 0;
|
||||
var j, k;
|
||||
|
||||
@@ -95,8 +95,7 @@ ol.geom.GeometryCollection.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.GeometryCollection.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.GeometryCollection.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -160,8 +159,7 @@ ol.geom.GeometryCollection.prototype.getGeometriesArray = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.GeometryCollection.prototype.getSimplifiedGeometry =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = function(squaredTolerance) {
|
||||
if (this.simplifiedGeometryRevision != this.getRevision()) {
|
||||
goog.object.clear(this.simplifiedGeometryCache);
|
||||
this.simplifiedGeometryMaxMinSquaredTolerance = 0;
|
||||
|
||||
@@ -60,8 +60,7 @@ ol.geom.LinearRing.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.LinearRing.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -102,8 +101,7 @@ ol.geom.LinearRing.prototype.getCoordinates = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
simplifiedFlatCoordinates.length = ol.geom.flat.simplify.douglasPeucker(
|
||||
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
|
||||
@@ -130,8 +128,7 @@ ol.geom.LinearRing.prototype.getType = function() {
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.setCoordinates =
|
||||
function(coordinates, opt_layout) {
|
||||
ol.geom.LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
|
||||
} else {
|
||||
@@ -150,8 +147,7 @@ ol.geom.LinearRing.prototype.setCoordinates =
|
||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates) {
|
||||
ol.geom.LinearRing.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -94,8 +94,7 @@ ol.geom.LineString.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LineString.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.LineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -209,8 +208,7 @@ ol.geom.LineString.prototype.getFlatMidpoint = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LineString.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.LineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
simplifiedFlatCoordinates.length = ol.geom.flat.simplify.douglasPeucker(
|
||||
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
|
||||
@@ -248,8 +246,7 @@ ol.geom.LineString.prototype.intersectsExtent = function(extent) {
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.LineString.prototype.setCoordinates =
|
||||
function(coordinates, opt_layout) {
|
||||
ol.geom.LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
|
||||
} else {
|
||||
@@ -268,8 +265,7 @@ ol.geom.LineString.prototype.setCoordinates =
|
||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
ol.geom.LineString.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates) {
|
||||
ol.geom.LineString.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -90,8 +90,7 @@ ol.geom.MultiLineString.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.MultiLineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -129,8 +128,7 @@ ol.geom.MultiLineString.prototype.closestPointXY =
|
||||
* @return {ol.Coordinate} Coordinate.
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.getCoordinateAtM =
|
||||
function(m, opt_extrapolate, opt_interpolate) {
|
||||
ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
|
||||
if ((this.layout != ol.geom.GeometryLayout.XYM &&
|
||||
this.layout != ol.geom.GeometryLayout.XYZM) ||
|
||||
this.flatCoordinates.length === 0) {
|
||||
@@ -229,8 +227,7 @@ ol.geom.MultiLineString.prototype.getFlatMidpoints = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
var simplifiedEnds = [];
|
||||
simplifiedFlatCoordinates.length = ol.geom.flat.simplify.douglasPeuckers(
|
||||
@@ -268,8 +265,7 @@ ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) {
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.setCoordinates =
|
||||
function(coordinates, opt_layout) {
|
||||
ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.ends_);
|
||||
} else {
|
||||
@@ -290,8 +286,7 @@ ol.geom.MultiLineString.prototype.setCoordinates =
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates, ends) {
|
||||
ol.geom.MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
||||
if (!flatCoordinates) {
|
||||
goog.asserts.assert(ends && ends.length === 0,
|
||||
'ends must be truthy and ends.length should be 0');
|
||||
|
||||
@@ -62,8 +62,7 @@ ol.geom.MultiPoint.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.MultiPoint.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -173,8 +172,7 @@ ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) {
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.setCoordinates =
|
||||
function(coordinates, opt_layout) {
|
||||
ol.geom.MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
|
||||
} else {
|
||||
@@ -193,8 +191,7 @@ ol.geom.MultiPoint.prototype.setCoordinates =
|
||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates) {
|
||||
ol.geom.MultiPoint.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -131,8 +131,7 @@ ol.geom.MultiPolygon.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.MultiPolygon.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -257,8 +256,7 @@ ol.geom.MultiPolygon.prototype.getOrientedFlatCoordinates = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
var simplifiedEndss = [];
|
||||
simplifiedFlatCoordinates.length = ol.geom.flat.simplify.quantizess(
|
||||
@@ -361,8 +359,7 @@ ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) {
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.setCoordinates =
|
||||
function(coordinates, opt_layout) {
|
||||
ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.endss_);
|
||||
} else {
|
||||
@@ -389,8 +386,7 @@ ol.geom.MultiPolygon.prototype.setCoordinates =
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates, endss) {
|
||||
ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) {
|
||||
goog.asserts.assert(endss, 'endss must be truthy');
|
||||
if (!flatCoordinates || flatCoordinates.length === 0) {
|
||||
goog.asserts.assert(endss.length === 0, 'the length of endss should be 0');
|
||||
|
||||
@@ -41,8 +41,7 @@ ol.geom.Point.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.Point.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.Point.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
var flatCoordinates = this.flatCoordinates;
|
||||
var squaredDistance = ol.math.squaredDistance(
|
||||
x, y, flatCoordinates[0], flatCoordinates[1]);
|
||||
|
||||
@@ -118,8 +118,7 @@ ol.geom.Polygon.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.Polygon.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
ol.geom.Polygon.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
@@ -298,8 +297,7 @@ ol.geom.Polygon.prototype.getOrientedFlatCoordinates = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.Polygon.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.Polygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
var simplifiedEnds = [];
|
||||
simplifiedFlatCoordinates.length = ol.geom.flat.simplify.quantizes(
|
||||
@@ -359,8 +357,7 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
*/
|
||||
ol.geom.Polygon.prototype.setFlatCoordinates =
|
||||
function(layout, flatCoordinates, ends) {
|
||||
ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
||||
if (!flatCoordinates) {
|
||||
goog.asserts.assert(ends && ends.length === 0,
|
||||
'ends must be an empty array');
|
||||
|
||||
@@ -145,8 +145,7 @@ ol.geom.SimpleGeometry.prototype.getLayout = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {
|
||||
if (this.simplifiedGeometryRevision != this.getRevision()) {
|
||||
goog.object.clear(this.simplifiedGeometryCache);
|
||||
this.simplifiedGeometryMaxMinSquaredTolerance = 0;
|
||||
@@ -188,8 +187,7 @@ ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry =
|
||||
* @return {ol.geom.SimpleGeometry} Simplified geometry.
|
||||
* @protected
|
||||
*/
|
||||
ol.geom.SimpleGeometry.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
ol.geom.SimpleGeometry.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -207,8 +205,7 @@ ol.geom.SimpleGeometry.prototype.getStride = function() {
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @protected
|
||||
*/
|
||||
ol.geom.SimpleGeometry.prototype.setFlatCoordinatesInternal =
|
||||
function(layout, flatCoordinates) {
|
||||
ol.geom.SimpleGeometry.prototype.setFlatCoordinatesInternal = function(layout, flatCoordinates) {
|
||||
this.stride = ol.geom.SimpleGeometry.getStrideForLayout(layout);
|
||||
this.layout = layout;
|
||||
this.flatCoordinates = flatCoordinates;
|
||||
@@ -228,8 +225,7 @@ ol.geom.SimpleGeometry.prototype.setCoordinates = goog.abstractMethod;
|
||||
* @param {number} nesting Nesting.
|
||||
* @protected
|
||||
*/
|
||||
ol.geom.SimpleGeometry.prototype.setLayout =
|
||||
function(layout, coordinates, nesting) {
|
||||
ol.geom.SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesting) {
|
||||
/** @type {number} */
|
||||
var stride;
|
||||
if (layout) {
|
||||
@@ -287,8 +283,7 @@ ol.geom.SimpleGeometry.prototype.translate = function(deltaX, deltaY) {
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed flat coordinates.
|
||||
*/
|
||||
ol.geom.transformSimpleGeometry2D =
|
||||
function(simpleGeometry, transform, opt_dest) {
|
||||
ol.geom.transformSimpleGeometry2D = function(simpleGeometry, transform, opt_dest) {
|
||||
var flatCoordinates = simpleGeometry.getFlatCoordinates();
|
||||
if (!flatCoordinates) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user