@vaadin/bundles 25.0.0-alpha3 → 25.0.0-alpha5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules_ol_ImageCanvas_js.js +76 -83
- package/node_modules_ol_ImageCanvas_js.js.map +1 -1
- package/node_modules_ol_TileRange_js.js +128 -110
- package/node_modules_ol_TileRange_js.js.map +1 -1
- package/node_modules_ol_Tile_js.js +279 -0
- package/node_modules_ol_Tile_js.js.map +1 -0
- package/node_modules_ol_VectorRenderTile_js.js +428 -143
- package/node_modules_ol_VectorRenderTile_js.js.map +1 -1
- package/node_modules_ol_VectorTile_js.js +405 -119
- package/node_modules_ol_VectorTile_js.js.map +1 -1
- package/node_modules_ol_control_MousePosition_js.js +327 -0
- package/node_modules_ol_control_MousePosition_js.js.map +1 -0
- package/node_modules_ol_control_ZoomToExtent_js.js +118 -0
- package/node_modules_ol_control_ZoomToExtent_js.js.map +1 -0
- package/node_modules_ol_events_SnapEvent_js.js +79 -0
- package/node_modules_ol_events_SnapEvent_js.js.map +1 -0
- package/node_modules_ol_featureloader_js.js +205 -0
- package/node_modules_ol_featureloader_js.js.map +1 -0
- package/node_modules_ol_geom_Circle_js.js +300 -0
- package/node_modules_ol_geom_Circle_js.js.map +1 -0
- package/node_modules_ol_geom_GeometryCollection_js.js +369 -0
- package/node_modules_ol_geom_GeometryCollection_js.js.map +1 -0
- package/node_modules_ol_geom_MultiPoint_js.js +228 -0
- package/node_modules_ol_geom_MultiPoint_js.js.map +1 -0
- package/node_modules_ol_geom_flat_center_js.js +47 -0
- package/node_modules_ol_geom_flat_center_js.js.map +1 -0
- package/node_modules_ol_geom_flat_geodesic_js.js +123 -88
- package/node_modules_ol_geom_flat_geodesic_js.js.map +1 -1
- package/node_modules_ol_geom_flat_interpolate_js.js +230 -0
- package/node_modules_ol_geom_flat_interpolate_js.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a0.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a0.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a1.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a1.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a2.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a2.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a3.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a3.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a4.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a4.js.map +1 -0
- package/node_modules_ol_geom_flat_linechunk_js.js +76 -0
- package/node_modules_ol_geom_flat_linechunk_js.js.map +1 -0
- package/node_modules_ol_geom_flat_straightchunk_js.js +68 -0
- package/node_modules_ol_geom_flat_straightchunk_js.js.map +1 -0
- package/node_modules_ol_geom_flat_textpath_js.js +178 -0
- package/node_modules_ol_geom_flat_textpath_js.js.map +1 -0
- package/node_modules_ol_interaction_DblClickDragZoom_js.js +285 -0
- package/node_modules_ol_interaction_DblClickDragZoom_js.js.map +1 -0
- package/node_modules_ol_interaction_DragAndDrop_js.js +351 -0
- package/node_modules_ol_interaction_DragAndDrop_js.js.map +1 -0
- package/node_modules_ol_interaction_DragRotateAndZoom_js.js +159 -0
- package/node_modules_ol_interaction_DragRotateAndZoom_js.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49290.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49290.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49291.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49291.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49292.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49292.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49293.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49293.js.map +1 -0
- package/node_modules_ol_loadingstrategy_js.js +95 -0
- package/node_modules_ol_loadingstrategy_js.js.map +1 -0
- package/node_modules_ol_render_VectorContext_js-_3ad60.js +144 -0
- package/node_modules_ol_render_VectorContext_js-_3ad60.js.map +1 -0
- package/node_modules_ol_render_VectorContext_js-_3ad61.js +144 -0
- package/node_modules_ol_render_VectorContext_js-_3ad61.js.map +1 -0
- package/node_modules_ol_render_VectorContext_js-node_modules_ol_render_canvas_hitdetect_js.js +372 -0
- package/node_modules_ol_render_VectorContext_js-node_modules_ol_render_canvas_hitdetect_js.js.map +1 -0
- package/node_modules_ol_render_canvas_ImageBuilder_js.js +318 -0
- package/node_modules_ol_render_canvas_ImageBuilder_js.js.map +1 -0
- package/node_modules_ol_render_canvas_Instruction_js.js +66 -0
- package/node_modules_ol_render_canvas_Instruction_js.js.map +1 -0
- package/node_modules_ol_render_canvas_LineStringBuilder_js.js +187 -0
- package/node_modules_ol_render_canvas_LineStringBuilder_js.js.map +1 -0
- package/node_modules_ol_render_canvas_PolygonBuilder_js.js +276 -0
- package/node_modules_ol_render_canvas_PolygonBuilder_js.js.map +1 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab20.js +156 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab20.js.map +1 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab21.js +156 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab21.js.map +1 -0
- package/node_modules_ol_render_js-node_modules_ol_render_VectorContext_js.js +301 -0
- package/node_modules_ol_render_js-node_modules_ol_render_VectorContext_js.js.map +1 -0
- package/node_modules_ol_renderer_Layer_js.js +219 -0
- package/node_modules_ol_renderer_Layer_js.js.map +1 -0
- package/node_modules_ol_source_Source_js.js +256 -0
- package/node_modules_ol_source_Source_js.js.map +1 -0
- package/node_modules_ol_source_VectorEventType_js-node_modules_ol_structs_RBush_js.js +318 -0
- package/node_modules_ol_source_VectorEventType_js-node_modules_ol_structs_RBush_js.js.map +1 -0
- package/node_modules_ol_source_VectorEventType_js.js +80 -0
- package/node_modules_ol_source_VectorEventType_js.js.map +1 -0
- package/node_modules_ol_structs_RBush_js.js +242 -0
- package/node_modules_ol_structs_RBush_js.js.map +1 -0
- package/node_modules_ol_style_js.js +2 -1
- package/node_modules_ol_style_js.js.map +1 -1
- package/node_modules_rbush_rbush_min_js.js +16 -0
- package/node_modules_rbush_rbush_min_js.js.map +1 -0
- package/package.json +142 -146
- package/vaadin-bundle.json +2447 -2352
- package/vaadin.js +52246 -63791
- package/vaadin.js.map +1 -1
- package/vendors-node_modules_dompurify_dist_purify_es_mjs.js +1364 -0
- package/vendors-node_modules_dompurify_dist_purify_es_mjs.js.map +1 -0
- package/vendors-node_modules_dompurify_dist_purify_js.js +26 -21
- package/vendors-node_modules_dompurify_dist_purify_js.js.map +1 -1
- package/vendors-node_modules_marked_lib_marked_esm_js.js +2205 -0
- package/vendors-node_modules_marked_lib_marked_esm_js.js.map +1 -0
- package/vendors-node_modules_marked_lib_marked_umd_js.js +2164 -2556
- package/vendors-node_modules_marked_lib_marked_umd_js.js.map +1 -1
- package/vendors-node_modules_ol_Feature_js.js +360 -0
- package/vendors-node_modules_ol_Feature_js.js.map +1 -0
- package/vendors-node_modules_ol_Geolocation_js.js +352 -293
- package/vendors-node_modules_ol_Geolocation_js.js.map +1 -1
- package/vendors-node_modules_ol_ImageTile_js.js +494 -0
- package/vendors-node_modules_ol_ImageTile_js.js.map +1 -0
- package/vendors-node_modules_ol_Overlay_js.js +606 -0
- package/vendors-node_modules_ol_Overlay_js.js.map +1 -0
- package/vendors-node_modules_ol_control_FullScreen_js.js +417 -0
- package/vendors-node_modules_ol_control_FullScreen_js.js.map +1 -0
- package/vendors-node_modules_ol_control_OverviewMap_js.js +711 -0
- package/vendors-node_modules_ol_control_OverviewMap_js.js.map +1 -0
- package/vendors-node_modules_ol_control_ScaleLine_js.js +509 -0
- package/vendors-node_modules_ol_control_ScaleLine_js.js.map +1 -0
- package/vendors-node_modules_ol_control_ZoomSlider_js.js +418 -0
- package/vendors-node_modules_ol_control_ZoomSlider_js.js.map +1 -0
- package/vendors-node_modules_ol_control_js.js +490 -0
- package/vendors-node_modules_ol_control_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_LineString_js.js +574 -0
- package/vendors-node_modules_ol_geom_LineString_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_MultiLineString_js.js +405 -0
- package/vendors-node_modules_ol_geom_MultiLineString_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_MultiPolygon_js.js +773 -0
- package/vendors-node_modules_ol_geom_MultiPolygon_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_js-node_modules_ol_geom_flat_length_js.js +769 -0
- package/vendors-node_modules_ol_geom_js-node_modules_ol_geom_flat_length_js.js.map +1 -0
- package/vendors-node_modules_ol_index_js.js +526 -675
- package/vendors-node_modules_ol_index_js.js.map +1 -1
- package/vendors-node_modules_ol_interaction_Draw_js.js +2777 -0
- package/vendors-node_modules_ol_interaction_Draw_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Extent_js.js +586 -0
- package/vendors-node_modules_ol_interaction_Extent_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Link_js.js +489 -0
- package/vendors-node_modules_ol_interaction_Link_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Modify_js.js +1841 -0
- package/vendors-node_modules_ol_interaction_Modify_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Select_js.js +623 -0
- package/vendors-node_modules_ol_interaction_Select_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Snap_js.js +982 -0
- package/vendors-node_modules_ol_interaction_Snap_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Translate_js.js +466 -0
- package/vendors-node_modules_ol_interaction_Translate_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_js.js +872 -0
- package/vendors-node_modules_ol_interaction_js.js.map +1 -0
- package/vendors-node_modules_ol_layer_Graticule_js.js +1374 -989
- package/vendors-node_modules_ol_layer_Graticule_js.js.map +1 -1
- package/vendors-node_modules_ol_render_Feature_js.js +546 -0
- package/vendors-node_modules_ol_render_Feature_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_BuilderGroup_js.js +897 -0
- package/vendors-node_modules_ol_render_canvas_BuilderGroup_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_Builder_js.js +907 -0
- package/vendors-node_modules_ol_render_canvas_Builder_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js +539 -0
- package/vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_Executor_js.js +1715 -0
- package/vendors-node_modules_ol_render_canvas_Executor_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_Immediate_js.js +1208 -0
- package/vendors-node_modules_ol_render_canvas_Immediate_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_TextBuilder_js.js +825 -0
- package/vendors-node_modules_ol_render_canvas_TextBuilder_js.js.map +1 -0
- package/vendors-node_modules_ol_renderer_canvas_Layer_js.js +654 -0
- package/vendors-node_modules_ol_renderer_canvas_Layer_js.js.map +1 -0
- package/vendors-node_modules_ol_renderer_canvas_VectorLayer_js.js +1044 -0
- package/vendors-node_modules_ol_renderer_canvas_VectorLayer_js.js.map +1 -0
- package/vendors-node_modules_ol_renderer_vector_js.js +460 -0
- package/vendors-node_modules_ol_renderer_vector_js.js.map +1 -0
- package/vendors-node_modules_ol_source_Vector_js.js +2091 -0
- package/vendors-node_modules_ol_source_Vector_js.js.map +1 -0
- package/node_modules_ol_ImageTile_js.js +0 -177
- package/node_modules_ol_ImageTile_js.js.map +0 -1
- package/node_modules_ol_render_js.js +0 -131
- package/node_modules_ol_render_js.js.map +0 -1
- package/node_modules_ol_structs_LRUCache_js.js +0 -275
- package/node_modules_ol_structs_LRUCache_js.js.map +0 -1
- package/node_modules_ol_tilecoord_js.js +0 -115
- package/node_modules_ol_tilecoord_js.js.map +0 -1
- package/vendors-node_modules_ol_TileCache_js.js +0 -461
- package/vendors-node_modules_ol_TileCache_js.js.map +0 -1
- package/vendors-node_modules_ol_Tile_js.js +0 -330
- package/vendors-node_modules_ol_Tile_js.js.map +0 -1
- package/vendors-node_modules_ol_style_Text_js.js +0 -509
- package/vendors-node_modules_ol_style_Text_js.js.map +0 -1
- package/vendors-node_modules_rbush_index_js.js +0 -531
- package/vendors-node_modules_rbush_index_js.js.map +0 -1
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["vendors-node_modules_ol_geom_MultiLineString_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/geom/MultiLineString.js":
|
|
4
|
+
/*!*************************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/geom/MultiLineString.js ***!
|
|
6
|
+
\*************************************************/
|
|
7
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../array.js */ "./node_modules/ol/array.js");
|
|
14
|
+
/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extent.js */ "./node_modules/ol/extent.js");
|
|
15
|
+
/* harmony import */ var _LineString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./LineString.js */ "./node_modules/ol/geom/LineString.js");
|
|
16
|
+
/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SimpleGeometry.js */ "./node_modules/ol/geom/SimpleGeometry.js");
|
|
17
|
+
/* harmony import */ var _flat_closest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/closest.js */ "./node_modules/ol/geom/flat/closest.js");
|
|
18
|
+
/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flat/deflate.js */ "./node_modules/ol/geom/flat/deflate.js");
|
|
19
|
+
/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/inflate.js */ "./node_modules/ol/geom/flat/inflate.js");
|
|
20
|
+
/* harmony import */ var _flat_interpolate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat/interpolate.js */ "./node_modules/ol/geom/flat/interpolate.js");
|
|
21
|
+
/* harmony import */ var _flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flat/intersectsextent.js */ "./node_modules/ol/geom/flat/intersectsextent.js");
|
|
22
|
+
/* harmony import */ var _flat_length_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flat/length.js */ "./node_modules/ol/geom/flat/length.js");
|
|
23
|
+
/* harmony import */ var _flat_simplify_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flat/simplify.js */ "./node_modules/ol/geom/flat/simplify.js");
|
|
24
|
+
/**
|
|
25
|
+
* @module ol/geom/MultiLineString
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @classdesc
|
|
41
|
+
* Multi-linestring geometry.
|
|
42
|
+
*
|
|
43
|
+
* @api
|
|
44
|
+
*/
|
|
45
|
+
class MultiLineString extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
46
|
+
/**
|
|
47
|
+
* @param {Array<Array<import("../coordinate.js").Coordinate>|LineString>|Array<number>} coordinates
|
|
48
|
+
* Coordinates or LineString geometries. (For internal use, flat coordinates in
|
|
49
|
+
* combination with `layout` and `ends` are also accepted.)
|
|
50
|
+
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
51
|
+
* @param {Array<number>} [ends] Flat coordinate ends for internal use.
|
|
52
|
+
*/
|
|
53
|
+
constructor(coordinates, layout, ends) {
|
|
54
|
+
super();
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @type {Array<number>}
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
this.ends_ = [];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @private
|
|
64
|
+
* @type {number}
|
|
65
|
+
*/
|
|
66
|
+
this.maxDelta_ = -1;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @private
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
this.maxDeltaRevision_ = -1;
|
|
73
|
+
|
|
74
|
+
if (Array.isArray(coordinates[0])) {
|
|
75
|
+
this.setCoordinates(
|
|
76
|
+
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (
|
|
77
|
+
coordinates
|
|
78
|
+
),
|
|
79
|
+
layout,
|
|
80
|
+
);
|
|
81
|
+
} else if (layout !== undefined && ends) {
|
|
82
|
+
this.setFlatCoordinates(
|
|
83
|
+
layout,
|
|
84
|
+
/** @type {Array<number>} */ (coordinates),
|
|
85
|
+
);
|
|
86
|
+
this.ends_ = ends;
|
|
87
|
+
} else {
|
|
88
|
+
const lineStrings = /** @type {Array<LineString>} */ (coordinates);
|
|
89
|
+
/** @type {Array<number>} */
|
|
90
|
+
const flatCoordinates = [];
|
|
91
|
+
const ends = [];
|
|
92
|
+
for (let i = 0, ii = lineStrings.length; i < ii; ++i) {
|
|
93
|
+
const lineString = lineStrings[i];
|
|
94
|
+
(0,_array_js__WEBPACK_IMPORTED_MODULE_1__.extend)(flatCoordinates, lineString.getFlatCoordinates());
|
|
95
|
+
ends.push(flatCoordinates.length);
|
|
96
|
+
}
|
|
97
|
+
const layout =
|
|
98
|
+
lineStrings.length === 0
|
|
99
|
+
? this.getLayout()
|
|
100
|
+
: lineStrings[0].getLayout();
|
|
101
|
+
this.setFlatCoordinates(layout, flatCoordinates);
|
|
102
|
+
this.ends_ = ends;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Append the passed linestring to the multilinestring.
|
|
108
|
+
* @param {LineString} lineString LineString.
|
|
109
|
+
* @api
|
|
110
|
+
*/
|
|
111
|
+
appendLineString(lineString) {
|
|
112
|
+
(0,_array_js__WEBPACK_IMPORTED_MODULE_1__.extend)(this.flatCoordinates, lineString.getFlatCoordinates().slice());
|
|
113
|
+
this.ends_.push(this.flatCoordinates.length);
|
|
114
|
+
this.changed();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Make a complete copy of the geometry.
|
|
119
|
+
* @return {!MultiLineString} Clone.
|
|
120
|
+
* @api
|
|
121
|
+
* @override
|
|
122
|
+
*/
|
|
123
|
+
clone() {
|
|
124
|
+
const multiLineString = new MultiLineString(
|
|
125
|
+
this.flatCoordinates.slice(),
|
|
126
|
+
this.layout,
|
|
127
|
+
this.ends_.slice(),
|
|
128
|
+
);
|
|
129
|
+
multiLineString.applyProperties(this);
|
|
130
|
+
return multiLineString;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @param {number} x X.
|
|
135
|
+
* @param {number} y Y.
|
|
136
|
+
* @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
|
|
137
|
+
* @param {number} minSquaredDistance Minimum squared distance.
|
|
138
|
+
* @return {number} Minimum squared distance.
|
|
139
|
+
* @override
|
|
140
|
+
*/
|
|
141
|
+
closestPointXY(x, y, closestPoint, minSquaredDistance) {
|
|
142
|
+
if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {
|
|
143
|
+
return minSquaredDistance;
|
|
144
|
+
}
|
|
145
|
+
if (this.maxDeltaRevision_ != this.getRevision()) {
|
|
146
|
+
this.maxDelta_ = Math.sqrt(
|
|
147
|
+
(0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_3__.arrayMaxSquaredDelta)(
|
|
148
|
+
this.flatCoordinates,
|
|
149
|
+
0,
|
|
150
|
+
this.ends_,
|
|
151
|
+
this.stride,
|
|
152
|
+
0,
|
|
153
|
+
),
|
|
154
|
+
);
|
|
155
|
+
this.maxDeltaRevision_ = this.getRevision();
|
|
156
|
+
}
|
|
157
|
+
return (0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_3__.assignClosestArrayPoint)(
|
|
158
|
+
this.flatCoordinates,
|
|
159
|
+
0,
|
|
160
|
+
this.ends_,
|
|
161
|
+
this.stride,
|
|
162
|
+
this.maxDelta_,
|
|
163
|
+
false,
|
|
164
|
+
x,
|
|
165
|
+
y,
|
|
166
|
+
closestPoint,
|
|
167
|
+
minSquaredDistance,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Returns the coordinate at `m` using linear interpolation, or `null` if no
|
|
173
|
+
* such coordinate exists.
|
|
174
|
+
*
|
|
175
|
+
* `extrapolate` controls extrapolation beyond the range of Ms in the
|
|
176
|
+
* MultiLineString. If `extrapolate` is `true` then Ms less than the first
|
|
177
|
+
* M will return the first coordinate and Ms greater than the last M will
|
|
178
|
+
* return the last coordinate.
|
|
179
|
+
*
|
|
180
|
+
* `interpolate` controls interpolation between consecutive LineStrings
|
|
181
|
+
* within the MultiLineString. If `interpolate` is `true` the coordinates
|
|
182
|
+
* will be linearly interpolated between the last coordinate of one LineString
|
|
183
|
+
* and the first coordinate of the next LineString. If `interpolate` is
|
|
184
|
+
* `false` then the function will return `null` for Ms falling between
|
|
185
|
+
* LineStrings.
|
|
186
|
+
*
|
|
187
|
+
* @param {number} m M.
|
|
188
|
+
* @param {boolean} [extrapolate] Extrapolate. Default is `false`.
|
|
189
|
+
* @param {boolean} [interpolate] Interpolate. Default is `false`.
|
|
190
|
+
* @return {import("../coordinate.js").Coordinate|null} Coordinate.
|
|
191
|
+
* @api
|
|
192
|
+
*/
|
|
193
|
+
getCoordinateAtM(m, extrapolate, interpolate) {
|
|
194
|
+
if (
|
|
195
|
+
(this.layout != 'XYM' && this.layout != 'XYZM') ||
|
|
196
|
+
this.flatCoordinates.length === 0
|
|
197
|
+
) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
extrapolate = extrapolate !== undefined ? extrapolate : false;
|
|
201
|
+
interpolate = interpolate !== undefined ? interpolate : false;
|
|
202
|
+
return (0,_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_4__.lineStringsCoordinateAtM)(
|
|
203
|
+
this.flatCoordinates,
|
|
204
|
+
0,
|
|
205
|
+
this.ends_,
|
|
206
|
+
this.stride,
|
|
207
|
+
m,
|
|
208
|
+
extrapolate,
|
|
209
|
+
interpolate,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Return the coordinates of the multilinestring.
|
|
215
|
+
* @return {Array<Array<import("../coordinate.js").Coordinate>>} Coordinates.
|
|
216
|
+
* @api
|
|
217
|
+
* @override
|
|
218
|
+
*/
|
|
219
|
+
getCoordinates() {
|
|
220
|
+
return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinatesArray)(
|
|
221
|
+
this.flatCoordinates,
|
|
222
|
+
0,
|
|
223
|
+
this.ends_,
|
|
224
|
+
this.stride,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @return {Array<number>} Ends.
|
|
230
|
+
*/
|
|
231
|
+
getEnds() {
|
|
232
|
+
return this.ends_;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Return the linestring at the specified index.
|
|
237
|
+
* @param {number} index Index.
|
|
238
|
+
* @return {LineString} LineString.
|
|
239
|
+
* @api
|
|
240
|
+
*/
|
|
241
|
+
getLineString(index) {
|
|
242
|
+
if (index < 0 || this.ends_.length <= index) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
return new _LineString_js__WEBPACK_IMPORTED_MODULE_6__["default"](
|
|
246
|
+
this.flatCoordinates.slice(
|
|
247
|
+
index === 0 ? 0 : this.ends_[index - 1],
|
|
248
|
+
this.ends_[index],
|
|
249
|
+
),
|
|
250
|
+
this.layout,
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Return the linestrings of this multilinestring.
|
|
256
|
+
* @return {Array<LineString>} LineStrings.
|
|
257
|
+
* @api
|
|
258
|
+
*/
|
|
259
|
+
getLineStrings() {
|
|
260
|
+
const flatCoordinates = this.flatCoordinates;
|
|
261
|
+
const ends = this.ends_;
|
|
262
|
+
const layout = this.layout;
|
|
263
|
+
/** @type {Array<LineString>} */
|
|
264
|
+
const lineStrings = [];
|
|
265
|
+
let offset = 0;
|
|
266
|
+
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
|
267
|
+
const end = ends[i];
|
|
268
|
+
const lineString = new _LineString_js__WEBPACK_IMPORTED_MODULE_6__["default"](
|
|
269
|
+
flatCoordinates.slice(offset, end),
|
|
270
|
+
layout,
|
|
271
|
+
);
|
|
272
|
+
lineStrings.push(lineString);
|
|
273
|
+
offset = end;
|
|
274
|
+
}
|
|
275
|
+
return lineStrings;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Return the sum of all line string lengths
|
|
280
|
+
* @return {number} Length (on projected plane).
|
|
281
|
+
* @api
|
|
282
|
+
*/
|
|
283
|
+
getLength() {
|
|
284
|
+
const ends = this.ends_;
|
|
285
|
+
let start = 0;
|
|
286
|
+
let length = 0;
|
|
287
|
+
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
|
288
|
+
length += (0,_flat_length_js__WEBPACK_IMPORTED_MODULE_7__.lineStringLength)(
|
|
289
|
+
this.flatCoordinates,
|
|
290
|
+
start,
|
|
291
|
+
ends[i],
|
|
292
|
+
this.stride,
|
|
293
|
+
);
|
|
294
|
+
start = ends[i];
|
|
295
|
+
}
|
|
296
|
+
return length;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @return {Array<number>} Flat midpoints.
|
|
301
|
+
*/
|
|
302
|
+
getFlatMidpoints() {
|
|
303
|
+
/** @type {Array<number>} */
|
|
304
|
+
const midpoints = [];
|
|
305
|
+
const flatCoordinates = this.flatCoordinates;
|
|
306
|
+
let offset = 0;
|
|
307
|
+
const ends = this.ends_;
|
|
308
|
+
const stride = this.stride;
|
|
309
|
+
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
|
310
|
+
const end = ends[i];
|
|
311
|
+
const midpoint = (0,_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_4__.interpolatePoint)(
|
|
312
|
+
flatCoordinates,
|
|
313
|
+
offset,
|
|
314
|
+
end,
|
|
315
|
+
stride,
|
|
316
|
+
0.5,
|
|
317
|
+
);
|
|
318
|
+
(0,_array_js__WEBPACK_IMPORTED_MODULE_1__.extend)(midpoints, midpoint);
|
|
319
|
+
offset = end;
|
|
320
|
+
}
|
|
321
|
+
return midpoints;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @param {number} squaredTolerance Squared tolerance.
|
|
326
|
+
* @return {MultiLineString} Simplified MultiLineString.
|
|
327
|
+
* @protected
|
|
328
|
+
* @override
|
|
329
|
+
*/
|
|
330
|
+
getSimplifiedGeometryInternal(squaredTolerance) {
|
|
331
|
+
/** @type {Array<number>} */
|
|
332
|
+
const simplifiedFlatCoordinates = [];
|
|
333
|
+
/** @type {Array<number>} */
|
|
334
|
+
const simplifiedEnds = [];
|
|
335
|
+
simplifiedFlatCoordinates.length = (0,_flat_simplify_js__WEBPACK_IMPORTED_MODULE_8__.douglasPeuckerArray)(
|
|
336
|
+
this.flatCoordinates,
|
|
337
|
+
0,
|
|
338
|
+
this.ends_,
|
|
339
|
+
this.stride,
|
|
340
|
+
squaredTolerance,
|
|
341
|
+
simplifiedFlatCoordinates,
|
|
342
|
+
0,
|
|
343
|
+
simplifiedEnds,
|
|
344
|
+
);
|
|
345
|
+
return new MultiLineString(simplifiedFlatCoordinates, 'XY', simplifiedEnds);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Get the type of this geometry.
|
|
350
|
+
* @return {import("./Geometry.js").Type} Geometry type.
|
|
351
|
+
* @api
|
|
352
|
+
* @override
|
|
353
|
+
*/
|
|
354
|
+
getType() {
|
|
355
|
+
return 'MultiLineString';
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Test if the geometry and the passed extent intersect.
|
|
360
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
361
|
+
* @return {boolean} `true` if the geometry and the extent intersect.
|
|
362
|
+
* @api
|
|
363
|
+
* @override
|
|
364
|
+
*/
|
|
365
|
+
intersectsExtent(extent) {
|
|
366
|
+
return (0,_flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_9__.intersectsLineStringArray)(
|
|
367
|
+
this.flatCoordinates,
|
|
368
|
+
0,
|
|
369
|
+
this.ends_,
|
|
370
|
+
this.stride,
|
|
371
|
+
extent,
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Set the coordinates of the multilinestring.
|
|
377
|
+
* @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
|
|
378
|
+
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
379
|
+
* @api
|
|
380
|
+
* @override
|
|
381
|
+
*/
|
|
382
|
+
setCoordinates(coordinates, layout) {
|
|
383
|
+
this.setLayout(layout, coordinates, 2);
|
|
384
|
+
if (!this.flatCoordinates) {
|
|
385
|
+
this.flatCoordinates = [];
|
|
386
|
+
}
|
|
387
|
+
const ends = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_10__.deflateCoordinatesArray)(
|
|
388
|
+
this.flatCoordinates,
|
|
389
|
+
0,
|
|
390
|
+
coordinates,
|
|
391
|
+
this.stride,
|
|
392
|
+
this.ends_,
|
|
393
|
+
);
|
|
394
|
+
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
|
|
395
|
+
this.changed();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MultiLineString);
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
/***/ })
|
|
403
|
+
|
|
404
|
+
}])
|
|
405
|
+
//# sourceMappingURL=vendors-node_modules_ol_geom_MultiLineString_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors-node_modules_ol_geom_MultiLineString_js.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACmC;AACmB;AACb;AACQ;AAC+B;AACtB;AACA;AAI3B;AACsC;AACnB;AACK;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0DAAc;AAC5C;AACA,aAAa,8EAA8E;AAC3F;AACA;AACA,aAAa,wCAAwC;AACrD,aAAa,eAAe;AAC5B;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,mBAAmB,qDAAqD;AACxE;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA,MAAM;AACN,qCAAqC,mBAAmB;AACxD,iBAAiB,eAAe;AAChC;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA,QAAQ,iDAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA,IAAI,iDAAM;AACV;AACA;AACA;;AAEA;AACA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA,6BAA6B,oEAAwB;AACrD;AACA;AACA;AACA;AACA,QAAQ,sEAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yEAAuB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,cAAc,4CAA4C;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8EAAwB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,qDAAqD;AACnE;AACA;AACA;AACA;AACA,WAAW,yEAAuB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA,6BAA6B,sDAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C,gBAAgB,iEAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,eAAe;AAC7B;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA,uBAAuB,sEAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iDAAM;AACZ;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,eAAe,eAAe;AAC9B;AACA,uCAAuC,sEAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,8BAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,+BAA+B;AAC5C,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA,WAAW,oFAAyB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sDAAsD;AACnE,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,0EAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,eAAe,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/geom/MultiLineString.js"],"sourcesContent":["/**\n * @module ol/geom/MultiLineString\n */\nimport {extend} from '../array.js';\nimport {closestSquaredDistanceXY} from '../extent.js';\nimport LineString from './LineString.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {arrayMaxSquaredDelta, assignClosestArrayPoint} from './flat/closest.js';\nimport {deflateCoordinatesArray} from './flat/deflate.js';\nimport {inflateCoordinatesArray} from './flat/inflate.js';\nimport {\n interpolatePoint,\n lineStringsCoordinateAtM,\n} from './flat/interpolate.js';\nimport {intersectsLineStringArray} from './flat/intersectsextent.js';\nimport {lineStringLength} from './flat/length.js';\nimport {douglasPeuckerArray} from './flat/simplify.js';\n\n/**\n * @classdesc\n * Multi-linestring geometry.\n *\n * @api\n */\nclass MultiLineString extends SimpleGeometry {\n /**\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>|LineString>|Array<number>} coordinates\n * Coordinates or LineString geometries. (For internal use, flat coordinates in\n * combination with `layout` and `ends` are also accepted.)\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array<number>} [ends] Flat coordinate ends for internal use.\n */\n constructor(coordinates, layout, ends) {\n super();\n\n /**\n * @type {Array<number>}\n * @private\n */\n this.ends_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n if (Array.isArray(coordinates[0])) {\n this.setCoordinates(\n /** @type {Array<Array<import(\"../coordinate.js\").Coordinate>>} */ (\n coordinates\n ),\n layout,\n );\n } else if (layout !== undefined && ends) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array<number>} */ (coordinates),\n );\n this.ends_ = ends;\n } else {\n const lineStrings = /** @type {Array<LineString>} */ (coordinates);\n /** @type {Array<number>} */\n const flatCoordinates = [];\n const ends = [];\n for (let i = 0, ii = lineStrings.length; i < ii; ++i) {\n const lineString = lineStrings[i];\n extend(flatCoordinates, lineString.getFlatCoordinates());\n ends.push(flatCoordinates.length);\n }\n const layout =\n lineStrings.length === 0\n ? this.getLayout()\n : lineStrings[0].getLayout();\n this.setFlatCoordinates(layout, flatCoordinates);\n this.ends_ = ends;\n }\n }\n\n /**\n * Append the passed linestring to the multilinestring.\n * @param {LineString} lineString LineString.\n * @api\n */\n appendLineString(lineString) {\n extend(this.flatCoordinates, lineString.getFlatCoordinates().slice());\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiLineString} Clone.\n * @api\n * @override\n */\n clone() {\n const multiLineString = new MultiLineString(\n this.flatCoordinates.slice(),\n this.layout,\n this.ends_.slice(),\n );\n multiLineString.applyProperties(this);\n return multiLineString;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(\n arrayMaxSquaredDelta(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n 0,\n ),\n );\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestArrayPoint(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n this.maxDelta_,\n false,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * `interpolate` controls interpolation between consecutive LineStrings\n * within the MultiLineString. If `interpolate` is `true` the coordinates\n * will be linearly interpolated between the last coordinate of one LineString\n * and the first coordinate of the next LineString. If `interpolate` is\n * `false` then the function will return `null` for Ms falling between\n * LineStrings.\n *\n * @param {number} m M.\n * @param {boolean} [extrapolate] Extrapolate. Default is `false`.\n * @param {boolean} [interpolate] Interpolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate|null} Coordinate.\n * @api\n */\n getCoordinateAtM(m, extrapolate, interpolate) {\n if (\n (this.layout != 'XYM' && this.layout != 'XYZM') ||\n this.flatCoordinates.length === 0\n ) {\n return null;\n }\n extrapolate = extrapolate !== undefined ? extrapolate : false;\n interpolate = interpolate !== undefined ? interpolate : false;\n return lineStringsCoordinateAtM(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n m,\n extrapolate,\n interpolate,\n );\n }\n\n /**\n * Return the coordinates of the multilinestring.\n * @return {Array<Array<import(\"../coordinate.js\").Coordinate>>} Coordinates.\n * @api\n * @override\n */\n getCoordinates() {\n return inflateCoordinatesArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n );\n }\n\n /**\n * @return {Array<number>} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * Return the linestring at the specified index.\n * @param {number} index Index.\n * @return {LineString} LineString.\n * @api\n */\n getLineString(index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new LineString(\n this.flatCoordinates.slice(\n index === 0 ? 0 : this.ends_[index - 1],\n this.ends_[index],\n ),\n this.layout,\n );\n }\n\n /**\n * Return the linestrings of this multilinestring.\n * @return {Array<LineString>} LineStrings.\n * @api\n */\n getLineStrings() {\n const flatCoordinates = this.flatCoordinates;\n const ends = this.ends_;\n const layout = this.layout;\n /** @type {Array<LineString>} */\n const lineStrings = [];\n let offset = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const lineString = new LineString(\n flatCoordinates.slice(offset, end),\n layout,\n );\n lineStrings.push(lineString);\n offset = end;\n }\n return lineStrings;\n }\n\n /**\n * Return the sum of all line string lengths\n * @return {number} Length (on projected plane).\n * @api\n */\n getLength() {\n const ends = this.ends_;\n let start = 0;\n let length = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n length += lineStringLength(\n this.flatCoordinates,\n start,\n ends[i],\n this.stride,\n );\n start = ends[i];\n }\n return length;\n }\n\n /**\n * @return {Array<number>} Flat midpoints.\n */\n getFlatMidpoints() {\n /** @type {Array<number>} */\n const midpoints = [];\n const flatCoordinates = this.flatCoordinates;\n let offset = 0;\n const ends = this.ends_;\n const stride = this.stride;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const midpoint = interpolatePoint(\n flatCoordinates,\n offset,\n end,\n stride,\n 0.5,\n );\n extend(midpoints, midpoint);\n offset = end;\n }\n return midpoints;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {MultiLineString} Simplified MultiLineString.\n * @protected\n * @override\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array<number>} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array<number>} */\n const simplifiedEnds = [];\n simplifiedFlatCoordinates.length = douglasPeuckerArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n simplifiedEnds,\n );\n return new MultiLineString(simplifiedFlatCoordinates, 'XY', simplifiedEnds);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'MultiLineString';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return intersectsLineStringArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n extent,\n );\n }\n\n /**\n * Set the coordinates of the multilinestring.\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const ends = deflateCoordinatesArray(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n this.ends_,\n );\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n }\n}\n\nexport default MultiLineString;\n"],"names":[],"sourceRoot":""}
|