@vaadin/bundles 25.3.0-alpha13 → 25.3.0-alpha14

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 (105) hide show
  1. package/node_modules_vaadin_map_node_modules_ol_control_MousePosition_js.js +6 -6
  2. package/node_modules_vaadin_map_node_modules_ol_control_MousePosition_js.js.map +1 -1
  3. package/node_modules_vaadin_map_node_modules_ol_control_ZoomToExtent_js.js +10 -1
  4. package/node_modules_vaadin_map_node_modules_ol_control_ZoomToExtent_js.js.map +1 -1
  5. package/node_modules_vaadin_map_node_modules_ol_events_SnapEvent_js.js +5 -0
  6. package/node_modules_vaadin_map_node_modules_ol_events_SnapEvent_js.js.map +1 -1
  7. package/node_modules_vaadin_map_node_modules_ol_featureloader_js.js +9 -8
  8. package/node_modules_vaadin_map_node_modules_ol_featureloader_js.js.map +1 -1
  9. package/node_modules_vaadin_map_node_modules_ol_geom_GeometryCollection_js.js +1 -1
  10. package/node_modules_vaadin_map_node_modules_ol_geom_GeometryCollection_js.js.map +1 -1
  11. package/node_modules_vaadin_map_node_modules_ol_geom_flat_clip_js.js +172 -0
  12. package/node_modules_vaadin_map_node_modules_ol_geom_flat_clip_js.js.map +1 -0
  13. package/node_modules_vaadin_map_node_modules_ol_geom_flat_length_js-_95bd5.js +58 -0
  14. package/node_modules_vaadin_map_node_modules_ol_geom_flat_length_js-_95bd5.js.map +1 -0
  15. package/{node_modules_vaadin_map_node_modules_ol_render_VectorContext_js-node_modules_vaadin_map_node_-a1378d.js → node_modules_vaadin_map_node_modules_ol_geom_flat_lineoffset_js-node_modules_vaadin_map_node_-304640.js} +244 -5
  16. package/node_modules_vaadin_map_node_modules_ol_geom_flat_lineoffset_js-node_modules_vaadin_map_node_-304640.js.map +1 -0
  17. package/node_modules_vaadin_map_node_modules_ol_geom_flat_lineoffset_js-node_modules_vaadin_map_node_-7a9288.js +383 -0
  18. package/node_modules_vaadin_map_node_modules_ol_geom_flat_lineoffset_js-node_modules_vaadin_map_node_-7a9288.js.map +1 -0
  19. package/node_modules_vaadin_map_node_modules_ol_geom_flat_lineoffset_js.js +243 -0
  20. package/node_modules_vaadin_map_node_modules_ol_geom_flat_lineoffset_js.js.map +1 -0
  21. package/node_modules_vaadin_map_node_modules_ol_geom_flat_textpath_js.js +18 -5
  22. package/node_modules_vaadin_map_node_modules_ol_geom_flat_textpath_js.js.map +1 -1
  23. package/node_modules_vaadin_map_node_modules_ol_interaction_DragAndDrop_js.js +8 -8
  24. package/node_modules_vaadin_map_node_modules_ol_interaction_DragAndDrop_js.js.map +1 -1
  25. package/{node_modules_vaadin_map_node_modules_ol_render_VectorContext_js-_279c0.js → node_modules_vaadin_map_node_modules_ol_render_VectorContext_js.js} +2 -2
  26. package/node_modules_vaadin_map_node_modules_ol_render_VectorContext_js.js.map +1 -0
  27. package/node_modules_vaadin_map_node_modules_ol_render_canvas_LineStringBuilder_js.js +17 -7
  28. package/node_modules_vaadin_map_node_modules_ol_render_canvas_LineStringBuilder_js.js.map +1 -1
  29. package/node_modules_vaadin_map_node_modules_ol_render_canvas_ZIndexContext_js-_abc10.js +18 -15
  30. package/node_modules_vaadin_map_node_modules_ol_render_canvas_ZIndexContext_js-_abc10.js.map +1 -1
  31. package/node_modules_vaadin_map_node_modules_ol_render_canvas_ZIndexContext_js-_abc11.js +18 -15
  32. package/node_modules_vaadin_map_node_modules_ol_render_canvas_ZIndexContext_js-_abc11.js.map +1 -1
  33. package/node_modules_vaadin_map_node_modules_ol_renderer_Layer_js.js +21 -1
  34. package/node_modules_vaadin_map_node_modules_ol_renderer_Layer_js.js.map +1 -1
  35. package/node_modules_vaadin_map_node_modules_ol_source_Source_js.js +34 -3
  36. package/node_modules_vaadin_map_node_modules_ol_source_Source_js.js.map +1 -1
  37. package/package.json +135 -135
  38. package/vaadin-bundle.json +1824 -1812
  39. package/vaadin.js +2725 -1726
  40. package/vaadin.js.map +1 -1
  41. package/vendors-node_modules_vaadin_map_node_modules_ol_Feature_js.js +30 -16
  42. package/vendors-node_modules_vaadin_map_node_modules_ol_Feature_js.js.map +1 -1
  43. package/vendors-node_modules_vaadin_map_node_modules_ol_Overlay_js.js +6 -6
  44. package/vendors-node_modules_vaadin_map_node_modules_ol_Overlay_js.js.map +1 -1
  45. package/vendors-node_modules_vaadin_map_node_modules_ol_control_FullScreen_js.js +7 -7
  46. package/vendors-node_modules_vaadin_map_node_modules_ol_control_FullScreen_js.js.map +1 -1
  47. package/vendors-node_modules_vaadin_map_node_modules_ol_control_OverviewMap_js.js +1 -1
  48. package/vendors-node_modules_vaadin_map_node_modules_ol_control_OverviewMap_js.js.map +1 -1
  49. package/vendors-node_modules_vaadin_map_node_modules_ol_control_ScaleLine_js.js +6 -6
  50. package/vendors-node_modules_vaadin_map_node_modules_ol_control_ScaleLine_js.js.map +1 -1
  51. package/vendors-node_modules_vaadin_map_node_modules_ol_control_ZoomSlider_js.js +1 -1
  52. package/vendors-node_modules_vaadin_map_node_modules_ol_control_ZoomSlider_js.js.map +1 -1
  53. package/vendors-node_modules_vaadin_map_node_modules_ol_control_js.js +34 -25
  54. package/vendors-node_modules_vaadin_map_node_modules_ol_control_js.js.map +1 -1
  55. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Draw_js.js +146 -943
  56. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Draw_js.js.map +1 -1
  57. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Extent_js.js +111 -34
  58. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Extent_js.js.map +1 -1
  59. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Link_js.js +3 -3
  60. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Link_js.js.map +1 -1
  61. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Modify_js.js +1055 -219
  62. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Modify_js.js.map +1 -1
  63. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Select_js.js +129 -57
  64. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Select_js.js.map +1 -1
  65. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Snap_js.js +74 -80
  66. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Snap_js.js.map +1 -1
  67. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Translate_js.js +11 -11
  68. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_Translate_js.js.map +1 -1
  69. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_js.js +54 -54
  70. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_js.js.map +1 -1
  71. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_tracing_js.js +801 -0
  72. package/vendors-node_modules_vaadin_map_node_modules_ol_interaction_tracing_js.js.map +1 -0
  73. package/vendors-node_modules_vaadin_map_node_modules_ol_render_Feature_js.js +36 -20
  74. package/vendors-node_modules_vaadin_map_node_modules_ol_render_Feature_js.js.map +1 -1
  75. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_BuilderGroup_js.js +17 -279
  76. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_BuilderGroup_js.js.map +1 -1
  77. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_Builder_js.js +16 -7
  78. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_Builder_js.js.map +1 -1
  79. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_ExecutorGroup_js.js +53 -17
  80. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_ExecutorGroup_js.js.map +1 -1
  81. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_Executor_js.js +336 -38
  82. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_Executor_js.js.map +1 -1
  83. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_Immediate_js.js +75 -42
  84. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_Immediate_js.js.map +1 -1
  85. package/{node_modules_vaadin_map_node_modules_ol_render_canvas_PolygonBuilder_js.js → vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_PolygonBuilder_js.js} +77 -11
  86. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_PolygonBuilder_js.js.map +1 -0
  87. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_TextBuilder_js.js +210 -16
  88. package/vendors-node_modules_vaadin_map_node_modules_ol_render_canvas_TextBuilder_js.js.map +1 -1
  89. package/vendors-node_modules_vaadin_map_node_modules_ol_renderer_canvas_Layer_js.js +88 -32
  90. package/vendors-node_modules_vaadin_map_node_modules_ol_renderer_canvas_Layer_js.js.map +1 -1
  91. package/vendors-node_modules_vaadin_map_node_modules_ol_renderer_canvas_VectorLayer_js.js +62 -22
  92. package/vendors-node_modules_vaadin_map_node_modules_ol_renderer_canvas_VectorLayer_js.js.map +1 -1
  93. package/vendors-node_modules_vaadin_map_node_modules_ol_renderer_vector_js.js +2 -2
  94. package/vendors-node_modules_vaadin_map_node_modules_ol_renderer_vector_js.js.map +1 -1
  95. package/vendors-node_modules_vaadin_map_node_modules_ol_source_Vector_js.js +135 -81
  96. package/vendors-node_modules_vaadin_map_node_modules_ol_source_Vector_js.js.map +1 -1
  97. package/node_modules_vaadin_map_node_modules_ol_render_VectorContext_js-_279c0.js.map +0 -1
  98. package/node_modules_vaadin_map_node_modules_ol_render_VectorContext_js-_279c1.js +0 -144
  99. package/node_modules_vaadin_map_node_modules_ol_render_VectorContext_js-_279c1.js.map +0 -1
  100. package/node_modules_vaadin_map_node_modules_ol_render_VectorContext_js-node_modules_vaadin_map_node_-a1378d.js.map +0 -1
  101. package/node_modules_vaadin_map_node_modules_ol_render_canvas_PolygonBuilder_js.js.map +0 -1
  102. package/node_modules_vaadin_map_node_modules_ol_style_js.js +0 -48
  103. package/node_modules_vaadin_map_node_modules_ol_style_js.js.map +0 -1
  104. package/vendors-node_modules_vaadin_map_node_modules_ol_geom_js-node_modules_vaadin_map_node_modules_-f0f4bb.js +0 -769
  105. package/vendors-node_modules_vaadin_map_node_modules_ol_geom_js-node_modules_vaadin_map_node_modules_-f0f4bb.js.map +0 -1
