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