Rename _ol_geom_MultiLineString_ to MultiLineString
This commit is contained in:
@@ -25,7 +25,7 @@ import _ol_geom_flat_simplify_ from '../geom/flat/simplify.js';
|
||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||
* @api
|
||||
*/
|
||||
var _ol_geom_MultiLineString_ = function(coordinates, opt_layout) {
|
||||
var MultiLineString = function(coordinates, opt_layout) {
|
||||
|
||||
_ol_geom_SimpleGeometry_.call(this);
|
||||
|
||||
@@ -51,7 +51,7 @@ var _ol_geom_MultiLineString_ = function(coordinates, opt_layout) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_geom_MultiLineString_, _ol_geom_SimpleGeometry_);
|
||||
inherits(MultiLineString, _ol_geom_SimpleGeometry_);
|
||||
|
||||
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ inherits(_ol_geom_MultiLineString_, _ol_geom_SimpleGeometry_);
|
||||
* @param {ol.geom.LineString} lineString LineString.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.appendLineString = function(lineString) {
|
||||
MultiLineString.prototype.appendLineString = function(lineString) {
|
||||
if (!this.flatCoordinates) {
|
||||
this.flatCoordinates = lineString.getFlatCoordinates().slice();
|
||||
} else {
|
||||
@@ -77,8 +77,8 @@ _ol_geom_MultiLineString_.prototype.appendLineString = function(lineString) {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.clone = function() {
|
||||
var multiLineString = new _ol_geom_MultiLineString_(null);
|
||||
MultiLineString.prototype.clone = function() {
|
||||
var multiLineString = new MultiLineString(null);
|
||||
multiLineString.setFlatCoordinates(
|
||||
this.layout, this.flatCoordinates.slice(), this.ends_.slice());
|
||||
return multiLineString;
|
||||
@@ -88,7 +88,7 @@ _ol_geom_MultiLineString_.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
MultiLineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ _ol_geom_MultiLineString_.prototype.closestPointXY = function(x, y, closestPoint
|
||||
* @return {ol.Coordinate} Coordinate.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
|
||||
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) {
|
||||
@@ -144,7 +144,7 @@ _ol_geom_MultiLineString_.prototype.getCoordinateAtM = function(m, opt_extrapola
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getCoordinates = function() {
|
||||
MultiLineString.prototype.getCoordinates = function() {
|
||||
return _ol_geom_flat_inflate_.coordinatess(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride);
|
||||
};
|
||||
@@ -153,7 +153,7 @@ _ol_geom_MultiLineString_.prototype.getCoordinates = function() {
|
||||
/**
|
||||
* @return {Array.<number>} Ends.
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getEnds = function() {
|
||||
MultiLineString.prototype.getEnds = function() {
|
||||
return this.ends_;
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@ _ol_geom_MultiLineString_.prototype.getEnds = function() {
|
||||
* @return {ol.geom.LineString} LineString.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getLineString = function(index) {
|
||||
MultiLineString.prototype.getLineString = function(index) {
|
||||
if (index < 0 || this.ends_.length <= index) {
|
||||
return null;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ _ol_geom_MultiLineString_.prototype.getLineString = function(index) {
|
||||
* @return {Array.<ol.geom.LineString>} LineStrings.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getLineStrings = function() {
|
||||
MultiLineString.prototype.getLineStrings = function() {
|
||||
var flatCoordinates = this.flatCoordinates;
|
||||
var ends = this.ends_;
|
||||
var layout = this.layout;
|
||||
@@ -202,7 +202,7 @@ _ol_geom_MultiLineString_.prototype.getLineStrings = function() {
|
||||
/**
|
||||
* @return {Array.<number>} Flat midpoints.
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getFlatMidpoints = function() {
|
||||
MultiLineString.prototype.getFlatMidpoints = function() {
|
||||
var midpoints = [];
|
||||
var flatCoordinates = this.flatCoordinates;
|
||||
var offset = 0;
|
||||
@@ -223,13 +223,13 @@ _ol_geom_MultiLineString_.prototype.getFlatMidpoints = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
MultiLineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
var simplifiedEnds = [];
|
||||
simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.douglasPeuckers(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride, squaredTolerance,
|
||||
simplifiedFlatCoordinates, 0, simplifiedEnds);
|
||||
var simplifiedMultiLineString = new _ol_geom_MultiLineString_(null);
|
||||
var simplifiedMultiLineString = new MultiLineString(null);
|
||||
simplifiedMultiLineString.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEnds);
|
||||
return simplifiedMultiLineString;
|
||||
@@ -240,7 +240,7 @@ _ol_geom_MultiLineString_.prototype.getSimplifiedGeometryInternal = function(squ
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.getType = function() {
|
||||
MultiLineString.prototype.getType = function() {
|
||||
return _ol_geom_GeometryType_.MULTI_LINE_STRING;
|
||||
};
|
||||
|
||||
@@ -249,7 +249,7 @@ _ol_geom_MultiLineString_.prototype.getType = function() {
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.intersectsExtent = function(extent) {
|
||||
MultiLineString.prototype.intersectsExtent = function(extent) {
|
||||
return _ol_geom_flat_intersectsextent_.lineStrings(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride, extent);
|
||||
};
|
||||
@@ -262,7 +262,7 @@ _ol_geom_MultiLineString_.prototype.intersectsExtent = function(extent) {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.ends_);
|
||||
} else {
|
||||
@@ -283,7 +283,7 @@ _ol_geom_MultiLineString_.prototype.setCoordinates = function(coordinates, opt_l
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
||||
MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||
this.ends_ = ends;
|
||||
this.changed();
|
||||
@@ -293,7 +293,7 @@ _ol_geom_MultiLineString_.prototype.setFlatCoordinates = function(layout, flatCo
|
||||
/**
|
||||
* @param {Array.<ol.geom.LineString>} lineStrings LineStrings.
|
||||
*/
|
||||
_ol_geom_MultiLineString_.prototype.setLineStrings = function(lineStrings) {
|
||||
MultiLineString.prototype.setLineStrings = function(lineStrings) {
|
||||
var layout = this.getLayout();
|
||||
var flatCoordinates = [];
|
||||
var ends = [];
|
||||
@@ -308,4 +308,4 @@ _ol_geom_MultiLineString_.prototype.setLineStrings = function(lineStrings) {
|
||||
}
|
||||
this.setFlatCoordinates(layout, flatCoordinates, ends);
|
||||
};
|
||||
export default _ol_geom_MultiLineString_;
|
||||
export default MultiLineString;
|
||||
|
||||
Reference in New Issue
Block a user