Rename _ol_geom_LineString_ to LineString

This commit is contained in:
Tim Schaub
2017-12-14 08:54:53 -07:00
parent ad5806c29d
commit f7b3876c1b
55 changed files with 270 additions and 270 deletions

View File

@@ -2,7 +2,7 @@ import {inherits} from '../src/ol/index.js';
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import Point from '../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_interaction_ from '../src/ol/interaction.js';
@@ -137,7 +137,7 @@ app.Drag.prototype.handleUpEvent = function() {
var pointFeature = new _ol_Feature_(new Point([0, 0]));
var lineFeature = new _ol_Feature_(
new _ol_geom_LineString_([[-1e7, 1e6], [-1e6, 3e6]]));
new LineString([[-1e7, 1e6], [-1e6, 3e6]]));
var polygonFeature = new _ol_Feature_(
new _ol_geom_Polygon_([[[-3e6, -1e6], [-3e6, 1e6],

View File

@@ -2,7 +2,7 @@
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
@@ -60,7 +60,7 @@ var animateFlights = function(event) {
}
var maxIndex = Math.min(elapsedPoints, coords.length);
var currentLine = new _ol_geom_LineString_(coords.slice(0, maxIndex));
var currentLine = new LineString(coords.slice(0, maxIndex));
// directly draw the line with the vector context
vectorContext.drawGeometry(currentLine);
@@ -92,7 +92,7 @@ flightsSource = new _ol_source_Vector_({
var arcLine = arcGenerator.Arc(100, {offset: 10});
if (arcLine.geometries.length === 1) {
var line = new _ol_geom_LineString_(arcLine.geometries[0].coords);
var line = new LineString(arcLine.geometries[0].coords);
line.transform('EPSG:4326', 'EPSG:3857');
var feature = new _ol_Feature_({

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
@@ -11,7 +11,7 @@ var sin30 = Math.sin(Math.PI / 6);
var rise = radius * sin30;
var run = radius * cos30;
var triangle = new _ol_geom_LineString_([
var triangle = new LineString([
[0, radius], [run, -rise], [-run, -rise], [0, radius]
]);

View File

@@ -3,7 +3,7 @@ import _ol_Map_ from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import {fromLonLat} from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
@@ -42,7 +42,7 @@ map.addOverlay(marker);
// LineString to store the different geolocation positions. This LineString
// is time aware.
// The Z dimension is actually used to store the rotation (heading).
var positions = new _ol_geom_LineString_([],
var positions = new LineString([],
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
// Geolocation Control

View File

@@ -5,7 +5,7 @@ import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
@@ -20,7 +20,7 @@ var style = new _ol_style_Style_({
})
});
var feature = new _ol_Feature_(new _ol_geom_LineString_([[-4000000, 0], [4000000, 0]]));
var feature = new _ol_Feature_(new LineString([[-4000000, 0], [4000000, 0]]));
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({

View File

@@ -3,7 +3,7 @@ import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import Point from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -132,7 +132,7 @@ var displaySnap = function(coordinate) {
closestFeature.get('PLT') + ' (' + date.toUTCString() + ')';
var coordinates = [coordinate, [closestPoint[0], closestPoint[1]]];
if (line === null) {
line = new _ol_geom_LineString_(coordinates);
line = new LineString(coordinates);
} else {
line.setCoordinates(coordinates);
}

View File

@@ -3,7 +3,7 @@ import _ol_Observable_ from '../src/ol/Observable.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_Sphere_ from '../src/ol/Sphere.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -106,7 +106,7 @@ var pointerMoveHandler = function(evt) {
var geom = (sketch.getGeometry());
if (geom instanceof _ol_geom_Polygon_) {
helpMsg = continuePolygonMsg;
} else if (geom instanceof _ol_geom_LineString_) {
} else if (geom instanceof LineString) {
helpMsg = continueLineMsg;
}
}
@@ -220,7 +220,7 @@ function addInteraction() {
if (geom instanceof _ol_geom_Polygon_) {
output = formatArea(geom);
tooltipCoord = geom.getInteriorPoint().getCoordinates();
} else if (geom instanceof _ol_geom_LineString_) {
} else if (geom instanceof LineString) {
output = formatLength(geom);
tooltipCoord = geom.getLastCoordinate();
}

View File

@@ -1,4 +1,4 @@
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import Point from '../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_render_ from '../src/ol/render.js';
@@ -24,6 +24,6 @@ var style = new _ol_style_Style_({
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([[10, 10], [90, 90]]));
vectorContext.drawGeometry(new LineString([[10, 10], [90, 90]]));
vectorContext.drawGeometry(new _ol_geom_Polygon_([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
vectorContext.drawGeometry(new Point([88, 88]));

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
@@ -31,7 +31,7 @@ for (i = 0; i < count; ++i) {
deltaY = delta * signY;
endPoint = [startPoint[0] + deltaX, startPoint[1] + deltaY];
features[i] = new _ol_Feature_({
'geometry': new _ol_geom_LineString_([startPoint, endPoint])
'geometry': new LineString([startPoint, endPoint])
});
startPoint = endPoint;
}

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import Point from '../src/ol/geom/Point.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
@@ -76,7 +76,7 @@ var displaySnap = function(coordinate) {
point.setCoordinates(closestPoint);
}
if (line === null) {
line = new _ol_geom_LineString_([coordinate, closestPoint]);
line = new LineString([coordinate, closestPoint]);
} else {
line.setCoordinates([coordinate, closestPoint]);
}

View File

@@ -5,7 +5,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import Point from '../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import LineString from '../src/ol/geom/LineString.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
@@ -113,7 +113,7 @@ topo.on('removenode', function(e) {
topo.on('addedge', edgeToFeature);
topo.on('modedge', function(e) {
var feature = edges.getFeatureById(e.id);
feature.setGeometry(new _ol_geom_LineString_(e.coordinates));
feature.setGeometry(new LineString(e.coordinates));
});
topo.on('removeedge', function(e) {
removeElementFeature(edges, e);
@@ -139,7 +139,7 @@ function nodeToFeature(node) {
function edgeToFeature(edge) {
var feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(edge.coordinates),
geometry: new LineString(edge.coordinates),
edge: edge
});
feature.setId(edge.id);

View File

@@ -4,7 +4,7 @@
import _ol_coordinate_ from './coordinate.js';
import {intersects, getCenter} from './extent.js';
import _ol_geom_GeometryLayout_ from './geom/GeometryLayout.js';
import _ol_geom_LineString_ from './geom/LineString.js';
import LineString from './geom/LineString.js';
import Point from './geom/Point.js';
import _ol_geom_flat_geodesic_ from './geom/flat/geodesic.js';
import _ol_math_ from './math.js';
@@ -491,7 +491,7 @@ _ol_Graticule_.prototype.getMeridian_ = function(lon, minLat, maxLat,
var flatCoordinates = _ol_geom_flat_geodesic_.meridian(lon,
minLat, maxLat, this.projection_, squaredTolerance);
var lineString = this.meridians_[index] !== undefined ?
this.meridians_[index] : new _ol_geom_LineString_(null);
this.meridians_[index] : new LineString(null);
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates);
return lineString;
};
@@ -521,7 +521,7 @@ _ol_Graticule_.prototype.getParallel_ = function(lat, minLon, maxLon,
var flatCoordinates = _ol_geom_flat_geodesic_.parallel(lat,
minLon, maxLon, this.projection_, squaredTolerance);
var lineString = this.parallels_[index] !== undefined ?
this.parallels_[index] : new _ol_geom_LineString_(null);
this.parallels_[index] : new LineString(null);
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates);
return lineString;
};

View File

@@ -9,7 +9,7 @@ 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 _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
@@ -174,7 +174,7 @@ _ol_format_EsriJSON_.readPointGeometry_ = function(object) {
*/
_ol_format_EsriJSON_.readLineStringGeometry_ = function(object) {
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
return new _ol_geom_LineString_(object.paths[0], layout);
return new LineString(object.paths[0], layout);
};

View File

@@ -9,7 +9,7 @@ import _ol_format_GMLBase_ from '../format/GMLBase.js';
import _ol_format_XSD_ from '../format/XSD.js';
import _ol_geom_Geometry_ from '../geom/Geometry.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
@@ -272,7 +272,7 @@ _ol_format_GML3_.prototype.readCurve_ = function(node, objectStack) {
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
this.CURVE_PARSERS_, node, objectStack, this);
if (flatCoordinates) {
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
return lineString;
} else {

View File

@@ -10,7 +10,7 @@ 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 _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
@@ -368,7 +368,7 @@ _ol_format_GMLBase_.prototype.readLineString = function(node, objectStack) {
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
return lineString;
} else {

View File

@@ -8,7 +8,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 _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import Point from '../geom/Point.js';
import {get as getProjection} from '../proj.js';
@@ -240,7 +240,7 @@ _ol_format_GPX_.readRte_ = function(node, objectStack) {
var layoutOptions = /** @type {ol.LayoutOptions} */ (values['layoutOptions']);
delete values['layoutOptions'];
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates);
var geometry = new _ol_geom_LineString_(null);
var geometry = new LineString(null);
geometry.setFlatCoordinates(layout, flatCoordinates);
_ol_format_Feature_.transformWithOptions(geometry, false, options);
var feature = new _ol_Feature_(geometry);

View File

@@ -10,7 +10,7 @@ import _ol_Feature_ from '../Feature.js';
import _ol_format_Feature_ from '../format/Feature.js';
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
@@ -119,7 +119,7 @@ _ol_format_GeoJSON_.readPointGeometry_ = function(object) {
* @return {ol.geom.LineString} LineString.
*/
_ol_format_GeoJSON_.readLineStringGeometry_ = function(object) {
return new _ol_geom_LineString_(object.coordinates);
return new LineString(object.coordinates);
};

View File

@@ -7,7 +7,7 @@ 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 _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import {get as getProjection} from '../proj.js';
/**
@@ -157,7 +157,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
if (flatCoordinates.length === 0) {
return null;
}
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
var layout = altitudeMode == _ol_format_IGCZ_.NONE ?
_ol_geom_GeometryLayout_.XYM : _ol_geom_GeometryLayout_.XYZM;
lineString.setFlatCoordinates(layout, flatCoordinates);

View File

@@ -17,7 +17,7 @@ import _ol_format_XSD_ from '../format/XSD.js';
import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
@@ -816,7 +816,7 @@ _ol_format_KML_.readGxTrack_ = function(node, objectStack) {
++i) {
flatCoordinates[4 * i + 3] = whens[i];
}
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZM, flatCoordinates);
return lineString;
};
@@ -864,7 +864,7 @@ _ol_format_KML_.readLineString_ = function(node, objectStack) {
var flatCoordinates =
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
lineString.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
lineString.setProperties(properties);
return lineString;

View File

@@ -10,7 +10,7 @@ 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 _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
@@ -311,7 +311,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
}
} else {
geom = geometryType === _ol_geom_GeometryType_.POINT ? new Point(null) :
geometryType === _ol_geom_GeometryType_.LINE_STRING ? new _ol_geom_LineString_(null) :
geometryType === _ol_geom_GeometryType_.LINE_STRING ? new LineString(null) :
geometryType === _ol_geom_GeometryType_.POLYGON ? new _ol_geom_Polygon_(null) :
geometryType === _ol_geom_GeometryType_.MULTI_POINT ? new MultiPoint (null) :
geometryType === _ol_geom_GeometryType_.MULTI_LINE_STRING ? new _ol_geom_MultiLineString_(null) :

View File

@@ -8,7 +8,7 @@ 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 _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_obj_ from '../obj.js';
@@ -189,7 +189,7 @@ _ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options)
geometry.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates,
[flatCoordinates.length]);
} else {
geometry = new _ol_geom_LineString_(null);
geometry = new LineString(null);
geometry.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates);
}
_ol_format_Feature_.transformWithOptions(geometry, false, options);

View File

@@ -7,7 +7,7 @@ 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 _ol_geom_LineString_ from '../geom/LineString.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';
import _ol_geom_flat_inflate_ from '../geom/flat/inflate.js';
@@ -334,7 +334,7 @@ _ol_format_Polyline_.prototype.readGeometryFromText = function(text, opt_options
return (
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
new _ol_geom_LineString_(coordinates, this.geometryLayout_), false,
new LineString(coordinates, this.geometryLayout_), false,
this.adaptOptions(opt_options))
);
};

View File

@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_format_Feature_ from '../format/Feature.js';
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
@@ -140,7 +140,7 @@ _ol_format_TopoJSON_.readMultiPointGeometry_ = function(object, scale,
*/
_ol_format_TopoJSON_.readLineStringGeometry_ = function(object, arcs) {
var coordinates = _ol_format_TopoJSON_.concatenateArcs_(object.arcs, arcs);
return new _ol_geom_LineString_(coordinates);
return new LineString(coordinates);
};

View File

@@ -8,7 +8,7 @@ import _ol_format_TextFeature_ from '../format/TextFeature.js';
import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
@@ -919,7 +919,7 @@ _ol_format_WKT_.Parser.prototype.formatErrorMessage_ = function() {
*/
_ol_format_WKT_.Parser.GeometryConstructor_ = {
'POINT': Point,
'LINESTRING': _ol_geom_LineString_,
'LINESTRING': LineString,
'POLYGON': _ol_geom_Polygon_,
'MULTIPOINT': MultiPoint,
'MULTILINESTRING': _ol_geom_MultiLineString_,

View File

@@ -26,7 +26,7 @@ import _ol_geom_flat_simplify_ from '../geom/flat/simplify.js';
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
var _ol_geom_LineString_ = function(coordinates, opt_layout) {
var LineString = function(coordinates, opt_layout) {
_ol_geom_SimpleGeometry_.call(this);
@@ -58,7 +58,7 @@ var _ol_geom_LineString_ = function(coordinates, opt_layout) {
};
inherits(_ol_geom_LineString_, _ol_geom_SimpleGeometry_);
inherits(LineString, _ol_geom_SimpleGeometry_);
/**
@@ -66,7 +66,7 @@ inherits(_ol_geom_LineString_, _ol_geom_SimpleGeometry_);
* @param {ol.Coordinate} coordinate Coordinate.
* @api
*/
_ol_geom_LineString_.prototype.appendCoordinate = function(coordinate) {
LineString.prototype.appendCoordinate = function(coordinate) {
if (!this.flatCoordinates) {
this.flatCoordinates = coordinate.slice();
} else {
@@ -82,8 +82,8 @@ _ol_geom_LineString_.prototype.appendCoordinate = function(coordinate) {
* @override
* @api
*/
_ol_geom_LineString_.prototype.clone = function() {
var lineString = new _ol_geom_LineString_(null);
LineString.prototype.clone = function() {
var lineString = new LineString(null);
lineString.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
return lineString;
};
@@ -92,7 +92,7 @@ _ol_geom_LineString_.prototype.clone = function() {
/**
* @inheritDoc
*/
_ol_geom_LineString_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
LineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
return minSquaredDistance;
}
@@ -120,7 +120,7 @@ _ol_geom_LineString_.prototype.closestPointXY = function(x, y, closestPoint, min
* @template T,S
* @api
*/
_ol_geom_LineString_.prototype.forEachSegment = function(callback, opt_this) {
LineString.prototype.forEachSegment = function(callback, opt_this) {
return _ol_geom_flat_segments_.forEach(this.flatCoordinates, 0,
this.flatCoordinates.length, this.stride, callback, opt_this);
};
@@ -140,7 +140,7 @@ _ol_geom_LineString_.prototype.forEachSegment = function(callback, opt_this) {
* @return {ol.Coordinate} Coordinate.
* @api
*/
_ol_geom_LineString_.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
if (this.layout != _ol_geom_GeometryLayout_.XYM &&
this.layout != _ol_geom_GeometryLayout_.XYZM) {
return null;
@@ -157,7 +157,7 @@ _ol_geom_LineString_.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
* @override
* @api
*/
_ol_geom_LineString_.prototype.getCoordinates = function() {
LineString.prototype.getCoordinates = function() {
return _ol_geom_flat_inflate_.coordinates(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
};
@@ -173,7 +173,7 @@ _ol_geom_LineString_.prototype.getCoordinates = function() {
* @return {ol.Coordinate} Coordinate of the interpolated point.
* @api
*/
_ol_geom_LineString_.prototype.getCoordinateAt = function(fraction, opt_dest) {
LineString.prototype.getCoordinateAt = function(fraction, opt_dest) {
return _ol_geom_flat_interpolate_.lineString(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
fraction, opt_dest);
@@ -185,7 +185,7 @@ _ol_geom_LineString_.prototype.getCoordinateAt = function(fraction, opt_dest) {
* @return {number} Length (on projected plane).
* @api
*/
_ol_geom_LineString_.prototype.getLength = function() {
LineString.prototype.getLength = function() {
return _ol_geom_flat_length_.lineString(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
};
@@ -194,7 +194,7 @@ _ol_geom_LineString_.prototype.getLength = function() {
/**
* @return {Array.<number>} Flat midpoint.
*/
_ol_geom_LineString_.prototype.getFlatMidpoint = function() {
LineString.prototype.getFlatMidpoint = function() {
if (this.flatMidpointRevision_ != this.getRevision()) {
this.flatMidpoint_ = this.getCoordinateAt(0.5, this.flatMidpoint_);
this.flatMidpointRevision_ = this.getRevision();
@@ -206,12 +206,12 @@ _ol_geom_LineString_.prototype.getFlatMidpoint = function() {
/**
* @inheritDoc
*/
_ol_geom_LineString_.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
LineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
var simplifiedFlatCoordinates = [];
simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.douglasPeucker(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
squaredTolerance, simplifiedFlatCoordinates, 0);
var simplifiedLineString = new _ol_geom_LineString_(null);
var simplifiedLineString = new LineString(null);
simplifiedLineString.setFlatCoordinates(
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates);
return simplifiedLineString;
@@ -222,7 +222,7 @@ _ol_geom_LineString_.prototype.getSimplifiedGeometryInternal = function(squaredT
* @inheritDoc
* @api
*/
_ol_geom_LineString_.prototype.getType = function() {
LineString.prototype.getType = function() {
return _ol_geom_GeometryType_.LINE_STRING;
};
@@ -231,7 +231,7 @@ _ol_geom_LineString_.prototype.getType = function() {
* @inheritDoc
* @api
*/
_ol_geom_LineString_.prototype.intersectsExtent = function(extent) {
LineString.prototype.intersectsExtent = function(extent) {
return _ol_geom_flat_intersectsextent_.lineString(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
extent);
@@ -245,7 +245,7 @@ _ol_geom_LineString_.prototype.intersectsExtent = function(extent) {
* @override
* @api
*/
_ol_geom_LineString_.prototype.setCoordinates = function(coordinates, opt_layout) {
LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
} else {
@@ -264,8 +264,8 @@ _ol_geom_LineString_.prototype.setCoordinates = function(coordinates, opt_layout
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
*/
_ol_geom_LineString_.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
LineString.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.changed();
};
export default _ol_geom_LineString_;
export default LineString;

View File

@@ -6,7 +6,7 @@ import _ol_array_ from '../array.js';
import {closestSquaredDistanceXY} from '../extent.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
@@ -168,7 +168,7 @@ _ol_geom_MultiLineString_.prototype.getLineString = function(index) {
if (index < 0 || this.ends_.length <= index) {
return null;
}
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
lineString.setFlatCoordinates(this.layout, this.flatCoordinates.slice(
index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]));
return lineString;
@@ -190,7 +190,7 @@ _ol_geom_MultiLineString_.prototype.getLineStrings = function() {
var i, ii;
for (i = 0, ii = ends.length; i < ii; ++i) {
var end = ends[i];
var lineString = new _ol_geom_LineString_(null);
var lineString = new LineString(null);
lineString.setFlatCoordinates(layout, flatCoordinates.slice(offset, end));
lineStrings.push(lineString);
offset = end;

View File

@@ -13,7 +13,7 @@ import {boundingExtent, getBottomLeft, getBottomRight, getTopLeft, getTopRight}
import _ol_functions_ from '../functions.js';
import _ol_geom_Circle_ from '../geom/Circle.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import LineString from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
@@ -154,7 +154,7 @@ var _ol_interaction_Draw_ = function(options) {
if (mode === _ol_interaction_Draw_.Mode_.POINT) {
Constructor = Point;
} else if (mode === _ol_interaction_Draw_.Mode_.LINE_STRING) {
Constructor = _ol_geom_LineString_;
Constructor = LineString;
} else if (mode === _ol_interaction_Draw_.Mode_.POLYGON) {
Constructor = _ol_geom_Polygon_;
}
@@ -511,7 +511,7 @@ _ol_interaction_Draw_.prototype.startDrawing_ = function(event) {
}
if (this.sketchLineCoords_) {
this.sketchLine_ = new _ol_Feature_(
new _ol_geom_LineString_(this.sketchLineCoords_));
new LineString(this.sketchLineCoords_));
}
var geometry = this.geometryFunction_(this.sketchCoords_);
this.sketchFeature_ = new _ol_Feature_();
@@ -558,7 +558,7 @@ _ol_interaction_Draw_.prototype.modifyDrawing_ = function(event) {
if (geometry instanceof _ol_geom_Polygon_ &&
this.mode_ !== _ol_interaction_Draw_.Mode_.POLYGON) {
if (!this.sketchLine_) {
this.sketchLine_ = new _ol_Feature_(new _ol_geom_LineString_(null));
this.sketchLine_ = new _ol_Feature_(new LineString(null));
}
var ring = geometry.getLinearRing(0);
sketchLineGeom = /** @type {ol.geom.LineString} */ (this.sketchLine_.getGeometry());

View File

@@ -3,7 +3,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -58,7 +58,7 @@ describe('ol.rendering.layer.Vector', function() {
}
function addLineString(r) {
source.addFeature(new _ol_Feature_(new _ol_geom_LineString_([
source.addFeature(new _ol_Feature_(new LineString([
[center[0] - r, center[1] - r],
[center[0] + r, center[1] - r],
[center[0] + r, center[1] + r],
@@ -75,7 +75,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders opacity correctly with the canvas renderer', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -101,7 +101,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders opacity correctly with renderMode: \'image\'', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -128,7 +128,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders transparent layers correctly with the canvas renderer', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -141,7 +141,7 @@ describe('ol.rendering.layer.Vector', function() {
})
]);
source.addFeature(smallLine);
var smallLine2 = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine2 = new _ol_Feature_(new LineString([
[center[0], center[1] - 1000],
[center[0], center[1] + 1000]
]));
@@ -167,7 +167,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders transparent layers correctly with renderMode: \'image\'', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -180,7 +180,7 @@ describe('ol.rendering.layer.Vector', function() {
})
]);
source.addFeature(smallLine);
var smallLine2 = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine2 = new _ol_Feature_(new LineString([
[center[0], center[1] - 1000],
[center[0], center[1] + 1000]
]));
@@ -881,7 +881,7 @@ describe('ol.rendering.layer.Vector', function() {
})
})
}));
var line = new _ol_Feature_(new _ol_geom_LineString_([
var line = new _ol_Feature_(new LineString([
[center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200]
]));
@@ -924,7 +924,7 @@ describe('ol.rendering.layer.Vector', function() {
})
})
}));
var line = new _ol_Feature_(new _ol_geom_LineString_([
var line = new _ol_Feature_(new LineString([
[center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200]
]));
@@ -968,7 +968,7 @@ describe('ol.rendering.layer.Vector', function() {
})
})
}));
var line = new _ol_Feature_(new _ol_geom_LineString_([
var line = new _ol_Feature_(new LineString([
[center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200]
]));

View File

@@ -1,4 +1,4 @@
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
import LineString from '../../../src/ol/geom/LineString.js';
import Point from '../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../src/ol/geom/Polygon.js';
import _ol_render_ from '../../../src/ol/render.js';
@@ -65,7 +65,7 @@ describe('ol.render', function() {
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([
vectorContext.drawGeometry(new LineString([
[10, 60], [30, 40], [50, 60], [70, 40], [90, 60]
]));
@@ -90,7 +90,7 @@ describe('ol.render', function() {
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([
vectorContext.drawGeometry(new LineString([
[10, 60], [30, 40], [50, 60], [70, 40], [90, 60]
]));
@@ -115,7 +115,7 @@ describe('ol.render', function() {
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([
vectorContext.drawGeometry(new LineString([
[10, 60], [30, 40], [50, 60], [70, 40], [90, 60]
]));

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -44,7 +44,7 @@ describe('ol.rendering.style.LineString', function() {
var feature;
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, 20], [15, 20]]
)
});
@@ -54,7 +54,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, 15], [15, 15]]
)
});
@@ -64,7 +64,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, 10], [15, 10]]
)
});
@@ -76,7 +76,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, -20], [-2, 0], [15, -20]]
)
});
@@ -92,7 +92,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, -15], [-2, 5], [15, -15]]
)
});

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
@@ -105,7 +105,7 @@ describe('ol.rendering.style.Text', function() {
var polygon = [151, 17, 163, 22, 159, 30, 150, 30, 143, 24, 151, 17];
function createLineString(coords, textAlign, maxAngle, strokeColor, strokeWidth, scale) {
var geom = new _ol_geom_LineString_();
var geom = new LineString();
geom.setFlatCoordinates('XY', coords);
var style = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
@@ -262,7 +262,7 @@ describe('ol.rendering.style.Text', function() {
it('renders text along a MultiLineString', function(done) {
createMap('canvas');
var line = new _ol_geom_LineString_();
var line = new LineString();
line.setFlatCoordinates('XY', nicePath);
var geom = new _ol_geom_MultiLineString_(null);
geom.appendLineString(line);

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_EsriJSON_ from '../../../../src/ol/format/EsriJSON.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -181,7 +181,7 @@ describe('ol.format.EsriJSON', function() {
var feature = format.readFeature(lineStringEsriJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(
[[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]);
expect(feature.get('prop0')).to.be('value0');
@@ -228,7 +228,7 @@ describe('ol.format.EsriJSON', function() {
var features = format.readFeatures(featureCollectionEsriJSON);
expect(features).to.have.length(3);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
expect(features[1].getGeometry()).to.be.an(LineString);
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
});
@@ -285,13 +285,13 @@ describe('ol.format.EsriJSON', function() {
expect(first).to.be.a(_ol_Feature_);
expect(first.get('LINK_ID')).to.be(573730499);
var firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(_ol_geom_LineString_);
expect(firstGeom).to.be.a(LineString);
var second = array[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('ST_NAME')).to.be('BRUNNSGATAN');
var secondGeom = second.getGeometry();
expect(secondGeom).to.be.a(_ol_geom_LineString_);
expect(secondGeom).to.be.a(LineString);
});
it('parses ksfields.geojson', function(done) {
@@ -435,7 +435,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getCoordinates()).to.eql([[10, 20], [30, 40]]);
expect(obj.getLayout()).to.eql('XY');
});
@@ -447,7 +447,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYZ');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
});
@@ -459,7 +459,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYM');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
});
@@ -472,7 +472,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYZM');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534, 1],
[30, 40, 1420, 2]]);
@@ -751,7 +751,7 @@ describe('ol.format.EsriJSON', function() {
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('bam')).to.be('baz');
expect(second.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(second.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:3857'));
@@ -791,14 +791,14 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var linestring = new LineString([[10, 20], [30, 40]]);
var esrijson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
format.readGeometry(esrijson).getCoordinates());
});
it('encodes XYZ linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20, 1534], [30, 40, 1420]],
var linestring = new LineString([[10, 20, 1534], [30, 40, 1420]],
'XYZ');
var esrijson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
@@ -806,7 +806,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYM linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20, 1534], [30, 40, 1420]],
var linestring = new LineString([[10, 20, 1534], [30, 40, 1420]],
'XYM');
var esrijson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
@@ -814,7 +814,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYZM linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20, 1534, 1],
var linestring = new LineString([[10, 20, 1534, 1],
[30, 40, 1420, 1]],
'XYZM');
var esrijson = format.writeGeometry(linestring);

View File

@@ -3,7 +3,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
@@ -164,7 +164,7 @@ describe('ol.format.GeoJSON', function() {
var feature = format.readFeature(lineStringGeoJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(
[[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]);
expect(feature.get('prop0')).to.be('value0');
@@ -201,7 +201,7 @@ describe('ol.format.GeoJSON', function() {
var features = format.readFeatures(featureCollectionGeoJSON);
expect(features).to.have.length(3);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
expect(features[1].getGeometry()).to.be.an(LineString);
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
});
@@ -274,13 +274,13 @@ describe('ol.format.GeoJSON', function() {
expect(first).to.be.a(_ol_Feature_);
expect(first.get('LINK_ID')).to.be(573730499);
var firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(_ol_geom_LineString_);
expect(firstGeom).to.be.a(LineString);
var second = array[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('ST_NAME')).to.be('BRUNNSGATAN');
var secondGeom = second.getGeometry();
expect(secondGeom).to.be.a(_ol_geom_LineString_);
expect(secondGeom).to.be.a(LineString);
});
it('can parse a polygon geometry as an array of one feature', function() {
@@ -340,7 +340,7 @@ describe('ol.format.GeoJSON', function() {
var first = features[0];
expect(first).to.be.a(_ol_Feature_);
expect(first.get('bam')).to.be('baz');
expect(first.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(first.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:4326'));
});
@@ -368,7 +368,7 @@ describe('ol.format.GeoJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getCoordinates()).to.eql([[10, 20], [30, 40]]);
expect(obj.getLayout()).to.eql('XY');
});
@@ -380,7 +380,7 @@ describe('ol.format.GeoJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYZ');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
});
@@ -419,7 +419,7 @@ describe('ol.format.GeoJSON', function() {
expect(array.length).to.be(2);
expect(array[0]).to.be.a(Point);
expect(array[0].getLayout()).to.eql('XY');
expect(array[1]).to.be.a(_ol_geom_LineString_);
expect(array[1]).to.be.a(LineString);
expect(array[1].getLayout()).to.eql('XY');
});
@@ -469,7 +469,7 @@ describe('ol.format.GeoJSON', function() {
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('bam')).to.be('baz');
expect(second.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(second.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:3857'));
@@ -512,7 +512,7 @@ describe('ol.format.GeoJSON', function() {
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('bam')).to.be('baz');
expect(second.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(second.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:4326'));
@@ -612,7 +612,7 @@ describe('ol.format.GeoJSON', function() {
});
it('encodes linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var linestring = new LineString([[10, 20], [30, 40]]);
var geojson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
format.readGeometry(geojson).getCoordinates());
@@ -731,7 +731,7 @@ describe('ol.format.GeoJSON', function() {
it('encodes geometry collection', function() {
var collection = new _ol_geom_GeometryCollection_([
new Point([10, 20]),
new _ol_geom_LineString_([[30, 40], [50, 60]])
new LineString([[30, 40], [50, 60]])
]);
var geojson = format.writeGeometry(collection);
var got = format.readGeometry(geojson);
@@ -772,7 +772,7 @@ describe('ol.format.GeoJSON', function() {
it('transforms and encodes geometry collection', function() {
var collection = new _ol_geom_GeometryCollection_([
new Point([2, 3]),
new _ol_geom_LineString_([[3, 2], [2, 1]])
new LineString([[3, 2], [2, 1]])
]);
var geojson = format.writeGeometry(collection, {
featureProjection: 'EPSG:3857'
@@ -803,7 +803,7 @@ describe('ol.format.GeoJSON', function() {
});
it('truncates a linestring with decimals option', function() {
var linestring = new _ol_geom_LineString_([[42.123456789, 38.987654321],
var linestring = new LineString([[42.123456789, 38.987654321],
[43, 39]]);
var geojson = format.writeGeometry(linestring, {
decimals: 6
@@ -815,7 +815,7 @@ describe('ol.format.GeoJSON', function() {
});
it('rounds a linestring with decimals option = 0', function() {
var linestring = new _ol_geom_LineString_([[42.123456789, 38.987654321],
var linestring = new LineString([[42.123456789, 38.987654321],
[43, 39]]);
var geojson = format.writeGeometry(linestring, {
decimals: 0

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GML_ from '../../../../src/ol/format/GML.js';
import _ol_format_GML2_ from '../../../../src/ol/format/GML2.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -164,7 +164,7 @@ describe('ol.format.GML2', function() {
' </layer>';
var feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[1.1, 2], [3, 4.2]])
geometry: new LineString([[1.1, 2], [3, 4.2]])
});
feature.setId(1);
var objectStack = [{
@@ -442,7 +442,7 @@ describe('ol.format.GML3', function() {
' <gml:posList srsDimension="2">1 2 3 4</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
var serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -459,7 +459,7 @@ describe('ol.format.GML3', function() {
' <gml:posList>1 2 3 4</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text, config);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
var coordinates = g.getCoordinates();
expect(coordinates[0].slice(0, 2)).to.eql(
transform([1, 2], 'CRS:84', 'EPSG:3857'));
@@ -481,7 +481,7 @@ describe('ol.format.GML3', function() {
' <gml:posList srsDimension="2">2 1 4 3</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(formatWGS84, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
var serialized = formatWGS84.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -500,7 +500,7 @@ describe('ol.format.GML3', function() {
' <gml:posList srsDimension="2">-90 -180 90 180</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[-180, -90, 0], [180, 90, 0]]);
var serialized = formatWGS84.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -563,7 +563,7 @@ describe('ol.format.GML3', function() {
' <gml:posList>1 2 3 4 5 6</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
});
@@ -677,7 +677,7 @@ describe('ol.format.GML3', function() {
' </gml:segments>' +
'</gml:Curve>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
format = new _ol_format_GML_({srsName: 'CRS:84', curve: true});
var serialized = format.writeGeometryNode(g);
@@ -1522,7 +1522,7 @@ describe('ol.format.GML3', function() {
it('creates a LineString', function() {
feature = features[0];
expect(feature.getId()).to.equal('geoserver_layer.1');
expect(feature.getGeometry()).to.be.an(_ol_geom_LineString_);
expect(feature.getGeometry()).to.be.an(LineString);
});
it('creates a Polygon', function() {

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GPX_ from '../../../../src/ol/format/GPX.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
@@ -38,7 +38,7 @@ describe('ol.format.GPX', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([]);
expect(g.getLayout()).to.be('XY');
});
@@ -95,7 +95,7 @@ describe('ol.format.GPX', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[2, 1], [4, 3]]);
expect(g.getLayout()).to.be('XY');
var serialized = format.writeFeaturesNode(fs);
@@ -120,7 +120,7 @@ describe('ol.format.GPX', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
var p1 = transform([2, 1], 'EPSG:4326', 'EPSG:3857');
var p2 = transform([6, 5], 'EPSG:4326', 'EPSG:3857');
expect(g.getCoordinates()).to.eql([p1, p2]);

View File

@@ -3,7 +3,7 @@ import _ol_array_ from '../../../../src/ol/array.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_format_KML_ from '../../../../src/ol/format/KML.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -194,7 +194,7 @@ describe('ol.format.KML', function() {
it('can write properties', function() {
var lineString = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var lineString = new LineString([[1, 2], [3, 4]]);
lineString.set('extrude', false);
lineString.set('tessellate', true);
lineString.set('altitudeMode', 'clampToGround');
@@ -449,7 +449,7 @@ describe('ol.format.KML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
expect(g.get('extrude')).to.be(false);
expect(g.get('tessellate')).to.be(true);
@@ -458,7 +458,7 @@ describe('ol.format.KML', function() {
it('can write XY LineString geometries', function() {
var layout = 'XY';
var lineString = new _ol_geom_LineString_([[1, 2], [3, 4]], layout);
var lineString = new LineString([[1, 2], [3, 4]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
var text =
@@ -478,7 +478,7 @@ describe('ol.format.KML', function() {
it('can write XYZ LineString geometries', function() {
var layout = 'XYZ';
var lineString = new _ol_geom_LineString_(
var lineString = new LineString(
[[1, 2, 3], [4, 5, 6]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
@@ -499,7 +499,7 @@ describe('ol.format.KML', function() {
it('can write XYM LineString geometries', function() {
var layout = 'XYM';
var lineString = new _ol_geom_LineString_(
var lineString = new LineString(
[[1, 2, 100], [3, 4, 200]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
@@ -520,7 +520,7 @@ describe('ol.format.KML', function() {
it('can write XYZM LineString geometries', function() {
var layout = 'XYZM';
var lineString = new _ol_geom_LineString_(
var lineString = new LineString(
[[1, 2, 3, 100], [4, 5, 6, 200]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
@@ -1181,7 +1181,7 @@ describe('ol.format.KML', function() {
var gs = g.getGeometries();
expect(gs).to.have.length(4);
expect(gs[0]).to.be.an(Point);
expect(gs[1]).to.be.an(_ol_geom_LineString_);
expect(gs[1]).to.be.an(LineString);
expect(gs[2]).to.be.an(_ol_geom_Polygon_);
expect(gs[3]).to.be.an(_ol_geom_Polygon_);
});
@@ -1210,7 +1210,7 @@ describe('ol.format.KML', function() {
it('can write GeometryCollection geometries', function() {
var collection = new _ol_geom_GeometryCollection_([
new Point([1, 2]),
new _ol_geom_LineString_([[1, 2], [3, 4]]),
new LineString([[1, 2], [3, 4]]),
new _ol_geom_Polygon_([[[1, 2], [3, 4], [3, 2], [1, 2]]])
]);
var features = [new _ol_Feature_(collection)];
@@ -1262,7 +1262,7 @@ describe('ol.format.KML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
});
it('can read gx:MultiTrack', function() {
@@ -1292,7 +1292,7 @@ describe('ol.format.KML', function() {
expect(g).to.be.an(_ol_geom_MultiLineString_);
var gs = g.getLineStrings();
expect(gs).to.have.length(2);
expect(gs[0]).to.be.an(_ol_geom_LineString_);
expect(gs[0]).to.be.an(LineString);
});
it('can read dateTime', function() {

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_OSMXML_ from '../../../../src/ol/format/OSMXML.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -81,7 +81,7 @@ describe('ol.format.OSMXML', function() {
var line = fs[2];
expect(line).to.be.an(_ol_Feature_);
g = line.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[2, 1], [4, 3]]);
});
@@ -107,7 +107,7 @@ describe('ol.format.OSMXML', function() {
var line = fs[2];
expect(line).to.be.an(_ol_Feature_);
var g = line.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[2, 1], [4, 3]]);
});

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_Polyline_ from '../../../../src/ol/format/Polyline.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
describe('ol.format.Polyline', function() {
@@ -267,7 +267,7 @@ describe('ol.format.Polyline', function() {
var feature = format.readFeature(encodedFlatPoints);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getFlatCoordinates()).to.eql(flatPoints);
});
@@ -277,7 +277,7 @@ describe('ol.format.Polyline', function() {
});
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(points3857);
});
@@ -292,7 +292,7 @@ describe('ol.format.Polyline', function() {
var feature = features[0];
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getFlatCoordinates()).to.eql(flatPoints);
});
@@ -305,7 +305,7 @@ describe('ol.format.Polyline', function() {
var feature = features[0];
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(points3857);
});
@@ -315,7 +315,7 @@ describe('ol.format.Polyline', function() {
it('returns the expected geometry', function() {
var geometry = format.readGeometry(encodedFlatPoints);
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getFlatCoordinates()).to.eql(flatPoints);
});
@@ -342,7 +342,7 @@ describe('ol.format.Polyline', function() {
var geometry = format.readGeometry(encodedFlatPoints, {
featureProjection: 'EPSG:3857'
});
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(points3857);
});
@@ -360,12 +360,12 @@ describe('ol.format.Polyline', function() {
describe('#writeFeature', function() {
it('returns the expected text', function() {
var feature = new _ol_Feature_(new _ol_geom_LineString_(points));
var feature = new _ol_Feature_(new LineString(points));
expect(format.writeFeature(feature)).to.be(encodedFlatPoints);
});
it('transforms and returns the expected text', function() {
var feature = new _ol_Feature_(new _ol_geom_LineString_(points3857));
var feature = new _ol_Feature_(new LineString(points3857));
expect(format.writeFeature(feature, {
featureProjection: 'EPSG:3857'
})).to.be(encodedFlatPoints);
@@ -376,12 +376,12 @@ describe('ol.format.Polyline', function() {
describe('#writeFeature', function() {
it('returns the expected text', function() {
var features = [new _ol_Feature_(new _ol_geom_LineString_(points))];
var features = [new _ol_Feature_(new LineString(points))];
expect(format.writeFeatures(features)).to.be(encodedFlatPoints);
});
it('transforms and returns the expected text', function() {
var features = [new _ol_Feature_(new _ol_geom_LineString_(points3857))];
var features = [new _ol_Feature_(new LineString(points3857))];
expect(format.writeFeatures(features, {
featureProjection: 'EPSG:3857'
})).to.be(encodedFlatPoints);
@@ -392,12 +392,12 @@ describe('ol.format.Polyline', function() {
describe('#writeGeometry', function() {
it('returns the expected text', function() {
var geometry = new _ol_geom_LineString_(points);
var geometry = new LineString(points);
expect(format.writeGeometry(geometry)).to.be(encodedFlatPoints);
});
it('transforms and returns the expected text', function() {
var geometry = new _ol_geom_LineString_(points3857);
var geometry = new LineString(points3857);
expect(format.writeGeometry(geometry, {
featureProjection: 'EPSG:3857'
})).to.be(encodedFlatPoints);

View File

@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GML2_ from '../../../../src/ol/format/GML2.js';
import _ol_format_WFS_ from '../../../../src/ol/format/WFS.js';
import _ol_format_filter_ from '../../../../src/ol/format/filter.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
@@ -934,14 +934,14 @@ describe('ol.format.WFS', function() {
it('handles the WFS version', function() {
var format = new _ol_format_WFS_();
var insertFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2], [3, 4.2]]),
the_geom: new LineString([[1.1, 2], [3, 4.2]]),
foo: 'bar',
nul: null
});
insertFeature.setGeometryName('the_geom');
var inserts = [insertFeature];
var updateFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2], [3, 4.2]]),
the_geom: new LineString([[1.1, 2], [3, 4.2]]),
foo: 'bar',
// null value gets Property element with no Value
nul: null,
@@ -1021,14 +1021,14 @@ describe('ol.format.WFS', function() {
it('handles 3D in WFS 1.0.0', function() {
var format = new _ol_format_WFS_();
var insertFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2, 4], [3, 4.2, 5]]),
the_geom: new LineString([[1.1, 2, 4], [3, 4.2, 5]]),
foo: 'bar',
nul: null
});
insertFeature.setGeometryName('the_geom');
var inserts = [insertFeature];
var updateFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2, 6], [3, 4.2, 7]]),
the_geom: new LineString([[1.1, 2, 6], [3, 4.2, 7]]),
foo: 'bar',
// null value gets Property element with no Value
nul: null,

View File

@@ -1,6 +1,6 @@
import _ol_geom_Geometry_ from '../../../../src/ol/geom/Geometry.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
@@ -15,7 +15,7 @@ describe('ol.geom.GeometryCollection', function() {
var line, multi, point, poly;
beforeEach(function() {
point = new Point([10, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
});
@@ -57,7 +57,7 @@ describe('ol.geom.GeometryCollection', function() {
it('returns a collection of geometries', function() {
var point = new Point([10, 20]);
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var line = new LineString([[10, 20], [30, 40]]);
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
@@ -65,7 +65,7 @@ describe('ol.geom.GeometryCollection', function() {
expect(geometries).to.be.an(Array);
expect(geometries).to.have.length(3);
expect(geometries[0]).to.be.a(Point);
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
expect(geometries[1]).to.be.a(LineString);
expect(geometries[2]).to.be.a(_ol_geom_Polygon_);
});
@@ -75,7 +75,7 @@ describe('ol.geom.GeometryCollection', function() {
it('has a working clone method', function() {
var point = new Point([10, 20]);
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var line = new LineString([[10, 20], [30, 40]]);
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
var clone = multi.clone();
@@ -106,7 +106,7 @@ describe('ol.geom.GeometryCollection', function() {
it('returns the bounding extent', function() {
var point = new Point([10, 2]);
var line = new _ol_geom_LineString_([[1, 20], [30, 40]]);
var line = new LineString([[1, 20], [30, 40]]);
var multi = new _ol_geom_GeometryCollection_([point, line]);
var extent = multi.getExtent();
expect(extent[0]).to.be(1);
@@ -123,7 +123,7 @@ describe('ol.geom.GeometryCollection', function() {
beforeEach(function() {
point = new Point([5, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
});
@@ -152,7 +152,7 @@ describe('ol.geom.GeometryCollection', function() {
var line, multi, point, poly;
beforeEach(function() {
point = new Point([10, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
});
@@ -177,7 +177,7 @@ describe('ol.geom.GeometryCollection', function() {
it('scales a collection', function() {
var geom = new _ol_geom_GeometryCollection_([
new Point([-1, -2]),
new _ol_geom_LineString_([[0, 0], [1, 2]])
new LineString([[0, 0], [1, 2]])
]);
geom.scale(10);
var geometries = geom.getGeometries();
@@ -188,7 +188,7 @@ describe('ol.geom.GeometryCollection', function() {
it('accepts sx and sy', function() {
var geom = new _ol_geom_GeometryCollection_([
new Point([-1, -2]),
new _ol_geom_LineString_([[0, 0], [1, 2]])
new LineString([[0, 0], [1, 2]])
]);
geom.scale(2, 3);
var geometries = geom.getGeometries();
@@ -199,7 +199,7 @@ describe('ol.geom.GeometryCollection', function() {
it('accepts an anchor', function() {
var geom = new _ol_geom_GeometryCollection_([
new Point([-1, -2]),
new _ol_geom_LineString_([[0, 0], [1, 2]])
new LineString([[0, 0], [1, 2]])
]);
geom.scale(10, 15, [-1, -2]);
var geometries = geom.getGeometries();
@@ -214,7 +214,7 @@ describe('ol.geom.GeometryCollection', function() {
var line, multi, point;
beforeEach(function() {
point = new Point([10, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
multi = new _ol_geom_GeometryCollection_([point, line]);
});
@@ -223,7 +223,7 @@ describe('ol.geom.GeometryCollection', function() {
var geometries = multi.getGeometries();
expect(geometries[0]).to.be.a(Point);
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
expect(geometries[1]).to.be.a(LineString);
var coords = geometries[0].getCoordinates();
expect(coords[0]).to.roughlyEqual(1113194.90, 1e-2);

View File

@@ -1,12 +1,12 @@
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
describe('ol.geom.LineString', function() {
it('can be constructed with a null geometry', function() {
expect(function() {
return new _ol_geom_LineString_(null);
return new LineString(null);
}).not.to.throwException();
});
@@ -14,7 +14,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([]);
lineString = new LineString([]);
});
it('defaults to layout XY', function() {
@@ -50,7 +50,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([[1, 2], [3, 4]]);
lineString = new LineString([[1, 2], [3, 4]]);
});
it('has the expected layout', function() {
@@ -111,7 +111,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([[1, 2, 3], [4, 5, 6]]);
lineString = new LineString([[1, 2, 3], [4, 5, 6]]);
});
it('has the expected layout', function() {
@@ -156,7 +156,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_(
lineString = new LineString(
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
@@ -202,7 +202,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([[1, 2, 3, 4], [5, 6, 7, 8]]);
lineString = new LineString([[1, 2, 3, 4], [5, 6, 7, 8]]);
});
it('has the expected layout', function() {
@@ -246,21 +246,21 @@ describe('ol.geom.LineString', function() {
describe('#scale()', function() {
it('scales a linestring', function() {
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
var geom = new LineString([[-10, -20], [10, 20]]);
geom.scale(10);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-100, -200], [100, 200]]);
});
it('accepts sx and sy', function() {
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
var geom = new LineString([[-10, -20], [10, 20]]);
geom.scale(2, 3);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-20, -60], [20, 60]]);
});
it('accepts an anchor', function() {
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
var geom = new LineString([[-10, -20], [10, 20]]);
geom.scale(3, 2, [10, 20]);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-50, -60], [10, 20]]);
@@ -272,7 +272,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_(
lineString = new LineString(
[[0, 0], [1.5, 1], [3, 3], [5, 1], [6, 3.5], [7, 5]]);
});
@@ -308,7 +308,7 @@ describe('ol.geom.LineString', function() {
it('returns a simplified geometry', function() {
var simplified = lineString.simplify(1);
expect(simplified).to.be.an(_ol_geom_LineString_);
expect(simplified).to.be.an(LineString);
expect(simplified.getCoordinates()).to.eql(
[[0, 0], [3, 3], [5, 1], [7, 5]]);
});
@@ -331,7 +331,7 @@ describe('ol.geom.LineString', function() {
it('returns the expectedResult', function() {
var simplifiedGeometry = lineString.getSimplifiedGeometry(1);
expect(simplifiedGeometry).to.be.an(_ol_geom_LineString_);
expect(simplifiedGeometry).to.be.an(LineString);
expect(simplifiedGeometry.getCoordinates()).to.eql(
[[0, 0], [3, 3], [5, 1], [7, 5]]);
});
@@ -384,7 +384,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_(
lineString = new LineString(
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
@@ -413,7 +413,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([
lineString = new LineString([
[0, 0, 0, 0],
[1, -1, 2, 1],
[2, -2, 4, 2],

View File

@@ -1,5 +1,5 @@
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
@@ -40,11 +40,11 @@ describe('ol.geom.MultiLineString', function() {
it('can append line strings', function() {
multiLineString.appendLineString(
new _ol_geom_LineString_([[1, 2], [3, 4]]));
new LineString([[1, 2], [3, 4]]));
expect(multiLineString.getCoordinates()).to.eql(
[[[1, 2], [3, 4]]]);
multiLineString.appendLineString(
new _ol_geom_LineString_([[5, 6], [7, 8]]));
new LineString([[5, 6], [7, 8]]));
expect(multiLineString.getCoordinates()).to.eql(
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]);
});
@@ -168,11 +168,11 @@ describe('ol.geom.MultiLineString', function() {
it('can return individual line strings', function() {
var lineString0 = multiLineString.getLineString(0);
expect(lineString0).to.be.an(_ol_geom_LineString_);
expect(lineString0).to.be.an(LineString);
expect(lineString0.getLayout()).to.be('XYM');
expect(lineString0.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
var lineString1 = multiLineString.getLineString(1);
expect(lineString1).to.be.an(_ol_geom_LineString_);
expect(lineString1).to.be.an(LineString);
expect(lineString1.getLayout()).to.be('XYM');
expect(lineString1.getCoordinates()).to.eql([[7, 8, 9], [10, 11, 12]]);
});
@@ -344,8 +344,8 @@ describe('ol.geom.MultiLineString', function() {
it('sets the line strings', function() {
var multiLineString = new _ol_geom_MultiLineString_(null);
var lineString1 = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var lineString2 = new _ol_geom_LineString_([[5, 6], [7, 8]]);
var lineString1 = new LineString([[1, 2], [3, 4]]);
var lineString2 = new LineString([[5, 6], [7, 8]]);
multiLineString.setLineStrings([lineString1, lineString2]);
expect(multiLineString.getFlatCoordinates()).to.eql(
[1, 2, 3, 4, 5, 6, 7, 8]);

View File

@@ -6,7 +6,7 @@ import _ol_array_ from '../../../../src/ol/array.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
@@ -284,7 +284,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql([[10, -20], [30, -20]]);
});
@@ -326,7 +326,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql(
[[10, -20], [20, -30], [20, -40]]);
});
@@ -363,7 +363,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
// expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql(
[[10, -20], [20, -30], [30, -40], [40, -50], [50, -60], [60, -70]]);
});
@@ -392,7 +392,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql([[10, -20], [30, -20]]);
});
@@ -1036,7 +1036,7 @@ describe('ol.interaction.Draw', function() {
});
map.addInteraction(draw);
feature = new _ol_Feature_(
new _ol_geom_LineString_([[0, 0], [1, 1], [2, 0]]));
new LineString([[0, 0], [1, 1], [2, 0]]));
});
it('sets the initial state', function() {

View File

@@ -6,7 +6,7 @@ import _ol_View_ from '../../../../src/ol/View.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_interaction_Modify_ from '../../../../src/ol/interaction/Modify.js';
@@ -226,7 +226,7 @@ describe('ol.interaction.Modify', function() {
it('deletes first vertex of a LineString', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]]
)
});
@@ -262,7 +262,7 @@ describe('ol.interaction.Modify', function() {
it('deletes last vertex of a LineString', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]]
)
});
@@ -298,7 +298,7 @@ describe('ol.interaction.Modify', function() {
it('deletes vertex of a LineString programmatically', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]]
)
});
@@ -340,7 +340,7 @@ describe('ol.interaction.Modify', function() {
it('keeps the third dimension', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0, 10], [10, 20, 20], [0, 40, 30], [40, 40, 40], [40, 0, 50]]
)
});

View File

@@ -4,7 +4,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_interaction_Snap_ from '../../../../src/ol/interaction/Snap.js';
@@ -73,7 +73,7 @@ describe('ol.interaction.Snap', function() {
});
it('snaps to edges only', function() {
var point = new _ol_Feature_(new _ol_geom_LineString_([[-10, 0], [10, 0]]));
var point = new _ol_Feature_(new LineString([[-10, 0], [10, 0]]));
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([point]),
pixelTolerance: 5,
@@ -91,7 +91,7 @@ describe('ol.interaction.Snap', function() {
});
it('snaps to vertices only', function() {
var point = new _ol_Feature_(new _ol_geom_LineString_([[-10, 0], [10, 0]]));
var point = new _ol_Feature_(new LineString([[-10, 0], [10, 0]]));
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([point]),
pixelTolerance: 5,
@@ -136,7 +136,7 @@ describe('ol.interaction.Snap', function() {
});
snapInteraction.setMap(map);
feature.setGeometry(new _ol_geom_LineString_([[-10, 0], [10, 0]]));
feature.setGeometry(new LineString([[-10, 0], [10, 0]]));
var event = {
pixel: [7 + width / 2, height / 2 - 4],
@@ -148,7 +148,7 @@ describe('ol.interaction.Snap', function() {
});
it('handle geometry changes', function() {
var line = new _ol_Feature_(new _ol_geom_LineString_([[-10, 0], [0, 0]]));
var line = new _ol_Feature_(new LineString([[-10, 0], [0, 0]]));
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([line]),
pixelTolerance: 5,
@@ -169,8 +169,8 @@ describe('ol.interaction.Snap', function() {
it('handle geometry name changes', function() {
var line = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[-10, 0], [0, 0]]),
alt_geometry: new _ol_geom_LineString_([[-10, 0], [10, 0]])
geometry: new LineString([[-10, 0], [0, 0]]),
alt_geometry: new LineString([[-10, 0], [10, 0]])
});
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([line]),

View File

@@ -1,6 +1,6 @@
import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
@@ -81,7 +81,7 @@ describe('ol.render.canvas.Immediate', function() {
var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
sinon.spy(context, 'drawLineString');
var geometry = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var geometry = new LineString([[1, 2], [3, 4]]);
context.drawGeometry(geometry);
expect(context.drawLineString.calledOnce).to.be(true);
expect(context.drawLineString.firstCall.calledWithExactly(geometry)).to.be(true);
@@ -135,7 +135,7 @@ describe('ol.render.canvas.Immediate', function() {
sinon.spy(context, 'drawPolygon');
var point = new Point([1, 2]);
var linestring = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var linestring = new LineString([[1, 2], [3, 4]]);
var polygon = new _ol_geom_Polygon_([[[1, 2], [3, 4], [5, 6], [1, 2]]]);
var geometry = new _ol_geom_GeometryCollection_([point, linestring, polygon]);

View File

@@ -1,4 +1,4 @@
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
@@ -78,7 +78,7 @@ describe('ol.render.Feature', function() {
describe('#getFlatMidpoint()', function() {
it('returns correct point', function() {
var line = new _ol_geom_LineString_([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
var line = new LineString([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
var feature = new _ol_render_Feature_('LineString', line.getFlatCoordinates());
expect(feature.getFlatMidpoint()).to.eql([10, 10]);
expect(feature.getFlatMidpoint()).to.eql(feature.flatMidpoints_);

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
@@ -27,7 +27,7 @@ describe('ol.render.webgl.Immediate', function() {
stroke: new _ol_style_Stroke_()
});
circle = new _ol_geom_Circle_([0, 0], 5);
line = new _ol_geom_LineString_([[0, 0], [5, 5]]);
line = new LineString([[0, 0], [5, 5]]);
multiLine = new _ol_geom_MultiLineString_([[[0, 0], [5, 5]]]);
point = new Point([0, 0]);
multiPoint = new MultiPoint([[0, 0]]);

View File

@@ -1,6 +1,6 @@
import {getUid} from '../../../../../src/ol/index.js';
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import _ol_render_webgl_LineStringReplay_ from '../../../../../src/ol/render/webgl/LineStringReplay.js';
import _ol_render_webgl_linestringreplay_defaultshader_ from '../../../../../src/ol/render/webgl/linestringreplay/defaultshader.js';
@@ -56,7 +56,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
it('sets the buffer data', function() {
var linestring;
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 2000], [2000, 3000]]);
replay.setFillStrokeStyle(null, strokeStyle1);
replay.drawLineString(linestring, null);
@@ -66,7 +66,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
expect(replay.startIndices).to.have.length(1);
expect(replay.startIndicesFeature).to.have.length(1);
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
replay.drawLineString(linestring, null);
expect(replay.vertices).to.have.length(140);
@@ -106,7 +106,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineJoin: 'bevel'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -126,7 +126,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineCap: 'butt'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -145,7 +145,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
color: [0, 255, 0, 1]
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -168,7 +168,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineJoin: 'bevel'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 2000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -189,7 +189,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineJoin: 'bevel'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000], [1000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -287,13 +287,13 @@ describe('ol.render.webgl.LineStringReplay', function() {
describe('#drawReplay', function() {
var gl, context;
var feature1 = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[0, 0], [500, 500]])
geometry: new LineString([[0, 0], [500, 500]])
});
var feature2 = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[0, 0], [500, 500]])
geometry: new LineString([[0, 0], [500, 500]])
});
var feature3 = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[0, 0], [500, 500]])
geometry: new LineString([[0, 0], [500, 500]])
});
beforeEach(function() {
gl = {

View File

@@ -1,7 +1,7 @@
import {getUid} from '../../../../../src/ol/index.js';
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
@@ -232,7 +232,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
var point = new _ol_Feature_(new Point([45, 90]));
var multipoint = new _ol_Feature_(new MultiPoint(
[[45, 90], [90, 45]]));
var linestring = new _ol_Feature_(new _ol_geom_LineString_(
var linestring = new _ol_Feature_(new LineString(
[[45, 90], [45, 45], [90, 45]]));
var multilinestring = new _ol_Feature_(new _ol_geom_MultiLineString_(
[linestring.getGeometry().getCoordinates(), linestring.getGeometry().getCoordinates()]));

View File

@@ -1,6 +1,6 @@
import {nullFunction} from '../../../../src/ol/index.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
@@ -99,7 +99,7 @@ describe('ol.renderer.vector', function() {
});
it('does render the linestring', function() {
feature.setGeometry(new _ol_geom_LineString_([[0, 0], [1, 1]]));
feature.setGeometry(new LineString([[0, 0], [1, 1]]));
var lineStringReplay = replayGroup.getReplay(
style.getZIndex(), 'LineString');
var setFillStrokeStyleSpy = sinon.spy(lineStringReplay,

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {get as getProjection} from '../../../../src/ol/proj.js';
@@ -51,7 +51,7 @@ describe('ol.source.Cluster', function() {
source: new _ol_source_Vector_({
features: [
new _ol_Feature_(new Point([0, 0])),
new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [1, 1]])),
new _ol_Feature_(new LineString([[0, 0], [1, 1]])),
new _ol_Feature_(new _ol_geom_Polygon_(
[[[-1, -1], [-1, 1], [1, 1], [1, -1], [-1, -1]]]))
]

View File

@@ -4,7 +4,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_loadingstrategy_ from '../../../../src/ol/loadingstrategy.js';
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js';
@@ -92,7 +92,7 @@ describe('ol.source.Vector', function() {
var features = [];
var vectorSource;
beforeEach(function() {
features.push(new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [10, 10]])));
features.push(new _ol_Feature_(new LineString([[0, 0], [10, 10]])));
features.push(new _ol_Feature_(new Point([0, 10])));
features.push(new _ol_Feature_(new Point([10, 5])));
vectorSource = new _ol_source_Vector_({

View File

@@ -5,7 +5,7 @@
import _ol_Sphere_ from '../../../src/ol/Sphere.js';
import _ol_format_WKT_ from '../../../src/ol/format/WKT.js';
import _ol_geom_GeometryCollection_ from '../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
import LineString from '../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../src/ol/geom/MultiPoint.js';
import Point from '../../../src/ol/geom/Point.js';
@@ -121,7 +121,7 @@ describe('ol.Sphere.getLength()', function() {
geometry: new MultiPoint([[0, 0], [1, 1]]),
length: 0
}, {
geometry: new _ol_geom_LineString_([
geometry: new LineString([
[12801741.441226462, -3763310.627144653],
[14582853.293918837, -2511525.2348457114],
[15918687.18343812, -2875744.624352243],
@@ -129,7 +129,7 @@ describe('ol.Sphere.getLength()', function() {
]),
length: 4407939.124914191
}, {
geometry: new _ol_geom_LineString_([
geometry: new LineString([
[115, -32],
[131, -22],
[143, -25],
@@ -155,13 +155,13 @@ describe('ol.Sphere.getLength()', function() {
length: 2 * 4407939.124914191
}, {
geometry: new _ol_geom_GeometryCollection_([
new _ol_geom_LineString_([
new LineString([
[115, -32],
[131, -22],
[143, -25],
[150, -34]
]),
new _ol_geom_LineString_([
new LineString([
[115, -32],
[131, -22],
[143, -25],

View File

@@ -3,7 +3,7 @@ import _ol_View_ from '../../../src/ol/View.js';
import _ol_ViewHint_ from '../../../src/ol/ViewHint.js';
import * as _ol_extent_ from '../../../src/ol/extent.js';
import _ol_geom_Circle_ from '../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
import LineString from '../../../src/ol/geom/LineString.js';
import Point from '../../../src/ol/geom/Point.js';
describe('ol.View', function() {
@@ -1252,21 +1252,21 @@ describe('ol.View', function() {
});
it('fits correctly to the geometry', function() {
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100], constrainResolution: false});
expect(view.getResolution()).to.be(11);
expect(view.getCenter()[0]).to.be(5950);
expect(view.getCenter()[1]).to.be(47100);
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100]});
expect(view.getResolution()).to.be(20);
expect(view.getCenter()[0]).to.be(5500);
expect(view.getCenter()[1]).to.be(47550);
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100], nearest: true});
expect(view.getResolution()).to.be(10);
expect(view.getCenter()[0]).to.be(6000);
@@ -1304,7 +1304,7 @@ describe('ol.View', function() {
view.setRotation(Math.PI / 4);
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100], constrainResolution: false});
expect(view.getResolution()).to.roughlyEqual(14.849242404917458, 1e-9);
expect(view.getCenter()[0]).to.roughlyEqual(5200, 1e-9);
@@ -1328,7 +1328,7 @@ describe('ol.View', function() {
});
it('animates when duration is defined', function(done) {
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{
size: [200, 200],
padding: [100, 0, 0, 100],
@@ -1348,7 +1348,7 @@ describe('ol.View', function() {
});
it('calls a callback when duration is not defined', function(done) {
view.fit(new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]), {
view.fit(new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), {
callback: function(complete) {
expect(complete).to.be(true);
done();
@@ -1356,7 +1356,7 @@ describe('ol.View', function() {
});
});
it('calls a callback when animation completes', function(done) {
view.fit(new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]), {
view.fit(new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), {
duration: 25,
callback: function(complete) {
expect(complete).to.be(true);