@@ -37,10 +37,10 @@ const COORDINATE_FORMAT = 'coordinateFormat';
37
37
 
38
38
  /***
39
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|
40
+ * @typedef {import("../Observable.js").OnSignature<import("../Observable.js").EventTypes, import("../events/Event.js").default, Return> &
41
+ * import("../Observable.js").OnSignature<import("../ObjectEventType.js").Types|
42
+ * 'change:coordinateFormat'|'change:projection', import("../Object.js").ObjectEvent, Return> &
43
+ * import("../Observable.js").CombinedOnSignature<import("../Observable.js").EventTypes|import("../ObjectEventType.js").Types|
44
44
  * 'change:coordinateFormat'|'change:projection', Return>} MousePositionOnSignature
45
45
  */
46
46
 
@@ -93,12 +93,12 @@ class MousePosition extends _Control_js__WEBPACK_IMPORTED_MODULE_1__["default"]
93
93
  });
94
94
 
95
95
  /***
96
- * @type {MousePositionOnSignature<import("../events").EventsKey>}
96
+ * @type {MousePositionOnSignature<import("../events.js").EventsKey>}
97
97
  */
98
98
  this.on;
99
99
 
100
100
  /***
101
- * @type {MousePositionOnSignature<import("../events").EventsKey>}
101
+ * @type {MousePositionOnSignature<import("../events.js").EventsKey>}
102
102
  */
103
103
  this.once;
104
104
 
@@ -1 +1 @@
1
- {"version":3,"file":"node_modules_vaadin_map_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/@vaadin/map/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 : '&#160;';\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":""}
1
+ {"version":3,"file":"node_modules_vaadin_map_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/@vaadin/map/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.js\").OnSignature<import(\"../Observable.js\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable.js\").OnSignature<import(\"../ObjectEventType.js\").Types|\n * 'change:coordinateFormat'|'change:projection', import(\"../Object.js\").ObjectEvent, Return> &\n * import(\"../Observable.js\").CombinedOnSignature<import(\"../Observable.js\").EventTypes|import(\"../ObjectEventType.js\").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.js\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {MousePositionOnSignature<import(\"../events.js\").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 : '&#160;';\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":""}
@@ -34,6 +34,8 @@ __webpack_require__.r(__webpack_exports__);
34
34
  * @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.
35
35
  * @property {import("../extent.js").Extent} [extent] The extent to zoom to. If undefined the validity
36
36
  * extent of the view projection is used.
37
+ * @property {import("../View.js").FitOptions} [fitOptions] Options to pass to the view when fitting
38
+ * the extent (e.g. `padding`, `duration`, `minResolution`, `maxZoom`, `easing`, `callback`).
37
39
  */
38
40
 
39
41
  /**
@@ -61,6 +63,12 @@ class ZoomToExtent extends _Control_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
61
63
  */
62
64
  this.extent = options.extent ? options.extent : null;
63
65
 
66
+ /**
67
+ * @type {import("../View.js").FitOptions}
68
+ * @protected
69
+ */
70
+ this.fitOptions = options.fitOptions || {};
71
+
64
72
  const className =
65
73
  options.className !== undefined ? options.className : 'ol-zoom-extent';
66
74
 
@@ -105,7 +113,8 @@ class ZoomToExtent extends _Control_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
105
113
  const extent = !this.extent
106
114
  ? view.getProjection().getExtent()
107
115
  : (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));
116
+
117
+ view.fitInternal((0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_4__.fromExtent)(extent), this.fitOptions);
109
118
  }
110
119
  }
111
120
 
