@vaadin/bundles 25.0.0-alpha3 → 25.0.0-alpha5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules_ol_ImageCanvas_js.js +76 -83
- package/node_modules_ol_ImageCanvas_js.js.map +1 -1
- package/node_modules_ol_TileRange_js.js +128 -110
- package/node_modules_ol_TileRange_js.js.map +1 -1
- package/node_modules_ol_Tile_js.js +279 -0
- package/node_modules_ol_Tile_js.js.map +1 -0
- package/node_modules_ol_VectorRenderTile_js.js +428 -143
- package/node_modules_ol_VectorRenderTile_js.js.map +1 -1
- package/node_modules_ol_VectorTile_js.js +405 -119
- package/node_modules_ol_VectorTile_js.js.map +1 -1
- package/node_modules_ol_control_MousePosition_js.js +327 -0
- package/node_modules_ol_control_MousePosition_js.js.map +1 -0
- package/node_modules_ol_control_ZoomToExtent_js.js +118 -0
- package/node_modules_ol_control_ZoomToExtent_js.js.map +1 -0
- package/node_modules_ol_events_SnapEvent_js.js +79 -0
- package/node_modules_ol_events_SnapEvent_js.js.map +1 -0
- package/node_modules_ol_featureloader_js.js +205 -0
- package/node_modules_ol_featureloader_js.js.map +1 -0
- package/node_modules_ol_geom_Circle_js.js +300 -0
- package/node_modules_ol_geom_Circle_js.js.map +1 -0
- package/node_modules_ol_geom_GeometryCollection_js.js +369 -0
- package/node_modules_ol_geom_GeometryCollection_js.js.map +1 -0
- package/node_modules_ol_geom_MultiPoint_js.js +228 -0
- package/node_modules_ol_geom_MultiPoint_js.js.map +1 -0
- package/node_modules_ol_geom_flat_center_js.js +47 -0
- package/node_modules_ol_geom_flat_center_js.js.map +1 -0
- package/node_modules_ol_geom_flat_geodesic_js.js +123 -88
- package/node_modules_ol_geom_flat_geodesic_js.js.map +1 -1
- package/node_modules_ol_geom_flat_interpolate_js.js +230 -0
- package/node_modules_ol_geom_flat_interpolate_js.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a0.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a0.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a1.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a1.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a2.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a2.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a3.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a3.js.map +1 -0
- package/node_modules_ol_geom_flat_length_js-_375a4.js +58 -0
- package/node_modules_ol_geom_flat_length_js-_375a4.js.map +1 -0
- package/node_modules_ol_geom_flat_linechunk_js.js +76 -0
- package/node_modules_ol_geom_flat_linechunk_js.js.map +1 -0
- package/node_modules_ol_geom_flat_straightchunk_js.js +68 -0
- package/node_modules_ol_geom_flat_straightchunk_js.js.map +1 -0
- package/node_modules_ol_geom_flat_textpath_js.js +178 -0
- package/node_modules_ol_geom_flat_textpath_js.js.map +1 -0
- package/node_modules_ol_interaction_DblClickDragZoom_js.js +285 -0
- package/node_modules_ol_interaction_DblClickDragZoom_js.js.map +1 -0
- package/node_modules_ol_interaction_DragAndDrop_js.js +351 -0
- package/node_modules_ol_interaction_DragAndDrop_js.js.map +1 -0
- package/node_modules_ol_interaction_DragRotateAndZoom_js.js +159 -0
- package/node_modules_ol_interaction_DragRotateAndZoom_js.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49290.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49290.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49291.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49291.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49292.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49292.js.map +1 -0
- package/node_modules_ol_layer_Vector_js-_49293.js +110 -0
- package/node_modules_ol_layer_Vector_js-_49293.js.map +1 -0
- package/node_modules_ol_loadingstrategy_js.js +95 -0
- package/node_modules_ol_loadingstrategy_js.js.map +1 -0
- package/node_modules_ol_render_VectorContext_js-_3ad60.js +144 -0
- package/node_modules_ol_render_VectorContext_js-_3ad60.js.map +1 -0
- package/node_modules_ol_render_VectorContext_js-_3ad61.js +144 -0
- package/node_modules_ol_render_VectorContext_js-_3ad61.js.map +1 -0
- package/node_modules_ol_render_VectorContext_js-node_modules_ol_render_canvas_hitdetect_js.js +372 -0
- package/node_modules_ol_render_VectorContext_js-node_modules_ol_render_canvas_hitdetect_js.js.map +1 -0
- package/node_modules_ol_render_canvas_ImageBuilder_js.js +318 -0
- package/node_modules_ol_render_canvas_ImageBuilder_js.js.map +1 -0
- package/node_modules_ol_render_canvas_Instruction_js.js +66 -0
- package/node_modules_ol_render_canvas_Instruction_js.js.map +1 -0
- package/node_modules_ol_render_canvas_LineStringBuilder_js.js +187 -0
- package/node_modules_ol_render_canvas_LineStringBuilder_js.js.map +1 -0
- package/node_modules_ol_render_canvas_PolygonBuilder_js.js +276 -0
- package/node_modules_ol_render_canvas_PolygonBuilder_js.js.map +1 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab20.js +156 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab20.js.map +1 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab21.js +156 -0
- package/node_modules_ol_render_canvas_ZIndexContext_js-_fab21.js.map +1 -0
- package/node_modules_ol_render_js-node_modules_ol_render_VectorContext_js.js +301 -0
- package/node_modules_ol_render_js-node_modules_ol_render_VectorContext_js.js.map +1 -0
- package/node_modules_ol_renderer_Layer_js.js +219 -0
- package/node_modules_ol_renderer_Layer_js.js.map +1 -0
- package/node_modules_ol_source_Source_js.js +256 -0
- package/node_modules_ol_source_Source_js.js.map +1 -0
- package/node_modules_ol_source_VectorEventType_js-node_modules_ol_structs_RBush_js.js +318 -0
- package/node_modules_ol_source_VectorEventType_js-node_modules_ol_structs_RBush_js.js.map +1 -0
- package/node_modules_ol_source_VectorEventType_js.js +80 -0
- package/node_modules_ol_source_VectorEventType_js.js.map +1 -0
- package/node_modules_ol_structs_RBush_js.js +242 -0
- package/node_modules_ol_structs_RBush_js.js.map +1 -0
- package/node_modules_ol_style_js.js +2 -1
- package/node_modules_ol_style_js.js.map +1 -1
- package/node_modules_rbush_rbush_min_js.js +16 -0
- package/node_modules_rbush_rbush_min_js.js.map +1 -0
- package/package.json +142 -146
- package/vaadin-bundle.json +2447 -2352
- package/vaadin.js +52246 -63791
- package/vaadin.js.map +1 -1
- package/vendors-node_modules_dompurify_dist_purify_es_mjs.js +1364 -0
- package/vendors-node_modules_dompurify_dist_purify_es_mjs.js.map +1 -0
- package/vendors-node_modules_dompurify_dist_purify_js.js +26 -21
- package/vendors-node_modules_dompurify_dist_purify_js.js.map +1 -1
- package/vendors-node_modules_marked_lib_marked_esm_js.js +2205 -0
- package/vendors-node_modules_marked_lib_marked_esm_js.js.map +1 -0
- package/vendors-node_modules_marked_lib_marked_umd_js.js +2164 -2556
- package/vendors-node_modules_marked_lib_marked_umd_js.js.map +1 -1
- package/vendors-node_modules_ol_Feature_js.js +360 -0
- package/vendors-node_modules_ol_Feature_js.js.map +1 -0
- package/vendors-node_modules_ol_Geolocation_js.js +352 -293
- package/vendors-node_modules_ol_Geolocation_js.js.map +1 -1
- package/vendors-node_modules_ol_ImageTile_js.js +494 -0
- package/vendors-node_modules_ol_ImageTile_js.js.map +1 -0
- package/vendors-node_modules_ol_Overlay_js.js +606 -0
- package/vendors-node_modules_ol_Overlay_js.js.map +1 -0
- package/vendors-node_modules_ol_control_FullScreen_js.js +417 -0
- package/vendors-node_modules_ol_control_FullScreen_js.js.map +1 -0
- package/vendors-node_modules_ol_control_OverviewMap_js.js +711 -0
- package/vendors-node_modules_ol_control_OverviewMap_js.js.map +1 -0
- package/vendors-node_modules_ol_control_ScaleLine_js.js +509 -0
- package/vendors-node_modules_ol_control_ScaleLine_js.js.map +1 -0
- package/vendors-node_modules_ol_control_ZoomSlider_js.js +418 -0
- package/vendors-node_modules_ol_control_ZoomSlider_js.js.map +1 -0
- package/vendors-node_modules_ol_control_js.js +490 -0
- package/vendors-node_modules_ol_control_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_LineString_js.js +574 -0
- package/vendors-node_modules_ol_geom_LineString_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_MultiLineString_js.js +405 -0
- package/vendors-node_modules_ol_geom_MultiLineString_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_MultiPolygon_js.js +773 -0
- package/vendors-node_modules_ol_geom_MultiPolygon_js.js.map +1 -0
- package/vendors-node_modules_ol_geom_js-node_modules_ol_geom_flat_length_js.js +769 -0
- package/vendors-node_modules_ol_geom_js-node_modules_ol_geom_flat_length_js.js.map +1 -0
- package/vendors-node_modules_ol_index_js.js +526 -675
- package/vendors-node_modules_ol_index_js.js.map +1 -1
- package/vendors-node_modules_ol_interaction_Draw_js.js +2777 -0
- package/vendors-node_modules_ol_interaction_Draw_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Extent_js.js +586 -0
- package/vendors-node_modules_ol_interaction_Extent_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Link_js.js +489 -0
- package/vendors-node_modules_ol_interaction_Link_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Modify_js.js +1841 -0
- package/vendors-node_modules_ol_interaction_Modify_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Select_js.js +623 -0
- package/vendors-node_modules_ol_interaction_Select_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Snap_js.js +982 -0
- package/vendors-node_modules_ol_interaction_Snap_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_Translate_js.js +466 -0
- package/vendors-node_modules_ol_interaction_Translate_js.js.map +1 -0
- package/vendors-node_modules_ol_interaction_js.js +872 -0
- package/vendors-node_modules_ol_interaction_js.js.map +1 -0
- package/vendors-node_modules_ol_layer_Graticule_js.js +1374 -989
- package/vendors-node_modules_ol_layer_Graticule_js.js.map +1 -1
- package/vendors-node_modules_ol_render_Feature_js.js +546 -0
- package/vendors-node_modules_ol_render_Feature_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_BuilderGroup_js.js +897 -0
- package/vendors-node_modules_ol_render_canvas_BuilderGroup_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_Builder_js.js +907 -0
- package/vendors-node_modules_ol_render_canvas_Builder_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js +539 -0
- package/vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_Executor_js.js +1715 -0
- package/vendors-node_modules_ol_render_canvas_Executor_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_Immediate_js.js +1208 -0
- package/vendors-node_modules_ol_render_canvas_Immediate_js.js.map +1 -0
- package/vendors-node_modules_ol_render_canvas_TextBuilder_js.js +825 -0
- package/vendors-node_modules_ol_render_canvas_TextBuilder_js.js.map +1 -0
- package/vendors-node_modules_ol_renderer_canvas_Layer_js.js +654 -0
- package/vendors-node_modules_ol_renderer_canvas_Layer_js.js.map +1 -0
- package/vendors-node_modules_ol_renderer_canvas_VectorLayer_js.js +1044 -0
- package/vendors-node_modules_ol_renderer_canvas_VectorLayer_js.js.map +1 -0
- package/vendors-node_modules_ol_renderer_vector_js.js +460 -0
- package/vendors-node_modules_ol_renderer_vector_js.js.map +1 -0
- package/vendors-node_modules_ol_source_Vector_js.js +2091 -0
- package/vendors-node_modules_ol_source_Vector_js.js.map +1 -0
- package/node_modules_ol_ImageTile_js.js +0 -177
- package/node_modules_ol_ImageTile_js.js.map +0 -1
- package/node_modules_ol_render_js.js +0 -131
- package/node_modules_ol_render_js.js.map +0 -1
- package/node_modules_ol_structs_LRUCache_js.js +0 -275
- package/node_modules_ol_structs_LRUCache_js.js.map +0 -1
- package/node_modules_ol_tilecoord_js.js +0 -115
- package/node_modules_ol_tilecoord_js.js.map +0 -1
- package/vendors-node_modules_ol_TileCache_js.js +0 -461
- package/vendors-node_modules_ol_TileCache_js.js.map +0 -1
- package/vendors-node_modules_ol_Tile_js.js +0 -330
- package/vendors-node_modules_ol_Tile_js.js.map +0 -1
- package/vendors-node_modules_ol_style_Text_js.js +0 -509
- package/vendors-node_modules_ol_style_Text_js.js.map +0 -1
- package/vendors-node_modules_rbush_index_js.js +0 -531
- package/vendors-node_modules_rbush_index_js.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors-node_modules_ol_render_canvas_Builder_js.js","mappings":";;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,6CAA6C;AAC1D,aAAa,qCAAqC;AAClD,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA,aAAa,uCAAuC;AACpD;AACA;;AAEA;AACA;AACA;AACA,aAAa,qCAAqC;AAClD;AACA;;AAEA;AACA,aAAa,qCAAqC;AAClD,aAAa,iCAAiC;AAC9C,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,iCAAiC;AAC9C,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,iDAAiD;AAC9D,aAAa,iCAAiC;AAC9C,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,wEAAwE;AACrF,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,6EAA6E;AAC1F,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,wEAAwE;AACrF,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,2CAA2C;AACxD,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,mEAAmE;AAChF,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,qEAAqE;AAClF,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,4EAA4E;AACzF,aAAa,qCAAqC;AAClD,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA,aAAa,oCAAoC;AACjD,aAAa,sCAAsC;AACnD;AACA;;AAEA;AACA,aAAa,qCAAqC;AAClD,aAAa,sDAAsD;AACnE;AACA;;AAEA;AACA,aAAa,oCAAoC;AACjD,aAAa,sDAAsD;AACnE;AACA;AACA;;AAEA,iEAAe,aAAa,EAAC;;;;;;;;;;;;;;;;;;;;;;;AC7H7B;AACA;AACA;AACuD;AACR;AACS;AAM/B;AAKW;AACY;AAU1B;AAC2B;;AAEjD,4BAA4B,yDAAa;AACzC;AACA,aAAa,QAAQ;AACrB,aAAa,kCAAkC;AAC/C,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA,4BAA4B,wCAAwC,MAAM;AAC1E;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA,UAAU,8DAAkB;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B,SAAS;AACvC;AACA;AACA,gBAAgB,kEAAsB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,qBAAqB,4EAAyB;AACtD;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,cAAc,QAAQ;AACtB;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,gDAAgD;AAC7D,aAAa,wCAAwC;AACrD,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,8CAA8C;AACnE;AACA;AACA;AACA;AACA,qBAAqB,8CAA8C;AACnE;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA,UAAU,+EAA4B;AACtC;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA,UAAU,+EAA4B;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yCAAyC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yFAAyF;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA,UAAU,0EAAuB;AACjC;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA,UAAU,0EAAuB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA,UAAU,qEAAkB;AAC5B;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA,UAAU,qEAAkB;AAC5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,8DAAwB;AACpC;AACA;AACA;AACA;AACA,YAAY,qEAAkB;AAC9B;AACA;AACA;AACA,YAAY,8DAAwB;AACpC;AACA;AACA;AACA;AACA,YAAY,qEAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAwB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,uEAAuE;AACpF,aAAa,wCAAwC;AACrD,aAAa,QAAQ;AACrB;AACA;AACA;AACA,MAAM,sEAAgC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,sEAAgC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,iDAAiD;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA,wBAAwB,oCAAoC;AAC5D,kBAAkB,oEAA8B;AAChD;AACA,QAAQ,iBAAiB,sEAAgC;AACzD;AACA,QAAQ,0DAAe;AACvB;AACA;AACA;AACA;;AAEA;AACA,aAAa,uCAAuC;AACpD,aAAa,wCAAwC;AACrD,cAAc,wCAAwC;AACtD;AACA;AACA;AACA,uBAAuB,wCAAwC,MAAM;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAAW;AACnC,0CAA0C,wDAAgB;AAC1D;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,aAAa,yCAAyC;AACtD,aAAa,wCAAwC;AACrD,cAAc,wCAAwC;AACtD;AACA;AACA;AACA,uBAAuB,wCAAwC,MAAM;AACrE;AACA;AACA;AACA,0BAA0B,0DAAW;AACrC,8CAA8C,0DAAkB;AAChE;AACA;AACA;AACA,gEAAgE,sDAAc;AAC9E;AACA;AACA;AACA,UAAU,uDAAe;AACzB;AACA;AACA;AACA,UAAU,6DAAqB;AAC/B;AACA;AACA;AACA;AACA,YAAY,uDAAe;AAC3B;AACA;AACA,4DAA4D,wDAAgB;AAC5E;AACA;AACA;AACA;AACA,YAAY,yDAAiB;;AAE7B;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,uCAAuC;AACpD,aAAa,yCAAyC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD,cAAc,UAAU;AACxB;AACA;AACA;AACA,eAAe,UAAU;AACzB,6BAA6B,sEAAgC;AAC7D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD,cAAc,UAAU;AACxB;AACA;AACA;AACA,MAAM,wEAAkC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD,aAAa,+EAA+E;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD,aAAa,4EAA4E;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iDAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oEAA8B;AAClE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,kCAAkC;AAChD;AACA;AACA;AACA;AACA,gCAAgC,iDAAK;AACrC;AACA;AACA,QAAQ,kDAAM;AACd;AACA;AACA;AACA;AACA;;AAEA,iEAAe,aAAa,EAAC;;;;;;;;;;;;;;;;;;;ACxrB7B;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACO;;AAEP;AACA,UAAU;AACV;AACO;;AAEP;AACA,UAAU;AACV;AACO;;AAEP;AACA,UAAU;AACV;AACO;;AAEP,iEAAe,WAAW,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/render/VectorContext.js","webpack://@vaadin/bundles/./node_modules/ol/render/canvas/Builder.js","webpack://@vaadin/bundles/./node_modules/ol/render/canvas/Instruction.js"],"sourcesContent":["/**\n * @module ol/render/VectorContext\n */\n\n/**\n * @classdesc\n * Context for drawing geometries. A vector context is available on render\n * events and does not need to be constructed directly.\n * @api\n */\nclass VectorContext {\n /**\n * Render a geometry with a custom renderer.\n *\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {Function} renderer Renderer.\n * @param {Function} hitDetectionRenderer Renderer.\n * @param {number} [index] Render order index.\n */\n drawCustom(geometry, feature, renderer, hitDetectionRenderer, index) {}\n\n /**\n * Render a geometry.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry The geometry to render.\n */\n drawGeometry(geometry) {}\n\n /**\n * Set the rendering style.\n *\n * @param {import(\"../style/Style.js\").default} style The rendering style.\n */\n setStyle(style) {}\n\n /**\n * @param {import(\"../geom/Circle.js\").default} circleGeometry Circle geometry.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawCircle(circleGeometry, feature, index) {}\n\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} [index] Render order index.\n */\n drawFeature(feature, style, index) {}\n\n /**\n * @param {import(\"../geom/GeometryCollection.js\").default} geometryCollectionGeometry Geometry collection.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawGeometryCollection(geometryCollectionGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/LineString.js\").default|import(\"./Feature.js\").default} lineStringGeometry Line string geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawLineString(lineStringGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"./Feature.js\").default} multiLineStringGeometry MultiLineString geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawMultiLineString(multiLineStringGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"./Feature.js\").default} multiPointGeometry MultiPoint geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawMultiPoint(multiPointGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/MultiPolygon.js\").default} multiPolygonGeometry MultiPolygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawMultiPolygon(multiPolygonGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/Point.js\").default|import(\"./Feature.js\").default} pointGeometry Point geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawPoint(pointGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/Polygon.js\").default|import(\"./Feature.js\").default} polygonGeometry Polygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawPolygon(polygonGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default|import(\"./Feature.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawText(geometry, feature, index) {}\n\n /**\n * @param {import(\"../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../style/Stroke.js\").default} strokeStyle Stroke style.\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {}\n\n /**\n * @param {import(\"../style/Image.js\").default} imageStyle Image style.\n * @param {import(\"../render/canvas.js\").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with a text style.\n */\n setImageStyle(imageStyle, declutterImageWithText) {}\n\n /**\n * @param {import(\"../style/Text.js\").default} textStyle Text style.\n * @param {import(\"../render/canvas.js\").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with an image style.\n */\n setTextStyle(textStyle, declutterImageWithText) {}\n}\n\nexport default VectorContext;\n","/**\n * @module ol/render/canvas/Builder\n */\nimport {equals, reverseSubArray} from '../../array.js';\nimport {asColorLike} from '../../colorlike.js';\nimport Relationship from '../../extent/Relationship.js';\nimport {\n buffer,\n clone,\n containsCoordinate,\n coordinateRelationship,\n} from '../../extent.js';\nimport {\n inflateCoordinates,\n inflateCoordinatesArray,\n inflateMultiCoordinatesArray,\n} from '../../geom/flat/inflate.js';\nimport VectorContext from '../VectorContext.js';\nimport {\n defaultFillStyle,\n defaultLineCap,\n defaultLineDash,\n defaultLineDashOffset,\n defaultLineJoin,\n defaultLineWidth,\n defaultMiterLimit,\n defaultStrokeStyle,\n} from '../canvas.js';\nimport CanvasInstruction from './Instruction.js';\n\nclass CanvasBuilder extends VectorContext {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n super();\n\n /**\n * @protected\n * @type {number}\n */\n this.tolerance = tolerance;\n\n /**\n * @protected\n * @const\n * @type {import(\"../../extent.js\").Extent}\n */\n this.maxExtent = maxExtent;\n\n /**\n * @protected\n * @type {number}\n */\n this.pixelRatio = pixelRatio;\n\n /**\n * @protected\n * @type {number}\n */\n this.maxLineWidth = 0;\n\n /**\n * @protected\n * @const\n * @type {number}\n */\n this.resolution = resolution;\n\n /**\n * @private\n * @type {Array<*>}\n */\n this.beginGeometryInstruction1_ = null;\n\n /**\n * @private\n * @type {Array<*>}\n */\n this.beginGeometryInstruction2_ = null;\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.bufferedMaxExtent_ = null;\n\n /**\n * @protected\n * @type {Array<*>}\n */\n this.instructions = [];\n\n /**\n * @protected\n * @type {Array<number>}\n */\n this.coordinates = [];\n\n /**\n * @private\n * @type {import(\"../../coordinate.js\").Coordinate}\n */\n this.tmpCoordinate_ = [];\n\n /**\n * @protected\n * @type {Array<*>}\n */\n this.hitDetectionInstructions = [];\n\n /**\n * @protected\n * @type {import(\"../canvas.js\").FillStrokeState}\n */\n this.state = /** @type {import(\"../canvas.js\").FillStrokeState} */ ({});\n }\n\n /**\n * @protected\n * @param {Array<number>} dashArray Dash array.\n * @return {Array<number>} Dash array with pixel ratio applied\n */\n applyPixelRatio(dashArray) {\n const pixelRatio = this.pixelRatio;\n return pixelRatio == 1\n ? dashArray\n : dashArray.map(function (dash) {\n return dash * pixelRatio;\n });\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} stride Stride.\n * @protected\n * @return {number} My end\n */\n appendFlatPointCoordinates(flatCoordinates, stride) {\n const extent = this.getBufferedMaxExtent();\n const tmpCoord = this.tmpCoordinate_;\n const coordinates = this.coordinates;\n let myEnd = coordinates.length;\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n tmpCoord[0] = flatCoordinates[i];\n tmpCoord[1] = flatCoordinates[i + 1];\n if (containsCoordinate(extent, tmpCoord)) {\n coordinates[myEnd++] = tmpCoord[0];\n coordinates[myEnd++] = tmpCoord[1];\n }\n }\n return myEnd;\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 * @param {boolean} closed Last input coordinate equals first.\n * @param {boolean} skipFirst Skip first coordinate.\n * @protected\n * @return {number} My end.\n */\n appendFlatLineCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n closed,\n skipFirst,\n ) {\n const coordinates = this.coordinates;\n let myEnd = coordinates.length;\n const extent = this.getBufferedMaxExtent();\n if (skipFirst) {\n offset += stride;\n }\n let lastXCoord = flatCoordinates[offset];\n let lastYCoord = flatCoordinates[offset + 1];\n const nextCoord = this.tmpCoordinate_;\n let skipped = true;\n\n let i, lastRel, nextRel;\n for (i = offset + stride; i < end; i += stride) {\n nextCoord[0] = flatCoordinates[i];\n nextCoord[1] = flatCoordinates[i + 1];\n nextRel = coordinateRelationship(extent, nextCoord);\n if (nextRel !== lastRel) {\n if (skipped) {\n coordinates[myEnd++] = lastXCoord;\n coordinates[myEnd++] = lastYCoord;\n skipped = false;\n }\n coordinates[myEnd++] = nextCoord[0];\n coordinates[myEnd++] = nextCoord[1];\n } else if (nextRel === Relationship.INTERSECTING) {\n coordinates[myEnd++] = nextCoord[0];\n coordinates[myEnd++] = nextCoord[1];\n skipped = false;\n } else {\n skipped = true;\n }\n lastXCoord = nextCoord[0];\n lastYCoord = nextCoord[1];\n lastRel = nextRel;\n }\n\n // Last coordinate equals first or only one point to append:\n if ((closed && skipped) || i === offset + stride) {\n coordinates[myEnd++] = lastXCoord;\n coordinates[myEnd++] = lastYCoord;\n }\n return myEnd;\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<number>} builderEnds Builder ends.\n * @return {number} Offset.\n */\n drawCustomCoordinates_(flatCoordinates, offset, ends, stride, builderEnds) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const builderEnd = this.appendFlatLineCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n false,\n false,\n );\n builderEnds.push(builderEnd);\n offset = end;\n }\n return offset;\n }\n\n /**\n * @param {import(\"../../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {Function} renderer Renderer.\n * @param {Function} hitDetectionRenderer Renderer.\n * @param {number} [index] Render order index.\n * @override\n */\n drawCustom(geometry, feature, renderer, hitDetectionRenderer, index) {\n this.beginGeometry(geometry, feature, index);\n\n const type = geometry.getType();\n const stride = geometry.getStride();\n const builderBegin = this.coordinates.length;\n\n let flatCoordinates, builderEnd, builderEnds, builderEndss;\n let offset;\n\n switch (type) {\n case 'MultiPolygon':\n flatCoordinates =\n /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (\n geometry\n ).getOrientedFlatCoordinates();\n builderEndss = [];\n const endss =\n /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (\n geometry\n ).getEndss();\n offset = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const myEnds = [];\n offset = this.drawCustomCoordinates_(\n flatCoordinates,\n offset,\n endss[i],\n stride,\n myEnds,\n );\n builderEndss.push(myEnds);\n }\n this.instructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEndss,\n geometry,\n renderer,\n inflateMultiCoordinatesArray,\n index,\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEndss,\n geometry,\n hitDetectionRenderer || renderer,\n inflateMultiCoordinatesArray,\n index,\n ]);\n break;\n case 'Polygon':\n case 'MultiLineString':\n builderEnds = [];\n flatCoordinates =\n type == 'Polygon'\n ? /** @type {import(\"../../geom/Polygon.js\").default} */ (\n geometry\n ).getOrientedFlatCoordinates()\n : geometry.getFlatCoordinates();\n offset = this.drawCustomCoordinates_(\n flatCoordinates,\n 0,\n /** @type {import(\"../../geom/Polygon.js\").default|import(\"../../geom/MultiLineString.js\").default} */ (\n geometry\n ).getEnds(),\n stride,\n builderEnds,\n );\n this.instructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnds,\n geometry,\n renderer,\n inflateCoordinatesArray,\n index,\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnds,\n geometry,\n hitDetectionRenderer || renderer,\n inflateCoordinatesArray,\n index,\n ]);\n break;\n case 'LineString':\n case 'Circle':\n flatCoordinates = geometry.getFlatCoordinates();\n builderEnd = this.appendFlatLineCoordinates(\n flatCoordinates,\n 0,\n flatCoordinates.length,\n stride,\n false,\n false,\n );\n this.instructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnd,\n geometry,\n renderer,\n inflateCoordinates,\n index,\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnd,\n geometry,\n hitDetectionRenderer || renderer,\n inflateCoordinates,\n index,\n ]);\n break;\n case 'MultiPoint':\n flatCoordinates = geometry.getFlatCoordinates();\n builderEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);\n\n if (builderEnd > builderBegin) {\n this.instructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnd,\n geometry,\n renderer,\n inflateCoordinates,\n index,\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnd,\n geometry,\n hitDetectionRenderer || renderer,\n inflateCoordinates,\n index,\n ]);\n }\n break;\n case 'Point':\n flatCoordinates = geometry.getFlatCoordinates();\n this.coordinates.push(flatCoordinates[0], flatCoordinates[1]);\n builderEnd = this.coordinates.length;\n\n this.instructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnd,\n geometry,\n renderer,\n undefined,\n index,\n ]);\n this.hitDetectionInstructions.push([\n CanvasInstruction.CUSTOM,\n builderBegin,\n builderEnd,\n geometry,\n hitDetectionRenderer || renderer,\n undefined,\n index,\n ]);\n break;\n default:\n }\n this.endGeometry(feature);\n }\n\n /**\n * @protected\n * @param {import(\"../../geom/Geometry\").default|import(\"../Feature.js\").default} geometry The geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {number} index Render order index\n */\n beginGeometry(geometry, feature, index) {\n this.beginGeometryInstruction1_ = [\n CanvasInstruction.BEGIN_GEOMETRY,\n feature,\n 0,\n geometry,\n index,\n ];\n this.instructions.push(this.beginGeometryInstruction1_);\n this.beginGeometryInstruction2_ = [\n CanvasInstruction.BEGIN_GEOMETRY,\n feature,\n 0,\n geometry,\n index,\n ];\n this.hitDetectionInstructions.push(this.beginGeometryInstruction2_);\n }\n\n /**\n * @return {import(\"../canvas.js\").SerializableInstructions} the serializable instructions.\n */\n finish() {\n return {\n instructions: this.instructions,\n hitDetectionInstructions: this.hitDetectionInstructions,\n coordinates: this.coordinates,\n };\n }\n\n /**\n * Reverse the hit detection instructions.\n */\n reverseHitDetectionInstructions() {\n const hitDetectionInstructions = this.hitDetectionInstructions;\n // step 1 - reverse array\n hitDetectionInstructions.reverse();\n // step 2 - reverse instructions within geometry blocks\n let i;\n const n = hitDetectionInstructions.length;\n let instruction;\n let type;\n let begin = -1;\n for (i = 0; i < n; ++i) {\n instruction = hitDetectionInstructions[i];\n type = /** @type {import(\"./Instruction.js\").default} */ (instruction[0]);\n if (type == CanvasInstruction.END_GEOMETRY) {\n begin = i;\n } else if (type == CanvasInstruction.BEGIN_GEOMETRY) {\n instruction[2] = i;\n reverseSubArray(this.hitDetectionInstructions, begin, i);\n begin = -1;\n }\n }\n }\n\n /**\n * @param {import(\"../../style/Fill.js\").default} fillStyle Fill style.\n * @param {import('../canvas.js').FillStrokeState} [state] State.\n * @return {import('../canvas.js').FillStrokeState} State.\n */\n fillStyleToState(\n fillStyle,\n state = /** @type {import('../canvas.js').FillStrokeState} */ ({}),\n ) {\n if (fillStyle) {\n const fillStyleColor = fillStyle.getColor();\n state.fillPatternScale =\n fillStyleColor &&\n typeof fillStyleColor === 'object' &&\n 'src' in fillStyleColor\n ? this.pixelRatio\n : 1;\n state.fillStyle = asColorLike(\n fillStyleColor ? fillStyleColor : defaultFillStyle,\n );\n } else {\n state.fillStyle = undefined;\n }\n return state;\n }\n\n /**\n * @param {import(\"../../style/Stroke.js\").default} strokeStyle Stroke style.\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {import(\"../canvas.js\").FillStrokeState} State.\n */\n strokeStyleToState(\n strokeStyle,\n state = /** @type {import('../canvas.js').FillStrokeState} */ ({}),\n ) {\n if (strokeStyle) {\n const strokeStyleColor = strokeStyle.getColor();\n state.strokeStyle = asColorLike(\n strokeStyleColor ? strokeStyleColor : defaultStrokeStyle,\n );\n const strokeStyleLineCap = strokeStyle.getLineCap();\n state.lineCap =\n strokeStyleLineCap !== undefined ? strokeStyleLineCap : defaultLineCap;\n const strokeStyleLineDash = strokeStyle.getLineDash();\n state.lineDash = strokeStyleLineDash\n ? strokeStyleLineDash.slice()\n : defaultLineDash;\n const strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();\n state.lineDashOffset = strokeStyleLineDashOffset\n ? strokeStyleLineDashOffset\n : defaultLineDashOffset;\n const strokeStyleLineJoin = strokeStyle.getLineJoin();\n state.lineJoin =\n strokeStyleLineJoin !== undefined\n ? strokeStyleLineJoin\n : defaultLineJoin;\n const strokeStyleWidth = strokeStyle.getWidth();\n state.lineWidth =\n strokeStyleWidth !== undefined ? strokeStyleWidth : defaultLineWidth;\n const strokeStyleMiterLimit = strokeStyle.getMiterLimit();\n state.miterLimit =\n strokeStyleMiterLimit !== undefined\n ? strokeStyleMiterLimit\n : defaultMiterLimit;\n\n if (state.lineWidth > this.maxLineWidth) {\n this.maxLineWidth = state.lineWidth;\n // invalidate the buffered max extent cache\n this.bufferedMaxExtent_ = null;\n }\n } else {\n state.strokeStyle = undefined;\n state.lineCap = undefined;\n state.lineDash = null;\n state.lineDashOffset = undefined;\n state.lineJoin = undefined;\n state.lineWidth = undefined;\n state.miterLimit = undefined;\n }\n return state;\n }\n\n /**\n * @param {import(\"../../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../../style/Stroke.js\").default} strokeStyle Stroke style.\n * @override\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {\n const state = this.state;\n this.fillStyleToState(fillStyle, state);\n this.strokeStyleToState(strokeStyle, state);\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {Array<*>} Fill instruction.\n */\n createFill(state) {\n const fillStyle = state.fillStyle;\n /** @type {Array<*>} */\n const fillInstruction = [CanvasInstruction.SET_FILL_STYLE, fillStyle];\n if (typeof fillStyle !== 'string') {\n // Fill is a pattern or gradient - align and scale it!\n fillInstruction.push(state.fillPatternScale);\n }\n return fillInstruction;\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n */\n applyStroke(state) {\n this.instructions.push(this.createStroke(state));\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {Array<*>} Stroke instruction.\n */\n createStroke(state) {\n return [\n CanvasInstruction.SET_STROKE_STYLE,\n state.strokeStyle,\n state.lineWidth * this.pixelRatio,\n state.lineCap,\n state.lineJoin,\n state.miterLimit,\n state.lineDash ? this.applyPixelRatio(state.lineDash) : null,\n state.lineDashOffset * this.pixelRatio,\n ];\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @param {function(this:CanvasBuilder, import(\"../canvas.js\").FillStrokeState):Array<*>} createFill Create fill.\n */\n updateFillStyle(state, createFill) {\n const fillStyle = state.fillStyle;\n if (typeof fillStyle !== 'string' || state.currentFillStyle != fillStyle) {\n this.instructions.push(createFill.call(this, state));\n state.currentFillStyle = fillStyle;\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @param {function(this:CanvasBuilder, import(\"../canvas.js\").FillStrokeState): void} applyStroke Apply stroke.\n */\n updateStrokeStyle(state, applyStroke) {\n const strokeStyle = state.strokeStyle;\n const lineCap = state.lineCap;\n const lineDash = state.lineDash;\n const lineDashOffset = state.lineDashOffset;\n const lineJoin = state.lineJoin;\n const lineWidth = state.lineWidth;\n const miterLimit = state.miterLimit;\n if (\n state.currentStrokeStyle != strokeStyle ||\n state.currentLineCap != lineCap ||\n (lineDash != state.currentLineDash &&\n !equals(state.currentLineDash, lineDash)) ||\n state.currentLineDashOffset != lineDashOffset ||\n state.currentLineJoin != lineJoin ||\n state.currentLineWidth != lineWidth ||\n state.currentMiterLimit != miterLimit\n ) {\n applyStroke.call(this, state);\n state.currentStrokeStyle = strokeStyle;\n state.currentLineCap = lineCap;\n state.currentLineDash = lineDash;\n state.currentLineDashOffset = lineDashOffset;\n state.currentLineJoin = lineJoin;\n state.currentLineWidth = lineWidth;\n state.currentMiterLimit = miterLimit;\n }\n }\n\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n endGeometry(feature) {\n this.beginGeometryInstruction1_[2] = this.instructions.length;\n this.beginGeometryInstruction1_ = null;\n this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;\n this.beginGeometryInstruction2_ = null;\n const endGeometryInstruction = [CanvasInstruction.END_GEOMETRY, feature];\n this.instructions.push(endGeometryInstruction);\n this.hitDetectionInstructions.push(endGeometryInstruction);\n }\n\n /**\n * Get the buffered rendering extent. Rendering will be clipped to the extent\n * provided to the constructor. To account for symbolizers that may intersect\n * this extent, we calculate a buffered extent (e.g. based on stroke width).\n * @return {import(\"../../extent.js\").Extent} The buffered rendering extent.\n * @protected\n */\n getBufferedMaxExtent() {\n if (!this.bufferedMaxExtent_) {\n this.bufferedMaxExtent_ = clone(this.maxExtent);\n if (this.maxLineWidth > 0) {\n const width = (this.resolution * (this.maxLineWidth + 1)) / 2;\n buffer(this.bufferedMaxExtent_, width, this.bufferedMaxExtent_);\n }\n }\n return this.bufferedMaxExtent_;\n }\n}\n\nexport default CanvasBuilder;\n","/**\n * @module ol/render/canvas/Instruction\n */\n\n/**\n * @enum {number}\n */\nconst Instruction = {\n BEGIN_GEOMETRY: 0,\n BEGIN_PATH: 1,\n CIRCLE: 2,\n CLOSE_PATH: 3,\n CUSTOM: 4,\n DRAW_CHARS: 5,\n DRAW_IMAGE: 6,\n END_GEOMETRY: 7,\n FILL: 8,\n MOVE_TO_LINE_TO: 9,\n SET_FILL_STYLE: 10,\n SET_STROKE_STYLE: 11,\n STROKE: 12,\n};\n\n/**\n * @type {Array<Instruction>}\n */\nexport const fillInstruction = [Instruction.FILL];\n\n/**\n * @type {Array<Instruction>}\n */\nexport const strokeInstruction = [Instruction.STROKE];\n\n/**\n * @type {Array<Instruction>}\n */\nexport const beginPathInstruction = [Instruction.BEGIN_PATH];\n\n/**\n * @type {Array<Instruction>}\n */\nexport const closePathInstruction = [Instruction.CLOSE_PATH];\n\nexport default Instruction;\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["vendors-node_modules_ol_render_canvas_ExecutorGroup_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/render/canvas/ExecutorGroup.js":
|
|
4
|
+
/*!********************************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/render/canvas/ExecutorGroup.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 */ "ALL": () => (/* binding */ ALL),
|
|
12
|
+
/* harmony export */ "DECLUTTER": () => (/* binding */ DECLUTTER),
|
|
13
|
+
/* harmony export */ "NON_DECLUTTER": () => (/* binding */ NON_DECLUTTER),
|
|
14
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
15
|
+
/* harmony export */ "getPixelIndexArray": () => (/* binding */ getPixelIndexArray)
|
|
16
|
+
/* harmony export */ });
|
|
17
|
+
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../array.js */ "./node_modules/ol/array.js");
|
|
18
|
+
/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/ol/dom.js");
|
|
19
|
+
/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../extent.js */ "./node_modules/ol/extent.js");
|
|
20
|
+
/* harmony import */ var _geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geom/flat/transform.js */ "./node_modules/ol/geom/flat/transform.js");
|
|
21
|
+
/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../obj.js */ "./node_modules/ol/obj.js");
|
|
22
|
+
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../transform.js */ "./node_modules/ol/transform.js");
|
|
23
|
+
/* harmony import */ var _Executor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Executor.js */ "./node_modules/ol/render/canvas/Executor.js");
|
|
24
|
+
/**
|
|
25
|
+
* @module ol/render/canvas/ExecutorGroup
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @const
|
|
38
|
+
* @type {Array<import("../canvas.js").BuilderType>}
|
|
39
|
+
*/
|
|
40
|
+
const ALL = [
|
|
41
|
+
'Polygon',
|
|
42
|
+
'Circle',
|
|
43
|
+
'LineString',
|
|
44
|
+
'Image',
|
|
45
|
+
'Text',
|
|
46
|
+
'Default',
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @const
|
|
51
|
+
* @type {Array<import("../canvas.js").BuilderType>}
|
|
52
|
+
*/
|
|
53
|
+
const DECLUTTER = ['Image', 'Text'];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @const
|
|
57
|
+
* @type {Array<import("../canvas.js").BuilderType>}
|
|
58
|
+
*/
|
|
59
|
+
const NON_DECLUTTER = ALL.filter(
|
|
60
|
+
(builderType) => !DECLUTTER.includes(builderType),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
class ExecutorGroup {
|
|
64
|
+
/**
|
|
65
|
+
* @param {import("../../extent.js").Extent} maxExtent Max extent for clipping. When a
|
|
66
|
+
* `maxExtent` was set on the Builder for this executor group, the same `maxExtent`
|
|
67
|
+
* should be set here, unless the target context does not exceed that extent (which
|
|
68
|
+
* can be the case when rendering to tiles).
|
|
69
|
+
* @param {number} resolution Resolution.
|
|
70
|
+
* @param {number} pixelRatio Pixel ratio.
|
|
71
|
+
* @param {boolean} overlaps The executor group can have overlapping geometries.
|
|
72
|
+
* @param {!Object<string, !Object<import("../canvas.js").BuilderType, import("../canvas.js").SerializableInstructions>>} allInstructions
|
|
73
|
+
* The serializable instructions.
|
|
74
|
+
* @param {number} [renderBuffer] Optional rendering buffer.
|
|
75
|
+
* @param {boolean} [deferredRendering] Enable deferred rendering with renderDeferred().
|
|
76
|
+
*/
|
|
77
|
+
constructor(
|
|
78
|
+
maxExtent,
|
|
79
|
+
resolution,
|
|
80
|
+
pixelRatio,
|
|
81
|
+
overlaps,
|
|
82
|
+
allInstructions,
|
|
83
|
+
renderBuffer,
|
|
84
|
+
deferredRendering,
|
|
85
|
+
) {
|
|
86
|
+
/**
|
|
87
|
+
* @private
|
|
88
|
+
* @type {import("../../extent.js").Extent}
|
|
89
|
+
*/
|
|
90
|
+
this.maxExtent_ = maxExtent;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @private
|
|
94
|
+
* @type {boolean}
|
|
95
|
+
*/
|
|
96
|
+
this.overlaps_ = overlaps;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @private
|
|
100
|
+
* @type {number}
|
|
101
|
+
*/
|
|
102
|
+
this.pixelRatio_ = pixelRatio;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @private
|
|
106
|
+
* @type {number}
|
|
107
|
+
*/
|
|
108
|
+
this.resolution_ = resolution;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @private
|
|
112
|
+
* @type {number|undefined}
|
|
113
|
+
*/
|
|
114
|
+
this.renderBuffer_ = renderBuffer;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @private
|
|
118
|
+
* @type {!Object<string, !Object<string, import("./Executor").default>>}
|
|
119
|
+
*/
|
|
120
|
+
this.executorsByZIndex_ = {};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @private
|
|
124
|
+
* @type {CanvasRenderingContext2D}
|
|
125
|
+
*/
|
|
126
|
+
this.hitDetectionContext_ = null;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @private
|
|
130
|
+
* @type {import("../../transform.js").Transform}
|
|
131
|
+
*/
|
|
132
|
+
this.hitDetectionTransform_ = (0,_transform_js__WEBPACK_IMPORTED_MODULE_0__.create)();
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @private
|
|
136
|
+
* @type {CanvasRenderingContext2D}
|
|
137
|
+
*/
|
|
138
|
+
this.renderedContext_ = null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @private
|
|
142
|
+
* @type {Object<number, Array<import("./ZIndexContext.js").default>>}
|
|
143
|
+
*/
|
|
144
|
+
this.deferredZIndexContexts_ = {};
|
|
145
|
+
|
|
146
|
+
this.createExecutors_(allInstructions, deferredRendering);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @param {CanvasRenderingContext2D} context Context.
|
|
151
|
+
* @param {import("../../transform.js").Transform} transform Transform.
|
|
152
|
+
*/
|
|
153
|
+
clip(context, transform) {
|
|
154
|
+
const flatClipCoords = this.getClipCoords(transform);
|
|
155
|
+
context.beginPath();
|
|
156
|
+
context.moveTo(flatClipCoords[0], flatClipCoords[1]);
|
|
157
|
+
context.lineTo(flatClipCoords[2], flatClipCoords[3]);
|
|
158
|
+
context.lineTo(flatClipCoords[4], flatClipCoords[5]);
|
|
159
|
+
context.lineTo(flatClipCoords[6], flatClipCoords[7]);
|
|
160
|
+
context.clip();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Create executors and populate them using the provided instructions.
|
|
165
|
+
* @private
|
|
166
|
+
* @param {!Object<string, !Object<string, import("../canvas.js").SerializableInstructions>>} allInstructions The serializable instructions
|
|
167
|
+
* @param {boolean} deferredRendering Enable deferred rendering.
|
|
168
|
+
*/
|
|
169
|
+
createExecutors_(allInstructions, deferredRendering) {
|
|
170
|
+
for (const zIndex in allInstructions) {
|
|
171
|
+
let executors = this.executorsByZIndex_[zIndex];
|
|
172
|
+
if (executors === undefined) {
|
|
173
|
+
executors = {};
|
|
174
|
+
this.executorsByZIndex_[zIndex] = executors;
|
|
175
|
+
}
|
|
176
|
+
const instructionByZindex = allInstructions[zIndex];
|
|
177
|
+
for (const builderType in instructionByZindex) {
|
|
178
|
+
const instructions = instructionByZindex[builderType];
|
|
179
|
+
executors[builderType] = new _Executor_js__WEBPACK_IMPORTED_MODULE_1__["default"](
|
|
180
|
+
this.resolution_,
|
|
181
|
+
this.pixelRatio_,
|
|
182
|
+
this.overlaps_,
|
|
183
|
+
instructions,
|
|
184
|
+
deferredRendering,
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @param {Array<import("../canvas.js").BuilderType>} executors Executors.
|
|
192
|
+
* @return {boolean} Has executors of the provided types.
|
|
193
|
+
*/
|
|
194
|
+
hasExecutors(executors) {
|
|
195
|
+
for (const zIndex in this.executorsByZIndex_) {
|
|
196
|
+
const candidates = this.executorsByZIndex_[zIndex];
|
|
197
|
+
for (let i = 0, ii = executors.length; i < ii; ++i) {
|
|
198
|
+
if (executors[i] in candidates) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
|
208
|
+
* @param {number} resolution Resolution.
|
|
209
|
+
* @param {number} rotation Rotation.
|
|
210
|
+
* @param {number} hitTolerance Hit tolerance in pixels.
|
|
211
|
+
* @param {function(import("../../Feature.js").FeatureLike, import("../../geom/SimpleGeometry.js").default, number): T} callback Feature callback.
|
|
212
|
+
* @param {Array<import("../../Feature.js").FeatureLike>} declutteredFeatures Decluttered features.
|
|
213
|
+
* @return {T|undefined} Callback result.
|
|
214
|
+
* @template T
|
|
215
|
+
*/
|
|
216
|
+
forEachFeatureAtCoordinate(
|
|
217
|
+
coordinate,
|
|
218
|
+
resolution,
|
|
219
|
+
rotation,
|
|
220
|
+
hitTolerance,
|
|
221
|
+
callback,
|
|
222
|
+
declutteredFeatures,
|
|
223
|
+
) {
|
|
224
|
+
hitTolerance = Math.round(hitTolerance);
|
|
225
|
+
const contextSize = hitTolerance * 2 + 1;
|
|
226
|
+
const transform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_0__.compose)(
|
|
227
|
+
this.hitDetectionTransform_,
|
|
228
|
+
hitTolerance + 0.5,
|
|
229
|
+
hitTolerance + 0.5,
|
|
230
|
+
1 / resolution,
|
|
231
|
+
-1 / resolution,
|
|
232
|
+
-rotation,
|
|
233
|
+
-coordinate[0],
|
|
234
|
+
-coordinate[1],
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
const newContext = !this.hitDetectionContext_;
|
|
238
|
+
if (newContext) {
|
|
239
|
+
this.hitDetectionContext_ = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.createCanvasContext2D)(
|
|
240
|
+
contextSize,
|
|
241
|
+
contextSize,
|
|
242
|
+
undefined,
|
|
243
|
+
{willReadFrequently: false},
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
const context = this.hitDetectionContext_;
|
|
247
|
+
|
|
248
|
+
if (
|
|
249
|
+
context.canvas.width !== contextSize ||
|
|
250
|
+
context.canvas.height !== contextSize
|
|
251
|
+
) {
|
|
252
|
+
context.canvas.width = contextSize;
|
|
253
|
+
context.canvas.height = contextSize;
|
|
254
|
+
} else if (!newContext) {
|
|
255
|
+
context.clearRect(0, 0, contextSize, contextSize);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** @type {import("../../extent.js").Extent|undefined} */
|
|
259
|
+
let hitExtent;
|
|
260
|
+
if (this.renderBuffer_ !== undefined) {
|
|
261
|
+
hitExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.createEmpty)();
|
|
262
|
+
(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.extendCoordinate)(hitExtent, coordinate);
|
|
263
|
+
(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.buffer)(
|
|
264
|
+
hitExtent,
|
|
265
|
+
resolution * (this.renderBuffer_ + hitTolerance),
|
|
266
|
+
hitExtent,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const indexes = getPixelIndexArray(hitTolerance);
|
|
271
|
+
|
|
272
|
+
/** @type {import("../canvas.js").BuilderType} */
|
|
273
|
+
let builderType;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @param {import("../../Feature.js").FeatureLike} feature Feature.
|
|
277
|
+
* @param {import("../../geom/SimpleGeometry.js").default} geometry Geometry.
|
|
278
|
+
* @param {import('../../style/Style.js').DeclutterMode} declutterMode Declutter mode.
|
|
279
|
+
* @return {T|undefined} Callback result.
|
|
280
|
+
*/
|
|
281
|
+
function featureCallback(feature, geometry, declutterMode) {
|
|
282
|
+
const imageData = context.getImageData(
|
|
283
|
+
0,
|
|
284
|
+
0,
|
|
285
|
+
contextSize,
|
|
286
|
+
contextSize,
|
|
287
|
+
).data;
|
|
288
|
+
for (let i = 0, ii = indexes.length; i < ii; i++) {
|
|
289
|
+
if (imageData[indexes[i]] > 0) {
|
|
290
|
+
if (
|
|
291
|
+
!declutteredFeatures ||
|
|
292
|
+
declutterMode === 'none' ||
|
|
293
|
+
(builderType !== 'Image' && builderType !== 'Text') ||
|
|
294
|
+
declutteredFeatures.includes(feature)
|
|
295
|
+
) {
|
|
296
|
+
const idx = (indexes[i] - 3) / 4;
|
|
297
|
+
const x = hitTolerance - (idx % contextSize);
|
|
298
|
+
const y = hitTolerance - ((idx / contextSize) | 0);
|
|
299
|
+
const result = callback(feature, geometry, x * x + y * y);
|
|
300
|
+
if (result) {
|
|
301
|
+
return result;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
context.clearRect(0, 0, contextSize, contextSize);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return undefined;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** @type {Array<number>} */
|
|
312
|
+
const zs = Object.keys(this.executorsByZIndex_).map(Number);
|
|
313
|
+
zs.sort(_array_js__WEBPACK_IMPORTED_MODULE_4__.ascending);
|
|
314
|
+
|
|
315
|
+
let i, j, executors, executor, result;
|
|
316
|
+
for (i = zs.length - 1; i >= 0; --i) {
|
|
317
|
+
const zIndexKey = zs[i].toString();
|
|
318
|
+
executors = this.executorsByZIndex_[zIndexKey];
|
|
319
|
+
for (j = ALL.length - 1; j >= 0; --j) {
|
|
320
|
+
builderType = ALL[j];
|
|
321
|
+
executor = executors[builderType];
|
|
322
|
+
if (executor !== undefined) {
|
|
323
|
+
result = executor.executeHitDetection(
|
|
324
|
+
context,
|
|
325
|
+
transform,
|
|
326
|
+
rotation,
|
|
327
|
+
featureCallback,
|
|
328
|
+
hitExtent,
|
|
329
|
+
);
|
|
330
|
+
if (result) {
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return undefined;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @param {import("../../transform.js").Transform} transform Transform.
|
|
341
|
+
* @return {Array<number>|null} Clip coordinates.
|
|
342
|
+
*/
|
|
343
|
+
getClipCoords(transform) {
|
|
344
|
+
const maxExtent = this.maxExtent_;
|
|
345
|
+
if (!maxExtent) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
const minX = maxExtent[0];
|
|
349
|
+
const minY = maxExtent[1];
|
|
350
|
+
const maxX = maxExtent[2];
|
|
351
|
+
const maxY = maxExtent[3];
|
|
352
|
+
const flatClipCoords = [minX, minY, minX, maxY, maxX, maxY, maxX, minY];
|
|
353
|
+
(0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_5__.transform2D)(flatClipCoords, 0, 8, 2, transform, flatClipCoords);
|
|
354
|
+
return flatClipCoords;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @return {boolean} Is empty.
|
|
359
|
+
*/
|
|
360
|
+
isEmpty() {
|
|
361
|
+
return (0,_obj_js__WEBPACK_IMPORTED_MODULE_6__.isEmpty)(this.executorsByZIndex_);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* @param {CanvasRenderingContext2D} targetContext Context.
|
|
366
|
+
* @param {import('../../size.js').Size} scaledCanvasSize Scale of the context.
|
|
367
|
+
* @param {import("../../transform.js").Transform} transform Transform.
|
|
368
|
+
* @param {number} viewRotation View rotation.
|
|
369
|
+
* @param {boolean} snapToPixel Snap point symbols and test to integer pixel.
|
|
370
|
+
* @param {Array<import("../canvas.js").BuilderType>} [builderTypes] Ordered replay types to replay.
|
|
371
|
+
* Default is {@link module:ol/render/replay~ALL}
|
|
372
|
+
* @param {import("rbush").default<import('./Executor.js').DeclutterEntry>|null} [declutterTree] Declutter tree.
|
|
373
|
+
* When set to null, no decluttering is done, even when the executor group has a `ZIndexContext`.
|
|
374
|
+
*/
|
|
375
|
+
execute(
|
|
376
|
+
targetContext,
|
|
377
|
+
scaledCanvasSize,
|
|
378
|
+
transform,
|
|
379
|
+
viewRotation,
|
|
380
|
+
snapToPixel,
|
|
381
|
+
builderTypes,
|
|
382
|
+
declutterTree,
|
|
383
|
+
) {
|
|
384
|
+
const zs = Object.keys(this.executorsByZIndex_).map(Number);
|
|
385
|
+
zs.sort(declutterTree ? _array_js__WEBPACK_IMPORTED_MODULE_4__.descending : _array_js__WEBPACK_IMPORTED_MODULE_4__.ascending);
|
|
386
|
+
|
|
387
|
+
builderTypes = builderTypes ? builderTypes : ALL;
|
|
388
|
+
const maxBuilderTypes = ALL.length;
|
|
389
|
+
for (let i = 0, ii = zs.length; i < ii; ++i) {
|
|
390
|
+
const zIndexKey = zs[i].toString();
|
|
391
|
+
const replays = this.executorsByZIndex_[zIndexKey];
|
|
392
|
+
for (let j = 0, jj = builderTypes.length; j < jj; ++j) {
|
|
393
|
+
const builderType = builderTypes[j];
|
|
394
|
+
const replay = replays[builderType];
|
|
395
|
+
if (replay !== undefined) {
|
|
396
|
+
const zIndexContext =
|
|
397
|
+
declutterTree === null ? undefined : replay.getZIndexContext();
|
|
398
|
+
const context = zIndexContext
|
|
399
|
+
? zIndexContext.getContext()
|
|
400
|
+
: targetContext;
|
|
401
|
+
const requireClip =
|
|
402
|
+
this.maxExtent_ &&
|
|
403
|
+
builderType !== 'Image' &&
|
|
404
|
+
builderType !== 'Text';
|
|
405
|
+
if (requireClip) {
|
|
406
|
+
context.save();
|
|
407
|
+
// setup clipping so that the parts of over-simplified geometries are not
|
|
408
|
+
// visible outside the current extent when panning
|
|
409
|
+
this.clip(context, transform);
|
|
410
|
+
}
|
|
411
|
+
if (
|
|
412
|
+
!zIndexContext ||
|
|
413
|
+
builderType === 'Text' ||
|
|
414
|
+
builderType === 'Image'
|
|
415
|
+
) {
|
|
416
|
+
replay.execute(
|
|
417
|
+
context,
|
|
418
|
+
scaledCanvasSize,
|
|
419
|
+
transform,
|
|
420
|
+
viewRotation,
|
|
421
|
+
snapToPixel,
|
|
422
|
+
declutterTree,
|
|
423
|
+
);
|
|
424
|
+
} else {
|
|
425
|
+
zIndexContext.pushFunction((context) =>
|
|
426
|
+
replay.execute(
|
|
427
|
+
context,
|
|
428
|
+
scaledCanvasSize,
|
|
429
|
+
transform,
|
|
430
|
+
viewRotation,
|
|
431
|
+
snapToPixel,
|
|
432
|
+
declutterTree,
|
|
433
|
+
),
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
if (requireClip) {
|
|
437
|
+
context.restore();
|
|
438
|
+
}
|
|
439
|
+
if (zIndexContext) {
|
|
440
|
+
zIndexContext.offset();
|
|
441
|
+
const index = zs[i] * maxBuilderTypes + ALL.indexOf(builderType);
|
|
442
|
+
if (!this.deferredZIndexContexts_[index]) {
|
|
443
|
+
this.deferredZIndexContexts_[index] = [];
|
|
444
|
+
}
|
|
445
|
+
this.deferredZIndexContexts_[index].push(zIndexContext);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
this.renderedContext_ = targetContext;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
getDeferredZIndexContexts() {
|
|
455
|
+
return this.deferredZIndexContexts_;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
getRenderedContext() {
|
|
459
|
+
return this.renderedContext_;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
renderDeferred() {
|
|
463
|
+
const deferredZIndexContexts = this.deferredZIndexContexts_;
|
|
464
|
+
const zs = Object.keys(deferredZIndexContexts).map(Number).sort(_array_js__WEBPACK_IMPORTED_MODULE_4__.ascending);
|
|
465
|
+
for (let i = 0, ii = zs.length; i < ii; ++i) {
|
|
466
|
+
deferredZIndexContexts[zs[i]].forEach((zIndexContext) => {
|
|
467
|
+
zIndexContext.draw(this.renderedContext_); // FIXME Pass clip to replay for temporarily enabling clip
|
|
468
|
+
zIndexContext.clear();
|
|
469
|
+
});
|
|
470
|
+
deferredZIndexContexts[zs[i]].length = 0;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* This cache is used to store arrays of indexes for calculated pixel circles
|
|
477
|
+
* to increase performance.
|
|
478
|
+
* It is a static property to allow each Replaygroup to access it.
|
|
479
|
+
* @type {Object<number, Array<number>>}
|
|
480
|
+
*/
|
|
481
|
+
const circlePixelIndexArrayCache = {};
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* This methods creates an array with indexes of all pixels within a circle,
|
|
485
|
+
* ordered by how close they are to the center.
|
|
486
|
+
* A cache is used to increase performance.
|
|
487
|
+
* @param {number} radius Radius.
|
|
488
|
+
* @return {Array<number>} An array with indexes within a circle.
|
|
489
|
+
*/
|
|
490
|
+
function getPixelIndexArray(radius) {
|
|
491
|
+
if (circlePixelIndexArrayCache[radius] !== undefined) {
|
|
492
|
+
return circlePixelIndexArrayCache[radius];
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const size = radius * 2 + 1;
|
|
496
|
+
const maxDistanceSq = radius * radius;
|
|
497
|
+
const distances = new Array(maxDistanceSq + 1);
|
|
498
|
+
for (let i = 0; i <= radius; ++i) {
|
|
499
|
+
for (let j = 0; j <= radius; ++j) {
|
|
500
|
+
const distanceSq = i * i + j * j;
|
|
501
|
+
if (distanceSq > maxDistanceSq) {
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
let distance = distances[distanceSq];
|
|
505
|
+
if (!distance) {
|
|
506
|
+
distance = [];
|
|
507
|
+
distances[distanceSq] = distance;
|
|
508
|
+
}
|
|
509
|
+
distance.push(((radius + i) * size + (radius + j)) * 4 + 3);
|
|
510
|
+
if (i > 0) {
|
|
511
|
+
distance.push(((radius - i) * size + (radius + j)) * 4 + 3);
|
|
512
|
+
}
|
|
513
|
+
if (j > 0) {
|
|
514
|
+
distance.push(((radius + i) * size + (radius - j)) * 4 + 3);
|
|
515
|
+
if (i > 0) {
|
|
516
|
+
distance.push(((radius - i) * size + (radius - j)) * 4 + 3);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const pixelIndex = [];
|
|
523
|
+
for (let i = 0, ii = distances.length; i < ii; ++i) {
|
|
524
|
+
if (distances[i]) {
|
|
525
|
+
pixelIndex.push(...distances[i]);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
circlePixelIndexArrayCache[radius] = pixelIndex;
|
|
530
|
+
return pixelIndex;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExecutorGroup);
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
/***/ })
|
|
537
|
+
|
|
538
|
+
}])
|
|
539
|
+
//# sourceMappingURL=vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors-node_modules_ol_render_canvas_ExecutorGroup_js.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAEqD;AACF;AACmB;AACb;AACpB;AAIT;AACS;;AAErC;AACA;AACA,UAAU;AACV;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACO;;AAEP;AACA;AACA,UAAU;AACV;AACO;AACP;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,+GAA+G;AAC5H;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA,kCAAkC,qDAAe;;AAEjD;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;AACA,aAAa,0BAA0B;AACvC,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,mFAAmF;AAChG,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,oDAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,2CAA2C;AACxD,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,0CAA0C;AACvD,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,6GAA6G;AAC1H,aAAa,+CAA+C;AAC5D,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,8DAAqB;AACvD;AACA;AACA;AACA,SAAS,0BAA0B;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA,eAAe,4CAA4C;AAC3D;AACA;AACA,kBAAkB,uDAAW;AAC7B,MAAM,4DAAgB;AACtB,MAAM,kDAAM;AACZ;AACA;AACA;AACA;AACA;;AAEA;;AAEA,eAAe,oCAAoC;AACnD;;AAEA;AACA,eAAe,wCAAwC;AACvD,eAAe,gDAAgD;AAC/D,eAAe,8CAA8C;AAC7D,gBAAgB,aAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,eAAe;AAC9B;AACA,YAAY,gDAAS;;AAErB;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,wCAAwC;AACrD,cAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,oEAAW;AACf;AACA;;AAEA;AACA,cAAc,SAAS;AACvB;AACA;AACA,WAAW,gDAAO;AAClB;;AAEA;AACA,aAAa,0BAA0B;AACvC,aAAa,8BAA8B;AAC3C,aAAa,wCAAwC;AACrD,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,2CAA2C;AACxD,qBAAqB;AACrB,aAAa,sEAAsE;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iDAAU,GAAG,gDAAS;;AAElD;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oEAAoE,gDAAS;AAC7E,oCAAoC,QAAQ;AAC5C;AACA,mDAAmD;AACnD;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,aAAa;AAC/B,oBAAoB,aAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iEAAe,aAAa,EAAC","sources":["webpack://@vaadin/bundles/./node_modules/ol/render/canvas/ExecutorGroup.js"],"sourcesContent":["/**\n * @module ol/render/canvas/ExecutorGroup\n */\n\nimport {ascending, descending} from '../../array.js';\nimport {createCanvasContext2D} from '../../dom.js';\nimport {buffer, createEmpty, extendCoordinate} from '../../extent.js';\nimport {transform2D} from '../../geom/flat/transform.js';\nimport {isEmpty} from '../../obj.js';\nimport {\n compose as composeTransform,\n create as createTransform,\n} from '../../transform.js';\nimport Executor from './Executor.js';\n\n/**\n * @const\n * @type {Array<import(\"../canvas.js\").BuilderType>}\n */\nexport const ALL = [\n 'Polygon',\n 'Circle',\n 'LineString',\n 'Image',\n 'Text',\n 'Default',\n];\n\n/**\n * @const\n * @type {Array<import(\"../canvas.js\").BuilderType>}\n */\nexport const DECLUTTER = ['Image', 'Text'];\n\n/**\n * @const\n * @type {Array<import(\"../canvas.js\").BuilderType>}\n */\nexport const NON_DECLUTTER = ALL.filter(\n (builderType) => !DECLUTTER.includes(builderType),\n);\n\nclass ExecutorGroup {\n /**\n * @param {import(\"../../extent.js\").Extent} maxExtent Max extent for clipping. When a\n * `maxExtent` was set on the Builder for this executor group, the same `maxExtent`\n * should be set here, unless the target context does not exceed that extent (which\n * can be the case when rendering to tiles).\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {boolean} overlaps The executor group can have overlapping geometries.\n * @param {!Object<string, !Object<import(\"../canvas.js\").BuilderType, import(\"../canvas.js\").SerializableInstructions>>} allInstructions\n * The serializable instructions.\n * @param {number} [renderBuffer] Optional rendering buffer.\n * @param {boolean} [deferredRendering] Enable deferred rendering with renderDeferred().\n */\n constructor(\n maxExtent,\n resolution,\n pixelRatio,\n overlaps,\n allInstructions,\n renderBuffer,\n deferredRendering,\n ) {\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.maxExtent_ = maxExtent;\n\n /**\n * @private\n * @type {boolean}\n */\n this.overlaps_ = overlaps;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @private\n * @type {number}\n */\n this.resolution_ = resolution;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.renderBuffer_ = renderBuffer;\n\n /**\n * @private\n * @type {!Object<string, !Object<string, import(\"./Executor\").default>>}\n */\n this.executorsByZIndex_ = {};\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.hitDetectionContext_ = null;\n\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n this.hitDetectionTransform_ = createTransform();\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.renderedContext_ = null;\n\n /**\n * @private\n * @type {Object<number, Array<import(\"./ZIndexContext.js\").default>>}\n */\n this.deferredZIndexContexts_ = {};\n\n this.createExecutors_(allInstructions, deferredRendering);\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n */\n clip(context, transform) {\n const flatClipCoords = this.getClipCoords(transform);\n context.beginPath();\n context.moveTo(flatClipCoords[0], flatClipCoords[1]);\n context.lineTo(flatClipCoords[2], flatClipCoords[3]);\n context.lineTo(flatClipCoords[4], flatClipCoords[5]);\n context.lineTo(flatClipCoords[6], flatClipCoords[7]);\n context.clip();\n }\n\n /**\n * Create executors and populate them using the provided instructions.\n * @private\n * @param {!Object<string, !Object<string, import(\"../canvas.js\").SerializableInstructions>>} allInstructions The serializable instructions\n * @param {boolean} deferredRendering Enable deferred rendering.\n */\n createExecutors_(allInstructions, deferredRendering) {\n for (const zIndex in allInstructions) {\n let executors = this.executorsByZIndex_[zIndex];\n if (executors === undefined) {\n executors = {};\n this.executorsByZIndex_[zIndex] = executors;\n }\n const instructionByZindex = allInstructions[zIndex];\n for (const builderType in instructionByZindex) {\n const instructions = instructionByZindex[builderType];\n executors[builderType] = new Executor(\n this.resolution_,\n this.pixelRatio_,\n this.overlaps_,\n instructions,\n deferredRendering,\n );\n }\n }\n }\n\n /**\n * @param {Array<import(\"../canvas.js\").BuilderType>} executors Executors.\n * @return {boolean} Has executors of the provided types.\n */\n hasExecutors(executors) {\n for (const zIndex in this.executorsByZIndex_) {\n const candidates = this.executorsByZIndex_[zIndex];\n for (let i = 0, ii = executors.length; i < ii; ++i) {\n if (executors[i] in candidates) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(import(\"../../Feature.js\").FeatureLike, import(\"../../geom/SimpleGeometry.js\").default, number): T} callback Feature callback.\n * @param {Array<import(\"../../Feature.js\").FeatureLike>} declutteredFeatures Decluttered features.\n * @return {T|undefined} Callback result.\n * @template T\n */\n forEachFeatureAtCoordinate(\n coordinate,\n resolution,\n rotation,\n hitTolerance,\n callback,\n declutteredFeatures,\n ) {\n hitTolerance = Math.round(hitTolerance);\n const contextSize = hitTolerance * 2 + 1;\n const transform = composeTransform(\n this.hitDetectionTransform_,\n hitTolerance + 0.5,\n hitTolerance + 0.5,\n 1 / resolution,\n -1 / resolution,\n -rotation,\n -coordinate[0],\n -coordinate[1],\n );\n\n const newContext = !this.hitDetectionContext_;\n if (newContext) {\n this.hitDetectionContext_ = createCanvasContext2D(\n contextSize,\n contextSize,\n undefined,\n {willReadFrequently: false},\n );\n }\n const context = this.hitDetectionContext_;\n\n if (\n context.canvas.width !== contextSize ||\n context.canvas.height !== contextSize\n ) {\n context.canvas.width = contextSize;\n context.canvas.height = contextSize;\n } else if (!newContext) {\n context.clearRect(0, 0, contextSize, contextSize);\n }\n\n /** @type {import(\"../../extent.js\").Extent|undefined} */\n let hitExtent;\n if (this.renderBuffer_ !== undefined) {\n hitExtent = createEmpty();\n extendCoordinate(hitExtent, coordinate);\n buffer(\n hitExtent,\n resolution * (this.renderBuffer_ + hitTolerance),\n hitExtent,\n );\n }\n\n const indexes = getPixelIndexArray(hitTolerance);\n\n /** @type {import(\"../canvas.js\").BuilderType} */\n let builderType;\n\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import('../../style/Style.js').DeclutterMode} declutterMode Declutter mode.\n * @return {T|undefined} Callback result.\n */\n function featureCallback(feature, geometry, declutterMode) {\n const imageData = context.getImageData(\n 0,\n 0,\n contextSize,\n contextSize,\n ).data;\n for (let i = 0, ii = indexes.length; i < ii; i++) {\n if (imageData[indexes[i]] > 0) {\n if (\n !declutteredFeatures ||\n declutterMode === 'none' ||\n (builderType !== 'Image' && builderType !== 'Text') ||\n declutteredFeatures.includes(feature)\n ) {\n const idx = (indexes[i] - 3) / 4;\n const x = hitTolerance - (idx % contextSize);\n const y = hitTolerance - ((idx / contextSize) | 0);\n const result = callback(feature, geometry, x * x + y * y);\n if (result) {\n return result;\n }\n }\n context.clearRect(0, 0, contextSize, contextSize);\n break;\n }\n }\n return undefined;\n }\n\n /** @type {Array<number>} */\n const zs = Object.keys(this.executorsByZIndex_).map(Number);\n zs.sort(ascending);\n\n let i, j, executors, executor, result;\n for (i = zs.length - 1; i >= 0; --i) {\n const zIndexKey = zs[i].toString();\n executors = this.executorsByZIndex_[zIndexKey];\n for (j = ALL.length - 1; j >= 0; --j) {\n builderType = ALL[j];\n executor = executors[builderType];\n if (executor !== undefined) {\n result = executor.executeHitDetection(\n context,\n transform,\n rotation,\n featureCallback,\n hitExtent,\n );\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n }\n\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @return {Array<number>|null} Clip coordinates.\n */\n getClipCoords(transform) {\n const maxExtent = this.maxExtent_;\n if (!maxExtent) {\n return null;\n }\n const minX = maxExtent[0];\n const minY = maxExtent[1];\n const maxX = maxExtent[2];\n const maxY = maxExtent[3];\n const flatClipCoords = [minX, minY, minX, maxY, maxX, maxY, maxX, minY];\n transform2D(flatClipCoords, 0, 8, 2, transform, flatClipCoords);\n return flatClipCoords;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return isEmpty(this.executorsByZIndex_);\n }\n\n /**\n * @param {CanvasRenderingContext2D} targetContext Context.\n * @param {import('../../size.js').Size} scaledCanvasSize Scale of the context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {boolean} snapToPixel Snap point symbols and test to integer pixel.\n * @param {Array<import(\"../canvas.js\").BuilderType>} [builderTypes] Ordered replay types to replay.\n * Default is {@link module:ol/render/replay~ALL}\n * @param {import(\"rbush\").default<import('./Executor.js').DeclutterEntry>|null} [declutterTree] Declutter tree.\n * When set to null, no decluttering is done, even when the executor group has a `ZIndexContext`.\n */\n execute(\n targetContext,\n scaledCanvasSize,\n transform,\n viewRotation,\n snapToPixel,\n builderTypes,\n declutterTree,\n ) {\n const zs = Object.keys(this.executorsByZIndex_).map(Number);\n zs.sort(declutterTree ? descending : ascending);\n\n builderTypes = builderTypes ? builderTypes : ALL;\n const maxBuilderTypes = ALL.length;\n for (let i = 0, ii = zs.length; i < ii; ++i) {\n const zIndexKey = zs[i].toString();\n const replays = this.executorsByZIndex_[zIndexKey];\n for (let j = 0, jj = builderTypes.length; j < jj; ++j) {\n const builderType = builderTypes[j];\n const replay = replays[builderType];\n if (replay !== undefined) {\n const zIndexContext =\n declutterTree === null ? undefined : replay.getZIndexContext();\n const context = zIndexContext\n ? zIndexContext.getContext()\n : targetContext;\n const requireClip =\n this.maxExtent_ &&\n builderType !== 'Image' &&\n builderType !== 'Text';\n if (requireClip) {\n context.save();\n // setup clipping so that the parts of over-simplified geometries are not\n // visible outside the current extent when panning\n this.clip(context, transform);\n }\n if (\n !zIndexContext ||\n builderType === 'Text' ||\n builderType === 'Image'\n ) {\n replay.execute(\n context,\n scaledCanvasSize,\n transform,\n viewRotation,\n snapToPixel,\n declutterTree,\n );\n } else {\n zIndexContext.pushFunction((context) =>\n replay.execute(\n context,\n scaledCanvasSize,\n transform,\n viewRotation,\n snapToPixel,\n declutterTree,\n ),\n );\n }\n if (requireClip) {\n context.restore();\n }\n if (zIndexContext) {\n zIndexContext.offset();\n const index = zs[i] * maxBuilderTypes + ALL.indexOf(builderType);\n if (!this.deferredZIndexContexts_[index]) {\n this.deferredZIndexContexts_[index] = [];\n }\n this.deferredZIndexContexts_[index].push(zIndexContext);\n }\n }\n }\n }\n\n this.renderedContext_ = targetContext;\n }\n\n getDeferredZIndexContexts() {\n return this.deferredZIndexContexts_;\n }\n\n getRenderedContext() {\n return this.renderedContext_;\n }\n\n renderDeferred() {\n const deferredZIndexContexts = this.deferredZIndexContexts_;\n const zs = Object.keys(deferredZIndexContexts).map(Number).sort(ascending);\n for (let i = 0, ii = zs.length; i < ii; ++i) {\n deferredZIndexContexts[zs[i]].forEach((zIndexContext) => {\n zIndexContext.draw(this.renderedContext_); // FIXME Pass clip to replay for temporarily enabling clip\n zIndexContext.clear();\n });\n deferredZIndexContexts[zs[i]].length = 0;\n }\n }\n}\n\n/**\n * This cache is used to store arrays of indexes for calculated pixel circles\n * to increase performance.\n * It is a static property to allow each Replaygroup to access it.\n * @type {Object<number, Array<number>>}\n */\nconst circlePixelIndexArrayCache = {};\n\n/**\n * This methods creates an array with indexes of all pixels within a circle,\n * ordered by how close they are to the center.\n * A cache is used to increase performance.\n * @param {number} radius Radius.\n * @return {Array<number>} An array with indexes within a circle.\n */\nexport function getPixelIndexArray(radius) {\n if (circlePixelIndexArrayCache[radius] !== undefined) {\n return circlePixelIndexArrayCache[radius];\n }\n\n const size = radius * 2 + 1;\n const maxDistanceSq = radius * radius;\n const distances = new Array(maxDistanceSq + 1);\n for (let i = 0; i <= radius; ++i) {\n for (let j = 0; j <= radius; ++j) {\n const distanceSq = i * i + j * j;\n if (distanceSq > maxDistanceSq) {\n break;\n }\n let distance = distances[distanceSq];\n if (!distance) {\n distance = [];\n distances[distanceSq] = distance;\n }\n distance.push(((radius + i) * size + (radius + j)) * 4 + 3);\n if (i > 0) {\n distance.push(((radius - i) * size + (radius + j)) * 4 + 3);\n }\n if (j > 0) {\n distance.push(((radius + i) * size + (radius - j)) * 4 + 3);\n if (i > 0) {\n distance.push(((radius - i) * size + (radius - j)) * 4 + 3);\n }\n }\n }\n }\n\n const pixelIndex = [];\n for (let i = 0, ii = distances.length; i < ii; ++i) {\n if (distances[i]) {\n pixelIndex.push(...distances[i]);\n }\n }\n\n circlePixelIndexArrayCache[radius] = pixelIndex;\n return pixelIndex;\n}\n\nexport default ExecutorGroup;\n"],"names":[],"sourceRoot":""}
|