@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.
Files changed (192) hide show
  1. package/node_modules_ol_ImageCanvas_js.js +76 -83
  2. package/node_modules_ol_ImageCanvas_js.js.map +1 -1
  3. package/node_modules_ol_TileRange_js.js +128 -110
  4. package/node_modules_ol_TileRange_js.js.map +1 -1
  5. package/node_modules_ol_Tile_js.js +279 -0
  6. package/node_modules_ol_Tile_js.js.map +1 -0
  7. package/node_modules_ol_VectorRenderTile_js.js +428 -143
  8. package/node_modules_ol_VectorRenderTile_js.js.map +1 -1
  9. package/node_modules_ol_VectorTile_js.js +405 -119
  10. package/node_modules_ol_VectorTile_js.js.map +1 -1
  11. package/node_modules_ol_control_MousePosition_js.js +327 -0
  12. package/node_modules_ol_control_MousePosition_js.js.map +1 -0
  13. package/node_modules_ol_control_ZoomToExtent_js.js +118 -0
  14. package/node_modules_ol_control_ZoomToExtent_js.js.map +1 -0
  15. package/node_modules_ol_events_SnapEvent_js.js +79 -0
  16. package/node_modules_ol_events_SnapEvent_js.js.map +1 -0
  17. package/node_modules_ol_featureloader_js.js +205 -0
  18. package/node_modules_ol_featureloader_js.js.map +1 -0
  19. package/node_modules_ol_geom_Circle_js.js +300 -0
  20. package/node_modules_ol_geom_Circle_js.js.map +1 -0
  21. package/node_modules_ol_geom_GeometryCollection_js.js +369 -0
  22. package/node_modules_ol_geom_GeometryCollection_js.js.map +1 -0
  23. package/node_modules_ol_geom_MultiPoint_js.js +228 -0
  24. package/node_modules_ol_geom_MultiPoint_js.js.map +1 -0
  25. package/node_modules_ol_geom_flat_center_js.js +47 -0
  26. package/node_modules_ol_geom_flat_center_js.js.map +1 -0
  27. package/node_modules_ol_geom_flat_geodesic_js.js +123 -88
  28. package/node_modules_ol_geom_flat_geodesic_js.js.map +1 -1
  29. package/node_modules_ol_geom_flat_interpolate_js.js +230 -0
  30. package/node_modules_ol_geom_flat_interpolate_js.js.map +1 -0
  31. package/node_modules_ol_geom_flat_length_js-_375a0.js +58 -0
  32. package/node_modules_ol_geom_flat_length_js-_375a0.js.map +1 -0
  33. package/node_modules_ol_geom_flat_length_js-_375a1.js +58 -0
  34. package/node_modules_ol_geom_flat_length_js-_375a1.js.map +1 -0
  35. package/node_modules_ol_geom_flat_length_js-_375a2.js +58 -0
  36. package/node_modules_ol_geom_flat_length_js-_375a2.js.map +1 -0
  37. package/node_modules_ol_geom_flat_length_js-_375a3.js +58 -0
  38. package/node_modules_ol_geom_flat_length_js-_375a3.js.map +1 -0
  39. package/node_modules_ol_geom_flat_length_js-_375a4.js +58 -0
  40. package/node_modules_ol_geom_flat_length_js-_375a4.js.map +1 -0
  41. package/node_modules_ol_geom_flat_linechunk_js.js +76 -0
  42. package/node_modules_ol_geom_flat_linechunk_js.js.map +1 -0
  43. package/node_modules_ol_geom_flat_straightchunk_js.js +68 -0
  44. package/node_modules_ol_geom_flat_straightchunk_js.js.map +1 -0
  45. package/node_modules_ol_geom_flat_textpath_js.js +178 -0
  46. package/node_modules_ol_geom_flat_textpath_js.js.map +1 -0
  47. package/node_modules_ol_interaction_DblClickDragZoom_js.js +285 -0
  48. package/node_modules_ol_interaction_DblClickDragZoom_js.js.map +1 -0
  49. package/node_modules_ol_interaction_DragAndDrop_js.js +351 -0
  50. package/node_modules_ol_interaction_DragAndDrop_js.js.map +1 -0
  51. package/node_modules_ol_interaction_DragRotateAndZoom_js.js +159 -0
  52. package/node_modules_ol_interaction_DragRotateAndZoom_js.js.map +1 -0
  53. package/node_modules_ol_layer_Vector_js-_49290.js +110 -0
  54. package/node_modules_ol_layer_Vector_js-_49290.js.map +1 -0
  55. package/node_modules_ol_layer_Vector_js-_49291.js +110 -0
  56. package/node_modules_ol_layer_Vector_js-_49291.js.map +1 -0
  57. package/node_modules_ol_layer_Vector_js-_49292.js +110 -0
  58. package/node_modules_ol_layer_Vector_js-_49292.js.map +1 -0
  59. package/node_modules_ol_layer_Vector_js-_49293.js +110 -0
  60. package/node_modules_ol_layer_Vector_js-_49293.js.map +1 -0
  61. package/node_modules_ol_loadingstrategy_js.js +95 -0
  62. package/node_modules_ol_loadingstrategy_js.js.map +1 -0
  63. package/node_modules_ol_render_VectorContext_js-_3ad60.js +144 -0
  64. package/node_modules_ol_render_VectorContext_js-_3ad60.js.map +1 -0
  65. package/node_modules_ol_render_VectorContext_js-_3ad61.js +144 -0
  66. package/node_modules_ol_render_VectorContext_js-_3ad61.js.map +1 -0
  67. package/node_modules_ol_render_VectorContext_js-node_modules_ol_render_canvas_hitdetect_js.js +372 -0
  68. package/node_modules_ol_render_VectorContext_js-node_modules_ol_render_canvas_hitdetect_js.js.map +1 -0
  69. package/node_modules_ol_render_canvas_ImageBuilder_js.js +318 -0
  70. package/node_modules_ol_render_canvas_ImageBuilder_js.js.map +1 -0
  71. package/node_modules_ol_render_canvas_Instruction_js.js +66 -0
  72. package/node_modules_ol_render_canvas_Instruction_js.js.map +1 -0
  73. package/node_modules_ol_render_canvas_LineStringBuilder_js.js +187 -0
  74. package/node_modules_ol_render_canvas_LineStringBuilder_js.js.map +1 -0
  75. package/node_modules_ol_render_canvas_PolygonBuilder_js.js +276 -0
  76. package/node_modules_ol_render_canvas_PolygonBuilder_js.js.map +1 -0
  77. package/node_modules_ol_render_canvas_ZIndexContext_js-_fab20.js +156 -0
  78. package/node_modules_ol_render_canvas_ZIndexContext_js-_fab20.js.map +1 -0
  79. package/node_modules_ol_render_canvas_ZIndexContext_js-_fab21.js +156 -0
  80. package/node_modules_ol_render_canvas_ZIndexContext_js-_fab21.js.map +1 -0
  81. package/node_modules_ol_render_js-node_modules_ol_render_VectorContext_js.js +301 -0
  82. package/node_modules_ol_render_js-node_modules_ol_render_VectorContext_js.js.map +1 -0
  83. package/node_modules_ol_renderer_Layer_js.js +219 -0
  84. package/node_modules_ol_renderer_Layer_js.js.map +1 -0
  85. package/node_modules_ol_source_Source_js.js +256 -0
  86. package/node_modules_ol_source_Source_js.js.map +1 -0
  87. package/node_modules_ol_source_VectorEventType_js-node_modules_ol_structs_RBush_js.js +318 -0
  88. package/node_modules_ol_source_VectorEventType_js-node_modules_ol_structs_RBush_js.js.map +1 -0
  89. package/node_modules_ol_source_VectorEventType_js.js +80 -0
  90. package/node_modules_ol_source_VectorEventType_js.js.map +1 -0
  91. package/node_modules_ol_structs_RBush_js.js +242 -0
  92. package/node_modules_ol_structs_RBush_js.js.map +1 -0
  93. package/node_modules_ol_style_js.js +2 -1
  94. package/node_modules_ol_style_js.js.map +1 -1
  95. package/node_modules_rbush_rbush_min_js.js +16 -0
  96. package/node_modules_rbush_rbush_min_js.js.map +1 -0
  97. package/package.json +142 -146
  98. package/vaadin-bundle.json +2447 -2352
  99. package/vaadin.js +52246 -63791
  100. package/vaadin.js.map +1 -1
  101. package/vendors-node_modules_dompurify_dist_purify_es_mjs.js +1364 -0
  102. package/vendors-node_modules_dompurify_dist_purify_es_mjs.js.map +1 -0
  103. package/vendors-node_modules_dompurify_dist_purify_js.js +26 -21
  104. package/vendors-node_modules_dompurify_dist_purify_js.js.map +1 -1
  105. package/vendors-node_modules_marked_lib_marked_esm_js.js +2205 -0
  106. package/vendors-node_modules_marked_lib_marked_esm_js.js.map +1 -0
  107. package/vendors-node_modules_marked_lib_marked_umd_js.js +2164 -2556
  108. package/vendors-node_modules_marked_lib_marked_umd_js.js.map +1 -1
  109. package/vendors-node_modules_ol_Feature_js.js +360 -0
  110. package/vendors-node_modules_ol_Feature_js.js.map +1 -0
  111. package/vendors-node_modules_ol_Geolocation_js.js +352 -293
  112. package/vendors-node_modules_ol_Geolocation_js.js.map +1 -1
  113. package/vendors-node_modules_ol_ImageTile_js.js +494 -0
  114. package/vendors-node_modules_ol_ImageTile_js.js.map +1 -0
  115. package/vendors-node_modules_ol_Overlay_js.js +606 -0
  116. package/vendors-node_modules_ol_Overlay_js.js.map +1 -0
  117. package/vendors-node_modules_ol_control_FullScreen_js.js +417 -0
  118. package/vendors-node_modules_ol_control_FullScreen_js.js.map +1 -0
  119. package/vendors-node_modules_ol_control_OverviewMap_js.js +711 -0
  120. package/vendors-node_modules_ol_control_OverviewMap_js.js.map +1 -0
  121. package/vendors-node_modules_ol_control_ScaleLine_js.js +509 -0
  122. package/vendors-node_modules_ol_control_ScaleLine_js.js.map +1 -0
  123. package/vendors-node_modules_ol_control_ZoomSlider_js.js +418 -0
  124. package/vendors-node_modules_ol_control_ZoomSlider_js.js.map +1 -0
  125. package/vendors-node_modules_ol_control_js.js +490 -0
  126. package/vendors-node_modules_ol_control_js.js.map +1 -0
  127. package/vendors-node_modules_ol_geom_LineString_js.js +574 -0
  128. package/vendors-node_modules_ol_geom_LineString_js.js.map +1 -0
  129. package/vendors-node_modules_ol_geom_MultiLineString_js.js +405 -0
  130. package/vendors-node_modules_ol_geom_MultiLineString_js.js.map +1 -0
  131. package/vendors-node_modules_ol_geom_MultiPolygon_js.js +773 -0
  132. package/vendors-node_modules_ol_geom_MultiPolygon_js.js.map +1 -0
  133. package/vendors-node_modules_ol_geom_js-node_modules_ol_geom_flat_length_js.js +769 -0
  134. package/vendors-node_modules_ol_geom_js-node_modules_ol_geom_flat_length_js.js.map +1 -0
  135. package/vendors-node_modules_ol_index_js.js +526 -675
  136. package/vendors-node_modules_ol_index_js.js.map +1 -1
  137. package/vendors-node_modules_ol_interaction_Draw_js.js +2777 -0
  138. package/vendors-node_modules_ol_interaction_Draw_js.js.map +1 -0
  139. package/vendors-node_modules_ol_interaction_Extent_js.js +586 -0
  140. package/vendors-node_modules_ol_interaction_Extent_js.js.map +1 -0
  141. package/vendors-node_modules_ol_interaction_Link_js.js +489 -0
  142. package/vendors-node_modules_ol_interaction_Link_js.js.map +1 -0
  143. package/vendors-node_modules_ol_interaction_Modify_js.js +1841 -0
  144. package/vendors-node_modules_ol_interaction_Modify_js.js.map +1 -0
  145. package/vendors-node_modules_ol_interaction_Select_js.js +623 -0
  146. package/vendors-node_modules_ol_interaction_Select_js.js.map +1 -0
  147. package/vendors-node_modules_ol_interaction_Snap_js.js +982 -0
  148. package/vendors-node_modules_ol_interaction_Snap_js.js.map +1 -0
  149. package/vendors-node_modules_ol_interaction_Translate_js.js +466 -0
  150. package/vendors-node_modules_ol_interaction_Translate_js.js.map +1 -0
  151. package/vendors-node_modules_ol_interaction_js.js +872 -0
  152. package/vendors-node_modules_ol_interaction_js.js.map +1 -0
  153. package/vendors-node_modules_ol_layer_Graticule_js.js +1374 -989
  154. package/vendors-node_modules_ol_layer_Graticule_js.js.map +1 -1
  155. package/vendors-node_modules_ol_render_Feature_js.js +546 -0
  156. package/vendors-node_modules_ol_render_Feature_js.js.map +1 -0
  157. package/vendors-node_modules_ol_render_canvas_BuilderGroup_js.js +897 -0
  158. package/vendors-node_modules_ol_render_canvas_BuilderGroup_js.js.map +1 -0
  159. package/vendors-node_modules_ol_render_canvas_Builder_js.js +907 -0
  160. package/vendors-node_modules_ol_render_canvas_Builder_js.js.map +1 -0
  161. package/vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js +539 -0
  162. package/vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js.map +1 -0
  163. package/vendors-node_modules_ol_render_canvas_Executor_js.js +1715 -0
  164. package/vendors-node_modules_ol_render_canvas_Executor_js.js.map +1 -0
  165. package/vendors-node_modules_ol_render_canvas_Immediate_js.js +1208 -0
  166. package/vendors-node_modules_ol_render_canvas_Immediate_js.js.map +1 -0
  167. package/vendors-node_modules_ol_render_canvas_TextBuilder_js.js +825 -0
  168. package/vendors-node_modules_ol_render_canvas_TextBuilder_js.js.map +1 -0
  169. package/vendors-node_modules_ol_renderer_canvas_Layer_js.js +654 -0
  170. package/vendors-node_modules_ol_renderer_canvas_Layer_js.js.map +1 -0
  171. package/vendors-node_modules_ol_renderer_canvas_VectorLayer_js.js +1044 -0
  172. package/vendors-node_modules_ol_renderer_canvas_VectorLayer_js.js.map +1 -0
  173. package/vendors-node_modules_ol_renderer_vector_js.js +460 -0
  174. package/vendors-node_modules_ol_renderer_vector_js.js.map +1 -0
  175. package/vendors-node_modules_ol_source_Vector_js.js +2091 -0
  176. package/vendors-node_modules_ol_source_Vector_js.js.map +1 -0
  177. package/node_modules_ol_ImageTile_js.js +0 -177
  178. package/node_modules_ol_ImageTile_js.js.map +0 -1
  179. package/node_modules_ol_render_js.js +0 -131
  180. package/node_modules_ol_render_js.js.map +0 -1
  181. package/node_modules_ol_structs_LRUCache_js.js +0 -275
  182. package/node_modules_ol_structs_LRUCache_js.js.map +0 -1
  183. package/node_modules_ol_tilecoord_js.js +0 -115
  184. package/node_modules_ol_tilecoord_js.js.map +0 -1
  185. package/vendors-node_modules_ol_TileCache_js.js +0 -461
  186. package/vendors-node_modules_ol_TileCache_js.js.map +0 -1
  187. package/vendors-node_modules_ol_Tile_js.js +0 -330
  188. package/vendors-node_modules_ol_Tile_js.js.map +0 -1
  189. package/vendors-node_modules_ol_style_Text_js.js +0 -509
  190. package/vendors-node_modules_ol_style_Text_js.js.map +0 -1
  191. package/vendors-node_modules_rbush_index_js.js +0 -531
  192. package/vendors-node_modules_rbush_index_js.js.map +0 -1