@@ -1 +1 @@
1
- {"version":3,"file":"node_modules_vaadin_map_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/@vaadin/map/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":""}
1
+ {"version":3,"file":"node_modules_vaadin_map_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,cAAc,iCAAiC;AAC/C;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,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;;AAEtB,qBAAqB,4DAAiB;AACtC;AACA;;AAEA,iEAAe,YAAY,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/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 * @property {import(\"../View.js\").FitOptions} [fitOptions] Options to pass to the view when fitting\n * the extent (e.g. `padding`, `duration`, `minResolution`, `maxZoom`, `easing`, `callback`).\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 /**\n * @type {import(\"../View.js\").FitOptions}\n * @protected\n */\n this.fitOptions = options.fitOptions || {};\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\n view.fitInternal(polygonFromExtent(extent), this.fitOptions);\n }\n}\n\nexport default ZoomToExtent;\n"],"names":[],"sourceRoot":""}
@@ -27,6 +27,11 @@ const SnapEventType = {
27
27
  * @api
28
28
  */
29
29
  SNAP: 'snap',
30
+ /**
31
+ * Triggered if no longer snapped
32
+ * @event SnapEvent#unsnap
33
+ * @api
34
+ */
30
35
  UNSNAP: 'unsnap',
31
36
  };
32
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"node_modules_vaadin_map_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/@vaadin/map/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":""}
1
+ {"version":3,"file":"node_modules_vaadin_map_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;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/@vaadin/map/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 /**\n * Triggered if no longer snapped\n * @event SnapEvent#unsnap\n * @api\n */\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":""}
@@ -27,13 +27,14 @@ let withCredentials = false;
27
27
  * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to
28
28
  * load features.
29
29
  *
30
- * This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing
31
- * the area to be loaded, a `{number}` representing the resolution (map units per pixel), a
32
- * {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get
33
- * the loaded features passed as an argument and an optional failure callback with no arguments. If
34
- * the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and
35
- * `'featuresloaderror'` events. `this` within the function is bound to the
36
- * {@link module:ol/source/Vector~VectorSource} it's called from.
30
+ * This function takes 3 arguments: an {@link module:ol/extent~Extent} representing
31
+ * the area to be loaded, a `{number}` representing the resolution (map units per pixel), and a
32
+ * {@link module:ol/proj/Projection~Projection} for the projection. The function is expeced to return
33
+ * a promise that resolves to an array of features.
34
+ *
35
+ * There are also a deprecated signature, with `void` as
36
+ * return, and two additional arguments: an optional success callback that should get
37
+ * the loaded features passed as an argument and an optional failure callback with no arguments.
37
38
  *
38
39
  * The function is responsible for loading the features and adding them to the
39
40
  * source.
@@ -44,7 +45,7 @@ let withCredentials = false;
44
45
  * resolution: number,
45
46
  * projection: import("./proj/Projection.js").default,
46
47
  * success?: (features: Array<FeatureType>) => void,
47
- * failure?: () => void) => void} FeatureLoader
48
+ * failure?: () => void) => void|Promise<Array<FeatureType>>} FeatureLoader
48
49
  * @api
49
50
  */
50
51
 
