@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,205 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_featureloader_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/featureloader.js":
|
|
4
|
+
/*!******************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/featureloader.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 */ "loadFeaturesXhr": () => (/* binding */ loadFeaturesXhr),
|
|
12
|
+
/* harmony export */ "setWithCredentials": () => (/* binding */ setWithCredentials),
|
|
13
|
+
/* harmony export */ "xhr": () => (/* binding */ xhr)
|
|
14
|
+
/* harmony export */ });
|
|
15
|
+
/**
|
|
16
|
+
* @module ol/featureloader
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
let withCredentials = false;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* {@link module:ol/source/Vector~VectorSource} sources use a function of this type to
|
|
28
|
+
* load features.
|
|
29
|
+
*
|
|
30
|
+
* This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing
|
|
31
|
+
* the area to be loaded, a `{number}` representing the resolution (map units per pixel), a
|
|
32
|
+
* {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get
|
|
33
|
+
* the loaded features passed as an argument and an optional failure callback with no arguments. If
|
|
34
|
+
* the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and
|
|
35
|
+
* `'featuresloaderror'` events. `this` within the function is bound to the
|
|
36
|
+
* {@link module:ol/source/Vector~VectorSource} it's called from.
|
|
37
|
+
*
|
|
38
|
+
* The function is responsible for loading the features and adding them to the
|
|
39
|
+
* source.
|
|
40
|
+
*
|
|
41
|
+
* @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
|
|
42
|
+
* @typedef {(
|
|
43
|
+
* extent: import("./extent.js").Extent,
|
|
44
|
+
* resolution: number,
|
|
45
|
+
* projection: import("./proj/Projection.js").default,
|
|
46
|
+
* success?: (features: Array<FeatureType>) => void,
|
|
47
|
+
* failure?: () => void) => void} FeatureLoader
|
|
48
|
+
* @api
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* {@link module:ol/source/Vector~VectorSource} sources use a function of this type to
|
|
53
|
+
* get the url to load features from.
|
|
54
|
+
*
|
|
55
|
+
* This function takes an {@link module:ol/extent~Extent} representing the area
|
|
56
|
+
* to be loaded, a `{number}` representing the resolution (map units per pixel)
|
|
57
|
+
* and an {@link module:ol/proj/Projection~Projection} for the projection as
|
|
58
|
+
* arguments and returns a `{string}` representing the URL.
|
|
59
|
+
* @typedef {function(import("./extent.js").Extent, number, import("./proj/Projection.js").default): string} FeatureUrlFunction
|
|
60
|
+
* @api
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
|
|
65
|
+
* @param {string|FeatureUrlFunction} url Feature URL service.
|
|
66
|
+
* @param {import("./format/Feature.js").default<FeatureType>} format Feature format.
|
|
67
|
+
* @param {import("./extent.js").Extent} extent Extent.
|
|
68
|
+
* @param {number} resolution Resolution.
|
|
69
|
+
* @param {import("./proj/Projection.js").default} projection Projection.
|
|
70
|
+
* @param {function(Array<FeatureType>, import("./proj/Projection.js").default): void} success Success
|
|
71
|
+
* Function called with the loaded features and optionally with the data projection.
|
|
72
|
+
* @param {function(): void} failure Failure
|
|
73
|
+
* Function called when loading failed.
|
|
74
|
+
*/
|
|
75
|
+
function loadFeaturesXhr(
|
|
76
|
+
url,
|
|
77
|
+
format,
|
|
78
|
+
extent,
|
|
79
|
+
resolution,
|
|
80
|
+
projection,
|
|
81
|
+
success,
|
|
82
|
+
failure,
|
|
83
|
+
) {
|
|
84
|
+
const xhr = new XMLHttpRequest();
|
|
85
|
+
xhr.open(
|
|
86
|
+
'GET',
|
|
87
|
+
typeof url === 'function' ? url(extent, resolution, projection) : url,
|
|
88
|
+
true,
|
|
89
|
+
);
|
|
90
|
+
if (format.getType() == 'arraybuffer') {
|
|
91
|
+
xhr.responseType = 'arraybuffer';
|
|
92
|
+
}
|
|
93
|
+
xhr.withCredentials = withCredentials;
|
|
94
|
+
/**
|
|
95
|
+
* @param {Event} event Event.
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
xhr.onload = function (event) {
|
|
99
|
+
// status will be 0 for file:// urls
|
|
100
|
+
if (!xhr.status || (xhr.status >= 200 && xhr.status < 300)) {
|
|
101
|
+
const type = format.getType();
|
|
102
|
+
try {
|
|
103
|
+
/** @type {Document|Node|Object|string|undefined} */
|
|
104
|
+
let source;
|
|
105
|
+
if (type == 'text' || type == 'json') {
|
|
106
|
+
source = xhr.responseText;
|
|
107
|
+
} else if (type == 'xml') {
|
|
108
|
+
source = xhr.responseXML || xhr.responseText;
|
|
109
|
+
} else if (type == 'arraybuffer') {
|
|
110
|
+
source = /** @type {ArrayBuffer} */ (xhr.response);
|
|
111
|
+
}
|
|
112
|
+
if (source) {
|
|
113
|
+
success(
|
|
114
|
+
/** @type {Array<FeatureType>} */
|
|
115
|
+
(
|
|
116
|
+
format.readFeatures(source, {
|
|
117
|
+
extent: extent,
|
|
118
|
+
featureProjection: projection,
|
|
119
|
+
})
|
|
120
|
+
),
|
|
121
|
+
format.readProjection(source),
|
|
122
|
+
);
|
|
123
|
+
} else {
|
|
124
|
+
failure();
|
|
125
|
+
}
|
|
126
|
+
} catch {
|
|
127
|
+
failure();
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
failure();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @private
|
|
135
|
+
*/
|
|
136
|
+
xhr.onerror = failure;
|
|
137
|
+
xhr.send();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Create an XHR feature loader for a `url` and `format`. The feature loader
|
|
142
|
+
* loads features (with XHR), parses the features, and adds them to the
|
|
143
|
+
* vector source.
|
|
144
|
+
*
|
|
145
|
+
* @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
|
|
146
|
+
* @param {string|FeatureUrlFunction} url Feature URL service.
|
|
147
|
+
* @param {import("./format/Feature.js").default<FeatureType>} format Feature format.
|
|
148
|
+
* @return {FeatureLoader<FeatureType>} The feature loader.
|
|
149
|
+
* @api
|
|
150
|
+
*/
|
|
151
|
+
function xhr(url, format) {
|
|
152
|
+
/**
|
|
153
|
+
* @param {import("./extent.js").Extent} extent Extent.
|
|
154
|
+
* @param {number} resolution Resolution.
|
|
155
|
+
* @param {import("./proj/Projection.js").default} projection Projection.
|
|
156
|
+
* @param {function(Array<FeatureType>): void} [success] Success
|
|
157
|
+
* Function called when loading succeeded.
|
|
158
|
+
* @param {function(): void} [failure] Failure
|
|
159
|
+
* Function called when loading failed.
|
|
160
|
+
* @this {import("./source/Vector.js").default<FeatureType>}
|
|
161
|
+
*/
|
|
162
|
+
return function (extent, resolution, projection, success, failure) {
|
|
163
|
+
loadFeaturesXhr(
|
|
164
|
+
url,
|
|
165
|
+
format,
|
|
166
|
+
extent,
|
|
167
|
+
resolution,
|
|
168
|
+
projection,
|
|
169
|
+
/**
|
|
170
|
+
* @param {Array<FeatureType>} features The loaded features.
|
|
171
|
+
* @param {import("./proj/Projection.js").default} dataProjection Data
|
|
172
|
+
* projection.
|
|
173
|
+
*/
|
|
174
|
+
(features, dataProjection) => {
|
|
175
|
+
this.addFeatures(features);
|
|
176
|
+
if (success !== undefined) {
|
|
177
|
+
success(features);
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
() => {
|
|
181
|
+
this.changed();
|
|
182
|
+
if (failure !== undefined) {
|
|
183
|
+
failure();
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Setter for the withCredentials configuration for the XHR.
|
|
192
|
+
*
|
|
193
|
+
* @param {boolean} xhrWithCredentials The value of withCredentials to set.
|
|
194
|
+
* Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/
|
|
195
|
+
* @api
|
|
196
|
+
*/
|
|
197
|
+
function setWithCredentials(xhrWithCredentials) {
|
|
198
|
+
withCredentials = xhrWithCredentials;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
/***/ })
|
|
203
|
+
|
|
204
|
+
}])
|
|
205
|
+
//# sourceMappingURL=node_modules_ol_featureloader_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_featureloader_js.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA,wDAAwD,+BAA+B;AACvF,8BAA8B,OAAO;AACrC,IAAI,4CAA4C;AAChD;AACA;AACA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA;AACA;AACA,cAAc,oCAAoC;AAClD,aAAa;AACb;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA,2BAA2B,+BAA+B;AAC1D,qBAAqB,OAAO;AAC5B,WAAW,4CAA4C;AACvD,6BAA6B,OAAO;AACpC,aAAa,gGAAgG;AAC7G;AACA;;AAEA;AACA,cAAc,oCAAoC;AAClD,WAAW,2BAA2B;AACtC,WAAW,oDAAoD;AAC/D,WAAW,8BAA8B;AACzC,WAAW,QAAQ;AACnB,WAAW,wCAAwC;AACnD,WAAW,4EAA4E;AACvF;AACA,WAAW,kBAAkB;AAC7B;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAuC;AAC1D;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV,8BAA8B,aAAa;AAC3C;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,oCAAoC;AAClD,WAAW,2BAA2B;AACtC,WAAW,oDAAoD;AAC/D,YAAY,4BAA4B;AACxC;AACA;AACO;AACP;AACA,aAAa,8BAA8B;AAC3C,aAAa,QAAQ;AACrB,aAAa,wCAAwC;AACrD,aAAa,oCAAoC;AACjD;AACA,aAAa,kBAAkB;AAC/B;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC,iBAAiB,wCAAwC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACO;AACP;AACA","sources":["webpack://@vaadin/bundles/./node_modules/ol/featureloader.js"],"sourcesContent":["/**\n * @module ol/featureloader\n */\n\n/**\n *\n * @type {boolean}\n * @private\n */\nlet withCredentials = false;\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * load features.\n *\n * This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing\n * the area to be loaded, a `{number}` representing the resolution (map units per pixel), a\n * {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get\n * the loaded features passed as an argument and an optional failure callback with no arguments. If\n * the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and\n * `'featuresloaderror'` events. `this` within the function is bound to the\n * {@link module:ol/source/Vector~VectorSource} it's called from.\n *\n * The function is responsible for loading the features and adding them to the\n * source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").FeatureLike]\n * @typedef {(\n * extent: import(\"./extent.js\").Extent,\n * resolution: number,\n * projection: import(\"./proj/Projection.js\").default,\n * success?: (features: Array<FeatureType>) => void,\n * failure?: () => void) => void} FeatureLoader\n * @api\n */\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * get the url to load features from.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area\n * to be loaded, a `{number}` representing the resolution (map units per pixel)\n * and an {@link module:ol/proj/Projection~Projection} for the projection as\n * arguments and returns a `{string}` representing the URL.\n * @typedef {function(import(\"./extent.js\").Extent, number, import(\"./proj/Projection.js\").default): string} FeatureUrlFunction\n * @api\n */\n\n/**\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default<FeatureType>} format Feature format.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<FeatureType>, import(\"./proj/Projection.js\").default): void} success Success\n * Function called with the loaded features and optionally with the data projection.\n * @param {function(): void} failure Failure\n * Function called when loading failed.\n */\nexport function loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n success,\n failure,\n) {\n const xhr = new XMLHttpRequest();\n xhr.open(\n 'GET',\n typeof url === 'function' ? url(extent, resolution, projection) : url,\n true,\n );\n if (format.getType() == 'arraybuffer') {\n xhr.responseType = 'arraybuffer';\n }\n xhr.withCredentials = withCredentials;\n /**\n * @param {Event} event Event.\n * @private\n */\n xhr.onload = function (event) {\n // status will be 0 for file:// urls\n if (!xhr.status || (xhr.status >= 200 && xhr.status < 300)) {\n const type = format.getType();\n try {\n /** @type {Document|Node|Object|string|undefined} */\n let source;\n if (type == 'text' || type == 'json') {\n source = xhr.responseText;\n } else if (type == 'xml') {\n source = xhr.responseXML || xhr.responseText;\n } else if (type == 'arraybuffer') {\n source = /** @type {ArrayBuffer} */ (xhr.response);\n }\n if (source) {\n success(\n /** @type {Array<FeatureType>} */\n (\n format.readFeatures(source, {\n extent: extent,\n featureProjection: projection,\n })\n ),\n format.readProjection(source),\n );\n } else {\n failure();\n }\n } catch {\n failure();\n }\n } else {\n failure();\n }\n };\n /**\n * @private\n */\n xhr.onerror = failure;\n xhr.send();\n}\n\n/**\n * Create an XHR feature loader for a `url` and `format`. The feature loader\n * loads features (with XHR), parses the features, and adds them to the\n * vector source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default<FeatureType>} format Feature format.\n * @return {FeatureLoader<FeatureType>} The feature loader.\n * @api\n */\nexport function xhr(url, format) {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<FeatureType>): void} [success] Success\n * Function called when loading succeeded.\n * @param {function(): void} [failure] Failure\n * Function called when loading failed.\n * @this {import(\"./source/Vector.js\").default<FeatureType>}\n */\n return function (extent, resolution, projection, success, failure) {\n loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n /**\n * @param {Array<FeatureType>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data\n * projection.\n */\n (features, dataProjection) => {\n this.addFeatures(features);\n if (success !== undefined) {\n success(features);\n }\n },\n () => {\n this.changed();\n if (failure !== undefined) {\n failure();\n }\n },\n );\n };\n}\n\n/**\n * Setter for the withCredentials configuration for the XHR.\n *\n * @param {boolean} xhrWithCredentials The value of withCredentials to set.\n * Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/\n * @api\n */\nexport function setWithCredentials(xhrWithCredentials) {\n withCredentials = xhrWithCredentials;\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_geom_Circle_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/geom/Circle.js":
|
|
4
|
+
/*!****************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/geom/Circle.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 _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../extent.js */ "./node_modules/ol/extent.js");
|
|
14
|
+
/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SimpleGeometry.js */ "./node_modules/ol/geom/SimpleGeometry.js");
|
|
15
|
+
/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flat/deflate.js */ "./node_modules/ol/geom/flat/deflate.js");
|
|
16
|
+
/* harmony import */ var _flat_transform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/transform.js */ "./node_modules/ol/geom/flat/transform.js");
|
|
17
|
+
/**
|
|
18
|
+
* @module ol/geom/Circle
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @classdesc
|
|
27
|
+
* Circle geometry.
|
|
28
|
+
*
|
|
29
|
+
* @api
|
|
30
|
+
*/
|
|
31
|
+
class Circle extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
32
|
+
/**
|
|
33
|
+
* @param {!import("../coordinate.js").Coordinate} center Center.
|
|
34
|
+
* For internal use, flat coordinates in combination with `layout` and no
|
|
35
|
+
* `radius` are also accepted.
|
|
36
|
+
* @param {number} [radius] Radius in units of the projection.
|
|
37
|
+
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
38
|
+
*/
|
|
39
|
+
constructor(center, radius, layout) {
|
|
40
|
+
super();
|
|
41
|
+
if (layout !== undefined && radius === undefined) {
|
|
42
|
+
this.setFlatCoordinates(layout, center);
|
|
43
|
+
} else {
|
|
44
|
+
radius = radius ? radius : 0;
|
|
45
|
+
this.setCenterAndRadius(center, radius, layout);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Make a complete copy of the geometry.
|
|
51
|
+
* @return {!Circle} Clone.
|
|
52
|
+
* @api
|
|
53
|
+
* @override
|
|
54
|
+
*/
|
|
55
|
+
clone() {
|
|
56
|
+
const circle = new Circle(
|
|
57
|
+
this.flatCoordinates.slice(),
|
|
58
|
+
undefined,
|
|
59
|
+
this.layout,
|
|
60
|
+
);
|
|
61
|
+
circle.applyProperties(this);
|
|
62
|
+
return circle;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @param {number} x X.
|
|
67
|
+
* @param {number} y Y.
|
|
68
|
+
* @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
|
|
69
|
+
* @param {number} minSquaredDistance Minimum squared distance.
|
|
70
|
+
* @return {number} Minimum squared distance.
|
|
71
|
+
* @override
|
|
72
|
+
*/
|
|
73
|
+
closestPointXY(x, y, closestPoint, minSquaredDistance) {
|
|
74
|
+
const flatCoordinates = this.flatCoordinates;
|
|
75
|
+
const dx = x - flatCoordinates[0];
|
|
76
|
+
const dy = y - flatCoordinates[1];
|
|
77
|
+
const squaredDistance = dx * dx + dy * dy;
|
|
78
|
+
if (squaredDistance < minSquaredDistance) {
|
|
79
|
+
if (squaredDistance === 0) {
|
|
80
|
+
for (let i = 0; i < this.stride; ++i) {
|
|
81
|
+
closestPoint[i] = flatCoordinates[i];
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
const delta = this.getRadius() / Math.sqrt(squaredDistance);
|
|
85
|
+
closestPoint[0] = flatCoordinates[0] + delta * dx;
|
|
86
|
+
closestPoint[1] = flatCoordinates[1] + delta * dy;
|
|
87
|
+
for (let i = 2; i < this.stride; ++i) {
|
|
88
|
+
closestPoint[i] = flatCoordinates[i];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
closestPoint.length = this.stride;
|
|
92
|
+
return squaredDistance;
|
|
93
|
+
}
|
|
94
|
+
return minSquaredDistance;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @param {number} x X.
|
|
99
|
+
* @param {number} y Y.
|
|
100
|
+
* @return {boolean} Contains (x, y).
|
|
101
|
+
* @override
|
|
102
|
+
*/
|
|
103
|
+
containsXY(x, y) {
|
|
104
|
+
const flatCoordinates = this.flatCoordinates;
|
|
105
|
+
const dx = x - flatCoordinates[0];
|
|
106
|
+
const dy = y - flatCoordinates[1];
|
|
107
|
+
return dx * dx + dy * dy <= this.getRadiusSquared_();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
|
112
|
+
* @return {import("../coordinate.js").Coordinate} Center.
|
|
113
|
+
* @api
|
|
114
|
+
*/
|
|
115
|
+
getCenter() {
|
|
116
|
+
return this.flatCoordinates.slice(0, this.stride);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
121
|
+
* @protected
|
|
122
|
+
* @return {import("../extent.js").Extent} extent Extent.
|
|
123
|
+
* @override
|
|
124
|
+
*/
|
|
125
|
+
computeExtent(extent) {
|
|
126
|
+
const flatCoordinates = this.flatCoordinates;
|
|
127
|
+
const radius = flatCoordinates[this.stride] - flatCoordinates[0];
|
|
128
|
+
return (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createOrUpdate)(
|
|
129
|
+
flatCoordinates[0] - radius,
|
|
130
|
+
flatCoordinates[1] - radius,
|
|
131
|
+
flatCoordinates[0] + radius,
|
|
132
|
+
flatCoordinates[1] + radius,
|
|
133
|
+
extent,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Return the radius of the circle.
|
|
139
|
+
* @return {number} Radius.
|
|
140
|
+
* @api
|
|
141
|
+
*/
|
|
142
|
+
getRadius() {
|
|
143
|
+
return Math.sqrt(this.getRadiusSquared_());
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @private
|
|
148
|
+
* @return {number} Radius squared.
|
|
149
|
+
*/
|
|
150
|
+
getRadiusSquared_() {
|
|
151
|
+
const dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0];
|
|
152
|
+
const dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];
|
|
153
|
+
return dx * dx + dy * dy;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get the type of this geometry.
|
|
158
|
+
* @return {import("./Geometry.js").Type} Geometry type.
|
|
159
|
+
* @api
|
|
160
|
+
* @override
|
|
161
|
+
*/
|
|
162
|
+
getType() {
|
|
163
|
+
return 'Circle';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Test if the geometry and the passed extent intersect.
|
|
168
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
169
|
+
* @return {boolean} `true` if the geometry and the extent intersect.
|
|
170
|
+
* @api
|
|
171
|
+
* @override
|
|
172
|
+
*/
|
|
173
|
+
intersectsExtent(extent) {
|
|
174
|
+
const circleExtent = this.getExtent();
|
|
175
|
+
if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.intersects)(extent, circleExtent)) {
|
|
176
|
+
const center = this.getCenter();
|
|
177
|
+
|
|
178
|
+
if (extent[0] <= center[0] && extent[2] >= center[0]) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
if (extent[1] <= center[1] && extent[3] >= center[1]) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.forEachCorner)(extent, this.intersectsCoordinate.bind(this));
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
|
192
|
+
* @param {import("../coordinate.js").Coordinate} center Center.
|
|
193
|
+
* @api
|
|
194
|
+
*/
|
|
195
|
+
setCenter(center) {
|
|
196
|
+
const stride = this.stride;
|
|
197
|
+
const radius = this.flatCoordinates[stride] - this.flatCoordinates[0];
|
|
198
|
+
const flatCoordinates = center.slice();
|
|
199
|
+
flatCoordinates[stride] = flatCoordinates[0] + radius;
|
|
200
|
+
for (let i = 1; i < stride; ++i) {
|
|
201
|
+
flatCoordinates[stride + i] = center[i];
|
|
202
|
+
}
|
|
203
|
+
this.setFlatCoordinates(this.layout, flatCoordinates);
|
|
204
|
+
this.changed();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as
|
|
209
|
+
* number) of the circle.
|
|
210
|
+
* @param {!import("../coordinate.js").Coordinate} center Center.
|
|
211
|
+
* @param {number} radius Radius.
|
|
212
|
+
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
213
|
+
* @api
|
|
214
|
+
*/
|
|
215
|
+
setCenterAndRadius(center, radius, layout) {
|
|
216
|
+
this.setLayout(layout, center, 0);
|
|
217
|
+
if (!this.flatCoordinates) {
|
|
218
|
+
this.flatCoordinates = [];
|
|
219
|
+
}
|
|
220
|
+
/** @type {Array<number>} */
|
|
221
|
+
const flatCoordinates = this.flatCoordinates;
|
|
222
|
+
let offset = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_2__.deflateCoordinate)(flatCoordinates, 0, center, this.stride);
|
|
223
|
+
flatCoordinates[offset++] = flatCoordinates[0] + radius;
|
|
224
|
+
for (let i = 1, ii = this.stride; i < ii; ++i) {
|
|
225
|
+
flatCoordinates[offset++] = flatCoordinates[i];
|
|
226
|
+
}
|
|
227
|
+
flatCoordinates.length = offset;
|
|
228
|
+
this.changed();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @override
|
|
233
|
+
*/
|
|
234
|
+
getCoordinates() {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @override
|
|
240
|
+
*/
|
|
241
|
+
setCoordinates(coordinates, layout) {}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Set the radius of the circle. The radius is in the units of the projection.
|
|
245
|
+
* @param {number} radius Radius.
|
|
246
|
+
* @api
|
|
247
|
+
*/
|
|
248
|
+
setRadius(radius) {
|
|
249
|
+
this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;
|
|
250
|
+
this.changed();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Rotate the geometry around a given coordinate. This modifies the geometry
|
|
255
|
+
* coordinates in place.
|
|
256
|
+
* @param {number} angle Rotation angle in counter-clockwise radians.
|
|
257
|
+
* @param {import("../coordinate.js").Coordinate} anchor The rotation center.
|
|
258
|
+
* @api
|
|
259
|
+
* @override
|
|
260
|
+
*/
|
|
261
|
+
rotate(angle, anchor) {
|
|
262
|
+
const center = this.getCenter();
|
|
263
|
+
const stride = this.getStride();
|
|
264
|
+
this.setCenter(
|
|
265
|
+
(0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.rotate)(center, 0, center.length, stride, angle, anchor, center),
|
|
266
|
+
);
|
|
267
|
+
this.changed();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Transform each coordinate of the circle from one coordinate reference system
|
|
273
|
+
* to another. The geometry is modified in place.
|
|
274
|
+
* If you do not want the geometry modified in place, first clone() it and
|
|
275
|
+
* then use this function on the clone.
|
|
276
|
+
*
|
|
277
|
+
* Internally a circle is currently represented by two points: the center of
|
|
278
|
+
* the circle `[cx, cy]`, and the point to the right of the circle
|
|
279
|
+
* `[cx + r, cy]`. This `transform` function just transforms these two points.
|
|
280
|
+
* So the resulting geometry is also a circle, and that circle does not
|
|
281
|
+
* correspond to the shape that would be obtained by transforming every point
|
|
282
|
+
* of the original circle.
|
|
283
|
+
*
|
|
284
|
+
* @param {import("../proj.js").ProjectionLike} source The current projection. Can be a
|
|
285
|
+
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
|
286
|
+
* @param {import("../proj.js").ProjectionLike} destination The desired projection. Can be a
|
|
287
|
+
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
|
288
|
+
* @return {Circle} This geometry. Note that original geometry is
|
|
289
|
+
* modified in place.
|
|
290
|
+
* @function
|
|
291
|
+
* @api
|
|
292
|
+
*/
|
|
293
|
+
Circle.prototype.transform;
|
|
294
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Circle);
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
/***/ })
|
|
298
|
+
|
|
299
|
+
}])
|
|
300
|
+
//# sourceMappingURL=node_modules_ol_geom_Circle_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_geom_Circle_js.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACuE;AACtB;AACG;AACT;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0DAAc;AACnC;AACA,aAAa,wCAAwC;AACrD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,SAAS;AACvB;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;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,iDAAiD;AAC1F,cAAc,uCAAuC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,+BAA+B;AAC5C;AACA,cAAc,+BAA+B;AAC7C;AACA;AACA;AACA;AACA;AACA,WAAW,0DAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;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;AACA,QAAQ,sDAAU;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,yDAAa;AAC1B;AACA;AACA;;AAEA;AACA,sCAAsC,iDAAiD;AACvF,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB,iDAAiD;AAC1E;AACA,aAAa,wCAAwC;AACrD,aAAa,QAAQ;AACrB,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,iBAAiB,mEAAiB;AAClC;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,0DAAM;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,+BAA+B,4CAA4C;AAC3E,WAAW,qCAAqC;AAChD,+BAA+B,4CAA4C;AAC3E,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,iEAAe,MAAM,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/geom/Circle.js"],"sourcesContent":["/**\n * @module ol/geom/Circle\n */\nimport {createOrUpdate, forEachCorner, intersects} from '../extent.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {deflateCoordinate} from './flat/deflate.js';\nimport {rotate} from './flat/transform.js';\n\n/**\n * @classdesc\n * Circle geometry.\n *\n * @api\n */\nclass Circle extends SimpleGeometry {\n /**\n * @param {!import(\"../coordinate.js\").Coordinate} center Center.\n * For internal use, flat coordinates in combination with `layout` and no\n * `radius` are also accepted.\n * @param {number} [radius] Radius in units of the projection.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(center, radius, layout) {\n super();\n if (layout !== undefined && radius === undefined) {\n this.setFlatCoordinates(layout, center);\n } else {\n radius = radius ? radius : 0;\n this.setCenterAndRadius(center, radius, layout);\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!Circle} Clone.\n * @api\n * @override\n */\n clone() {\n const circle = new Circle(\n this.flatCoordinates.slice(),\n undefined,\n this.layout,\n );\n circle.applyProperties(this);\n return circle;\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 const flatCoordinates = this.flatCoordinates;\n const dx = x - flatCoordinates[0];\n const dy = y - flatCoordinates[1];\n const squaredDistance = dx * dx + dy * dy;\n if (squaredDistance < minSquaredDistance) {\n if (squaredDistance === 0) {\n for (let i = 0; i < this.stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n } else {\n const delta = this.getRadius() / Math.sqrt(squaredDistance);\n closestPoint[0] = flatCoordinates[0] + delta * dx;\n closestPoint[1] = flatCoordinates[1] + delta * dy;\n for (let i = 2; i < this.stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n }\n closestPoint.length = this.stride;\n return squaredDistance;\n }\n return minSquaredDistance;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n * @override\n */\n containsXY(x, y) {\n const flatCoordinates = this.flatCoordinates;\n const dx = x - flatCoordinates[0];\n const dy = y - flatCoordinates[1];\n return dx * dx + dy * dy <= this.getRadiusSquared_();\n }\n\n /**\n * Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.\n * @return {import(\"../coordinate.js\").Coordinate} Center.\n * @api\n */\n getCenter() {\n return this.flatCoordinates.slice(0, this.stride);\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @override\n */\n computeExtent(extent) {\n const flatCoordinates = this.flatCoordinates;\n const radius = flatCoordinates[this.stride] - flatCoordinates[0];\n return createOrUpdate(\n flatCoordinates[0] - radius,\n flatCoordinates[1] - radius,\n flatCoordinates[0] + radius,\n flatCoordinates[1] + radius,\n extent,\n );\n }\n\n /**\n * Return the radius of the circle.\n * @return {number} Radius.\n * @api\n */\n getRadius() {\n return Math.sqrt(this.getRadiusSquared_());\n }\n\n /**\n * @private\n * @return {number} Radius squared.\n */\n getRadiusSquared_() {\n const dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0];\n const dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];\n return dx * dx + dy * dy;\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 'Circle';\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 const circleExtent = this.getExtent();\n if (intersects(extent, circleExtent)) {\n const center = this.getCenter();\n\n if (extent[0] <= center[0] && extent[2] >= center[0]) {\n return true;\n }\n if (extent[1] <= center[1] && extent[3] >= center[1]) {\n return true;\n }\n\n return forEachCorner(extent, this.intersectsCoordinate.bind(this));\n }\n return false;\n }\n\n /**\n * Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} center Center.\n * @api\n */\n setCenter(center) {\n const stride = this.stride;\n const radius = this.flatCoordinates[stride] - this.flatCoordinates[0];\n const flatCoordinates = center.slice();\n flatCoordinates[stride] = flatCoordinates[0] + radius;\n for (let i = 1; i < stride; ++i) {\n flatCoordinates[stride + i] = center[i];\n }\n this.setFlatCoordinates(this.layout, flatCoordinates);\n this.changed();\n }\n\n /**\n * Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as\n * number) of the circle.\n * @param {!import(\"../coordinate.js\").Coordinate} center Center.\n * @param {number} radius Radius.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCenterAndRadius(center, radius, layout) {\n this.setLayout(layout, center, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n /** @type {Array<number>} */\n const flatCoordinates = this.flatCoordinates;\n let offset = deflateCoordinate(flatCoordinates, 0, center, this.stride);\n flatCoordinates[offset++] = flatCoordinates[0] + radius;\n for (let i = 1, ii = this.stride; i < ii; ++i) {\n flatCoordinates[offset++] = flatCoordinates[i];\n }\n flatCoordinates.length = offset;\n this.changed();\n }\n\n /**\n * @override\n */\n getCoordinates() {\n return null;\n }\n\n /**\n * @override\n */\n setCoordinates(coordinates, layout) {}\n\n /**\n * Set the radius of the circle. The radius is in the units of the projection.\n * @param {number} radius Radius.\n * @api\n */\n setRadius(radius) {\n this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;\n this.changed();\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in counter-clockwise radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n * @override\n */\n rotate(angle, anchor) {\n const center = this.getCenter();\n const stride = this.getStride();\n this.setCenter(\n rotate(center, 0, center.length, stride, angle, anchor, center),\n );\n this.changed();\n }\n}\n\n/**\n * Transform each coordinate of the circle from one coordinate reference system\n * to another. The geometry is modified in place.\n * If you do not want the geometry modified in place, first clone() it and\n * then use this function on the clone.\n *\n * Internally a circle is currently represented by two points: the center of\n * the circle `[cx, cy]`, and the point to the right of the circle\n * `[cx + r, cy]`. This `transform` function just transforms these two points.\n * So the resulting geometry is also a circle, and that circle does not\n * correspond to the shape that would be obtained by transforming every point\n * of the original circle.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {Circle} This geometry. Note that original geometry is\n * modified in place.\n * @function\n * @api\n */\nCircle.prototype.transform;\nexport default Circle;\n"],"names":[],"sourceRoot":""}
|