@arcgis/core 4.24.0-next.20220620 → 4.24.1

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 (69) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{aa14e999e03ccb770455.js → dd51b8f77fd9472c2e54.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{6a02a75e935af0fc2b2b.js → de5c5c216a804becdaf6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{e5c8584ae764892c324d.js → ed1bb19480397d388fe9.js} +1 -1
  5. package/assets/esri/themes/base/widgets/_SnappingControls.scss +4 -0
  6. package/assets/esri/themes/dark/main.css +1 -1
  7. package/assets/esri/themes/light/main.css +1 -1
  8. package/assets/esri/themes/light/view.css +1 -1
  9. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ar.json +1 -1
  10. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bg.json +1 -1
  11. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bs.json +1 -1
  12. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ca.json +1 -1
  13. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_cs.json +1 -1
  14. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_da.json +1 -1
  15. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_de.json +1 -1
  16. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_el.json +1 -1
  17. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_es.json +1 -1
  18. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_et.json +1 -1
  19. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fi.json +1 -1
  20. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fr.json +1 -1
  21. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_he.json +1 -1
  22. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hr.json +1 -1
  23. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hu.json +1 -1
  24. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_id.json +1 -1
  25. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_it.json +1 -1
  26. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ja.json +1 -1
  27. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ko.json +1 -1
  28. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lt.json +1 -1
  29. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lv.json +1 -1
  30. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nb.json +1 -1
  31. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nl.json +1 -1
  32. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pl.json +1 -1
  33. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-BR.json +1 -1
  34. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-PT.json +1 -1
  35. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ro.json +1 -1
  36. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ru.json +1 -1
  37. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sk.json +1 -1
  38. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sl.json +1 -1
  39. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sr.json +1 -1
  40. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sv.json +1 -1
  41. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_th.json +1 -1
  42. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_tr.json +1 -1
  43. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_uk.json +1 -1
  44. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_vi.json +1 -1
  45. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-CN.json +1 -1
  46. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-HK.json +1 -1
  47. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-TW.json +1 -1
  48. package/config.js +1 -1
  49. package/interfaces.d.ts +5 -5
  50. package/package.json +1 -1
  51. package/support/revision.js +1 -1
  52. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  53. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  54. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  55. package/views/3d/terrain/TileCompositor.js +1 -1
  56. package/views/webgl/context-util.js +1 -1
  57. package/widgets/Directions.js +1 -1
  58. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  59. package/widgets/Editor/CreateWorkflow.js +1 -1
  60. package/widgets/Editor/UpdateWorkflow.js +1 -1
  61. package/widgets/Editor.js +1 -1
  62. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  63. package/widgets/FeatureForm/InputField.js +1 -1
  64. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  65. package/widgets/FeatureForm.js +1 -1
  66. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  67. package/widgets/support/SnappingControls/SnappingLayerListViewModel.js +1 -1
  68. package/widgets/support/SnappingControls/SnappingListItem.js +1 -1
  69. package/widgets/support/datePickerUtils.js +1 -1
@@ -1 +1 @@
1
- {"widgetLabel":"تبديل خريطة الأساس","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"تبديل خريطة الأساس","incompatibleSpatialReference":"تحتوي خريطة الأساس هذه على إسناد مكاني غير متوافق"}
@@ -1 +1 @@
1
- {"widgetLabel":"Превключване на базова карта","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Превключване на базова карта","incompatibleSpatialReference":"Тази базова карта има несъвместима пространствена препратка"}
@@ -1 +1 @@
1
- {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"Ova kartografska podloga sadrži nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Activa o desactiva el mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Activa o desactiva el mapa base","incompatibleSpatialReference":"Aquest mapa de base té una referència espacial no compatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"Přepnout podkladovou mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Přepnout podkladovou mapu","incompatibleSpatialReference":"Podkladová mapa nemá kompatibilní souřadnicový systém."}
@@ -1 +1 @@
1
- {"widgetLabel":"Skift baggrundskort","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Skift baggrundskort","incompatibleSpatialReference":"Dette baggrundskortet har en inkompatibel spatial reference"}
@@ -1 +1 @@
1
- {"widgetLabel":"Grundkarte wechseln","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Grundkarte wechseln","incompatibleSpatialReference":"Diese Grundkarte weist einen nicht kompatiblen Raumbezug auf."}
@@ -1 +1 @@
1
- {"widgetLabel":"Εναλλαγή υποβάθρου","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Εναλλαγή υποβάθρου","incompatibleSpatialReference":"Αυτός ο βασικός χάρτης έχει μια μη συμβατή χωρική αναφορά"}
@@ -1 +1 @@
1
- {"widgetLabel":"Cambiar el mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Cambiar el mapa base","incompatibleSpatialReference":"Este mapa base tiene una referencia espacial incompatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"Vaheta aluskaarti","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Vaheta aluskaarti","incompatibleSpatialReference":"Aluskaardil on ühildumatu koordinaatsüsteem"}
@@ -1 +1 @@
1
- {"widgetLabel":"Vaihda taustakarttaa","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Vaihda taustakarttaa","incompatibleSpatialReference":"Tässä taustakartassa on yhteensopimaton koordinaatistotieto"}
@@ -1 +1 @@
1
- {"widgetLabel":"Basculer le fond de carte","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Basculer le fond de carte","incompatibleSpatialReference":"Ce fond de carte possède une référence spatiale incompatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"הדלק או כבה מפת בסיס","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"הדלק או כבה מפת בסיס","incompatibleSpatialReference":"למפת בסיס זו יש ייחוס מרחבי לא תואם"}
@@ -1 +1 @@
1
- {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"Ova kartografska podloga sadrži nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alaptérkép átváltása","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alaptérkép átváltása","incompatibleSpatialReference":"Ez az alaptérkép egy nem kompatibilis térbeli referenciával rendelkezik"}
@@ -1 +1 @@
1
- {"widgetLabel":"Nyalakan/Matikan peta dasar","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Nyalakan/Matikan peta dasar","incompatibleSpatialReference":"Peta dasar ini memiliki referensi spasial yang tidak kompatibel"}
@@ -1 +1 @@
1
- {"widgetLabel":"Attiva/disattiva mappa di base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Attiva/disattiva mappa di base","incompatibleSpatialReference":"Questa mappa di base ha un riferimento spaziale incompatibile"}
@@ -1 +1 @@
1
- {"widgetLabel":"ベースマップの切り替え","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"ベースマップの切り替え","incompatibleSpatialReference":"このベースマップの空間参照は互換性がありません"}
@@ -1 +1 @@
1
- {"widgetLabel":"베이스맵 토글","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"베이스맵 토글","incompatibleSpatialReference":"이 베이스맵에 호환되지 않는 공간 기준 체계가 있습니다."}
@@ -1 +1 @@
1
- {"widgetLabel":"Perjungti pagrindo žemėlapį","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Perjungti pagrindo žemėlapį","incompatibleSpatialReference":"Šis pagrindo žemėlapis turi nesuderinamą erdvinę nuorodą"}
@@ -1 +1 @@
1
- {"widgetLabel":"Pārslēgt pamatkarti","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Pārslēgt pamatkarti","incompatibleSpatialReference":"Šai pamatkartei ir nesaderīga telpiskā atskaite"}
@@ -1 +1 @@
1
- {"widgetLabel":"Veksle mellom bakgrunnskart","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Veksle mellom bakgrunnskart","incompatibleSpatialReference":"Dette bakgrunnskartet har en inkompatibel romlig referanse"}
@@ -1 +1 @@
1
- {"widgetLabel":"Basiskaart in- en uitschakelen","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Basiskaart in- en uitschakelen","incompatibleSpatialReference":"Deze basiskaart heeft een incompatibele ruimtelijke referentie"}
@@ -1 +1 @@
1
- {"widgetLabel":"Przełącz mapę bazową","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Przełącz mapę bazową","incompatibleSpatialReference":"Ta mapa bazowa ma niezgodne odniesienie przestrzenne"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"Este mapa base tem uma referência espacial incompatível"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"Este mapa base contém uma referência espacial incompatível"}
@@ -1 +1 @@
1
- {"widgetLabel":"Comutare hartă fundal","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Comutare hartă fundal","incompatibleSpatialReference":"Această hartă de fundal are o referință spațială incompatibilă"}
@@ -1 +1 @@
1
- {"widgetLabel":"Переключить базовую карту","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Переключить базовую карту","incompatibleSpatialReference":"Пространственная привязка данной базовой карты несовместима."}
@@ -1 +1 @@
1
- {"widgetLabel":"Prepnúť podkladovú mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prepnúť podkladovú mapu","incompatibleSpatialReference":"Táto podkladová mapa má nekompatibilný priestorový referenčný systém"}
@@ -1 +1 @@
1
- {"widgetLabel":"Preklopi temeljno karto","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Preklopi temeljno karto","incompatibleSpatialReference":"Ta temeljna karta ima nezdružljiv koordinatni sistem"}
@@ -1 +1 @@
1
- {"widgetLabel":"Uklj./isklj. pozadinsku mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Uklj./isklj. pozadinsku mapu","incompatibleSpatialReference":"Ova pozadinska mapa ima nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Växla baskarta","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Växla baskarta","incompatibleSpatialReference":"Den här baskartan har en inkompatibel spatial referens"}
@@ -1 +1 @@
1
- {"widgetLabel":"ปุ่มสำหรับเปิดปิดแผนที่ฐาน","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"ปุ่มสำหรับเปิดปิดแผนที่ฐาน","incompatibleSpatialReference":"แผนที่ฐานนี้มีการอ้างอิงเชิงพื้นที่ที่ไม่สามารถใช้งานร่วมกันได้"}
@@ -1 +1 @@
1
- {"widgetLabel":"Altlık haritayı aç/kapat","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Altlık haritayı aç/kapat","incompatibleSpatialReference":"Bu altlık haritada uyumsuz bir mekânsal referans var"}
@@ -1 +1 @@
1
- {"widgetLabel":"Перемикнути базову карту","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Перемикнути базову карту","incompatibleSpatialReference":"Ця базова карта має несумісну просторову прив'язку"}
@@ -1 +1 @@
1
- {"widgetLabel":"Chuyển đổi bản đồ nền","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Chuyển đổi bản đồ nền","incompatibleSpatialReference":"Bản đồ nền này có tham chiếu không gian không tương thích"}
@@ -1 +1 @@
1
- {"widgetLabel":"切换底图","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切换底图","incompatibleSpatialReference":"此底图具有不兼容的空间参考"}
@@ -1 +1 @@
1
- {"widgetLabel":"切換底圖","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切換底圖","incompatibleSpatialReference":"此底圖具有不相容的空間參考"}
@@ -1 +1 @@
1
- {"widgetLabel":"切換底圖","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切換底圖","incompatibleSpatialReference":"此底圖具有不相容的空間參考"}
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";import{buildDate as r}from"./support/revision.js";const s={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.24.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const r={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.24.1";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
package/interfaces.d.ts CHANGED
@@ -66454,7 +66454,7 @@ declare namespace __esri {
66454
66454
 
66455
66455
  interface SketchLabelOptionsConstructor {
66456
66456
  /**
66457
- * The `SketchLabelOptions` allows users to configure the labels which are shown next to each segment of a graphic while sketching.
66457
+ * The `SketchLabelOptions` allows users to configure the labels which are shown next to each segment of a graphic while sketching and editing.
66458
66458
  *
66459
66459
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-interactive-sketch-SketchLabelOptions.html)
66460
66460
  */
@@ -82171,10 +82171,9 @@ declare namespace __esri {
82171
82171
  /**
82172
82172
  * The result of `visibilityExpression`.
82173
82173
  *
82174
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#evaluatedVisibility)
82174
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#evaluatedVisibilityExpression)
82175
82175
  */
82176
- readonly evaluatedVisibility: boolean;
82177
- initialState: "expanded" | "collapsed";
82176
+ readonly evaluatedVisibilityExpression: boolean;
82178
82177
  /**
82179
82178
  * The input fields belonging to this group.
82180
82179
  *
@@ -82187,6 +82186,7 @@ declare namespace __esri {
82187
82186
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#label)
82188
82187
  */
82189
82188
  readonly label: string;
82189
+ state: "expanded" | "collapsed";
82190
82190
  /**
82191
82191
  * Arcade expression to determine whether this group is visible or not.
82192
82192
  *
@@ -82222,7 +82222,7 @@ declare namespace __esri {
82222
82222
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description)
82223
82223
  */
82224
82224
  description?: string;
82225
- initialState?: "expanded" | "collapsed";
82225
+ state?: "expanded" | "collapsed";
82226
82226
  /**
82227
82227
  * Arcade expression to determine whether this group is visible or not.
82228
82228
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.24.0-next.20220620",
3
+ "version": "4.24.1",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- const a="20220620",c="f710f1c71d8fa77c80a2ad051258d8a3b312e010";export{a as buildDate,c as commitHash};
5
+ const b="20220623",c="8e53b079c0bc89b3df424a4c52ba69e6403a5507";export{b as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{h as i,d as r,r as e,c as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as u}from"../../../webgl/ProgramTemplate.js";const l=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=u(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const u=s(d),f=Math.abs(Math.cos(u)),g=Math.abs(Math.sin(u)),x=Math.round(p*f+_*g),b=Math.round(n.worldScreenWidth);if(x<=b)return!1;const j=p*g+_*f,E=b*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,j,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,u),r(P,P,this._worldDimensionsPx),o(P,P,l),!0}}export{f as WorldExtentClipRenderer};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{h as i,d as r,r as e,c as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as l}from"../../../webgl/ProgramTemplate.js";const u=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=l(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const l=s(d),f=Math.abs(Math.cos(l)),b=Math.abs(Math.sin(l)),g=Math.round(p*f+_*b),x=Math.round(n.worldScreenWidth);if(g<=x)return!1;const j=p*b+_*f,E=x*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,j,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,l),r(P,P,this._worldDimensionsPx),o(P,P,u),!0}}export{f as WorldExtentClipRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isSome as s,unwrap as r}from"../../../../core/maybe.js";import{debounce as l,isAbortError as a,eachAlways as o}from"../../../../core/promiseUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../geometry/Point.js";import u from"../../../../layers/support/PixelBlock.js";import p from"../../../../layers/support/TileInfo.js";import{update as y,unregister as d,register as g,getRasterId as m}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{extractBands as _}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{getWorldWidth as f,computeProjectedScales as w}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import"../../tiling/PagedTileQueue.js";import b from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{getWebGLCapabilities as C}from"../../../webgl/capabilities.js";import v from"../../../../geometry/Extent.js";const R=[0,0],T=i.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let V=class extends t{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.timeExtent=null,this.redrawOrRefetch=l(((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.updatingHandles.addPromise(this.doRefresh()):this.updatingHandles.addPromise(this._redrawImage(t))))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:v.fromJSON(t);y(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue.updating||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){C("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new b(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&s(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,r]=e,l=new u({width:i,height:r,pixels:[new Uint8Array(i*r)],mask:new Uint8Array(i*r),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=l),l}_fetchTile1(e,t){const i=s(t)&&t.signal,l=this.canUseWebGLForProcessing(),{layerView:a}=this,o=!a.tileInfo.isWrappable&&s(f(a.view.spatialReference)),h={allowPartialFill:!0,datumTransformation:a.datumTransformation,interpolation:l?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:l,signal:r(i),srcResolution:this._srcResolutions[e.level],timeExtent:a.timeExtent,tileInfo:a.tileInfo,disableWrapAround:o};return this.fetchTile(e,h)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new c({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=w(this.layer.rasterInfo,e),l=p.create({spatialReference:e,size:512,scales:i});(0===l.origin.x||l.origin.x>t.x)&&(l.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",l),this._srcResolutions=s??[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){this.updatingHandles.addPromise(this._enqueueTileFetch1(e,t))}async _enqueueTileFetch1(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key),{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){a(i)&&T.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(R,e.key),o=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:l,resolution:o}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(i){a(i)||T.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await o(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:_(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map((e=>255*e)),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),l=i?.multidimensionalInfo?s.getSliceIndex(r):null,a=m(t,l);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=g(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];y(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.tiles.forEach((t=>e.push(this._enqueueTileFetch(t)))),await o(e)}};e([h()],V.prototype,"_fetchQueue",void 0),e([h()],V.prototype,"_globalUpdateRequested",void 0),e([h()],V.prototype,"attached",void 0),e([h()],V.prototype,"container",void 0),e([h()],V.prototype,"layer",void 0),e([h()],V.prototype,"layerView",void 0),e([h()],V.prototype,"type",void 0),e([h()],V.prototype,"useWebGLForProcessing",null),e([h()],V.prototype,"useProgressiveUpdate",null),e([h()],V.prototype,"timeExtent",void 0),e([h()],V.prototype,"updating",null),V=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],V);export{V as BaseImageryTileSubView2D};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isSome as s,unwrap as r}from"../../../../core/maybe.js";import{debounce as l,isAbortError as a,eachAlways as o}from"../../../../core/promiseUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../geometry/Point.js";import u from"../../../../layers/support/PixelBlock.js";import p from"../../../../layers/support/TileInfo.js";import{update as y,unregister as d,register as g,getRasterId as m}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{extractBands as _}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{getWorldWidth as f,computeProjectedScales as w}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import"../../tiling/PagedTileQueue.js";import b from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{getWebGLCapabilities as C}from"../../../webgl/capabilities.js";import v from"../../../../geometry/Extent.js";const R=[0,0],T=i.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let V=class extends t{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.timeExtent=null,this.redrawOrRefetch=l(((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.updatingHandles.addPromise(this.doRefresh()):this.updatingHandles.addPromise(this._redrawImage(t))))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:v.fromJSON(t);y(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue?.updating||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){C("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new b(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&s(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,r]=e,l=new u({width:i,height:r,pixels:[new Uint8Array(i*r)],mask:new Uint8Array(i*r),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=l),l}_fetchTile1(e,t){const i=s(t)&&t.signal,l=this.canUseWebGLForProcessing(),{layerView:a}=this,o=!a.tileInfo.isWrappable&&s(f(a.view.spatialReference)),h={allowPartialFill:!0,datumTransformation:a.datumTransformation,interpolation:l?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:l,signal:r(i),srcResolution:this._srcResolutions[e.level],timeExtent:a.timeExtent,tileInfo:a.tileInfo,disableWrapAround:o};return this.fetchTile(e,h)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new c({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=w(this.layer.rasterInfo,e),l=p.create({spatialReference:e,size:512,scales:i});(0===l.origin.x||l.origin.x>t.x)&&(l.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",l),this._srcResolutions=s??[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){this.updatingHandles.addPromise(this._enqueueTileFetch1(e,t))}async _enqueueTileFetch1(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key),{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){a(i)&&T.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(R,e.key),o=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:l,resolution:o}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(i){a(i)||T.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await o(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:_(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map((e=>255*e)),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),l=i?.multidimensionalInfo?s.getSliceIndex(r):null,a=m(t,l);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=g(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];y(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.tiles.forEach((t=>e.push(this._enqueueTileFetch(t)))),await o(e)}};e([h()],V.prototype,"_fetchQueue",void 0),e([h()],V.prototype,"_globalUpdateRequested",void 0),e([h()],V.prototype,"attached",void 0),e([h()],V.prototype,"container",void 0),e([h()],V.prototype,"layer",void 0),e([h()],V.prototype,"layerView",void 0),e([h()],V.prototype,"type",void 0),e([h()],V.prototype,"useWebGLForProcessing",null),e([h()],V.prototype,"useProgressiveUpdate",null),e([h()],V.prototype,"timeExtent",void 0),e([h()],V.prototype,"updating",null),V=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],V);export{V as BaseImageryTileSubView2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{someMap as r}from"../../../../core/MapUtils.js";import{isSome as a,destroyMaybe as n,isNone as o,unwrap as u}from"../../../../core/maybe.js";import{isAbortError as l,eachAlways as h}from"../../../../core/promiseUtils.js";import{on as c}from"../../../../core/reactiveUtils.js";import{schedule as d}from"../../../../core/scheduling.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as m,equals as g,clone as F,expand as y,toExtent as _}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as T,hasVertices as x}from"../../../../layers/graphics/dehydratedFeatures.js";import E from"../../../../rest/support/QuantizationParameters.js";import C from"../../../../rest/support/Query.js";import{ViewingMode as R}from"../../../ViewingMode.js";import{MultiFeatureReference as b,SingleFeatureReference as v}from"./featureReference.js";import{FAILED_FEATURE_COUNT as M,FetchStatus as D,FeatureTile as w}from"./FeatureTile.js";import{tilesAreRelated as j}from"../../terrain/tileUtils.js";import{ImmediateTask as O,TaskPriority as P}from"../../../support/Scheduler.js";const N=i.getLogger("esri.views.3d.layers.support.FeatureTileFetcher3D");let U=class extends t{constructor(e){super(e),this._useTileCount=!1,this.updating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this.maximumNumberOfFeaturesExceededThrottle=1e3,this._fullRatio=1,this._farRatio=1,this.changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this.handles=new s,this._frameTask=O,this._dirty=!1,this.featureTiles=new Map,this.displayingFeatureReferences=new Map,this.numDisplayingFeatureReferences=0,this.suspended=!0,this.pendingEdits=null}set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this.supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&a(this.context.query.queryFeatureCount)}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get memoryForUnusedFeatures(){let e=0;return this.featureTiles.forEach((t=>e+=t.estimatedUnusedSize)),e}get totalVertices(){let e=0;return this.featureTiles.forEach((t=>e+=t.numVertices)),e}get totalFeatures(){let e=0;return this.featureTiles.forEach((t=>e+=t.numFeatures)),e}set filterExtent(e){if(e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void N.error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||t&&e&&t.equals(e))return;const s=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}initialize(){this.handles.add(c((()=>this.tileDescriptors),"change",(()=>this._setDirty()),{onListenerAdd:()=>this._setDirty()})),this.objectIdField=this.context.objectIdField,this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?b:v;const e=this.context.scheduler;a(e)&&(this._frameTask=e.registerTask(P.FEATURE_TILE_FETCHER,this)),this._setDirty()}destroy(){this._frameTask.remove(),this.handles=n(this.handles),this.featureTiles.forEach((e=>{this._cancelFetchTile(e),this._removeTile(e)})),this.featureTiles.clear(),this.displayingFeatureReferences.clear(),this.pendingEdits&&(this.pendingEdits.controller.abort(),this.pendingEdits=null)}get paused(){return this.suspended||!!this.pendingEdits}restart(){this.featureTiles.forEach((e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)})),a(this.context.memoryCache)&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this.featureTiles.forEach((e=>{this._cancelFetchTile(e),this._resetFetchTile(e)})),a(this.context.memoryCache)&&this.context.memoryCache.clear(),this._setDirty()}suspend(){this.suspended||(this.suspended=!0,this._pause(),this._setDirty())}resume(){this.suspended&&(this.suspended=!1,this._unpause())}_pause(){this.paused&&(this.featureTiles.forEach((e=>this._cancelFetchTile(e))),this._updated())}_unpause(){this.paused||(this._setDirty(),this._updated())}get availableFields(){let e=null;return this.featureTiles.forEach((t=>{o(t.displayingFeatures)||0===t.displayingFeatures.length||(o(e)?e=new Set(t.availableFields):e.forEach((s=>{t.availableFields.has(s)||u(e).delete(s)})))})),a(e)?e:new Set}applyEdits(e){this.pendingEdits||(this.pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this.pendingEdits;t.count++;const s=t.edits.then((()=>e.result.catch((e=>{if(l(e))throw e;return null})).then((e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then((()=>e))):e)).then((e=>(0==--t.count&&(this.pendingEdits===t&&(this.pendingEdits=null),a(this.context.memoryCache)&&this.context.memoryCache.clear(),this._unpause(),this._updated()),e)))));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),i=new Set,r=this.objectIdField;e.forEach((({objectId:e,globalId:a})=>{if((!e||e<0)&&t){s||N.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`);const e=this.features.find((e=>e.attributes&&e.attributes[t]===a));e&&i.add(T(e,r))}else i.add(e)})),this.featureTiles.forEach((e=>{if(!e.features)return;const t=e.features.filter((e=>!i.has(T(e,this.objectIdField))));t.length!==e.features.length&&(e.setFeatures(t,0,e.availableFields),this._invalidateCounts())}))}async _applyEditsAddUpdateFeatures(e,t,s){const i=[],r=new Set;if(e.forEach((e=>i.push(e.objectId))),t.forEach((e=>{i.push(e.objectId),r.add(e.objectId)})),0===i.length)return;const a=[];this.featureTiles.forEach((e=>{const t=this._applyEditsAddUpdateTile(e,i,r,s);t&&a.push(t)})),await h(a)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=t;const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter((e=>!s.has(T(e,this.objectIdField))));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),e.setFeatures(n,0,H(e.availableFields,a.fields)),this._invalidateCounts())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:B})}_setDirty(){this._dirty=!0,this._updated()}get running(){return this.updating}runTask(e){if(this._frameTask.processQueue(e),!this._dirty||!this.constructed)return;this._dirty=!1;const t=this._getListOfTiles();if(this._markTilesNotAlive(t),!e.run((()=>this._addTiles(t,e)))||!e.run((()=>this._filterExtentTiles(t,e)))||!e.run((()=>this._removeTiles(t,e)))||e.done)return void this._setDirty();const s=this._sortTiles(t);e.run((()=>this._displayTiles(s,e)))&&e.run((()=>this._fetchTiles(s,e)))&&e.run((()=>this._updateMemoryEstimates(s,e)))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!this.suspended&&(this.tileDescriptors.forEach((s=>{const i=this.featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())})),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort(((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority)),e}_displayTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;return e.reduceFeatures(t,this.memoryFactor,this.objectIdField)&&this._setDirty(),this._showTile(e)};for(const r of e)if(!t.run((()=>i(r)))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this.paused)return!1;let s=!1;for(const i of e){if(!i.needsFetching)continue;const e=a(this.context.memoryCache)?this.context.memoryCache.pop(i.id):null;if(a(e))i.cache=e,this._setDirty(),this._scheduleUpdated(),t.madeProgress();else{if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,(()=>i.numFeatures=M)),s=!0,t.madeProgress()}if(t.done)return!0}}if(s)return t.hasProgressed;for(const i of e)if(i.needsFetching){const e=new AbortController,s=this._fetchTile(i,e.signal);if(this._handleRequest(i,s,e,(e=>{i.setFeatures([],0,null),this._invalidateCounts(),i.featuresMissing=!1,this.context.logFetchError(N,e)})),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some((e=>!t.run((()=>e.updateMemoryEstimates()))&&(this._setDirty(),!0))),t.hasProgressed}_reclip(e,t){if(!this.constructed)return;const s=new Array;this.featureTiles.forEach((i=>{o(i.displayingFeatures)||0===i.displayingFeatures.length||(i.intersectionIncludingBorrowed(t,V),i.intersectionIncludingBorrowed(e,z),g(V,z)||s.push(i))})),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this.changes.updates;for(const i of e)if(!o(i.displayingFeatures))for(const e of i.displayingFeatures){const i=T(e,this.objectIdField);if(t.has(i))continue;t.add(i);const{feature:r}=this.displayingFeatureReferences.get(i);s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;this.paused||this.featureTiles.forEach((t=>t.isFetching?++e:0));const t=this._dirty||e>0||!!this.pendingEdits;if(this._set("updating",t),t){let t=0,s=0,i=0,r=0,n=0;const o=this.displayingFeatureReferences.size/this.numDisplayingFeatureReferences;this.featureTiles.forEach((e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=a(e.displayingFeatures)?e.displayingFeatures.length*o:0;n+=t-s}e.needsFetching?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)})),r+=e;let u=0,l=0;t?(l=t,u=Math.min(r*t/i,t)):(l=s,u=r),n=Math.min(this.maximumNumberOfFeatures-this.features.length,n),this._set("updatingTotal",l),this._set("updatingRemaining",u),this._set("expectedFeatureDiff",n)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const e=r(this.featureTiles,(e=>e.perTileMaximumNumberOfFeaturesExceeded));this._set("maximumNumberOfFeaturesExceeded",e)}_updateRatio(e){const t=q(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this.featureTiles.forEach((e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.features&&(e.features.length>=t||e.fetchStatus===D.FULL)||(this._cancelFetchTile(e),this._resetFetchTile(e))})),this._setDirty())}_addTile(e){const t=new w(e);return this.featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.descriptor.resolution;this.featureTiles.forEach((s=>{if(!(o(s.displayingFeatures)||e===s||e.descriptor.lij&&s.descriptor.lij&&!j(e.descriptor.lij,s.descriptor.lij))){o(e.displayingFeatures)&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(o(e.extentIncludingBorrowedFeatures)&&(e.extentIncludingBorrowedFeatures=F(e.descriptor.extent)),y(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this.displayingFeatureReferences.get(T(i,this.objectIdField));s.ref(s.feature,t),this.numDisplayingFeatureReferences++}}})),e.featureLimit=a(e.displayingFeatures)?e.displayingFeatures.length:0}_removeTile(e){this._clearTile(e),this.featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetching&&(e.fetchStatus=D.DONE):e.fetchStatus=D.FETCH_NEEDED}_cancelFetchTile(e){const t=e.requestController;a(t)&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){return e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._getListOfTiles()),e.fetchStatus===D.REFETCHING?D.REFETCH_NEEDED:D.FETCH_NEEDED}async _fetchTile(e,t){const s=this._maximumFeaturesForTile(e);if(s<=0)return L(e);const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(I(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>C.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=Math.ceil(s/i),e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}const{features:n,exceededTransferLimit:o,fields:u}=await this._queryFeatures(a,t),l=o?a.maxRecordCountFactor>=C.MAX_MAX_RECORD_COUNT_FACTOR?D.FULL:D.DONE:D.FULL;return await this._frameTask.schedule((()=>{e.featuresMissing=n.length<e.numFeatures||o;const t=this._removeEmptyFeatures(n);e.setFeatures(n,t,Q(u))}),t),this._invalidateCounts(),l}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,n=this._maximumFeaturesForTile(e)-a;const o=this._getMaxRecordCount(e);let l=null;for(;;){const h=this._createQuery(e),c=this._setPagingParameters(h,i,n,o),{features:d,exceededTransferLimit:p,fields:f}=await this._queryFeatures(h,t);if(await this._frameTask.schedule((()=>{c&&(i+=u(h.num)),a+=d.length,r+=this._removeEmptyFeatures(d),e.featuresMissing=i<e.numFeatures||p,s=s?s.concat(d):d,l=H(l,f),e.setFeatures(s,r,l)}),t),this._invalidateCounts(),this._setDirty(),n=this._maximumFeaturesForTile(e)-a,!c||!p||n<=0)return p?D.DONE:D.FULL}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery(),s=e.descriptor.extent;if(s){const e=this.context.tilingScheme.spatialReference;t.geometry=_(s,e)}return this._setResolutionParams(t,e),this._useTileQuery(e)?t.resultType="tile":this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(null==e.descriptor.resolution)return null;const t=this.context.viewingMode===R.Global?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.descriptor.resolution,t)/this.lodFactor}get supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){if(!this.supportsResolution)return;const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new E({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e){const t=e.length;for(let s=0;s<e.length;){const t=e[s];x(t.geometry)?++s:(e[s]=e[e.length-1],--e.length)}return t-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!I(e)}_getMaxRecordCount(e){const{tileMaxRecordCount:t,maxRecordCount:s}=this.context;return this._useTileQuery(e)&&a(t)&&t>0&&this.context.capabilities.supportsResultType?t:a(s)&&s>0?s:k}_useTileQuery(e){return(!I(e)||!this.context.capabilities.supportsCacheHint)&&this.context.capabilities.supportsResultType}_handleRequest(e,t,s,i){e.fetchStatus=e.needsRefetching?D.REFETCHING:D.FETCHING,e.requestController=s;let r=!1;t.then((t=>{e.requestController=null,e.fetchStatus=t})).catch((t=>{e.requestController===s&&(e.requestController=null,e.fetchStatus=D.DONE),l(t)?r=!0:i(t)})).then((()=>{r||this._setDirty(),this._scheduleUpdated()}))}_scheduleUpdated(){this.handles&&!this.handles.has("scheduleUpdated")&&this.handles.add(d((()=>{this.handles.remove("scheduleUpdated"),this._updated()})),"scheduleUpdated")}_showTile(e){if(a(e.displayingFeatures)&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=a(e.displayingFeatures)&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.descriptor.resolution,i=this.changes.updates,r=this.changes.adds,n=Math.min(e.featureLimit,t.length);e.featureLimit=n;for(let a=0;a<n;++a){const e=t[a],n=T(e,this.objectIdField),o=this.displayingFeatureReferences.get(n);if(o){const t=o.ref(e,s);t.oldVersion!==t.newVersion&&(i.removes.push(t.oldVersion),i.adds.push(t.newVersion))}else this.displayingFeatureReferences.set(n,new this.FeatureReferenceClass(e,s)),r.push(e);this.numDisplayingFeatureReferences++}return this._hideTileFeatures(e),this._applyChanges(),e.displayingFeatures=t.slice(0,n),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(o(e.displayingFeatures))return;const t=this.changes.updates,s=this.changes.removes;for(const i of e.displayingFeatures){const r=T(i,this.objectIdField),a=this.displayingFeatureReferences.get(r);if(!a)continue;const n=a.unref(e.descriptor.resolution);this.numDisplayingFeatureReferences--,n?n.oldVersion!==n.newVersion&&(null==n.newVersion?(this.displayingFeatureReferences.delete(r),s.push(n.oldVersion)):(t.adds.push(n.newVersion),t.removes.push(n.oldVersion))):console.error("Hiding unreferenced feature")}this._applyChanges(),e.displayingFeatures=null}_applyChanges(){const e=this.changes.updates;e.removes.length>0&&(this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this.features.addMany(e.adds),e.adds.length=0);const t=this.changes.adds,s=this.changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+G,i);this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&this.features.addMany(0===r?t:t.slice(r)),s.length>i&&this.features.removeMany(0===r?s:s.slice(r)),t.length=0,s.length=0}_clearTile(e){if(this._hideTile(e),e.features&&a(this.context.memoryCache)){const t=16+e.estimatedSize;this.context.memoryCache.put(e.id,e.cache,t)}e.setFeatures(null,0,null),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this.featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce(((e,t)=>e+(t.features?t.features.length:0)),0)}_maximumFeaturesForTile(e){const t=e.hasPreciseFeatureCount?e.numFeatures:1/0,s=e.hasPreciseFeatureCount?t:this.maximumNumberOfFeatures,i=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(s*i/(1-e.emptyFeatureRatio)),t)}get test(){return{process:e=>this.runTask(e),getFeatureTileById:e=>this.featureTiles.get(e),forEachFeatureTile:e=>this.featureTiles.forEach(e)}}};function I(e){return"dummy-tile-full-extent"===e.id}function q(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function A(e){const t=e.capabilities.query;return{supportsMultipleResolutions:S(e),supportsPagination:!(!t||!t.supportsPagination),supportsResultType:!(!t||!t.supportsResultType),supportsCacheHint:!(!t||!t.supportsCacheHint),supportsQuantization:!(!t||!t.supportsQuantization),supportsQuantizationEditMode:!(!t||!t.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!t||!t.supportsMaxRecordCountFactor),supportsFormatPBF:!(!t||!t.supportsFormatPBF)}}function S(e){switch(e.geometryType){case"polyline":return!0;case"polygon":return e.capabilities&&e.capabilities.query&&e.capabilities.query.supportsQuantization;default:return!1}}function L(e){return e.setFeatures([],0,null),e.featuresMissing=!1,D.DONE}function Q(e){return o(e)?new Set:new Set(e.map((e=>e.name)))}function H(e,t){if(o(e)||o(t))return Q(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}e([p({constructOnly:!0})],U.prototype,"features",void 0),e([p()],U.prototype,"tileDescriptors",void 0),e([p({value:1/0})],U.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],U.prototype,"memoryFactor",null),e([p({value:1})],U.prototype,"lodFactor",null),e([p()],U.prototype,"useTileCount",null),e([p({readOnly:!0})],U.prototype,"updating",void 0),e([p({readOnly:!0})],U.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],U.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],U.prototype,"expectedFeatureDiff",void 0),e([p({readOnly:!0})],U.prototype,"memoryForUnusedFeatures",null),e([p({readOnly:!0})],U.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({constructOnly:!0})],U.prototype,"maximumNumberOfFeaturesExceededThrottle",void 0),e([p({readOnly:!0})],U.prototype,"totalVertices",null),e([p({readOnly:!0})],U.prototype,"totalFeatures",null),e([p()],U.prototype,"filterExtent",null),e([p({constructOnly:!0})],U.prototype,"context",void 0),U=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],U);const k=2e3,V=m(),z=m(),B=6e5,G=200;export{U as FeatureTileFetcher3D,A as contextCapabilitiesFromLayer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{someMap as r}from"../../../../core/MapUtils.js";import{isSome as a,destroyMaybe as n,isNone as o,unwrap as u}from"../../../../core/maybe.js";import{isAbortError as l,eachAlways as h,throwIfAborted as c}from"../../../../core/promiseUtils.js";import{on as d}from"../../../../core/reactiveUtils.js";import{schedule as p}from"../../../../core/scheduling.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as g,equals as F,clone as y,expand as _,toExtent as T}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as x,hasVertices as E}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import R from"../../../../rest/support/Query.js";import{ViewingMode as b}from"../../../ViewingMode.js";import{MultiFeatureReference as v,SingleFeatureReference as M}from"./featureReference.js";import{FAILED_FEATURE_COUNT as D,FetchStatus as w,FeatureTile as j}from"./FeatureTile.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as P,TaskPriority as N}from"../../../support/Scheduler.js";const U=i.getLogger("esri.views.3d.layers.support.FeatureTileFetcher3D");let I=class extends t{constructor(e){super(e),this._useTileCount=!1,this.updating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this.maximumNumberOfFeaturesExceededThrottle=1e3,this._fullRatio=1,this._farRatio=1,this.changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this.handles=new s,this._frameTask=P,this._dirty=!1,this.featureTiles=new Map,this.displayingFeatureReferences=new Map,this.numDisplayingFeatureReferences=0,this.suspended=!0,this.pendingEdits=null}set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this.supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&a(this.context.query.queryFeatureCount)}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get memoryForUnusedFeatures(){let e=0;return this.featureTiles.forEach((t=>e+=t.estimatedUnusedSize)),e}get totalVertices(){let e=0;return this.featureTiles.forEach((t=>e+=t.numVertices)),e}get totalFeatures(){let e=0;return this.featureTiles.forEach((t=>e+=t.numFeatures)),e}set filterExtent(e){if(e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void U.error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||t&&e&&t.equals(e))return;const s=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}initialize(){this.handles.add(d((()=>this.tileDescriptors),"change",(()=>this._setDirty()),{onListenerAdd:()=>this._setDirty()})),this.objectIdField=this.context.objectIdField,this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?v:M;const e=this.context.scheduler;a(e)&&(this._frameTask=e.registerTask(N.FEATURE_TILE_FETCHER,this)),this._setDirty()}destroy(){this._frameTask.remove(),this.handles=n(this.handles),this.featureTiles.forEach((e=>{this._cancelFetchTile(e),this._removeTile(e)})),this.featureTiles.clear(),this.displayingFeatureReferences.clear(),this.pendingEdits&&(this.pendingEdits.controller.abort(),this.pendingEdits=null)}get paused(){return this.suspended||!!this.pendingEdits}restart(){this.featureTiles.forEach((e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)})),a(this.context.memoryCache)&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this.featureTiles.forEach((e=>{this._cancelFetchTile(e),this._resetFetchTile(e)})),a(this.context.memoryCache)&&this.context.memoryCache.clear(),this._setDirty()}suspend(){this.suspended||(this.suspended=!0,this._pause(),this._setDirty())}resume(){this.suspended&&(this.suspended=!1,this._unpause())}_pause(){this.paused&&(this.featureTiles.forEach((e=>this._cancelFetchTile(e))),this._updated())}_unpause(){this.paused||(this._setDirty(),this._updated())}get availableFields(){let e=null;return this.featureTiles.forEach((t=>{o(t.displayingFeatures)||0===t.displayingFeatures.length||(o(e)?e=new Set(t.availableFields):e.forEach((s=>{t.availableFields.has(s)||u(e).delete(s)})))})),a(e)?e:new Set}applyEdits(e){this.pendingEdits||(this.pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this.pendingEdits;t.count++;const s=t.edits.then((()=>e.result.catch((e=>{if(l(e))throw e;return null})).then((e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then((()=>e))):e)).then((e=>(0==--t.count&&(this.pendingEdits===t&&(this.pendingEdits=null),a(this.context.memoryCache)&&this.context.memoryCache.clear(),this._unpause(),this._updated()),e)))));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),i=new Set,r=this.objectIdField;e.forEach((({objectId:e,globalId:a})=>{if((!e||e<0)&&t){s||U.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`);const e=this.features.find((e=>e.attributes&&e.attributes[t]===a));e&&i.add(x(e,r))}else i.add(e)})),this.featureTiles.forEach((e=>{if(!e.features)return;const t=e.features.filter((e=>!i.has(x(e,this.objectIdField))));t.length!==e.features.length&&(e.setFeatures(t,0,e.availableFields),this._invalidateCounts())}))}async _applyEditsAddUpdateFeatures(e,t,s){const i=[],r=new Set;if(e.forEach((e=>i.push(e.objectId))),t.forEach((e=>{i.push(e.objectId),r.add(e.objectId)})),0===i.length)return;const a=[];this.featureTiles.forEach((e=>{const t=this._applyEditsAddUpdateTile(e,i,r,s);t&&a.push(t)})),await h(a)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=t;const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter((e=>!s.has(x(e,this.objectIdField))));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),e.setFeatures(n,0,k(e.availableFields,a.fields)),this._invalidateCounts())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:G})}_setDirty(){this._dirty=!0,this._updated()}get running(){return this.updating}runTask(e){if(this._frameTask.processQueue(e),!this._dirty||!this.constructed)return;this._dirty=!1;const t=this._getListOfTiles();if(this._markTilesNotAlive(t),!e.run((()=>this._addTiles(t,e)))||!e.run((()=>this._filterExtentTiles(t,e)))||!e.run((()=>this._removeTiles(t,e)))||e.done)return void this._setDirty();const s=this._sortTiles(t);e.run((()=>this._displayTiles(s,e)))&&e.run((()=>this._fetchTiles(s,e)))&&e.run((()=>this._updateMemoryEstimates(s,e)))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!this.suspended&&(this.tileDescriptors.forEach((s=>{const i=this.featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())})),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort(((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority)),e}_displayTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;return e.reduceFeatures(t,this.memoryFactor,this.objectIdField)&&this._setDirty(),this._showTile(e)};for(const r of e)if(!t.run((()=>i(r)))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this.paused)return!1;let s=!1;for(const i of e){if(!i.needsFetching)continue;const e=a(this.context.memoryCache)?this.context.memoryCache.pop(i.id):null;if(a(e))i.cache=e,this._setDirty(),this._scheduleUpdated(),t.madeProgress();else{if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,(()=>i.numFeatures=D)),s=!0,t.madeProgress()}if(t.done)return!0}}if(s)return t.hasProgressed;for(const i of e)if(i.needsFetching){const e=new AbortController,s=this._fetchTile(i,e.signal);if(this._handleRequest(i,s,e,(e=>{i.setFeatures([],0,null),this._invalidateCounts(),i.featuresMissing=!1,this.context.logFetchError(U,e)})),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some((e=>!t.run((()=>e.updateMemoryEstimates()))&&(this._setDirty(),!0))),t.hasProgressed}_reclip(e,t){if(!this.constructed)return;const s=new Array;this.featureTiles.forEach((i=>{o(i.displayingFeatures)||0===i.displayingFeatures.length||(i.intersectionIncludingBorrowed(t,z),i.intersectionIncludingBorrowed(e,B),F(z,B)||s.push(i))})),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this.changes.updates;for(const i of e)if(!o(i.displayingFeatures))for(const e of i.displayingFeatures){const i=x(e,this.objectIdField);if(t.has(i))continue;t.add(i);const{feature:r}=this.displayingFeatureReferences.get(i);s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;this.paused||this.featureTiles.forEach((t=>t.isFetching?++e:0));const t=this._dirty||e>0||!!this.pendingEdits;if(this._set("updating",t),t){let t=0,s=0,i=0,r=0,n=0;const o=this.displayingFeatureReferences.size/this.numDisplayingFeatureReferences;this.featureTiles.forEach((e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=a(e.displayingFeatures)?e.displayingFeatures.length*o:0;n+=t-s}e.needsFetching?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)})),r+=e;let u=0,l=0;t?(l=t,u=Math.min(r*t/i,t)):(l=s,u=r),n=Math.min(this.maximumNumberOfFeatures-this.features.length,n),this._set("updatingTotal",l),this._set("updatingRemaining",u),this._set("expectedFeatureDiff",n)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const e=r(this.featureTiles,(e=>e.perTileMaximumNumberOfFeaturesExceeded));this._set("maximumNumberOfFeaturesExceeded",e)}_updateRatio(e){const t=A(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this.featureTiles.forEach((e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.features&&(e.features.length>=t||e.fetchStatus===w.FULL)||(this._cancelFetchTile(e),this._resetFetchTile(e))})),this._setDirty())}_addTile(e){const t=new j(e);return this.featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.descriptor.resolution;this.featureTiles.forEach((s=>{if(!(o(s.displayingFeatures)||e===s||e.descriptor.lij&&s.descriptor.lij&&!O(e.descriptor.lij,s.descriptor.lij))){o(e.displayingFeatures)&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(o(e.extentIncludingBorrowedFeatures)&&(e.extentIncludingBorrowedFeatures=y(e.descriptor.extent)),_(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this.displayingFeatureReferences.get(x(i,this.objectIdField));s.ref(s.feature,t),this.numDisplayingFeatureReferences++}}})),e.featureLimit=a(e.displayingFeatures)?e.displayingFeatures.length:0}_removeTile(e){this._clearTile(e),this.featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetching&&(e.fetchStatus=w.DONE):e.fetchStatus=w.FETCH_NEEDED}_cancelFetchTile(e){const t=e.requestController;a(t)&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){return e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._getListOfTiles()),e.fetchStatus===w.REFETCHING?w.REFETCH_NEEDED:w.FETCH_NEEDED}async _fetchTile(e,t){const s=this._maximumFeaturesForTile(e);if(s<=0)return Q(e);const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(q(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>R.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=Math.ceil(s/i),e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}const{features:n,exceededTransferLimit:o,fields:u}=await this._queryFeatures(a,t),l=o?a.maxRecordCountFactor>=R.MAX_MAX_RECORD_COUNT_FACTOR?w.FULL:w.DONE:w.FULL;return await this._frameTask.schedule((()=>{e.featuresMissing=n.length<e.numFeatures||o;const t=this._removeEmptyFeatures(n);e.setFeatures(n,t,H(u))}),t),c(t),this._invalidateCounts(),l}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,n=this._maximumFeaturesForTile(e)-a;const o=this._getMaxRecordCount(e);let l=null;for(;;){const h=this._createQuery(e),d=this._setPagingParameters(h,i,n,o),{features:p,exceededTransferLimit:f,fields:m}=await this._queryFeatures(h,t);if(await this._frameTask.schedule((()=>{d&&(i+=u(h.num)),a+=p.length,r+=this._removeEmptyFeatures(p),e.featuresMissing=i<e.numFeatures||f,s=s?s.concat(p):p,l=k(l,m),e.setFeatures(s,r,l)}),t),c(t),this._invalidateCounts(),this._setDirty(),n=this._maximumFeaturesForTile(e)-a,!d||!f||n<=0)return f?w.DONE:w.FULL}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery(),s=e.descriptor.extent;if(s){const e=this.context.tilingScheme.spatialReference;t.geometry=T(s,e)}return this._setResolutionParams(t,e),this._useTileQuery(e)?t.resultType="tile":this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(null==e.descriptor.resolution)return null;const t=this.context.viewingMode===b.Global?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.descriptor.resolution,t)/this.lodFactor}get supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){if(!this.supportsResolution)return;const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e){const t=e.length;for(let s=0;s<e.length;){const t=e[s];E(t.geometry)?++s:(e[s]=e[e.length-1],--e.length)}return t-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!q(e)}_getMaxRecordCount(e){const{tileMaxRecordCount:t,maxRecordCount:s}=this.context;return this._useTileQuery(e)&&a(t)&&t>0&&this.context.capabilities.supportsResultType?t:a(s)&&s>0?s:V}_useTileQuery(e){return(!q(e)||!this.context.capabilities.supportsCacheHint)&&this.context.capabilities.supportsResultType}_handleRequest(e,t,s,i){e.fetchStatus=e.needsRefetching?w.REFETCHING:w.FETCHING,e.requestController=s;let r=!1;t.then((t=>{e.requestController=null,e.fetchStatus=t})).catch((t=>{e.requestController===s&&(e.requestController=null,e.fetchStatus=w.DONE),l(t)?r=!0:i(t)})).then((()=>{r||this._setDirty(),this._scheduleUpdated()}))}_scheduleUpdated(){this.handles&&!this.handles.has("scheduleUpdated")&&this.handles.add(p((()=>{this.handles.remove("scheduleUpdated"),this._updated()})),"scheduleUpdated")}_showTile(e){if(a(e.displayingFeatures)&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=a(e.displayingFeatures)&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.descriptor.resolution,i=this.changes.updates,r=this.changes.adds,n=Math.min(e.featureLimit,t.length);e.featureLimit=n;for(let a=0;a<n;++a){const e=t[a],n=x(e,this.objectIdField),o=this.displayingFeatureReferences.get(n);if(o){const t=o.ref(e,s);t.oldVersion!==t.newVersion&&(i.removes.push(t.oldVersion),i.adds.push(t.newVersion))}else this.displayingFeatureReferences.set(n,new this.FeatureReferenceClass(e,s)),r.push(e);this.numDisplayingFeatureReferences++}return this._hideTileFeatures(e),this._applyChanges(),e.displayingFeatures=t.slice(0,n),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(o(e.displayingFeatures))return;const t=this.changes.updates,s=this.changes.removes;for(const i of e.displayingFeatures){const r=x(i,this.objectIdField),a=this.displayingFeatureReferences.get(r);if(!a)continue;const n=a.unref(e.descriptor.resolution);this.numDisplayingFeatureReferences--,n?n.oldVersion!==n.newVersion&&(null==n.newVersion?(this.displayingFeatureReferences.delete(r),s.push(n.oldVersion)):(t.adds.push(n.newVersion),t.removes.push(n.oldVersion))):console.error("Hiding unreferenced feature")}this._applyChanges(),e.displayingFeatures=null}_applyChanges(){const e=this.changes.updates;e.removes.length>0&&(this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this.features.addMany(e.adds),e.adds.length=0);const t=this.changes.adds,s=this.changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+X,i);this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&this.features.addMany(0===r?t:t.slice(r)),s.length>i&&this.features.removeMany(0===r?s:s.slice(r)),t.length=0,s.length=0}_clearTile(e){if(this._hideTile(e),e.features&&a(this.context.memoryCache)){const t=16+e.estimatedSize;this.context.memoryCache.put(e.id,e.cache,t)}e.setFeatures(null,0,null),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this.featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce(((e,t)=>e+(t.features?t.features.length:0)),0)}_maximumFeaturesForTile(e){const t=e.hasPreciseFeatureCount?e.numFeatures:1/0,s=e.hasPreciseFeatureCount?t:this.maximumNumberOfFeatures,i=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(s*i/(1-e.emptyFeatureRatio)),t)}get test(){return{process:e=>this.runTask(e),getFeatureTileById:e=>this.featureTiles.get(e),forEachFeatureTile:e=>this.featureTiles.forEach(e)}}};function q(e){return"dummy-tile-full-extent"===e.id}function A(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function S(e){const t=e.capabilities.query;return{supportsMultipleResolutions:L(e),supportsPagination:!(!t||!t.supportsPagination),supportsResultType:!(!t||!t.supportsResultType),supportsCacheHint:!(!t||!t.supportsCacheHint),supportsQuantization:!(!t||!t.supportsQuantization),supportsQuantizationEditMode:!(!t||!t.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!t||!t.supportsMaxRecordCountFactor),supportsFormatPBF:!(!t||!t.supportsFormatPBF)}}function L(e){switch(e.geometryType){case"polyline":return!0;case"polygon":return e.capabilities&&e.capabilities.query&&e.capabilities.query.supportsQuantization;default:return!1}}function Q(e){return e.setFeatures([],0,null),e.featuresMissing=!1,w.DONE}function H(e){return o(e)?new Set:new Set(e.map((e=>e.name)))}function k(e,t){if(o(e)||o(t))return H(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}e([f({constructOnly:!0})],I.prototype,"features",void 0),e([f()],I.prototype,"tileDescriptors",void 0),e([f({value:1/0})],I.prototype,"maximumNumberOfFeatures",null),e([f({value:1})],I.prototype,"memoryFactor",null),e([f({value:1})],I.prototype,"lodFactor",null),e([f()],I.prototype,"useTileCount",null),e([f({readOnly:!0})],I.prototype,"updating",void 0),e([f({readOnly:!0})],I.prototype,"updatingTotal",void 0),e([f({readOnly:!0})],I.prototype,"updatingRemaining",void 0),e([f({readOnly:!0})],I.prototype,"expectedFeatureDiff",void 0),e([f({readOnly:!0})],I.prototype,"memoryForUnusedFeatures",null),e([f({readOnly:!0})],I.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([f({constructOnly:!0})],I.prototype,"maximumNumberOfFeaturesExceededThrottle",void 0),e([f({readOnly:!0})],I.prototype,"totalVertices",null),e([f({readOnly:!0})],I.prototype,"totalFeatures",null),e([f()],I.prototype,"filterExtent",null),e([f({constructOnly:!0})],I.prototype,"context",void 0),I=e([m("esri.views.3d.layers.support.FeatureTileFetcher3D")],I);const V=2e3,z=g(),B=g(),G=6e5,X=200;export{I as FeatureTileFetcher3D,S as contextCapabilitiesFromLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e,releaseMaybe as r,isNone as t,isSome as i}from"../../../core/maybe.js";import{Z as o}from"../../../chunks/vec2f64.js";import{RasterColorizerStretchType as s}from"../../2d/engine/imagery/enums.js";import{VectorTileRendererHelper3D as l}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechniqueConfiguration as n,BlendLayersTechnique as a}from"./BlendLayersTechnique.js";import{LayerClass as h}from"./LayerClass.js";import{RasterColorizerTechniqueConfiguration as u,RasterColorizerTechnique as c}from"./RasterColorizerTechnique.js";import{FBOPool as _}from"./support/FBOPool.js";import{LayerBlendMode as d}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{TileBlendInput as b}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{B as f,a as p}from"../../../chunks/BlendLayers.glsl.js";import{BindParameters as T}from"../webgl-engine/lib/BindParameters.js";import{Pos2Tex as m}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as y}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as g,ClearBufferBit as B,TextureType as C}from"../../webgl/enums.js";import{Texture as x}from"../../webgl/Texture.js";import{vertexCount as O}from"../../webgl/Util.js";class F{constructor(e,r){this._rctx=e,this._techniqueRepository=r,this._fboPools=[],this._doubleBufferFbo=[],this._vectorTileHelper=new l,this._bindParameters=new T(null,null,null),this._blendLayersTechniqueConfig=new n,this._poolToWrite=0,this._vaoQuad=y(this._rctx,m),this._fboPools.push(new _(this._rctx)),this._fboPools.push(new _(this._rctx))}dispose(){this._fboPools.forEach((e=>{e.clear(),e=null})),this._fboPools=null,this._doubleBufferFbo.forEach((r=>e(r))),this._vaoQuad=e(this._vaoQuad),this._vectorTileHelper=e(this._vectorTileHelper),this._backgroundTechnique=r(this._backgroundTechnique),this._applyOpacityTechnique=r(this._applyOpacityTechnique),this._blendLayersTechnique=r(this._blendLayersTechnique)}_getBlendLayersTechnique(e,r,t,i=!1){return this._blendLayersTechniqueConfig.output=r,this._blendLayersTechniqueConfig.blendMode=e,this._blendLayersTechniqueConfig.baseOpacityMode=t?r===f.Composite?p.OnBaseLayer:p.OnBackground:p.One,this._blendLayersTechniqueConfig.premultipliedSource=i,this._blendLayersTechnique=this._techniqueRepository.releaseAndAcquire(a,this._blendLayersTechniqueConfig,this._blendLayersTechnique),this._blendLayersTechnique}drawBackground(e,r){const t=this._getBlendLayersTechnique(d.Normal,r,!1),i=this._rctx.bindTechnique(t,e,this._bindParameters);this._render(i)}_render(e){this._rctx.bindVAO(this._vaoQuad),e.assertCompatibleVertexAttributeLocations(this._vaoQuad),this._rctx.drawArrays(g.TRIANGLE_STRIP,0,O(this._vaoQuad,"geometry"))}drawRasterData(e,r,i=!1){if(t(r.texture))return;const o=r.baseOpacity<1;r.blendMode!==d.Normal||o||i?(r.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):r.fboTexture=null;const s=this._getBlendLayersTechnique(r.blendMode,e,o,i),l=this._rctx.bindTechnique(s,r,this._bindParameters);this._render(l)}drawImageryTileData(e,r,t){const i=e.sourceLayerInfo.data;if(!i.source)return;e.tile.surface.layerViewByIndex(e.layerIndex,h.MAP).ensureSymbolizerParameters(i);const o=t.baseOpacity<1;t.blendMode!==d.Normal||o?(t.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):t.fboTexture=null;const s=this._getRasterColorizerTechnique(i,r,t.blendMode,o),l=this._rctx.bindTechnique(s);if(!i.bind(this._rctx))return;i.opacity=t.opacity;const n=i.getUniforms();n.scale=e.scale,n.offset=e.offset,n.backgroundColor=t.backgroundColor,n.fboTexture=t.fboTexture,n.baseOpacity=t.baseOpacity,s.bindPass(n,null),this._render(l)}_getRasterColorizerTechnique(e,r,i,o){const l=e.symbolizerParameters,n=["stretch","lut","hillshade"].indexOf(l.type);return t(this._rasterColorizerConfig)&&(this._rasterColorizerConfig=new u,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),this._rctx.gl.getExtension("OES_texture_float")),this._rasterColorizerConfig.tileBlendInput=r===f.ColorComposite?b.ColorComposite:r===f.GridComposite?b.GridComposite:b.LayerOnly,this._rasterColorizerConfig.blendMode=i,this._rasterColorizerConfig.baseOpacityMode=o?r===f.Composite?p.OnBaseLayer:p.OnBackground:p.One,this._rasterColorizerConfig.colorizerType=n,this._rasterColorizerConfig.applyColormap=!!l.colormap,this._rasterColorizerConfig.stretchType=e.hasStretchTypeNone()?s.Noop:s.PerBand,this._rasterColorizerTechnique=this._techniqueRepository.releaseAndAcquire(c,this._rasterColorizerConfig,this._rasterColorizerTechnique),this._rasterColorizerTechnique}drawVectorData(e,r,t,s,l,n,a){const u=this._rctx,c=r.sourceLayerInfo.data,_=r.tile.surface.layerViewByIndex(r.layerIndex,h.MAP),b=e.baseOpacity<1||e.opacity<1||e.blendMode!==d.Normal||a!==f.Composite;let p;return this._getBlendLayersTechnique(e.blendMode,a,e.baseOpacity<1,b).bindPipelineState(u),b?(p=this._acquire(l),u.bindFramebuffer(p),u.setClearColor(0,0,0,0),u.clearSafe(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT)):n&&u.clearSafe(B.DEPTH_BUFFER_BIT),this._vectorTileHelper.render(u,r.sourceLod,c,_.painter,_.layer.styleRepository,_.schemaHelper,Math.round(1/r.scale),r.offset,s,t),!i(p)||(u.bindFramebuffer(this._currentFBO),e.texture=p.colorTexture,e.offset=o,e.scale=1,this.drawRasterData(a,e,b),p.release(),n)}copyFBOToTexture(e){const r=this._rctx,t=r.bindTexture(e.texture,x.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;r.gl.copyTexImage2D(C.TEXTURE_2D,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),r.bindTexture(t,x.TEXTURE_UNIT_FOR_UPDATES)}_initFBO(e,r){this._rctx.bindFramebuffer(e),this._rctx.setViewport(0,0,r,r),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.clearSafe(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT)}_acquire(e){return this._fboPools[this._poolToWrite].acquire(e)}bindPool(e,r){this._poolToWrite=e,null==this._doubleBufferFbo[e]&&(this._doubleBufferFbo[e]=this._acquire(r),this._initFBO(this._doubleBufferFbo[e],r))}_switchPool(e){this._releaseCurrentFBO(),this._doubleBufferFbo[this._poolToWrite]=null,this._poolToWrite=0===this._poolToWrite?1:0,this.bindPool(this._poolToWrite,e)}get _currentFBO(){return this._doubleBufferFbo[this._poolToWrite]}_releaseCurrentFBO(){this._doubleBufferFbo[this._poolToWrite].release(),this._doubleBufferFbo[this._poolToWrite]=null}releasePool(){this._rctx.bindFramebuffer(null),this._releaseCurrentFBO()}cleanupFBOPool(e,r){e===this._lastPixelRatio&&r===this._lastNumLayers||(this._fboPools.forEach((e=>e.clear())),this._lastPixelRatio=e,this._lastNumLayers=r)}}export{F as TileCompositor};
5
+ import e from"../../../core/Logger.js";import{disposeMaybe as r,releaseMaybe as t,isNone as i,isSome as o}from"../../../core/maybe.js";import{Z as s}from"../../../chunks/vec2f64.js";import{RasterColorizerStretchType as n}from"../../2d/engine/imagery/enums.js";import{VectorTileRendererHelper3D as l}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechniqueConfiguration as a,BlendLayersTechnique as h}from"./BlendLayersTechnique.js";import{LayerClass as c}from"./LayerClass.js";import{RasterColorizerTechniqueConfiguration as u,RasterColorizerTechnique as _}from"./RasterColorizerTechnique.js";import{FBOPool as d}from"./support/FBOPool.js";import{LayerBlendMode as b}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{TileBlendInput as f}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{B as p,a as T}from"../../../chunks/BlendLayers.glsl.js";import{BindParameters as m}from"../webgl-engine/lib/BindParameters.js";import{Pos2Tex as y}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as g}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as B,ClearBufferBit as C,TextureType as x}from"../../webgl/enums.js";import{Texture as O}from"../../webgl/Texture.js";import{vertexCount as F}from"../../webgl/Util.js";const q=e.getLogger("esri.views.3d.terrain");class L{constructor(e,r){this._rctx=e,this._techniqueRepository=r,this._fboPools=[],this._doubleBufferFbo=[],this._vectorTileHelper=new l,this._bindParameters=new m(null,null,null),this._blendLayersTechniqueConfig=new a,this._poolToWrite=0,this._vaoQuad=g(this._rctx,y),this._fboPools.push(new d(this._rctx)),this._fboPools.push(new d(this._rctx))}dispose(){this._fboPools.forEach((e=>{e.clear(),e=null})),this._fboPools=null,this._doubleBufferFbo.forEach((e=>r(e))),this._vaoQuad=r(this._vaoQuad),this._vectorTileHelper=r(this._vectorTileHelper),this._backgroundTechnique=t(this._backgroundTechnique),this._applyOpacityTechnique=t(this._applyOpacityTechnique),this._blendLayersTechnique=t(this._blendLayersTechnique)}_getBlendLayersTechnique(e,r,t,i=!1){return this._blendLayersTechniqueConfig.output=r,this._blendLayersTechniqueConfig.blendMode=e,this._blendLayersTechniqueConfig.baseOpacityMode=t?r===p.Composite?T.OnBaseLayer:T.OnBackground:T.One,this._blendLayersTechniqueConfig.premultipliedSource=i,this._blendLayersTechnique=this._techniqueRepository.releaseAndAcquire(h,this._blendLayersTechniqueConfig,this._blendLayersTechnique),this._blendLayersTechnique}drawBackground(e,r){const t=this._getBlendLayersTechnique(b.Normal,r,!1),i=this._rctx.bindTechnique(t,e,this._bindParameters);this._render(i)}_render(e){this._rctx.bindVAO(this._vaoQuad),e.assertCompatibleVertexAttributeLocations(this._vaoQuad),this._rctx.drawArrays(B.TRIANGLE_STRIP,0,F(this._vaoQuad,"geometry"))}drawRasterData(e,r,t=!1){if(i(r.texture))return;const o=r.baseOpacity<1;r.blendMode!==b.Normal||o||t?(r.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):r.fboTexture=null;const s=this._getBlendLayersTechnique(r.blendMode,e,o,t),n=this._rctx.bindTechnique(s,r,this._bindParameters);this._render(n)}drawImageryTileData(e,r,t){const i=e.sourceLayerInfo.data;if(!i.source)return;e.tile.surface.layerViewByIndex(e.layerIndex,c.MAP).ensureSymbolizerParameters(i);const o=t.baseOpacity<1;t.blendMode!==b.Normal||o?(t.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):t.fboTexture=null;const s=this._getRasterColorizerTechnique(i,r,t.blendMode,o),n=this._rctx.bindTechnique(s);if(!i.bind(this._rctx))return;i.opacity=t.opacity;const l=i.getUniforms();l.scale=e.scale,l.offset=e.offset,l.backgroundColor=t.backgroundColor,l.fboTexture=t.fboTexture,l.baseOpacity=t.baseOpacity,s.bindPass(l,null),this._render(n)}_getRasterColorizerTechnique(e,r,t,o){const s=e.symbolizerParameters,l=["stretch","lut","hillshade"].indexOf(s.type);return i(this._rasterColorizerConfig)&&(this._rasterColorizerConfig=new u,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),this._rctx.gl.getExtension("OES_texture_float")),this._rasterColorizerConfig.tileBlendInput=r===p.ColorComposite?f.ColorComposite:r===p.GridComposite?f.GridComposite:f.LayerOnly,this._rasterColorizerConfig.blendMode=t,this._rasterColorizerConfig.baseOpacityMode=o?r===p.Composite?T.OnBaseLayer:T.OnBackground:T.One,this._rasterColorizerConfig.colorizerType=l,this._rasterColorizerConfig.applyColormap=!!s.colormap,this._rasterColorizerConfig.stretchType=e.hasStretchTypeNone()?n.Noop:n.PerBand,this._rasterColorizerTechnique=this._techniqueRepository.releaseAndAcquire(_,this._rasterColorizerConfig,this._rasterColorizerTechnique),this._rasterColorizerTechnique}drawVectorData(e,r,t,i,n,l,a){const h=this._rctx,u=r.sourceLayerInfo.data,_=r.tile.surface.layerViewByIndex(r.layerIndex,c.MAP),d=e.baseOpacity<1||e.opacity<1||e.blendMode!==b.Normal||a!==p.Composite;let f;this._getBlendLayersTechnique(e.blendMode,a,e.baseOpacity<1,d).bindPipelineState(h),d?(f=this._acquire(n),h.bindFramebuffer(f),h.setClearColor(0,0,0,0),h.clearSafe(C.COLOR_BUFFER_BIT|C.DEPTH_BUFFER_BIT)):l&&h.clearSafe(C.DEPTH_BUFFER_BIT);try{this._vectorTileHelper.render(h,r.sourceLod,u,_.painter,_.layer.styleRepository,_.schemaHelper,Math.round(1/r.scale),r.offset,i,t)}catch(T){q.warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!o(f)||(h.bindFramebuffer(this._currentFBO),e.texture=f.colorTexture,e.offset=s,e.scale=1,this.drawRasterData(a,e,d),f.release(),l)}copyFBOToTexture(e){const r=this._rctx,t=r.bindTexture(e.texture,O.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;r.gl.copyTexImage2D(x.TEXTURE_2D,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),r.bindTexture(t,O.TEXTURE_UNIT_FOR_UPDATES)}_initFBO(e,r){this._rctx.bindFramebuffer(e),this._rctx.setViewport(0,0,r,r),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.clearSafe(C.COLOR_BUFFER_BIT|C.DEPTH_BUFFER_BIT)}_acquire(e){return this._fboPools[this._poolToWrite].acquire(e)}bindPool(e,r){this._poolToWrite=e,null==this._doubleBufferFbo[e]&&(this._doubleBufferFbo[e]=this._acquire(r),this._initFBO(this._doubleBufferFbo[e],r))}_switchPool(e){this._releaseCurrentFBO(),this._doubleBufferFbo[this._poolToWrite]=null,this._poolToWrite=0===this._poolToWrite?1:0,this.bindPool(this._poolToWrite,e)}get _currentFBO(){return this._doubleBufferFbo[this._poolToWrite]}_releaseCurrentFBO(){this._doubleBufferFbo[this._poolToWrite].release(),this._doubleBufferFbo[this._poolToWrite]=null}releasePool(){this._rctx.bindFramebuffer(null),this._releaseCurrentFBO()}cleanupFBOPool(e,r){e===this._lastPixelRatio&&r===this._lastNumLayers||(this._fboPools.forEach((e=>e.clear())),this._lastPixelRatio=e,this._lastNumLayers=r)}}export{L as TileCompositor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/has.js";import{isSome as t,isNone as r}from"../../core/maybe.js";var o;function n(e,r,o={}){const n=i(e);for(;n.length>1;){const e=l(r,n.shift(),o);if(t(e))return e}return c(r,n.shift(),o)}function i(t){const r=e("esri-force-webgl");if(r===o.WEBGL1||r===o.WEBGL2)return[r];switch(t){case"2d":case"3d":return[o.WEBGL2,o.WEBGL1]}}function c(e,t,o={}){if(!window.WebGLRenderingContext)return s(e,a),null;const n=l(e,t,o);return r(n)&&s(e,u),n}function l(e,t,r={}){const n=t===o.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let i=null;for(const o of n){try{i=e.getContext(o,r)}catch(c){}if(i)break}return i}function s(e,t){const r=e.parentNode;r&&(r.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(o||(o={}));const a='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',u='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';export{o as ContextType,l as createContext,n as createContextOrErrorHTML,i as getContextTypes};
5
+ import e from"../../core/has.js";import{isSome as t,isNone as r}from"../../core/maybe.js";var o;function n(e,r,o={}){const n=i(e);for(;n.length>1;){const e=l(r,n.shift(),o);if(t(e))return e}return c(r,n.shift(),o)}function i(t){const r=e("esri-force-webgl");if(r===o.WEBGL1||r===o.WEBGL2)return[r];switch(t){case"2d":return e("mac")?[o.WEBGL1,o.WEBGL2]:[o.WEBGL2,o.WEBGL1];case"3d":return[o.WEBGL2,o.WEBGL1]}}function c(e,t,o={}){if(!window.WebGLRenderingContext)return a(e,s),null;const n=l(e,t,o);return r(n)&&a(e,u),n}function l(e,t,r={}){const n=t===o.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let i=null;for(const o of n){try{i=e.getContext(o,r)}catch(c){}if(i)break}return i}function a(e,t){const r=e.parentNode;r&&(r.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(o||(o={}));const s='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',u='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';export{o as ContextType,l as createContext,n as createContextOrErrorHTML,i as getContextTypes};