@@ -1 +1 @@
1
- {"version":3,"file":"node_modules_vaadin_map_node_modules_ol_featureloader_js.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA,wDAAwD,+BAA+B;AACvF,8BAA8B,OAAO;AACrC,IAAI,4CAA4C;AAChD;AACA;AACA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA;AACA;AACA,cAAc,oCAAoC;AAClD,aAAa;AACb;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA,2BAA2B,+BAA+B;AAC1D,qBAAqB,OAAO;AAC5B,WAAW,4CAA4C;AACvD,6BAA6B,OAAO;AACpC,aAAa,gGAAgG;AAC7G;AACA;;AAEA;AACA,cAAc,oCAAoC;AAClD,WAAW,2BAA2B;AACtC,WAAW,oDAAoD;AAC/D,WAAW,8BAA8B;AACzC,WAAW,QAAQ;AACnB,WAAW,wCAAwC;AACnD,WAAW,4EAA4E;AACvF;AACA,WAAW,kBAAkB;AAC7B;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAuC;AAC1D;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV,8BAA8B,aAAa;AAC3C;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,oCAAoC;AAClD,WAAW,2BAA2B;AACtC,WAAW,oDAAoD;AAC/D,YAAY,4BAA4B;AACxC;AACA;AACO;AACP;AACA,aAAa,8BAA8B;AAC3C,aAAa,QAAQ;AACrB,aAAa,wCAAwC;AACrD,aAAa,oCAAoC;AACjD;AACA,aAAa,kBAAkB;AAC/B;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC,iBAAiB,wCAAwC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACO;AACP;AACA","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/node_modules/ol/featureloader.js"],"sourcesContent":["/**\n * @module ol/featureloader\n */\n\n/**\n *\n * @type {boolean}\n * @private\n */\nlet withCredentials = false;\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * load features.\n *\n * This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing\n * the area to be loaded, a `{number}` representing the resolution (map units per pixel), a\n * {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get\n * the loaded features passed as an argument and an optional failure callback with no arguments. If\n * the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and\n * `'featuresloaderror'` events. `this` within the function is bound to the\n * {@link module:ol/source/Vector~VectorSource} it's called from.\n *\n * The function is responsible for loading the features and adding them to the\n * source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").FeatureLike]\n * @typedef {(\n * extent: import(\"./extent.js\").Extent,\n * resolution: number,\n * projection: import(\"./proj/Projection.js\").default,\n * success?: (features: Array<FeatureType>) => void,\n * failure?: () => void) => void} FeatureLoader\n * @api\n */\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * get the url to load features from.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area\n * to be loaded, a `{number}` representing the resolution (map units per pixel)\n * and an {@link module:ol/proj/Projection~Projection} for the projection as\n * arguments and returns a `{string}` representing the URL.\n * @typedef {function(import(\"./extent.js\").Extent, number, import(\"./proj/Projection.js\").default): string} FeatureUrlFunction\n * @api\n */\n\n/**\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default<FeatureType>} format Feature format.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<FeatureType>, import(\"./proj/Projection.js\").default): void} success Success\n * Function called with the loaded features and optionally with the data projection.\n * @param {function(): void} failure Failure\n * Function called when loading failed.\n */\nexport function loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n success,\n failure,\n) {\n const xhr = new XMLHttpRequest();\n xhr.open(\n 'GET',\n typeof url === 'function' ? url(extent, resolution, projection) : url,\n true,\n );\n if (format.getType() == 'arraybuffer') {\n xhr.responseType = 'arraybuffer';\n }\n xhr.withCredentials = withCredentials;\n /**\n * @param {Event} event Event.\n * @private\n */\n xhr.onload = function (event) {\n // status will be 0 for file:// urls\n if (!xhr.status || (xhr.status >= 200 && xhr.status < 300)) {\n const type = format.getType();\n try {\n /** @type {Document|Node|Object|string|undefined} */\n let source;\n if (type == 'text' || type == 'json') {\n source = xhr.responseText;\n } else if (type == 'xml') {\n source = xhr.responseXML || xhr.responseText;\n } else if (type == 'arraybuffer') {\n source = /** @type {ArrayBuffer} */ (xhr.response);\n }\n if (source) {\n success(\n /** @type {Array<FeatureType>} */\n (\n format.readFeatures(source, {\n extent: extent,\n featureProjection: projection,\n })\n ),\n format.readProjection(source),\n );\n } else {\n failure();\n }\n } catch {\n failure();\n }\n } else {\n failure();\n }\n };\n /**\n * @private\n */\n xhr.onerror = failure;\n xhr.send();\n}\n\n/**\n * Create an XHR feature loader for a `url` and `format`. The feature loader\n * loads features (with XHR), parses the features, and adds them to the\n * vector source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default<FeatureType>} format Feature format.\n * @return {FeatureLoader<FeatureType>} The feature loader.\n * @api\n */\nexport function xhr(url, format) {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<FeatureType>): void} [success] Success\n * Function called when loading succeeded.\n * @param {function(): void} [failure] Failure\n * Function called when loading failed.\n * @this {import(\"./source/Vector.js\").default<FeatureType>}\n */\n return function (extent, resolution, projection, success, failure) {\n loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n /**\n * @param {Array<FeatureType>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data\n * projection.\n */\n (features, dataProjection) => {\n this.addFeatures(features);\n if (success !== undefined) {\n success(features);\n }\n },\n () => {\n this.changed();\n if (failure !== undefined) {\n failure();\n }\n },\n );\n };\n}\n\n/**\n * Setter for the withCredentials configuration for the XHR.\n *\n * @param {boolean} xhrWithCredentials The value of withCredentials to set.\n * Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/\n * @api\n */\nexport function setWithCredentials(xhrWithCredentials) {\n withCredentials = xhrWithCredentials;\n}\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"node_modules_vaadin_map_node_modules_ol_featureloader_js.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA,wCAAwC,+BAA+B;AACvE,8BAA8B,OAAO;AACrC,IAAI,4CAA4C;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,oCAAoC;AAClD,aAAa;AACb;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;;AAEA;AACA,IAAI,4CAA4C;AAChD;AACA;AACA,2BAA2B,+BAA+B;AAC1D,qBAAqB,OAAO;AAC5B,WAAW,4CAA4C;AACvD,6BAA6B,OAAO;AACpC,aAAa,gGAAgG;AAC7G;AACA;;AAEA;AACA,cAAc,oCAAoC;AAClD,WAAW,2BAA2B;AACtC,WAAW,oDAAoD;AAC/D,WAAW,8BAA8B;AACzC,WAAW,QAAQ;AACnB,WAAW,wCAAwC;AACnD,WAAW,4EAA4E;AACvF;AACA,WAAW,kBAAkB;AAC7B;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAuC;AAC1D;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV,8BAA8B,aAAa;AAC3C;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,oCAAoC;AAClD,WAAW,2BAA2B;AACtC,WAAW,oDAAoD;AAC/D,YAAY,4BAA4B;AACxC;AACA;AACO;AACP;AACA,aAAa,8BAA8B;AAC3C,aAAa,QAAQ;AACrB,aAAa,wCAAwC;AACrD,aAAa,oCAAoC;AACjD;AACA,aAAa,kBAAkB;AAC/B;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC,iBAAiB,wCAAwC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACO;AACP;AACA","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/node_modules/ol/featureloader.js"],"sourcesContent":["/**\n * @module ol/featureloader\n */\n\n/**\n *\n * @type {boolean}\n * @private\n */\nlet withCredentials = false;\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * load features.\n *\n * This function takes 3 arguments: an {@link module:ol/extent~Extent} representing\n * the area to be loaded, a `{number}` representing the resolution (map units per pixel), and a\n * {@link module:ol/proj/Projection~Projection} for the projection. The function is expeced to return\n * a promise that resolves to an array of features.\n *\n * There are also a deprecated signature, with `void` as\n * return, and two additional arguments: an optional success callback that should get\n * the loaded features passed as an argument and an optional failure callback with no arguments.\n *\n * The function is responsible for loading the features and adding them to the\n * source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").FeatureLike]\n * @typedef {(\n * extent: import(\"./extent.js\").Extent,\n * resolution: number,\n * projection: import(\"./proj/Projection.js\").default,\n * success?: (features: Array<FeatureType>) => void,\n * failure?: () => void) => void|Promise<Array<FeatureType>>} FeatureLoader\n * @api\n */\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * get the url to load features from.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area\n * to be loaded, a `{number}` representing the resolution (map units per pixel)\n * and an {@link module:ol/proj/Projection~Projection} for the projection as\n * arguments and returns a `{string}` representing the URL.\n * @typedef {function(import(\"./extent.js\").Extent, number, import(\"./proj/Projection.js\").default): string} FeatureUrlFunction\n * @api\n */\n\n/**\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default<FeatureType>} format Feature format.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<FeatureType>, import(\"./proj/Projection.js\").default): void} success Success\n * Function called with the loaded features and optionally with the data projection.\n * @param {function(): void} failure Failure\n * Function called when loading failed.\n */\nexport function loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n success,\n failure,\n) {\n const xhr = new XMLHttpRequest();\n xhr.open(\n 'GET',\n typeof url === 'function' ? url(extent, resolution, projection) : url,\n true,\n );\n if (format.getType() == 'arraybuffer') {\n xhr.responseType = 'arraybuffer';\n }\n xhr.withCredentials = withCredentials;\n /**\n * @param {Event} event Event.\n * @private\n */\n xhr.onload = function (event) {\n // status will be 0 for file:// urls\n if (!xhr.status || (xhr.status >= 200 && xhr.status < 300)) {\n const type = format.getType();\n try {\n /** @type {Document|Node|Object|string|undefined} */\n let source;\n if (type == 'text' || type == 'json') {\n source = xhr.responseText;\n } else if (type == 'xml') {\n source = xhr.responseXML || xhr.responseText;\n } else if (type == 'arraybuffer') {\n source = /** @type {ArrayBuffer} */ (xhr.response);\n }\n if (source) {\n success(\n /** @type {Array<FeatureType>} */\n (\n format.readFeatures(source, {\n extent: extent,\n featureProjection: projection,\n })\n ),\n format.readProjection(source),\n );\n } else {\n failure();\n }\n } catch {\n failure();\n }\n } else {\n failure();\n }\n };\n /**\n * @private\n */\n xhr.onerror = failure;\n xhr.send();\n}\n\n/**\n * Create an XHR feature loader for a `url` and `format`. The feature loader\n * loads features (with XHR), parses the features, and adds them to the\n * vector source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default<FeatureType>} format Feature format.\n * @return {FeatureLoader<FeatureType>} The feature loader.\n * @api\n */\nexport function xhr(url, format) {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<FeatureType>): void} [success] Success\n * Function called when loading succeeded.\n * @param {function(): void} [failure] Failure\n * Function called when loading failed.\n * @this {import(\"./source/Vector.js\").default<FeatureType>}\n */\n return function (extent, resolution, projection, success, failure) {\n loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n /**\n * @param {Array<FeatureType>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data\n * projection.\n */\n (features, dataProjection) => {\n this.addFeatures(features);\n if (success !== undefined) {\n success(features);\n }\n },\n () => {\n this.changed();\n if (failure !== undefined) {\n failure();\n }\n },\n );\n };\n}\n\n/**\n * Setter for the withCredentials configuration for the XHR.\n *\n * @param {boolean} xhrWithCredentials The value of withCredentials to set.\n * Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/\n * @api\n */\nexport function setWithCredentials(xhrWithCredentials) {\n withCredentials = xhrWithCredentials;\n}\n"],"names":[],"sourceRoot":""}
@@ -10,8 +10,8 @@ __webpack_require__.r(__webpack_exports__);
10
10
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
11
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
12
12
  /* harmony export */ });