@@ -0,0 +1,623 @@
1
+ (self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["vendors-node_modules_ol_interaction_Select_js"],{
2
+
3
+ /***/ "./node_modules/ol/interaction/Select.js":
4
+ /*!***********************************************!*\
5
+ !*** ./node_modules/ol/interaction/Select.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 */ "SelectEvent": () => (/* binding */ SelectEvent),
12
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13
+ /* harmony export */ });
14
+ /* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Collection.js */ "./node_modules/ol/Collection.js");
15
+ /* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../CollectionEventType.js */ "./node_modules/ol/CollectionEventType.js");
16
+ /* harmony import */ var _Feature_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Feature.js */ "./node_modules/ol/Feature.js");
17
+ /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../array.js */ "./node_modules/ol/array.js");
18
+ /* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events/Event.js */ "./node_modules/ol/events/Event.js");
19
+ /* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/condition.js */ "./node_modules/ol/events/condition.js");
20
+ /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions.js */ "./node_modules/ol/functions.js");
21
+ /* harmony import */ var _layer_Vector_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../layer/Vector.js */ "./node_modules/ol/layer/Vector.js");
22
+ /* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../obj.js */ "./node_modules/ol/obj.js");
23
+ /* harmony import */ var _style_Style_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../style/Style.js */ "./node_modules/ol/style/Style.js");
24
+ /* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util.js */ "./node_modules/ol/util.js");
25
+ /* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Interaction.js */ "./node_modules/ol/interaction/Interaction.js");
26
+ /**
27
+ * @module ol/interaction/Select
28
+ */
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+ /**
43
+ * @enum {string}
44
+ */
45
+ const SelectEventType = {
46
+ /**
47
+ * Triggered when feature(s) has been (de)selected.
48
+ * @event SelectEvent#select
49
+ * @api
50
+ */
51
+ SELECT: 'select',
52
+ };
53
+
54
+ /**
55
+ * A function that takes a {@link module:ol/Feature~Feature} and returns `true` if the feature may be
56
+ * selected or `false` otherwise.
57
+ * @typedef {function(import("../Feature.js").default, import("../layer/Layer.js").default<import("../source/Source").default>):boolean} FilterFunction
58
+ */
59
+
60
+ /**
61
+ * @typedef {Object} Options
62
+ * @property {import("../events/condition.js").Condition} [addCondition] A function
63
+ * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
64
+ * boolean to indicate whether that event should be handled.
65
+ * By default, this is {@link module:ol/events/condition.never}. Use this if you
66
+ * want to use different events for add and remove instead of `toggle`.
67
+ * @property {import("../events/condition.js").Condition} [condition] A function that
68
+ * takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
69
+ * boolean to indicate whether that event should be handled. This is the event
70
+ * for the selected features as a whole. By default, this is
71
+ * {@link module:ol/events/condition.singleClick}. Clicking on a feature selects that
72
+ * feature and removes any that were in the selection. Clicking outside any
73
+ * feature removes all from the selection.
74
+ * See `toggle`, `add`, `remove` options for adding/removing extra features to/
75
+ * from the selection.
76
+ * @property {Array<import("../layer/Layer.js").default>|function(import("../layer/Layer.js").default<import("../source/Source").default>): boolean} [layers]
77
+ * A list of layers from which features should be selected. Alternatively, a
78
+ * filter function can be provided. The function will be called for each layer
79
+ * in the map and should return `true` for layers that you want to be
80
+ * selectable. If the option is absent, all visible layers will be considered
81
+ * selectable.
82
+ * @property {import("../style/Style.js").StyleLike|null} [style]
83
+ * Style for the selected features. By default the default edit style is used
84
+ * (see {@link module:ol/style/Style~Style}). Set to `null` if this interaction should not apply
85
+ * any style changes for selected features.
86
+ * If set to a falsey value, the selected feature's style will not change.
87
+ * @property {import("../events/condition.js").Condition} [removeCondition] A function
88
+ * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
89
+ * boolean to indicate whether that event should be handled.
90
+ * By default, this is {@link module:ol/events/condition.never}. Use this if you
91
+ * want to use different events for add and remove instead of `toggle`.
92
+ * @property {import("../events/condition.js").Condition} [toggleCondition] A function
93
+ * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
94
+ * boolean to indicate whether that event should be handled. This is in addition
95
+ * to the `condition` event. By default,
96
+ * {@link module:ol/events/condition.shiftKeyOnly}, i.e. pressing `shift` as
97
+ * well as the `condition` event, adds that feature to the current selection if
98
+ * it is not currently selected, and removes it if it is. See `add` and `remove`
99
+ * if you want to use different events instead of a toggle.
100
+ * @property {boolean} [multi=false] A boolean that determines if the default
101
+ * behaviour should select only single features or all (overlapping) features at
102
+ * the clicked map position. The default of `false` means single select.
103
+ * @property {Collection<Feature>} [features]
104
+ * Collection where the interaction will place selected features. Optional. If
105
+ * not set the interaction will create a collection. In any case the collection
106
+ * used by the interaction is returned by
107
+ * {@link module:ol/interaction/Select~Select#getFeatures}.
108
+ * @property {FilterFunction} [filter] A function
109
+ * that takes a {@link module:ol/Feature~Feature} and a
110
+ * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be
111
+ * selected or `false` otherwise.
112
+ * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside
113
+ * the radius around the given position will be checked for features.
114
+ */
115
+
116
+ /**
117
+ * @classdesc
118
+ * Events emitted by {@link module:ol/interaction/Select~Select} instances are instances of
119
+ * this type.
120
+ */
121
+ class SelectEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
122
+ /**
123
+ * @param {SelectEventType} type The event type.
124
+ * @param {Array<import("../Feature.js").default>} selected Selected features.
125
+ * @param {Array<import("../Feature.js").default>} deselected Deselected features.
126
+ * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Associated
127
+ * {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
128
+ */
129
+ constructor(type, selected, deselected, mapBrowserEvent) {
130
+ super(type);
131
+
132
+ /**
133
+ * Selected features array.
134
+ * @type {Array<import("../Feature.js").default>}
135
+ * @api
136
+ */
137
+ this.selected = selected;
138
+
139
+ /**
140
+ * Deselected features array.
141
+ * @type {Array<import("../Feature.js").default>}
142
+ * @api
143
+ */
144
+ this.deselected = deselected;
145
+
146
+ /**
147
+ * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
148
+ * @type {import("../MapBrowserEvent.js").default}
149
+ * @api
150
+ */
151
+ this.mapBrowserEvent = mapBrowserEvent;
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Original feature styles to reset to when features are no longer selected.
157
+ * @type {Object<number, import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction>}
158
+ */
159
+ const originalFeatureStyles = {};
160
+
161
+ /***
162
+ * @template Return
163
+ * @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
164
+ * import("../Observable").OnSignature<import("../ObjectEventType").Types|
165
+ * 'change:active', import("../Object").ObjectEvent, Return> &
166
+ * import("../Observable").OnSignature<'select', SelectEvent, Return> &
167
+ * import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("../ObjectEventType").Types|
168
+ * 'change:active'|'select', Return>} SelectOnSignature
169
+ */
170
+
171
+ /**
172
+ * @classdesc
173
+ * Interaction for selecting vector features. By default, selected features are
174
+ * styled differently, so this interaction can be used for visual highlighting,
175
+ * as well as selecting features for other actions, such as modification or
176
+ * output. There are three ways of controlling which features are selected:
177
+ * using the browser event as defined by the `condition` and optionally the
178
+ * `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a
179
+ * further feature filter using the `filter` option.
180
+ *
181
+ * @fires SelectEvent
182
+ * @api
183
+ */
184
+ class Select extends _Interaction_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
185
+ /**
186
+ * @param {Options} [options] Options.
187
+ */
188
+ constructor(options) {
189
+ super();
190
+
191
+ /***
192
+ * @type {SelectOnSignature<import("../events").EventsKey>}
193
+ */
194
+ this.on;
195
+
196
+ /***
197
+ * @type {SelectOnSignature<import("../events").EventsKey>}
198
+ */
199
+ this.once;
200
+
201
+ /***
202
+ * @type {SelectOnSignature<void>}
203
+ */
204
+ this.un;
205
+
206
+ options = options ? options : {};
207
+
208
+ /**
209
+ * @private
210
+ */
211
+ this.boundAddFeature_ = this.addFeature_.bind(this);
212
+
213
+ /**
214
+ * @private
215
+ */
216
+ this.boundRemoveFeature_ = this.removeFeature_.bind(this);
217
+
218
+ /**
219
+ * @private
220
+ * @type {import("../events/condition.js").Condition}
221
+ */
222
+ this.condition_ = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_2__.singleClick;
223
+
224
+ /**
225
+ * @private
226
+ * @type {import("../events/condition.js").Condition}
227
+ */
228
+ this.addCondition_ = options.addCondition ? options.addCondition : _events_condition_js__WEBPACK_IMPORTED_MODULE_2__.never;
229
+
230
+ /**
231
+ * @private
232
+ * @type {import("../events/condition.js").Condition}
233
+ */
234
+ this.removeCondition_ = options.removeCondition
235
+ ? options.removeCondition
236
+ : _events_condition_js__WEBPACK_IMPORTED_MODULE_2__.never;
237
+
238
+ /**
239
+ * @private
240
+ * @type {import("../events/condition.js").Condition}
241
+ */
242
+ this.toggleCondition_ = options.toggleCondition
243
+ ? options.toggleCondition
244
+ : _events_condition_js__WEBPACK_IMPORTED_MODULE_2__.shiftKeyOnly;
245
+
246
+ /**
247
+ * @private
248
+ * @type {boolean}
249
+ */
250
+ this.multi_ = options.multi ? options.multi : false;
251
+
252
+ /**
253
+ * @private
254
+ * @type {FilterFunction}
255
+ */
256
+ this.filter_ = options.filter ? options.filter : _functions_js__WEBPACK_IMPORTED_MODULE_3__.TRUE;
257
+
258
+ /**
259
+ * @private
260
+ * @type {number}
261
+ */
262
+ this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;
263
+
264
+ /**
265
+ * @private
266
+ * @type {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction|null}
267
+ */
268
+ this.style_ =
269
+ options.style !== undefined ? options.style : getDefaultStyleFunction();
270
+
271
+ /**
272
+ * @private
273
+ * @type {Collection<Feature>}
274
+ */
275
+ this.features_ = options.features || new _Collection_js__WEBPACK_IMPORTED_MODULE_4__["default"]();
276
+
277
+ /** @type {function(import("../layer/Layer.js").default<import("../source/Source").default>): boolean} */
278
+ let layerFilter;
279
+ if (options.layers) {
280
+ if (typeof options.layers === 'function') {
281
+ layerFilter = options.layers;
282
+ } else {
283
+ const layers = options.layers;
284
+ layerFilter = function (layer) {
285
+ return layers.includes(layer);
286
+ };
287
+ }
288
+ } else {
289
+ layerFilter = _functions_js__WEBPACK_IMPORTED_MODULE_3__.TRUE;
290
+ }
291
+
292
+ /**
293
+ * @private
294
+ * @type {function(import("../layer/Layer.js").default<import("../source/Source").default>): boolean}
295
+ */
296
+ this.layerFilter_ = layerFilter;
297
+
298
+ /**
299
+ * An association between selected feature (key)
300
+ * and layer (value)
301
+ * @private
302
+ * @type {Object<string, import("../layer/Layer.js").default>}
303
+ */
304
+ this.featureLayerAssociation_ = {};
305
+ }
306
+
307
+ /**
308
+ * @param {import("../Feature.js").default} feature Feature.
309
+ * @param {import("../layer/Layer.js").default} layer Layer.
310
+ * @private
311
+ */
312
+ addFeatureLayerAssociation_(feature, layer) {
313
+ this.featureLayerAssociation_[(0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature)] = layer;
314
+ }
315
+
316
+ /**
317
+ * Get the selected features.
318
+ * @return {Collection<Feature>} Features collection.
319
+ * @api
320
+ */
321
+ getFeatures() {
322
+ return this.features_;
323
+ }
324
+
325
+ /**
326
+ * Returns the Hit-detection tolerance.
327
+ * @return {number} Hit tolerance in pixels.
328
+ * @api
329
+ */
330
+ getHitTolerance() {
331
+ return this.hitTolerance_;
332
+ }
333
+
334
+ /**
335
+ * Returns the associated {@link module:ol/layer/Vector~VectorLayer vector layer} of
336
+ * a selected feature.
337
+ * @param {import("../Feature.js").default} feature Feature
338
+ * @return {import('../layer/Vector.js').default} Layer.
339
+ * @api
340
+ */
341
+ getLayer(feature) {
342
+ return /** @type {import('../layer/Vector.js').default} */ (
343
+ this.featureLayerAssociation_[(0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature)]
344
+ );
345
+ }
346
+
347
+ /**
348
+ * Hit-detection tolerance. Pixels inside the radius around the given position
349
+ * will be checked for features.
350
+ * @param {number} hitTolerance Hit tolerance in pixels.
351
+ * @api
352
+ */
353
+ setHitTolerance(hitTolerance) {
354
+ this.hitTolerance_ = hitTolerance;
355
+ }
356
+
357
+ /**
358
+ * Remove the interaction from its current map, if any, and attach it to a new
359
+ * map, if any. Pass `null` to just remove the interaction from the current map.
360
+ * @param {import("../Map.js").default|null} map Map.
361
+ * @api
362
+ * @override
363
+ */
364
+ setMap(map) {
365
+ const currentMap = this.getMap();
366
+ if (currentMap && this.style_) {
367
+ this.features_.forEach(this.restorePreviousStyle_.bind(this));
368
+ }
369
+ super.setMap(map);
370
+ if (map) {
371
+ this.features_.addEventListener(
372
+ _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__["default"].ADD,
373
+ this.boundAddFeature_,
374
+ );
375
+ this.features_.addEventListener(
376
+ _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__["default"].REMOVE,
377
+ this.boundRemoveFeature_,
378
+ );
379
+
380
+ if (this.style_) {
381
+ this.features_.forEach(this.applySelectedStyle_.bind(this));
382
+ }
383
+ } else {
384
+ this.features_.removeEventListener(
385
+ _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__["default"].ADD,
386
+ this.boundAddFeature_,
387
+ );
388
+ this.features_.removeEventListener(
389
+ _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__["default"].REMOVE,
390
+ this.boundRemoveFeature_,
391
+ );
392
+ }
393
+ }
394
+
395
+ /**
396
+ * @param {import("../Collection.js").CollectionEvent<Feature>} evt Event.
397
+ * @private
398
+ */
399
+ addFeature_(evt) {
400
+ const feature = evt.element;
401
+ if (this.style_) {
402
+ this.applySelectedStyle_(feature);
403
+ }
404
+ if (!this.getLayer(feature)) {
405
+ const layer = /** @type {VectorLayer} */ (
406
+ this.getMap()
407
+ .getAllLayers()
408
+ .find(function (layer) {
409
+ if (
410
+ layer instanceof _layer_Vector_js__WEBPACK_IMPORTED_MODULE_7__["default"] &&
411
+ layer.getSource() &&
412
+ layer.getSource().hasFeature(feature)
413
+ ) {
414
+ return layer;
415
+ }
416
+ })
417
+ );
418
+ if (layer) {
419
+ this.addFeatureLayerAssociation_(feature, layer);
420
+ }
421
+ }
422
+ }
423
+
424
+ /**
425
+ * @param {import("../Collection.js").CollectionEvent<Feature>} evt Event.
426
+ * @private
427
+ */
428
+ removeFeature_(evt) {
429
+ if (this.style_) {
430
+ this.restorePreviousStyle_(evt.element);
431
+ }
432
+ }
433
+
434
+ /**
435
+ * @return {import("../style/Style.js").StyleLike|null} Select style.
436
+ */
437
+ getStyle() {
438
+ return this.style_;
439
+ }
440
+
441
+ /**
442
+ * @param {Feature} feature Feature
443
+ * @private
444
+ */
445
+ applySelectedStyle_(feature) {
446
+ const key = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature);
447
+ if (!(key in originalFeatureStyles)) {
448
+ originalFeatureStyles[key] = feature.getStyle();
449
+ }
450
+ feature.setStyle(this.style_);
451
+ }
452
+
453
+ /**
454
+ * @param {Feature} feature Feature
455
+ * @private
456
+ */
457
+ restorePreviousStyle_(feature) {
458
+ const interactions = this.getMap().getInteractions().getArray();
459
+ for (let i = interactions.length - 1; i >= 0; --i) {
460
+ const interaction = interactions[i];
461
+ if (
462
+ interaction !== this &&
463
+ interaction instanceof Select &&
464
+ interaction.getStyle() &&
465
+ interaction.getFeatures().getArray().lastIndexOf(feature) !== -1
466
+ ) {
467
+ feature.setStyle(interaction.getStyle());
468
+ return;
469
+ }
470
+ }
471
+
472
+ const key = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature);
473
+ feature.setStyle(originalFeatureStyles[key]);
474
+ delete originalFeatureStyles[key];
475
+ }
476
+
477
+ /**
478
+ * @param {Feature} feature Feature.
479
+ * @private
480
+ */
481
+ removeFeatureLayerAssociation_(feature) {
482
+ delete this.featureLayerAssociation_[(0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature)];
483
+ }
484
+
485
+ /**
486
+ * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may change the
487
+ * selected state of features.
488
+ * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
489
+ * @return {boolean} `false` to stop event propagation.
490
+ * @override
491
+ */
492
+ handleEvent(mapBrowserEvent) {
493
+ if (!this.condition_(mapBrowserEvent)) {
494
+ return true;
495
+ }
496
+ const add = this.addCondition_(mapBrowserEvent);
497
+ const remove = this.removeCondition_(mapBrowserEvent);
498
+ const toggle = this.toggleCondition_(mapBrowserEvent);
499
+ const set = !add && !remove && !toggle;
500
+ const map = mapBrowserEvent.map;
501
+ const features = this.getFeatures();
502
+
503
+ /**
504
+ * @type {Array<Feature>}
505
+ */
506
+ const deselected = [];
507
+
508
+ /**
509
+ * @type {Array<Feature>}
510
+ */
511
+ const selected = [];
512
+
513
+ if (set) {
514
+ // Replace the currently selected feature(s) with the feature(s) at the
515
+ // pixel, or clear the selected feature(s) if there is no feature at
516
+ // the pixel.
517
+ (0,_obj_js__WEBPACK_IMPORTED_MODULE_8__.clear)(this.featureLayerAssociation_);
518
+ map.forEachFeatureAtPixel(
519
+ mapBrowserEvent.pixel,
520
+ /**
521
+ * @param {import("../Feature.js").FeatureLike} feature Feature.
522
+ * @param {import("../layer/Layer.js").default} layer Layer.
523
+ * @return {boolean|undefined} Continue to iterate over the features.
524
+ */
525
+ (feature, layer) => {
526
+ if (!(feature instanceof _Feature_js__WEBPACK_IMPORTED_MODULE_9__["default"]) || !this.filter_(feature, layer)) {
527
+ return;
528
+ }
529
+ this.addFeatureLayerAssociation_(feature, layer);
530
+ selected.push(feature);
531
+ return !this.multi_;
532
+ },
533
+ {
534
+ layerFilter: this.layerFilter_,
535
+ hitTolerance: this.hitTolerance_,
536
+ },
537
+ );
538
+ for (let i = features.getLength() - 1; i >= 0; --i) {
539
+ const feature = features.item(i);
540
+ const index = selected.indexOf(feature);
541
+ if (index > -1) {
542
+ // feature is already selected
543
+ selected.splice(index, 1);
544
+ } else {
545
+ features.remove(feature);
546
+ deselected.push(feature);
547
+ }
548
+ }
549
+ if (selected.length !== 0) {
550
+ features.extend(selected);
551
+ }
552
+ } else {
553
+ // Modify the currently selected feature(s).
554
+ map.forEachFeatureAtPixel(
555
+ mapBrowserEvent.pixel,
556
+ /**
557
+ * @param {import("../Feature.js").FeatureLike} feature Feature.
558
+ * @param {import("../layer/Layer.js").default} layer Layer.
559
+ * @return {boolean|undefined} Continue to iterate over the features.
560
+ */
561
+ (feature, layer) => {
562
+ if (!(feature instanceof _Feature_js__WEBPACK_IMPORTED_MODULE_9__["default"]) || !this.filter_(feature, layer)) {
563
+ return;
564
+ }
565
+ if ((add || toggle) && !features.getArray().includes(feature)) {
566
+ this.addFeatureLayerAssociation_(feature, layer);
567
+ selected.push(feature);
568
+ } else if (
569
+ (remove || toggle) &&
570
+ features.getArray().includes(feature)
571
+ ) {
572
+ deselected.push(feature);
573
+ this.removeFeatureLayerAssociation_(feature);
574
+ }
575
+ return !this.multi_;
576
+ },
577
+ {
578
+ layerFilter: this.layerFilter_,
579
+ hitTolerance: this.hitTolerance_,
580
+ },
581
+ );
582
+ for (let j = deselected.length - 1; j >= 0; --j) {
583
+ features.remove(deselected[j]);
584
+ }
585
+ features.extend(selected);
586
+ }
587
+ if (selected.length > 0 || deselected.length > 0) {
588
+ this.dispatchEvent(
589
+ new SelectEvent(
590
+ SelectEventType.SELECT,
591
+ selected,
592
+ deselected,
593
+ mapBrowserEvent,
594
+ ),
595
+ );
596
+ }
597
+ return true;
598
+ }
599
+ }
600
+
601
+ /**
602
+ * @return {import("../style/Style.js").StyleFunction} Styles.
603
+ */
604
+ function getDefaultStyleFunction() {
605
+ const styles = (0,_style_Style_js__WEBPACK_IMPORTED_MODULE_10__.createEditingStyle)();
606
+ (0,_array_js__WEBPACK_IMPORTED_MODULE_11__.extend)(styles['Polygon'], styles['LineString']);
607
+ (0,_array_js__WEBPACK_IMPORTED_MODULE_11__.extend)(styles['GeometryCollection'], styles['LineString']);
608
+
609
+ return function (feature) {
610
+ if (!feature.getGeometry()) {
611
+ return null;
612
+ }
613
+ return styles[feature.getGeometry().getType()];
614
+ };
615
+ }
616
+
617
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Select);
618
+
619
+
620
+ /***/ })
621
+
622
+ }])
623
+ //# sourceMappingURL=vendors-node_modules_ol_interaction_Select_js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors-node_modules_ol_interaction_Select_js.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAC0C;AACkB;AACxB;AACD;AACI;AACiC;AACnC;AACQ;AACb;AACqB;AACnB;AACS;;AAE3C;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,iCAAiC;AAC7D;AACA,aAAa,4HAA4H;AACzI;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,4CAA4C;AAC1D,iBAAiB,iDAAiD;AAClE;AACA,wBAAwB,uCAAuC;AAC/D;AACA,cAAc,4CAA4C;AAC1D,YAAY,iDAAiD;AAC7D;AACA;AACA,IAAI,6CAA6C;AACjD;AACA;AACA;AACA;AACA,cAAc,uIAAuI;AACrJ;AACA;AACA;AACA;AACA;AACA,cAAc,4CAA4C;AAC1D;AACA,SAAS,kCAAkC;AAC3C;AACA;AACA,cAAc,4CAA4C;AAC1D,iBAAiB,iDAAiD;AAClE;AACA,wBAAwB,uCAAuC;AAC/D;AACA,cAAc,4CAA4C;AAC1D,iBAAiB,iDAAiD;AAClE;AACA;AACA,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA,IAAI,sDAAsD;AAC1D,cAAc,gBAAgB;AAC9B,iBAAiB,iCAAiC;AAClD,IAAI,mCAAmC;AACvC;AACA,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA,sBAAsB,2CAA2C;AACjE;AACA;AACO,0BAA0B,wDAAK;AACtC;AACA,aAAa,iBAAiB;AAC9B,aAAa,wCAAwC;AACrD,aAAa,wCAAwC;AACrD,aAAa,yCAAyC;AACtD,UAAU,gDAAgD;AAC1D;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA,mBAAmB,gDAAgD;AACnE,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,mBAAmB;AACrE;AACA;AACA;AACA;AACA;AACA,qBAAqB,uDAAW;AAChC;AACA,aAAa,SAAS;AACtB;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA,8DAA8D,6DAAW;;AAEzE;AACA;AACA,cAAc;AACd;AACA,uEAAuE,uDAAK;;AAE5E;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,QAAQ,uDAAK;;AAEb;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,QAAQ,8DAAY;;AAEpB;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA,qDAAqD,+CAAI;;AAEzD;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA,6CAA6C,sDAAU;;AAEvD,eAAe,4FAA4F;AAC3G;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,oBAAoB,+CAAI;AACxB;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA,aAAa,iCAAiC;AAC9C,aAAa,qCAAqC;AAClD;AACA;AACA;AACA,kCAAkC,gDAAM;AACxC;;AAEA;AACA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,uDAAuD;AACpF;AACA,aAAa,iCAAiC;AAC9C,cAAc,sCAAsC;AACpD;AACA;AACA;AACA,sBAAsB,sCAAsC;AAC5D,oCAAoC,gDAAM;AAC1C;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mEAAuB;AAC/B;AACA;AACA;AACA,QAAQ,sEAA0B;AAClC;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,QAAQ,mEAAuB;AAC/B;AACA;AACA;AACA,QAAQ,sEAA0B;AAClC;AACA;AACA;AACA;;AAEA;AACA,aAAa,qDAAqD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,aAAa;AAC5C;AACA;AACA;AACA;AACA,+BAA+B,wDAAW;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,qDAAqD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,4CAA4C;AAC1D;AACA;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA,gBAAgB,gDAAM;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,gDAAM;AACtB;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA,yCAAyC,gDAAM;AAC/C;;AAEA;AACA,kBAAkB,mEAAmE;AACrF;AACA,aAAa,yCAAyC;AACtD,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM,8CAAK;AACX;AACA;AACA;AACA,mBAAmB,qCAAqC;AACxD,mBAAmB,qCAAqC;AACxD,oBAAoB,mBAAmB;AACvC;AACA;AACA,mCAAmC,mDAAO;AAC1C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,mBAAmB,qCAAqC;AACxD,mBAAmB,qCAAqC;AACxD,oBAAoB,mBAAmB;AACvC;AACA;AACA,mCAAmC,mDAAO;AAC1C;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,2CAA2C;AACvD;AACA;AACA,iBAAiB,oEAAkB;AACnC,EAAE,kDAAM;AACR,EAAE,kDAAM;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,MAAM,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/interaction/Select.js"],"sourcesContent":["/**\n * @module ol/interaction/Select\n */\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport Feature from '../Feature.js';\nimport {extend} from '../array.js';\nimport Event from '../events/Event.js';\nimport {never, shiftKeyOnly, singleClick} from '../events/condition.js';\nimport {TRUE} from '../functions.js';\nimport VectorLayer from '../layer/Vector.js';\nimport {clear} from '../obj.js';\nimport {createEditingStyle} from '../style/Style.js';\nimport {getUid} from '../util.js';\nimport Interaction from './Interaction.js';\n\n/**\n * @enum {string}\n */\nconst SelectEventType = {\n /**\n * Triggered when feature(s) has been (de)selected.\n * @event SelectEvent#select\n * @api\n */\n SELECT: 'select',\n};\n\n/**\n * A function that takes a {@link module:ol/Feature~Feature} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @typedef {function(import(\"../Feature.js\").default, import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>):boolean} FilterFunction\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [addCondition] A function\n * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition.never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is the event\n * for the selected features as a whole. By default, this is\n * {@link module:ol/events/condition.singleClick}. Clicking on a feature selects that\n * feature and removes any that were in the selection. Clicking outside any\n * feature removes all from the selection.\n * See `toggle`, `add`, `remove` options for adding/removing extra features to/\n * from the selection.\n * @property {Array<import(\"../layer/Layer.js\").default>|function(import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>): boolean} [layers]\n * A list of layers from which features should be selected. Alternatively, a\n * filter function can be provided. The function will be called for each layer\n * in the map and should return `true` for layers that you want to be\n * selectable. If the option is absent, all visible layers will be considered\n * selectable.\n * @property {import(\"../style/Style.js\").StyleLike|null} [style]\n * Style for the selected features. By default the default edit style is used\n * (see {@link module:ol/style/Style~Style}). Set to `null` if this interaction should not apply\n * any style changes for selected features.\n * If set to a falsey value, the selected feature's style will not change.\n * @property {import(\"../events/condition.js\").Condition} [removeCondition] A function\n * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition.never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [toggleCondition] A function\n * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is in addition\n * to the `condition` event. By default,\n * {@link module:ol/events/condition.shiftKeyOnly}, i.e. pressing `shift` as\n * well as the `condition` event, adds that feature to the current selection if\n * it is not currently selected, and removes it if it is. See `add` and `remove`\n * if you want to use different events instead of a toggle.\n * @property {boolean} [multi=false] A boolean that determines if the default\n * behaviour should select only single features or all (overlapping) features at\n * the clicked map position. The default of `false` means single select.\n * @property {Collection<Feature>} [features]\n * Collection where the interaction will place selected features. Optional. If\n * not set the interaction will create a collection. In any case the collection\n * used by the interaction is returned by\n * {@link module:ol/interaction/Select~Select#getFeatures}.\n * @property {FilterFunction} [filter] A function\n * that takes a {@link module:ol/Feature~Feature} and a\n * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside\n * the radius around the given position will be checked for features.\n */\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Select~Select} instances are instances of\n * this type.\n */\nexport class SelectEvent extends Event {\n /**\n * @param {SelectEventType} type The event type.\n * @param {Array<import(\"../Feature.js\").default>} selected Selected features.\n * @param {Array<import(\"../Feature.js\").default>} deselected Deselected features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Associated\n * {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n */\n constructor(type, selected, deselected, mapBrowserEvent) {\n super(type);\n\n /**\n * Selected features array.\n * @type {Array<import(\"../Feature.js\").default>}\n * @api\n */\n this.selected = selected;\n\n /**\n * Deselected features array.\n * @type {Array<import(\"../Feature.js\").default>}\n * @api\n */\n this.deselected = deselected;\n\n /**\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n this.mapBrowserEvent = mapBrowserEvent;\n }\n}\n\n/**\n * Original feature styles to reset to when features are no longer selected.\n * @type {Object<number, import(\"../style/Style.js\").default|Array<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction>}\n */\nconst originalFeatureStyles = {};\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<'select', SelectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active'|'select', Return>} SelectOnSignature\n */\n\n/**\n * @classdesc\n * Interaction for selecting vector features. By default, selected features are\n * styled differently, so this interaction can be used for visual highlighting,\n * as well as selecting features for other actions, such as modification or\n * output. There are three ways of controlling which features are selected:\n * using the browser event as defined by the `condition` and optionally the\n * `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a\n * further feature filter using the `filter` option.\n *\n * @fires SelectEvent\n * @api\n */\nclass Select extends Interaction {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {SelectOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {SelectOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {SelectOnSignature<void>}\n */\n this.un;\n\n options = options ? options : {};\n\n /**\n * @private\n */\n this.boundAddFeature_ = this.addFeature_.bind(this);\n\n /**\n * @private\n */\n this.boundRemoveFeature_ = this.removeFeature_.bind(this);\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : singleClick;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.addCondition_ = options.addCondition ? options.addCondition : never;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.removeCondition_ = options.removeCondition\n ? options.removeCondition\n : never;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.toggleCondition_ = options.toggleCondition\n ? options.toggleCondition\n : shiftKeyOnly;\n\n /**\n * @private\n * @type {boolean}\n */\n this.multi_ = options.multi ? options.multi : false;\n\n /**\n * @private\n * @type {FilterFunction}\n */\n this.filter_ = options.filter ? options.filter : TRUE;\n\n /**\n * @private\n * @type {number}\n */\n this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;\n\n /**\n * @private\n * @type {import(\"../style/Style.js\").default|Array<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction|null}\n */\n this.style_ =\n options.style !== undefined ? options.style : getDefaultStyleFunction();\n\n /**\n * @private\n * @type {Collection<Feature>}\n */\n this.features_ = options.features || new Collection();\n\n /** @type {function(import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>): boolean} */\n let layerFilter;\n if (options.layers) {\n if (typeof options.layers === 'function') {\n layerFilter = options.layers;\n } else {\n const layers = options.layers;\n layerFilter = function (layer) {\n return layers.includes(layer);\n };\n }\n } else {\n layerFilter = TRUE;\n }\n\n /**\n * @private\n * @type {function(import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>): boolean}\n */\n this.layerFilter_ = layerFilter;\n\n /**\n * An association between selected feature (key)\n * and layer (value)\n * @private\n * @type {Object<string, import(\"../layer/Layer.js\").default>}\n */\n this.featureLayerAssociation_ = {};\n }\n\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @private\n */\n addFeatureLayerAssociation_(feature, layer) {\n this.featureLayerAssociation_[getUid(feature)] = layer;\n }\n\n /**\n * Get the selected features.\n * @return {Collection<Feature>} Features collection.\n * @api\n */\n getFeatures() {\n return this.features_;\n }\n\n /**\n * Returns the Hit-detection tolerance.\n * @return {number} Hit tolerance in pixels.\n * @api\n */\n getHitTolerance() {\n return this.hitTolerance_;\n }\n\n /**\n * Returns the associated {@link module:ol/layer/Vector~VectorLayer vector layer} of\n * a selected feature.\n * @param {import(\"../Feature.js\").default} feature Feature\n * @return {import('../layer/Vector.js').default} Layer.\n * @api\n */\n getLayer(feature) {\n return /** @type {import('../layer/Vector.js').default} */ (\n this.featureLayerAssociation_[getUid(feature)]\n );\n }\n\n /**\n * Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @api\n */\n setHitTolerance(hitTolerance) {\n this.hitTolerance_ = hitTolerance;\n }\n\n /**\n * Remove the interaction from its current map, if any, and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {import(\"../Map.js\").default|null} map Map.\n * @api\n * @override\n */\n setMap(map) {\n const currentMap = this.getMap();\n if (currentMap && this.style_) {\n this.features_.forEach(this.restorePreviousStyle_.bind(this));\n }\n super.setMap(map);\n if (map) {\n this.features_.addEventListener(\n CollectionEventType.ADD,\n this.boundAddFeature_,\n );\n this.features_.addEventListener(\n CollectionEventType.REMOVE,\n this.boundRemoveFeature_,\n );\n\n if (this.style_) {\n this.features_.forEach(this.applySelectedStyle_.bind(this));\n }\n } else {\n this.features_.removeEventListener(\n CollectionEventType.ADD,\n this.boundAddFeature_,\n );\n this.features_.removeEventListener(\n CollectionEventType.REMOVE,\n this.boundRemoveFeature_,\n );\n }\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<Feature>} evt Event.\n * @private\n */\n addFeature_(evt) {\n const feature = evt.element;\n if (this.style_) {\n this.applySelectedStyle_(feature);\n }\n if (!this.getLayer(feature)) {\n const layer = /** @type {VectorLayer} */ (\n this.getMap()\n .getAllLayers()\n .find(function (layer) {\n if (\n layer instanceof VectorLayer &&\n layer.getSource() &&\n layer.getSource().hasFeature(feature)\n ) {\n return layer;\n }\n })\n );\n if (layer) {\n this.addFeatureLayerAssociation_(feature, layer);\n }\n }\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<Feature>} evt Event.\n * @private\n */\n removeFeature_(evt) {\n if (this.style_) {\n this.restorePreviousStyle_(evt.element);\n }\n }\n\n /**\n * @return {import(\"../style/Style.js\").StyleLike|null} Select style.\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * @param {Feature} feature Feature\n * @private\n */\n applySelectedStyle_(feature) {\n const key = getUid(feature);\n if (!(key in originalFeatureStyles)) {\n originalFeatureStyles[key] = feature.getStyle();\n }\n feature.setStyle(this.style_);\n }\n\n /**\n * @param {Feature} feature Feature\n * @private\n */\n restorePreviousStyle_(feature) {\n const interactions = this.getMap().getInteractions().getArray();\n for (let i = interactions.length - 1; i >= 0; --i) {\n const interaction = interactions[i];\n if (\n interaction !== this &&\n interaction instanceof Select &&\n interaction.getStyle() &&\n interaction.getFeatures().getArray().lastIndexOf(feature) !== -1\n ) {\n feature.setStyle(interaction.getStyle());\n return;\n }\n }\n\n const key = getUid(feature);\n feature.setStyle(originalFeatureStyles[key]);\n delete originalFeatureStyles[key];\n }\n\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n removeFeatureLayerAssociation_(feature) {\n delete this.featureLayerAssociation_[getUid(feature)];\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may change the\n * selected state of features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @override\n */\n handleEvent(mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n const add = this.addCondition_(mapBrowserEvent);\n const remove = this.removeCondition_(mapBrowserEvent);\n const toggle = this.toggleCondition_(mapBrowserEvent);\n const set = !add && !remove && !toggle;\n const map = mapBrowserEvent.map;\n const features = this.getFeatures();\n\n /**\n * @type {Array<Feature>}\n */\n const deselected = [];\n\n /**\n * @type {Array<Feature>}\n */\n const selected = [];\n\n if (set) {\n // Replace the currently selected feature(s) with the feature(s) at the\n // pixel, or clear the selected feature(s) if there is no feature at\n // the pixel.\n clear(this.featureLayerAssociation_);\n map.forEachFeatureAtPixel(\n mapBrowserEvent.pixel,\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n (feature, layer) => {\n if (!(feature instanceof Feature) || !this.filter_(feature, layer)) {\n return;\n }\n this.addFeatureLayerAssociation_(feature, layer);\n selected.push(feature);\n return !this.multi_;\n },\n {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_,\n },\n );\n for (let i = features.getLength() - 1; i >= 0; --i) {\n const feature = features.item(i);\n const index = selected.indexOf(feature);\n if (index > -1) {\n // feature is already selected\n selected.splice(index, 1);\n } else {\n features.remove(feature);\n deselected.push(feature);\n }\n }\n if (selected.length !== 0) {\n features.extend(selected);\n }\n } else {\n // Modify the currently selected feature(s).\n map.forEachFeatureAtPixel(\n mapBrowserEvent.pixel,\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n (feature, layer) => {\n if (!(feature instanceof Feature) || !this.filter_(feature, layer)) {\n return;\n }\n if ((add || toggle) && !features.getArray().includes(feature)) {\n this.addFeatureLayerAssociation_(feature, layer);\n selected.push(feature);\n } else if (\n (remove || toggle) &&\n features.getArray().includes(feature)\n ) {\n deselected.push(feature);\n this.removeFeatureLayerAssociation_(feature);\n }\n return !this.multi_;\n },\n {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_,\n },\n );\n for (let j = deselected.length - 1; j >= 0; --j) {\n features.remove(deselected[j]);\n }\n features.extend(selected);\n }\n if (selected.length > 0 || deselected.length > 0) {\n this.dispatchEvent(\n new SelectEvent(\n SelectEventType.SELECT,\n selected,\n deselected,\n mapBrowserEvent,\n ),\n );\n }\n return true;\n }\n}\n\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n const styles = createEditingStyle();\n extend(styles['Polygon'], styles['LineString']);\n extend(styles['GeometryCollection'], styles['LineString']);\n\n return function (feature) {\n if (!feature.getGeometry()) {\n return null;\n }\n return styles[feature.getGeometry().getType()];\n };\n}\n\nexport default Select;\n"],"names":[],"sourceRoot":""}