@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,327 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_control_MousePosition_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/control/MousePosition.js":
|
|
4
|
+
/*!**************************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/control/MousePosition.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 _coordinate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../coordinate.js */ "./node_modules/ol/coordinate.js");
|
|
14
|
+
/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events.js */ "./node_modules/ol/events.js");
|
|
15
|
+
/* harmony import */ var _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../pointer/EventType.js */ "./node_modules/ol/pointer/EventType.js");
|
|
16
|
+
/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ "./node_modules/ol/proj.js");
|
|
17
|
+
/* harmony import */ var _Control_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Control.js */ "./node_modules/ol/control/Control.js");
|
|
18
|
+
/**
|
|
19
|
+
* @module ol/control/MousePosition
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
const PROJECTION = 'projection';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
const COORDINATE_FORMAT = 'coordinateFormat';
|
|
37
|
+
|
|
38
|
+
/***
|
|
39
|
+
* @template Return
|
|
40
|
+
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
41
|
+
* import("../Observable").OnSignature<import("../ObjectEventType").Types|
|
|
42
|
+
* 'change:coordinateFormat'|'change:projection', import("../Object").ObjectEvent, Return> &
|
|
43
|
+
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("../ObjectEventType").Types|
|
|
44
|
+
* 'change:coordinateFormat'|'change:projection', Return>} MousePositionOnSignature
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {Object} Options
|
|
49
|
+
* @property {string} [className='ol-mouse-position'] CSS class name.
|
|
50
|
+
* @property {import("../coordinate.js").CoordinateFormat} [coordinateFormat] Coordinate format.
|
|
51
|
+
* @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection.
|
|
52
|
+
* @property {function(import("../MapEvent.js").default):void} [render] Function called when the
|
|
53
|
+
* control should be re-rendered. This is called in a `requestAnimationFrame`
|
|
54
|
+
* callback.
|
|
55
|
+
* @property {HTMLElement|string} [target] Specify a target if you want the
|
|
56
|
+
* control to be rendered outside of the map's viewport.
|
|
57
|
+
* @property {string} [placeholder] Markup to show when the mouse position is not
|
|
58
|
+
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space is rendered
|
|
59
|
+
* initially and the last position is retained when the mouse leaves the viewport.
|
|
60
|
+
* When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a
|
|
61
|
+
* placeholder.
|
|
62
|
+
* @property {boolean} [wrapX=true] Wrap the world horizontally on the projection's antimeridian, if it
|
|
63
|
+
* is a global projection.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @classdesc
|
|
68
|
+
* A control to show the 2D coordinates of the mouse cursor. By default, these
|
|
69
|
+
* are in the view projection, but can be in any supported projection.
|
|
70
|
+
* By default the control is shown in the top right corner of the map, but this
|
|
71
|
+
* can be changed by using the css selector `.ol-mouse-position`.
|
|
72
|
+
*
|
|
73
|
+
* On touch devices, which usually do not have a mouse cursor, the coordinates
|
|
74
|
+
* of the currently touched position are shown.
|
|
75
|
+
*
|
|
76
|
+
* @api
|
|
77
|
+
*/
|
|
78
|
+
class MousePosition extends _Control_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
79
|
+
/**
|
|
80
|
+
* @param {Options} [options] Mouse position options.
|
|
81
|
+
*/
|
|
82
|
+
constructor(options) {
|
|
83
|
+
options = options ? options : {};
|
|
84
|
+
|
|
85
|
+
const element = document.createElement('div');
|
|
86
|
+
element.className =
|
|
87
|
+
options.className !== undefined ? options.className : 'ol-mouse-position';
|
|
88
|
+
|
|
89
|
+
super({
|
|
90
|
+
element: element,
|
|
91
|
+
render: options.render,
|
|
92
|
+
target: options.target,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/***
|
|
96
|
+
* @type {MousePositionOnSignature<import("../events").EventsKey>}
|
|
97
|
+
*/
|
|
98
|
+
this.on;
|
|
99
|
+
|
|
100
|
+
/***
|
|
101
|
+
* @type {MousePositionOnSignature<import("../events").EventsKey>}
|
|
102
|
+
*/
|
|
103
|
+
this.once;
|
|
104
|
+
|
|
105
|
+
/***
|
|
106
|
+
* @type {MousePositionOnSignature<void>}
|
|
107
|
+
*/
|
|
108
|
+
this.un;
|
|
109
|
+
|
|
110
|
+
this.addChangeListener(PROJECTION, this.handleProjectionChanged_);
|
|
111
|
+
|
|
112
|
+
if (options.coordinateFormat) {
|
|
113
|
+
this.setCoordinateFormat(options.coordinateFormat);
|
|
114
|
+
}
|
|
115
|
+
if (options.projection) {
|
|
116
|
+
this.setProjection(options.projection);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @private
|
|
121
|
+
* @type {boolean}
|
|
122
|
+
*/
|
|
123
|
+
this.renderOnMouseOut_ = options.placeholder !== undefined;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @private
|
|
127
|
+
* @type {string}
|
|
128
|
+
*/
|
|
129
|
+
this.placeholder_ = this.renderOnMouseOut_ ? options.placeholder : ' ';
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @private
|
|
133
|
+
* @type {string}
|
|
134
|
+
*/
|
|
135
|
+
this.renderedHTML_ = element.innerHTML;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @private
|
|
139
|
+
* @type {?import("../proj/Projection.js").default}
|
|
140
|
+
*/
|
|
141
|
+
this.mapProjection_ = null;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @private
|
|
145
|
+
* @type {?import("../proj.js").TransformFunction}
|
|
146
|
+
*/
|
|
147
|
+
this.transform_ = null;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @private
|
|
151
|
+
* @type {boolean}
|
|
152
|
+
*/
|
|
153
|
+
this.wrapX_ = options.wrapX === false ? false : true;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
handleProjectionChanged_() {
|
|
160
|
+
this.transform_ = null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Return the coordinate format type used to render the current position or
|
|
165
|
+
* undefined.
|
|
166
|
+
* @return {import("../coordinate.js").CoordinateFormat|undefined} The format to render the current
|
|
167
|
+
* position in.
|
|
168
|
+
* @observable
|
|
169
|
+
* @api
|
|
170
|
+
*/
|
|
171
|
+
getCoordinateFormat() {
|
|
172
|
+
return /** @type {import("../coordinate.js").CoordinateFormat|undefined} */ (
|
|
173
|
+
this.get(COORDINATE_FORMAT)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Return the projection that is used to report the mouse position.
|
|
179
|
+
* @return {import("../proj/Projection.js").default|undefined} The projection to report mouse
|
|
180
|
+
* position in.
|
|
181
|
+
* @observable
|
|
182
|
+
* @api
|
|
183
|
+
*/
|
|
184
|
+
getProjection() {
|
|
185
|
+
return /** @type {import("../proj/Projection.js").default|undefined} */ (
|
|
186
|
+
this.get(PROJECTION)
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @param {MouseEvent} event Browser event.
|
|
192
|
+
* @protected
|
|
193
|
+
*/
|
|
194
|
+
handleMouseMove(event) {
|
|
195
|
+
const map = this.getMap();
|
|
196
|
+
this.updateHTML_(map.getEventPixel(event));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @param {Event} event Browser event.
|
|
201
|
+
* @protected
|
|
202
|
+
*/
|
|
203
|
+
handleMouseOut(event) {
|
|
204
|
+
this.updateHTML_(null);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Remove the control from its current map and attach it to the new map.
|
|
209
|
+
* Pass `null` to just remove the control from the current map.
|
|
210
|
+
* Subclasses may set up event handlers to get notified about changes to
|
|
211
|
+
* the map here.
|
|
212
|
+
* @param {import("../Map.js").default|null} map Map.
|
|
213
|
+
* @api
|
|
214
|
+
* @override
|
|
215
|
+
*/
|
|
216
|
+
setMap(map) {
|
|
217
|
+
super.setMap(map);
|
|
218
|
+
if (map) {
|
|
219
|
+
const viewport = map.getViewport();
|
|
220
|
+
this.listenerKeys.push(
|
|
221
|
+
(0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(viewport, _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__["default"].POINTERMOVE, this.handleMouseMove, this),
|
|
222
|
+
);
|
|
223
|
+
if (this.renderOnMouseOut_) {
|
|
224
|
+
this.listenerKeys.push(
|
|
225
|
+
(0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(viewport, _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__["default"].POINTEROUT, this.handleMouseOut, this),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
this.updateHTML_(null);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Set the coordinate format type used to render the current position.
|
|
234
|
+
* @param {import("../coordinate.js").CoordinateFormat} format The format to render the current
|
|
235
|
+
* position in.
|
|
236
|
+
* @observable
|
|
237
|
+
* @api
|
|
238
|
+
*/
|
|
239
|
+
setCoordinateFormat(format) {
|
|
240
|
+
this.set(COORDINATE_FORMAT, format);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Set the projection that is used to report the mouse position.
|
|
245
|
+
* @param {import("../proj.js").ProjectionLike} projection The projection to report mouse
|
|
246
|
+
* position in.
|
|
247
|
+
* @observable
|
|
248
|
+
* @api
|
|
249
|
+
*/
|
|
250
|
+
setProjection(projection) {
|
|
251
|
+
this.set(PROJECTION, (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)(projection));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @param {?import("../pixel.js").Pixel} pixel Pixel.
|
|
256
|
+
* @private
|
|
257
|
+
*/
|
|
258
|
+
updateHTML_(pixel) {
|
|
259
|
+
let html = this.placeholder_;
|
|
260
|
+
if (pixel && this.mapProjection_) {
|
|
261
|
+
if (!this.transform_) {
|
|
262
|
+
const projection = this.getProjection();
|
|
263
|
+
if (projection) {
|
|
264
|
+
this.transform_ = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransformFromProjections)(
|
|
265
|
+
this.mapProjection_,
|
|
266
|
+
projection,
|
|
267
|
+
);
|
|
268
|
+
} else {
|
|
269
|
+
this.transform_ = _proj_js__WEBPACK_IMPORTED_MODULE_0__.identityTransform;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const map = this.getMap();
|
|
273
|
+
const coordinate = map.getCoordinateFromPixelInternal(pixel);
|
|
274
|
+
if (coordinate) {
|
|
275
|
+
const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getUserProjection)();
|
|
276
|
+
if (userProjection) {
|
|
277
|
+
this.transform_ = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransformFromProjections)(
|
|
278
|
+
this.mapProjection_,
|
|
279
|
+
userProjection,
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
this.transform_(coordinate, coordinate);
|
|
283
|
+
if (this.wrapX_) {
|
|
284
|
+
const projection =
|
|
285
|
+
userProjection || this.getProjection() || this.mapProjection_;
|
|
286
|
+
(0,_coordinate_js__WEBPACK_IMPORTED_MODULE_4__.wrapX)(coordinate, projection);
|
|
287
|
+
}
|
|
288
|
+
const coordinateFormat = this.getCoordinateFormat();
|
|
289
|
+
if (coordinateFormat) {
|
|
290
|
+
html = coordinateFormat(coordinate);
|
|
291
|
+
} else {
|
|
292
|
+
html = coordinate.toString();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (!this.renderedHTML_ || html !== this.renderedHTML_) {
|
|
297
|
+
this.element.innerHTML = html;
|
|
298
|
+
this.renderedHTML_ = html;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Update the projection. Rendering of the coordinates is done in
|
|
304
|
+
* `handleMouseMove` and `handleMouseUp`.
|
|
305
|
+
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
|
306
|
+
* @override
|
|
307
|
+
*/
|
|
308
|
+
render(mapEvent) {
|
|
309
|
+
const frameState = mapEvent.frameState;
|
|
310
|
+
if (!frameState) {
|
|
311
|
+
this.mapProjection_ = null;
|
|
312
|
+
} else {
|
|
313
|
+
if (this.mapProjection_ != frameState.viewState.projection) {
|
|
314
|
+
this.mapProjection_ = frameState.viewState.projection;
|
|
315
|
+
this.transform_ = null;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MousePosition);
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
/***/ })
|
|
325
|
+
|
|
326
|
+
}])
|
|
327
|
+
//# sourceMappingURL=node_modules_ol_control_MousePosition_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_control_MousePosition_js.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAEuC;AACH;AACY;AAM5B;AACe;;AAEnC;AACA,UAAU;AACV;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,+DAA+D;AAC/D;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,6CAA6C;AAC3D,cAAc,qCAAqC;AACnD,cAAc,iDAAiD;AAC/D;AACA;AACA,cAAc,oBAAoB;AAClC;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAO;AACnC;AACA,aAAa,SAAS;AACtB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,cAAc;AACd;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA,8EAA8E;;AAE9E;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,uDAAuD;AACrE;AACA;AACA;AACA;AACA;AACA,sBAAsB,uDAAuD;AAC7E;AACA;AACA;;AAEA;AACA;AACA,cAAc,mDAAmD;AACjE;AACA;AACA;AACA;AACA;AACA,sBAAsB,mDAAmD;AACzE;AACA;AACA;;AAEA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAM,WAAW,yEAAqB;AAC9C;AACA;AACA;AACA,UAAU,kDAAM,WAAW,wEAAoB;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,6CAA6C;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qCAAqC;AAClD;AACA;AACA;AACA;AACA;AACA,yBAAyB,6CAAa;AACtC;;AAEA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qEAA2B;AACvD;AACA;AACA;AACA,UAAU;AACV,4BAA4B,uDAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA,+BAA+B,2DAAiB;AAChD;AACA,4BAA4B,qEAA2B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,qDAAK;AACf;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,aAAa,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/control/MousePosition.js"],"sourcesContent":["/**\n * @module ol/control/MousePosition\n */\n\nimport {wrapX} from '../coordinate.js';\nimport {listen} from '../events.js';\nimport EventType from '../pointer/EventType.js';\nimport {\n get as getProjection,\n getTransformFromProjections,\n getUserProjection,\n identityTransform,\n} from '../proj.js';\nimport Control from './Control.js';\n\n/**\n * @type {string}\n */\nconst PROJECTION = 'projection';\n\n/**\n * @type {string}\n */\nconst COORDINATE_FORMAT = 'coordinateFormat';\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:coordinateFormat'|'change:projection', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:coordinateFormat'|'change:projection', Return>} MousePositionOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-mouse-position'] CSS class name.\n * @property {import(\"../coordinate.js\").CoordinateFormat} [coordinateFormat] Coordinate format.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when the\n * control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n * @property {HTMLElement|string} [target] Specify a target if you want the\n * control to be rendered outside of the map's viewport.\n * @property {string} [placeholder] Markup to show when the mouse position is not\n * available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space is rendered\n * initially and the last position is retained when the mouse leaves the viewport.\n * When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a\n * placeholder.\n * @property {boolean} [wrapX=true] Wrap the world horizontally on the projection's antimeridian, if it\n * is a global projection.\n */\n\n/**\n * @classdesc\n * A control to show the 2D coordinates of the mouse cursor. By default, these\n * are in the view projection, but can be in any supported projection.\n * By default the control is shown in the top right corner of the map, but this\n * can be changed by using the css selector `.ol-mouse-position`.\n *\n * On touch devices, which usually do not have a mouse cursor, the coordinates\n * of the currently touched position are shown.\n *\n * @api\n */\nclass MousePosition extends Control {\n /**\n * @param {Options} [options] Mouse position options.\n */\n constructor(options) {\n options = options ? options : {};\n\n const element = document.createElement('div');\n element.className =\n options.className !== undefined ? options.className : 'ol-mouse-position';\n\n super({\n element: element,\n render: options.render,\n target: options.target,\n });\n\n /***\n * @type {MousePositionOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {MousePositionOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {MousePositionOnSignature<void>}\n */\n this.un;\n\n this.addChangeListener(PROJECTION, this.handleProjectionChanged_);\n\n if (options.coordinateFormat) {\n this.setCoordinateFormat(options.coordinateFormat);\n }\n if (options.projection) {\n this.setProjection(options.projection);\n }\n\n /**\n * @private\n * @type {boolean}\n */\n this.renderOnMouseOut_ = options.placeholder !== undefined;\n\n /**\n * @private\n * @type {string}\n */\n this.placeholder_ = this.renderOnMouseOut_ ? options.placeholder : ' ';\n\n /**\n * @private\n * @type {string}\n */\n this.renderedHTML_ = element.innerHTML;\n\n /**\n * @private\n * @type {?import(\"../proj/Projection.js\").default}\n */\n this.mapProjection_ = null;\n\n /**\n * @private\n * @type {?import(\"../proj.js\").TransformFunction}\n */\n this.transform_ = null;\n\n /**\n * @private\n * @type {boolean}\n */\n this.wrapX_ = options.wrapX === false ? false : true;\n }\n\n /**\n * @private\n */\n handleProjectionChanged_() {\n this.transform_ = null;\n }\n\n /**\n * Return the coordinate format type used to render the current position or\n * undefined.\n * @return {import(\"../coordinate.js\").CoordinateFormat|undefined} The format to render the current\n * position in.\n * @observable\n * @api\n */\n getCoordinateFormat() {\n return /** @type {import(\"../coordinate.js\").CoordinateFormat|undefined} */ (\n this.get(COORDINATE_FORMAT)\n );\n }\n\n /**\n * Return the projection that is used to report the mouse position.\n * @return {import(\"../proj/Projection.js\").default|undefined} The projection to report mouse\n * position in.\n * @observable\n * @api\n */\n getProjection() {\n return /** @type {import(\"../proj/Projection.js\").default|undefined} */ (\n this.get(PROJECTION)\n );\n }\n\n /**\n * @param {MouseEvent} event Browser event.\n * @protected\n */\n handleMouseMove(event) {\n const map = this.getMap();\n this.updateHTML_(map.getEventPixel(event));\n }\n\n /**\n * @param {Event} event Browser event.\n * @protected\n */\n handleMouseOut(event) {\n this.updateHTML_(null);\n }\n\n /**\n * Remove the control from its current map and attach it to the new map.\n * Pass `null` to just remove the control from the current map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default|null} map Map.\n * @api\n * @override\n */\n setMap(map) {\n super.setMap(map);\n if (map) {\n const viewport = map.getViewport();\n this.listenerKeys.push(\n listen(viewport, EventType.POINTERMOVE, this.handleMouseMove, this),\n );\n if (this.renderOnMouseOut_) {\n this.listenerKeys.push(\n listen(viewport, EventType.POINTEROUT, this.handleMouseOut, this),\n );\n }\n this.updateHTML_(null);\n }\n }\n\n /**\n * Set the coordinate format type used to render the current position.\n * @param {import(\"../coordinate.js\").CoordinateFormat} format The format to render the current\n * position in.\n * @observable\n * @api\n */\n setCoordinateFormat(format) {\n this.set(COORDINATE_FORMAT, format);\n }\n\n /**\n * Set the projection that is used to report the mouse position.\n * @param {import(\"../proj.js\").ProjectionLike} projection The projection to report mouse\n * position in.\n * @observable\n * @api\n */\n setProjection(projection) {\n this.set(PROJECTION, getProjection(projection));\n }\n\n /**\n * @param {?import(\"../pixel.js\").Pixel} pixel Pixel.\n * @private\n */\n updateHTML_(pixel) {\n let html = this.placeholder_;\n if (pixel && this.mapProjection_) {\n if (!this.transform_) {\n const projection = this.getProjection();\n if (projection) {\n this.transform_ = getTransformFromProjections(\n this.mapProjection_,\n projection,\n );\n } else {\n this.transform_ = identityTransform;\n }\n }\n const map = this.getMap();\n const coordinate = map.getCoordinateFromPixelInternal(pixel);\n if (coordinate) {\n const userProjection = getUserProjection();\n if (userProjection) {\n this.transform_ = getTransformFromProjections(\n this.mapProjection_,\n userProjection,\n );\n }\n this.transform_(coordinate, coordinate);\n if (this.wrapX_) {\n const projection =\n userProjection || this.getProjection() || this.mapProjection_;\n wrapX(coordinate, projection);\n }\n const coordinateFormat = this.getCoordinateFormat();\n if (coordinateFormat) {\n html = coordinateFormat(coordinate);\n } else {\n html = coordinate.toString();\n }\n }\n }\n if (!this.renderedHTML_ || html !== this.renderedHTML_) {\n this.element.innerHTML = html;\n this.renderedHTML_ = html;\n }\n }\n\n /**\n * Update the projection. Rendering of the coordinates is done in\n * `handleMouseMove` and `handleMouseUp`.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @override\n */\n render(mapEvent) {\n const frameState = mapEvent.frameState;\n if (!frameState) {\n this.mapProjection_ = null;\n } else {\n if (this.mapProjection_ != frameState.viewState.projection) {\n this.mapProjection_ = frameState.viewState.projection;\n this.transform_ = null;\n }\n }\n }\n}\n\nexport default MousePosition;\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_control_ZoomToExtent_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/control/ZoomToExtent.js":
|
|
4
|
+
/*!*************************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/control/ZoomToExtent.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 _css_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../css.js */ "./node_modules/ol/css.js");
|
|
14
|
+
/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/EventType.js */ "./node_modules/ol/events/EventType.js");
|
|
15
|
+
/* harmony import */ var _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geom/Polygon.js */ "./node_modules/ol/geom/Polygon.js");
|
|
16
|
+
/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ "./node_modules/ol/proj.js");
|
|
17
|
+
/* harmony import */ var _Control_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Control.js */ "./node_modules/ol/control/Control.js");
|
|
18
|
+
/**
|
|
19
|
+
* @module ol/control/ZoomToExtent
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} Options
|
|
29
|
+
* @property {string} [className='ol-zoom-extent'] Class name.
|
|
30
|
+
* @property {HTMLElement|string} [target] Specify a target if you want the control
|
|
31
|
+
* to be rendered outside of the map's viewport.
|
|
32
|
+
* @property {string|HTMLElement} [label='E'] Text label to use for the button.
|
|
33
|
+
* Instead of text, also an element (e.g. a `span` element) can be used.
|
|
34
|
+
* @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.
|
|
35
|
+
* @property {import("../extent.js").Extent} [extent] The extent to zoom to. If undefined the validity
|
|
36
|
+
* extent of the view projection is used.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @classdesc
|
|
41
|
+
* A button control which, when pressed, changes the map view to a specific
|
|
42
|
+
* extent. To style this control use the css selector `.ol-zoom-extent`.
|
|
43
|
+
*
|
|
44
|
+
* @api
|
|
45
|
+
*/
|
|
46
|
+
class ZoomToExtent extends _Control_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
47
|
+
/**
|
|
48
|
+
* @param {Options} [options] Options.
|
|
49
|
+
*/
|
|
50
|
+
constructor(options) {
|
|
51
|
+
options = options ? options : {};
|
|
52
|
+
|
|
53
|
+
super({
|
|
54
|
+
element: document.createElement('div'),
|
|
55
|
+
target: options.target,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @type {?import("../extent.js").Extent|null}
|
|
60
|
+
* @protected
|
|
61
|
+
*/
|
|
62
|
+
this.extent = options.extent ? options.extent : null;
|
|
63
|
+
|
|
64
|
+
const className =
|
|
65
|
+
options.className !== undefined ? options.className : 'ol-zoom-extent';
|
|
66
|
+
|
|
67
|
+
const label = options.label !== undefined ? options.label : 'E';
|
|
68
|
+
const tipLabel =
|
|
69
|
+
options.tipLabel !== undefined ? options.tipLabel : 'Fit to extent';
|
|
70
|
+
const button = document.createElement('button');
|
|
71
|
+
button.setAttribute('type', 'button');
|
|
72
|
+
button.title = tipLabel;
|
|
73
|
+
button.appendChild(
|
|
74
|
+
typeof label === 'string' ? document.createTextNode(label) : label,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
button.addEventListener(
|
|
78
|
+
_events_EventType_js__WEBPACK_IMPORTED_MODULE_2__["default"].CLICK,
|
|
79
|
+
this.handleClick_.bind(this),
|
|
80
|
+
false,
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const cssClasses =
|
|
84
|
+
className + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_3__.CLASS_UNSELECTABLE + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_3__.CLASS_CONTROL;
|
|
85
|
+
const element = this.element;
|
|
86
|
+
element.className = cssClasses;
|
|
87
|
+
element.appendChild(button);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @param {MouseEvent} event The event to handle
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
handleClick_(event) {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
this.handleZoomToExtent();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @protected
|
|
101
|
+
*/
|
|
102
|
+
handleZoomToExtent() {
|
|
103
|
+
const map = this.getMap();
|
|
104
|
+
const view = map.getView();
|
|
105
|
+
const extent = !this.extent
|
|
106
|
+
? view.getProjection().getExtent()
|
|
107
|
+
: (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.fromUserExtent)(this.extent, view.getProjection());
|
|
108
|
+
view.fitInternal((0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_4__.fromExtent)(extent));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ZoomToExtent);
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/***/ })
|
|
116
|
+
|
|
117
|
+
}])
|
|
118
|
+
//# sourceMappingURL=node_modules_ol_control_ZoomToExtent_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_control_ZoomToExtent_js.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAC4D;AACb;AACoB;AACzB;AACP;;AAEnC;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC;AACA,cAAc,oBAAoB;AAClC;AACA,cAAc,QAAQ;AACtB,cAAc,+BAA+B;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAO;AAClC;AACA,aAAa,SAAS;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM,kEAAe;AACrB;AACA;AACA;;AAEA;AACA,wBAAwB,uDAAkB,SAAS,kDAAa;AAChE;AACA;AACA;AACA;;AAEA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wDAAc;AACtB,qBAAqB,4DAAiB;AACtC;AACA;;AAEA,iEAAe,YAAY,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/control/ZoomToExtent.js"],"sourcesContent":["/**\n * @module ol/control/ZoomToExtent\n */\nimport {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';\nimport EventType from '../events/EventType.js';\nimport {fromExtent as polygonFromExtent} from '../geom/Polygon.js';\nimport {fromUserExtent} from '../proj.js';\nimport Control from './Control.js';\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-zoom-extent'] Class name.\n * @property {HTMLElement|string} [target] Specify a target if you want the control\n * to be rendered outside of the map's viewport.\n * @property {string|HTMLElement} [label='E'] Text label to use for the button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.\n * @property {import(\"../extent.js\").Extent} [extent] The extent to zoom to. If undefined the validity\n * extent of the view projection is used.\n */\n\n/**\n * @classdesc\n * A button control which, when pressed, changes the map view to a specific\n * extent. To style this control use the css selector `.ol-zoom-extent`.\n *\n * @api\n */\nclass ZoomToExtent extends Control {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n\n super({\n element: document.createElement('div'),\n target: options.target,\n });\n\n /**\n * @type {?import(\"../extent.js\").Extent|null}\n * @protected\n */\n this.extent = options.extent ? options.extent : null;\n\n const className =\n options.className !== undefined ? options.className : 'ol-zoom-extent';\n\n const label = options.label !== undefined ? options.label : 'E';\n const tipLabel =\n options.tipLabel !== undefined ? options.tipLabel : 'Fit to extent';\n const button = document.createElement('button');\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(\n typeof label === 'string' ? document.createTextNode(label) : label,\n );\n\n button.addEventListener(\n EventType.CLICK,\n this.handleClick_.bind(this),\n false,\n );\n\n const cssClasses =\n className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n const element = this.element;\n element.className = cssClasses;\n element.appendChild(button);\n }\n\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n handleClick_(event) {\n event.preventDefault();\n this.handleZoomToExtent();\n }\n\n /**\n * @protected\n */\n handleZoomToExtent() {\n const map = this.getMap();\n const view = map.getView();\n const extent = !this.extent\n ? view.getProjection().getExtent()\n : fromUserExtent(this.extent, view.getProjection());\n view.fitInternal(polygonFromExtent(extent));\n }\n}\n\nexport default ZoomToExtent;\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_events_SnapEvent_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/events/SnapEvent.js":
|
|
4
|
+
/*!*********************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/events/SnapEvent.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 */ "SnapEvent": () => (/* binding */ SnapEvent),
|
|
12
|
+
/* harmony export */ "SnapEventType": () => (/* binding */ SnapEventType)
|
|
13
|
+
/* harmony export */ });
|
|
14
|
+
/* harmony import */ var _Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Event.js */ "./node_modules/ol/events/Event.js");
|
|
15
|
+
/**
|
|
16
|
+
* @module ol/events/SnapEvent
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @enum {string}
|
|
22
|
+
*/
|
|
23
|
+
const SnapEventType = {
|
|
24
|
+
/**
|
|
25
|
+
* Triggered upon snapping to vertex or edge
|
|
26
|
+
* @event SnapEvent#snap
|
|
27
|
+
* @api
|
|
28
|
+
*/
|
|
29
|
+
SNAP: 'snap',
|
|
30
|
+
UNSNAP: 'unsnap',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @classdesc
|
|
35
|
+
* Events emitted by {@link module:ol/interaction/Snap~Snap} instances are instances of this
|
|
36
|
+
*/
|
|
37
|
+
class SnapEvent extends _Event_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
38
|
+
/**
|
|
39
|
+
* @param {SnapEventType} type Type.
|
|
40
|
+
* @param {Object} options Options.
|
|
41
|
+
* @param {import("../coordinate.js").Coordinate} options.vertex The snapped vertex.
|
|
42
|
+
* @param {import("../coordinate.js").Coordinate} options.vertexPixel The pixel of the snapped vertex.
|
|
43
|
+
* @param {import("../Feature.js").default} options.feature The feature being snapped.
|
|
44
|
+
* @param {Array<import("../coordinate.js").Coordinate>|null} options.segment Segment, or `null` if snapped to a vertex.
|
|
45
|
+
*/
|
|
46
|
+
constructor(type, options) {
|
|
47
|
+
super(type);
|
|
48
|
+
/**
|
|
49
|
+
* The Map coordinate of the snapped point.
|
|
50
|
+
* @type {import("../coordinate.js").Coordinate}
|
|
51
|
+
* @api
|
|
52
|
+
*/
|
|
53
|
+
this.vertex = options.vertex;
|
|
54
|
+
/**
|
|
55
|
+
* The Map pixel of the snapped point.
|
|
56
|
+
* @type {Array<number>&Array<number>}
|
|
57
|
+
* @api
|
|
58
|
+
*/
|
|
59
|
+
this.vertexPixel = options.vertexPixel;
|
|
60
|
+
/**
|
|
61
|
+
* The feature closest to the snapped point.
|
|
62
|
+
* @type {import("../Feature.js").default<import("../geom/Geometry.js").default>}
|
|
63
|
+
* @api
|
|
64
|
+
*/
|
|
65
|
+
this.feature = options.feature;
|
|
66
|
+
/**
|
|
67
|
+
* The segment closest to the snapped point, if snapped to a segment.
|
|
68
|
+
* @type {Array<import("../coordinate.js").Coordinate>|null}
|
|
69
|
+
* @api
|
|
70
|
+
*/
|
|
71
|
+
this.segment = options.segment;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/***/ })
|
|
77
|
+
|
|
78
|
+
}])
|
|
79
|
+
//# sourceMappingURL=node_modules_ol_events_SnapEvent_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_events_SnapEvent_js.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AAC+B;;AAE/B;AACA,UAAU;AACV;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,uCAAuC;AAC7D;AACO,wBAAwB,iDAAK;AACpC;AACA,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD,aAAa,uCAAuC;AACpD,aAAa,iCAAiC;AAC9C,aAAa,mDAAmD;AAChE;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA","sources":["webpack://@vaadin/bundles/./node_modules/ol/events/SnapEvent.js"],"sourcesContent":["/**\n * @module ol/events/SnapEvent\n */\nimport Event from './Event.js';\n\n/**\n * @enum {string}\n */\nexport const SnapEventType = {\n /**\n * Triggered upon snapping to vertex or edge\n * @event SnapEvent#snap\n * @api\n */\n SNAP: 'snap',\n UNSNAP: 'unsnap',\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Snap~Snap} instances are instances of this\n */\nexport class SnapEvent extends Event {\n /**\n * @param {SnapEventType} type Type.\n * @param {Object} options Options.\n * @param {import(\"../coordinate.js\").Coordinate} options.vertex The snapped vertex.\n * @param {import(\"../coordinate.js\").Coordinate} options.vertexPixel The pixel of the snapped vertex.\n * @param {import(\"../Feature.js\").default} options.feature The feature being snapped.\n * @param {Array<import(\"../coordinate.js\").Coordinate>|null} options.segment Segment, or `null` if snapped to a vertex.\n */\n constructor(type, options) {\n super(type);\n /**\n * The Map coordinate of the snapped point.\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n this.vertex = options.vertex;\n /**\n * The Map pixel of the snapped point.\n * @type {Array<number>&Array<number>}\n * @api\n */\n this.vertexPixel = options.vertexPixel;\n /**\n * The feature closest to the snapped point.\n * @type {import(\"../Feature.js\").default<import(\"../geom/Geometry.js\").default>}\n * @api\n */\n this.feature = options.feature;\n /**\n * The segment closest to the snapped point, if snapped to a segment.\n * @type {Array<import(\"../coordinate.js\").Coordinate>|null}\n * @api\n */\n this.segment = options.segment;\n }\n}\n"],"names":[],"sourceRoot":""}
|