Rename _ol_geom_GeometryLayout_ to GeometryLayout
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import _ol_coordinate_ from './coordinate.js';
|
||||
import {intersects, getCenter} from './extent.js';
|
||||
import _ol_geom_GeometryLayout_ from './geom/GeometryLayout.js';
|
||||
import GeometryLayout from './geom/GeometryLayout.js';
|
||||
import LineString from './geom/LineString.js';
|
||||
import Point from './geom/Point.js';
|
||||
import _ol_geom_flat_geodesic_ from './geom/flat/geodesic.js';
|
||||
@@ -492,7 +492,7 @@ _ol_Graticule_.prototype.getMeridian_ = function(lon, minLat, maxLat,
|
||||
minLat, maxLat, this.projection_, squaredTolerance);
|
||||
var lineString = this.meridians_[index] !== undefined ?
|
||||
this.meridians_[index] : new LineString(null);
|
||||
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates);
|
||||
lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||
return lineString;
|
||||
};
|
||||
|
||||
@@ -522,7 +522,7 @@ _ol_Graticule_.prototype.getParallel_ = function(lat, minLon, maxLon,
|
||||
minLon, maxLon, this.projection_, squaredTolerance);
|
||||
var lineString = this.parallels_[index] !== undefined ?
|
||||
this.parallels_[index] : new LineString(null);
|
||||
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates);
|
||||
lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||
return lineString;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_asserts_ from '../asserts.js';
|
||||
import {containsExtent} from '../extent.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
||||
@@ -153,13 +153,13 @@ _ol_format_EsriJSON_.readPointGeometry_ = function(object) {
|
||||
var point;
|
||||
if (object.m !== undefined && object.z !== undefined) {
|
||||
point = new Point([object.x, object.y, object.z, object.m],
|
||||
_ol_geom_GeometryLayout_.XYZM);
|
||||
GeometryLayout.XYZM);
|
||||
} else if (object.z !== undefined) {
|
||||
point = new Point([object.x, object.y, object.z],
|
||||
_ol_geom_GeometryLayout_.XYZ);
|
||||
GeometryLayout.XYZ);
|
||||
} else if (object.m !== undefined) {
|
||||
point = new Point([object.x, object.y, object.m],
|
||||
_ol_geom_GeometryLayout_.XYM);
|
||||
GeometryLayout.XYM);
|
||||
} else {
|
||||
point = new Point([object.x, object.y]);
|
||||
}
|
||||
@@ -195,13 +195,13 @@ _ol_format_EsriJSON_.readMultiLineStringGeometry_ = function(object) {
|
||||
* @return {ol.geom.GeometryLayout} The geometry layout to use.
|
||||
*/
|
||||
_ol_format_EsriJSON_.getGeometryLayout_ = function(object) {
|
||||
var layout = _ol_geom_GeometryLayout_.XY;
|
||||
var layout = GeometryLayout.XY;
|
||||
if (object.hasZ === true && object.hasM === true) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZM;
|
||||
layout = GeometryLayout.XYZM;
|
||||
} else if (object.hasZ === true) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZ;
|
||||
layout = GeometryLayout.XYZ;
|
||||
} else if (object.hasM === true) {
|
||||
layout = _ol_geom_GeometryLayout_.XYM;
|
||||
layout = GeometryLayout.XYM;
|
||||
}
|
||||
return layout;
|
||||
};
|
||||
@@ -252,26 +252,26 @@ _ol_format_EsriJSON_.writePointGeometry_ = function(geometry, opt_options) {
|
||||
var coordinates = /** @type {ol.geom.Point} */ (geometry).getCoordinates();
|
||||
var esriJSON;
|
||||
var layout = /** @type {ol.geom.Point} */ (geometry).getLayout();
|
||||
if (layout === _ol_geom_GeometryLayout_.XYZ) {
|
||||
if (layout === GeometryLayout.XYZ) {
|
||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||
x: coordinates[0],
|
||||
y: coordinates[1],
|
||||
z: coordinates[2]
|
||||
});
|
||||
} else if (layout === _ol_geom_GeometryLayout_.XYM) {
|
||||
} else if (layout === GeometryLayout.XYM) {
|
||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||
x: coordinates[0],
|
||||
y: coordinates[1],
|
||||
m: coordinates[2]
|
||||
});
|
||||
} else if (layout === _ol_geom_GeometryLayout_.XYZM) {
|
||||
} else if (layout === GeometryLayout.XYZM) {
|
||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||
x: coordinates[0],
|
||||
y: coordinates[1],
|
||||
z: coordinates[2],
|
||||
m: coordinates[3]
|
||||
});
|
||||
} else if (layout === _ol_geom_GeometryLayout_.XY) {
|
||||
} else if (layout === GeometryLayout.XY) {
|
||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||
x: coordinates[0],
|
||||
y: coordinates[1]
|
||||
@@ -291,10 +291,10 @@ _ol_format_EsriJSON_.writePointGeometry_ = function(geometry, opt_options) {
|
||||
_ol_format_EsriJSON_.getHasZM_ = function(geometry) {
|
||||
var layout = geometry.getLayout();
|
||||
return {
|
||||
hasZ: (layout === _ol_geom_GeometryLayout_.XYZ ||
|
||||
layout === _ol_geom_GeometryLayout_.XYZM),
|
||||
hasM: (layout === _ol_geom_GeometryLayout_.XYM ||
|
||||
layout === _ol_geom_GeometryLayout_.XYZM)
|
||||
hasZ: (layout === GeometryLayout.XYZ ||
|
||||
layout === GeometryLayout.XYZM),
|
||||
hasM: (layout === GeometryLayout.XYM ||
|
||||
layout === GeometryLayout.XYZM)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||
@@ -253,7 +253,7 @@ _ol_format_GML3_.prototype.readSurface_ = function(node, objectStack) {
|
||||
ends.push(flatCoordinates.length);
|
||||
}
|
||||
polygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XYZ, flatCoordinates, ends);
|
||||
GeometryLayout.XYZ, flatCoordinates, ends);
|
||||
return polygon;
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -273,7 +273,7 @@ _ol_format_GML3_.prototype.readCurve_ = function(node, objectStack) {
|
||||
this.CURVE_PARSERS_, node, objectStack, this);
|
||||
if (flatCoordinates) {
|
||||
var lineString = new LineString(null);
|
||||
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||
lineString.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
return lineString;
|
||||
} else {
|
||||
return undefined;
|
||||
|
||||
@@ -9,7 +9,7 @@ import _ol_array_ from '../array.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
@@ -265,7 +265,7 @@ _ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
var point = new Point(null);
|
||||
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
return point;
|
||||
}
|
||||
};
|
||||
@@ -369,7 +369,7 @@ _ol_format_GMLBase_.prototype.readLineString = function(node, objectStack) {
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
var lineString = new LineString(null);
|
||||
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||
lineString.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
return lineString;
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -405,7 +405,7 @@ _ol_format_GMLBase_.prototype.readLinearRing = function(node, objectStack) {
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
var ring = new _ol_geom_LinearRing_(null);
|
||||
ring.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||
ring.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
return ring;
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -432,7 +432,7 @@ _ol_format_GMLBase_.prototype.readPolygon = function(node, objectStack) {
|
||||
ends.push(flatCoordinates.length);
|
||||
}
|
||||
polygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XYZ, flatCoordinates, ends);
|
||||
GeometryLayout.XYZ, flatCoordinates, ends);
|
||||
return polygon;
|
||||
} else {
|
||||
return undefined;
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_array_ from '../array.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
import Point from '../geom/Point.js';
|
||||
@@ -105,16 +105,16 @@ _ol_format_GPX_.appendCoordinate_ = function(flatCoordinates, layoutOptions, nod
|
||||
* @return {ol.geom.GeometryLayout} Layout.
|
||||
*/
|
||||
_ol_format_GPX_.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, ends) {
|
||||
var layout = _ol_geom_GeometryLayout_.XY;
|
||||
var layout = GeometryLayout.XY;
|
||||
var stride = 2;
|
||||
if (layoutOptions.hasZ && layoutOptions.hasM) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZM;
|
||||
layout = GeometryLayout.XYZM;
|
||||
stride = 4;
|
||||
} else if (layoutOptions.hasZ) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZ;
|
||||
layout = GeometryLayout.XYZ;
|
||||
stride = 3;
|
||||
} else if (layoutOptions.hasM) {
|
||||
layout = _ol_geom_GeometryLayout_.XYM;
|
||||
layout = GeometryLayout.XYM;
|
||||
stride = 3;
|
||||
}
|
||||
if (stride !== 4) {
|
||||
@@ -588,17 +588,17 @@ _ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
_ol_xml_.setAttributeNS(node, null, 'lon', coordinate[0]);
|
||||
var geometryLayout = context['geometryLayout'];
|
||||
switch (geometryLayout) {
|
||||
case _ol_geom_GeometryLayout_.XYZM:
|
||||
case GeometryLayout.XYZM:
|
||||
if (coordinate[3] !== 0) {
|
||||
properties['time'] = coordinate[3];
|
||||
}
|
||||
// fall through
|
||||
case _ol_geom_GeometryLayout_.XYZ:
|
||||
case GeometryLayout.XYZ:
|
||||
if (coordinate[2] !== 0) {
|
||||
properties['ele'] = coordinate[2];
|
||||
}
|
||||
break;
|
||||
case _ol_geom_GeometryLayout_.XYM:
|
||||
case GeometryLayout.XYM:
|
||||
if (coordinate[2] !== 0) {
|
||||
properties['time'] = coordinate[2];
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_IGCZ_ from '../format/IGCZ.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
|
||||
@@ -159,7 +159,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
}
|
||||
var lineString = new LineString(null);
|
||||
var layout = altitudeMode == _ol_format_IGCZ_.NONE ?
|
||||
_ol_geom_GeometryLayout_.XYM : _ol_geom_GeometryLayout_.XYZM;
|
||||
GeometryLayout.XYM : GeometryLayout.XYZM;
|
||||
lineString.setFlatCoordinates(layout, flatCoordinates);
|
||||
var feature = new _ol_Feature_(_ol_format_Feature_.transformWithOptions(
|
||||
lineString, false, opt_options));
|
||||
|
||||
@@ -15,7 +15,7 @@ import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
@@ -817,7 +817,7 @@ _ol_format_KML_.readGxTrack_ = function(node, objectStack) {
|
||||
flatCoordinates[4 * i + 3] = whens[i];
|
||||
}
|
||||
var lineString = new LineString(null);
|
||||
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZM, flatCoordinates);
|
||||
lineString.setFlatCoordinates(GeometryLayout.XYZM, flatCoordinates);
|
||||
return lineString;
|
||||
};
|
||||
|
||||
@@ -865,7 +865,7 @@ _ol_format_KML_.readLineString_ = function(node, objectStack) {
|
||||
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
var lineString = new LineString(null);
|
||||
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||
lineString.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
lineString.setProperties(properties);
|
||||
return lineString;
|
||||
} else {
|
||||
@@ -888,7 +888,7 @@ _ol_format_KML_.readLinearRing_ = function(node, objectStack) {
|
||||
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
var polygon = new Polygon(null);
|
||||
polygon.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates,
|
||||
polygon.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates,
|
||||
[flatCoordinates.length]);
|
||||
polygon.setProperties(properties);
|
||||
return polygon;
|
||||
@@ -973,7 +973,7 @@ _ol_format_KML_.readPoint_ = function(node, objectStack) {
|
||||
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
var point = new Point(null);
|
||||
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
point.setProperties(properties);
|
||||
return point;
|
||||
} else {
|
||||
@@ -1004,7 +1004,7 @@ _ol_format_KML_.readPolygon_ = function(node, objectStack) {
|
||||
ends.push(flatCoordinates.length);
|
||||
}
|
||||
polygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XYZ, flatCoordinates, ends);
|
||||
GeometryLayout.XYZ, flatCoordinates, ends);
|
||||
polygon.setProperties(properties);
|
||||
return polygon;
|
||||
} else {
|
||||
@@ -2122,11 +2122,11 @@ _ol_format_KML_.writeCoordinatesTextNode_ = function(node, coordinates, objectSt
|
||||
var stride = context['stride'];
|
||||
|
||||
var dimension;
|
||||
if (layout == _ol_geom_GeometryLayout_.XY ||
|
||||
layout == _ol_geom_GeometryLayout_.XYM) {
|
||||
if (layout == GeometryLayout.XY ||
|
||||
layout == GeometryLayout.XYM) {
|
||||
dimension = 2;
|
||||
} else if (layout == _ol_geom_GeometryLayout_.XYZ ||
|
||||
layout == _ol_geom_GeometryLayout_.XYZM) {
|
||||
} else if (layout == GeometryLayout.XYZ ||
|
||||
layout == GeometryLayout.XYZM) {
|
||||
dimension = 3;
|
||||
} else {
|
||||
_ol_asserts_.assert(false, 34); // Invalid geometry layout
|
||||
|
||||
@@ -8,7 +8,7 @@ import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_ext_PBF_ from 'pbf';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
@@ -317,7 +317,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
||||
geometryType === _ol_geom_GeometryType_.MULTI_LINE_STRING ? new MultiLineString(null) :
|
||||
null;
|
||||
}
|
||||
geom.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates, ends);
|
||||
geom.setFlatCoordinates(GeometryLayout.XY, flatCoordinates, ends);
|
||||
feature = new this.featureClass_();
|
||||
if (this.geometryName_) {
|
||||
feature.setGeometryName(this.geometryName_);
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_array_ from '../array.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
@@ -186,11 +186,11 @@ _ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options)
|
||||
if (values.ndrefs[0] == values.ndrefs[values.ndrefs.length - 1]) {
|
||||
// closed way
|
||||
geometry = new Polygon(null);
|
||||
geometry.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates,
|
||||
geometry.setFlatCoordinates(GeometryLayout.XY, flatCoordinates,
|
||||
[flatCoordinates.length]);
|
||||
} else {
|
||||
geometry = new LineString(null);
|
||||
geometry.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates);
|
||||
geometry.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||
}
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||
var feature = new _ol_Feature_(geometry);
|
||||
|
||||
@@ -6,7 +6,7 @@ import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_flip_ from '../geom/flat/flip.js';
|
||||
@@ -46,7 +46,7 @@ var _ol_format_Polyline_ = function(opt_options) {
|
||||
* @type {ol.geom.GeometryLayout}
|
||||
*/
|
||||
this.geometryLayout_ = options.geometryLayout ?
|
||||
options.geometryLayout : _ol_geom_GeometryLayout_.XY;
|
||||
options.geometryLayout : GeometryLayout.XY;
|
||||
};
|
||||
|
||||
inherits(_ol_format_Polyline_, _ol_format_TextFeature_);
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
import MultiPoint from '../geom/MultiPoint.js';
|
||||
@@ -187,10 +187,10 @@ _ol_format_WKT_.encodeMultiPolygonGeometry_ = function(geom) {
|
||||
_ol_format_WKT_.encodeGeometryLayout_ = function(geom) {
|
||||
var layout = geom.getLayout();
|
||||
var dimInfo = '';
|
||||
if (layout === _ol_geom_GeometryLayout_.XYZ || layout === _ol_geom_GeometryLayout_.XYZM) {
|
||||
if (layout === GeometryLayout.XYZ || layout === GeometryLayout.XYZM) {
|
||||
dimInfo += _ol_format_WKT_.Z;
|
||||
}
|
||||
if (layout === _ol_geom_GeometryLayout_.XYM || layout === _ol_geom_GeometryLayout_.XYZM) {
|
||||
if (layout === GeometryLayout.XYM || layout === GeometryLayout.XYZM) {
|
||||
dimInfo += _ol_format_WKT_.M;
|
||||
}
|
||||
return dimInfo;
|
||||
@@ -587,7 +587,7 @@ _ol_format_WKT_.Parser = function(lexer) {
|
||||
* @type {ol.geom.GeometryLayout}
|
||||
* @private
|
||||
*/
|
||||
this.layout_ = _ol_geom_GeometryLayout_.XY;
|
||||
this.layout_ = GeometryLayout.XY;
|
||||
};
|
||||
|
||||
|
||||
@@ -641,18 +641,18 @@ _ol_format_WKT_.Parser.prototype.parse = function() {
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseGeometryLayout_ = function() {
|
||||
var layout = _ol_geom_GeometryLayout_.XY;
|
||||
var layout = GeometryLayout.XY;
|
||||
var dimToken = this.token_;
|
||||
if (this.isTokenType(_ol_format_WKT_.TokenType_.TEXT)) {
|
||||
var dimInfo = dimToken.value;
|
||||
if (dimInfo === _ol_format_WKT_.Z) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZ;
|
||||
layout = GeometryLayout.XYZ;
|
||||
} else if (dimInfo === _ol_format_WKT_.M) {
|
||||
layout = _ol_geom_GeometryLayout_.XYM;
|
||||
layout = GeometryLayout.XYM;
|
||||
} else if (dimInfo === _ol_format_WKT_.ZM) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZM;
|
||||
layout = GeometryLayout.XYZM;
|
||||
}
|
||||
if (layout !== _ol_geom_GeometryLayout_.XY) {
|
||||
if (layout !== GeometryLayout.XY) {
|
||||
this.consume_();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import {createOrUpdate, forEachCorner, intersects} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
||||
@@ -186,7 +186,7 @@ Circle.prototype.setCenter = function(center) {
|
||||
*/
|
||||
Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
|
||||
if (!center) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null);
|
||||
} else {
|
||||
this.setLayout(opt_layout, center, 0);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* `'XYZ'`, `'XYM'`, `'XYZM'`.
|
||||
* @enum {string}
|
||||
*/
|
||||
var _ol_geom_GeometryLayout_ = {
|
||||
var GeometryLayout = {
|
||||
XY: 'XY',
|
||||
XYZ: 'XYZ',
|
||||
XYM: 'XYM',
|
||||
XYZM: 'XYZM'
|
||||
};
|
||||
|
||||
export default _ol_geom_GeometryLayout_;
|
||||
export default GeometryLayout;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {closestSquaredDistanceXY} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||
@@ -141,8 +141,8 @@ LineString.prototype.forEachSegment = function(callback, opt_this) {
|
||||
* @api
|
||||
*/
|
||||
LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
||||
if (this.layout != _ol_geom_GeometryLayout_.XYM &&
|
||||
this.layout != _ol_geom_GeometryLayout_.XYZM) {
|
||||
if (this.layout != GeometryLayout.XYM &&
|
||||
this.layout != GeometryLayout.XYZM) {
|
||||
return null;
|
||||
}
|
||||
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
||||
@@ -213,7 +213,7 @@ LineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance)
|
||||
squaredTolerance, simplifiedFlatCoordinates, 0);
|
||||
var simplifiedLineString = new LineString(null);
|
||||
simplifiedLineString.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates);
|
||||
GeometryLayout.XY, simplifiedFlatCoordinates);
|
||||
return simplifiedLineString;
|
||||
};
|
||||
|
||||
@@ -247,7 +247,7 @@ LineString.prototype.intersectsExtent = function(extent) {
|
||||
*/
|
||||
LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 1);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import {closestSquaredDistanceXY} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_area_ from '../geom/flat/area.js';
|
||||
@@ -110,7 +110,7 @@ _ol_geom_LinearRing_.prototype.getSimplifiedGeometryInternal = function(squaredT
|
||||
squaredTolerance, simplifiedFlatCoordinates, 0);
|
||||
var simplifiedLinearRing = new _ol_geom_LinearRing_(null);
|
||||
simplifiedLinearRing.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates);
|
||||
GeometryLayout.XY, simplifiedFlatCoordinates);
|
||||
return simplifiedLinearRing;
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ _ol_geom_LinearRing_.prototype.intersectsExtent = function(extent) {};
|
||||
*/
|
||||
_ol_geom_LinearRing_.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 1);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {closestSquaredDistanceXY} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
@@ -126,8 +126,8 @@ MultiLineString.prototype.closestPointXY = function(x, y, closestPoint, minSquar
|
||||
* @api
|
||||
*/
|
||||
MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
|
||||
if ((this.layout != _ol_geom_GeometryLayout_.XYM &&
|
||||
this.layout != _ol_geom_GeometryLayout_.XYZM) ||
|
||||
if ((this.layout != GeometryLayout.XYM &&
|
||||
this.layout != GeometryLayout.XYZM) ||
|
||||
this.flatCoordinates.length === 0) {
|
||||
return null;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ MultiLineString.prototype.getSimplifiedGeometryInternal = function(squaredTolera
|
||||
simplifiedFlatCoordinates, 0, simplifiedEnds);
|
||||
var simplifiedMultiLineString = new MultiLineString(null);
|
||||
simplifiedMultiLineString.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEnds);
|
||||
GeometryLayout.XY, simplifiedFlatCoordinates, simplifiedEnds);
|
||||
return simplifiedMultiLineString;
|
||||
};
|
||||
|
||||
@@ -264,7 +264,7 @@ MultiLineString.prototype.intersectsExtent = function(extent) {
|
||||
*/
|
||||
MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.ends_);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null, this.ends_);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 2);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {closestSquaredDistanceXY, containsXY} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
@@ -172,7 +172,7 @@ MultiPoint.prototype.intersectsExtent = function(extent) {
|
||||
*/
|
||||
MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 1);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {closestSquaredDistanceXY} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import MultiPoint from '../geom/MultiPoint.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
@@ -229,7 +229,7 @@ MultiPolygon.prototype.getFlatInteriorPoints = function() {
|
||||
*/
|
||||
MultiPolygon.prototype.getInteriorPoints = function() {
|
||||
var interiorPoints = new MultiPoint(null);
|
||||
interiorPoints.setFlatCoordinates(_ol_geom_GeometryLayout_.XYM,
|
||||
interiorPoints.setFlatCoordinates(GeometryLayout.XYM,
|
||||
this.getFlatInteriorPoints().slice());
|
||||
return interiorPoints;
|
||||
};
|
||||
@@ -268,7 +268,7 @@ MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance
|
||||
simplifiedFlatCoordinates, 0, simplifiedEndss);
|
||||
var simplifiedMultiPolygon = new MultiPolygon(null);
|
||||
simplifiedMultiPolygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEndss);
|
||||
GeometryLayout.XY, simplifiedFlatCoordinates, simplifiedEndss);
|
||||
return simplifiedMultiPolygon;
|
||||
};
|
||||
|
||||
@@ -363,7 +363,7 @@ MultiPolygon.prototype.intersectsExtent = function(extent) {
|
||||
*/
|
||||
MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.endss_);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null, this.endss_);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 3);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import {createOrUpdateFromCoordinate, containsXY} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
||||
@@ -104,7 +104,7 @@ Point.prototype.intersectsExtent = function(extent) {
|
||||
*/
|
||||
Point.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 0);
|
||||
if (!this.flatCoordinates) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {closestSquaredDistanceXY, getCenter} from '../extent.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
||||
import Point from '../geom/Point.js';
|
||||
@@ -215,7 +215,7 @@ Polygon.prototype.getFlatInteriorPoint = function() {
|
||||
* @api
|
||||
*/
|
||||
Polygon.prototype.getInteriorPoint = function() {
|
||||
return new Point(this.getFlatInteriorPoint(), _ol_geom_GeometryLayout_.XYM);
|
||||
return new Point(this.getFlatInteriorPoint(), GeometryLayout.XYM);
|
||||
};
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ Polygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||
simplifiedFlatCoordinates, 0, simplifiedEnds);
|
||||
var simplifiedPolygon = new Polygon(null);
|
||||
simplifiedPolygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEnds);
|
||||
GeometryLayout.XY, simplifiedFlatCoordinates, simplifiedEnds);
|
||||
return simplifiedPolygon;
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ Polygon.prototype.intersectsExtent = function(extent) {
|
||||
*/
|
||||
Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||
if (!coordinates) {
|
||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.ends_);
|
||||
this.setFlatCoordinates(GeometryLayout.XY, null, this.ends_);
|
||||
} else {
|
||||
this.setLayout(opt_layout, coordinates, 2);
|
||||
if (!this.flatCoordinates) {
|
||||
@@ -390,7 +390,7 @@ Polygon.circular = function(sphere, center, radius, opt_n) {
|
||||
flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);
|
||||
var polygon = new Polygon(null);
|
||||
polygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, flatCoordinates, [flatCoordinates.length]);
|
||||
GeometryLayout.XY, flatCoordinates, [flatCoordinates.length]);
|
||||
return polygon;
|
||||
};
|
||||
|
||||
@@ -410,7 +410,7 @@ Polygon.fromExtent = function(extent) {
|
||||
[minX, minY, minX, maxY, maxX, maxY, maxX, minY, minX, minY];
|
||||
var polygon = new Polygon(null);
|
||||
polygon.setFlatCoordinates(
|
||||
_ol_geom_GeometryLayout_.XY, flatCoordinates, [flatCoordinates.length]);
|
||||
GeometryLayout.XY, flatCoordinates, [flatCoordinates.length]);
|
||||
return polygon;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import _ol_functions_ from '../functions.js';
|
||||
import {createOrUpdateFromFlatCoordinates, getCenter} from '../extent.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_flat_transform_ from '../geom/flat/transform.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
|
||||
@@ -27,7 +27,7 @@ var _ol_geom_SimpleGeometry_ = function() {
|
||||
* @protected
|
||||
* @type {ol.geom.GeometryLayout}
|
||||
*/
|
||||
this.layout = _ol_geom_GeometryLayout_.XY;
|
||||
this.layout = GeometryLayout.XY;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -54,11 +54,11 @@ inherits(_ol_geom_SimpleGeometry_, Geometry);
|
||||
_ol_geom_SimpleGeometry_.getLayoutForStride_ = function(stride) {
|
||||
var layout;
|
||||
if (stride == 2) {
|
||||
layout = _ol_geom_GeometryLayout_.XY;
|
||||
layout = GeometryLayout.XY;
|
||||
} else if (stride == 3) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZ;
|
||||
layout = GeometryLayout.XYZ;
|
||||
} else if (stride == 4) {
|
||||
layout = _ol_geom_GeometryLayout_.XYZM;
|
||||
layout = GeometryLayout.XYZM;
|
||||
}
|
||||
return /** @type {ol.geom.GeometryLayout} */ (layout);
|
||||
};
|
||||
@@ -70,11 +70,11 @@ _ol_geom_SimpleGeometry_.getLayoutForStride_ = function(stride) {
|
||||
*/
|
||||
_ol_geom_SimpleGeometry_.getStrideForLayout = function(layout) {
|
||||
var stride;
|
||||
if (layout == _ol_geom_GeometryLayout_.XY) {
|
||||
if (layout == GeometryLayout.XY) {
|
||||
stride = 2;
|
||||
} else if (layout == _ol_geom_GeometryLayout_.XYZ || layout == _ol_geom_GeometryLayout_.XYM) {
|
||||
} else if (layout == GeometryLayout.XYZ || layout == GeometryLayout.XYM) {
|
||||
stride = 3;
|
||||
} else if (layout == _ol_geom_GeometryLayout_.XYZM) {
|
||||
} else if (layout == GeometryLayout.XYZM) {
|
||||
stride = 4;
|
||||
}
|
||||
return /** @type {number} */ (stride);
|
||||
@@ -234,7 +234,7 @@ _ol_geom_SimpleGeometry_.prototype.setLayout = function(layout, coordinates, nes
|
||||
var i;
|
||||
for (i = 0; i < nesting; ++i) {
|
||||
if (coordinates.length === 0) {
|
||||
this.layout = _ol_geom_GeometryLayout_.XY;
|
||||
this.layout = GeometryLayout.XY;
|
||||
this.stride = 2;
|
||||
return;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user