13
- /* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/EventType.js */ "./node_modules/@vaadin/map/node_modules/ol/events/EventType.js");
14
13
  /* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events.js */ "./node_modules/@vaadin/map/node_modules/ol/events.js");
14
+ /* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/EventType.js */ "./node_modules/@vaadin/map/node_modules/ol/events/EventType.js");
15
15
  /* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../extent.js */ "./node_modules/@vaadin/map/node_modules/ol/extent.js");
16
16
  /* harmony import */ var _Geometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Geometry.js */ "./node_modules/@vaadin/map/node_modules/ol/geom/Geometry.js");
17
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"node_modules_vaadin_map_node_modules_ol_geom_GeometryCollection_js.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAC+C;AACI;AAM7B;AACe;;AAErC;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA,iCAAiC,oDAAQ;AACzC;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,qDAAa;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA,QAAQ,kDAAM,gBAAgB,mEAAgB;AAC9C;AACA;AACA;;AAEA;AACA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA,6BAA6B,oEAAwB;AACrD;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,+BAA+B;AAC5C;AACA,cAAc,+BAA+B;AAC7C;AACA;AACA;AACA,IAAI,+DAAmB;AACvB;AACA,4CAA4C,QAAQ;AACpD,MAAM,kDAAM;AACZ;AACA;AACA;;AAEA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;;AAEA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,8BAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,+BAA+B;AAC5C,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qDAAS;AACxB;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,iBAAiB;AAC5B,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;;AAEA,iEAAe,kBAAkB,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/node_modules/ol/geom/GeometryCollection.js"],"sourcesContent":["/**\n * @module ol/geom/GeometryCollection\n */\nimport EventType from '../events/EventType.js';\nimport {listen, unlistenByKey} from '../events.js';\nimport {\n closestSquaredDistanceXY,\n createOrUpdateEmpty,\n extend,\n getCenter,\n} from '../extent.js';\nimport Geometry from './Geometry.js';\n\n/**\n * @classdesc\n * An array of {@link module:ol/geom/Geometry~Geometry} objects.\n *\n * @api\n */\nclass GeometryCollection extends Geometry {\n /**\n * @param {Array<Geometry>} geometries Geometries.\n */\n constructor(geometries) {\n super();\n\n /**\n * @private\n * @type {Array<Geometry>}\n */\n this.geometries_ = geometries;\n\n /**\n * @private\n * @type {Array<import(\"../events.js\").EventsKey>}\n */\n this.changeEventsKeys_ = [];\n\n this.listenGeometriesChange_();\n }\n\n /**\n * @private\n */\n unlistenGeometriesChange_() {\n this.changeEventsKeys_.forEach(unlistenByKey);\n this.changeEventsKeys_.length = 0;\n }\n\n /**\n * @private\n */\n listenGeometriesChange_() {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n this.changeEventsKeys_.push(\n listen(geometries[i], EventType.CHANGE, this.changed, this),\n );\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!GeometryCollection} Clone.\n * @api\n * @override\n */\n clone() {\n const geometryCollection = new GeometryCollection(\n cloneGeometries(this.geometries_),\n );\n geometryCollection.applyProperties(this);\n return geometryCollection;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n minSquaredDistance = geometries[i].closestPointXY(\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n return minSquaredDistance;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n * @override\n */\n containsXY(x, y) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].containsXY(x, y)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @override\n */\n computeExtent(extent) {\n createOrUpdateEmpty(extent);\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n extend(extent, geometries[i].getExtent());\n }\n return extent;\n }\n\n /**\n * Return the geometries that make up this geometry collection.\n * @return {Array<Geometry>} Geometries.\n * @api\n */\n getGeometries() {\n return cloneGeometries(this.geometries_);\n }\n\n /**\n * @return {Array<Geometry>} Geometries.\n */\n getGeometriesArray() {\n return this.geometries_;\n }\n\n /**\n * @return {Array<Geometry>} Geometries.\n */\n getGeometriesArrayRecursive() {\n /** @type {Array<Geometry>} */\n let geometriesArray = [];\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].getType() === this.getType()) {\n geometriesArray = geometriesArray.concat(\n /** @type {GeometryCollection} */ (\n geometries[i]\n ).getGeometriesArrayRecursive(),\n );\n } else {\n geometriesArray.push(geometries[i]);\n }\n }\n return geometriesArray;\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {GeometryCollection} Simplified GeometryCollection.\n * @override\n */\n getSimplifiedGeometry(squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n if (\n squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance < this.simplifiedGeometryMaxMinSquaredTolerance)\n ) {\n return this;\n }\n\n const simplifiedGeometries = [];\n const geometries = this.geometries_;\n let simplified = false;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n const geometry = geometries[i];\n const simplifiedGeometry =\n geometry.getSimplifiedGeometry(squaredTolerance);\n simplifiedGeometries.push(simplifiedGeometry);\n if (simplifiedGeometry !== geometry) {\n simplified = true;\n }\n }\n if (simplified) {\n const simplifiedGeometryCollection = new GeometryCollection(\n simplifiedGeometries,\n );\n return simplifiedGeometryCollection;\n }\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'GeometryCollection';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].intersectsExtent(extent)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return this.geometries_.length === 0;\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n * @override\n */\n rotate(angle, anchor) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].rotate(angle, anchor);\n }\n this.changed();\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n * @override\n */\n scale(sx, sy, anchor) {\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].scale(sx, sy, anchor);\n }\n this.changed();\n }\n\n /**\n * Set the geometries that make up this geometry collection.\n * @param {Array<Geometry>} geometries Geometries.\n * @api\n */\n setGeometries(geometries) {\n this.setGeometriesArray(cloneGeometries(geometries));\n }\n\n /**\n * @param {Array<Geometry>} geometries Geometries.\n */\n setGeometriesArray(geometries) {\n this.unlistenGeometriesChange_();\n this.geometries_ = geometries;\n this.listenGeometriesChange_();\n this.changed();\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n * @override\n */\n applyTransform(transformFn) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].applyTransform(transformFn);\n }\n this.changed();\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n * @override\n */\n translate(deltaX, deltaY) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].translate(deltaX, deltaY);\n }\n this.changed();\n }\n\n /**\n * Clean up.\n * @override\n */\n disposeInternal() {\n this.unlistenGeometriesChange_();\n super.disposeInternal();\n }\n}\n\n/**\n * @param {Array<Geometry>} geometries Geometries.\n * @return {Array<Geometry>} Cloned geometries.\n */\nfunction cloneGeometries(geometries) {\n return geometries.map((geometry) => geometry.clone());\n}\n\nexport default GeometryCollection;\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"node_modules_vaadin_map_node_modules_ol_geom_GeometryCollection_js.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACmD;AACJ;AAMzB;AACe;;AAErC;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA,iCAAiC,oDAAQ;AACzC;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,qDAAa;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA,QAAQ,kDAAM,gBAAgB,mEAAgB;AAC9C;AACA;AACA;;AAEA;AACA;AACA,cAAc,qBAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA,6BAA6B,oEAAwB;AACrD;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,+BAA+B;AAC5C;AACA,cAAc,+BAA+B;AAC7C;AACA;AACA;AACA,IAAI,+DAAmB;AACvB;AACA,4CAA4C,QAAQ;AACpD,MAAM,kDAAM;AACZ;AACA;AACA;;AAEA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;;AAEA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,8BAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,+BAA+B;AAC5C,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qDAAS;AACxB;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,iBAAiB;AAC5B,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;;AAEA,iEAAe,kBAAkB,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/node_modules/ol/geom/GeometryCollection.js"],"sourcesContent":["/**\n * @module ol/geom/GeometryCollection\n */\nimport {listen, unlistenByKey} from '../events.js';\nimport EventType from '../events/EventType.js';\nimport {\n closestSquaredDistanceXY,\n createOrUpdateEmpty,\n extend,\n getCenter,\n} from '../extent.js';\nimport Geometry from './Geometry.js';\n\n/**\n * @classdesc\n * An array of {@link module:ol/geom/Geometry~Geometry} objects.\n *\n * @api\n */\nclass GeometryCollection extends Geometry {\n /**\n * @param {Array<Geometry>} geometries Geometries.\n */\n constructor(geometries) {\n super();\n\n /**\n * @private\n * @type {Array<Geometry>}\n */\n this.geometries_ = geometries;\n\n /**\n * @private\n * @type {Array<import(\"../events.js\").EventsKey>}\n */\n this.changeEventsKeys_ = [];\n\n this.listenGeometriesChange_();\n }\n\n /**\n * @private\n */\n unlistenGeometriesChange_() {\n this.changeEventsKeys_.forEach(unlistenByKey);\n this.changeEventsKeys_.length = 0;\n }\n\n /**\n * @private\n */\n listenGeometriesChange_() {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n this.changeEventsKeys_.push(\n listen(geometries[i], EventType.CHANGE, this.changed, this),\n );\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!GeometryCollection} Clone.\n * @api\n * @override\n */\n clone() {\n const geometryCollection = new GeometryCollection(\n cloneGeometries(this.geometries_),\n );\n geometryCollection.applyProperties(this);\n return geometryCollection;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n minSquaredDistance = geometries[i].closestPointXY(\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n return minSquaredDistance;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n * @override\n */\n containsXY(x, y) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].containsXY(x, y)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @override\n */\n computeExtent(extent) {\n createOrUpdateEmpty(extent);\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n extend(extent, geometries[i].getExtent());\n }\n return extent;\n }\n\n /**\n * Return the geometries that make up this geometry collection.\n * @return {Array<Geometry>} Geometries.\n * @api\n */\n getGeometries() {\n return cloneGeometries(this.geometries_);\n }\n\n /**\n * @return {Array<Geometry>} Geometries.\n */\n getGeometriesArray() {\n return this.geometries_;\n }\n\n /**\n * @return {Array<Geometry>} Geometries.\n */\n getGeometriesArrayRecursive() {\n /** @type {Array<Geometry>} */\n let geometriesArray = [];\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].getType() === this.getType()) {\n geometriesArray = geometriesArray.concat(\n /** @type {GeometryCollection} */ (\n geometries[i]\n ).getGeometriesArrayRecursive(),\n );\n } else {\n geometriesArray.push(geometries[i]);\n }\n }\n return geometriesArray;\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {GeometryCollection} Simplified GeometryCollection.\n * @override\n */\n getSimplifiedGeometry(squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n if (\n squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance < this.simplifiedGeometryMaxMinSquaredTolerance)\n ) {\n return this;\n }\n\n const simplifiedGeometries = [];\n const geometries = this.geometries_;\n let simplified = false;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n const geometry = geometries[i];\n const simplifiedGeometry =\n geometry.getSimplifiedGeometry(squaredTolerance);\n simplifiedGeometries.push(simplifiedGeometry);\n if (simplifiedGeometry !== geometry) {\n simplified = true;\n }\n }\n if (simplified) {\n const simplifiedGeometryCollection = new GeometryCollection(\n simplifiedGeometries,\n );\n return simplifiedGeometryCollection;\n }\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'GeometryCollection';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].intersectsExtent(extent)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return this.geometries_.length === 0;\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n * @override\n */\n rotate(angle, anchor) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].rotate(angle, anchor);\n }\n this.changed();\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n * @override\n */\n scale(sx, sy, anchor) {\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].scale(sx, sy, anchor);\n }\n this.changed();\n }\n\n /**\n * Set the geometries that make up this geometry collection.\n * @param {Array<Geometry>} geometries Geometries.\n * @api\n */\n setGeometries(geometries) {\n this.setGeometriesArray(cloneGeometries(geometries));\n }\n\n /**\n * @param {Array<Geometry>} geometries Geometries.\n */\n setGeometriesArray(geometries) {\n this.unlistenGeometriesChange_();\n this.geometries_ = geometries;\n this.listenGeometriesChange_();\n this.changed();\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n * @override\n */\n applyTransform(transformFn) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].applyTransform(transformFn);\n }\n this.changed();\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n * @override\n */\n translate(deltaX, deltaY) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].translate(deltaX, deltaY);\n }\n this.changed();\n }\n\n /**\n * Clean up.\n * @override\n */\n disposeInternal() {\n this.unlistenGeometriesChange_();\n super.disposeInternal();\n }\n}\n\n/**\n * @param {Array<Geometry>} geometries Geometries.\n * @return {Array<Geometry>} Cloned geometries.\n */\nfunction cloneGeometries(geometries) {\n return geometries.map((geometry) => geometry.clone());\n}\n\nexport default GeometryCollection;\n"],"names":[],"sourceRoot":""}
@@ -0,0 +1,172 @@
1
+ (self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_vaadin_map_node_modules_ol_geom_flat_clip_js"],{
2
+
3
+ /***/ "./node_modules/@vaadin/map/node_modules/ol/geom/flat/clip.js":
4
+ /*!********************************************************************!*\
5
+ !*** ./node_modules/@vaadin/map/node_modules/ol/geom/flat/clip.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 */ "clipFlatLineStrings": () => (/* binding */ clipFlatLineStrings)
12
+ /* harmony export */ });
13
+ /**
14
+ * @module ol/geom/flat/clip
15
+ */
16
+
17
+ /**
18
+ * Start parameter of the portion of the last clipped segment that is inside the
19
+ * extent. Set by {@link clipSegment}, read right after a `true` return to avoid
20
+ * allocating a result array per segment.
21
+ * @type {number}
22
+ */
23
+ let clipSegmentStart = 0;
24
+
25
+ /**
26
+ * End parameter of the portion of the last clipped segment that is inside the
27
+ * extent. See {@link clipSegmentStart}.
28
+ * @type {number}
29
+ */
30
+ let clipSegmentEnd = 1;
31
+
32
+ /**
33
+ * Clip a segment to a rectangular extent. On a `true` return, the inside
34
+ * portion is `[clipSegmentStart, clipSegmentEnd]` in segment parameters. No
35
+ * allocations are made, so the result globals must be read before the next
36
+ * call.
37
+ * @param {number} minX Minimum X.
38
+ * @param {number} minY Minimum Y.
39
+ * @param {number} maxX Maximum X.
40
+ * @param {number} maxY Maximum Y.
41
+ * @param {number} x0 Segment start X.
42
+ * @param {number} y0 Segment start Y.
43
+ * @param {number} x1 Segment end X.
44
+ * @param {number} y1 Segment end Y.
45
+ * @return {boolean} The segment intersects the extent.
46
+ */
47
+ function clipSegment(minX, minY, maxX, maxY, x0, y0, x1, y1) {
48
+ const dx = x1 - x0;
49
+ const dy = y1 - y0;
50
+ let t0 = 0;
51
+ let t1 = 1;
52
+
53
+ // X slab.
54
+ if (dx === 0) {
55
+ if (x0 < minX || x0 > maxX) {
56
+ return false;
57
+ }
58
+ } else {
59
+ let ta = (minX - x0) / dx;
60
+ let tb = (maxX - x0) / dx;
61
+ if (ta > tb) {
62
+ const tmp = ta;
63
+ ta = tb;
64
+ tb = tmp;
65
+ }
66
+ if (ta > t0) {
67
+ t0 = ta;
68
+ }
69
+ if (tb < t1) {
70
+ t1 = tb;
71
+ }
72
+ if (t0 > t1) {
73
+ return false;
74
+ }
75
+ }
76
+
77
+ // Y slab.
78
+ if (dy === 0) {
79
+ if (y0 < minY || y0 > maxY) {
80
+ return false;
81
+ }
82
+ } else {
83
+ let ta = (minY - y0) / dy;
84
+ let tb = (maxY - y0) / dy;
85
+ if (ta > tb) {
86
+ const tmp = ta;
87
+ ta = tb;
88
+ tb = tmp;
89
+ }
90
+ if (ta > t0) {
91
+ t0 = ta;
92
+ }
93
+ if (tb < t1) {
94
+ t1 = tb;
95
+ }
96
+ if (t0 > t1) {
97
+ return false;
98
+ }
99
+ }
100
+
101
+ clipSegmentStart = t0;
102
+ clipSegmentEnd = t1;
103
+ return true;
104
+ }
105
+
106
+ /**
107
+ * Clip flat line strings to the given extent. Parts outside the extent are
108
+ * dropped and a vertex is inserted where a segment crosses the boundary. A line
109
+ * that leaves and re-enters the extent is split into separate parts so that
110
+ * positions derived from the result (e.g. labels placed along the line) stay
111
+ * within the extent. Output coordinates have a stride of 2.
112
+ * @param {Array<number>} flatCoordinates Flat coordinates.
113
+ * @param {Array<number>} ends Ends.
114
+ * @param {number} stride Stride.
115
+ * @param {import("../../extent.js").Extent} extent Extent to clip to.
116
+ * @return {{flatCoordinates: Array<number>, ends: Array<number>}} Clipped flat
117
+ * coordinates and ends.
118
+ */
119
+ function clipFlatLineStrings(flatCoordinates, ends, stride, extent) {
120
+ const minX = extent[0];
121
+ const minY = extent[1];
122
+ const maxX = extent[2];
123
+ const maxY = extent[3];
124
+ const dest = [];
125
+ const destEnds = [];
126
+ let open = false;
127
+ let lastX, lastY;
128
+ let offset = 0;
129
+ for (let e = 0, ee = ends.length; e < ee; ++e) {
130
+ const end = ends[e];
131
+ let prevX = flatCoordinates[offset];
132
+ let prevY = flatCoordinates[offset + 1];
133
+ let lineHasLast = false;
134
+ for (let i = offset + stride; i < end; i += stride) {
135
+ const curX = flatCoordinates[i];
136
+ const curY = flatCoordinates[i + 1];
137
+ if (clipSegment(minX, minY, maxX, maxY, prevX, prevY, curX, curY)) {
138
+ const dx = curX - prevX;
139
+ const dy = curY - prevY;
140
+ const ax = prevX + clipSegmentStart * dx;
141
+ const ay = prevY + clipSegmentStart * dy;
142
+ const bx = prevX + clipSegmentEnd * dx;
143
+ const by = prevY + clipSegmentEnd * dy;
144
+ if (open && lineHasLast && ax === lastX && ay === lastY) {
145
+ dest.push(bx, by);
146
+ } else {
147
+ if (open) {
148
+ destEnds.push(dest.length);
149
+ }
150
+ dest.push(ax, ay, bx, by);
151
+ open = true;
152
+ }
153
+ lastX = bx;
154
+ lastY = by;
155
+ lineHasLast = true;
156
+ }
157
+ prevX = curX;
158
+ prevY = curY;
159
+ }
160
+ offset = end;
161
+ }
162
+ if (open) {
163
+ destEnds.push(dest.length);
164
+ }
165
+ return {flatCoordinates: dest, ends: destEnds};
166
+ }
167
+
168
+
169
+ /***/ })
170
+
171
+ }])
172
+ //# sourceMappingURL=node_modules_vaadin_map_node_modules_ol_geom_flat_clip_js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node_modules_vaadin_map_node_modules_ol_geom_flat_clip_js.js","mappings":";;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,gBAAgB,uBAAuB;AACvC,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,WAAW,kCAAkC;AAC7C,aAAa,sDAAsD;AACnE;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA,kCAAkC,SAAS;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/node_modules/ol/geom/flat/clip.js"],"sourcesContent":["/**\n * @module ol/geom/flat/clip\n */\n\n/**\n * Start parameter of the portion of the last clipped segment that is inside the\n * extent. Set by {@link clipSegment}, read right after a `true` return to avoid\n * allocating a result array per segment.\n * @type {number}\n */\nlet clipSegmentStart = 0;\n\n/**\n * End parameter of the portion of the last clipped segment that is inside the\n * extent. See {@link clipSegmentStart}.\n * @type {number}\n */\nlet clipSegmentEnd = 1;\n\n/**\n * Clip a segment to a rectangular extent. On a `true` return, the inside\n * portion is `[clipSegmentStart, clipSegmentEnd]` in segment parameters. No\n * allocations are made, so the result globals must be read before the next\n * call.\n * @param {number} minX Minimum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxX Maximum X.\n * @param {number} maxY Maximum Y.\n * @param {number} x0 Segment start X.\n * @param {number} y0 Segment start Y.\n * @param {number} x1 Segment end X.\n * @param {number} y1 Segment end Y.\n * @return {boolean} The segment intersects the extent.\n */\nfunction clipSegment(minX, minY, maxX, maxY, x0, y0, x1, y1) {\n const dx = x1 - x0;\n const dy = y1 - y0;\n let t0 = 0;\n let t1 = 1;\n\n // X slab.\n if (dx === 0) {\n if (x0 < minX || x0 > maxX) {\n return false;\n }\n } else {\n let ta = (minX - x0) / dx;\n let tb = (maxX - x0) / dx;\n if (ta > tb) {\n const tmp = ta;\n ta = tb;\n tb = tmp;\n }\n if (ta > t0) {\n t0 = ta;\n }\n if (tb < t1) {\n t1 = tb;\n }\n if (t0 > t1) {\n return false;\n }\n }\n\n // Y slab.\n if (dy === 0) {\n if (y0 < minY || y0 > maxY) {\n return false;\n }\n } else {\n let ta = (minY - y0) / dy;\n let tb = (maxY - y0) / dy;\n if (ta > tb) {\n const tmp = ta;\n ta = tb;\n tb = tmp;\n }\n if (ta > t0) {\n t0 = ta;\n }\n if (tb < t1) {\n t1 = tb;\n }\n if (t0 > t1) {\n return false;\n }\n }\n\n clipSegmentStart = t0;\n clipSegmentEnd = t1;\n return true;\n}\n\n/**\n * Clip flat line strings to the given extent. Parts outside the extent are\n * dropped and a vertex is inserted where a segment crosses the boundary. A line\n * that leaves and re-enters the extent is split into separate parts so that\n * positions derived from the result (e.g. labels placed along the line) stay\n * within the extent. Output coordinates have a stride of 2.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent to clip to.\n * @return {{flatCoordinates: Array<number>, ends: Array<number>}} Clipped flat\n * coordinates and ends.\n */\nexport function clipFlatLineStrings(flatCoordinates, ends, stride, extent) {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const dest = [];\n const destEnds = [];\n let open = false;\n let lastX, lastY;\n let offset = 0;\n for (let e = 0, ee = ends.length; e < ee; ++e) {\n const end = ends[e];\n let prevX = flatCoordinates[offset];\n let prevY = flatCoordinates[offset + 1];\n let lineHasLast = false;\n for (let i = offset + stride; i < end; i += stride) {\n const curX = flatCoordinates[i];\n const curY = flatCoordinates[i + 1];\n if (clipSegment(minX, minY, maxX, maxY, prevX, prevY, curX, curY)) {\n const dx = curX - prevX;\n const dy = curY - prevY;\n const ax = prevX + clipSegmentStart * dx;\n const ay = prevY + clipSegmentStart * dy;\n const bx = prevX + clipSegmentEnd * dx;\n const by = prevY + clipSegmentEnd * dy;\n if (open && lineHasLast && ax === lastX && ay === lastY) {\n dest.push(bx, by);\n } else {\n if (open) {\n destEnds.push(dest.length);\n }\n dest.push(ax, ay, bx, by);\n open = true;\n }\n lastX = bx;\n lastY = by;\n lineHasLast = true;\n }\n prevX = curX;\n prevY = curY;\n }\n offset = end;\n }\n if (open) {\n destEnds.push(dest.length);\n }\n return {flatCoordinates: dest, ends: destEnds};\n}\n"],"names":[],"sourceRoot":""}
@@ -0,0 +1,58 @@
1
+ (self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_vaadin_map_node_modules_ol_geom_flat_length_js-_95bd5"],{
2
+
3
+ /***/ "./node_modules/@vaadin/map/node_modules/ol/geom/flat/length.js":
4
+ /*!**********************************************************************!*\
5
+ !*** ./node_modules/@vaadin/map/node_modules/ol/geom/flat/length.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 */ "lineStringLength": () => (/* binding */ lineStringLength),
12
+ /* harmony export */ "linearRingLength": () => (/* binding */ linearRingLength)
13
+ /* harmony export */ });
14
+ /**
15
+ * @module ol/geom/flat/length
16
+ */
17
+
18
+ /**
19
+ * @param {Array<number>} flatCoordinates Flat coordinates.
20
+ * @param {number} offset Offset.
21
+ * @param {number} end End.
22
+ * @param {number} stride Stride.
23
+ * @return {number} Length.
24
+ */
25
+ function lineStringLength(flatCoordinates, offset, end, stride) {
26
+ let x1 = flatCoordinates[offset];
27
+ let y1 = flatCoordinates[offset + 1];
28
+ let length = 0;
29
+ for (let i = offset + stride; i < end; i += stride) {
30
+ const x2 = flatCoordinates[i];
31
+ const y2 = flatCoordinates[i + 1];
32
+ length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
33
+ x1 = x2;
34
+ y1 = y2;
35
+ }
36
+ return length;
37
+ }
38
+
39
+ /**
40
+ * @param {Array<number>} flatCoordinates Flat coordinates.
41
+ * @param {number} offset Offset.
42
+ * @param {number} end End.
43
+ * @param {number} stride Stride.
44
+ * @return {number} Perimeter.
45
+ */
46
+ function linearRingLength(flatCoordinates, offset, end, stride) {
47
+ let perimeter = lineStringLength(flatCoordinates, offset, end, stride);
48
+ const dx = flatCoordinates[end - stride] - flatCoordinates[offset];
49
+ const dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1];
50
+ perimeter += Math.sqrt(dx * dx + dy * dy);
51
+ return perimeter;
52
+ }
53
+
54
+
55
+ /***/ })
56
+
57
+ }])
58
+ //# sourceMappingURL=node_modules_vaadin_map_node_modules_ol_geom_flat_length_js-_95bd5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node_modules_vaadin_map_node_modules_ol_geom_flat_length_js-_95bd5.js","mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACO;AACP;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACO;AACP;AACA;AACA;AACA;AACA;AACA","sources":["webpack://@vaadin/bundles/./node_modules/@vaadin/map/node_modules/ol/geom/flat/length.js"],"sourcesContent":["/**\n * @module ol/geom/flat/length\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Length.\n */\nexport function lineStringLength(flatCoordinates, offset, end, stride) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n let length = 0;\n for (let i = offset + stride; i < end; i += stride) {\n const x2 = flatCoordinates[i];\n const y2 = flatCoordinates[i + 1];\n length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n x1 = x2;\n y1 = y2;\n }\n return length;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Perimeter.\n */\nexport function linearRingLength(flatCoordinates, offset, end, stride) {\n let perimeter = lineStringLength(flatCoordinates, offset, end, stride);\n const dx = flatCoordinates[end - stride] - flatCoordinates[offset];\n const dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1];\n perimeter += Math.sqrt(dx * dx + dy * dy);\n return perimeter;\n}\n"],"names":[],"sourceRoot":""}