Rename _ol_geom_LinearRing_ to LinearRing

This commit is contained in:
Tim Schaub
2017-12-14 09:01:39 -07:00
parent 504368369c
commit 64a0d40361
9 changed files with 51 additions and 51 deletions

View File

@@ -10,7 +10,7 @@ import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js';
import LineString from '../geom/LineString.js';
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import LinearRing from '../geom/LinearRing.js';
import MultiLineString from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import MultiPolygon from '../geom/MultiPolygon.js';
@@ -124,8 +124,8 @@ _ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
for (i = outerRings.length - 1; i >= 0; i--) {
var outerRing = outerRings[i][0];
var containsHole = containsExtent(
new _ol_geom_LinearRing_(outerRing).getExtent(),
new _ol_geom_LinearRing_(hole).getExtent()
new LinearRing(outerRing).getExtent(),
new LinearRing(hole).getExtent()
);
if (containsHole) {
// the hole is contained push it into our polygon

View File

@@ -11,7 +11,7 @@ import _ol_format_Feature_ from '../format/Feature.js';
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js';
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import LinearRing from '../geom/LinearRing.js';
import MultiLineString from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import MultiPolygon from '../geom/MultiPolygon.js';
@@ -404,7 +404,7 @@ _ol_format_GMLBase_.prototype.readLinearRing = function(node, objectStack) {
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var ring = new _ol_geom_LinearRing_(null);
var ring = new LinearRing(null);
ring.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
return ring;
} else {

View File

@@ -23,7 +23,7 @@ import _ol_geom_flat_simplify_ from '../geom/flat/simplify.js';
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
var _ol_geom_LinearRing_ = function(coordinates, opt_layout) {
var LinearRing = function(coordinates, opt_layout) {
_ol_geom_SimpleGeometry_.call(this);
@@ -43,7 +43,7 @@ var _ol_geom_LinearRing_ = function(coordinates, opt_layout) {
};
inherits(_ol_geom_LinearRing_, _ol_geom_SimpleGeometry_);
inherits(LinearRing, _ol_geom_SimpleGeometry_);
/**
@@ -52,8 +52,8 @@ inherits(_ol_geom_LinearRing_, _ol_geom_SimpleGeometry_);
* @override
* @api
*/
_ol_geom_LinearRing_.prototype.clone = function() {
var linearRing = new _ol_geom_LinearRing_(null);
LinearRing.prototype.clone = function() {
var linearRing = new LinearRing(null);
linearRing.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
return linearRing;
};
@@ -62,7 +62,7 @@ _ol_geom_LinearRing_.prototype.clone = function() {
/**
* @inheritDoc
*/
_ol_geom_LinearRing_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
LinearRing.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
return minSquaredDistance;
}
@@ -82,7 +82,7 @@ _ol_geom_LinearRing_.prototype.closestPointXY = function(x, y, closestPoint, min
* @return {number} Area (on projected plane).
* @api
*/
_ol_geom_LinearRing_.prototype.getArea = function() {
LinearRing.prototype.getArea = function() {
return _ol_geom_flat_area_.linearRing(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
};
@@ -94,7 +94,7 @@ _ol_geom_LinearRing_.prototype.getArea = function() {
* @override
* @api
*/
_ol_geom_LinearRing_.prototype.getCoordinates = function() {
LinearRing.prototype.getCoordinates = function() {
return _ol_geom_flat_inflate_.coordinates(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
};
@@ -103,12 +103,12 @@ _ol_geom_LinearRing_.prototype.getCoordinates = function() {
/**
* @inheritDoc
*/
_ol_geom_LinearRing_.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
LinearRing.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
var simplifiedFlatCoordinates = [];
simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.douglasPeucker(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
squaredTolerance, simplifiedFlatCoordinates, 0);
var simplifiedLinearRing = new _ol_geom_LinearRing_(null);
var simplifiedLinearRing = new LinearRing(null);
simplifiedLinearRing.setFlatCoordinates(
GeometryLayout.XY, simplifiedFlatCoordinates);
return simplifiedLinearRing;
@@ -119,7 +119,7 @@ _ol_geom_LinearRing_.prototype.getSimplifiedGeometryInternal = function(squaredT
* @inheritDoc
* @api
*/
_ol_geom_LinearRing_.prototype.getType = function() {
LinearRing.prototype.getType = function() {
return GeometryType.LINEAR_RING;
};
@@ -127,7 +127,7 @@ _ol_geom_LinearRing_.prototype.getType = function() {
/**
* @inheritDoc
*/
_ol_geom_LinearRing_.prototype.intersectsExtent = function(extent) {};
LinearRing.prototype.intersectsExtent = function(extent) {};
/**
@@ -137,7 +137,7 @@ _ol_geom_LinearRing_.prototype.intersectsExtent = function(extent) {};
* @override
* @api
*/
_ol_geom_LinearRing_.prototype.setCoordinates = function(coordinates, opt_layout) {
LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {
this.setFlatCoordinates(GeometryLayout.XY, null);
} else {
@@ -156,8 +156,8 @@ _ol_geom_LinearRing_.prototype.setCoordinates = function(coordinates, opt_layout
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
*/
_ol_geom_LinearRing_.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
LinearRing.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.changed();
};
export default _ol_geom_LinearRing_;
export default LinearRing;

View File

@@ -6,7 +6,7 @@ import _ol_array_ from '../array.js';
import {closestSquaredDistanceXY, getCenter} from '../extent.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js';
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import LinearRing from '../geom/LinearRing.js';
import Point from '../geom/Point.js';
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
import _ol_geom_flat_area_ from '../geom/flat/area.js';
@@ -245,7 +245,7 @@ Polygon.prototype.getLinearRing = function(index) {
if (index < 0 || this.ends_.length <= index) {
return null;
}
var linearRing = new _ol_geom_LinearRing_(null);
var linearRing = new LinearRing(null);
linearRing.setFlatCoordinates(this.layout, this.flatCoordinates.slice(
index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]));
return linearRing;
@@ -266,7 +266,7 @@ Polygon.prototype.getLinearRings = function() {
var i, ii;
for (i = 0, ii = ends.length; i < ii; ++i) {
var end = ends[i];
var linearRing = new _ol_geom_LinearRing_(null);
var linearRing = new LinearRing(null);
linearRing.setFlatCoordinates(layout, flatCoordinates.slice(offset, end));
linearRings.push(linearRing);
offset = end;