@nasa-terra/components 0.0.197 → 0.0.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunks/GeoTIFF.VXDS234A.js +20754 -0
- package/cdn/chunks/chunk.2EWZDAYT.js +29 -0
- package/cdn/chunks/chunk.2JJELSL5.js +47 -0
- package/cdn/chunks/chunk.2T337UTK.js +19 -0
- package/cdn/chunks/chunk.2XG73ITG.js +357 -0
- package/cdn/chunks/chunk.33GFCE5N.js +19 -0
- package/cdn/chunks/chunk.3JXVH2NE.js +377 -0
- package/cdn/chunks/chunk.3VUC5O5G.js +33 -0
- package/cdn/chunks/chunk.3XZ3WU77.js +35 -0
- package/cdn/chunks/chunk.3Y7HZ5CS.js +110 -0
- package/cdn/chunks/chunk.44VCJ6SW.js +29 -0
- package/cdn/chunks/chunk.4HXIWAKE.js +29 -0
- package/cdn/chunks/chunk.4KHGJTYG.js +310 -0
- package/cdn/chunks/chunk.4LAXKCHJ.js +19 -0
- package/cdn/chunks/chunk.4N76TU2N.js +60 -0
- package/cdn/chunks/chunk.55WRSCJY.js +978 -0
- package/cdn/chunks/chunk.573DB434.js +39 -0
- package/cdn/chunks/chunk.5BH3C4GN.js +19 -0
- package/cdn/chunks/chunk.5BVN7II7.js +19 -0
- package/cdn/chunks/chunk.5DLA37YX.js +19 -0
- package/cdn/chunks/chunk.5LFN6KT3.js +416 -0
- package/cdn/chunks/chunk.5MB6A5RU.js +19 -0
- package/cdn/chunks/chunk.5ZT2BS3I.js +60 -0
- package/cdn/chunks/chunk.66IWKBC6.js +364 -0
- package/cdn/chunks/chunk.6D2IDMCW.js +106 -0
- package/cdn/chunks/chunk.6JG52BSF.js +35 -0
- package/cdn/chunks/chunk.6O7XOHAP.js +32 -0
- package/cdn/chunks/chunk.6Z7GRBWL.js +277 -0
- package/cdn/chunks/chunk.76A5M5WG.js +33 -0
- package/cdn/chunks/chunk.7BSMV3XV.js +36 -0
- package/cdn/chunks/chunk.7C3LJSTD.js +19 -0
- package/cdn/chunks/chunk.7G65ACMK.js +19 -0
- package/cdn/chunks/chunk.7GIH3FHL.js +29 -0
- package/cdn/chunks/chunk.7KYOVGMU.js +32 -0
- package/cdn/chunks/chunk.7UCNMWYE.js +1975 -0
- package/cdn/chunks/chunk.7Y2VDUYC.js +62 -0
- package/cdn/chunks/chunk.ABFNT6U4.js +32 -0
- package/cdn/chunks/chunk.ADFH5ULU.js +29 -0
- package/cdn/chunks/chunk.ADHCB3BO.js +538 -0
- package/cdn/chunks/chunk.AH7EQF7K.js +29 -0
- package/cdn/chunks/chunk.AO7RPFJO.js +19 -0
- package/cdn/chunks/chunk.AQB2ML3I.js +537 -0
- package/cdn/chunks/chunk.ASJLND3B.js +77 -0
- package/cdn/chunks/chunk.AYFA4HPN.js +4735 -0
- package/cdn/chunks/chunk.B3ADFXJY.js +32 -0
- package/cdn/chunks/chunk.B3GLOTII.js +92 -0
- package/cdn/chunks/chunk.B6YC7R6P.js +29 -0
- package/cdn/chunks/chunk.BFDVUZHC.js +35 -0
- package/cdn/chunks/chunk.BJRAF4ZX.js +19 -0
- package/cdn/chunks/chunk.BNGXQNNQ.js +29 -0
- package/cdn/chunks/chunk.BOZ3VKJO.js +19 -0
- package/cdn/chunks/chunk.BW44PXWN.js +657 -0
- package/cdn/chunks/chunk.COHRXEHA.js +29 -0
- package/cdn/chunks/chunk.CRQDFPSH.js +37 -0
- package/cdn/chunks/chunk.CX65AHTW.js +104 -0
- package/cdn/chunks/chunk.CX6JSAGB.js +19 -0
- package/cdn/chunks/chunk.DEHDGGWE.js +19 -0
- package/cdn/chunks/chunk.DMULXFKY.js +32 -0
- package/cdn/chunks/chunk.DO3V7V6I.js +259 -0
- package/cdn/chunks/chunk.DYRKSW2X.js +99 -0
- package/cdn/chunks/chunk.E4ONM7EQ.js +224 -0
- package/cdn/chunks/chunk.E6L6YVTU.js +19 -0
- package/cdn/chunks/chunk.ECR75TPC.js +19 -0
- package/cdn/chunks/chunk.EHRAILYE.js +19 -0
- package/cdn/chunks/chunk.EHVXLTCB.js +190 -0
- package/cdn/chunks/chunk.EKXY4PGP.js +29 -0
- package/cdn/chunks/chunk.F7QE3QNK.js +93 -0
- package/cdn/chunks/chunk.FI4YBHHD.js +1339 -0
- package/cdn/chunks/chunk.FIREC5CC.js +478 -0
- package/cdn/chunks/chunk.FQ7GYAM6.js +450 -0
- package/cdn/chunks/chunk.FQBIIKY5.js +19 -0
- package/cdn/chunks/chunk.FSGSFI2L.js +162 -0
- package/cdn/chunks/chunk.G7AGZVJM.js +32 -0
- package/cdn/chunks/chunk.GA4QBBRX.js +19 -0
- package/cdn/chunks/chunk.GEVOOPOP.js +32 -0
- package/cdn/chunks/chunk.GF56J2LC.js +29 -0
- package/cdn/chunks/chunk.GGODQ75Z.js +359 -0
- package/cdn/chunks/chunk.GP5CKNVX.js +19 -0
- package/cdn/chunks/chunk.GTZLRBU6.js +15 -0
- package/cdn/chunks/chunk.GWUGCYFL.js +19 -0
- package/cdn/chunks/chunk.H6KRH5P2.js +17685 -0
- package/cdn/chunks/chunk.HCUUZMUR.js +610 -0
- package/cdn/chunks/chunk.HETFTQ32.js +36 -0
- package/cdn/chunks/chunk.HFQ4URSA.js +29 -0
- package/cdn/chunks/chunk.HHFSBJ5G.js +19 -0
- package/cdn/chunks/chunk.HJHZJEFY.js +19 -0
- package/cdn/chunks/chunk.HQL5JPO6.js +29 -0
- package/cdn/chunks/chunk.HRRDY7XJ.js +19 -0
- package/cdn/chunks/chunk.HT4VXYXY.js +37 -0
- package/cdn/chunks/chunk.HUVHJ5KI.js +19 -0
- package/cdn/chunks/chunk.HVDW2G5B.js +19 -0
- package/cdn/chunks/chunk.HVKGLK5J.js +78 -0
- package/cdn/chunks/chunk.I4B5GFUI.js +30 -0
- package/cdn/chunks/chunk.I4GAKXVS.js +82 -0
- package/cdn/chunks/chunk.I74CWXDT.js +29 -0
- package/cdn/chunks/chunk.IJRMB4PM.js +19 -0
- package/cdn/chunks/chunk.IK2SGPIW.js +5463 -0
- package/cdn/chunks/chunk.IYBWOV2C.js +1660 -0
- package/cdn/chunks/chunk.J52GFLCR.js +110 -0
- package/cdn/chunks/chunk.JHM6GLII.js +599 -0
- package/cdn/chunks/chunk.JJRD2OTY.js +293 -0
- package/cdn/chunks/chunk.JTRGBBGG.js +29 -0
- package/cdn/chunks/chunk.JXSQUWZZ.js +19 -0
- package/cdn/chunks/chunk.JYF5D5R5.js +19 -0
- package/cdn/chunks/chunk.K4QMVYIR.js +443 -0
- package/cdn/chunks/chunk.K56RZQTE.js +155 -0
- package/cdn/chunks/chunk.KB3G2WCI.js +34 -0
- package/cdn/chunks/chunk.KF4FXYKE.js +19 -0
- package/cdn/chunks/chunk.KHDL2CAQ.js +230 -0
- package/cdn/chunks/chunk.KHRT3JCC.js +29 -0
- package/cdn/chunks/chunk.KPSIXCYD.js +29 -0
- package/cdn/chunks/chunk.KX7SACHH.js +68 -0
- package/cdn/chunks/chunk.KZCBK6S4.js +19 -0
- package/cdn/chunks/chunk.L3TQOLJO.js +74 -0
- package/cdn/chunks/chunk.L67UJNXB.js +41 -0
- package/cdn/chunks/chunk.L77N7C7E.js +171 -0
- package/cdn/chunks/chunk.LGRZMWVK.js +35 -0
- package/cdn/chunks/chunk.LIPFUNWP.js +38 -0
- package/cdn/chunks/chunk.LRZIT4M2.js +157 -0
- package/cdn/chunks/chunk.LWZNG7WV.js +29 -0
- package/cdn/chunks/chunk.LXQGTI2B.js +32 -0
- package/cdn/chunks/chunk.M43ZJHCX.js +33 -0
- package/cdn/chunks/chunk.M6QQY2ST.js +17603 -0
- package/cdn/chunks/chunk.MAHUWVEN.js +279 -0
- package/cdn/chunks/chunk.MLJM2THR.js +19 -0
- package/cdn/chunks/chunk.MNP4CXLJ.js +19 -0
- package/cdn/chunks/chunk.MUXCPAHQ.js +543 -0
- package/cdn/chunks/chunk.MZKOUZD2.js +123 -0
- package/cdn/chunks/chunk.N2L7WOXF.js +29 -0
- package/cdn/chunks/chunk.N2SCVTHV.js +29 -0
- package/cdn/chunks/chunk.NCROEX7Z.js +29 -0
- package/cdn/chunks/chunk.NH4YMQJT.js +298 -0
- package/cdn/chunks/chunk.NIKJGSH5.js +19 -0
- package/cdn/chunks/chunk.NIQW247C.js +19 -0
- package/cdn/chunks/chunk.NKD2XOGT.js +33 -0
- package/cdn/chunks/chunk.NNUQZHMT.js +32 -0
- package/cdn/chunks/chunk.NQLIIDC4.js +81 -0
- package/cdn/chunks/chunk.O3E7K42P.js +278 -0
- package/cdn/chunks/chunk.O3JICBSZ.js +904 -0
- package/cdn/chunks/chunk.O6V37MUB.js +19 -0
- package/cdn/chunks/chunk.OCOILS4L.js +531 -0
- package/cdn/chunks/chunk.OO345KKC.js +19 -0
- package/cdn/chunks/chunk.P5NZ7ZES.js +19 -0
- package/cdn/chunks/chunk.PB7O3LZB.js +2713 -0
- package/cdn/chunks/chunk.PDZ25A5I.js +19 -0
- package/cdn/chunks/chunk.PF6HHPHM.js +1691 -0
- package/cdn/chunks/chunk.PHX2Z4JM.js +113 -0
- package/cdn/chunks/chunk.PIEJ3UF6.js +592 -0
- package/cdn/chunks/chunk.PJPMBXC4.js +19 -0
- package/cdn/chunks/chunk.PKAVFPZ7.js +36 -0
- package/cdn/chunks/chunk.PNEWL4NR.js +925 -0
- package/cdn/chunks/chunk.PR55CF2E.js +19 -0
- package/cdn/chunks/chunk.PVARN7ER.js +86 -0
- package/cdn/chunks/chunk.Q4B4QXYW.js +19 -0
- package/cdn/chunks/chunk.Q7FVA2QA.js +234 -0
- package/cdn/chunks/chunk.QNGVGHSM.js +616 -0
- package/cdn/chunks/chunk.QSXNN4K7.js +29 -0
- package/cdn/chunks/chunk.QU5NA6A2.js +34 -0
- package/cdn/chunks/chunk.QUXBL6PU.js +19 -0
- package/cdn/chunks/chunk.QWKEI3FC.js +49 -0
- package/cdn/chunks/chunk.RCUE3PFX.js +19 -0
- package/cdn/chunks/chunk.RGMOIMLO.js +19 -0
- package/cdn/chunks/chunk.RHKWK57F.js +32 -0
- package/cdn/chunks/chunk.RK7LHY6Q.js +1197 -0
- package/cdn/chunks/chunk.RPETTG3O.js +19 -0
- package/cdn/chunks/chunk.RYLQ7J4S.js +134 -0
- package/cdn/chunks/chunk.S43EHJMQ.js +276 -0
- package/cdn/chunks/chunk.S5FXMDJD.js +136 -0
- package/cdn/chunks/chunk.SE55TMVG.js +143 -0
- package/cdn/chunks/chunk.SPVQ3TUO.js +188 -0
- package/cdn/chunks/chunk.STAMGMYS.js +19 -0
- package/cdn/chunks/chunk.SYUADFIF.js +151 -0
- package/cdn/chunks/chunk.SZVIFQRJ.js +71 -0
- package/cdn/chunks/chunk.T47BZXNK.js +19 -0
- package/cdn/chunks/chunk.TAGA7EGX.js +348 -0
- package/cdn/chunks/chunk.TG3YYWRJ.js +672 -0
- package/cdn/chunks/chunk.TOSFVKE4.js +36 -0
- package/cdn/chunks/chunk.TTCE562V.js +29 -0
- package/cdn/chunks/chunk.TTUIBJR7.js +29 -0
- package/cdn/chunks/chunk.TXCVCIZI.js +35 -0
- package/cdn/chunks/chunk.TZQ63Z3H.js +36 -0
- package/cdn/chunks/chunk.UBVO3Z7U.js +32 -0
- package/cdn/chunks/chunk.UI5WWHT7.js +19 -0
- package/cdn/chunks/chunk.UKCY4NE5.js +33 -0
- package/cdn/chunks/chunk.UKKNHVT2.js +2546 -0
- package/cdn/chunks/chunk.URQOTCAU.js +29 -0
- package/cdn/chunks/chunk.UUUD46S3.js +1862 -0
- package/cdn/chunks/chunk.VEIJLCDU.js +29 -0
- package/cdn/chunks/chunk.VKNIBCZI.js +19 -0
- package/cdn/chunks/chunk.VRMWYJMN.js +37 -0
- package/cdn/chunks/chunk.VSLVNJ6A.js +158 -0
- package/cdn/chunks/chunk.W36EIIQD.js +19 -0
- package/cdn/chunks/chunk.W4NGS5VZ.js +29 -0
- package/cdn/chunks/chunk.W5DRTC2Y.js +19 -0
- package/cdn/chunks/chunk.W7DYWM5I.js +32 -0
- package/cdn/chunks/chunk.WEGQDDNL.js +83 -0
- package/cdn/chunks/chunk.WHARISEG.js +29 -0
- package/cdn/chunks/chunk.WHHJJOQT.js +19 -0
- package/cdn/chunks/chunk.WNFL2Q36.js +524 -0
- package/cdn/chunks/chunk.WY6BZ6AK.js +138 -0
- package/cdn/chunks/chunk.WY7ZAZXA.js +19 -0
- package/cdn/chunks/chunk.X37TJUYW.js +19 -0
- package/cdn/chunks/chunk.X5GEXAXL.js +19 -0
- package/cdn/chunks/chunk.X76WQYYW.js +19 -0
- package/cdn/chunks/chunk.XVQCMA3M.js +32 -0
- package/cdn/chunks/chunk.XWYVG7GK.js +19 -0
- package/cdn/chunks/chunk.Y66HDAOP.js +32 -0
- package/cdn/chunks/chunk.YF7FICS7.js +19 -0
- package/cdn/chunks/chunk.YHKRAHVP.js +231 -0
- package/cdn/chunks/chunk.YPKEC5IK.js +29 -0
- package/cdn/chunks/chunk.YQ4SKOIN.js +132 -0
- package/cdn/chunks/chunk.Z3RVDKOC.js +15 -0
- package/cdn/chunks/chunk.Z44HWXXJ.js +195 -0
- package/cdn/chunks/chunk.ZAARA5NN.js +29 -0
- package/cdn/chunks/chunk.ZCVWVO2H.js +266 -0
- package/cdn/chunks/chunk.ZHIZCLYJ.js +93 -0
- package/cdn/chunks/chunk.ZL336EPZ.js +631 -0
- package/cdn/chunks/chunk.ZLI235RR.js +19 -0
- package/cdn/chunks/chunk.ZRV6GVL5.js +19 -0
- package/cdn/chunks/chunk.ZS67HYGB.js +56075 -0
- package/cdn/chunks/chunk.ZSELDXE4.js +19 -0
- package/cdn/chunks/chunk.ZZUDFWQK.js +19 -0
- package/cdn/chunks/lerc.WZVXX72L.js +2097 -0
- package/cdn/components/accordion/accordion.component.js +5 -5
- package/cdn/components/accordion/accordion.js +6 -6
- package/cdn/components/alert/alert.component.js +3 -3
- package/cdn/components/alert/alert.js +4 -4
- package/cdn/components/avatar/avatar.component.js +7 -7
- package/cdn/components/avatar/avatar.js +8 -8
- package/cdn/components/badge/badge.component.js +2 -2
- package/cdn/components/badge/badge.js +3 -3
- package/cdn/components/banner/banner.component.js +2 -2
- package/cdn/components/banner/banner.js +3 -3
- package/cdn/components/breadcrumb/breadcrumb.component.js +2 -2
- package/cdn/components/breadcrumb/breadcrumb.js +3 -3
- package/cdn/components/breadcrumbs/breadcrumbs.component.js +2 -2
- package/cdn/components/breadcrumbs/breadcrumbs.js +3 -3
- package/cdn/components/browse-variables/browse-variables.component.js +21 -21
- package/cdn/components/browse-variables/browse-variables.js +22 -22
- package/cdn/components/button/button.component.js +7 -7
- package/cdn/components/button/button.js +8 -8
- package/cdn/components/button-group/button-group.component.js +2 -2
- package/cdn/components/button-group/button-group.js +3 -3
- package/cdn/components/caption/caption.component.js +2 -2
- package/cdn/components/caption/caption.js +3 -3
- package/cdn/components/card/card.component.js +2 -2
- package/cdn/components/card/card.js +3 -3
- package/cdn/components/checkbox/checkbox.component.js +9 -9
- package/cdn/components/checkbox/checkbox.js +10 -10
- package/cdn/components/chip/chip.component.js +2 -2
- package/cdn/components/chip/chip.js +3 -3
- package/cdn/components/combobox/combobox.component.js +7 -7
- package/cdn/components/combobox/combobox.js +8 -8
- package/cdn/components/data-access/data-access.component.js +51 -41
- package/cdn/components/data-access/data-access.js +52 -42
- package/cdn/components/data-grid/data-grid.component.js +5 -5
- package/cdn/components/data-grid/data-grid.js +6 -6
- package/cdn/components/data-rods/data-rods.component.js +60 -50
- package/cdn/components/data-rods/data-rods.js +61 -51
- package/cdn/components/data-subsetter/data-subsetter.component.d.ts +1 -0
- package/cdn/components/data-subsetter/data-subsetter.component.js +61 -51
- package/cdn/components/data-subsetter/data-subsetter.js +62 -52
- package/cdn/components/data-subsetter/notebooks/subsetter-notebook.js +1 -1
- package/cdn/components/data-subsetter-history/data-subsetter-history.component.js +63 -53
- package/cdn/components/data-subsetter-history/data-subsetter-history.js +64 -54
- package/cdn/components/date-picker/date-picker.component.js +17 -17
- package/cdn/components/date-picker/date-picker.js +18 -18
- package/cdn/components/date-range-slider/date-range-slider.component.js +2 -2
- package/cdn/components/date-range-slider/date-range-slider.js +3 -3
- package/cdn/components/dialog/dialog.component.js +9 -9
- package/cdn/components/dialog/dialog.js +10 -10
- package/cdn/components/divider/divider.component.js +2 -2
- package/cdn/components/divider/divider.js +3 -3
- package/cdn/components/dropdown/dropdown.component.js +3 -3
- package/cdn/components/dropdown/dropdown.js +4 -4
- package/cdn/components/earthdata-login/earthdata-login.component.js +16 -16
- package/cdn/components/earthdata-login/earthdata-login.js +17 -17
- package/cdn/components/file-upload/file-upload.component.js +2 -2
- package/cdn/components/file-upload/file-upload.js +3 -3
- package/cdn/components/harmony-history/harmony-history.component.js +10 -10
- package/cdn/components/harmony-history/harmony-history.js +11 -11
- package/cdn/components/icon/icon.component.js +3 -3
- package/cdn/components/icon/icon.js +4 -4
- package/cdn/components/input/input.component.js +8 -8
- package/cdn/components/input/input.js +9 -9
- package/cdn/components/loader/loader.component.js +2 -2
- package/cdn/components/loader/loader.js +3 -3
- package/cdn/components/login/login.component.d.ts +1 -0
- package/cdn/components/login/login.component.js +13 -13
- package/cdn/components/login/login.js +14 -14
- package/cdn/components/map/controls/draw-toolbar.control.js +3 -1
- package/cdn/components/map/layers/base.layer.d.ts +7 -0
- package/cdn/components/map/layers/base.layer.js +12 -0
- package/cdn/components/map/layers/borders.layer.d.ts +6 -0
- package/cdn/components/map/layers/borders.layer.js +14 -0
- package/cdn/components/map/layers/bordersStyleConfig.d.ts +29 -0
- package/cdn/components/map/layers/bordersStyleConfig.js +7 -0
- package/cdn/components/map/layers/labels.layer.d.ts +6 -0
- package/cdn/components/map/layers/labels.layer.js +14 -0
- package/cdn/components/map/layers/labelsStyleConfig.d.ts +2337 -0
- package/cdn/components/map/layers/labelsStyleConfig.js +7 -0
- package/cdn/components/map/map.component.d.ts +42 -0
- package/cdn/components/map/map.component.js +19 -9
- package/cdn/components/map/map.js +20 -10
- package/cdn/components/map/map.service.d.ts +50 -1
- package/cdn/components/map/map.service.js +14 -4
- package/cdn/components/map/map.styles.js +1 -1
- package/cdn/components/menu/menu.component.js +2 -2
- package/cdn/components/menu/menu.js +3 -3
- package/cdn/components/menu-item/menu-item.component.js +11 -11
- package/cdn/components/menu-item/menu-item.js +12 -12
- package/cdn/components/menu-item/submenu-controller.js +3 -3
- package/cdn/components/option/option.component.js +6 -6
- package/cdn/components/option/option.js +7 -7
- package/cdn/components/pagination/pagination.component.js +6 -6
- package/cdn/components/pagination/pagination.js +7 -7
- package/cdn/components/plot/plot.component.js +3 -3
- package/cdn/components/plot/plot.js +4 -4
- package/cdn/components/plot-toolbar/notebooks/time-averaged-map-notebook.js +1 -1
- package/cdn/components/plot-toolbar/notebooks/time-series-notebook.js +1 -1
- package/cdn/components/plot-toolbar/plot-toolbar.component.js +35 -25
- package/cdn/components/plot-toolbar/plot-toolbar.js +36 -26
- package/cdn/components/popup/popup.component.js +2 -2
- package/cdn/components/popup/popup.js +3 -3
- package/cdn/components/progress-bar/progress-bar.component.js +2 -2
- package/cdn/components/progress-bar/progress-bar.js +3 -3
- package/cdn/components/radio/radio.component.js +4 -4
- package/cdn/components/radio/radio.js +5 -5
- package/cdn/components/radio-group/radio-group.component.js +2 -2
- package/cdn/components/radio-group/radio-group.js +3 -3
- package/cdn/components/scroll-hint/scroll-hint.component.js +6 -6
- package/cdn/components/scroll-hint/scroll-hint.js +7 -7
- package/cdn/components/select/select.component.js +10 -10
- package/cdn/components/select/select.js +11 -11
- package/cdn/components/site-header/site-header.component.js +5 -5
- package/cdn/components/site-header/site-header.js +5 -5
- package/cdn/components/site-navigation/site-navigation.component.js +2 -2
- package/cdn/components/site-navigation/site-navigation.js +2 -2
- package/cdn/components/skeleton/skeleton.component.js +2 -2
- package/cdn/components/skeleton/skeleton.js +3 -3
- package/cdn/components/slider/slider.component.js +2 -2
- package/cdn/components/slider/slider.js +3 -3
- package/cdn/components/spatial-picker/spatial-picker.component.js +34 -24
- package/cdn/components/spatial-picker/spatial-picker.js +35 -25
- package/cdn/components/status-indicator/status-indicator.component.js +2 -2
- package/cdn/components/status-indicator/status-indicator.js +3 -3
- package/cdn/components/stepper/stepper.component.js +2 -2
- package/cdn/components/stepper/stepper.js +3 -3
- package/cdn/components/stepper-step/stepper-step.component.js +6 -6
- package/cdn/components/stepper-step/stepper-step.js +7 -7
- package/cdn/components/tab/tab.component.js +6 -6
- package/cdn/components/tab/tab.js +7 -7
- package/cdn/components/tab-panel/tab-panel.component.js +2 -2
- package/cdn/components/tab-panel/tab-panel.js +3 -3
- package/cdn/components/tabs/tabs.component.js +6 -6
- package/cdn/components/tabs/tabs.js +7 -7
- package/cdn/components/tag/tag.component.js +6 -6
- package/cdn/components/tag/tag.js +7 -7
- package/cdn/components/textarea/textarea.component.js +4 -4
- package/cdn/components/textarea/textarea.js +5 -5
- package/cdn/components/time-average-map/time-average-map.component.d.ts +12 -8
- package/cdn/components/time-average-map/time-average-map.component.js +44 -34
- package/cdn/components/time-average-map/time-average-map.controller.d.ts +5 -0
- package/cdn/components/time-average-map/time-average-map.controller.js +1 -1
- package/cdn/components/time-average-map/time-average-map.js +45 -35
- package/cdn/components/time-average-map/time-average-map.styles.js +1 -1
- package/cdn/components/time-series/time-series.component.js +43 -33
- package/cdn/components/time-series/time-series.controller.d.ts +5 -0
- package/cdn/components/time-series/time-series.controller.js +1 -1
- package/cdn/components/time-series/time-series.js +44 -34
- package/cdn/components/toast/toast.component.js +4 -4
- package/cdn/components/toast/toast.js +5 -5
- package/cdn/components/toggle/toggle.component.js +4 -4
- package/cdn/components/toggle/toggle.js +5 -5
- package/cdn/components/tooltip/tooltip.component.js +3 -3
- package/cdn/components/tooltip/tooltip.js +4 -4
- package/cdn/components/variable-combobox/lib.js +3 -3
- package/cdn/components/variable-combobox/variable-combobox.component.js +17 -17
- package/cdn/components/variable-combobox/variable-combobox.controller.js +4 -4
- package/cdn/components/variable-combobox/variable-combobox.js +18 -18
- package/cdn/components/variable-keyword-search/variable-keyword-search.component.js +15 -15
- package/cdn/components/variable-keyword-search/variable-keyword-search.js +16 -16
- package/cdn/custom-elements.json +8639 -8546
- package/cdn/events/events.d.ts +1 -1
- package/cdn/events/terra-map-change.d.ts +6 -0
- package/cdn/react/accordion/index.js +6 -6
- package/cdn/react/alert/index.js +4 -4
- package/cdn/react/avatar/index.js +8 -8
- package/cdn/react/badge/index.js +3 -3
- package/cdn/react/banner/index.js +3 -3
- package/cdn/react/breadcrumb/index.js +3 -3
- package/cdn/react/breadcrumbs/index.js +3 -3
- package/cdn/react/browse-variables/index.js +22 -22
- package/cdn/react/button/index.js +8 -8
- package/cdn/react/button-group/index.js +3 -3
- package/cdn/react/caption/index.js +3 -3
- package/cdn/react/card/index.js +3 -3
- package/cdn/react/checkbox/index.js +10 -10
- package/cdn/react/chip/index.js +3 -3
- package/cdn/react/combobox/index.js +8 -8
- package/cdn/react/data-access/index.js +52 -42
- package/cdn/react/data-grid/index.js +6 -6
- package/cdn/react/data-rods/index.js +61 -51
- package/cdn/react/data-subsetter/index.js +62 -52
- package/cdn/react/data-subsetter-history/index.js +64 -54
- package/cdn/react/date-picker/index.js +18 -18
- package/cdn/react/date-range-slider/index.js +3 -3
- package/cdn/react/dialog/index.js +10 -10
- package/cdn/react/divider/index.js +3 -3
- package/cdn/react/dropdown/index.js +4 -4
- package/cdn/react/earthdata-login/index.js +17 -17
- package/cdn/react/file-upload/index.js +3 -3
- package/cdn/react/harmony-history/index.js +11 -11
- package/cdn/react/icon/index.js +4 -4
- package/cdn/react/index.d.ts +23 -23
- package/cdn/react/index.js +258 -248
- package/cdn/react/input/index.js +9 -9
- package/cdn/react/loader/index.js +3 -3
- package/cdn/react/login/index.js +14 -14
- package/cdn/react/map/index.js +20 -10
- package/cdn/react/menu/index.js +3 -3
- package/cdn/react/menu-item/index.js +12 -12
- package/cdn/react/option/index.js +7 -7
- package/cdn/react/pagination/index.js +7 -7
- package/cdn/react/plot/index.js +4 -4
- package/cdn/react/plot-toolbar/index.js +36 -26
- package/cdn/react/popup/index.js +3 -3
- package/cdn/react/progress-bar/index.js +3 -3
- package/cdn/react/radio/index.js +5 -5
- package/cdn/react/radio-group/index.js +3 -3
- package/cdn/react/scroll-hint/index.js +7 -7
- package/cdn/react/select/index.js +11 -11
- package/cdn/react/site-header/index.js +6 -6
- package/cdn/react/site-navigation/index.js +3 -3
- package/cdn/react/skeleton/index.js +3 -3
- package/cdn/react/slider/index.js +3 -3
- package/cdn/react/spatial-picker/index.js +35 -25
- package/cdn/react/status-indicator/index.js +3 -3
- package/cdn/react/stepper/index.js +3 -3
- package/cdn/react/stepper-step/index.js +7 -7
- package/cdn/react/tab/index.js +7 -7
- package/cdn/react/tab-panel/index.js +3 -3
- package/cdn/react/tabs/index.js +7 -7
- package/cdn/react/tag/index.js +7 -7
- package/cdn/react/textarea/index.js +5 -5
- package/cdn/react/time-average-map/index.js +45 -35
- package/cdn/react/time-series/index.js +44 -34
- package/cdn/react/toast/index.js +5 -5
- package/cdn/react/toggle/index.js +5 -5
- package/cdn/react/tooltip/index.js +4 -4
- package/cdn/react/variable-combobox/index.js +18 -18
- package/cdn/react/variable-keyword-search/index.js +16 -16
- package/cdn/terra-ui-components.js +255 -245
- package/cdn/types/vue/index.d.ts +881 -858
- package/cdn/vscode.html-custom-data.json +828 -822
- package/cdn/web-types.json +2047 -2032
- package/dist/chunks/chunk.2HEXM6MX.js +154 -0
- package/dist/chunks/chunk.2XFQ7HNR.js +1 -0
- package/dist/chunks/chunk.2ZDFC7XD.js +5 -0
- package/dist/chunks/chunk.3AF4SJ26.js +780 -0
- package/dist/chunks/chunk.3CP7SY7X.js +1 -0
- package/dist/chunks/chunk.3NAZF34U.js +1 -0
- package/dist/chunks/chunk.3R2J27ZS.js +25 -0
- package/dist/chunks/chunk.3XRKWNW5.js +1 -0
- package/dist/chunks/chunk.3YJGZAO5.js +1 -0
- package/dist/chunks/chunk.447IKCOD.js +1 -0
- package/dist/chunks/chunk.44AWWV54.js +30 -0
- package/dist/chunks/chunk.46DYUPBX.js +22 -0
- package/dist/chunks/chunk.4E2BUN4F.js +1 -0
- package/dist/chunks/chunk.4NDKE3PZ.js +1 -0
- package/dist/chunks/chunk.4RFJMMAN.js +1 -0
- package/dist/chunks/chunk.4SRXQYLE.js +39 -0
- package/dist/chunks/chunk.4ZQUOM75.js +80 -0
- package/dist/chunks/chunk.5DDZRQCR.js +26 -0
- package/dist/chunks/chunk.5DJQBDNY.js +99 -0
- package/dist/chunks/chunk.5GJQRKUS.js +1 -0
- package/dist/chunks/chunk.5GTOXSEK.js +24 -0
- package/dist/chunks/chunk.5HY3BVXE.js +23 -0
- package/dist/chunks/chunk.5MNSQC5Z.js +43 -0
- package/dist/chunks/chunk.5S57Z6MY.js +1 -0
- package/dist/chunks/chunk.63KFBVDZ.js +125 -0
- package/dist/chunks/chunk.66FVHWWG.js +1 -0
- package/dist/chunks/chunk.6C3T5LR6.js +1 -0
- package/dist/chunks/chunk.6D4YDDOH.js +148 -0
- package/dist/chunks/chunk.6OVOBLEB.js +1 -0
- package/dist/chunks/chunk.6QWTHDDS.js +1 -0
- package/dist/chunks/chunk.6TIISOSM.js +1 -0
- package/dist/chunks/chunk.6UUXXIO5.js +1 -0
- package/dist/chunks/chunk.6YB2WV52.js +9 -0
- package/dist/chunks/chunk.6YNWYAON.js +1 -0
- package/dist/chunks/chunk.74UO2S6X.js +26 -0
- package/dist/chunks/chunk.75Q2DUI4.js +145 -0
- package/dist/chunks/chunk.7DCDWHIP.js +1 -0
- package/dist/chunks/chunk.7KOIBYPW.js +1 -0
- package/dist/chunks/chunk.7LW5MDPV.js +1 -0
- package/dist/chunks/chunk.7RSJSUF5.js +122 -0
- package/dist/chunks/chunk.7VL5XLTF.js +1 -0
- package/dist/chunks/chunk.7ZTODERJ.js +61 -0
- package/dist/chunks/chunk.A4JPZBCU.js +1 -0
- package/dist/chunks/chunk.A6XZHXKG.js +17 -0
- package/dist/chunks/chunk.ABDHAYTU.js +1 -0
- package/dist/chunks/chunk.AF4KKKIK.js +176 -0
- package/dist/chunks/chunk.AOJ7CENL.js +1 -0
- package/dist/chunks/chunk.ATX7REBU.js +1 -0
- package/dist/chunks/chunk.AUBMY7XI.js +8 -0
- package/dist/chunks/chunk.AV5MTWD4.js +1 -0
- package/dist/chunks/chunk.AWA2ZGEV.js +300 -0
- package/dist/chunks/chunk.AXXCXZWY.js +1 -0
- package/dist/chunks/chunk.AYEBTFZT.js +433 -0
- package/dist/chunks/chunk.B5FLJR3A.js +37 -0
- package/dist/chunks/chunk.BCI323BR.js +1 -0
- package/dist/chunks/chunk.BQ2TQQGG.js +1 -0
- package/dist/chunks/chunk.BRSDDKYM.js +33 -0
- package/dist/chunks/chunk.BYWODPGT.js +1 -0
- package/dist/chunks/chunk.C5S23DNK.js +1 -0
- package/dist/chunks/chunk.CBLMIMXD.js +20 -0
- package/dist/chunks/chunk.CC3TFKZ5.js +1 -0
- package/dist/chunks/chunk.CLGMXYFG.js +1 -0
- package/dist/chunks/chunk.CLQSO2B3.js +1 -0
- package/dist/chunks/chunk.CMABIFU7.js +1 -0
- package/dist/chunks/chunk.CS5XSAK7.js +1 -0
- package/dist/chunks/chunk.D5GCNDYG.js +1 -0
- package/dist/chunks/chunk.DANE2DV4.js +1 -0
- package/dist/chunks/chunk.DBLKA334.js +1 -0
- package/dist/chunks/chunk.DHUDN5NR.js +1 -0
- package/dist/chunks/chunk.DK636C4K.js +19 -0
- package/dist/chunks/chunk.DSIIF7K6.js +1 -0
- package/dist/chunks/chunk.DUG6LPDO.js +1 -0
- package/dist/chunks/chunk.DXULPI2C.js +1 -0
- package/dist/chunks/chunk.ECXCY3XX.js +12 -0
- package/dist/chunks/chunk.EFQ4VOA6.js +1 -0
- package/dist/chunks/chunk.EHEFJ4UM.js +35 -0
- package/dist/chunks/chunk.EPMIYG6Y.js +113 -0
- package/dist/chunks/chunk.F5HERH3C.js +1 -0
- package/dist/chunks/chunk.FEBNDE5C.js +1 -0
- package/dist/chunks/chunk.FSHLOPG4.js +1 -0
- package/dist/chunks/chunk.FTC6BJLL.js +47 -0
- package/dist/chunks/chunk.FWNUKBYM.js +1 -0
- package/dist/chunks/chunk.GCKLOHLJ.js +1 -0
- package/dist/chunks/chunk.GQT3QXWD.js +1 -0
- package/dist/chunks/chunk.GSCUNOLU.js +30 -0
- package/dist/chunks/chunk.GUIMVPU3.js +1 -0
- package/dist/chunks/chunk.GXCYLTXI.js +1 -0
- package/dist/chunks/chunk.H2EZ7VOW.js +1 -0
- package/dist/chunks/chunk.H2MRWWA5.js +1 -0
- package/dist/chunks/chunk.H4WCUAI5.js +1 -0
- package/dist/chunks/chunk.H6HYWCWZ.js +55 -0
- package/dist/chunks/chunk.HKXBQIJC.js +1 -0
- package/dist/chunks/chunk.HLRV2WXA.js +1 -0
- package/dist/chunks/chunk.HPSHJNUL.js +1 -0
- package/dist/chunks/chunk.HQE6JQ36.js +1 -0
- package/dist/chunks/chunk.HTRDWX5D.js +1 -0
- package/dist/chunks/chunk.I2H5CL5B.js +1 -0
- package/dist/chunks/chunk.I2VZCTPD.js +1 -0
- package/dist/chunks/chunk.I3ABET54.js +1 -0
- package/dist/chunks/chunk.I4XNSZMV.js +14 -0
- package/dist/chunks/chunk.IDRV4QVY.js +75 -0
- package/dist/chunks/chunk.IHH2EMZT.js +280 -0
- package/dist/chunks/chunk.IX4DTAAR.js +1 -0
- package/dist/chunks/chunk.IYYXOBVJ.js +1 -0
- package/dist/chunks/chunk.J6YMXA4V.js +1 -0
- package/dist/chunks/chunk.JF64QOIK.js +1 -0
- package/dist/chunks/chunk.JMGGBACY.js +1 -0
- package/dist/chunks/chunk.JPRIHHL3.js +1 -0
- package/dist/chunks/chunk.JUV3F76R.js +35 -0
- package/dist/chunks/chunk.K67524WR.js +1 -0
- package/dist/chunks/chunk.K6KJNAUI.js +1 -0
- package/dist/chunks/chunk.KCCCUPQI.js +74 -0
- package/dist/chunks/chunk.KDP7MFSQ.js +1 -0
- package/dist/chunks/chunk.KG3775TI.js +1 -0
- package/dist/chunks/chunk.KG4H7K5W.js +11 -0
- package/dist/chunks/chunk.KIXW3H6F.js +1 -0
- package/dist/chunks/chunk.KRQB5VTT.js +1 -0
- package/dist/chunks/chunk.KSEX673E.js +1 -0
- package/dist/chunks/chunk.KUPSLOUX.js +1 -0
- package/dist/chunks/chunk.L2IUPHO3.js +1 -0
- package/dist/chunks/chunk.LCGVUMKQ.js +43 -0
- package/dist/chunks/chunk.LFHFYBLO.js +1 -0
- package/dist/chunks/chunk.LICY6WJT.js +4 -0
- package/dist/chunks/chunk.LKQ44YSQ.js +1 -0
- package/dist/chunks/chunk.M4G2JEW2.js +1 -0
- package/dist/chunks/chunk.MBOEFHQI.js +55 -0
- package/dist/chunks/chunk.MCR2VZQP.js +1 -0
- package/dist/chunks/chunk.MGN6FPMX.js +1 -0
- package/dist/chunks/chunk.MOWA5ULN.js +1 -0
- package/dist/chunks/chunk.MPDRWVZL.js +1 -0
- package/dist/chunks/chunk.MSBCPIGA.js +1 -0
- package/dist/chunks/chunk.N4IMML6I.js +121 -0
- package/dist/chunks/chunk.NRTWU3TW.js +1 -0
- package/dist/chunks/chunk.NW27EPOF.js +5 -0
- package/dist/chunks/chunk.NXSYWMFP.js +1 -0
- package/dist/chunks/chunk.NZNJPDVW.js +1 -0
- package/dist/chunks/chunk.OAALYDNZ.js +1 -0
- package/dist/chunks/chunk.OANTUX24.js +48 -0
- package/dist/chunks/chunk.OFOCDP2M.js +1 -0
- package/dist/chunks/chunk.OJUQFN4A.js +27 -0
- package/dist/chunks/chunk.OPBZIY2A.js +1 -0
- package/dist/chunks/chunk.OT6SFBQX.js +1 -0
- package/dist/chunks/chunk.OWZEKFKL.js +1 -0
- package/dist/chunks/chunk.OZUKFWGD.js +1 -0
- package/dist/chunks/chunk.P5XWJ5HC.js +1 -0
- package/dist/chunks/chunk.PR7E6KYS.js +1 -0
- package/dist/chunks/chunk.PTN44XCI.js +572 -0
- package/dist/chunks/chunk.PWT5JMOP.js +1 -0
- package/dist/chunks/chunk.QBXUVQTY.js +1 -0
- package/dist/chunks/chunk.QIS56XCC.js +1 -0
- package/dist/chunks/chunk.QP5FZIRF.js +1 -0
- package/dist/chunks/chunk.QQV7OIO7.js +55 -0
- package/dist/chunks/chunk.QS2CNV3Q.js +1 -0
- package/dist/chunks/chunk.QUULVCZU.js +1 -0
- package/dist/chunks/chunk.R4JAF7DS.js +1 -0
- package/dist/chunks/chunk.RFRYQSE5.js +41 -0
- package/dist/chunks/chunk.RIDJTVHV.js +1 -0
- package/dist/chunks/chunk.RNGOVZGF.js +9 -0
- package/dist/chunks/chunk.RRTP2FHP.js +1 -0
- package/dist/chunks/chunk.RW66TULD.js +1 -0
- package/dist/chunks/chunk.RXSKPOBF.js +1 -0
- package/dist/chunks/chunk.RYL27WYB.js +1 -0
- package/dist/chunks/chunk.SAHUIO3P.js +1 -0
- package/dist/chunks/chunk.SPNO75Q4.js +514 -0
- package/dist/chunks/chunk.SY3HGJA3.js +100 -0
- package/dist/chunks/chunk.SYGSWLVD.js +1 -0
- package/dist/chunks/chunk.TAQ6A3B7.js +2 -0
- package/dist/chunks/chunk.TQZFMQPE.js +11 -0
- package/dist/chunks/chunk.TSOQGANL.js +1 -0
- package/dist/chunks/chunk.TTWUGVNW.js +1 -0
- package/dist/chunks/chunk.UCO7ADVP.js +64 -0
- package/dist/chunks/chunk.UFJISWXG.js +1 -0
- package/dist/chunks/chunk.UFYFMNUK.js +1 -0
- package/dist/chunks/chunk.UIQXEV7N.js +67 -0
- package/dist/chunks/chunk.UZHA3QCH.js +1190 -0
- package/dist/chunks/chunk.UZI5DYPK.js +41 -0
- package/dist/chunks/chunk.UZZBJV4T.js +1 -0
- package/dist/chunks/chunk.V34PEB3H.js +1 -0
- package/dist/chunks/chunk.V4X3J7H5.js +1 -0
- package/dist/chunks/chunk.VILSXY2Q.js +1 -0
- package/dist/chunks/chunk.VSPWNHOW.js +1 -0
- package/dist/chunks/chunk.VT3KMZ66.js +1 -0
- package/dist/chunks/chunk.VZESRFZQ.js +62 -0
- package/dist/chunks/chunk.W57YAS2G.js +1 -0
- package/dist/chunks/chunk.WDHC6FGQ.js +157 -0
- package/dist/chunks/chunk.WE4PQXFD.js +65 -0
- package/dist/chunks/chunk.WG457PDK.js +1 -0
- package/dist/chunks/chunk.WJQTKD6X.js +1 -0
- package/dist/chunks/chunk.WKNEHZOD.js +16 -0
- package/dist/chunks/chunk.WQFHYRFG.js +1 -0
- package/dist/chunks/chunk.WTDZWPN3.js +1 -0
- package/dist/chunks/chunk.WZYEI2K3.js +1 -0
- package/dist/chunks/chunk.X266J3HR.js +1 -0
- package/dist/chunks/chunk.X74E6IXG.js +1 -0
- package/dist/chunks/chunk.XA6IYBQ4.js +1 -0
- package/dist/chunks/chunk.XAZE2FE3.js +1 -0
- package/dist/chunks/chunk.XJKVDKZL.js +1 -0
- package/dist/chunks/chunk.XUAILPGW.js +1 -0
- package/dist/chunks/chunk.XV7MX5O2.js +1 -0
- package/dist/chunks/chunk.YA5FFFLQ.js +20 -0
- package/dist/chunks/chunk.YDXNKY2Y.js +1 -0
- package/dist/chunks/chunk.YOFBYVP5.js +6 -0
- package/dist/chunks/chunk.YR5SSBSW.js +299 -0
- package/dist/chunks/chunk.YUDIM7TE.js +1 -0
- package/dist/chunks/chunk.YX5E2IPT.js +1 -0
- package/dist/chunks/chunk.ZRR3M7ZR.js +8 -0
- package/dist/chunks/chunk.ZUZ7QHWU.js +1 -0
- package/dist/components/accordion/accordion.component.js +1 -1
- package/dist/components/accordion/accordion.js +1 -1
- package/dist/components/alert/alert.component.js +1 -1
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/avatar/avatar.component.js +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.component.js +1 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/banner/banner.component.js +1 -1
- package/dist/components/banner/banner.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.component.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.component.js +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/components/browse-variables/browse-variables.component.js +1 -1
- package/dist/components/browse-variables/browse-variables.js +1 -1
- package/dist/components/button/button.component.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button-group/button-group.component.js +1 -1
- package/dist/components/button-group/button-group.js +1 -1
- package/dist/components/caption/caption.component.js +1 -1
- package/dist/components/caption/caption.js +1 -1
- package/dist/components/card/card.component.js +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/checkbox/checkbox.component.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/chip/chip.component.js +1 -1
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/combobox/combobox.component.js +1 -1
- package/dist/components/combobox/combobox.js +1 -1
- package/dist/components/data-access/data-access.component.js +1 -1
- package/dist/components/data-access/data-access.js +1 -1
- package/dist/components/data-grid/data-grid.component.js +1 -1
- package/dist/components/data-grid/data-grid.js +1 -1
- package/dist/components/data-rods/data-rods.component.js +1 -1
- package/dist/components/data-rods/data-rods.js +1 -1
- package/dist/components/data-subsetter/data-subsetter.component.d.ts +1 -0
- package/dist/components/data-subsetter/data-subsetter.component.js +1 -1
- package/dist/components/data-subsetter/data-subsetter.js +1 -1
- package/dist/components/data-subsetter/notebooks/subsetter-notebook.js +1 -1
- package/dist/components/data-subsetter-history/data-subsetter-history.component.js +1 -1
- package/dist/components/data-subsetter-history/data-subsetter-history.js +1 -1
- package/dist/components/date-picker/date-picker.component.js +1 -1
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-range-slider/date-range-slider.component.js +1 -1
- package/dist/components/date-range-slider/date-range-slider.js +1 -1
- package/dist/components/dialog/dialog.component.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/divider/divider.component.js +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/dropdown/dropdown.component.js +1 -1
- package/dist/components/dropdown/dropdown.js +1 -1
- package/dist/components/earthdata-login/earthdata-login.component.js +1 -1
- package/dist/components/earthdata-login/earthdata-login.js +1 -1
- package/dist/components/file-upload/file-upload.component.js +1 -1
- package/dist/components/file-upload/file-upload.js +1 -1
- package/dist/components/harmony-history/harmony-history.component.js +1 -1
- package/dist/components/harmony-history/harmony-history.js +1 -1
- package/dist/components/icon/icon.component.js +1 -1
- package/dist/components/icon/icon.js +1 -1
- package/dist/components/input/input.component.js +1 -1
- package/dist/components/input/input.js +1 -1
- package/dist/components/loader/loader.component.js +1 -1
- package/dist/components/loader/loader.js +1 -1
- package/dist/components/login/login.component.d.ts +1 -0
- package/dist/components/login/login.component.js +1 -1
- package/dist/components/login/login.js +1 -1
- package/dist/components/map/layers/base.layer.d.ts +7 -0
- package/dist/components/map/layers/base.layer.js +1 -0
- package/dist/components/map/layers/borders.layer.d.ts +6 -0
- package/dist/components/map/layers/borders.layer.js +1 -0
- package/dist/components/map/layers/bordersStyleConfig.d.ts +29 -0
- package/dist/components/map/layers/bordersStyleConfig.js +1 -0
- package/dist/components/map/layers/labels.layer.d.ts +6 -0
- package/dist/components/map/layers/labels.layer.js +1 -0
- package/dist/components/map/layers/labelsStyleConfig.d.ts +2337 -0
- package/dist/components/map/layers/labelsStyleConfig.js +1 -0
- package/dist/components/map/map.component.d.ts +42 -0
- package/dist/components/map/map.component.js +1 -1
- package/dist/components/map/map.js +1 -1
- package/dist/components/map/map.service.d.ts +50 -1
- package/dist/components/map/map.service.js +1 -1
- package/dist/components/map/map.styles.js +1 -1
- package/dist/components/menu/menu.component.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/menu-item/menu-item.component.js +1 -1
- package/dist/components/menu-item/menu-item.js +1 -1
- package/dist/components/option/option.component.js +1 -1
- package/dist/components/option/option.js +1 -1
- package/dist/components/pagination/pagination.component.js +1 -1
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/plot/plot.component.js +1 -1
- package/dist/components/plot/plot.js +1 -1
- package/dist/components/plot-toolbar/notebooks/time-averaged-map-notebook.js +1 -1
- package/dist/components/plot-toolbar/notebooks/time-series-notebook.js +1 -1
- package/dist/components/plot-toolbar/plot-toolbar.component.js +1 -1
- package/dist/components/plot-toolbar/plot-toolbar.js +1 -1
- package/dist/components/popup/popup.component.js +1 -1
- package/dist/components/popup/popup.js +1 -1
- package/dist/components/progress-bar/progress-bar.component.js +1 -1
- package/dist/components/progress-bar/progress-bar.js +1 -1
- package/dist/components/radio/radio.component.js +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio-group/radio-group.component.js +1 -1
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/scroll-hint/scroll-hint.component.js +1 -1
- package/dist/components/scroll-hint/scroll-hint.js +1 -1
- package/dist/components/select/select.component.js +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/site-header/site-header.component.js +1 -1
- package/dist/components/site-header/site-header.js +1 -1
- package/dist/components/site-navigation/site-navigation.component.js +1 -1
- package/dist/components/site-navigation/site-navigation.js +1 -1
- package/dist/components/skeleton/skeleton.component.js +1 -1
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/slider/slider.component.js +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/spatial-picker/spatial-picker.component.js +1 -1
- package/dist/components/spatial-picker/spatial-picker.js +1 -1
- package/dist/components/status-indicator/status-indicator.component.js +1 -1
- package/dist/components/status-indicator/status-indicator.js +1 -1
- package/dist/components/stepper/stepper.component.js +1 -1
- package/dist/components/stepper/stepper.js +1 -1
- package/dist/components/stepper-step/stepper-step.component.js +1 -1
- package/dist/components/stepper-step/stepper-step.js +1 -1
- package/dist/components/tab/tab.component.js +1 -1
- package/dist/components/tab/tab.js +1 -1
- package/dist/components/tab-panel/tab-panel.component.js +1 -1
- package/dist/components/tab-panel/tab-panel.js +1 -1
- package/dist/components/tabs/tabs.component.js +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tag/tag.component.js +1 -1
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/textarea/textarea.component.js +1 -1
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/time-average-map/time-average-map.component.d.ts +12 -8
- package/dist/components/time-average-map/time-average-map.component.js +1 -1
- package/dist/components/time-average-map/time-average-map.controller.d.ts +5 -0
- package/dist/components/time-average-map/time-average-map.controller.js +1 -1
- package/dist/components/time-average-map/time-average-map.js +1 -1
- package/dist/components/time-average-map/time-average-map.styles.js +1 -1
- package/dist/components/time-series/time-series.component.js +1 -1
- package/dist/components/time-series/time-series.controller.d.ts +5 -0
- package/dist/components/time-series/time-series.controller.js +1 -1
- package/dist/components/time-series/time-series.js +1 -1
- package/dist/components/toast/toast.component.js +1 -1
- package/dist/components/toast/toast.js +1 -1
- package/dist/components/toggle/toggle.component.js +1 -1
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/tooltip/tooltip.component.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/variable-combobox/variable-combobox.component.js +1 -1
- package/dist/components/variable-combobox/variable-combobox.js +1 -1
- package/dist/components/variable-keyword-search/variable-keyword-search.component.js +1 -1
- package/dist/components/variable-keyword-search/variable-keyword-search.js +1 -1
- package/dist/custom-elements.json +8639 -8546
- package/dist/events/events.d.ts +1 -1
- package/dist/events/terra-map-change.d.ts +6 -0
- package/dist/react/accordion/index.js +1 -1
- package/dist/react/alert/index.js +1 -1
- package/dist/react/avatar/index.js +1 -1
- package/dist/react/badge/index.js +1 -1
- package/dist/react/banner/index.js +1 -1
- package/dist/react/breadcrumb/index.js +1 -1
- package/dist/react/breadcrumbs/index.js +1 -1
- package/dist/react/browse-variables/index.js +1 -1
- package/dist/react/button/index.js +1 -1
- package/dist/react/button-group/index.js +1 -1
- package/dist/react/caption/index.js +1 -1
- package/dist/react/card/index.js +1 -1
- package/dist/react/checkbox/index.js +1 -1
- package/dist/react/chip/index.js +1 -1
- package/dist/react/combobox/index.js +1 -1
- package/dist/react/data-access/index.js +1 -1
- package/dist/react/data-grid/index.js +1 -1
- package/dist/react/data-rods/index.js +1 -1
- package/dist/react/data-subsetter/index.js +1 -1
- package/dist/react/data-subsetter-history/index.js +1 -1
- package/dist/react/date-picker/index.js +1 -1
- package/dist/react/date-range-slider/index.js +1 -1
- package/dist/react/dialog/index.js +1 -1
- package/dist/react/divider/index.js +1 -1
- package/dist/react/dropdown/index.js +1 -1
- package/dist/react/earthdata-login/index.js +1 -1
- package/dist/react/file-upload/index.js +1 -1
- package/dist/react/harmony-history/index.js +1 -1
- package/dist/react/icon/index.js +1 -1
- package/dist/react/index.d.ts +23 -23
- package/dist/react/index.js +1 -1
- package/dist/react/input/index.js +1 -1
- package/dist/react/loader/index.js +1 -1
- package/dist/react/login/index.js +1 -1
- package/dist/react/map/index.js +1 -1
- package/dist/react/menu/index.js +1 -1
- package/dist/react/menu-item/index.js +1 -1
- package/dist/react/option/index.js +1 -1
- package/dist/react/pagination/index.js +1 -1
- package/dist/react/plot/index.js +1 -1
- package/dist/react/plot-toolbar/index.js +1 -1
- package/dist/react/popup/index.js +1 -1
- package/dist/react/progress-bar/index.js +1 -1
- package/dist/react/radio/index.js +1 -1
- package/dist/react/radio-group/index.js +1 -1
- package/dist/react/scroll-hint/index.js +1 -1
- package/dist/react/select/index.js +1 -1
- package/dist/react/site-header/index.js +1 -1
- package/dist/react/site-navigation/index.js +1 -1
- package/dist/react/skeleton/index.js +1 -1
- package/dist/react/slider/index.js +1 -1
- package/dist/react/spatial-picker/index.js +1 -1
- package/dist/react/status-indicator/index.js +1 -1
- package/dist/react/stepper/index.js +1 -1
- package/dist/react/stepper-step/index.js +1 -1
- package/dist/react/tab/index.js +1 -1
- package/dist/react/tab-panel/index.js +1 -1
- package/dist/react/tabs/index.js +1 -1
- package/dist/react/tag/index.js +1 -1
- package/dist/react/textarea/index.js +1 -1
- package/dist/react/time-average-map/index.js +1 -1
- package/dist/react/time-series/index.js +1 -1
- package/dist/react/toast/index.js +1 -1
- package/dist/react/toggle/index.js +1 -1
- package/dist/react/tooltip/index.js +1 -1
- package/dist/react/variable-combobox/index.js +1 -1
- package/dist/react/variable-keyword-search/index.js +1 -1
- package/dist/terra-ui-components.js +1 -1
- package/dist/terra_ui_components-0.0.199-py3-none-any.whl +0 -0
- package/dist/terra_ui_components-0.0.199.tar.gz +0 -0
- package/dist/types/vue/index.d.ts +881 -858
- package/dist/vscode.html-custom-data.json +828 -822
- package/dist/web-types.json +2047 -2032
- package/package.json +2 -1
- package/cdn/chunks/GeoTIFF.NRJSPXBW.js +0 -21958
- package/cdn/chunks/chunk.2DTFNQFU.js +0 -537
- package/cdn/chunks/chunk.2GFNVSIG.js +0 -134
- package/cdn/chunks/chunk.2LBTME33.js +0 -29
- package/cdn/chunks/chunk.2QMJ6JFC.js +0 -19
- package/cdn/chunks/chunk.2WSLJMJH.js +0 -19
- package/cdn/chunks/chunk.2YVSNZK6.js +0 -158
- package/cdn/chunks/chunk.35V6PNLW.js +0 -113
- package/cdn/chunks/chunk.35W6TJ7F.js +0 -266
- package/cdn/chunks/chunk.3EDRI43W.js +0 -19
- package/cdn/chunks/chunk.3MSKTFUH.js +0 -610
- package/cdn/chunks/chunk.3MSMZU4H.js +0 -33
- package/cdn/chunks/chunk.3Q67HS22.js +0 -19
- package/cdn/chunks/chunk.43DUFN7D.js +0 -37
- package/cdn/chunks/chunk.463S4T2I.js +0 -49
- package/cdn/chunks/chunk.4AP7IUGS.js +0 -19
- package/cdn/chunks/chunk.4C66SG3L.js +0 -47
- package/cdn/chunks/chunk.4CMK7BSI.js +0 -29
- package/cdn/chunks/chunk.4GLQ2KWQ.js +0 -631
- package/cdn/chunks/chunk.4GNN2544.js +0 -29
- package/cdn/chunks/chunk.4U3PMGMD.js +0 -36
- package/cdn/chunks/chunk.4ZE6RMS6.js +0 -132
- package/cdn/chunks/chunk.5FAACRBU.js +0 -594
- package/cdn/chunks/chunk.5JFGJRLR.js +0 -19
- package/cdn/chunks/chunk.5S5IE4WQ.js +0 -195
- package/cdn/chunks/chunk.5U47W7ZI.js +0 -32
- package/cdn/chunks/chunk.5VJNHYYD.js +0 -171
- package/cdn/chunks/chunk.632TYPZK.js +0 -19
- package/cdn/chunks/chunk.6FJCGU4K.js +0 -616
- package/cdn/chunks/chunk.6INKGSON.js +0 -19
- package/cdn/chunks/chunk.6IRICZQU.js +0 -36
- package/cdn/chunks/chunk.6NKCYDS6.js +0 -99
- package/cdn/chunks/chunk.6OXV4DFR.js +0 -29
- package/cdn/chunks/chunk.6SJL6T2W.js +0 -29
- package/cdn/chunks/chunk.73PEBYZF.js +0 -224
- package/cdn/chunks/chunk.73QX76GR.js +0 -19
- package/cdn/chunks/chunk.7IYPYEBZ.js +0 -278
- package/cdn/chunks/chunk.7MG6BND4.js +0 -359
- package/cdn/chunks/chunk.7MOV32ZX.js +0 -29
- package/cdn/chunks/chunk.7OBDWUSU.js +0 -293
- package/cdn/chunks/chunk.A6A2KVBS.js +0 -29
- package/cdn/chunks/chunk.AATVQZ7X.js +0 -277
- package/cdn/chunks/chunk.AB5GSS2K.js +0 -86
- package/cdn/chunks/chunk.AP626FXT.js +0 -35
- package/cdn/chunks/chunk.APOEQA6N.js +0 -157
- package/cdn/chunks/chunk.ARMGN7PF.js +0 -35
- package/cdn/chunks/chunk.AUB3ZMUY.js +0 -32
- package/cdn/chunks/chunk.AUOREJVS.js +0 -32
- package/cdn/chunks/chunk.AVQ3IV27.js +0 -29
- package/cdn/chunks/chunk.B2JKFWS4.js +0 -19
- package/cdn/chunks/chunk.B3ZNCJ7K.js +0 -32
- package/cdn/chunks/chunk.B4EO7TSO.js +0 -29
- package/cdn/chunks/chunk.B4JUAUTG.js +0 -29
- package/cdn/chunks/chunk.B525B6TR.js +0 -19
- package/cdn/chunks/chunk.B6N22EGF.js +0 -29
- package/cdn/chunks/chunk.BEIYABPJ.js +0 -155
- package/cdn/chunks/chunk.BIFWEQ4T.js +0 -68
- package/cdn/chunks/chunk.BPM7DAZG.js +0 -19
- package/cdn/chunks/chunk.BSZO4VOU.js +0 -29
- package/cdn/chunks/chunk.BVACLOKI.js +0 -110
- package/cdn/chunks/chunk.BY4MQRHS.js +0 -19
- package/cdn/chunks/chunk.C5JHX2EK.js +0 -19
- package/cdn/chunks/chunk.CJZNLZ5M.js +0 -190
- package/cdn/chunks/chunk.CLL4XXBG.js +0 -188
- package/cdn/chunks/chunk.CLOSWCHA.js +0 -279
- package/cdn/chunks/chunk.CLYZO6RS.js +0 -19
- package/cdn/chunks/chunk.COWPPOED.js +0 -298
- package/cdn/chunks/chunk.D33JWLZ4.js +0 -1197
- package/cdn/chunks/chunk.D4EWCYPC.js +0 -29
- package/cdn/chunks/chunk.D7P7KTFB.js +0 -60
- package/cdn/chunks/chunk.DHO25PWY.js +0 -29
- package/cdn/chunks/chunk.DI7EKGFG.js +0 -19
- package/cdn/chunks/chunk.DL33ULT6.js +0 -74
- package/cdn/chunks/chunk.DS2UI56D.js +0 -2546
- package/cdn/chunks/chunk.E5DXZQD2.js +0 -29
- package/cdn/chunks/chunk.EGVLPWSM.js +0 -19
- package/cdn/chunks/chunk.EJ53LCTI.js +0 -19
- package/cdn/chunks/chunk.EJGXJRTJ.js +0 -104
- package/cdn/chunks/chunk.EM5ETPZC.js +0 -538
- package/cdn/chunks/chunk.ENHWIPZE.js +0 -19
- package/cdn/chunks/chunk.EOI3OPDR.js +0 -19
- package/cdn/chunks/chunk.EUOALKXD.js +0 -443
- package/cdn/chunks/chunk.EYGHFENC.js +0 -29
- package/cdn/chunks/chunk.FFXP3B4Q.js +0 -357
- package/cdn/chunks/chunk.FIBES3B2.js +0 -657
- package/cdn/chunks/chunk.G3RBNUL7.js +0 -19
- package/cdn/chunks/chunk.G6XFMNSN.js +0 -39
- package/cdn/chunks/chunk.GGTQYGC5.js +0 -458
- package/cdn/chunks/chunk.GMM3EOD6.js +0 -9743
- package/cdn/chunks/chunk.GPKPQWJT.js +0 -19
- package/cdn/chunks/chunk.GSVBEUFJ.js +0 -1264
- package/cdn/chunks/chunk.GULH5ZQL.js +0 -136
- package/cdn/chunks/chunk.GZFLFIFJ.js +0 -34
- package/cdn/chunks/chunk.HDXVT23K.js +0 -19
- package/cdn/chunks/chunk.HOZW3NJM.js +0 -29
- package/cdn/chunks/chunk.HSJLPMW3.js +0 -83
- package/cdn/chunks/chunk.HYQMNFLO.js +0 -19
- package/cdn/chunks/chunk.I2ABYF5Q.js +0 -29
- package/cdn/chunks/chunk.IOF6AEVS.js +0 -19
- package/cdn/chunks/chunk.IYZN7M47.js +0 -19
- package/cdn/chunks/chunk.J5KHF56L.js +0 -19
- package/cdn/chunks/chunk.J7MBJE4R.js +0 -19
- package/cdn/chunks/chunk.JTS4WCJO.js +0 -92
- package/cdn/chunks/chunk.JU6WFHNW.js +0 -36
- package/cdn/chunks/chunk.JUSWD466.js +0 -29
- package/cdn/chunks/chunk.KM6WWUYU.js +0 -77
- package/cdn/chunks/chunk.KT3QCKKA.js +0 -19
- package/cdn/chunks/chunk.L5CO7SOT.js +0 -925
- package/cdn/chunks/chunk.LAY23KKI.js +0 -78
- package/cdn/chunks/chunk.LBQ4PSBA.js +0 -19
- package/cdn/chunks/chunk.LH5PCM5Y.js +0 -29
- package/cdn/chunks/chunk.LK72N66W.js +0 -19
- package/cdn/chunks/chunk.LXN7MR5D.js +0 -33
- package/cdn/chunks/chunk.M2W34SRN.js +0 -19
- package/cdn/chunks/chunk.M3DISCOU.js +0 -138
- package/cdn/chunks/chunk.M6UIVWVO.js +0 -478
- package/cdn/chunks/chunk.MJWLUGWW.js +0 -377
- package/cdn/chunks/chunk.MLSETH2M.js +0 -19
- package/cdn/chunks/chunk.MYRHUQRX.js +0 -71
- package/cdn/chunks/chunk.N33IYXN4.js +0 -19
- package/cdn/chunks/chunk.N6LXBZMX.js +0 -29
- package/cdn/chunks/chunk.NG4ZI7ET.js +0 -19
- package/cdn/chunks/chunk.NGS4A7JM.js +0 -960
- package/cdn/chunks/chunk.NH3ZLAPS.js +0 -231
- package/cdn/chunks/chunk.NUC5GXPS.js +0 -19
- package/cdn/chunks/chunk.OG6IYX2E.js +0 -19
- package/cdn/chunks/chunk.OIV26ZOU.js +0 -29
- package/cdn/chunks/chunk.OPSENKP7.js +0 -19
- package/cdn/chunks/chunk.P4PYSONI.js +0 -1985
- package/cdn/chunks/chunk.PEKPD5D3.js +0 -32
- package/cdn/chunks/chunk.PWQDSQNT.js +0 -19
- package/cdn/chunks/chunk.PY5A6OKW.js +0 -19
- package/cdn/chunks/chunk.PZUVUD4C.js +0 -93
- package/cdn/chunks/chunk.Q4G4DZR4.js +0 -19
- package/cdn/chunks/chunk.QFAAK4H5.js +0 -99
- package/cdn/chunks/chunk.QFSWSE4T.js +0 -19
- package/cdn/chunks/chunk.QJWILSBB.js +0 -151
- package/cdn/chunks/chunk.QK2OQSMV.js +0 -19
- package/cdn/chunks/chunk.QKGQHWKR.js +0 -19
- package/cdn/chunks/chunk.QRED6RVA.js +0 -36
- package/cdn/chunks/chunk.R3WIGF3Z.js +0 -19
- package/cdn/chunks/chunk.REHR3VNE.js +0 -294
- package/cdn/chunks/chunk.RFGMNAAI.js +0 -162
- package/cdn/chunks/chunk.RIJPJNZ6.js +0 -56075
- package/cdn/chunks/chunk.RK6XTGKB.js +0 -19
- package/cdn/chunks/chunk.RKS4PEGG.js +0 -330
- package/cdn/chunks/chunk.S2TTSFDO.js +0 -37
- package/cdn/chunks/chunk.S5TMENAM.js +0 -35
- package/cdn/chunks/chunk.S7OZNH7N.js +0 -32
- package/cdn/chunks/chunk.SAIKW6IW.js +0 -19
- package/cdn/chunks/chunk.SBNF6Y4Z.js +0 -29
- package/cdn/chunks/chunk.SDT6TA7E.js +0 -34
- package/cdn/chunks/chunk.SHOBERVA.js +0 -32
- package/cdn/chunks/chunk.SIRMVNCG.js +0 -19
- package/cdn/chunks/chunk.SK73V355.js +0 -19
- package/cdn/chunks/chunk.SKBS4BJN.js +0 -24561
- package/cdn/chunks/chunk.SMALOHVS.js +0 -62
- package/cdn/chunks/chunk.SNTBUIUJ.js +0 -123
- package/cdn/chunks/chunk.SRYFSYXO.js +0 -904
- package/cdn/chunks/chunk.T2KZVS3W.js +0 -30
- package/cdn/chunks/chunk.T5RIWEQN.js +0 -32
- package/cdn/chunks/chunk.T62K7VOF.js +0 -1975
- package/cdn/chunks/chunk.TKRK5GQM.js +0 -29
- package/cdn/chunks/chunk.UD7NUYVG.js +0 -230
- package/cdn/chunks/chunk.UHPZT3U2.js +0 -29
- package/cdn/chunks/chunk.UYMPHDCE.js +0 -19
- package/cdn/chunks/chunk.V4YWPWXP.js +0 -36
- package/cdn/chunks/chunk.VBV3P6FL.js +0 -32
- package/cdn/chunks/chunk.VCPSDOI3.js +0 -19
- package/cdn/chunks/chunk.VGER7XWX.js +0 -19
- package/cdn/chunks/chunk.VLGM5YMT.js +0 -19
- package/cdn/chunks/chunk.VOW3VHP6.js +0 -110
- package/cdn/chunks/chunk.VYG3TDBE.js +0 -19
- package/cdn/chunks/chunk.VZZ5VWGT.js +0 -515
- package/cdn/chunks/chunk.W56KFXW3.js +0 -672
- package/cdn/chunks/chunk.WA4IWAQ5.js +0 -33
- package/cdn/chunks/chunk.WB4JIUNC.js +0 -29
- package/cdn/chunks/chunk.WBHKNBF4.js +0 -32
- package/cdn/chunks/chunk.WCJK4L7Z.js +0 -32
- package/cdn/chunks/chunk.WD7YIW7Q.js +0 -2710
- package/cdn/chunks/chunk.WLRHKMUU.js +0 -60
- package/cdn/chunks/chunk.WUXBI4OZ.js +0 -599
- package/cdn/chunks/chunk.WX3SD6KP.js +0 -543
- package/cdn/chunks/chunk.XF2FF246.js +0 -32
- package/cdn/chunks/chunk.XFQU5XOV.js +0 -29
- package/cdn/chunks/chunk.XGA76C4I.js +0 -310
- package/cdn/chunks/chunk.XKAWY3BU.js +0 -234
- package/cdn/chunks/chunk.XKYERLQI.js +0 -33
- package/cdn/chunks/chunk.XL2T3IOP.js +0 -19
- package/cdn/chunks/chunk.XNNFL6PT.js +0 -19
- package/cdn/chunks/chunk.XTIYI334.js +0 -524
- package/cdn/chunks/chunk.XXTI4EE7.js +0 -33
- package/cdn/chunks/chunk.Y6MVRFP6.js +0 -32
- package/cdn/chunks/chunk.YAQ7GYGE.js +0 -93
- package/cdn/chunks/chunk.YBMVWJN7.js +0 -35
- package/cdn/chunks/chunk.YIIC2VXV.js +0 -41
- package/cdn/chunks/chunk.YNW5MF6A.js +0 -32
- package/cdn/chunks/chunk.YR5IOGLT.js +0 -29
- package/cdn/chunks/chunk.YRXLTYVI.js +0 -82
- package/cdn/chunks/chunk.YT7YOMZX.js +0 -19
- package/cdn/chunks/chunk.YTS7DDAE.js +0 -19
- package/cdn/chunks/chunk.YYWIHJ7W.js +0 -35
- package/cdn/chunks/chunk.Z2RL47XD.js +0 -259
- package/cdn/chunks/chunk.ZFXH3XDM.js +0 -19
- package/cdn/chunks/chunk.ZG5ZKC6Y.js +0 -81
- package/cdn/chunks/chunk.ZHGWWFQE.js +0 -29
- package/cdn/chunks/chunk.ZM7I2NKC.js +0 -19
- package/cdn/chunks/chunk.ZMLAZTTI.js +0 -29
- package/cdn/chunks/chunk.ZRDBS5F2.js +0 -19
- package/cdn/chunks/chunk.ZRNQPABU.js +0 -276
- package/cdn/chunks/chunk.ZSRLKX2N.js +0 -19
- package/cdn/chunks/chunk.ZWCPWVFO.js +0 -19
- package/cdn/chunks/lerc.4U2WA6NV.js +0 -2097
- package/dist/chunks/chunk.2BE47NJG.js +0 -1
- package/dist/chunks/chunk.2BVYE6EK.js +0 -65
- package/dist/chunks/chunk.2MOIXIOP.js +0 -1
- package/dist/chunks/chunk.2WPBJQIO.js +0 -1
- package/dist/chunks/chunk.2ZTMYRXN.js +0 -148
- package/dist/chunks/chunk.32OPJVEF.js +0 -176
- package/dist/chunks/chunk.34X7FELX.js +0 -1
- package/dist/chunks/chunk.3F22UDEH.js +0 -1
- package/dist/chunks/chunk.3IQUPDW3.js +0 -11
- package/dist/chunks/chunk.3KSPRQMI.js +0 -121
- package/dist/chunks/chunk.3V3CFSEN.js +0 -113
- package/dist/chunks/chunk.4333NETV.js +0 -1
- package/dist/chunks/chunk.4OH3XCDR.js +0 -1190
- package/dist/chunks/chunk.4XE7LAQK.js +0 -1
- package/dist/chunks/chunk.56XPDUQ4.js +0 -1
- package/dist/chunks/chunk.5HHCBSFB.js +0 -1
- package/dist/chunks/chunk.5HHGFBX2.js +0 -1
- package/dist/chunks/chunk.5IVGPQIR.js +0 -1
- package/dist/chunks/chunk.5MTTMHHO.js +0 -39
- package/dist/chunks/chunk.5RHVUOFK.js +0 -41
- package/dist/chunks/chunk.5UEDTOD2.js +0 -1
- package/dist/chunks/chunk.6CQWKIOY.js +0 -1
- package/dist/chunks/chunk.6JDRZLOM.js +0 -17
- package/dist/chunks/chunk.6LI23A6A.js +0 -1
- package/dist/chunks/chunk.6LKD4GN7.js +0 -1
- package/dist/chunks/chunk.6QRXPELF.js +0 -30
- package/dist/chunks/chunk.77Q72G7O.js +0 -1
- package/dist/chunks/chunk.7BF3EHDA.js +0 -1
- package/dist/chunks/chunk.7DNAQWHB.js +0 -1
- package/dist/chunks/chunk.7FXJ5AVW.js +0 -1
- package/dist/chunks/chunk.7PMPECD5.js +0 -9
- package/dist/chunks/chunk.7U7KBTDG.js +0 -1
- package/dist/chunks/chunk.7Z7Z3PL3.js +0 -1
- package/dist/chunks/chunk.A2OV7HOM.js +0 -33
- package/dist/chunks/chunk.A3JRF4BH.js +0 -55
- package/dist/chunks/chunk.A5TQR6LX.js +0 -1
- package/dist/chunks/chunk.AEDP2SPE.js +0 -1
- package/dist/chunks/chunk.AGJGHA2P.js +0 -1
- package/dist/chunks/chunk.B2XZLBDQ.js +0 -1
- package/dist/chunks/chunk.B6BNGOZB.js +0 -1
- package/dist/chunks/chunk.BGKV5FYM.js +0 -55
- package/dist/chunks/chunk.BM75XYNW.js +0 -25
- package/dist/chunks/chunk.BMO4MMSG.js +0 -1
- package/dist/chunks/chunk.BRJCUVRW.js +0 -1
- package/dist/chunks/chunk.BRS3VXJA.js +0 -157
- package/dist/chunks/chunk.BSTHMPZU.js +0 -55
- package/dist/chunks/chunk.C5WYVFSA.js +0 -1
- package/dist/chunks/chunk.CADMINOX.js +0 -1
- package/dist/chunks/chunk.CGWQDVJN.js +0 -100
- package/dist/chunks/chunk.CUOWQB5V.js +0 -1
- package/dist/chunks/chunk.D3OS6IHO.js +0 -1
- package/dist/chunks/chunk.D7YD545N.js +0 -1
- package/dist/chunks/chunk.DBLQWRGX.js +0 -1
- package/dist/chunks/chunk.DJC4XPKT.js +0 -1
- package/dist/chunks/chunk.DLSNNLZT.js +0 -1
- package/dist/chunks/chunk.DRZXFC52.js +0 -1
- package/dist/chunks/chunk.DTNZUN66.js +0 -75
- package/dist/chunks/chunk.DV3HUYSH.js +0 -780
- package/dist/chunks/chunk.EAQPP2XQ.js +0 -1
- package/dist/chunks/chunk.EC43AUTZ.js +0 -1
- package/dist/chunks/chunk.EDSHE3IR.js +0 -43
- package/dist/chunks/chunk.EFJYUIN7.js +0 -9
- package/dist/chunks/chunk.ELAAFINX.js +0 -1
- package/dist/chunks/chunk.ELWTTGZP.js +0 -1
- package/dist/chunks/chunk.EOD4B3IX.js +0 -11
- package/dist/chunks/chunk.EVSHCE6H.js +0 -1
- package/dist/chunks/chunk.F2BK7U4N.js +0 -1
- package/dist/chunks/chunk.F4YPYLUT.js +0 -1
- package/dist/chunks/chunk.F56RXY3E.js +0 -24
- package/dist/chunks/chunk.FI3GSDLD.js +0 -1
- package/dist/chunks/chunk.FIRCFHOE.js +0 -1
- package/dist/chunks/chunk.FOFC6VTJ.js +0 -1
- package/dist/chunks/chunk.FR7BDEKN.js +0 -1
- package/dist/chunks/chunk.G35JQ2ZG.js +0 -35
- package/dist/chunks/chunk.G3TJUALR.js +0 -1
- package/dist/chunks/chunk.GNZLJUDW.js +0 -1
- package/dist/chunks/chunk.GQPIZDWW.js +0 -1
- package/dist/chunks/chunk.GTGYWE5F.js +0 -1
- package/dist/chunks/chunk.GXMHPA2J.js +0 -572
- package/dist/chunks/chunk.H3MW6SIJ.js +0 -1
- package/dist/chunks/chunk.H4ERXNRV.js +0 -1
- package/dist/chunks/chunk.H7VRVKXW.js +0 -145
- package/dist/chunks/chunk.HL5XIPFI.js +0 -1
- package/dist/chunks/chunk.HU7RII6Z.js +0 -1
- package/dist/chunks/chunk.I7EQNJXM.js +0 -14
- package/dist/chunks/chunk.IADRENNE.js +0 -1
- package/dist/chunks/chunk.IEJAC4O6.js +0 -300
- package/dist/chunks/chunk.IHS6LJWC.js +0 -1
- package/dist/chunks/chunk.IM2SCKZT.js +0 -1
- package/dist/chunks/chunk.ISCZLMLV.js +0 -1
- package/dist/chunks/chunk.J2SVUWUB.js +0 -1
- package/dist/chunks/chunk.J7U7DEKR.js +0 -38
- package/dist/chunks/chunk.JLDZFVA7.js +0 -1
- package/dist/chunks/chunk.JNGVL46L.js +0 -1
- package/dist/chunks/chunk.JTPCGE2I.js +0 -1
- package/dist/chunks/chunk.JXY5E3AD.js +0 -1
- package/dist/chunks/chunk.JZ2UTIMK.js +0 -1
- package/dist/chunks/chunk.K44QIVOS.js +0 -1
- package/dist/chunks/chunk.K7SV4V3V.js +0 -1
- package/dist/chunks/chunk.KARB77CR.js +0 -1
- package/dist/chunks/chunk.KIXX2VNW.js +0 -1
- package/dist/chunks/chunk.KTGFGJ6W.js +0 -127
- package/dist/chunks/chunk.KVQQYHK5.js +0 -20
- package/dist/chunks/chunk.KVUEPY2V.js +0 -1
- package/dist/chunks/chunk.KW3AJIGO.js +0 -1
- package/dist/chunks/chunk.LYVAQ5X2.js +0 -16
- package/dist/chunks/chunk.MAPRGE2B.js +0 -1
- package/dist/chunks/chunk.MEIAXAOT.js +0 -99
- package/dist/chunks/chunk.MEYXYGYW.js +0 -1
- package/dist/chunks/chunk.MJFLOS25.js +0 -1
- package/dist/chunks/chunk.MSAGS4ZW.js +0 -1
- package/dist/chunks/chunk.MT7KXK33.js +0 -8
- package/dist/chunks/chunk.MWZZDUQK.js +0 -1
- package/dist/chunks/chunk.NAPQRTMB.js +0 -1
- package/dist/chunks/chunk.NDF272DG.js +0 -64
- package/dist/chunks/chunk.NFPZBWVO.js +0 -1
- package/dist/chunks/chunk.NLMFSOK6.js +0 -37
- package/dist/chunks/chunk.NX3H7USL.js +0 -61
- package/dist/chunks/chunk.NYXYKBL4.js +0 -1
- package/dist/chunks/chunk.OA6TRXCL.js +0 -1
- package/dist/chunks/chunk.OAGDC5NY.js +0 -1
- package/dist/chunks/chunk.OB3I6CC2.js +0 -12
- package/dist/chunks/chunk.OGD4IZSR.js +0 -1
- package/dist/chunks/chunk.ON4XJHQC.js +0 -1
- package/dist/chunks/chunk.P2RISYZB.js +0 -1
- package/dist/chunks/chunk.P3BESYTX.js +0 -1
- package/dist/chunks/chunk.P5LLMXGD.js +0 -20
- package/dist/chunks/chunk.P6ZQBWYA.js +0 -498
- package/dist/chunks/chunk.PA2K76YR.js +0 -1
- package/dist/chunks/chunk.PM3TNHYU.js +0 -74
- package/dist/chunks/chunk.PO4J6EYL.js +0 -26
- package/dist/chunks/chunk.Q26WIGAX.js +0 -280
- package/dist/chunks/chunk.Q2MCOBRZ.js +0 -154
- package/dist/chunks/chunk.Q74JYYTU.js +0 -1
- package/dist/chunks/chunk.QBCCNPMY.js +0 -1
- package/dist/chunks/chunk.QBZRFS4J.js +0 -1
- package/dist/chunks/chunk.QOAJB4YT.js +0 -1
- package/dist/chunks/chunk.QSBUN22W.js +0 -1
- package/dist/chunks/chunk.QZ6YSHJK.js +0 -1
- package/dist/chunks/chunk.QZYXWLHN.js +0 -1
- package/dist/chunks/chunk.R5XG4VQB.js +0 -1
- package/dist/chunks/chunk.RAUAQANS.js +0 -43
- package/dist/chunks/chunk.REZJHB4P.js +0 -35
- package/dist/chunks/chunk.RITL4YAW.js +0 -1
- package/dist/chunks/chunk.RKMQB6WR.js +0 -1
- package/dist/chunks/chunk.RLEYBODQ.js +0 -1
- package/dist/chunks/chunk.RN2ARMZ5.js +0 -1
- package/dist/chunks/chunk.RQF6T73H.js +0 -1
- package/dist/chunks/chunk.RT7UII6X.js +0 -4
- package/dist/chunks/chunk.RU6XCWFZ.js +0 -1
- package/dist/chunks/chunk.SD6CXJRC.js +0 -2
- package/dist/chunks/chunk.SGZCX3AX.js +0 -30
- package/dist/chunks/chunk.SQ4F44ZY.js +0 -1
- package/dist/chunks/chunk.TR3HYY66.js +0 -1
- package/dist/chunks/chunk.U33TD5TB.js +0 -6
- package/dist/chunks/chunk.U37CFR4C.js +0 -1
- package/dist/chunks/chunk.U3N7OSDS.js +0 -1
- package/dist/chunks/chunk.U4HA7KFD.js +0 -5
- package/dist/chunks/chunk.U6JO5USY.js +0 -1
- package/dist/chunks/chunk.UDJWUU6K.js +0 -19
- package/dist/chunks/chunk.UECG6VCN.js +0 -1
- package/dist/chunks/chunk.UGBCGXEC.js +0 -22
- package/dist/chunks/chunk.UGPAZZ76.js +0 -1
- package/dist/chunks/chunk.UHZBOAYJ.js +0 -1
- package/dist/chunks/chunk.USGULNOF.js +0 -1
- package/dist/chunks/chunk.USKDRLRA.js +0 -1
- package/dist/chunks/chunk.VGKJBILS.js +0 -23
- package/dist/chunks/chunk.VIZRNKN5.js +0 -8
- package/dist/chunks/chunk.VTXWVS5C.js +0 -1
- package/dist/chunks/chunk.VWHPRXTT.js +0 -1
- package/dist/chunks/chunk.W54WCDFS.js +0 -1
- package/dist/chunks/chunk.W6SAQQLD.js +0 -1
- package/dist/chunks/chunk.W7DE3ZXX.js +0 -1
- package/dist/chunks/chunk.W7L7HUEJ.js +0 -122
- package/dist/chunks/chunk.WCISQBWK.js +0 -1
- package/dist/chunks/chunk.WDAW64SW.js +0 -27
- package/dist/chunks/chunk.WDSYLS6Y.js +0 -1
- package/dist/chunks/chunk.WJM2AWLV.js +0 -67
- package/dist/chunks/chunk.XLXVZWI2.js +0 -26
- package/dist/chunks/chunk.XMNTSLBZ.js +0 -1
- package/dist/chunks/chunk.XOFUYZ46.js +0 -1
- package/dist/chunks/chunk.XPMJPPF5.js +0 -1
- package/dist/chunks/chunk.XYS4GJZH.js +0 -299
- package/dist/chunks/chunk.XZBSVTBX.js +0 -1
- package/dist/chunks/chunk.Y25FQCMA.js +0 -1
- package/dist/chunks/chunk.Y4QTK5OI.js +0 -1
- package/dist/chunks/chunk.Y6F5QAB2.js +0 -1
- package/dist/chunks/chunk.Y6VOJNJH.js +0 -441
- package/dist/chunks/chunk.YBKVUXXU.js +0 -1
- package/dist/chunks/chunk.YIZ2RQOX.js +0 -1
- package/dist/chunks/chunk.YKWMWZMS.js +0 -1
- package/dist/chunks/chunk.YPU4IAHG.js +0 -1
- package/dist/chunks/chunk.YSQWMROO.js +0 -5
- package/dist/chunks/chunk.YTWF4W66.js +0 -80
- package/dist/chunks/chunk.YVVKOSUI.js +0 -62
- package/dist/chunks/chunk.ZBC4UK6H.js +0 -48
- package/dist/chunks/chunk.ZKDGF3PX.js +0 -1
- package/dist/chunks/chunk.ZLQVNAHB.js +0 -1
- package/dist/chunks/chunk.ZVOF2K46.js +0 -1
- package/dist/chunks/chunk.ZWNXLTTK.js +0 -47
- package/dist/chunks/chunk.ZXUW3LTE.js +0 -1
- package/dist/chunks/chunk.ZZBQVUDD.js +0 -1
- package/dist/terra_ui_components-0.0.197-py3-none-any.whl +0 -0
- package/dist/terra_ui_components-0.0.197.tar.gz +0 -0
|
@@ -0,0 +1,4735 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TimeAvgMapController
|
|
3
|
+
} from "./chunk.TAGA7EGX.js";
|
|
4
|
+
import {
|
|
5
|
+
time_average_map_styles_default
|
|
6
|
+
} from "./chunk.FQ7GYAM6.js";
|
|
7
|
+
import {
|
|
8
|
+
getFetchVariableTask
|
|
9
|
+
} from "./chunk.JNTHZSBA.js";
|
|
10
|
+
import {
|
|
11
|
+
getVariableEntryId
|
|
12
|
+
} from "./chunk.QS6LI65N.js";
|
|
13
|
+
import {
|
|
14
|
+
TerraPlotToolbar
|
|
15
|
+
} from "./chunk.RK7LHY6Q.js";
|
|
16
|
+
import {
|
|
17
|
+
TerraPlot
|
|
18
|
+
} from "./chunk.FSGSFI2L.js";
|
|
19
|
+
import {
|
|
20
|
+
extractHarmonyError,
|
|
21
|
+
formatHarmonyErrorMessage
|
|
22
|
+
} from "./chunk.USKVG5GU.js";
|
|
23
|
+
import {
|
|
24
|
+
AuthController
|
|
25
|
+
} from "./chunk.4JXPGYJW.js";
|
|
26
|
+
import {
|
|
27
|
+
s
|
|
28
|
+
} from "./chunk.BQDEKCXK.js";
|
|
29
|
+
import {
|
|
30
|
+
TerraMap
|
|
31
|
+
} from "./chunk.66IWKBC6.js";
|
|
32
|
+
import {
|
|
33
|
+
Draw_default
|
|
34
|
+
} from "./chunk.PF6HHPHM.js";
|
|
35
|
+
import {
|
|
36
|
+
create as create2,
|
|
37
|
+
fromTransform
|
|
38
|
+
} from "./chunk.FI4YBHHD.js";
|
|
39
|
+
import {
|
|
40
|
+
BooleanType,
|
|
41
|
+
CallExpression,
|
|
42
|
+
ColorType,
|
|
43
|
+
Feature_default,
|
|
44
|
+
NumberArrayType,
|
|
45
|
+
NumberType,
|
|
46
|
+
Ops,
|
|
47
|
+
SizeType,
|
|
48
|
+
StringType,
|
|
49
|
+
Vector_default,
|
|
50
|
+
Vector_default2,
|
|
51
|
+
isType,
|
|
52
|
+
newParsingContext,
|
|
53
|
+
parse,
|
|
54
|
+
typeName
|
|
55
|
+
} from "./chunk.M6QQY2ST.js";
|
|
56
|
+
import {
|
|
57
|
+
BaseTile_default,
|
|
58
|
+
ImageTile_default,
|
|
59
|
+
LRUCache_default,
|
|
60
|
+
Tile_default
|
|
61
|
+
} from "./chunk.IYBWOV2C.js";
|
|
62
|
+
import {
|
|
63
|
+
DataTile_default,
|
|
64
|
+
TileRange_default,
|
|
65
|
+
TileState_default,
|
|
66
|
+
asArrayLike,
|
|
67
|
+
asImageLike,
|
|
68
|
+
createOrUpdate,
|
|
69
|
+
getKey
|
|
70
|
+
} from "./chunk.UUUD46S3.js";
|
|
71
|
+
import {
|
|
72
|
+
EventType_default as EventType_default2,
|
|
73
|
+
Event_default,
|
|
74
|
+
Layer_default,
|
|
75
|
+
Point_default,
|
|
76
|
+
Property_default,
|
|
77
|
+
asArray
|
|
78
|
+
} from "./chunk.IK2SGPIW.js";
|
|
79
|
+
import {
|
|
80
|
+
Disposable_default,
|
|
81
|
+
EventType_default,
|
|
82
|
+
SAFARI_BUG_237906,
|
|
83
|
+
Target_default,
|
|
84
|
+
abstract,
|
|
85
|
+
apply,
|
|
86
|
+
assert,
|
|
87
|
+
boundingExtent,
|
|
88
|
+
clear,
|
|
89
|
+
compose,
|
|
90
|
+
containsCoordinate,
|
|
91
|
+
create,
|
|
92
|
+
createCanvasContext2D,
|
|
93
|
+
descending,
|
|
94
|
+
fromUserExtent,
|
|
95
|
+
getIntersection,
|
|
96
|
+
getLength,
|
|
97
|
+
getRotatedViewport,
|
|
98
|
+
getUid,
|
|
99
|
+
isEmpty2 as isEmpty,
|
|
100
|
+
reset,
|
|
101
|
+
rotate2 as rotate,
|
|
102
|
+
scale2 as scale,
|
|
103
|
+
toLonLat,
|
|
104
|
+
toSize,
|
|
105
|
+
translate
|
|
106
|
+
} from "./chunk.RCPXD7AS.js";
|
|
107
|
+
import {
|
|
108
|
+
h
|
|
109
|
+
} from "./chunk.ASJLND3B.js";
|
|
110
|
+
import {
|
|
111
|
+
QueryClientMixin
|
|
112
|
+
} from "./chunk.DOUWGQFH.js";
|
|
113
|
+
import {
|
|
114
|
+
TerraLoader
|
|
115
|
+
} from "./chunk.S5FXMDJD.js";
|
|
116
|
+
import {
|
|
117
|
+
formatDate
|
|
118
|
+
} from "./chunk.X2BIJLHO.js";
|
|
119
|
+
import {
|
|
120
|
+
TerraButton
|
|
121
|
+
} from "./chunk.FIREC5CC.js";
|
|
122
|
+
import {
|
|
123
|
+
TerraIcon
|
|
124
|
+
} from "./chunk.KHDL2CAQ.js";
|
|
125
|
+
import {
|
|
126
|
+
TerraAlert
|
|
127
|
+
} from "./chunk.ZCVWVO2H.js";
|
|
128
|
+
import {
|
|
129
|
+
watch
|
|
130
|
+
} from "./chunk.MPVZOQYA.js";
|
|
131
|
+
import {
|
|
132
|
+
TerraElement,
|
|
133
|
+
component_styles_default,
|
|
134
|
+
e,
|
|
135
|
+
n,
|
|
136
|
+
r,
|
|
137
|
+
undefinedStringConverter
|
|
138
|
+
} from "./chunk.TG3YYWRJ.js";
|
|
139
|
+
import {
|
|
140
|
+
A,
|
|
141
|
+
b
|
|
142
|
+
} from "./chunk.RRCYT4LP.js";
|
|
143
|
+
import {
|
|
144
|
+
__decorateClass,
|
|
145
|
+
__privateAdd,
|
|
146
|
+
__privateGet,
|
|
147
|
+
__privateMethod,
|
|
148
|
+
__privateSet,
|
|
149
|
+
__spreadProps,
|
|
150
|
+
__spreadValues,
|
|
151
|
+
init_buffer,
|
|
152
|
+
init_dirname,
|
|
153
|
+
init_process
|
|
154
|
+
} from "./chunk.ZEOVK2FE.js";
|
|
155
|
+
|
|
156
|
+
// src/components/time-average-map/time-average-map.component.ts
|
|
157
|
+
init_dirname();
|
|
158
|
+
init_buffer();
|
|
159
|
+
init_process();
|
|
160
|
+
|
|
161
|
+
// node_modules/ol/layer/WebGLTile.js
|
|
162
|
+
init_dirname();
|
|
163
|
+
init_buffer();
|
|
164
|
+
init_process();
|
|
165
|
+
|
|
166
|
+
// node_modules/ol/expr/gpu.js
|
|
167
|
+
init_dirname();
|
|
168
|
+
init_buffer();
|
|
169
|
+
init_process();
|
|
170
|
+
|
|
171
|
+
// node_modules/ol/renderer/webgl/TileLayer.js
|
|
172
|
+
init_dirname();
|
|
173
|
+
init_buffer();
|
|
174
|
+
init_process();
|
|
175
|
+
|
|
176
|
+
// node_modules/ol/webgl/Buffer.js
|
|
177
|
+
init_dirname();
|
|
178
|
+
init_buffer();
|
|
179
|
+
init_process();
|
|
180
|
+
|
|
181
|
+
// node_modules/ol/webgl.js
|
|
182
|
+
init_dirname();
|
|
183
|
+
init_buffer();
|
|
184
|
+
init_process();
|
|
185
|
+
var ARRAY_BUFFER = 34962;
|
|
186
|
+
var ELEMENT_ARRAY_BUFFER = 34963;
|
|
187
|
+
var STREAM_DRAW = 35040;
|
|
188
|
+
var STATIC_DRAW = 35044;
|
|
189
|
+
var DYNAMIC_DRAW = 35048;
|
|
190
|
+
var UNSIGNED_BYTE = 5121;
|
|
191
|
+
var UNSIGNED_SHORT = 5123;
|
|
192
|
+
var UNSIGNED_INT = 5125;
|
|
193
|
+
var FLOAT = 5126;
|
|
194
|
+
var CONTEXT_IDS = ["experimental-webgl", "webgl", "webkit-3d", "moz-webgl"];
|
|
195
|
+
function getContext(canvas, attributes) {
|
|
196
|
+
attributes = Object.assign(
|
|
197
|
+
{
|
|
198
|
+
preserveDrawingBuffer: true,
|
|
199
|
+
antialias: SAFARI_BUG_237906 ? false : true
|
|
200
|
+
// https://bugs.webkit.org/show_bug.cgi?id=237906
|
|
201
|
+
},
|
|
202
|
+
attributes
|
|
203
|
+
);
|
|
204
|
+
const ii = CONTEXT_IDS.length;
|
|
205
|
+
for (let i = 0; i < ii; ++i) {
|
|
206
|
+
try {
|
|
207
|
+
const context = canvas.getContext(CONTEXT_IDS[i], attributes);
|
|
208
|
+
if (context) {
|
|
209
|
+
return (
|
|
210
|
+
/** @type {!WebGLRenderingContext} */
|
|
211
|
+
context
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
} catch (e2) {
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// node_modules/ol/webgl/Buffer.js
|
|
221
|
+
var BufferUsage = {
|
|
222
|
+
STATIC_DRAW,
|
|
223
|
+
STREAM_DRAW,
|
|
224
|
+
DYNAMIC_DRAW
|
|
225
|
+
};
|
|
226
|
+
var WebGLArrayBuffer = class {
|
|
227
|
+
/**
|
|
228
|
+
* @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
|
|
229
|
+
* @param {number} [usage] Intended usage, either `STATIC_DRAW`, `STREAM_DRAW` or `DYNAMIC_DRAW`.
|
|
230
|
+
* Default is `STATIC_DRAW`.
|
|
231
|
+
*/
|
|
232
|
+
constructor(type, usage) {
|
|
233
|
+
this.array_ = null;
|
|
234
|
+
this.type_ = type;
|
|
235
|
+
assert(
|
|
236
|
+
type === ARRAY_BUFFER || type === ELEMENT_ARRAY_BUFFER,
|
|
237
|
+
"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"
|
|
238
|
+
);
|
|
239
|
+
this.usage_ = usage !== void 0 ? usage : BufferUsage.STATIC_DRAW;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Populates the buffer with an array of the given size (all values will be zeroes).
|
|
243
|
+
* @param {number} size Array size
|
|
244
|
+
* @return {WebGLArrayBuffer} This
|
|
245
|
+
*/
|
|
246
|
+
ofSize(size) {
|
|
247
|
+
this.array_ = new (getArrayClassForType(this.type_))(size);
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Populates the buffer with an array of the given size.
|
|
252
|
+
* @param {Array<number>} array Numerical array
|
|
253
|
+
* @return {WebGLArrayBuffer} This
|
|
254
|
+
*/
|
|
255
|
+
fromArray(array) {
|
|
256
|
+
this.array_ = getArrayClassForType(this.type_).from(array);
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Populates the buffer with a raw binary array buffer.
|
|
261
|
+
* @param {ArrayBuffer} buffer Raw binary buffer to populate the array with. Note that this buffer must have been
|
|
262
|
+
* initialized for the same typed array class.
|
|
263
|
+
* @return {WebGLArrayBuffer} This
|
|
264
|
+
*/
|
|
265
|
+
fromArrayBuffer(buffer) {
|
|
266
|
+
this.array_ = new (getArrayClassForType(this.type_))(buffer);
|
|
267
|
+
return this;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @return {number} Buffer type.
|
|
271
|
+
*/
|
|
272
|
+
getType() {
|
|
273
|
+
return this.type_;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Will return null if the buffer was not initialized
|
|
277
|
+
* @return {Float32Array|Uint32Array|null} Array.
|
|
278
|
+
*/
|
|
279
|
+
getArray() {
|
|
280
|
+
return this.array_;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* @param {Float32Array|Uint32Array} array Array.
|
|
284
|
+
*/
|
|
285
|
+
setArray(array) {
|
|
286
|
+
const ArrayType = getArrayClassForType(this.type_);
|
|
287
|
+
if (!(array instanceof ArrayType)) {
|
|
288
|
+
throw new Error(`Expected ${ArrayType}`);
|
|
289
|
+
}
|
|
290
|
+
this.array_ = array;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* @return {number} Usage.
|
|
294
|
+
*/
|
|
295
|
+
getUsage() {
|
|
296
|
+
return this.usage_;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Will return 0 if the buffer is not initialized
|
|
300
|
+
* @return {number} Array size
|
|
301
|
+
*/
|
|
302
|
+
getSize() {
|
|
303
|
+
return this.array_ ? this.array_.length : 0;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
function getArrayClassForType(type) {
|
|
307
|
+
switch (type) {
|
|
308
|
+
case ARRAY_BUFFER:
|
|
309
|
+
return Float32Array;
|
|
310
|
+
case ELEMENT_ARRAY_BUFFER:
|
|
311
|
+
return Uint32Array;
|
|
312
|
+
default:
|
|
313
|
+
return Float32Array;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
var Buffer_default = WebGLArrayBuffer;
|
|
317
|
+
|
|
318
|
+
// node_modules/ol/webgl/Helper.js
|
|
319
|
+
init_dirname();
|
|
320
|
+
init_buffer();
|
|
321
|
+
init_process();
|
|
322
|
+
|
|
323
|
+
// node_modules/ol/webgl/ContextEventType.js
|
|
324
|
+
init_dirname();
|
|
325
|
+
init_buffer();
|
|
326
|
+
init_process();
|
|
327
|
+
var ContextEventType_default = {
|
|
328
|
+
LOST: "webglcontextlost",
|
|
329
|
+
RESTORED: "webglcontextrestored"
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// node_modules/ol/webgl/PostProcessingPass.js
|
|
333
|
+
init_dirname();
|
|
334
|
+
init_buffer();
|
|
335
|
+
init_process();
|
|
336
|
+
var DEFAULT_VERTEX_SHADER = `
|
|
337
|
+
precision mediump float;
|
|
338
|
+
|
|
339
|
+
attribute vec2 a_position;
|
|
340
|
+
varying vec2 v_texCoord;
|
|
341
|
+
varying vec2 v_screenCoord;
|
|
342
|
+
|
|
343
|
+
uniform vec2 u_screenSize;
|
|
344
|
+
|
|
345
|
+
void main() {
|
|
346
|
+
v_texCoord = a_position * 0.5 + 0.5;
|
|
347
|
+
v_screenCoord = v_texCoord * u_screenSize;
|
|
348
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
349
|
+
}
|
|
350
|
+
`;
|
|
351
|
+
var DEFAULT_FRAGMENT_SHADER = `
|
|
352
|
+
precision mediump float;
|
|
353
|
+
|
|
354
|
+
uniform sampler2D u_image;
|
|
355
|
+
uniform float u_opacity;
|
|
356
|
+
|
|
357
|
+
varying vec2 v_texCoord;
|
|
358
|
+
|
|
359
|
+
void main() {
|
|
360
|
+
gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
|
|
361
|
+
}
|
|
362
|
+
`;
|
|
363
|
+
var WebGLPostProcessingPass = class {
|
|
364
|
+
/**
|
|
365
|
+
* @param {Options} options Options.
|
|
366
|
+
*/
|
|
367
|
+
constructor(options) {
|
|
368
|
+
this.gl_ = options.webGlContext;
|
|
369
|
+
const gl = this.gl_;
|
|
370
|
+
this.scaleRatio_ = options.scaleRatio || 1;
|
|
371
|
+
this.renderTargetTexture_ = gl.createTexture();
|
|
372
|
+
this.renderTargetTextureSize_ = null;
|
|
373
|
+
this.frameBuffer_ = gl.createFramebuffer();
|
|
374
|
+
this.depthBuffer_ = gl.createRenderbuffer();
|
|
375
|
+
const vertexShader = gl.createShader(gl.VERTEX_SHADER);
|
|
376
|
+
gl.shaderSource(
|
|
377
|
+
vertexShader,
|
|
378
|
+
options.vertexShader || DEFAULT_VERTEX_SHADER
|
|
379
|
+
);
|
|
380
|
+
gl.compileShader(vertexShader);
|
|
381
|
+
const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
|
|
382
|
+
gl.shaderSource(
|
|
383
|
+
fragmentShader,
|
|
384
|
+
options.fragmentShader || DEFAULT_FRAGMENT_SHADER
|
|
385
|
+
);
|
|
386
|
+
gl.compileShader(fragmentShader);
|
|
387
|
+
this.renderTargetProgram_ = gl.createProgram();
|
|
388
|
+
gl.attachShader(this.renderTargetProgram_, vertexShader);
|
|
389
|
+
gl.attachShader(this.renderTargetProgram_, fragmentShader);
|
|
390
|
+
gl.linkProgram(this.renderTargetProgram_);
|
|
391
|
+
this.renderTargetVerticesBuffer_ = gl.createBuffer();
|
|
392
|
+
const verticesArray = [-1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1];
|
|
393
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);
|
|
394
|
+
gl.bufferData(
|
|
395
|
+
gl.ARRAY_BUFFER,
|
|
396
|
+
new Float32Array(verticesArray),
|
|
397
|
+
gl.STATIC_DRAW
|
|
398
|
+
);
|
|
399
|
+
this.renderTargetAttribLocation_ = gl.getAttribLocation(
|
|
400
|
+
this.renderTargetProgram_,
|
|
401
|
+
"a_position"
|
|
402
|
+
);
|
|
403
|
+
this.renderTargetUniformLocation_ = gl.getUniformLocation(
|
|
404
|
+
this.renderTargetProgram_,
|
|
405
|
+
"u_screenSize"
|
|
406
|
+
);
|
|
407
|
+
this.renderTargetOpacityLocation_ = gl.getUniformLocation(
|
|
408
|
+
this.renderTargetProgram_,
|
|
409
|
+
"u_opacity"
|
|
410
|
+
);
|
|
411
|
+
this.renderTargetTextureLocation_ = gl.getUniformLocation(
|
|
412
|
+
this.renderTargetProgram_,
|
|
413
|
+
"u_image"
|
|
414
|
+
);
|
|
415
|
+
this.uniforms_ = [];
|
|
416
|
+
options.uniforms && Object.keys(options.uniforms).forEach((name) => {
|
|
417
|
+
this.uniforms_.push({
|
|
418
|
+
value: options.uniforms[name],
|
|
419
|
+
location: gl.getUniformLocation(this.renderTargetProgram_, name)
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
getRenderTargetTexture() {
|
|
424
|
+
return this.renderTargetTexture_;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Get the WebGL rendering context
|
|
428
|
+
* @return {WebGLRenderingContext} The rendering context.
|
|
429
|
+
*/
|
|
430
|
+
getGL() {
|
|
431
|
+
return this.gl_;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Initialize the render target texture of the post process, make sure it is at the
|
|
435
|
+
* right size and bind it as a render target for the next draw calls.
|
|
436
|
+
* The last step to be initialized will be the one where the primitives are rendered.
|
|
437
|
+
* @param {import("../Map.js").FrameState} frameState current frame state
|
|
438
|
+
*/
|
|
439
|
+
init(frameState) {
|
|
440
|
+
const gl = this.getGL();
|
|
441
|
+
const textureSize = [
|
|
442
|
+
gl.drawingBufferWidth * this.scaleRatio_,
|
|
443
|
+
gl.drawingBufferHeight * this.scaleRatio_
|
|
444
|
+
];
|
|
445
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, this.getFrameBuffer());
|
|
446
|
+
gl.bindRenderbuffer(gl.RENDERBUFFER, this.getDepthBuffer());
|
|
447
|
+
gl.viewport(0, 0, textureSize[0], textureSize[1]);
|
|
448
|
+
if (!this.renderTargetTextureSize_ || this.renderTargetTextureSize_[0] !== textureSize[0] || this.renderTargetTextureSize_[1] !== textureSize[1]) {
|
|
449
|
+
this.renderTargetTextureSize_ = textureSize;
|
|
450
|
+
const level = 0;
|
|
451
|
+
const internalFormat = gl.RGBA;
|
|
452
|
+
const border = 0;
|
|
453
|
+
const format = gl.RGBA;
|
|
454
|
+
const type = gl.UNSIGNED_BYTE;
|
|
455
|
+
const data = null;
|
|
456
|
+
gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);
|
|
457
|
+
gl.texImage2D(
|
|
458
|
+
gl.TEXTURE_2D,
|
|
459
|
+
level,
|
|
460
|
+
internalFormat,
|
|
461
|
+
textureSize[0],
|
|
462
|
+
textureSize[1],
|
|
463
|
+
border,
|
|
464
|
+
format,
|
|
465
|
+
type,
|
|
466
|
+
data
|
|
467
|
+
);
|
|
468
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
469
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
470
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
471
|
+
gl.framebufferTexture2D(
|
|
472
|
+
gl.FRAMEBUFFER,
|
|
473
|
+
gl.COLOR_ATTACHMENT0,
|
|
474
|
+
gl.TEXTURE_2D,
|
|
475
|
+
this.renderTargetTexture_,
|
|
476
|
+
0
|
|
477
|
+
);
|
|
478
|
+
gl.renderbufferStorage(
|
|
479
|
+
gl.RENDERBUFFER,
|
|
480
|
+
gl.DEPTH_COMPONENT16,
|
|
481
|
+
textureSize[0],
|
|
482
|
+
textureSize[1]
|
|
483
|
+
);
|
|
484
|
+
gl.framebufferRenderbuffer(
|
|
485
|
+
gl.FRAMEBUFFER,
|
|
486
|
+
gl.DEPTH_ATTACHMENT,
|
|
487
|
+
gl.RENDERBUFFER,
|
|
488
|
+
this.depthBuffer_
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Render to the next postprocessing pass (or to the canvas if final pass).
|
|
494
|
+
* @param {import("../Map.js").FrameState} frameState current frame state
|
|
495
|
+
* @param {WebGLPostProcessingPass} [nextPass] Next pass, optional
|
|
496
|
+
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [preCompose] Called before composing.
|
|
497
|
+
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [postCompose] Called before composing.
|
|
498
|
+
*/
|
|
499
|
+
apply(frameState, nextPass, preCompose, postCompose) {
|
|
500
|
+
const gl = this.getGL();
|
|
501
|
+
const size = frameState.size;
|
|
502
|
+
gl.bindFramebuffer(
|
|
503
|
+
gl.FRAMEBUFFER,
|
|
504
|
+
nextPass ? nextPass.getFrameBuffer() : null
|
|
505
|
+
);
|
|
506
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
507
|
+
gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);
|
|
508
|
+
if (!nextPass) {
|
|
509
|
+
const canvasId = getUid(gl.canvas);
|
|
510
|
+
if (!frameState.renderTargets[canvasId]) {
|
|
511
|
+
const attributes = gl.getContextAttributes();
|
|
512
|
+
if (attributes && attributes.preserveDrawingBuffer) {
|
|
513
|
+
gl.clearColor(0, 0, 0, 0);
|
|
514
|
+
gl.clearDepth(1);
|
|
515
|
+
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
|
516
|
+
}
|
|
517
|
+
frameState.renderTargets[canvasId] = true;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
gl.disable(gl.DEPTH_TEST);
|
|
521
|
+
gl.enable(gl.BLEND);
|
|
522
|
+
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
523
|
+
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
|
524
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);
|
|
525
|
+
gl.useProgram(this.renderTargetProgram_);
|
|
526
|
+
gl.enableVertexAttribArray(this.renderTargetAttribLocation_);
|
|
527
|
+
gl.vertexAttribPointer(
|
|
528
|
+
this.renderTargetAttribLocation_,
|
|
529
|
+
2,
|
|
530
|
+
gl.FLOAT,
|
|
531
|
+
false,
|
|
532
|
+
0,
|
|
533
|
+
0
|
|
534
|
+
);
|
|
535
|
+
gl.uniform2f(this.renderTargetUniformLocation_, size[0], size[1]);
|
|
536
|
+
gl.uniform1i(this.renderTargetTextureLocation_, 0);
|
|
537
|
+
const opacity = frameState.layerStatesArray[frameState.layerIndex].opacity;
|
|
538
|
+
gl.uniform1f(this.renderTargetOpacityLocation_, opacity);
|
|
539
|
+
this.applyUniforms(frameState);
|
|
540
|
+
if (preCompose) {
|
|
541
|
+
preCompose(gl, frameState);
|
|
542
|
+
}
|
|
543
|
+
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
|
544
|
+
if (postCompose) {
|
|
545
|
+
postCompose(gl, frameState);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* @return {WebGLFramebuffer} Frame buffer
|
|
550
|
+
*/
|
|
551
|
+
getFrameBuffer() {
|
|
552
|
+
return this.frameBuffer_;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @return {WebGLRenderbuffer} Depth buffer
|
|
556
|
+
*/
|
|
557
|
+
getDepthBuffer() {
|
|
558
|
+
return this.depthBuffer_;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Sets the custom uniforms based on what was given in the constructor.
|
|
562
|
+
* @param {import("../Map.js").FrameState} frameState Frame state.
|
|
563
|
+
* @private
|
|
564
|
+
*/
|
|
565
|
+
applyUniforms(frameState) {
|
|
566
|
+
const gl = this.getGL();
|
|
567
|
+
let value;
|
|
568
|
+
let textureSlot = 1;
|
|
569
|
+
this.uniforms_.forEach(function(uniform) {
|
|
570
|
+
value = typeof uniform.value === "function" ? uniform.value(frameState) : uniform.value;
|
|
571
|
+
if (value instanceof HTMLCanvasElement || value instanceof ImageData) {
|
|
572
|
+
if (!uniform.texture) {
|
|
573
|
+
uniform.texture = gl.createTexture();
|
|
574
|
+
}
|
|
575
|
+
gl.activeTexture(gl[`TEXTURE${textureSlot}`]);
|
|
576
|
+
gl.bindTexture(gl.TEXTURE_2D, uniform.texture);
|
|
577
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
578
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
579
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
580
|
+
if (value instanceof ImageData) {
|
|
581
|
+
gl.texImage2D(
|
|
582
|
+
gl.TEXTURE_2D,
|
|
583
|
+
0,
|
|
584
|
+
gl.RGBA,
|
|
585
|
+
gl.RGBA,
|
|
586
|
+
value.width,
|
|
587
|
+
value.height,
|
|
588
|
+
0,
|
|
589
|
+
gl.UNSIGNED_BYTE,
|
|
590
|
+
new Uint8Array(value.data)
|
|
591
|
+
);
|
|
592
|
+
} else {
|
|
593
|
+
gl.texImage2D(
|
|
594
|
+
gl.TEXTURE_2D,
|
|
595
|
+
0,
|
|
596
|
+
gl.RGBA,
|
|
597
|
+
gl.RGBA,
|
|
598
|
+
gl.UNSIGNED_BYTE,
|
|
599
|
+
value
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
gl.uniform1i(uniform.location, textureSlot++);
|
|
603
|
+
} else if (Array.isArray(value)) {
|
|
604
|
+
switch (value.length) {
|
|
605
|
+
case 2:
|
|
606
|
+
gl.uniform2f(uniform.location, value[0], value[1]);
|
|
607
|
+
return;
|
|
608
|
+
case 3:
|
|
609
|
+
gl.uniform3f(uniform.location, value[0], value[1], value[2]);
|
|
610
|
+
return;
|
|
611
|
+
case 4:
|
|
612
|
+
gl.uniform4f(
|
|
613
|
+
uniform.location,
|
|
614
|
+
value[0],
|
|
615
|
+
value[1],
|
|
616
|
+
value[2],
|
|
617
|
+
value[3]
|
|
618
|
+
);
|
|
619
|
+
return;
|
|
620
|
+
default:
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
} else if (typeof value === "number") {
|
|
624
|
+
gl.uniform1f(uniform.location, value);
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
var PostProcessingPass_default = WebGLPostProcessingPass;
|
|
630
|
+
|
|
631
|
+
// node_modules/ol/webgl/Helper.js
|
|
632
|
+
var DefaultUniform = {
|
|
633
|
+
PROJECTION_MATRIX: "u_projectionMatrix",
|
|
634
|
+
SCREEN_TO_WORLD_MATRIX: "u_screenToWorldMatrix",
|
|
635
|
+
TIME: "u_time",
|
|
636
|
+
ZOOM: "u_zoom",
|
|
637
|
+
RESOLUTION: "u_resolution",
|
|
638
|
+
ROTATION: "u_rotation",
|
|
639
|
+
VIEWPORT_SIZE_PX: "u_viewportSizePx",
|
|
640
|
+
PIXEL_RATIO: "u_pixelRatio",
|
|
641
|
+
HIT_DETECTION: "u_hitDetection"
|
|
642
|
+
};
|
|
643
|
+
var AttributeType = {
|
|
644
|
+
UNSIGNED_BYTE,
|
|
645
|
+
UNSIGNED_SHORT,
|
|
646
|
+
UNSIGNED_INT,
|
|
647
|
+
FLOAT
|
|
648
|
+
};
|
|
649
|
+
var canvasCache = {};
|
|
650
|
+
function getSharedCanvasCacheKey(key) {
|
|
651
|
+
return "shared/" + key;
|
|
652
|
+
}
|
|
653
|
+
var uniqueCanvasCacheKeyCount = 0;
|
|
654
|
+
function getUniqueCanvasCacheKey() {
|
|
655
|
+
const key = "unique/" + uniqueCanvasCacheKeyCount;
|
|
656
|
+
uniqueCanvasCacheKeyCount += 1;
|
|
657
|
+
return key;
|
|
658
|
+
}
|
|
659
|
+
function getOrCreateContext(key) {
|
|
660
|
+
let cacheItem = canvasCache[key];
|
|
661
|
+
if (!cacheItem) {
|
|
662
|
+
const canvas = document.createElement("canvas");
|
|
663
|
+
canvas.width = 1;
|
|
664
|
+
canvas.height = 1;
|
|
665
|
+
canvas.style.position = "absolute";
|
|
666
|
+
canvas.style.left = "0";
|
|
667
|
+
const context = getContext(canvas);
|
|
668
|
+
cacheItem = { users: 0, context };
|
|
669
|
+
canvasCache[key] = cacheItem;
|
|
670
|
+
}
|
|
671
|
+
cacheItem.users += 1;
|
|
672
|
+
return cacheItem.context;
|
|
673
|
+
}
|
|
674
|
+
function releaseCanvas(key) {
|
|
675
|
+
const cacheItem = canvasCache[key];
|
|
676
|
+
if (!cacheItem) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
cacheItem.users -= 1;
|
|
680
|
+
if (cacheItem.users > 0) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
const gl = cacheItem.context;
|
|
684
|
+
const extension = gl.getExtension("WEBGL_lose_context");
|
|
685
|
+
if (extension) {
|
|
686
|
+
extension.loseContext();
|
|
687
|
+
}
|
|
688
|
+
const canvas = gl.canvas;
|
|
689
|
+
canvas.width = 1;
|
|
690
|
+
canvas.height = 1;
|
|
691
|
+
delete canvasCache[key];
|
|
692
|
+
}
|
|
693
|
+
var WebGLHelper = class extends Disposable_default {
|
|
694
|
+
/**
|
|
695
|
+
* @param {Options} [options] Options.
|
|
696
|
+
*/
|
|
697
|
+
constructor(options) {
|
|
698
|
+
super();
|
|
699
|
+
options = options || {};
|
|
700
|
+
this.boundHandleWebGLContextLost_ = this.handleWebGLContextLost.bind(this);
|
|
701
|
+
this.boundHandleWebGLContextRestored_ = this.handleWebGLContextRestored.bind(this);
|
|
702
|
+
this.canvasCacheKey_ = options.canvasCacheKey ? getSharedCanvasCacheKey(options.canvasCacheKey) : getUniqueCanvasCacheKey();
|
|
703
|
+
this.gl_ = getOrCreateContext(this.canvasCacheKey_);
|
|
704
|
+
this.bufferCache_ = {};
|
|
705
|
+
this.extensionCache_ = {};
|
|
706
|
+
this.currentProgram_ = null;
|
|
707
|
+
this.needsToBeRecreated_ = false;
|
|
708
|
+
const canvas = this.gl_.canvas;
|
|
709
|
+
canvas.addEventListener(
|
|
710
|
+
ContextEventType_default.LOST,
|
|
711
|
+
this.boundHandleWebGLContextLost_
|
|
712
|
+
);
|
|
713
|
+
canvas.addEventListener(
|
|
714
|
+
ContextEventType_default.RESTORED,
|
|
715
|
+
this.boundHandleWebGLContextRestored_
|
|
716
|
+
);
|
|
717
|
+
this.offsetRotateMatrix_ = create();
|
|
718
|
+
this.offsetScaleMatrix_ = create();
|
|
719
|
+
this.tmpMat4_ = create2();
|
|
720
|
+
this.uniformLocationsByProgram_ = {};
|
|
721
|
+
this.attribLocationsByProgram_ = {};
|
|
722
|
+
this.uniforms_ = [];
|
|
723
|
+
if (options.uniforms) {
|
|
724
|
+
this.setUniforms(options.uniforms);
|
|
725
|
+
}
|
|
726
|
+
this.postProcessPasses_ = options.postProcesses ? options.postProcesses.map(
|
|
727
|
+
(options2) => new PostProcessingPass_default({
|
|
728
|
+
webGlContext: this.gl_,
|
|
729
|
+
scaleRatio: options2.scaleRatio,
|
|
730
|
+
vertexShader: options2.vertexShader,
|
|
731
|
+
fragmentShader: options2.fragmentShader,
|
|
732
|
+
uniforms: options2.uniforms
|
|
733
|
+
})
|
|
734
|
+
) : [new PostProcessingPass_default({ webGlContext: this.gl_ })];
|
|
735
|
+
this.shaderCompileErrors_ = null;
|
|
736
|
+
this.startTime_ = Date.now();
|
|
737
|
+
this.maxAttributeCount_ = this.gl_.getParameter(
|
|
738
|
+
this.gl_.MAX_VERTEX_ATTRIBS
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* @param {Object<string, UniformValue>} uniforms Uniform definitions.
|
|
743
|
+
*/
|
|
744
|
+
setUniforms(uniforms) {
|
|
745
|
+
this.uniforms_ = [];
|
|
746
|
+
this.addUniforms(uniforms);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* @param {Object<string, UniformValue>} uniforms Uniform definitions.
|
|
750
|
+
*/
|
|
751
|
+
addUniforms(uniforms) {
|
|
752
|
+
for (const name in uniforms) {
|
|
753
|
+
this.uniforms_.push({
|
|
754
|
+
name,
|
|
755
|
+
value: uniforms[name]
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* @param {string} canvasCacheKey The canvas cache key.
|
|
761
|
+
* @return {boolean} The provided key matches the one this helper was constructed with.
|
|
762
|
+
*/
|
|
763
|
+
canvasCacheKeyMatches(canvasCacheKey) {
|
|
764
|
+
return this.canvasCacheKey_ === getSharedCanvasCacheKey(canvasCacheKey);
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Get a WebGL extension. If the extension is not supported, null is returned.
|
|
768
|
+
* Extensions are cached after they are enabled for the first time.
|
|
769
|
+
* @param {string} name The extension name.
|
|
770
|
+
* @return {Object|null} The extension or null if not supported.
|
|
771
|
+
*/
|
|
772
|
+
getExtension(name) {
|
|
773
|
+
if (name in this.extensionCache_) {
|
|
774
|
+
return this.extensionCache_[name];
|
|
775
|
+
}
|
|
776
|
+
const extension = this.gl_.getExtension(name);
|
|
777
|
+
this.extensionCache_[name] = extension;
|
|
778
|
+
return extension;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Will throw if the extension is not available
|
|
782
|
+
* @return {ANGLE_instanced_arrays} Extension
|
|
783
|
+
*/
|
|
784
|
+
getInstancedRenderingExtension_() {
|
|
785
|
+
const ext = this.getExtension("ANGLE_instanced_arrays");
|
|
786
|
+
assert(
|
|
787
|
+
!!ext,
|
|
788
|
+
"WebGL extension 'ANGLE_instanced_arrays' is required for vector rendering"
|
|
789
|
+
);
|
|
790
|
+
return ext;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Just bind the buffer if it's in the cache. Otherwise create
|
|
794
|
+
* the WebGL buffer, bind it, populate it, and add an entry to
|
|
795
|
+
* the cache.
|
|
796
|
+
* @param {import("./Buffer").default} buffer Buffer.
|
|
797
|
+
*/
|
|
798
|
+
bindBuffer(buffer) {
|
|
799
|
+
const gl = this.gl_;
|
|
800
|
+
const bufferKey = getUid(buffer);
|
|
801
|
+
let bufferCache = this.bufferCache_[bufferKey];
|
|
802
|
+
if (!bufferCache) {
|
|
803
|
+
const webGlBuffer = gl.createBuffer();
|
|
804
|
+
bufferCache = {
|
|
805
|
+
buffer,
|
|
806
|
+
webGlBuffer
|
|
807
|
+
};
|
|
808
|
+
this.bufferCache_[bufferKey] = bufferCache;
|
|
809
|
+
}
|
|
810
|
+
gl.bindBuffer(buffer.getType(), bufferCache.webGlBuffer);
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Update the data contained in the buffer array; this is required for the
|
|
814
|
+
* new data to be rendered
|
|
815
|
+
* @param {import("./Buffer").default} buffer Buffer.
|
|
816
|
+
*/
|
|
817
|
+
flushBufferData(buffer) {
|
|
818
|
+
const gl = this.gl_;
|
|
819
|
+
this.bindBuffer(buffer);
|
|
820
|
+
gl.bufferData(buffer.getType(), buffer.getArray(), buffer.getUsage());
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* @param {import("./Buffer.js").default} buf Buffer.
|
|
824
|
+
*/
|
|
825
|
+
deleteBuffer(buf) {
|
|
826
|
+
const bufferKey = getUid(buf);
|
|
827
|
+
delete this.bufferCache_[bufferKey];
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Clean up.
|
|
831
|
+
* @override
|
|
832
|
+
*/
|
|
833
|
+
disposeInternal() {
|
|
834
|
+
const canvas = this.gl_.canvas;
|
|
835
|
+
canvas.removeEventListener(
|
|
836
|
+
ContextEventType_default.LOST,
|
|
837
|
+
this.boundHandleWebGLContextLost_
|
|
838
|
+
);
|
|
839
|
+
canvas.removeEventListener(
|
|
840
|
+
ContextEventType_default.RESTORED,
|
|
841
|
+
this.boundHandleWebGLContextRestored_
|
|
842
|
+
);
|
|
843
|
+
releaseCanvas(this.canvasCacheKey_);
|
|
844
|
+
delete this.gl_;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Clear the buffer & set the viewport to draw.
|
|
848
|
+
* Post process passes will be initialized here, the first one being bound as a render target for
|
|
849
|
+
* subsequent draw calls.
|
|
850
|
+
* @param {import("../Map.js").FrameState} frameState current frame state
|
|
851
|
+
* @param {boolean} [disableAlphaBlend] If true, no alpha blending will happen.
|
|
852
|
+
* @param {boolean} [enableDepth] If true, enables depth testing.
|
|
853
|
+
*/
|
|
854
|
+
prepareDraw(frameState, disableAlphaBlend, enableDepth) {
|
|
855
|
+
const gl = this.gl_;
|
|
856
|
+
const canvas = this.getCanvas();
|
|
857
|
+
const size = frameState.size;
|
|
858
|
+
const pixelRatio = frameState.pixelRatio;
|
|
859
|
+
if (canvas.width !== size[0] * pixelRatio || canvas.height !== size[1] * pixelRatio) {
|
|
860
|
+
canvas.width = size[0] * pixelRatio;
|
|
861
|
+
canvas.height = size[1] * pixelRatio;
|
|
862
|
+
canvas.style.width = size[0] + "px";
|
|
863
|
+
canvas.style.height = size[1] + "px";
|
|
864
|
+
}
|
|
865
|
+
for (let i = this.postProcessPasses_.length - 1; i >= 0; i--) {
|
|
866
|
+
this.postProcessPasses_[i].init(frameState);
|
|
867
|
+
}
|
|
868
|
+
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
869
|
+
gl.clearColor(0, 0, 0, 0);
|
|
870
|
+
gl.depthRange(0, 1);
|
|
871
|
+
gl.clearDepth(1);
|
|
872
|
+
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
|
873
|
+
gl.enable(gl.BLEND);
|
|
874
|
+
gl.blendFunc(gl.ONE, disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);
|
|
875
|
+
if (enableDepth) {
|
|
876
|
+
gl.enable(gl.DEPTH_TEST);
|
|
877
|
+
gl.depthFunc(gl.LEQUAL);
|
|
878
|
+
} else {
|
|
879
|
+
gl.disable(gl.DEPTH_TEST);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* @param {WebGLFramebuffer|null} frameBuffer The frame buffer.
|
|
884
|
+
* @param {WebGLTexture} [texture] The texture.
|
|
885
|
+
*/
|
|
886
|
+
bindFrameBuffer(frameBuffer, texture) {
|
|
887
|
+
const gl = this.getGL();
|
|
888
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);
|
|
889
|
+
if (texture) {
|
|
890
|
+
gl.framebufferTexture2D(
|
|
891
|
+
gl.FRAMEBUFFER,
|
|
892
|
+
gl.COLOR_ATTACHMENT0,
|
|
893
|
+
gl.TEXTURE_2D,
|
|
894
|
+
texture,
|
|
895
|
+
0
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Bind the frame buffer from the initial render.
|
|
901
|
+
*/
|
|
902
|
+
bindInitialFrameBuffer() {
|
|
903
|
+
const gl = this.getGL();
|
|
904
|
+
const frameBuffer = this.postProcessPasses_[0].getFrameBuffer();
|
|
905
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);
|
|
906
|
+
const texture = this.postProcessPasses_[0].getRenderTargetTexture();
|
|
907
|
+
gl.framebufferTexture2D(
|
|
908
|
+
gl.FRAMEBUFFER,
|
|
909
|
+
gl.COLOR_ATTACHMENT0,
|
|
910
|
+
gl.TEXTURE_2D,
|
|
911
|
+
texture,
|
|
912
|
+
0
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Prepare a program to use a texture.
|
|
917
|
+
* @param {WebGLTexture} texture The texture.
|
|
918
|
+
* @param {number} slot The texture slot.
|
|
919
|
+
* @param {string} uniformName The corresponding uniform name.
|
|
920
|
+
*/
|
|
921
|
+
bindTexture(texture, slot, uniformName) {
|
|
922
|
+
const gl = this.gl_;
|
|
923
|
+
gl.activeTexture(gl.TEXTURE0 + slot);
|
|
924
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
925
|
+
gl.uniform1i(this.getUniformLocation(uniformName), slot);
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Set up an attribute array buffer for use in the vertex shader.
|
|
929
|
+
* @param {import("./Buffer").default} buffer The buffer.
|
|
930
|
+
* @param {string} attributeName The attribute name.
|
|
931
|
+
* @param {number} size The number of components per attribute vertex.
|
|
932
|
+
*/
|
|
933
|
+
bindAttribute(buffer, attributeName, size) {
|
|
934
|
+
const gl = this.getGL();
|
|
935
|
+
this.bindBuffer(buffer);
|
|
936
|
+
const index = this.getAttributeLocation(attributeName);
|
|
937
|
+
gl.enableVertexAttribArray(index);
|
|
938
|
+
gl.vertexAttribPointer(index, size, gl.FLOAT, false, 0, 0);
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Clear the render target & bind it for future draw operations.
|
|
942
|
+
* This is similar to `prepareDraw`, only post processes will not be applied.
|
|
943
|
+
* Note: the whole viewport will be drawn to the render target, regardless of its size.
|
|
944
|
+
* @param {import("../Map.js").FrameState} frameState current frame state
|
|
945
|
+
* @param {import("./RenderTarget.js").default} renderTarget Render target to draw to
|
|
946
|
+
* @param {boolean} [disableAlphaBlend] If true, no alpha blending will happen.
|
|
947
|
+
* @param {boolean} [enableDepth] If true, enables depth testing.
|
|
948
|
+
*/
|
|
949
|
+
prepareDrawToRenderTarget(frameState, renderTarget, disableAlphaBlend, enableDepth) {
|
|
950
|
+
const gl = this.gl_;
|
|
951
|
+
const size = renderTarget.getSize();
|
|
952
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, renderTarget.getFramebuffer());
|
|
953
|
+
gl.bindRenderbuffer(gl.RENDERBUFFER, renderTarget.getDepthbuffer());
|
|
954
|
+
gl.viewport(0, 0, size[0], size[1]);
|
|
955
|
+
gl.bindTexture(gl.TEXTURE_2D, renderTarget.getTexture());
|
|
956
|
+
gl.clearColor(0, 0, 0, 0);
|
|
957
|
+
gl.depthRange(0, 1);
|
|
958
|
+
gl.clearDepth(1);
|
|
959
|
+
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
|
960
|
+
gl.enable(gl.BLEND);
|
|
961
|
+
gl.blendFunc(gl.ONE, disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);
|
|
962
|
+
if (enableDepth) {
|
|
963
|
+
gl.enable(gl.DEPTH_TEST);
|
|
964
|
+
gl.depthFunc(gl.LEQUAL);
|
|
965
|
+
} else {
|
|
966
|
+
gl.disable(gl.DEPTH_TEST);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* Execute a draw call based on the currently bound program, texture, buffers, attributes.
|
|
971
|
+
* @param {number} start Start index.
|
|
972
|
+
* @param {number} end End index.
|
|
973
|
+
*/
|
|
974
|
+
drawElements(start, end) {
|
|
975
|
+
const gl = this.gl_;
|
|
976
|
+
this.getExtension("OES_element_index_uint");
|
|
977
|
+
const elementType = gl.UNSIGNED_INT;
|
|
978
|
+
const elementSize = 4;
|
|
979
|
+
const numItems = end - start;
|
|
980
|
+
const offsetInBytes = start * elementSize;
|
|
981
|
+
gl.drawElements(gl.TRIANGLES, numItems, elementType, offsetInBytes);
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Execute a draw call similar to `drawElements`, but using instanced rendering.
|
|
985
|
+
* Will have no effect if `enableAttributesInstanced` was not called for this rendering pass.
|
|
986
|
+
* @param {number} start Start index.
|
|
987
|
+
* @param {number} end End index.
|
|
988
|
+
* @param {number} instanceCount The number of instances to render
|
|
989
|
+
*/
|
|
990
|
+
drawElementsInstanced(start, end, instanceCount) {
|
|
991
|
+
const gl = this.gl_;
|
|
992
|
+
this.getExtension("OES_element_index_uint");
|
|
993
|
+
const ext = this.getInstancedRenderingExtension_();
|
|
994
|
+
const elementType = gl.UNSIGNED_INT;
|
|
995
|
+
const elementSize = 4;
|
|
996
|
+
const numItems = end - start;
|
|
997
|
+
const offsetInBytes = start * elementSize;
|
|
998
|
+
ext.drawElementsInstancedANGLE(
|
|
999
|
+
gl.TRIANGLES,
|
|
1000
|
+
numItems,
|
|
1001
|
+
elementType,
|
|
1002
|
+
offsetInBytes,
|
|
1003
|
+
instanceCount
|
|
1004
|
+
);
|
|
1005
|
+
for (let i = 0; i < this.maxAttributeCount_; i++) {
|
|
1006
|
+
ext.vertexAttribDivisorANGLE(i, 0);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Apply the successive post process passes which will eventually render to the actual canvas.
|
|
1011
|
+
* @param {import("../Map.js").FrameState} frameState current frame state
|
|
1012
|
+
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [preCompose] Called before composing.
|
|
1013
|
+
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [postCompose] Called before composing.
|
|
1014
|
+
*/
|
|
1015
|
+
finalizeDraw(frameState, preCompose, postCompose) {
|
|
1016
|
+
for (let i = 0, ii = this.postProcessPasses_.length; i < ii; i++) {
|
|
1017
|
+
if (i === ii - 1) {
|
|
1018
|
+
this.postProcessPasses_[i].apply(
|
|
1019
|
+
frameState,
|
|
1020
|
+
null,
|
|
1021
|
+
preCompose,
|
|
1022
|
+
postCompose
|
|
1023
|
+
);
|
|
1024
|
+
} else {
|
|
1025
|
+
this.postProcessPasses_[i].apply(
|
|
1026
|
+
frameState,
|
|
1027
|
+
this.postProcessPasses_[i + 1]
|
|
1028
|
+
);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* @return {HTMLCanvasElement} Canvas.
|
|
1034
|
+
*/
|
|
1035
|
+
getCanvas() {
|
|
1036
|
+
return (
|
|
1037
|
+
/** @type {HTMLCanvasElement} */
|
|
1038
|
+
this.gl_.canvas
|
|
1039
|
+
);
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Get the WebGL rendering context
|
|
1043
|
+
* @return {WebGLRenderingContext} The rendering context.
|
|
1044
|
+
*/
|
|
1045
|
+
getGL() {
|
|
1046
|
+
return this.gl_;
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Sets the default matrix uniforms for a given frame state. This is called internally in `prepareDraw`.
|
|
1050
|
+
* @param {import("../Map.js").FrameState} frameState Frame state.
|
|
1051
|
+
*/
|
|
1052
|
+
applyFrameState(frameState) {
|
|
1053
|
+
const size = frameState.size;
|
|
1054
|
+
const rotation = frameState.viewState.rotation;
|
|
1055
|
+
const pixelRatio = frameState.pixelRatio;
|
|
1056
|
+
this.setUniformFloatValue(
|
|
1057
|
+
DefaultUniform.TIME,
|
|
1058
|
+
(Date.now() - this.startTime_) * 1e-3
|
|
1059
|
+
);
|
|
1060
|
+
this.setUniformFloatValue(DefaultUniform.ZOOM, frameState.viewState.zoom);
|
|
1061
|
+
this.setUniformFloatValue(
|
|
1062
|
+
DefaultUniform.RESOLUTION,
|
|
1063
|
+
frameState.viewState.resolution
|
|
1064
|
+
);
|
|
1065
|
+
this.setUniformFloatValue(DefaultUniform.PIXEL_RATIO, pixelRatio);
|
|
1066
|
+
this.setUniformFloatVec2(DefaultUniform.VIEWPORT_SIZE_PX, [
|
|
1067
|
+
size[0],
|
|
1068
|
+
size[1]
|
|
1069
|
+
]);
|
|
1070
|
+
this.setUniformFloatValue(DefaultUniform.ROTATION, rotation);
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Sets the `u_hitDetection` uniform.
|
|
1074
|
+
* @param {boolean} enabled Whether to enable the hit detection code path
|
|
1075
|
+
*/
|
|
1076
|
+
applyHitDetectionUniform(enabled) {
|
|
1077
|
+
const loc = this.getUniformLocation(DefaultUniform.HIT_DETECTION);
|
|
1078
|
+
this.getGL().uniform1i(loc, enabled ? 1 : 0);
|
|
1079
|
+
if (enabled) {
|
|
1080
|
+
this.setUniformFloatValue(DefaultUniform.PIXEL_RATIO, 0.5);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Sets the custom uniforms based on what was given in the constructor. This is called internally in `prepareDraw`.
|
|
1085
|
+
* @param {import("../Map.js").FrameState} frameState Frame state.
|
|
1086
|
+
*/
|
|
1087
|
+
applyUniforms(frameState) {
|
|
1088
|
+
const gl = this.gl_;
|
|
1089
|
+
let value;
|
|
1090
|
+
let textureSlot = 0;
|
|
1091
|
+
this.uniforms_.forEach((uniform) => {
|
|
1092
|
+
value = typeof uniform.value === "function" ? uniform.value(frameState) : uniform.value;
|
|
1093
|
+
if (value instanceof HTMLCanvasElement || value instanceof HTMLImageElement || value instanceof ImageData || value instanceof WebGLTexture) {
|
|
1094
|
+
if (value instanceof WebGLTexture && !uniform.texture) {
|
|
1095
|
+
uniform.prevValue = void 0;
|
|
1096
|
+
uniform.texture = value;
|
|
1097
|
+
} else if (!uniform.texture) {
|
|
1098
|
+
uniform.prevValue = void 0;
|
|
1099
|
+
uniform.texture = gl.createTexture();
|
|
1100
|
+
}
|
|
1101
|
+
this.bindTexture(uniform.texture, textureSlot, uniform.name);
|
|
1102
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
1103
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
1104
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
1105
|
+
const imageReady = !(value instanceof HTMLImageElement) || /** @type {HTMLImageElement} */
|
|
1106
|
+
value.complete;
|
|
1107
|
+
if (!(value instanceof WebGLTexture) && imageReady && uniform.prevValue !== value) {
|
|
1108
|
+
uniform.prevValue = value;
|
|
1109
|
+
gl.texImage2D(
|
|
1110
|
+
gl.TEXTURE_2D,
|
|
1111
|
+
0,
|
|
1112
|
+
gl.RGBA,
|
|
1113
|
+
gl.RGBA,
|
|
1114
|
+
gl.UNSIGNED_BYTE,
|
|
1115
|
+
value
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
textureSlot++;
|
|
1119
|
+
} else if (Array.isArray(value) && value.length === 6) {
|
|
1120
|
+
this.setUniformMatrixValue(
|
|
1121
|
+
uniform.name,
|
|
1122
|
+
fromTransform(this.tmpMat4_, value)
|
|
1123
|
+
);
|
|
1124
|
+
} else if (Array.isArray(value) && value.length <= 4) {
|
|
1125
|
+
switch (value.length) {
|
|
1126
|
+
case 2:
|
|
1127
|
+
gl.uniform2f(
|
|
1128
|
+
this.getUniformLocation(uniform.name),
|
|
1129
|
+
value[0],
|
|
1130
|
+
value[1]
|
|
1131
|
+
);
|
|
1132
|
+
return;
|
|
1133
|
+
case 3:
|
|
1134
|
+
gl.uniform3f(
|
|
1135
|
+
this.getUniformLocation(uniform.name),
|
|
1136
|
+
value[0],
|
|
1137
|
+
value[1],
|
|
1138
|
+
value[2]
|
|
1139
|
+
);
|
|
1140
|
+
return;
|
|
1141
|
+
case 4:
|
|
1142
|
+
gl.uniform4f(
|
|
1143
|
+
this.getUniformLocation(uniform.name),
|
|
1144
|
+
value[0],
|
|
1145
|
+
value[1],
|
|
1146
|
+
value[2],
|
|
1147
|
+
value[3]
|
|
1148
|
+
);
|
|
1149
|
+
return;
|
|
1150
|
+
default:
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
} else if (typeof value === "number") {
|
|
1154
|
+
gl.uniform1f(this.getUniformLocation(uniform.name), value);
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Set up a program for use. The program will be set as the current one. Then, the uniforms used
|
|
1160
|
+
* in the program will be set based on the current frame state and the helper configuration.
|
|
1161
|
+
* @param {WebGLProgram} program Program.
|
|
1162
|
+
* @param {import("../Map.js").FrameState} [frameState] Frame state.
|
|
1163
|
+
*/
|
|
1164
|
+
useProgram(program, frameState) {
|
|
1165
|
+
this.disableAllAttributes_();
|
|
1166
|
+
const gl = this.gl_;
|
|
1167
|
+
gl.useProgram(program);
|
|
1168
|
+
this.currentProgram_ = program;
|
|
1169
|
+
if (frameState) {
|
|
1170
|
+
this.applyFrameState(frameState);
|
|
1171
|
+
this.applyUniforms(frameState);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Will attempt to compile a vertex or fragment shader based on source
|
|
1176
|
+
* On error, the shader will be returned but
|
|
1177
|
+
* `gl.getShaderParameter(shader, gl.COMPILE_STATUS)` will return `true`
|
|
1178
|
+
* Use `gl.getShaderInfoLog(shader)` to have details
|
|
1179
|
+
* @param {string} source Shader source
|
|
1180
|
+
* @param {ShaderType} type VERTEX_SHADER or FRAGMENT_SHADER
|
|
1181
|
+
* @return {WebGLShader} Shader object
|
|
1182
|
+
*/
|
|
1183
|
+
compileShader(source, type) {
|
|
1184
|
+
const gl = this.gl_;
|
|
1185
|
+
const shader = gl.createShader(type);
|
|
1186
|
+
gl.shaderSource(shader, source);
|
|
1187
|
+
gl.compileShader(shader);
|
|
1188
|
+
return shader;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Create a program for a vertex and fragment shader. Throws if shader compilation fails.
|
|
1192
|
+
* @param {string} fragmentShaderSource Fragment shader source.
|
|
1193
|
+
* @param {string} vertexShaderSource Vertex shader source.
|
|
1194
|
+
* @return {WebGLProgram} Program
|
|
1195
|
+
*/
|
|
1196
|
+
getProgram(fragmentShaderSource, vertexShaderSource) {
|
|
1197
|
+
const gl = this.gl_;
|
|
1198
|
+
const fragmentShader = this.compileShader(
|
|
1199
|
+
fragmentShaderSource,
|
|
1200
|
+
gl.FRAGMENT_SHADER
|
|
1201
|
+
);
|
|
1202
|
+
const vertexShader = this.compileShader(
|
|
1203
|
+
vertexShaderSource,
|
|
1204
|
+
gl.VERTEX_SHADER
|
|
1205
|
+
);
|
|
1206
|
+
const program = gl.createProgram();
|
|
1207
|
+
gl.attachShader(program, fragmentShader);
|
|
1208
|
+
gl.attachShader(program, vertexShader);
|
|
1209
|
+
gl.linkProgram(program);
|
|
1210
|
+
if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
|
|
1211
|
+
const message = `Fragment shader compilation failed: ${gl.getShaderInfoLog(
|
|
1212
|
+
fragmentShader
|
|
1213
|
+
)}`;
|
|
1214
|
+
throw new Error(message);
|
|
1215
|
+
}
|
|
1216
|
+
gl.deleteShader(fragmentShader);
|
|
1217
|
+
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
|
|
1218
|
+
const message = `Vertex shader compilation failed: ${gl.getShaderInfoLog(
|
|
1219
|
+
vertexShader
|
|
1220
|
+
)}`;
|
|
1221
|
+
throw new Error(message);
|
|
1222
|
+
}
|
|
1223
|
+
gl.deleteShader(vertexShader);
|
|
1224
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
1225
|
+
const message = `GL program linking failed: ${gl.getProgramInfoLog(
|
|
1226
|
+
program
|
|
1227
|
+
)}`;
|
|
1228
|
+
throw new Error(message);
|
|
1229
|
+
}
|
|
1230
|
+
return program;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Will get the location from the shader or the cache
|
|
1234
|
+
* @param {string} name Uniform name
|
|
1235
|
+
* @return {WebGLUniformLocation} uniformLocation
|
|
1236
|
+
*/
|
|
1237
|
+
getUniformLocation(name) {
|
|
1238
|
+
const programUid = getUid(this.currentProgram_);
|
|
1239
|
+
if (this.uniformLocationsByProgram_[programUid] === void 0) {
|
|
1240
|
+
this.uniformLocationsByProgram_[programUid] = {};
|
|
1241
|
+
}
|
|
1242
|
+
if (this.uniformLocationsByProgram_[programUid][name] === void 0) {
|
|
1243
|
+
this.uniformLocationsByProgram_[programUid][name] = this.gl_.getUniformLocation(this.currentProgram_, name);
|
|
1244
|
+
}
|
|
1245
|
+
return this.uniformLocationsByProgram_[programUid][name];
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Will get the location from the shader or the cache
|
|
1249
|
+
* @param {string} name Attribute name
|
|
1250
|
+
* @return {number} attribLocation
|
|
1251
|
+
*/
|
|
1252
|
+
getAttributeLocation(name) {
|
|
1253
|
+
const programUid = getUid(this.currentProgram_);
|
|
1254
|
+
if (this.attribLocationsByProgram_[programUid] === void 0) {
|
|
1255
|
+
this.attribLocationsByProgram_[programUid] = {};
|
|
1256
|
+
}
|
|
1257
|
+
if (this.attribLocationsByProgram_[programUid][name] === void 0) {
|
|
1258
|
+
this.attribLocationsByProgram_[programUid][name] = this.gl_.getAttribLocation(this.currentProgram_, name);
|
|
1259
|
+
}
|
|
1260
|
+
return this.attribLocationsByProgram_[programUid][name];
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Sets the given transform to apply the rotation/translation/scaling of the given frame state.
|
|
1264
|
+
* The resulting transform can be used to convert world space coordinates to view coordinates in the [-1, 1] range.
|
|
1265
|
+
* @param {import("../Map.js").FrameState} frameState Frame state.
|
|
1266
|
+
* @param {import("../transform").Transform} transform Transform to update.
|
|
1267
|
+
* @return {import("../transform").Transform} The updated transform object.
|
|
1268
|
+
*/
|
|
1269
|
+
makeProjectionTransform(frameState, transform) {
|
|
1270
|
+
const size = frameState.size;
|
|
1271
|
+
const rotation = frameState.viewState.rotation;
|
|
1272
|
+
const resolution = frameState.viewState.resolution;
|
|
1273
|
+
const center = frameState.viewState.center;
|
|
1274
|
+
compose(
|
|
1275
|
+
transform,
|
|
1276
|
+
0,
|
|
1277
|
+
0,
|
|
1278
|
+
2 / (resolution * size[0]),
|
|
1279
|
+
2 / (resolution * size[1]),
|
|
1280
|
+
-rotation,
|
|
1281
|
+
-center[0],
|
|
1282
|
+
-center[1]
|
|
1283
|
+
);
|
|
1284
|
+
return transform;
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Give a value for a standard float uniform
|
|
1288
|
+
* @param {string} uniform Uniform name
|
|
1289
|
+
* @param {number} value Value
|
|
1290
|
+
*/
|
|
1291
|
+
setUniformFloatValue(uniform, value) {
|
|
1292
|
+
this.gl_.uniform1f(this.getUniformLocation(uniform), value);
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Give a value for a vec2 uniform
|
|
1296
|
+
* @param {string} uniform Uniform name
|
|
1297
|
+
* @param {Array<number>} value Array of length 4.
|
|
1298
|
+
*/
|
|
1299
|
+
setUniformFloatVec2(uniform, value) {
|
|
1300
|
+
this.gl_.uniform2fv(this.getUniformLocation(uniform), value);
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Give a value for a vec4 uniform
|
|
1304
|
+
* @param {string} uniform Uniform name
|
|
1305
|
+
* @param {Array<number>} value Array of length 4.
|
|
1306
|
+
*/
|
|
1307
|
+
setUniformFloatVec4(uniform, value) {
|
|
1308
|
+
this.gl_.uniform4fv(this.getUniformLocation(uniform), value);
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Give a value for a standard matrix4 uniform
|
|
1312
|
+
* @param {string} uniform Uniform name
|
|
1313
|
+
* @param {Array<number>} value Matrix value
|
|
1314
|
+
*/
|
|
1315
|
+
setUniformMatrixValue(uniform, value) {
|
|
1316
|
+
this.gl_.uniformMatrix4fv(this.getUniformLocation(uniform), false, value);
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Disable all vertex attributes.
|
|
1320
|
+
* @private
|
|
1321
|
+
*/
|
|
1322
|
+
disableAllAttributes_() {
|
|
1323
|
+
for (let i = 0; i < this.maxAttributeCount_; i++) {
|
|
1324
|
+
this.gl_.disableVertexAttribArray(i);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Will set the currently bound buffer to an attribute of the shader program. Used by `#enableAttributes`
|
|
1329
|
+
* internally.
|
|
1330
|
+
* @param {string} attribName Attribute name
|
|
1331
|
+
* @param {number} size Number of components per attributes
|
|
1332
|
+
* @param {number} type UNSIGNED_INT, UNSIGNED_BYTE, UNSIGNED_SHORT or FLOAT
|
|
1333
|
+
* @param {number} stride Stride in bytes (0 means attribs are packed)
|
|
1334
|
+
* @param {number} offset Offset in bytes
|
|
1335
|
+
* @param {boolean} instanced Whether the attribute is used for instanced rendering
|
|
1336
|
+
* @private
|
|
1337
|
+
*/
|
|
1338
|
+
enableAttributeArray_(attribName, size, type, stride, offset, instanced) {
|
|
1339
|
+
const location = this.getAttributeLocation(attribName);
|
|
1340
|
+
if (location < 0) {
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
this.gl_.enableVertexAttribArray(location);
|
|
1344
|
+
this.gl_.vertexAttribPointer(location, size, type, false, stride, offset);
|
|
1345
|
+
if (instanced) {
|
|
1346
|
+
this.getInstancedRenderingExtension_().vertexAttribDivisorANGLE(
|
|
1347
|
+
location,
|
|
1348
|
+
1
|
|
1349
|
+
);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* @private
|
|
1354
|
+
* @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer
|
|
1355
|
+
* @param {boolean} instanced Whether the attributes are instanced.
|
|
1356
|
+
*/
|
|
1357
|
+
enableAttributes_(attributes, instanced) {
|
|
1358
|
+
const stride = computeAttributesStride(attributes);
|
|
1359
|
+
let offset = 0;
|
|
1360
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
1361
|
+
const attr = attributes[i];
|
|
1362
|
+
if (attr.name) {
|
|
1363
|
+
this.enableAttributeArray_(
|
|
1364
|
+
attr.name,
|
|
1365
|
+
attr.size,
|
|
1366
|
+
attr.type || FLOAT,
|
|
1367
|
+
stride,
|
|
1368
|
+
offset,
|
|
1369
|
+
instanced
|
|
1370
|
+
);
|
|
1371
|
+
}
|
|
1372
|
+
offset += attr.size * getByteSizeFromType(attr.type);
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Will enable the following attributes to be read from the currently bound buffer,
|
|
1377
|
+
* i.e. tell the GPU where to read the different attributes in the buffer. An error in the
|
|
1378
|
+
* size/type/order of attributes will most likely break the rendering and throw a WebGL exception.
|
|
1379
|
+
* @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer
|
|
1380
|
+
*/
|
|
1381
|
+
enableAttributes(attributes) {
|
|
1382
|
+
this.enableAttributes_(attributes, false);
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Will enable these attributes as instanced, meaning that they will only be read
|
|
1386
|
+
* once per instance instead of per vertex.
|
|
1387
|
+
* @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer
|
|
1388
|
+
*/
|
|
1389
|
+
enableAttributesInstanced(attributes) {
|
|
1390
|
+
this.enableAttributes_(attributes, true);
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* WebGL context was lost
|
|
1394
|
+
* @param {WebGLContextEvent} event The context loss event.
|
|
1395
|
+
* @private
|
|
1396
|
+
*/
|
|
1397
|
+
handleWebGLContextLost(event) {
|
|
1398
|
+
clear(this.bufferCache_);
|
|
1399
|
+
this.currentProgram_ = null;
|
|
1400
|
+
event.preventDefault();
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* WebGL context was restored
|
|
1404
|
+
* @private
|
|
1405
|
+
*/
|
|
1406
|
+
handleWebGLContextRestored() {
|
|
1407
|
+
this.needsToBeRecreated_ = true;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Returns whether this helper needs to be recreated, as the context was lost and then restored.
|
|
1411
|
+
* @return {boolean} Whether this helper needs to be recreated.
|
|
1412
|
+
*/
|
|
1413
|
+
needsToBeRecreated() {
|
|
1414
|
+
return this.needsToBeRecreated_;
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Will create or reuse a given webgl texture and apply the given size. If no image data
|
|
1418
|
+
* specified, the texture will be empty, otherwise image data will be used and the `size`
|
|
1419
|
+
* parameter will be ignored. If a Uint8Array is provided for data, a size must also be provided.
|
|
1420
|
+
* Note: wrap parameters are set to clamp to edge, min filter is set to linear.
|
|
1421
|
+
* @param {Array<number>} size Expected size of the texture
|
|
1422
|
+
* @param {ImageData|HTMLImageElement|HTMLCanvasElement|Uint8Array|null} data Image data/object to bind to the texture
|
|
1423
|
+
* @param {WebGLTexture} [texture] Existing texture to reuse
|
|
1424
|
+
* @param {boolean} [nearest] Use gl.NEAREST for min/mag filter.
|
|
1425
|
+
* @return {WebGLTexture} The generated texture
|
|
1426
|
+
*/
|
|
1427
|
+
createTexture(size, data, texture, nearest) {
|
|
1428
|
+
const gl = this.gl_;
|
|
1429
|
+
texture = texture || gl.createTexture();
|
|
1430
|
+
const filter = nearest ? gl.NEAREST : gl.LINEAR;
|
|
1431
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
1432
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filter);
|
|
1433
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter);
|
|
1434
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
1435
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
1436
|
+
const level = 0;
|
|
1437
|
+
const internalFormat = gl.RGBA;
|
|
1438
|
+
const border = 0;
|
|
1439
|
+
const format = gl.RGBA;
|
|
1440
|
+
const type = gl.UNSIGNED_BYTE;
|
|
1441
|
+
if (data instanceof Uint8Array) {
|
|
1442
|
+
gl.texImage2D(
|
|
1443
|
+
gl.TEXTURE_2D,
|
|
1444
|
+
level,
|
|
1445
|
+
internalFormat,
|
|
1446
|
+
size[0],
|
|
1447
|
+
size[1],
|
|
1448
|
+
border,
|
|
1449
|
+
format,
|
|
1450
|
+
type,
|
|
1451
|
+
data
|
|
1452
|
+
);
|
|
1453
|
+
} else if (data) {
|
|
1454
|
+
gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, format, type, data);
|
|
1455
|
+
} else {
|
|
1456
|
+
gl.texImage2D(
|
|
1457
|
+
gl.TEXTURE_2D,
|
|
1458
|
+
level,
|
|
1459
|
+
internalFormat,
|
|
1460
|
+
size[0],
|
|
1461
|
+
size[1],
|
|
1462
|
+
border,
|
|
1463
|
+
format,
|
|
1464
|
+
type,
|
|
1465
|
+
null
|
|
1466
|
+
);
|
|
1467
|
+
}
|
|
1468
|
+
return texture;
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
function computeAttributesStride(attributes) {
|
|
1472
|
+
let stride = 0;
|
|
1473
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
1474
|
+
const attr = attributes[i];
|
|
1475
|
+
stride += attr.size * getByteSizeFromType(attr.type);
|
|
1476
|
+
}
|
|
1477
|
+
return stride;
|
|
1478
|
+
}
|
|
1479
|
+
function getByteSizeFromType(type) {
|
|
1480
|
+
switch (type) {
|
|
1481
|
+
case AttributeType.UNSIGNED_BYTE:
|
|
1482
|
+
return Uint8Array.BYTES_PER_ELEMENT;
|
|
1483
|
+
case AttributeType.UNSIGNED_SHORT:
|
|
1484
|
+
return Uint16Array.BYTES_PER_ELEMENT;
|
|
1485
|
+
case AttributeType.UNSIGNED_INT:
|
|
1486
|
+
return Uint32Array.BYTES_PER_ELEMENT;
|
|
1487
|
+
case AttributeType.FLOAT:
|
|
1488
|
+
default:
|
|
1489
|
+
return Float32Array.BYTES_PER_ELEMENT;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
var Helper_default = WebGLHelper;
|
|
1493
|
+
|
|
1494
|
+
// node_modules/ol/webgl/TileTexture.js
|
|
1495
|
+
init_dirname();
|
|
1496
|
+
init_buffer();
|
|
1497
|
+
init_process();
|
|
1498
|
+
|
|
1499
|
+
// node_modules/ol/webgl/BaseTileRepresentation.js
|
|
1500
|
+
init_dirname();
|
|
1501
|
+
init_buffer();
|
|
1502
|
+
init_process();
|
|
1503
|
+
var BaseTileRepresentation = class extends Target_default {
|
|
1504
|
+
/**
|
|
1505
|
+
* @param {TileRepresentationOptions<TileType>} options The tile representation options.
|
|
1506
|
+
*/
|
|
1507
|
+
constructor(options) {
|
|
1508
|
+
super();
|
|
1509
|
+
this.tile;
|
|
1510
|
+
this.handleTileChange_ = this.handleTileChange_.bind(this);
|
|
1511
|
+
this.gutter = options.gutter || 0;
|
|
1512
|
+
this.helper = options.helper;
|
|
1513
|
+
this.loaded = false;
|
|
1514
|
+
this.ready = false;
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* @param {TileType} tile Tile.
|
|
1518
|
+
*/
|
|
1519
|
+
setTile(tile) {
|
|
1520
|
+
if (tile !== this.tile) {
|
|
1521
|
+
if (this.tile) {
|
|
1522
|
+
this.tile.removeEventListener(EventType_default.CHANGE, this.handleTileChange_);
|
|
1523
|
+
}
|
|
1524
|
+
this.tile = tile;
|
|
1525
|
+
this.loaded = tile.getState() === TileState_default.LOADED;
|
|
1526
|
+
if (this.loaded) {
|
|
1527
|
+
this.uploadTile();
|
|
1528
|
+
} else {
|
|
1529
|
+
if (tile instanceof ImageTile_default) {
|
|
1530
|
+
const image = tile.getImage();
|
|
1531
|
+
if (image instanceof Image && !image.crossOrigin) {
|
|
1532
|
+
image.crossOrigin = "anonymous";
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
tile.addEventListener(EventType_default.CHANGE, this.handleTileChange_);
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* @abstract
|
|
1541
|
+
* @protected
|
|
1542
|
+
*/
|
|
1543
|
+
uploadTile() {
|
|
1544
|
+
abstract();
|
|
1545
|
+
}
|
|
1546
|
+
setReady() {
|
|
1547
|
+
this.ready = true;
|
|
1548
|
+
this.dispatchEvent(EventType_default.CHANGE);
|
|
1549
|
+
}
|
|
1550
|
+
handleTileChange_() {
|
|
1551
|
+
if (this.tile.getState() === TileState_default.LOADED) {
|
|
1552
|
+
this.loaded = true;
|
|
1553
|
+
this.uploadTile();
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* @param {import("./Helper.js").default} helper The WebGL helper.
|
|
1558
|
+
*/
|
|
1559
|
+
setHelper(helper) {
|
|
1560
|
+
this.helper = helper;
|
|
1561
|
+
if (this.helper && this.loaded) {
|
|
1562
|
+
this.uploadTile();
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* @override
|
|
1567
|
+
*/
|
|
1568
|
+
disposeInternal() {
|
|
1569
|
+
this.setHelper(null);
|
|
1570
|
+
this.tile.removeEventListener(EventType_default.CHANGE, this.handleTileChange_);
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
var BaseTileRepresentation_default = BaseTileRepresentation;
|
|
1574
|
+
|
|
1575
|
+
// node_modules/ol/webgl/TileTexture.js
|
|
1576
|
+
function bindAndConfigure(gl, texture, interpolate) {
|
|
1577
|
+
const resampleFilter = interpolate ? gl.LINEAR : gl.NEAREST;
|
|
1578
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
1579
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
1580
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
1581
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, resampleFilter);
|
|
1582
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, resampleFilter);
|
|
1583
|
+
}
|
|
1584
|
+
function uploadImageTexture(gl, texture, image, interpolate) {
|
|
1585
|
+
bindAndConfigure(gl, texture, interpolate);
|
|
1586
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
|
|
1587
|
+
}
|
|
1588
|
+
function uploadDataTexture(helper, texture, data, size, bandCount, interpolate) {
|
|
1589
|
+
const gl = helper.getGL();
|
|
1590
|
+
let textureType;
|
|
1591
|
+
let canInterpolate;
|
|
1592
|
+
if (data instanceof Float32Array) {
|
|
1593
|
+
textureType = gl.FLOAT;
|
|
1594
|
+
helper.getExtension("OES_texture_float");
|
|
1595
|
+
const extension = helper.getExtension("OES_texture_float_linear");
|
|
1596
|
+
canInterpolate = extension !== null;
|
|
1597
|
+
} else {
|
|
1598
|
+
textureType = gl.UNSIGNED_BYTE;
|
|
1599
|
+
canInterpolate = true;
|
|
1600
|
+
}
|
|
1601
|
+
bindAndConfigure(gl, texture, interpolate && canInterpolate);
|
|
1602
|
+
const bytesPerRow = data.byteLength / size[1];
|
|
1603
|
+
let unpackAlignment = 1;
|
|
1604
|
+
if (bytesPerRow % 8 === 0) {
|
|
1605
|
+
unpackAlignment = 8;
|
|
1606
|
+
} else if (bytesPerRow % 4 === 0) {
|
|
1607
|
+
unpackAlignment = 4;
|
|
1608
|
+
} else if (bytesPerRow % 2 === 0) {
|
|
1609
|
+
unpackAlignment = 2;
|
|
1610
|
+
}
|
|
1611
|
+
let format;
|
|
1612
|
+
switch (bandCount) {
|
|
1613
|
+
case 1: {
|
|
1614
|
+
format = gl.LUMINANCE;
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
case 2: {
|
|
1618
|
+
format = gl.LUMINANCE_ALPHA;
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
case 3: {
|
|
1622
|
+
format = gl.RGB;
|
|
1623
|
+
break;
|
|
1624
|
+
}
|
|
1625
|
+
case 4: {
|
|
1626
|
+
format = gl.RGBA;
|
|
1627
|
+
break;
|
|
1628
|
+
}
|
|
1629
|
+
default: {
|
|
1630
|
+
throw new Error(`Unsupported number of bands: ${bandCount}`);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
const oldUnpackAlignment = gl.getParameter(gl.UNPACK_ALIGNMENT);
|
|
1634
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
|
|
1635
|
+
gl.texImage2D(
|
|
1636
|
+
gl.TEXTURE_2D,
|
|
1637
|
+
0,
|
|
1638
|
+
format,
|
|
1639
|
+
size[0],
|
|
1640
|
+
size[1],
|
|
1641
|
+
0,
|
|
1642
|
+
format,
|
|
1643
|
+
textureType,
|
|
1644
|
+
data
|
|
1645
|
+
);
|
|
1646
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, oldUnpackAlignment);
|
|
1647
|
+
}
|
|
1648
|
+
var pixelContext = null;
|
|
1649
|
+
function createPixelContext() {
|
|
1650
|
+
pixelContext = createCanvasContext2D(1, 1, void 0, {
|
|
1651
|
+
willReadFrequently: true
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
var TileTexture = class extends BaseTileRepresentation_default {
|
|
1655
|
+
/**
|
|
1656
|
+
* @param {import("./BaseTileRepresentation.js").TileRepresentationOptions<TileType>} options The tile texture options.
|
|
1657
|
+
*/
|
|
1658
|
+
constructor(options) {
|
|
1659
|
+
super(options);
|
|
1660
|
+
this.textures = [];
|
|
1661
|
+
this.renderSize_ = toSize(
|
|
1662
|
+
options.grid.getTileSize(options.tile.tileCoord[0])
|
|
1663
|
+
);
|
|
1664
|
+
this.bandCount = NaN;
|
|
1665
|
+
const coords = new Buffer_default(ARRAY_BUFFER, STATIC_DRAW);
|
|
1666
|
+
coords.fromArray([
|
|
1667
|
+
0,
|
|
1668
|
+
// P0
|
|
1669
|
+
1,
|
|
1670
|
+
1,
|
|
1671
|
+
// P1
|
|
1672
|
+
1,
|
|
1673
|
+
1,
|
|
1674
|
+
// P2
|
|
1675
|
+
0,
|
|
1676
|
+
0,
|
|
1677
|
+
// P3
|
|
1678
|
+
0
|
|
1679
|
+
]);
|
|
1680
|
+
this.helper.flushBufferData(coords);
|
|
1681
|
+
this.coords = coords;
|
|
1682
|
+
this.setTile(options.tile);
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* @override
|
|
1686
|
+
* @param {import("./Helper.js").default} helper The WebGL helper.
|
|
1687
|
+
*/
|
|
1688
|
+
setHelper(helper) {
|
|
1689
|
+
var _a;
|
|
1690
|
+
const gl = (_a = this.helper) == null ? void 0 : _a.getGL();
|
|
1691
|
+
if (gl) {
|
|
1692
|
+
this.helper.deleteBuffer(this.coords);
|
|
1693
|
+
for (let i = 0; i < this.textures.length; ++i) {
|
|
1694
|
+
gl.deleteTexture(this.textures[i]);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
super.setHelper(helper);
|
|
1698
|
+
if (helper) {
|
|
1699
|
+
helper.flushBufferData(this.coords);
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
/**
|
|
1703
|
+
* @override
|
|
1704
|
+
*/
|
|
1705
|
+
uploadTile() {
|
|
1706
|
+
const helper = this.helper;
|
|
1707
|
+
const gl = helper.getGL();
|
|
1708
|
+
const tile = this.tile;
|
|
1709
|
+
this.textures.length = 0;
|
|
1710
|
+
let data;
|
|
1711
|
+
if (tile instanceof ImageTile_default || tile instanceof Tile_default) {
|
|
1712
|
+
data = tile.getImage();
|
|
1713
|
+
} else {
|
|
1714
|
+
data = tile.getData();
|
|
1715
|
+
}
|
|
1716
|
+
const image = asImageLike(data);
|
|
1717
|
+
if (image) {
|
|
1718
|
+
const texture = gl.createTexture();
|
|
1719
|
+
this.textures.push(texture);
|
|
1720
|
+
this.bandCount = 4;
|
|
1721
|
+
uploadImageTexture(gl, texture, image, tile.interpolate);
|
|
1722
|
+
this.setReady();
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
data = asArrayLike(data);
|
|
1726
|
+
const sourceTileSize = (
|
|
1727
|
+
/** @type {DataTile} */
|
|
1728
|
+
tile.getSize()
|
|
1729
|
+
);
|
|
1730
|
+
const pixelSize = [
|
|
1731
|
+
sourceTileSize[0] + 2 * this.gutter,
|
|
1732
|
+
sourceTileSize[1] + 2 * this.gutter
|
|
1733
|
+
];
|
|
1734
|
+
const isFloat = data instanceof Float32Array;
|
|
1735
|
+
const pixelCount = pixelSize[0] * pixelSize[1];
|
|
1736
|
+
const DataType = isFloat ? Float32Array : Uint8Array;
|
|
1737
|
+
const bytesPerElement = DataType.BYTES_PER_ELEMENT;
|
|
1738
|
+
const bytesPerRow = data.byteLength / pixelSize[1];
|
|
1739
|
+
this.bandCount = Math.floor(bytesPerRow / bytesPerElement / pixelSize[0]);
|
|
1740
|
+
const textureCount = Math.ceil(this.bandCount / 4);
|
|
1741
|
+
if (textureCount === 1) {
|
|
1742
|
+
const texture = gl.createTexture();
|
|
1743
|
+
this.textures.push(texture);
|
|
1744
|
+
uploadDataTexture(
|
|
1745
|
+
helper,
|
|
1746
|
+
texture,
|
|
1747
|
+
data,
|
|
1748
|
+
pixelSize,
|
|
1749
|
+
this.bandCount,
|
|
1750
|
+
tile.interpolate
|
|
1751
|
+
);
|
|
1752
|
+
this.setReady();
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
const textureDataArrays = new Array(textureCount);
|
|
1756
|
+
for (let textureIndex = 0; textureIndex < textureCount; ++textureIndex) {
|
|
1757
|
+
const texture = gl.createTexture();
|
|
1758
|
+
this.textures.push(texture);
|
|
1759
|
+
const bandCount = textureIndex < textureCount - 1 ? 4 : (this.bandCount - 1) % 4 + 1;
|
|
1760
|
+
textureDataArrays[textureIndex] = new DataType(pixelCount * bandCount);
|
|
1761
|
+
}
|
|
1762
|
+
let dataIndex = 0;
|
|
1763
|
+
let rowOffset = 0;
|
|
1764
|
+
const colCount = pixelSize[0] * this.bandCount;
|
|
1765
|
+
for (let rowIndex = 0; rowIndex < pixelSize[1]; ++rowIndex) {
|
|
1766
|
+
for (let colIndex = 0; colIndex < colCount; ++colIndex) {
|
|
1767
|
+
const dataValue = data[rowOffset + colIndex];
|
|
1768
|
+
const pixelIndex = Math.floor(dataIndex / this.bandCount);
|
|
1769
|
+
const bandIndex = colIndex % this.bandCount;
|
|
1770
|
+
const textureIndex = Math.floor(bandIndex / 4);
|
|
1771
|
+
const textureData = textureDataArrays[textureIndex];
|
|
1772
|
+
const bandCount = textureData.length / pixelCount;
|
|
1773
|
+
const textureBandIndex = bandIndex % 4;
|
|
1774
|
+
textureData[pixelIndex * bandCount + textureBandIndex] = dataValue;
|
|
1775
|
+
++dataIndex;
|
|
1776
|
+
}
|
|
1777
|
+
rowOffset += bytesPerRow / bytesPerElement;
|
|
1778
|
+
}
|
|
1779
|
+
for (let textureIndex = 0; textureIndex < textureCount; ++textureIndex) {
|
|
1780
|
+
const texture = this.textures[textureIndex];
|
|
1781
|
+
const textureData = textureDataArrays[textureIndex];
|
|
1782
|
+
const bandCount = textureData.length / pixelCount;
|
|
1783
|
+
uploadDataTexture(
|
|
1784
|
+
helper,
|
|
1785
|
+
texture,
|
|
1786
|
+
textureData,
|
|
1787
|
+
pixelSize,
|
|
1788
|
+
bandCount,
|
|
1789
|
+
tile.interpolate
|
|
1790
|
+
);
|
|
1791
|
+
}
|
|
1792
|
+
this.setReady();
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* @param {import("../DataTile.js").ImageLike} image The image.
|
|
1796
|
+
* @param {number} renderCol The column index (in rendered tile space).
|
|
1797
|
+
* @param {number} renderRow The row index (in rendered tile space).
|
|
1798
|
+
* @return {Uint8ClampedArray|null} The data.
|
|
1799
|
+
* @private
|
|
1800
|
+
*/
|
|
1801
|
+
getImagePixelData_(image, renderCol, renderRow) {
|
|
1802
|
+
const gutter = this.gutter;
|
|
1803
|
+
const renderWidth = this.renderSize_[0];
|
|
1804
|
+
const renderHeight = this.renderSize_[1];
|
|
1805
|
+
if (!pixelContext) {
|
|
1806
|
+
createPixelContext();
|
|
1807
|
+
}
|
|
1808
|
+
pixelContext.clearRect(0, 0, 1, 1);
|
|
1809
|
+
const sourceWidth = image.width;
|
|
1810
|
+
const sourceHeight = image.height;
|
|
1811
|
+
const sourceWidthWithoutGutter = sourceWidth - 2 * gutter;
|
|
1812
|
+
const sourceHeightWithoutGutter = sourceHeight - 2 * gutter;
|
|
1813
|
+
const sourceCol = gutter + Math.floor(sourceWidthWithoutGutter * (renderCol / renderWidth));
|
|
1814
|
+
const sourceRow = gutter + Math.floor(sourceHeightWithoutGutter * (renderRow / renderHeight));
|
|
1815
|
+
let data;
|
|
1816
|
+
try {
|
|
1817
|
+
pixelContext.drawImage(image, sourceCol, sourceRow, 1, 1, 0, 0, 1, 1);
|
|
1818
|
+
data = pixelContext.getImageData(0, 0, 1, 1).data;
|
|
1819
|
+
} catch (e2) {
|
|
1820
|
+
pixelContext = null;
|
|
1821
|
+
return null;
|
|
1822
|
+
}
|
|
1823
|
+
return data;
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* @param {import("../DataTile.js").ArrayLike} data The data.
|
|
1827
|
+
* @param {import("../size.js").Size} sourceSize The size.
|
|
1828
|
+
* @param {number} renderCol The column index (in rendered tile space).
|
|
1829
|
+
* @param {number} renderRow The row index (in rendered tile space).
|
|
1830
|
+
* @return {import("../DataTile.js").ArrayLike|null} The data.
|
|
1831
|
+
* @private
|
|
1832
|
+
*/
|
|
1833
|
+
getArrayPixelData_(data, sourceSize, renderCol, renderRow) {
|
|
1834
|
+
const gutter = this.gutter;
|
|
1835
|
+
const renderWidth = this.renderSize_[0];
|
|
1836
|
+
const renderHeight = this.renderSize_[1];
|
|
1837
|
+
const sourceWidthWithoutGutter = sourceSize[0];
|
|
1838
|
+
const sourceHeightWithoutGutter = sourceSize[1];
|
|
1839
|
+
const sourceWidth = sourceWidthWithoutGutter + 2 * gutter;
|
|
1840
|
+
const sourceHeight = sourceHeightWithoutGutter + 2 * gutter;
|
|
1841
|
+
const sourceCol = gutter + Math.floor(sourceWidthWithoutGutter * (renderCol / renderWidth));
|
|
1842
|
+
const sourceRow = gutter + Math.floor(sourceHeightWithoutGutter * (renderRow / renderHeight));
|
|
1843
|
+
if (data instanceof DataView) {
|
|
1844
|
+
const bytesPerPixel = data.byteLength / (sourceWidth * sourceHeight);
|
|
1845
|
+
const offset2 = bytesPerPixel * (sourceRow * sourceWidth + sourceCol);
|
|
1846
|
+
const buffer = data.buffer.slice(offset2, offset2 + bytesPerPixel);
|
|
1847
|
+
return new DataView(buffer);
|
|
1848
|
+
}
|
|
1849
|
+
const offset = this.bandCount * (sourceRow * sourceWidth + sourceCol);
|
|
1850
|
+
return data.slice(offset, offset + this.bandCount);
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Get data for a pixel. If the tile is not loaded, null is returned.
|
|
1854
|
+
* @param {number} renderCol The column index (in rendered tile space).
|
|
1855
|
+
* @param {number} renderRow The row index (in rendered tile space).
|
|
1856
|
+
* @return {import("../DataTile.js").ArrayLike|null} The data.
|
|
1857
|
+
*/
|
|
1858
|
+
getPixelData(renderCol, renderRow) {
|
|
1859
|
+
if (!this.loaded) {
|
|
1860
|
+
return null;
|
|
1861
|
+
}
|
|
1862
|
+
if (this.tile instanceof DataTile_default) {
|
|
1863
|
+
const data = this.tile.getData();
|
|
1864
|
+
const arrayData = asArrayLike(data);
|
|
1865
|
+
if (arrayData) {
|
|
1866
|
+
const sourceSize = this.tile.getSize();
|
|
1867
|
+
return this.getArrayPixelData_(
|
|
1868
|
+
arrayData,
|
|
1869
|
+
sourceSize,
|
|
1870
|
+
renderCol,
|
|
1871
|
+
renderRow
|
|
1872
|
+
);
|
|
1873
|
+
}
|
|
1874
|
+
return this.getImagePixelData_(asImageLike(data), renderCol, renderRow);
|
|
1875
|
+
}
|
|
1876
|
+
return this.getImagePixelData_(this.tile.getImage(), renderCol, renderRow);
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1879
|
+
var TileTexture_default = TileTexture;
|
|
1880
|
+
|
|
1881
|
+
// node_modules/ol/renderer/webgl/TileLayerBase.js
|
|
1882
|
+
init_dirname();
|
|
1883
|
+
init_buffer();
|
|
1884
|
+
init_process();
|
|
1885
|
+
|
|
1886
|
+
// node_modules/ol/renderer/webgl/Layer.js
|
|
1887
|
+
init_dirname();
|
|
1888
|
+
init_buffer();
|
|
1889
|
+
init_process();
|
|
1890
|
+
var WebGLLayerRenderer = class _WebGLLayerRenderer extends Layer_default {
|
|
1891
|
+
/**
|
|
1892
|
+
* @param {LayerType} layer Layer.
|
|
1893
|
+
* @param {Options} [options] Options.
|
|
1894
|
+
*/
|
|
1895
|
+
constructor(layer, options) {
|
|
1896
|
+
super(layer);
|
|
1897
|
+
options = options || {};
|
|
1898
|
+
this.inversePixelTransform_ = create();
|
|
1899
|
+
this.postProcesses_ = options.postProcesses;
|
|
1900
|
+
this.uniforms_ = options.uniforms;
|
|
1901
|
+
this.helper;
|
|
1902
|
+
this.onMapChanged_ = () => {
|
|
1903
|
+
this.clearCache();
|
|
1904
|
+
this.removeHelper();
|
|
1905
|
+
};
|
|
1906
|
+
layer.addChangeListener(Property_default.MAP, this.onMapChanged_);
|
|
1907
|
+
this.dispatchPreComposeEvent = this.dispatchPreComposeEvent.bind(this);
|
|
1908
|
+
this.dispatchPostComposeEvent = this.dispatchPostComposeEvent.bind(this);
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* @param {WebGLRenderingContext} context The WebGL rendering context.
|
|
1912
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
1913
|
+
* @protected
|
|
1914
|
+
*/
|
|
1915
|
+
dispatchPreComposeEvent(context, frameState) {
|
|
1916
|
+
const layer = this.getLayer();
|
|
1917
|
+
if (layer.hasListener(EventType_default2.PRECOMPOSE)) {
|
|
1918
|
+
const event = new Event_default(
|
|
1919
|
+
EventType_default2.PRECOMPOSE,
|
|
1920
|
+
void 0,
|
|
1921
|
+
frameState,
|
|
1922
|
+
context
|
|
1923
|
+
);
|
|
1924
|
+
layer.dispatchEvent(event);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* @param {WebGLRenderingContext} context The WebGL rendering context.
|
|
1929
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
1930
|
+
* @protected
|
|
1931
|
+
*/
|
|
1932
|
+
dispatchPostComposeEvent(context, frameState) {
|
|
1933
|
+
const layer = this.getLayer();
|
|
1934
|
+
if (layer.hasListener(EventType_default2.POSTCOMPOSE)) {
|
|
1935
|
+
const event = new Event_default(
|
|
1936
|
+
EventType_default2.POSTCOMPOSE,
|
|
1937
|
+
void 0,
|
|
1938
|
+
frameState,
|
|
1939
|
+
context
|
|
1940
|
+
);
|
|
1941
|
+
layer.dispatchEvent(event);
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Reset options (only handles uniforms).
|
|
1946
|
+
* @param {Options} options Options.
|
|
1947
|
+
*/
|
|
1948
|
+
reset(options) {
|
|
1949
|
+
this.uniforms_ = options.uniforms;
|
|
1950
|
+
if (this.helper) {
|
|
1951
|
+
this.helper.setUniforms(this.uniforms_);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
/**
|
|
1955
|
+
* @protected
|
|
1956
|
+
*/
|
|
1957
|
+
removeHelper() {
|
|
1958
|
+
if (this.helper) {
|
|
1959
|
+
this.helper.dispose();
|
|
1960
|
+
delete this.helper;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* Determine whether renderFrame should be called.
|
|
1965
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
1966
|
+
* @return {boolean} Layer is ready to be rendered.
|
|
1967
|
+
* @override
|
|
1968
|
+
*/
|
|
1969
|
+
prepareFrame(frameState) {
|
|
1970
|
+
if (this.getLayer().getRenderSource()) {
|
|
1971
|
+
let incrementGroup = true;
|
|
1972
|
+
let groupNumber = -1;
|
|
1973
|
+
let className;
|
|
1974
|
+
for (let i = 0, ii = frameState.layerStatesArray.length; i < ii; i++) {
|
|
1975
|
+
const layer = frameState.layerStatesArray[i].layer;
|
|
1976
|
+
const renderer = layer.getRenderer();
|
|
1977
|
+
if (!(renderer instanceof _WebGLLayerRenderer)) {
|
|
1978
|
+
incrementGroup = true;
|
|
1979
|
+
continue;
|
|
1980
|
+
}
|
|
1981
|
+
const layerClassName = layer.getClassName();
|
|
1982
|
+
if (incrementGroup || layerClassName !== className) {
|
|
1983
|
+
groupNumber += 1;
|
|
1984
|
+
incrementGroup = false;
|
|
1985
|
+
}
|
|
1986
|
+
className = layerClassName;
|
|
1987
|
+
if (renderer === this) {
|
|
1988
|
+
break;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
const canvasCacheKey = "map/" + frameState.mapId + "/group/" + groupNumber;
|
|
1992
|
+
if (!this.helper || !this.helper.canvasCacheKeyMatches(canvasCacheKey) || this.helper.needsToBeRecreated()) {
|
|
1993
|
+
this.removeHelper();
|
|
1994
|
+
this.helper = new Helper_default({
|
|
1995
|
+
postProcesses: this.postProcesses_,
|
|
1996
|
+
uniforms: this.uniforms_,
|
|
1997
|
+
canvasCacheKey
|
|
1998
|
+
});
|
|
1999
|
+
if (className) {
|
|
2000
|
+
this.helper.getCanvas().className = className;
|
|
2001
|
+
}
|
|
2002
|
+
this.afterHelperCreated();
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
return this.prepareFrameInternal(frameState);
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* @protected
|
|
2009
|
+
*/
|
|
2010
|
+
afterHelperCreated() {
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Determine whether renderFrame should be called.
|
|
2014
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2015
|
+
* @return {boolean} Layer is ready to be rendered.
|
|
2016
|
+
* @protected
|
|
2017
|
+
*/
|
|
2018
|
+
prepareFrameInternal(frameState) {
|
|
2019
|
+
return true;
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* @protected
|
|
2023
|
+
*/
|
|
2024
|
+
clearCache() {
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Clean up.
|
|
2028
|
+
* @override
|
|
2029
|
+
*/
|
|
2030
|
+
disposeInternal() {
|
|
2031
|
+
var _a;
|
|
2032
|
+
this.clearCache();
|
|
2033
|
+
this.removeHelper();
|
|
2034
|
+
(_a = this.getLayer()) == null ? void 0 : _a.removeChangeListener(
|
|
2035
|
+
Property_default.MAP,
|
|
2036
|
+
this.onMapChanged_
|
|
2037
|
+
);
|
|
2038
|
+
super.disposeInternal();
|
|
2039
|
+
}
|
|
2040
|
+
/**
|
|
2041
|
+
* @param {import("../../render/EventType.js").default} type Event type.
|
|
2042
|
+
* @param {WebGLRenderingContext} context The rendering context.
|
|
2043
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2044
|
+
* @private
|
|
2045
|
+
*/
|
|
2046
|
+
dispatchRenderEvent_(type, context, frameState) {
|
|
2047
|
+
const layer = this.getLayer();
|
|
2048
|
+
if (layer.hasListener(type)) {
|
|
2049
|
+
compose(
|
|
2050
|
+
this.inversePixelTransform_,
|
|
2051
|
+
0,
|
|
2052
|
+
0,
|
|
2053
|
+
frameState.pixelRatio,
|
|
2054
|
+
-frameState.pixelRatio,
|
|
2055
|
+
0,
|
|
2056
|
+
0,
|
|
2057
|
+
-frameState.size[1]
|
|
2058
|
+
);
|
|
2059
|
+
const event = new Event_default(
|
|
2060
|
+
type,
|
|
2061
|
+
this.inversePixelTransform_,
|
|
2062
|
+
frameState,
|
|
2063
|
+
context
|
|
2064
|
+
);
|
|
2065
|
+
layer.dispatchEvent(event);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* @param {WebGLRenderingContext} context The rendering context.
|
|
2070
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2071
|
+
* @protected
|
|
2072
|
+
*/
|
|
2073
|
+
preRender(context, frameState) {
|
|
2074
|
+
this.dispatchRenderEvent_(EventType_default2.PRERENDER, context, frameState);
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* @param {WebGLRenderingContext} context The rendering context.
|
|
2078
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2079
|
+
* @protected
|
|
2080
|
+
*/
|
|
2081
|
+
postRender(context, frameState) {
|
|
2082
|
+
this.dispatchRenderEvent_(EventType_default2.POSTRENDER, context, frameState);
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
var Layer_default2 = WebGLLayerRenderer;
|
|
2086
|
+
|
|
2087
|
+
// node_modules/ol/renderer/webgl/TileLayerBase.js
|
|
2088
|
+
var Uniforms = {
|
|
2089
|
+
TILE_TRANSFORM: "u_tileTransform",
|
|
2090
|
+
TRANSITION_ALPHA: "u_transitionAlpha",
|
|
2091
|
+
DEPTH: "u_depth",
|
|
2092
|
+
RENDER_EXTENT: "u_renderExtent",
|
|
2093
|
+
// intersection of layer, source, and view extent
|
|
2094
|
+
PATTERN_ORIGIN: "u_patternOrigin",
|
|
2095
|
+
RESOLUTION: "u_resolution",
|
|
2096
|
+
ZOOM: "u_zoom",
|
|
2097
|
+
GLOBAL_ALPHA: "u_globalAlpha",
|
|
2098
|
+
PROJECTION_MATRIX: "u_projectionMatrix",
|
|
2099
|
+
SCREEN_TO_WORLD_MATRIX: "u_screenToWorldMatrix"
|
|
2100
|
+
};
|
|
2101
|
+
function depthForZ(z) {
|
|
2102
|
+
return 1 / (z + 2);
|
|
2103
|
+
}
|
|
2104
|
+
function newTileRepresentationLookup() {
|
|
2105
|
+
return { tileIds: /* @__PURE__ */ new Set(), representationsByZ: {} };
|
|
2106
|
+
}
|
|
2107
|
+
function lookupHasTile(tileRepresentationLookup, tile) {
|
|
2108
|
+
return tileRepresentationLookup.tileIds.has(getUid(tile));
|
|
2109
|
+
}
|
|
2110
|
+
function addTileRepresentationToLookup(tileRepresentationLookup, tileRepresentation, z) {
|
|
2111
|
+
const representationsByZ = tileRepresentationLookup.representationsByZ;
|
|
2112
|
+
if (!(z in representationsByZ)) {
|
|
2113
|
+
representationsByZ[z] = /* @__PURE__ */ new Set();
|
|
2114
|
+
}
|
|
2115
|
+
representationsByZ[z].add(tileRepresentation);
|
|
2116
|
+
tileRepresentationLookup.tileIds.add(getUid(tileRepresentation.tile));
|
|
2117
|
+
}
|
|
2118
|
+
function getRenderExtent(frameState, extent) {
|
|
2119
|
+
const layerState = frameState.layerStatesArray[frameState.layerIndex];
|
|
2120
|
+
if (layerState.extent) {
|
|
2121
|
+
extent = getIntersection(
|
|
2122
|
+
extent,
|
|
2123
|
+
fromUserExtent(layerState.extent, frameState.viewState.projection)
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2126
|
+
const source = (
|
|
2127
|
+
/** @type {import("../../source/Tile.js").default} */
|
|
2128
|
+
layerState.layer.getRenderSource()
|
|
2129
|
+
);
|
|
2130
|
+
if (!source.getWrapX()) {
|
|
2131
|
+
const gridExtent = source.getTileGridForProjection(frameState.viewState.projection).getExtent();
|
|
2132
|
+
if (gridExtent) {
|
|
2133
|
+
extent = getIntersection(extent, gridExtent);
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
return extent;
|
|
2137
|
+
}
|
|
2138
|
+
function getCacheKey(source, tileCoord) {
|
|
2139
|
+
return `${getUid(source)},${source.getKey()},${getKey(tileCoord)}`;
|
|
2140
|
+
}
|
|
2141
|
+
var WebGLBaseTileLayerRenderer = class extends Layer_default2 {
|
|
2142
|
+
/**
|
|
2143
|
+
* @param {LayerType} tileLayer Tile layer.
|
|
2144
|
+
* @param {Options} options Options.
|
|
2145
|
+
*/
|
|
2146
|
+
constructor(tileLayer, options) {
|
|
2147
|
+
super(tileLayer, {
|
|
2148
|
+
uniforms: options.uniforms,
|
|
2149
|
+
postProcesses: options.postProcesses
|
|
2150
|
+
});
|
|
2151
|
+
this.renderComplete = false;
|
|
2152
|
+
this.tileTransform_ = create();
|
|
2153
|
+
this.tempMat4 = create2();
|
|
2154
|
+
this.tempTileRange_ = new TileRange_default(0, 0, 0, 0);
|
|
2155
|
+
this.tempTileCoord_ = createOrUpdate(0, 0, 0);
|
|
2156
|
+
this.tempSize_ = [0, 0];
|
|
2157
|
+
const cacheSize = options.cacheSize !== void 0 ? options.cacheSize : 512;
|
|
2158
|
+
this.tileRepresentationCache = new LRUCache_default(cacheSize);
|
|
2159
|
+
this.frameState = null;
|
|
2160
|
+
this.renderedProjection_ = void 0;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* @param {Options} options Options.
|
|
2164
|
+
* @override
|
|
2165
|
+
*/
|
|
2166
|
+
reset(options) {
|
|
2167
|
+
super.reset({
|
|
2168
|
+
uniforms: options.uniforms
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* Determine whether renderFrame should be called.
|
|
2173
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2174
|
+
* @return {boolean} Layer is ready to be rendered.
|
|
2175
|
+
* @override
|
|
2176
|
+
*/
|
|
2177
|
+
prepareFrameInternal(frameState) {
|
|
2178
|
+
if (!this.renderedProjection_) {
|
|
2179
|
+
this.renderedProjection_ = frameState.viewState.projection;
|
|
2180
|
+
} else if (frameState.viewState.projection !== this.renderedProjection_) {
|
|
2181
|
+
this.clearCache();
|
|
2182
|
+
this.renderedProjection_ = frameState.viewState.projection;
|
|
2183
|
+
}
|
|
2184
|
+
const layer = this.getLayer();
|
|
2185
|
+
const source = layer.getRenderSource();
|
|
2186
|
+
if (!source) {
|
|
2187
|
+
return false;
|
|
2188
|
+
}
|
|
2189
|
+
if (isEmpty(getRenderExtent(frameState, frameState.extent))) {
|
|
2190
|
+
return false;
|
|
2191
|
+
}
|
|
2192
|
+
return source.getState() === "ready";
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
* @abstract
|
|
2196
|
+
* @param {import("../../webgl/BaseTileRepresentation.js").TileRepresentationOptions<TileType>} options tile representation options
|
|
2197
|
+
* @return {TileRepresentation} A new tile representation
|
|
2198
|
+
* @protected
|
|
2199
|
+
*/
|
|
2200
|
+
createTileRepresentation(options) {
|
|
2201
|
+
return abstract();
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2205
|
+
* @param {import("../../extent.js").Extent} extent The extent to be rendered.
|
|
2206
|
+
* @param {number} initialZ The zoom level.
|
|
2207
|
+
* @param {TileRepresentationLookup} tileRepresentationLookup The zoom level.
|
|
2208
|
+
* @param {number} preload Number of additional levels to load.
|
|
2209
|
+
*/
|
|
2210
|
+
enqueueTiles(frameState, extent, initialZ, tileRepresentationLookup, preload) {
|
|
2211
|
+
const viewState = frameState.viewState;
|
|
2212
|
+
const tileLayer = this.getLayer();
|
|
2213
|
+
const tileSource = tileLayer.getRenderSource();
|
|
2214
|
+
const tileGrid = tileSource.getTileGridForProjection(viewState.projection);
|
|
2215
|
+
const gutter = tileSource.getGutterForProjection(viewState.projection);
|
|
2216
|
+
const tileSourceKey = getUid(tileSource);
|
|
2217
|
+
if (!(tileSourceKey in frameState.wantedTiles)) {
|
|
2218
|
+
frameState.wantedTiles[tileSourceKey] = {};
|
|
2219
|
+
}
|
|
2220
|
+
const wantedTiles = frameState.wantedTiles[tileSourceKey];
|
|
2221
|
+
const tileRepresentationCache = this.tileRepresentationCache;
|
|
2222
|
+
const map = tileLayer.getMapInternal();
|
|
2223
|
+
const minZ = Math.max(
|
|
2224
|
+
initialZ - preload,
|
|
2225
|
+
tileGrid.getMinZoom(),
|
|
2226
|
+
tileGrid.getZForResolution(
|
|
2227
|
+
Math.min(
|
|
2228
|
+
tileLayer.getMaxResolution(),
|
|
2229
|
+
map ? map.getView().getResolutionForZoom(Math.max(tileLayer.getMinZoom(), 0)) : tileGrid.getResolution(0)
|
|
2230
|
+
),
|
|
2231
|
+
tileSource.zDirection
|
|
2232
|
+
)
|
|
2233
|
+
);
|
|
2234
|
+
const rotation = viewState.rotation;
|
|
2235
|
+
const viewport = rotation ? getRotatedViewport(
|
|
2236
|
+
viewState.center,
|
|
2237
|
+
viewState.resolution,
|
|
2238
|
+
rotation,
|
|
2239
|
+
frameState.size
|
|
2240
|
+
) : void 0;
|
|
2241
|
+
for (let z = initialZ; z >= minZ; --z) {
|
|
2242
|
+
const tileRange = tileGrid.getTileRangeForExtentAndZ(
|
|
2243
|
+
extent,
|
|
2244
|
+
z,
|
|
2245
|
+
this.tempTileRange_
|
|
2246
|
+
);
|
|
2247
|
+
const tileResolution = tileGrid.getResolution(z);
|
|
2248
|
+
for (let x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
|
2249
|
+
for (let y = tileRange.minY; y <= tileRange.maxY; ++y) {
|
|
2250
|
+
if (rotation && !tileGrid.tileCoordIntersectsViewport([z, x, y], viewport)) {
|
|
2251
|
+
continue;
|
|
2252
|
+
}
|
|
2253
|
+
const tileCoord = createOrUpdate(z, x, y, this.tempTileCoord_);
|
|
2254
|
+
const cacheKey = getCacheKey(tileSource, tileCoord);
|
|
2255
|
+
let tileRepresentation;
|
|
2256
|
+
let tile;
|
|
2257
|
+
if (tileRepresentationCache.containsKey(cacheKey)) {
|
|
2258
|
+
tileRepresentation = tileRepresentationCache.get(cacheKey);
|
|
2259
|
+
tile = tileRepresentation.tile;
|
|
2260
|
+
}
|
|
2261
|
+
if (!tileRepresentation || tileRepresentation.tile.key !== tileSource.getKey()) {
|
|
2262
|
+
tile = tileSource.getTile(
|
|
2263
|
+
z,
|
|
2264
|
+
x,
|
|
2265
|
+
y,
|
|
2266
|
+
frameState.pixelRatio,
|
|
2267
|
+
viewState.projection
|
|
2268
|
+
);
|
|
2269
|
+
if (!tile) {
|
|
2270
|
+
continue;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
if (lookupHasTile(tileRepresentationLookup, tile)) {
|
|
2274
|
+
continue;
|
|
2275
|
+
}
|
|
2276
|
+
if (!tileRepresentation) {
|
|
2277
|
+
tileRepresentation = this.createTileRepresentation({
|
|
2278
|
+
tile,
|
|
2279
|
+
grid: tileGrid,
|
|
2280
|
+
helper: this.helper,
|
|
2281
|
+
gutter
|
|
2282
|
+
});
|
|
2283
|
+
tileRepresentationCache.set(cacheKey, tileRepresentation);
|
|
2284
|
+
} else {
|
|
2285
|
+
tileRepresentation.setTile(tile);
|
|
2286
|
+
}
|
|
2287
|
+
addTileRepresentationToLookup(
|
|
2288
|
+
tileRepresentationLookup,
|
|
2289
|
+
tileRepresentation,
|
|
2290
|
+
z
|
|
2291
|
+
);
|
|
2292
|
+
const tileQueueKey = tile.getKey();
|
|
2293
|
+
wantedTiles[tileQueueKey] = true;
|
|
2294
|
+
if (tile.getState() === TileState_default.IDLE) {
|
|
2295
|
+
if (!frameState.tileQueue.isKeyQueued(tileQueueKey)) {
|
|
2296
|
+
frameState.tileQueue.enqueue([
|
|
2297
|
+
tile,
|
|
2298
|
+
tileSourceKey,
|
|
2299
|
+
tileGrid.getTileCoordCenter(tileCoord),
|
|
2300
|
+
tileResolution
|
|
2301
|
+
]);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2310
|
+
* @param {boolean} tilesWithAlpha True if at least one of the rendered tiles has alpha
|
|
2311
|
+
* @protected
|
|
2312
|
+
*/
|
|
2313
|
+
beforeTilesRender(frameState, tilesWithAlpha) {
|
|
2314
|
+
this.helper.prepareDraw(this.frameState, !tilesWithAlpha, true);
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2318
|
+
* @return {boolean} If returns false, tile mask rendering will be skipped
|
|
2319
|
+
* @protected
|
|
2320
|
+
*/
|
|
2321
|
+
beforeTilesMaskRender(frameState) {
|
|
2322
|
+
return false;
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* @param {TileRepresentation} tileRepresentation Tile representation
|
|
2326
|
+
* @param {import("../../transform.js").Transform} tileTransform Tile transform
|
|
2327
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state
|
|
2328
|
+
* @param {import("../../extent.js").Extent} renderExtent Render extent
|
|
2329
|
+
* @param {number} tileResolution Tile resolution
|
|
2330
|
+
* @param {import("../../size.js").Size} tileSize Tile size
|
|
2331
|
+
* @param {import("../../coordinate.js").Coordinate} tileOrigin Tile origin
|
|
2332
|
+
* @param {import("../../extent.js").Extent} tileExtent tile Extent
|
|
2333
|
+
* @param {number} depth Depth
|
|
2334
|
+
* @param {number} gutter Gutter
|
|
2335
|
+
* @param {number} alpha Alpha
|
|
2336
|
+
* @protected
|
|
2337
|
+
*/
|
|
2338
|
+
renderTile(tileRepresentation, tileTransform, frameState, renderExtent, tileResolution, tileSize, tileOrigin, tileExtent, depth, gutter, alpha) {
|
|
2339
|
+
}
|
|
2340
|
+
/**
|
|
2341
|
+
* @param {TileRepresentation} tileRepresentation Tile representation
|
|
2342
|
+
* @param {number} tileZ Tile Z
|
|
2343
|
+
* @param {import("../../extent.js").Extent} extent Render extent
|
|
2344
|
+
* @param {number} depth Depth
|
|
2345
|
+
* @protected
|
|
2346
|
+
*/
|
|
2347
|
+
renderTileMask(tileRepresentation, tileZ, extent, depth) {
|
|
2348
|
+
}
|
|
2349
|
+
drawTile_(frameState, tileRepresentation, tileZ, gutter, extent, alphaLookup, tileGrid) {
|
|
2350
|
+
if (!tileRepresentation.ready) {
|
|
2351
|
+
return;
|
|
2352
|
+
}
|
|
2353
|
+
const tile = tileRepresentation.tile;
|
|
2354
|
+
const tileCoord = tile.tileCoord;
|
|
2355
|
+
const tileCoordKey = getKey(tileCoord);
|
|
2356
|
+
const alpha = tileCoordKey in alphaLookup ? alphaLookup[tileCoordKey] : 1;
|
|
2357
|
+
const tileResolution = tileGrid.getResolution(tileZ);
|
|
2358
|
+
const tileSize = toSize(tileGrid.getTileSize(tileZ), this.tempSize_);
|
|
2359
|
+
const tileOrigin = tileGrid.getOrigin(tileZ);
|
|
2360
|
+
const tileExtent = tileGrid.getTileCoordExtent(tileCoord);
|
|
2361
|
+
const depth = alpha < 1 ? -1 : depthForZ(tileZ);
|
|
2362
|
+
if (alpha < 1) {
|
|
2363
|
+
frameState.animate = true;
|
|
2364
|
+
}
|
|
2365
|
+
const viewState = frameState.viewState;
|
|
2366
|
+
const centerX = viewState.center[0];
|
|
2367
|
+
const centerY = viewState.center[1];
|
|
2368
|
+
const tileWidthWithGutter = tileSize[0] + 2 * gutter;
|
|
2369
|
+
const tileHeightWithGutter = tileSize[1] + 2 * gutter;
|
|
2370
|
+
const aspectRatio = tileWidthWithGutter / tileHeightWithGutter;
|
|
2371
|
+
const centerI = (centerX - tileOrigin[0]) / (tileSize[0] * tileResolution);
|
|
2372
|
+
const centerJ = (tileOrigin[1] - centerY) / (tileSize[1] * tileResolution);
|
|
2373
|
+
const tileScale = viewState.resolution / tileResolution;
|
|
2374
|
+
const tileCenterI = tileCoord[1];
|
|
2375
|
+
const tileCenterJ = tileCoord[2];
|
|
2376
|
+
reset(this.tileTransform_);
|
|
2377
|
+
scale(
|
|
2378
|
+
this.tileTransform_,
|
|
2379
|
+
2 / (frameState.size[0] * tileScale / tileWidthWithGutter),
|
|
2380
|
+
-2 / (frameState.size[1] * tileScale / tileWidthWithGutter)
|
|
2381
|
+
);
|
|
2382
|
+
rotate(this.tileTransform_, viewState.rotation);
|
|
2383
|
+
scale(this.tileTransform_, 1, 1 / aspectRatio);
|
|
2384
|
+
translate(
|
|
2385
|
+
this.tileTransform_,
|
|
2386
|
+
(tileSize[0] * (tileCenterI - centerI) - gutter) / tileWidthWithGutter,
|
|
2387
|
+
(tileSize[1] * (tileCenterJ - centerJ) - gutter) / tileHeightWithGutter
|
|
2388
|
+
);
|
|
2389
|
+
this.renderTile(
|
|
2390
|
+
/** @type {TileRepresentation} */
|
|
2391
|
+
tileRepresentation,
|
|
2392
|
+
this.tileTransform_,
|
|
2393
|
+
frameState,
|
|
2394
|
+
extent,
|
|
2395
|
+
tileResolution,
|
|
2396
|
+
tileSize,
|
|
2397
|
+
tileOrigin,
|
|
2398
|
+
tileExtent,
|
|
2399
|
+
depth,
|
|
2400
|
+
gutter,
|
|
2401
|
+
alpha
|
|
2402
|
+
);
|
|
2403
|
+
}
|
|
2404
|
+
/**
|
|
2405
|
+
* Render the layer.
|
|
2406
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2407
|
+
* @return {HTMLElement} The rendered element.
|
|
2408
|
+
* @override
|
|
2409
|
+
*/
|
|
2410
|
+
renderFrame(frameState) {
|
|
2411
|
+
this.frameState = frameState;
|
|
2412
|
+
this.renderComplete = true;
|
|
2413
|
+
const gl = this.helper.getGL();
|
|
2414
|
+
this.preRender(gl, frameState);
|
|
2415
|
+
const viewState = frameState.viewState;
|
|
2416
|
+
const tileLayer = this.getLayer();
|
|
2417
|
+
const tileSource = tileLayer.getRenderSource();
|
|
2418
|
+
const tileGrid = tileSource.getTileGridForProjection(viewState.projection);
|
|
2419
|
+
const gutter = tileSource.getGutterForProjection(viewState.projection);
|
|
2420
|
+
const extent = getRenderExtent(frameState, frameState.extent);
|
|
2421
|
+
const z = tileGrid.getZForResolution(
|
|
2422
|
+
viewState.resolution,
|
|
2423
|
+
tileSource.zDirection
|
|
2424
|
+
);
|
|
2425
|
+
const tileRepresentationLookup = newTileRepresentationLookup();
|
|
2426
|
+
const preload = tileLayer.getPreload();
|
|
2427
|
+
if (frameState.nextExtent) {
|
|
2428
|
+
const targetZ = tileGrid.getZForResolution(
|
|
2429
|
+
viewState.nextResolution,
|
|
2430
|
+
tileSource.zDirection
|
|
2431
|
+
);
|
|
2432
|
+
const nextExtent = getRenderExtent(frameState, frameState.nextExtent);
|
|
2433
|
+
this.enqueueTiles(
|
|
2434
|
+
frameState,
|
|
2435
|
+
nextExtent,
|
|
2436
|
+
targetZ,
|
|
2437
|
+
tileRepresentationLookup,
|
|
2438
|
+
preload
|
|
2439
|
+
);
|
|
2440
|
+
}
|
|
2441
|
+
this.enqueueTiles(frameState, extent, z, tileRepresentationLookup, 0);
|
|
2442
|
+
if (preload > 0) {
|
|
2443
|
+
setTimeout(() => {
|
|
2444
|
+
this.enqueueTiles(
|
|
2445
|
+
frameState,
|
|
2446
|
+
extent,
|
|
2447
|
+
z - 1,
|
|
2448
|
+
tileRepresentationLookup,
|
|
2449
|
+
preload - 1
|
|
2450
|
+
);
|
|
2451
|
+
}, 0);
|
|
2452
|
+
}
|
|
2453
|
+
const alphaLookup = {};
|
|
2454
|
+
let blend = false;
|
|
2455
|
+
const representationsByZ = tileRepresentationLookup.representationsByZ;
|
|
2456
|
+
if (z in representationsByZ) {
|
|
2457
|
+
const uid = getUid(this);
|
|
2458
|
+
const time = frameState.time;
|
|
2459
|
+
for (const tileRepresentation of representationsByZ[z]) {
|
|
2460
|
+
const tile = tileRepresentation.tile;
|
|
2461
|
+
if (tile.getState() === TileState_default.EMPTY) {
|
|
2462
|
+
continue;
|
|
2463
|
+
}
|
|
2464
|
+
const tileCoord = tile.tileCoord;
|
|
2465
|
+
if (tileRepresentation.ready) {
|
|
2466
|
+
const alpha = tile.getAlpha(uid, time);
|
|
2467
|
+
if (alpha === 1) {
|
|
2468
|
+
tile.endTransition(uid);
|
|
2469
|
+
continue;
|
|
2470
|
+
}
|
|
2471
|
+
blend = true;
|
|
2472
|
+
const tileCoordKey = getKey(tileCoord);
|
|
2473
|
+
alphaLookup[tileCoordKey] = alpha;
|
|
2474
|
+
}
|
|
2475
|
+
this.renderComplete = false;
|
|
2476
|
+
const coveredByChildren = this.findAltTiles_(
|
|
2477
|
+
tileGrid,
|
|
2478
|
+
tileCoord,
|
|
2479
|
+
z + 1,
|
|
2480
|
+
tileRepresentationLookup
|
|
2481
|
+
);
|
|
2482
|
+
if (coveredByChildren) {
|
|
2483
|
+
continue;
|
|
2484
|
+
}
|
|
2485
|
+
const minZoom = tileGrid.getMinZoom();
|
|
2486
|
+
for (let parentZ = z - 1; parentZ >= minZoom; --parentZ) {
|
|
2487
|
+
const coveredByParent = this.findAltTiles_(
|
|
2488
|
+
tileGrid,
|
|
2489
|
+
tileCoord,
|
|
2490
|
+
parentZ,
|
|
2491
|
+
tileRepresentationLookup
|
|
2492
|
+
);
|
|
2493
|
+
if (coveredByParent) {
|
|
2494
|
+
break;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
const zs = Object.keys(representationsByZ).map(Number).sort(descending);
|
|
2500
|
+
const renderTileMask = this.beforeTilesMaskRender(frameState);
|
|
2501
|
+
if (renderTileMask) {
|
|
2502
|
+
for (let j = 0, jj = zs.length; j < jj; ++j) {
|
|
2503
|
+
const tileZ = zs[j];
|
|
2504
|
+
for (const tileRepresentation of representationsByZ[tileZ]) {
|
|
2505
|
+
const tileCoord = tileRepresentation.tile.tileCoord;
|
|
2506
|
+
const tileCoordKey = getKey(tileCoord);
|
|
2507
|
+
if (tileCoordKey in alphaLookup) {
|
|
2508
|
+
continue;
|
|
2509
|
+
}
|
|
2510
|
+
const tileExtent = tileGrid.getTileCoordExtent(tileCoord);
|
|
2511
|
+
this.renderTileMask(
|
|
2512
|
+
/** @type {TileRepresentation} */
|
|
2513
|
+
tileRepresentation,
|
|
2514
|
+
tileZ,
|
|
2515
|
+
tileExtent,
|
|
2516
|
+
depthForZ(tileZ)
|
|
2517
|
+
);
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
this.beforeTilesRender(frameState, blend);
|
|
2522
|
+
for (let j = 0, jj = zs.length; j < jj; ++j) {
|
|
2523
|
+
const tileZ = zs[j];
|
|
2524
|
+
for (const tileRepresentation of representationsByZ[tileZ]) {
|
|
2525
|
+
const tileCoord = tileRepresentation.tile.tileCoord;
|
|
2526
|
+
const tileCoordKey = getKey(tileCoord);
|
|
2527
|
+
if (tileCoordKey in alphaLookup) {
|
|
2528
|
+
continue;
|
|
2529
|
+
}
|
|
2530
|
+
this.drawTile_(
|
|
2531
|
+
frameState,
|
|
2532
|
+
tileRepresentation,
|
|
2533
|
+
tileZ,
|
|
2534
|
+
gutter,
|
|
2535
|
+
extent,
|
|
2536
|
+
alphaLookup,
|
|
2537
|
+
tileGrid
|
|
2538
|
+
);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
if (z in representationsByZ) {
|
|
2542
|
+
for (const tileRepresentation of representationsByZ[z]) {
|
|
2543
|
+
const tileCoord = tileRepresentation.tile.tileCoord;
|
|
2544
|
+
const tileCoordKey = getKey(tileCoord);
|
|
2545
|
+
if (tileCoordKey in alphaLookup) {
|
|
2546
|
+
this.drawTile_(
|
|
2547
|
+
frameState,
|
|
2548
|
+
tileRepresentation,
|
|
2549
|
+
z,
|
|
2550
|
+
gutter,
|
|
2551
|
+
extent,
|
|
2552
|
+
alphaLookup,
|
|
2553
|
+
tileGrid
|
|
2554
|
+
);
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
this.beforeFinalize(frameState);
|
|
2559
|
+
this.helper.finalizeDraw(
|
|
2560
|
+
frameState,
|
|
2561
|
+
this.dispatchPreComposeEvent,
|
|
2562
|
+
this.dispatchPostComposeEvent
|
|
2563
|
+
);
|
|
2564
|
+
const canvas = this.helper.getCanvas();
|
|
2565
|
+
const tileRepresentationCache = this.tileRepresentationCache;
|
|
2566
|
+
tileRepresentationCache.expireCache();
|
|
2567
|
+
this.postRender(gl, frameState);
|
|
2568
|
+
return canvas;
|
|
2569
|
+
}
|
|
2570
|
+
/**
|
|
2571
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
2572
|
+
* @protected
|
|
2573
|
+
*/
|
|
2574
|
+
beforeFinalize(frameState) {
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* Look for tiles covering the provided tile coordinate at an alternate
|
|
2579
|
+
* zoom level. Loaded tiles will be added to the provided tile representation lookup.
|
|
2580
|
+
* @param {import("../../tilegrid/TileGrid.js").default} tileGrid The tile grid.
|
|
2581
|
+
* @param {import("../../tilecoord.js").TileCoord} tileCoord The target tile coordinate.
|
|
2582
|
+
* @param {number} altZ The alternate zoom level.
|
|
2583
|
+
* @param {TileRepresentationLookup} tileRepresentationLookup Lookup of
|
|
2584
|
+
* tile representations by zoom level.
|
|
2585
|
+
* @return {boolean} The tile coordinate is covered by loaded tiles at the alternate zoom level.
|
|
2586
|
+
* @private
|
|
2587
|
+
*/
|
|
2588
|
+
findAltTiles_(tileGrid, tileCoord, altZ, tileRepresentationLookup) {
|
|
2589
|
+
const tileRange = tileGrid.getTileRangeForTileCoordAndZ(
|
|
2590
|
+
tileCoord,
|
|
2591
|
+
altZ,
|
|
2592
|
+
this.tempTileRange_
|
|
2593
|
+
);
|
|
2594
|
+
if (!tileRange) {
|
|
2595
|
+
return false;
|
|
2596
|
+
}
|
|
2597
|
+
let covered = true;
|
|
2598
|
+
const tileRepresentationCache = this.tileRepresentationCache;
|
|
2599
|
+
const source = this.getLayer().getRenderSource();
|
|
2600
|
+
for (let x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
|
2601
|
+
for (let y = tileRange.minY; y <= tileRange.maxY; ++y) {
|
|
2602
|
+
const cacheKey = getCacheKey(source, [altZ, x, y]);
|
|
2603
|
+
let loaded = false;
|
|
2604
|
+
if (tileRepresentationCache.containsKey(cacheKey)) {
|
|
2605
|
+
const tileRepresentation = tileRepresentationCache.get(cacheKey);
|
|
2606
|
+
if (tileRepresentation.ready && !lookupHasTile(tileRepresentationLookup, tileRepresentation.tile)) {
|
|
2607
|
+
addTileRepresentationToLookup(
|
|
2608
|
+
tileRepresentationLookup,
|
|
2609
|
+
tileRepresentation,
|
|
2610
|
+
altZ
|
|
2611
|
+
);
|
|
2612
|
+
loaded = true;
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
if (!loaded) {
|
|
2616
|
+
covered = false;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
return covered;
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* @override
|
|
2624
|
+
*/
|
|
2625
|
+
clearCache() {
|
|
2626
|
+
super.clearCache();
|
|
2627
|
+
const tileRepresentationCache = this.tileRepresentationCache;
|
|
2628
|
+
tileRepresentationCache.forEach(
|
|
2629
|
+
(tileRepresentation) => tileRepresentation.dispose()
|
|
2630
|
+
);
|
|
2631
|
+
tileRepresentationCache.clear();
|
|
2632
|
+
}
|
|
2633
|
+
/**
|
|
2634
|
+
* @override
|
|
2635
|
+
*/
|
|
2636
|
+
afterHelperCreated() {
|
|
2637
|
+
super.afterHelperCreated();
|
|
2638
|
+
this.tileRepresentationCache.forEach(
|
|
2639
|
+
(tileRepresentation) => tileRepresentation.setHelper(this.helper)
|
|
2640
|
+
);
|
|
2641
|
+
}
|
|
2642
|
+
/**
|
|
2643
|
+
* Clean up.
|
|
2644
|
+
* @override
|
|
2645
|
+
*/
|
|
2646
|
+
disposeInternal() {
|
|
2647
|
+
super.disposeInternal();
|
|
2648
|
+
delete this.frameState;
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
var TileLayerBase_default = WebGLBaseTileLayerRenderer;
|
|
2652
|
+
|
|
2653
|
+
// node_modules/ol/renderer/webgl/TileLayer.js
|
|
2654
|
+
var Uniforms2 = __spreadProps(__spreadValues({}, Uniforms), {
|
|
2655
|
+
TILE_TEXTURE_ARRAY: "u_tileTextures",
|
|
2656
|
+
TEXTURE_PIXEL_WIDTH: "u_texturePixelWidth",
|
|
2657
|
+
TEXTURE_PIXEL_HEIGHT: "u_texturePixelHeight",
|
|
2658
|
+
TEXTURE_RESOLUTION: "u_textureResolution",
|
|
2659
|
+
// map units per texture pixel
|
|
2660
|
+
TEXTURE_ORIGIN_X: "u_textureOriginX",
|
|
2661
|
+
// map x coordinate of left edge of texture
|
|
2662
|
+
TEXTURE_ORIGIN_Y: "u_textureOriginY"
|
|
2663
|
+
// map y coordinate of top edge of texture
|
|
2664
|
+
});
|
|
2665
|
+
var Attributes = {
|
|
2666
|
+
TEXTURE_COORD: "a_textureCoord"
|
|
2667
|
+
};
|
|
2668
|
+
var attributeDescriptions = [
|
|
2669
|
+
{
|
|
2670
|
+
name: Attributes.TEXTURE_COORD,
|
|
2671
|
+
size: 2,
|
|
2672
|
+
type: AttributeType.FLOAT
|
|
2673
|
+
}
|
|
2674
|
+
];
|
|
2675
|
+
var WebGLTileLayerRenderer = class extends TileLayerBase_default {
|
|
2676
|
+
/**
|
|
2677
|
+
* @param {LayerType} tileLayer Tile layer.
|
|
2678
|
+
* @param {Options} options Options.
|
|
2679
|
+
*/
|
|
2680
|
+
constructor(tileLayer, options) {
|
|
2681
|
+
super(tileLayer, options);
|
|
2682
|
+
this.program_;
|
|
2683
|
+
this.vertexShader_ = options.vertexShader;
|
|
2684
|
+
this.fragmentShader_ = options.fragmentShader;
|
|
2685
|
+
this.indices_ = new Buffer_default(ELEMENT_ARRAY_BUFFER, STATIC_DRAW);
|
|
2686
|
+
this.indices_.fromArray([0, 1, 3, 1, 2, 3]);
|
|
2687
|
+
this.paletteTextures_ = options.paletteTextures || [];
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* @param {Options} options Options.
|
|
2691
|
+
* @override
|
|
2692
|
+
*/
|
|
2693
|
+
reset(options) {
|
|
2694
|
+
super.reset(options);
|
|
2695
|
+
if (this.helper) {
|
|
2696
|
+
const gl = this.helper.getGL();
|
|
2697
|
+
for (const paletteTexture of this.paletteTextures_) {
|
|
2698
|
+
paletteTexture.delete(gl);
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
this.vertexShader_ = options.vertexShader;
|
|
2702
|
+
this.fragmentShader_ = options.fragmentShader;
|
|
2703
|
+
this.paletteTextures_ = options.paletteTextures || [];
|
|
2704
|
+
if (this.helper) {
|
|
2705
|
+
this.program_ = this.helper.getProgram(
|
|
2706
|
+
this.fragmentShader_,
|
|
2707
|
+
this.vertexShader_
|
|
2708
|
+
);
|
|
2709
|
+
const gl = this.helper.getGL();
|
|
2710
|
+
for (const paletteTexture of this.paletteTextures_) {
|
|
2711
|
+
paletteTexture.getTexture(gl);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
/**
|
|
2716
|
+
* @override
|
|
2717
|
+
*/
|
|
2718
|
+
afterHelperCreated() {
|
|
2719
|
+
super.afterHelperCreated();
|
|
2720
|
+
const gl = this.helper.getGL();
|
|
2721
|
+
for (const paletteTexture of this.paletteTextures_) {
|
|
2722
|
+
paletteTexture.getTexture(gl);
|
|
2723
|
+
}
|
|
2724
|
+
this.program_ = this.helper.getProgram(
|
|
2725
|
+
this.fragmentShader_,
|
|
2726
|
+
this.vertexShader_
|
|
2727
|
+
);
|
|
2728
|
+
this.helper.flushBufferData(this.indices_);
|
|
2729
|
+
}
|
|
2730
|
+
/**
|
|
2731
|
+
* @override
|
|
2732
|
+
*/
|
|
2733
|
+
removeHelper() {
|
|
2734
|
+
if (this.helper) {
|
|
2735
|
+
const gl = this.helper.getGL();
|
|
2736
|
+
for (const paletteTexture of this.paletteTextures_) {
|
|
2737
|
+
paletteTexture.delete(gl);
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
super.removeHelper();
|
|
2741
|
+
}
|
|
2742
|
+
/**
|
|
2743
|
+
* @override
|
|
2744
|
+
*/
|
|
2745
|
+
createTileRepresentation(options) {
|
|
2746
|
+
return new TileTexture_default(options);
|
|
2747
|
+
}
|
|
2748
|
+
/**
|
|
2749
|
+
* @override
|
|
2750
|
+
*/
|
|
2751
|
+
beforeTilesRender(frameState, tilesWithAlpha) {
|
|
2752
|
+
super.beforeTilesRender(frameState, tilesWithAlpha);
|
|
2753
|
+
this.helper.useProgram(this.program_, frameState);
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* @override
|
|
2757
|
+
*/
|
|
2758
|
+
renderTile(tileTexture, tileTransform, frameState, renderExtent, tileResolution, tileSize, tileOrigin, tileExtent, depth, gutter, alpha) {
|
|
2759
|
+
const gl = this.helper.getGL();
|
|
2760
|
+
this.helper.bindBuffer(tileTexture.coords);
|
|
2761
|
+
this.helper.bindBuffer(this.indices_);
|
|
2762
|
+
this.helper.enableAttributes(attributeDescriptions);
|
|
2763
|
+
let textureSlot = 0;
|
|
2764
|
+
while (textureSlot < tileTexture.textures.length) {
|
|
2765
|
+
const uniformName = `${Uniforms2.TILE_TEXTURE_ARRAY}[${textureSlot}]`;
|
|
2766
|
+
this.helper.bindTexture(
|
|
2767
|
+
tileTexture.textures[textureSlot],
|
|
2768
|
+
textureSlot,
|
|
2769
|
+
uniformName
|
|
2770
|
+
);
|
|
2771
|
+
++textureSlot;
|
|
2772
|
+
}
|
|
2773
|
+
for (let paletteIndex = 0; paletteIndex < this.paletteTextures_.length; ++paletteIndex) {
|
|
2774
|
+
const paletteTexture = this.paletteTextures_[paletteIndex];
|
|
2775
|
+
const texture = paletteTexture.getTexture(gl);
|
|
2776
|
+
this.helper.bindTexture(texture, textureSlot, paletteTexture.name);
|
|
2777
|
+
++textureSlot;
|
|
2778
|
+
}
|
|
2779
|
+
const viewState = frameState.viewState;
|
|
2780
|
+
const tileWidthWithGutter = tileSize[0] + 2 * gutter;
|
|
2781
|
+
const tileHeightWithGutter = tileSize[1] + 2 * gutter;
|
|
2782
|
+
const tile = tileTexture.tile;
|
|
2783
|
+
const tileCoord = tile.tileCoord;
|
|
2784
|
+
const tileCenterI = tileCoord[1];
|
|
2785
|
+
const tileCenterJ = tileCoord[2];
|
|
2786
|
+
this.helper.setUniformMatrixValue(
|
|
2787
|
+
Uniforms2.TILE_TRANSFORM,
|
|
2788
|
+
fromTransform(this.tempMat4, tileTransform)
|
|
2789
|
+
);
|
|
2790
|
+
this.helper.setUniformFloatValue(Uniforms2.TRANSITION_ALPHA, alpha);
|
|
2791
|
+
this.helper.setUniformFloatValue(Uniforms2.DEPTH, depth);
|
|
2792
|
+
let gutterExtent = renderExtent;
|
|
2793
|
+
if (gutter > 0) {
|
|
2794
|
+
gutterExtent = tileExtent;
|
|
2795
|
+
getIntersection(gutterExtent, renderExtent, gutterExtent);
|
|
2796
|
+
}
|
|
2797
|
+
this.helper.setUniformFloatVec4(Uniforms2.RENDER_EXTENT, gutterExtent);
|
|
2798
|
+
this.helper.setUniformFloatValue(Uniforms2.RESOLUTION, viewState.resolution);
|
|
2799
|
+
this.helper.setUniformFloatValue(Uniforms2.ZOOM, viewState.zoom);
|
|
2800
|
+
this.helper.setUniformFloatValue(
|
|
2801
|
+
Uniforms2.TEXTURE_PIXEL_WIDTH,
|
|
2802
|
+
tileWidthWithGutter
|
|
2803
|
+
);
|
|
2804
|
+
this.helper.setUniformFloatValue(
|
|
2805
|
+
Uniforms2.TEXTURE_PIXEL_HEIGHT,
|
|
2806
|
+
tileHeightWithGutter
|
|
2807
|
+
);
|
|
2808
|
+
this.helper.setUniformFloatValue(
|
|
2809
|
+
Uniforms2.TEXTURE_RESOLUTION,
|
|
2810
|
+
tileResolution
|
|
2811
|
+
);
|
|
2812
|
+
this.helper.setUniformFloatValue(
|
|
2813
|
+
Uniforms2.TEXTURE_ORIGIN_X,
|
|
2814
|
+
tileOrigin[0] + tileCenterI * tileSize[0] * tileResolution - gutter * tileResolution
|
|
2815
|
+
);
|
|
2816
|
+
this.helper.setUniformFloatValue(
|
|
2817
|
+
Uniforms2.TEXTURE_ORIGIN_Y,
|
|
2818
|
+
tileOrigin[1] - tileCenterJ * tileSize[1] * tileResolution + gutter * tileResolution
|
|
2819
|
+
);
|
|
2820
|
+
this.helper.drawElements(0, this.indices_.getSize());
|
|
2821
|
+
}
|
|
2822
|
+
/**
|
|
2823
|
+
* @param {import("../../pixel.js").Pixel} pixel Pixel.
|
|
2824
|
+
* @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView} Data at the pixel location.
|
|
2825
|
+
* @override
|
|
2826
|
+
*/
|
|
2827
|
+
getData(pixel) {
|
|
2828
|
+
const gl = this.helper.getGL();
|
|
2829
|
+
if (!gl) {
|
|
2830
|
+
return null;
|
|
2831
|
+
}
|
|
2832
|
+
const frameState = this.frameState;
|
|
2833
|
+
if (!frameState) {
|
|
2834
|
+
return null;
|
|
2835
|
+
}
|
|
2836
|
+
const layer = this.getLayer();
|
|
2837
|
+
const coordinate = apply(
|
|
2838
|
+
frameState.pixelToCoordinateTransform,
|
|
2839
|
+
pixel.slice()
|
|
2840
|
+
);
|
|
2841
|
+
const viewState = frameState.viewState;
|
|
2842
|
+
const layerExtent = layer.getExtent();
|
|
2843
|
+
if (layerExtent) {
|
|
2844
|
+
if (!containsCoordinate(
|
|
2845
|
+
fromUserExtent(layerExtent, viewState.projection),
|
|
2846
|
+
coordinate
|
|
2847
|
+
)) {
|
|
2848
|
+
return null;
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
const sources = layer.getSources(
|
|
2852
|
+
boundingExtent([coordinate]),
|
|
2853
|
+
viewState.resolution
|
|
2854
|
+
);
|
|
2855
|
+
let i, source, tileGrid;
|
|
2856
|
+
for (i = sources.length - 1; i >= 0; --i) {
|
|
2857
|
+
source = sources[i];
|
|
2858
|
+
if (source.getState() === "ready") {
|
|
2859
|
+
tileGrid = source.getTileGridForProjection(viewState.projection);
|
|
2860
|
+
if (source.getWrapX()) {
|
|
2861
|
+
break;
|
|
2862
|
+
}
|
|
2863
|
+
const gridExtent = tileGrid.getExtent();
|
|
2864
|
+
if (!gridExtent || containsCoordinate(gridExtent, coordinate)) {
|
|
2865
|
+
break;
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
if (i < 0) {
|
|
2870
|
+
return null;
|
|
2871
|
+
}
|
|
2872
|
+
const tileTextureCache = this.tileRepresentationCache;
|
|
2873
|
+
for (let z = tileGrid.getZForResolution(viewState.resolution); z >= tileGrid.getMinZoom(); --z) {
|
|
2874
|
+
const tileCoord = tileGrid.getTileCoordForCoordAndZ(coordinate, z);
|
|
2875
|
+
const cacheKey = getCacheKey(source, tileCoord);
|
|
2876
|
+
if (!tileTextureCache.containsKey(cacheKey)) {
|
|
2877
|
+
continue;
|
|
2878
|
+
}
|
|
2879
|
+
const tileTexture = tileTextureCache.get(cacheKey);
|
|
2880
|
+
const tile = tileTexture.tile;
|
|
2881
|
+
if (tile.getState() === TileState_default.EMPTY) {
|
|
2882
|
+
return null;
|
|
2883
|
+
}
|
|
2884
|
+
if (!tileTexture.loaded) {
|
|
2885
|
+
continue;
|
|
2886
|
+
}
|
|
2887
|
+
const tileOrigin = tileGrid.getOrigin(z);
|
|
2888
|
+
const tileSize = toSize(tileGrid.getTileSize(z));
|
|
2889
|
+
const tileResolution = tileGrid.getResolution(z);
|
|
2890
|
+
const col = (coordinate[0] - tileOrigin[0]) / tileResolution - tileCoord[1] * tileSize[0];
|
|
2891
|
+
const row = (tileOrigin[1] - coordinate[1]) / tileResolution - tileCoord[2] * tileSize[1];
|
|
2892
|
+
return tileTexture.getPixelData(col, row);
|
|
2893
|
+
}
|
|
2894
|
+
return null;
|
|
2895
|
+
}
|
|
2896
|
+
/**
|
|
2897
|
+
* Clean up.
|
|
2898
|
+
* @override
|
|
2899
|
+
*/
|
|
2900
|
+
disposeInternal() {
|
|
2901
|
+
const helper = this.helper;
|
|
2902
|
+
if (helper) {
|
|
2903
|
+
const gl = helper.getGL();
|
|
2904
|
+
for (const paletteTexture of this.paletteTextures_) {
|
|
2905
|
+
paletteTexture.delete(gl);
|
|
2906
|
+
}
|
|
2907
|
+
this.paletteTextures_.length = 0;
|
|
2908
|
+
gl.deleteProgram(this.program_);
|
|
2909
|
+
delete this.program_;
|
|
2910
|
+
helper.deleteBuffer(this.indices_);
|
|
2911
|
+
}
|
|
2912
|
+
super.disposeInternal();
|
|
2913
|
+
delete this.indices_;
|
|
2914
|
+
}
|
|
2915
|
+
};
|
|
2916
|
+
var TileLayer_default = WebGLTileLayerRenderer;
|
|
2917
|
+
|
|
2918
|
+
// node_modules/ol/webgl/PaletteTexture.js
|
|
2919
|
+
init_dirname();
|
|
2920
|
+
init_buffer();
|
|
2921
|
+
init_process();
|
|
2922
|
+
var PaletteTexture = class {
|
|
2923
|
+
/**
|
|
2924
|
+
* @param {string} name The name of the texture.
|
|
2925
|
+
* @param {Uint8Array} data The texture data.
|
|
2926
|
+
*/
|
|
2927
|
+
constructor(name, data) {
|
|
2928
|
+
this.name = name;
|
|
2929
|
+
this.data = data;
|
|
2930
|
+
this.texture_ = null;
|
|
2931
|
+
}
|
|
2932
|
+
/**
|
|
2933
|
+
* @param {WebGLRenderingContext} gl Rendering context.
|
|
2934
|
+
* @return {WebGLTexture} The texture.
|
|
2935
|
+
*/
|
|
2936
|
+
getTexture(gl) {
|
|
2937
|
+
if (!this.texture_) {
|
|
2938
|
+
const texture = gl.createTexture();
|
|
2939
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
2940
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
2941
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
2942
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
2943
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
2944
|
+
gl.texImage2D(
|
|
2945
|
+
gl.TEXTURE_2D,
|
|
2946
|
+
0,
|
|
2947
|
+
gl.RGBA,
|
|
2948
|
+
this.data.length / 4,
|
|
2949
|
+
1,
|
|
2950
|
+
0,
|
|
2951
|
+
gl.RGBA,
|
|
2952
|
+
gl.UNSIGNED_BYTE,
|
|
2953
|
+
this.data
|
|
2954
|
+
);
|
|
2955
|
+
this.texture_ = texture;
|
|
2956
|
+
}
|
|
2957
|
+
return this.texture_;
|
|
2958
|
+
}
|
|
2959
|
+
/**
|
|
2960
|
+
* @param {WebGLRenderingContext} gl Rendering context.
|
|
2961
|
+
*/
|
|
2962
|
+
delete(gl) {
|
|
2963
|
+
if (this.texture_) {
|
|
2964
|
+
gl.deleteTexture(this.texture_);
|
|
2965
|
+
}
|
|
2966
|
+
this.texture_ = null;
|
|
2967
|
+
}
|
|
2968
|
+
};
|
|
2969
|
+
var PaletteTexture_default = PaletteTexture;
|
|
2970
|
+
|
|
2971
|
+
// node_modules/ol/expr/gpu.js
|
|
2972
|
+
function computeOperatorFunctionName(operator, context) {
|
|
2973
|
+
return `operator_${operator}_${Object.keys(context.functions).length}`;
|
|
2974
|
+
}
|
|
2975
|
+
function numberToGlsl(v) {
|
|
2976
|
+
const s2 = v.toString();
|
|
2977
|
+
return s2.includes(".") ? s2 : s2 + ".0";
|
|
2978
|
+
}
|
|
2979
|
+
function arrayToGlsl(array) {
|
|
2980
|
+
if (array.length < 2 || array.length > 4) {
|
|
2981
|
+
throw new Error(
|
|
2982
|
+
"`formatArray` can only output `vec2`, `vec3` or `vec4` arrays."
|
|
2983
|
+
);
|
|
2984
|
+
}
|
|
2985
|
+
return `vec${array.length}(${array.map(numberToGlsl).join(", ")})`;
|
|
2986
|
+
}
|
|
2987
|
+
function colorToGlsl(color) {
|
|
2988
|
+
const array = asArray(color);
|
|
2989
|
+
const alpha = array.length > 3 ? array[3] : 1;
|
|
2990
|
+
return arrayToGlsl([array[0] / 255, array[1] / 255, array[2] / 255, alpha]);
|
|
2991
|
+
}
|
|
2992
|
+
function sizeToGlsl(size) {
|
|
2993
|
+
const array = toSize(size);
|
|
2994
|
+
return arrayToGlsl(array);
|
|
2995
|
+
}
|
|
2996
|
+
var stringToFloatMap = {};
|
|
2997
|
+
var stringToFloatCounter = 0;
|
|
2998
|
+
function getStringNumberEquivalent(string) {
|
|
2999
|
+
if (!(string in stringToFloatMap)) {
|
|
3000
|
+
stringToFloatMap[string] = stringToFloatCounter++;
|
|
3001
|
+
}
|
|
3002
|
+
return stringToFloatMap[string];
|
|
3003
|
+
}
|
|
3004
|
+
function stringToGlsl(string) {
|
|
3005
|
+
return numberToGlsl(getStringNumberEquivalent(string));
|
|
3006
|
+
}
|
|
3007
|
+
function uniformNameForVariable(variableName) {
|
|
3008
|
+
return "u_var_" + variableName;
|
|
3009
|
+
}
|
|
3010
|
+
function newCompilationContext() {
|
|
3011
|
+
return {
|
|
3012
|
+
variables: {},
|
|
3013
|
+
properties: {},
|
|
3014
|
+
functions: {},
|
|
3015
|
+
bandCount: 0,
|
|
3016
|
+
featureId: false,
|
|
3017
|
+
geometryType: false
|
|
3018
|
+
};
|
|
3019
|
+
}
|
|
3020
|
+
var GET_BAND_VALUE_FUNC = "getBandValue";
|
|
3021
|
+
var PALETTE_TEXTURE_ARRAY = "u_paletteTextures";
|
|
3022
|
+
var FEATURE_ID_PROPERTY_NAME = "featureId";
|
|
3023
|
+
var GEOMETRY_TYPE_PROPERTY_NAME = "geometryType";
|
|
3024
|
+
var UNDEFINED_PROP_VALUE = -9999999;
|
|
3025
|
+
function buildExpression(encoded, type, parsingContext, compilationContext) {
|
|
3026
|
+
const expression = parse(encoded, type, parsingContext);
|
|
3027
|
+
return compile(expression, type, compilationContext);
|
|
3028
|
+
}
|
|
3029
|
+
function createCompiler(output) {
|
|
3030
|
+
return (context, expression, type) => {
|
|
3031
|
+
const length = expression.args.length;
|
|
3032
|
+
const args = new Array(length);
|
|
3033
|
+
for (let i = 0; i < length; ++i) {
|
|
3034
|
+
args[i] = compile(expression.args[i], type, context);
|
|
3035
|
+
}
|
|
3036
|
+
return output(args, context);
|
|
3037
|
+
};
|
|
3038
|
+
}
|
|
3039
|
+
var compilers = {
|
|
3040
|
+
[Ops.Get]: (context, expression) => {
|
|
3041
|
+
const firstArg = (
|
|
3042
|
+
/** @type {LiteralExpression} */
|
|
3043
|
+
expression.args[0]
|
|
3044
|
+
);
|
|
3045
|
+
const propName = (
|
|
3046
|
+
/** @type {string} */
|
|
3047
|
+
firstArg.value
|
|
3048
|
+
);
|
|
3049
|
+
const isExisting = propName in context.properties;
|
|
3050
|
+
if (!isExisting) {
|
|
3051
|
+
context.properties[propName] = {
|
|
3052
|
+
name: propName,
|
|
3053
|
+
type: expression.type
|
|
3054
|
+
};
|
|
3055
|
+
}
|
|
3056
|
+
let result = "a_prop_" + propName;
|
|
3057
|
+
if (isType(expression.type, BooleanType)) {
|
|
3058
|
+
result = `(${result} > 0.0)`;
|
|
3059
|
+
}
|
|
3060
|
+
return result;
|
|
3061
|
+
},
|
|
3062
|
+
[Ops.Id]: (context) => {
|
|
3063
|
+
context.featureId = true;
|
|
3064
|
+
return "a_" + FEATURE_ID_PROPERTY_NAME;
|
|
3065
|
+
},
|
|
3066
|
+
[Ops.GeometryType]: (context) => {
|
|
3067
|
+
context.geometryType = true;
|
|
3068
|
+
return "a_" + GEOMETRY_TYPE_PROPERTY_NAME;
|
|
3069
|
+
},
|
|
3070
|
+
[Ops.LineMetric]: () => "currentLineMetric",
|
|
3071
|
+
// this variable is assumed to always be present in shaders, default is 0.
|
|
3072
|
+
[Ops.Var]: (context, expression) => {
|
|
3073
|
+
const firstArg = (
|
|
3074
|
+
/** @type {LiteralExpression} */
|
|
3075
|
+
expression.args[0]
|
|
3076
|
+
);
|
|
3077
|
+
const varName = (
|
|
3078
|
+
/** @type {string} */
|
|
3079
|
+
firstArg.value
|
|
3080
|
+
);
|
|
3081
|
+
const isExisting = varName in context.variables;
|
|
3082
|
+
if (!isExisting) {
|
|
3083
|
+
context.variables[varName] = {
|
|
3084
|
+
name: varName,
|
|
3085
|
+
type: expression.type
|
|
3086
|
+
};
|
|
3087
|
+
}
|
|
3088
|
+
let result = uniformNameForVariable(varName);
|
|
3089
|
+
if (isType(expression.type, BooleanType)) {
|
|
3090
|
+
result = `(${result} > 0.0)`;
|
|
3091
|
+
}
|
|
3092
|
+
return result;
|
|
3093
|
+
},
|
|
3094
|
+
[Ops.Has]: (context, expression) => {
|
|
3095
|
+
const firstArg = (
|
|
3096
|
+
/** @type {LiteralExpression} */
|
|
3097
|
+
expression.args[0]
|
|
3098
|
+
);
|
|
3099
|
+
const propName = (
|
|
3100
|
+
/** @type {string} */
|
|
3101
|
+
firstArg.value
|
|
3102
|
+
);
|
|
3103
|
+
const isExisting = propName in context.properties;
|
|
3104
|
+
if (!isExisting) {
|
|
3105
|
+
context.properties[propName] = {
|
|
3106
|
+
name: propName,
|
|
3107
|
+
type: expression.type
|
|
3108
|
+
};
|
|
3109
|
+
}
|
|
3110
|
+
return `(a_prop_${propName} != ${numberToGlsl(UNDEFINED_PROP_VALUE)})`;
|
|
3111
|
+
},
|
|
3112
|
+
[Ops.Resolution]: () => "u_resolution",
|
|
3113
|
+
[Ops.Zoom]: () => "u_zoom",
|
|
3114
|
+
[Ops.Time]: () => "u_time",
|
|
3115
|
+
[Ops.Any]: createCompiler((compiledArgs) => `(${compiledArgs.join(` || `)})`),
|
|
3116
|
+
[Ops.All]: createCompiler((compiledArgs) => `(${compiledArgs.join(` && `)})`),
|
|
3117
|
+
[Ops.Not]: createCompiler(([value]) => `(!${value})`),
|
|
3118
|
+
[Ops.Equal]: createCompiler(
|
|
3119
|
+
([firstValue, secondValue]) => `(${firstValue} == ${secondValue})`
|
|
3120
|
+
),
|
|
3121
|
+
[Ops.NotEqual]: createCompiler(
|
|
3122
|
+
([firstValue, secondValue]) => `(${firstValue} != ${secondValue})`
|
|
3123
|
+
),
|
|
3124
|
+
[Ops.GreaterThan]: createCompiler(
|
|
3125
|
+
([firstValue, secondValue]) => `(${firstValue} > ${secondValue})`
|
|
3126
|
+
),
|
|
3127
|
+
[Ops.GreaterThanOrEqualTo]: createCompiler(
|
|
3128
|
+
([firstValue, secondValue]) => `(${firstValue} >= ${secondValue})`
|
|
3129
|
+
),
|
|
3130
|
+
[Ops.LessThan]: createCompiler(
|
|
3131
|
+
([firstValue, secondValue]) => `(${firstValue} < ${secondValue})`
|
|
3132
|
+
),
|
|
3133
|
+
[Ops.LessThanOrEqualTo]: createCompiler(
|
|
3134
|
+
([firstValue, secondValue]) => `(${firstValue} <= ${secondValue})`
|
|
3135
|
+
),
|
|
3136
|
+
[Ops.Multiply]: createCompiler(
|
|
3137
|
+
(compiledArgs) => `(${compiledArgs.join(" * ")})`
|
|
3138
|
+
),
|
|
3139
|
+
[Ops.Divide]: createCompiler(
|
|
3140
|
+
([firstValue, secondValue]) => `(${firstValue} / ${secondValue})`
|
|
3141
|
+
),
|
|
3142
|
+
[Ops.Add]: createCompiler((compiledArgs) => `(${compiledArgs.join(" + ")})`),
|
|
3143
|
+
[Ops.Subtract]: createCompiler(
|
|
3144
|
+
([firstValue, secondValue]) => `(${firstValue} - ${secondValue})`
|
|
3145
|
+
),
|
|
3146
|
+
[Ops.Clamp]: createCompiler(
|
|
3147
|
+
([value, min, max]) => `clamp(${value}, ${min}, ${max})`
|
|
3148
|
+
),
|
|
3149
|
+
[Ops.Mod]: createCompiler(([value, modulo]) => `mod(${value}, ${modulo})`),
|
|
3150
|
+
[Ops.Pow]: createCompiler(([value, power]) => `pow(${value}, ${power})`),
|
|
3151
|
+
[Ops.Abs]: createCompiler(([value]) => `abs(${value})`),
|
|
3152
|
+
[Ops.Floor]: createCompiler(([value]) => `floor(${value})`),
|
|
3153
|
+
[Ops.Ceil]: createCompiler(([value]) => `ceil(${value})`),
|
|
3154
|
+
[Ops.Round]: createCompiler(([value]) => `floor(${value} + 0.5)`),
|
|
3155
|
+
[Ops.Sin]: createCompiler(([value]) => `sin(${value})`),
|
|
3156
|
+
[Ops.Cos]: createCompiler(([value]) => `cos(${value})`),
|
|
3157
|
+
[Ops.Atan]: createCompiler(([firstValue, secondValue]) => {
|
|
3158
|
+
return secondValue !== void 0 ? `atan(${firstValue}, ${secondValue})` : `atan(${firstValue})`;
|
|
3159
|
+
}),
|
|
3160
|
+
[Ops.Sqrt]: createCompiler(([value]) => `sqrt(${value})`),
|
|
3161
|
+
[Ops.Match]: createCompiler((compiledArgs) => {
|
|
3162
|
+
const input = compiledArgs[0];
|
|
3163
|
+
const fallback = compiledArgs[compiledArgs.length - 1];
|
|
3164
|
+
let result = null;
|
|
3165
|
+
for (let i = compiledArgs.length - 3; i >= 1; i -= 2) {
|
|
3166
|
+
const match = compiledArgs[i];
|
|
3167
|
+
const output = compiledArgs[i + 1];
|
|
3168
|
+
result = `(${input} == ${match} ? ${output} : ${result || fallback})`;
|
|
3169
|
+
}
|
|
3170
|
+
return result;
|
|
3171
|
+
}),
|
|
3172
|
+
[Ops.Between]: createCompiler(
|
|
3173
|
+
([value, min, max]) => `(${value} >= ${min} && ${value} <= ${max})`
|
|
3174
|
+
),
|
|
3175
|
+
[Ops.Interpolate]: createCompiler(([exponent, input, ...compiledArgs]) => {
|
|
3176
|
+
let result = "";
|
|
3177
|
+
for (let i = 0; i < compiledArgs.length - 2; i += 2) {
|
|
3178
|
+
const stop1 = compiledArgs[i];
|
|
3179
|
+
const output1 = result || compiledArgs[i + 1];
|
|
3180
|
+
const stop2 = compiledArgs[i + 2];
|
|
3181
|
+
const output2 = compiledArgs[i + 3];
|
|
3182
|
+
let ratio;
|
|
3183
|
+
if (exponent === numberToGlsl(1)) {
|
|
3184
|
+
ratio = `(${input} - ${stop1}) / (${stop2} - ${stop1})`;
|
|
3185
|
+
} else {
|
|
3186
|
+
ratio = `(pow(${exponent}, (${input} - ${stop1})) - 1.0) / (pow(${exponent}, (${stop2} - ${stop1})) - 1.0)`;
|
|
3187
|
+
}
|
|
3188
|
+
result = `mix(${output1}, ${output2}, clamp(${ratio}, 0.0, 1.0))`;
|
|
3189
|
+
}
|
|
3190
|
+
return result;
|
|
3191
|
+
}),
|
|
3192
|
+
[Ops.Case]: createCompiler((compiledArgs) => {
|
|
3193
|
+
const fallback = compiledArgs[compiledArgs.length - 1];
|
|
3194
|
+
let result = null;
|
|
3195
|
+
for (let i = compiledArgs.length - 3; i >= 0; i -= 2) {
|
|
3196
|
+
const condition = compiledArgs[i];
|
|
3197
|
+
const output = compiledArgs[i + 1];
|
|
3198
|
+
result = `(${condition} ? ${output} : ${result || fallback})`;
|
|
3199
|
+
}
|
|
3200
|
+
return result;
|
|
3201
|
+
}),
|
|
3202
|
+
[Ops.In]: createCompiler(([needle, ...haystack], context) => {
|
|
3203
|
+
const funcName = computeOperatorFunctionName("in", context);
|
|
3204
|
+
const tests = [];
|
|
3205
|
+
for (let i = 0; i < haystack.length; i += 1) {
|
|
3206
|
+
tests.push(` if (inputValue == ${haystack[i]}) { return true; }`);
|
|
3207
|
+
}
|
|
3208
|
+
context.functions[funcName] = `bool ${funcName}(float inputValue) {
|
|
3209
|
+
${tests.join("\n")}
|
|
3210
|
+
return false;
|
|
3211
|
+
}`;
|
|
3212
|
+
return `${funcName}(${needle})`;
|
|
3213
|
+
}),
|
|
3214
|
+
[Ops.Array]: createCompiler(
|
|
3215
|
+
(args) => `vec${args.length}(${args.join(", ")})`
|
|
3216
|
+
),
|
|
3217
|
+
[Ops.Color]: createCompiler((compiledArgs) => {
|
|
3218
|
+
if (compiledArgs.length === 1) {
|
|
3219
|
+
return `vec4(vec3(${compiledArgs[0]} / 255.0), 1.0)`;
|
|
3220
|
+
}
|
|
3221
|
+
if (compiledArgs.length === 2) {
|
|
3222
|
+
return `vec4(vec3(${compiledArgs[0]} / 255.0), ${compiledArgs[1]})`;
|
|
3223
|
+
}
|
|
3224
|
+
const rgb = compiledArgs.slice(0, 3).map((color) => `${color} / 255.0`);
|
|
3225
|
+
if (compiledArgs.length === 3) {
|
|
3226
|
+
return `vec4(${rgb.join(", ")}, 1.0)`;
|
|
3227
|
+
}
|
|
3228
|
+
const alpha = compiledArgs[3];
|
|
3229
|
+
return `vec4(${rgb.join(", ")}, ${alpha})`;
|
|
3230
|
+
}),
|
|
3231
|
+
[Ops.Band]: createCompiler(([band, xOffset, yOffset], context) => {
|
|
3232
|
+
if (!(GET_BAND_VALUE_FUNC in context.functions)) {
|
|
3233
|
+
let ifBlocks = "";
|
|
3234
|
+
const bandCount = context.bandCount || 1;
|
|
3235
|
+
for (let i = 0; i < bandCount; i++) {
|
|
3236
|
+
const colorIndex = Math.floor(i / 4);
|
|
3237
|
+
let bandIndex = i % 4;
|
|
3238
|
+
if (i === bandCount - 1 && bandIndex === 1) {
|
|
3239
|
+
bandIndex = 3;
|
|
3240
|
+
}
|
|
3241
|
+
const textureName = `${Uniforms2.TILE_TEXTURE_ARRAY}[${colorIndex}]`;
|
|
3242
|
+
ifBlocks += ` if (band == ${i + 1}.0) {
|
|
3243
|
+
return texture2D(${textureName}, v_textureCoord + vec2(dx, dy))[${bandIndex}];
|
|
3244
|
+
}
|
|
3245
|
+
`;
|
|
3246
|
+
}
|
|
3247
|
+
context.functions[GET_BAND_VALUE_FUNC] = `float getBandValue(float band, float xOffset, float yOffset) {
|
|
3248
|
+
float dx = xOffset / ${Uniforms2.TEXTURE_PIXEL_WIDTH};
|
|
3249
|
+
float dy = yOffset / ${Uniforms2.TEXTURE_PIXEL_HEIGHT};
|
|
3250
|
+
${ifBlocks}
|
|
3251
|
+
}`;
|
|
3252
|
+
}
|
|
3253
|
+
return `${GET_BAND_VALUE_FUNC}(${band}, ${xOffset != null ? xOffset : "0.0"}, ${yOffset != null ? yOffset : "0.0"})`;
|
|
3254
|
+
}),
|
|
3255
|
+
[Ops.Palette]: (context, expression) => {
|
|
3256
|
+
const [index, ...colors] = expression.args;
|
|
3257
|
+
const numColors = colors.length;
|
|
3258
|
+
const palette = new Uint8Array(numColors * 4);
|
|
3259
|
+
for (let i = 0; i < colors.length; i++) {
|
|
3260
|
+
const parsedValue = (
|
|
3261
|
+
/** @type {string | Array<number>} */
|
|
3262
|
+
/** @type {LiteralExpression} */
|
|
3263
|
+
colors[i].value
|
|
3264
|
+
);
|
|
3265
|
+
const color = asArray(parsedValue);
|
|
3266
|
+
const offset = i * 4;
|
|
3267
|
+
palette[offset] = color[0];
|
|
3268
|
+
palette[offset + 1] = color[1];
|
|
3269
|
+
palette[offset + 2] = color[2];
|
|
3270
|
+
palette[offset + 3] = color[3] * 255;
|
|
3271
|
+
}
|
|
3272
|
+
if (!context.paletteTextures) {
|
|
3273
|
+
context.paletteTextures = [];
|
|
3274
|
+
}
|
|
3275
|
+
const paletteName = `${PALETTE_TEXTURE_ARRAY}[${context.paletteTextures.length}]`;
|
|
3276
|
+
const paletteTexture = new PaletteTexture_default(paletteName, palette);
|
|
3277
|
+
context.paletteTextures.push(paletteTexture);
|
|
3278
|
+
const compiledIndex = compile(index, NumberType, context);
|
|
3279
|
+
return `texture2D(${paletteName}, vec2((${compiledIndex} + 0.5) / ${numColors}.0, 0.5))`;
|
|
3280
|
+
}
|
|
3281
|
+
// TODO: unimplemented
|
|
3282
|
+
// Ops.Number
|
|
3283
|
+
// Ops.String
|
|
3284
|
+
// Ops.Coalesce
|
|
3285
|
+
// Ops.Concat
|
|
3286
|
+
// Ops.ToString
|
|
3287
|
+
};
|
|
3288
|
+
function compile(expression, returnType, context) {
|
|
3289
|
+
if (expression instanceof CallExpression) {
|
|
3290
|
+
const compiler = compilers[expression.operator];
|
|
3291
|
+
if (compiler === void 0) {
|
|
3292
|
+
throw new Error(
|
|
3293
|
+
`No compiler defined for this operator: ${JSON.stringify(
|
|
3294
|
+
expression.operator
|
|
3295
|
+
)}`
|
|
3296
|
+
);
|
|
3297
|
+
}
|
|
3298
|
+
return compiler(context, expression, returnType);
|
|
3299
|
+
}
|
|
3300
|
+
if ((expression.type & NumberType) > 0) {
|
|
3301
|
+
return numberToGlsl(
|
|
3302
|
+
/** @type {number} */
|
|
3303
|
+
expression.value
|
|
3304
|
+
);
|
|
3305
|
+
}
|
|
3306
|
+
if ((expression.type & BooleanType) > 0) {
|
|
3307
|
+
return expression.value.toString();
|
|
3308
|
+
}
|
|
3309
|
+
if ((expression.type & StringType) > 0) {
|
|
3310
|
+
return stringToGlsl(expression.value.toString());
|
|
3311
|
+
}
|
|
3312
|
+
if ((expression.type & ColorType) > 0) {
|
|
3313
|
+
return colorToGlsl(
|
|
3314
|
+
/** @type {Array<number> | string} */
|
|
3315
|
+
expression.value
|
|
3316
|
+
);
|
|
3317
|
+
}
|
|
3318
|
+
if ((expression.type & NumberArrayType) > 0) {
|
|
3319
|
+
return arrayToGlsl(
|
|
3320
|
+
/** @type {Array<number>} */
|
|
3321
|
+
expression.value
|
|
3322
|
+
);
|
|
3323
|
+
}
|
|
3324
|
+
if ((expression.type & SizeType) > 0) {
|
|
3325
|
+
return sizeToGlsl(
|
|
3326
|
+
/** @type {number|import('../size.js').Size} */
|
|
3327
|
+
expression.value
|
|
3328
|
+
);
|
|
3329
|
+
}
|
|
3330
|
+
throw new Error(
|
|
3331
|
+
`Unexpected expression ${expression.value} (expected type ${typeName(
|
|
3332
|
+
returnType
|
|
3333
|
+
)})`
|
|
3334
|
+
);
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
// node_modules/ol/render/webgl/compileUtil.js
|
|
3338
|
+
init_dirname();
|
|
3339
|
+
init_buffer();
|
|
3340
|
+
init_process();
|
|
3341
|
+
function expressionToGlsl(compilationContext, value, expectedType) {
|
|
3342
|
+
const parsingContext = newParsingContext();
|
|
3343
|
+
return buildExpression(
|
|
3344
|
+
value,
|
|
3345
|
+
expectedType,
|
|
3346
|
+
parsingContext,
|
|
3347
|
+
compilationContext
|
|
3348
|
+
);
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
// node_modules/ol/layer/WebGLTile.js
|
|
3352
|
+
function parseStyle(style, bandCount) {
|
|
3353
|
+
const vertexShader = `
|
|
3354
|
+
attribute vec2 ${Attributes.TEXTURE_COORD};
|
|
3355
|
+
uniform mat4 ${Uniforms2.TILE_TRANSFORM};
|
|
3356
|
+
uniform float ${Uniforms2.TEXTURE_PIXEL_WIDTH};
|
|
3357
|
+
uniform float ${Uniforms2.TEXTURE_PIXEL_HEIGHT};
|
|
3358
|
+
uniform float ${Uniforms2.TEXTURE_RESOLUTION};
|
|
3359
|
+
uniform float ${Uniforms2.TEXTURE_ORIGIN_X};
|
|
3360
|
+
uniform float ${Uniforms2.TEXTURE_ORIGIN_Y};
|
|
3361
|
+
uniform float ${Uniforms2.DEPTH};
|
|
3362
|
+
|
|
3363
|
+
varying vec2 v_textureCoord;
|
|
3364
|
+
varying vec2 v_mapCoord;
|
|
3365
|
+
|
|
3366
|
+
void main() {
|
|
3367
|
+
v_textureCoord = ${Attributes.TEXTURE_COORD};
|
|
3368
|
+
v_mapCoord = vec2(
|
|
3369
|
+
${Uniforms2.TEXTURE_ORIGIN_X} + ${Uniforms2.TEXTURE_RESOLUTION} * ${Uniforms2.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],
|
|
3370
|
+
${Uniforms2.TEXTURE_ORIGIN_Y} - ${Uniforms2.TEXTURE_RESOLUTION} * ${Uniforms2.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]
|
|
3371
|
+
);
|
|
3372
|
+
gl_Position = ${Uniforms2.TILE_TRANSFORM} * vec4(${Attributes.TEXTURE_COORD}, ${Uniforms2.DEPTH}, 1.0);
|
|
3373
|
+
}
|
|
3374
|
+
`;
|
|
3375
|
+
const context = __spreadProps(__spreadValues({}, newCompilationContext()), {
|
|
3376
|
+
bandCount
|
|
3377
|
+
});
|
|
3378
|
+
const pipeline = [];
|
|
3379
|
+
if (style.color !== void 0) {
|
|
3380
|
+
const color = expressionToGlsl(context, style.color, ColorType);
|
|
3381
|
+
pipeline.push(`color = ${color};`);
|
|
3382
|
+
}
|
|
3383
|
+
if (style.contrast !== void 0) {
|
|
3384
|
+
const contrast = expressionToGlsl(context, style.contrast, NumberType);
|
|
3385
|
+
pipeline.push(
|
|
3386
|
+
`color.rgb = clamp((${contrast} + 1.0) * color.rgb - (${contrast} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`
|
|
3387
|
+
);
|
|
3388
|
+
}
|
|
3389
|
+
if (style.exposure !== void 0) {
|
|
3390
|
+
const exposure = expressionToGlsl(context, style.exposure, NumberType);
|
|
3391
|
+
pipeline.push(
|
|
3392
|
+
`color.rgb = clamp((${exposure} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`
|
|
3393
|
+
);
|
|
3394
|
+
}
|
|
3395
|
+
if (style.saturation !== void 0) {
|
|
3396
|
+
const saturation = expressionToGlsl(context, style.saturation, NumberType);
|
|
3397
|
+
pipeline.push(`
|
|
3398
|
+
float saturation = ${saturation} + 1.0;
|
|
3399
|
+
float sr = (1.0 - saturation) * 0.2126;
|
|
3400
|
+
float sg = (1.0 - saturation) * 0.7152;
|
|
3401
|
+
float sb = (1.0 - saturation) * 0.0722;
|
|
3402
|
+
mat3 saturationMatrix = mat3(
|
|
3403
|
+
sr + saturation, sr, sr,
|
|
3404
|
+
sg, sg + saturation, sg,
|
|
3405
|
+
sb, sb, sb + saturation
|
|
3406
|
+
);
|
|
3407
|
+
color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));
|
|
3408
|
+
`);
|
|
3409
|
+
}
|
|
3410
|
+
if (style.gamma !== void 0) {
|
|
3411
|
+
const gamma = expressionToGlsl(context, style.gamma, NumberType);
|
|
3412
|
+
pipeline.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${gamma}));`);
|
|
3413
|
+
}
|
|
3414
|
+
if (style.brightness !== void 0) {
|
|
3415
|
+
const brightness = expressionToGlsl(context, style.brightness, NumberType);
|
|
3416
|
+
pipeline.push(
|
|
3417
|
+
`color.rgb = clamp(color.rgb + ${brightness}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`
|
|
3418
|
+
);
|
|
3419
|
+
}
|
|
3420
|
+
const uniforms = {};
|
|
3421
|
+
const numVariables = Object.keys(context.variables).length;
|
|
3422
|
+
if (numVariables > 1 && !style.variables) {
|
|
3423
|
+
throw new Error(
|
|
3424
|
+
`Missing variables in style (expected ${context.variables})`
|
|
3425
|
+
);
|
|
3426
|
+
}
|
|
3427
|
+
for (let i = 0; i < numVariables; ++i) {
|
|
3428
|
+
const variable = context.variables[Object.keys(context.variables)[i]];
|
|
3429
|
+
if (!(variable.name in style.variables)) {
|
|
3430
|
+
throw new Error(`Missing '${variable.name}' in style variables`);
|
|
3431
|
+
}
|
|
3432
|
+
const uniformName = uniformNameForVariable(variable.name);
|
|
3433
|
+
uniforms[uniformName] = function() {
|
|
3434
|
+
let value = style.variables[variable.name];
|
|
3435
|
+
if (typeof value === "string") {
|
|
3436
|
+
value = getStringNumberEquivalent(value);
|
|
3437
|
+
}
|
|
3438
|
+
return value !== void 0 ? value : -9999999;
|
|
3439
|
+
};
|
|
3440
|
+
}
|
|
3441
|
+
const uniformDeclarations = Object.keys(uniforms).map(function(name) {
|
|
3442
|
+
return `uniform float ${name};`;
|
|
3443
|
+
});
|
|
3444
|
+
const textureCount = Math.ceil(bandCount / 4);
|
|
3445
|
+
uniformDeclarations.push(
|
|
3446
|
+
`uniform sampler2D ${Uniforms2.TILE_TEXTURE_ARRAY}[${textureCount}];`
|
|
3447
|
+
);
|
|
3448
|
+
if (context.paletteTextures) {
|
|
3449
|
+
uniformDeclarations.push(
|
|
3450
|
+
`uniform sampler2D ${PALETTE_TEXTURE_ARRAY}[${context.paletteTextures.length}];`
|
|
3451
|
+
);
|
|
3452
|
+
}
|
|
3453
|
+
const functionDefintions = Object.keys(context.functions).map(
|
|
3454
|
+
function(name) {
|
|
3455
|
+
return context.functions[name];
|
|
3456
|
+
}
|
|
3457
|
+
);
|
|
3458
|
+
const fragmentShader = `
|
|
3459
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
3460
|
+
precision highp float;
|
|
3461
|
+
#else
|
|
3462
|
+
precision mediump float;
|
|
3463
|
+
#endif
|
|
3464
|
+
|
|
3465
|
+
varying vec2 v_textureCoord;
|
|
3466
|
+
varying vec2 v_mapCoord;
|
|
3467
|
+
uniform vec4 ${Uniforms2.RENDER_EXTENT};
|
|
3468
|
+
uniform float ${Uniforms2.TRANSITION_ALPHA};
|
|
3469
|
+
uniform float ${Uniforms2.TEXTURE_PIXEL_WIDTH};
|
|
3470
|
+
uniform float ${Uniforms2.TEXTURE_PIXEL_HEIGHT};
|
|
3471
|
+
uniform float ${Uniforms2.RESOLUTION};
|
|
3472
|
+
uniform float ${Uniforms2.ZOOM};
|
|
3473
|
+
|
|
3474
|
+
${uniformDeclarations.join("\n")}
|
|
3475
|
+
|
|
3476
|
+
${functionDefintions.join("\n")}
|
|
3477
|
+
|
|
3478
|
+
void main() {
|
|
3479
|
+
if (
|
|
3480
|
+
v_mapCoord[0] < ${Uniforms2.RENDER_EXTENT}[0] ||
|
|
3481
|
+
v_mapCoord[1] < ${Uniforms2.RENDER_EXTENT}[1] ||
|
|
3482
|
+
v_mapCoord[0] > ${Uniforms2.RENDER_EXTENT}[2] ||
|
|
3483
|
+
v_mapCoord[1] > ${Uniforms2.RENDER_EXTENT}[3]
|
|
3484
|
+
) {
|
|
3485
|
+
discard;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
vec4 color = texture2D(${Uniforms2.TILE_TEXTURE_ARRAY}[0], v_textureCoord);
|
|
3489
|
+
|
|
3490
|
+
${pipeline.join("\n")}
|
|
3491
|
+
|
|
3492
|
+
gl_FragColor = color;
|
|
3493
|
+
gl_FragColor.rgb *= gl_FragColor.a;
|
|
3494
|
+
gl_FragColor *= ${Uniforms2.TRANSITION_ALPHA};
|
|
3495
|
+
}`;
|
|
3496
|
+
return {
|
|
3497
|
+
vertexShader,
|
|
3498
|
+
fragmentShader,
|
|
3499
|
+
uniforms,
|
|
3500
|
+
paletteTextures: context.paletteTextures
|
|
3501
|
+
};
|
|
3502
|
+
}
|
|
3503
|
+
var WebGLTileLayer = class extends BaseTile_default {
|
|
3504
|
+
/**
|
|
3505
|
+
* @param {Options} [options] Tile layer options.
|
|
3506
|
+
*/
|
|
3507
|
+
constructor(options) {
|
|
3508
|
+
options = options ? Object.assign({}, options) : {};
|
|
3509
|
+
const style = options.style || {};
|
|
3510
|
+
delete options.style;
|
|
3511
|
+
super(options);
|
|
3512
|
+
this.sources_ = options.sources;
|
|
3513
|
+
this.renderedSource_ = null;
|
|
3514
|
+
this.renderedResolution_ = NaN;
|
|
3515
|
+
this.style_ = style;
|
|
3516
|
+
this.styleVariables_ = this.style_.variables || {};
|
|
3517
|
+
this.handleSourceUpdate_();
|
|
3518
|
+
this.addChangeListener(Property_default.SOURCE, this.handleSourceUpdate_);
|
|
3519
|
+
}
|
|
3520
|
+
/**
|
|
3521
|
+
* Gets the sources for this layer, for a given extent and resolution.
|
|
3522
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
3523
|
+
* @param {number} resolution Resolution.
|
|
3524
|
+
* @return {Array<SourceType>} Sources.
|
|
3525
|
+
*/
|
|
3526
|
+
getSources(extent, resolution) {
|
|
3527
|
+
const source = this.getSource();
|
|
3528
|
+
return this.sources_ ? typeof this.sources_ === "function" ? this.sources_(extent, resolution) : this.sources_ : source ? [source] : [];
|
|
3529
|
+
}
|
|
3530
|
+
/**
|
|
3531
|
+
* @return {SourceType} The source being rendered.
|
|
3532
|
+
* @override
|
|
3533
|
+
*/
|
|
3534
|
+
getRenderSource() {
|
|
3535
|
+
return this.renderedSource_ || this.getSource();
|
|
3536
|
+
}
|
|
3537
|
+
/**
|
|
3538
|
+
* @return {import("../source/Source.js").State} Source state.
|
|
3539
|
+
* @override
|
|
3540
|
+
*/
|
|
3541
|
+
getSourceState() {
|
|
3542
|
+
const source = this.getRenderSource();
|
|
3543
|
+
return source ? source.getState() : "undefined";
|
|
3544
|
+
}
|
|
3545
|
+
/**
|
|
3546
|
+
* @private
|
|
3547
|
+
*/
|
|
3548
|
+
handleSourceUpdate_() {
|
|
3549
|
+
if (this.hasRenderer()) {
|
|
3550
|
+
this.getRenderer().clearCache();
|
|
3551
|
+
}
|
|
3552
|
+
const source = this.getSource();
|
|
3553
|
+
if (source) {
|
|
3554
|
+
if (source.getState() === "loading") {
|
|
3555
|
+
const onChange = () => {
|
|
3556
|
+
if (source.getState() === "ready") {
|
|
3557
|
+
source.removeEventListener("change", onChange);
|
|
3558
|
+
this.setStyle(this.style_);
|
|
3559
|
+
}
|
|
3560
|
+
};
|
|
3561
|
+
source.addEventListener("change", onChange);
|
|
3562
|
+
} else {
|
|
3563
|
+
this.setStyle(this.style_);
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
/**
|
|
3568
|
+
* @private
|
|
3569
|
+
* @return {number} The number of source bands.
|
|
3570
|
+
*/
|
|
3571
|
+
getSourceBandCount_() {
|
|
3572
|
+
const max = Number.MAX_SAFE_INTEGER;
|
|
3573
|
+
const sources = this.getSources([-max, -max, max, max], max);
|
|
3574
|
+
return sources && sources.length && "bandCount" in sources[0] ? sources[0].bandCount : 4;
|
|
3575
|
+
}
|
|
3576
|
+
/**
|
|
3577
|
+
* @override
|
|
3578
|
+
*/
|
|
3579
|
+
createRenderer() {
|
|
3580
|
+
const parsedStyle = parseStyle(this.style_, this.getSourceBandCount_());
|
|
3581
|
+
return new TileLayer_default(this, {
|
|
3582
|
+
vertexShader: parsedStyle.vertexShader,
|
|
3583
|
+
fragmentShader: parsedStyle.fragmentShader,
|
|
3584
|
+
uniforms: parsedStyle.uniforms,
|
|
3585
|
+
cacheSize: this.getCacheSize(),
|
|
3586
|
+
paletteTextures: parsedStyle.paletteTextures
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
/**
|
|
3590
|
+
* @param {import("../Map").FrameState} frameState Frame state.
|
|
3591
|
+
* @param {Array<SourceType>} sources Sources.
|
|
3592
|
+
* @return {HTMLElement} Canvas.
|
|
3593
|
+
*/
|
|
3594
|
+
renderSources(frameState, sources) {
|
|
3595
|
+
const layerRenderer = this.getRenderer();
|
|
3596
|
+
let canvas;
|
|
3597
|
+
for (let i = 0, ii = sources.length; i < ii; ++i) {
|
|
3598
|
+
this.renderedSource_ = sources[i];
|
|
3599
|
+
if (layerRenderer.prepareFrame(frameState)) {
|
|
3600
|
+
canvas = layerRenderer.renderFrame(frameState);
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
return canvas;
|
|
3604
|
+
}
|
|
3605
|
+
/**
|
|
3606
|
+
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
|
3607
|
+
* @param {HTMLElement} target Target which the renderer may (but need not) use
|
|
3608
|
+
* for rendering its content.
|
|
3609
|
+
* @return {HTMLElement} The rendered element.
|
|
3610
|
+
* @override
|
|
3611
|
+
*/
|
|
3612
|
+
render(frameState, target) {
|
|
3613
|
+
this.rendered = true;
|
|
3614
|
+
const viewState = frameState.viewState;
|
|
3615
|
+
const sources = this.getSources(frameState.extent, viewState.resolution);
|
|
3616
|
+
let ready = true;
|
|
3617
|
+
for (let i = 0, ii = sources.length; i < ii; ++i) {
|
|
3618
|
+
const source = sources[i];
|
|
3619
|
+
const sourceState = source.getState();
|
|
3620
|
+
if (sourceState == "loading") {
|
|
3621
|
+
const onChange = () => {
|
|
3622
|
+
if (source.getState() == "ready") {
|
|
3623
|
+
source.removeEventListener("change", onChange);
|
|
3624
|
+
this.changed();
|
|
3625
|
+
}
|
|
3626
|
+
};
|
|
3627
|
+
source.addEventListener("change", onChange);
|
|
3628
|
+
}
|
|
3629
|
+
ready = ready && sourceState == "ready";
|
|
3630
|
+
}
|
|
3631
|
+
const canvas = this.renderSources(frameState, sources);
|
|
3632
|
+
if (this.getRenderer().renderComplete && ready) {
|
|
3633
|
+
this.renderedResolution_ = viewState.resolution;
|
|
3634
|
+
return canvas;
|
|
3635
|
+
}
|
|
3636
|
+
if (this.renderedResolution_ > 0.5 * viewState.resolution) {
|
|
3637
|
+
const altSources = this.getSources(
|
|
3638
|
+
frameState.extent,
|
|
3639
|
+
this.renderedResolution_
|
|
3640
|
+
).filter((source) => !sources.includes(source));
|
|
3641
|
+
if (altSources.length > 0) {
|
|
3642
|
+
return this.renderSources(frameState, altSources);
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
return canvas;
|
|
3646
|
+
}
|
|
3647
|
+
/**
|
|
3648
|
+
* Update the layer style. The `updateStyleVariables` function is a more efficient
|
|
3649
|
+
* way to update layer rendering. In cases where the whole style needs to be updated,
|
|
3650
|
+
* this method may be called instead. Note that calling this method will also replace
|
|
3651
|
+
* any previously set variables, so the new style also needs to include new variables,
|
|
3652
|
+
* if needed.
|
|
3653
|
+
* @param {Style} style The new style.
|
|
3654
|
+
*/
|
|
3655
|
+
setStyle(style) {
|
|
3656
|
+
this.styleVariables_ = style.variables || {};
|
|
3657
|
+
this.style_ = style;
|
|
3658
|
+
if (this.hasRenderer()) {
|
|
3659
|
+
const parsedStyle = parseStyle(this.style_, this.getSourceBandCount_());
|
|
3660
|
+
const renderer = this.getRenderer();
|
|
3661
|
+
renderer.reset({
|
|
3662
|
+
vertexShader: parsedStyle.vertexShader,
|
|
3663
|
+
fragmentShader: parsedStyle.fragmentShader,
|
|
3664
|
+
uniforms: parsedStyle.uniforms,
|
|
3665
|
+
paletteTextures: parsedStyle.paletteTextures
|
|
3666
|
+
});
|
|
3667
|
+
this.changed();
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
/**
|
|
3671
|
+
* Update any variables used by the layer style and trigger a re-render.
|
|
3672
|
+
* @param {Object<string, number>} variables Variables to update.
|
|
3673
|
+
* @api
|
|
3674
|
+
*/
|
|
3675
|
+
updateStyleVariables(variables) {
|
|
3676
|
+
Object.assign(this.styleVariables_, variables);
|
|
3677
|
+
this.changed();
|
|
3678
|
+
}
|
|
3679
|
+
};
|
|
3680
|
+
WebGLTileLayer.prototype.dispose;
|
|
3681
|
+
var WebGLTile_default = WebGLTileLayer;
|
|
3682
|
+
|
|
3683
|
+
// src/components/time-average-map/time-average-map.component.ts
|
|
3684
|
+
var _controller, _gtLayer, _vectorSource, _vectorLayer, _draw, _handleMapError, _handlePointerMove, _handleExportImage, _drawLegend, drawLegend_fn, _getMapTitleText, getMapTitleText_fn, _wrapText, wrapText_fn, _handleOpacityChange, handleOpacityChange_fn, _handleColorMapChange, handleColorMapChange_fn, _abortJobStatusTask, abortJobStatusTask_fn, _getNumberOfPoints, getNumberOfPoints_fn, _quantizeLineString, quantizeLineString_fn, _minifyMapPopover, minifyMapPopover_fn, _cleanUpMap, cleanUpMap_fn, _getRasterValueAtCoordinate, getRasterValueAtCoordinate_fn, _handleCheckBoxToggle, handleCheckBoxToggle_fn, _isVariableNotFound, isVariableNotFound_fn, _getErrorMessage, getErrorMessage_fn;
|
|
3685
|
+
var TerraTimeAverageMap = class extends QueryClientMixin(TerraElement) {
|
|
3686
|
+
constructor() {
|
|
3687
|
+
super(...arguments);
|
|
3688
|
+
__privateAdd(this, _drawLegend);
|
|
3689
|
+
__privateAdd(this, _getMapTitleText);
|
|
3690
|
+
__privateAdd(this, _wrapText);
|
|
3691
|
+
__privateAdd(this, _handleOpacityChange);
|
|
3692
|
+
__privateAdd(this, _handleColorMapChange);
|
|
3693
|
+
__privateAdd(this, _abortJobStatusTask);
|
|
3694
|
+
__privateAdd(this, _getNumberOfPoints);
|
|
3695
|
+
__privateAdd(this, _quantizeLineString);
|
|
3696
|
+
__privateAdd(this, _minifyMapPopover);
|
|
3697
|
+
__privateAdd(this, _cleanUpMap);
|
|
3698
|
+
__privateAdd(this, _getRasterValueAtCoordinate);
|
|
3699
|
+
__privateAdd(this, _handleCheckBoxToggle);
|
|
3700
|
+
__privateAdd(this, _isVariableNotFound);
|
|
3701
|
+
__privateAdd(this, _getErrorMessage);
|
|
3702
|
+
this.long_name = "";
|
|
3703
|
+
this.colorMapName = "viridis";
|
|
3704
|
+
this.opacity = 1;
|
|
3705
|
+
this.noCache = false;
|
|
3706
|
+
this.showHelp = true;
|
|
3707
|
+
this.pixelValue = "N/A";
|
|
3708
|
+
this.pixelCoordinates = "N/A";
|
|
3709
|
+
this.metadata = {};
|
|
3710
|
+
this.toggleState = false;
|
|
3711
|
+
this.minimized = false;
|
|
3712
|
+
this.noDataValue = -9999;
|
|
3713
|
+
this.min = "0";
|
|
3714
|
+
this.max = "1";
|
|
3715
|
+
this.legendValues = [];
|
|
3716
|
+
this.timeAverageMapError = null;
|
|
3717
|
+
__privateAdd(this, _controller, new TimeAvgMapController(this));
|
|
3718
|
+
__privateAdd(this, _gtLayer, null);
|
|
3719
|
+
__privateAdd(this, _vectorSource, null);
|
|
3720
|
+
__privateAdd(this, _vectorLayer, null);
|
|
3721
|
+
__privateAdd(this, _draw, null);
|
|
3722
|
+
this._authController = new AuthController(this);
|
|
3723
|
+
this.colormaps = [
|
|
3724
|
+
"jet",
|
|
3725
|
+
"hsv",
|
|
3726
|
+
"hot",
|
|
3727
|
+
"cool",
|
|
3728
|
+
"spring",
|
|
3729
|
+
"summer",
|
|
3730
|
+
"autumn",
|
|
3731
|
+
"winter",
|
|
3732
|
+
"bone",
|
|
3733
|
+
"copper",
|
|
3734
|
+
"greys",
|
|
3735
|
+
"YIGnBu",
|
|
3736
|
+
"greens",
|
|
3737
|
+
"YIOrRd",
|
|
3738
|
+
"bluered",
|
|
3739
|
+
"RdBu",
|
|
3740
|
+
"picnic",
|
|
3741
|
+
"rainbow",
|
|
3742
|
+
"portland",
|
|
3743
|
+
"blackbody",
|
|
3744
|
+
"earth",
|
|
3745
|
+
"electric",
|
|
3746
|
+
"viridis",
|
|
3747
|
+
"inferno",
|
|
3748
|
+
"magma",
|
|
3749
|
+
"plasma",
|
|
3750
|
+
"warm",
|
|
3751
|
+
"cool",
|
|
3752
|
+
"bathymetry",
|
|
3753
|
+
"cdom",
|
|
3754
|
+
"chlorophyll",
|
|
3755
|
+
"density",
|
|
3756
|
+
"fressurface-blue",
|
|
3757
|
+
"freesurface-red",
|
|
3758
|
+
"oxygen",
|
|
3759
|
+
"par",
|
|
3760
|
+
"phase",
|
|
3761
|
+
"salinity",
|
|
3762
|
+
"temperature",
|
|
3763
|
+
"turbidity",
|
|
3764
|
+
"velocity-blue",
|
|
3765
|
+
"velocity-green",
|
|
3766
|
+
"cubhelix"
|
|
3767
|
+
];
|
|
3768
|
+
this.plotData = {};
|
|
3769
|
+
this.layout = {};
|
|
3770
|
+
/**
|
|
3771
|
+
* anytime the collection or variable changes, we'll fetch the variable from the catalog to get all of it's metadata
|
|
3772
|
+
*/
|
|
3773
|
+
this._fetchVariableTask = getFetchVariableTask(this, false);
|
|
3774
|
+
__privateAdd(this, _handleMapError, (event) => {
|
|
3775
|
+
const { status, code, message, context } = event.detail;
|
|
3776
|
+
this.timeAverageMapError = {
|
|
3777
|
+
code: code || String(status),
|
|
3778
|
+
message,
|
|
3779
|
+
context
|
|
3780
|
+
};
|
|
3781
|
+
});
|
|
3782
|
+
__privateAdd(this, _handlePointerMove, (event) => {
|
|
3783
|
+
if (!__privateGet(this, _gtLayer)) {
|
|
3784
|
+
return;
|
|
3785
|
+
}
|
|
3786
|
+
let data = __privateGet(this, _gtLayer).getData(event.detail.pixel);
|
|
3787
|
+
const [lon, lat] = event.detail.coordinate;
|
|
3788
|
+
if (!data || !(data instanceof Uint8Array || data instanceof Uint8ClampedArray || data instanceof Float32Array) || isNaN(data[0]) || data[0] === 0) {
|
|
3789
|
+
data = null;
|
|
3790
|
+
}
|
|
3791
|
+
this.pixelValue = data ? Number(data[0]).toExponential(3) : "N/A";
|
|
3792
|
+
this.pixelCoordinates = [lon, lat].map((c) => c.toFixed(3)).join(", ");
|
|
3793
|
+
});
|
|
3794
|
+
__privateAdd(this, _handleExportImage, async (event) => {
|
|
3795
|
+
var _a, _b;
|
|
3796
|
+
if (!this.innerMap) {
|
|
3797
|
+
console.warn("Map not initialized, cannot export image");
|
|
3798
|
+
return;
|
|
3799
|
+
}
|
|
3800
|
+
const format = ((_a = event.detail) == null ? void 0 : _a.format) || "png";
|
|
3801
|
+
try {
|
|
3802
|
+
await this.innerMap.renderComplete();
|
|
3803
|
+
const mapSize = this.innerMap.getSize();
|
|
3804
|
+
if (!mapSize) {
|
|
3805
|
+
console.warn("Map size is not available");
|
|
3806
|
+
return;
|
|
3807
|
+
}
|
|
3808
|
+
const mapWidth = mapSize[0];
|
|
3809
|
+
const mapHeight = mapSize[1];
|
|
3810
|
+
const { canvases: allCanvases, svgs } = (_b = this.innerMap.getCanvasElements()) != null ? _b : {
|
|
3811
|
+
canvases: [],
|
|
3812
|
+
svgs: []
|
|
3813
|
+
};
|
|
3814
|
+
if (allCanvases.length === 0 && svgs.length === 0) {
|
|
3815
|
+
console.warn("Could not find map canvas or SVG elements");
|
|
3816
|
+
return;
|
|
3817
|
+
}
|
|
3818
|
+
const finalCanvas = document.createElement("canvas");
|
|
3819
|
+
const ctx = finalCanvas.getContext("2d");
|
|
3820
|
+
if (!ctx) {
|
|
3821
|
+
console.warn("Could not get canvas context");
|
|
3822
|
+
return;
|
|
3823
|
+
}
|
|
3824
|
+
const textHeight = 80;
|
|
3825
|
+
finalCanvas.width = mapWidth;
|
|
3826
|
+
finalCanvas.height = mapHeight + textHeight;
|
|
3827
|
+
ctx.fillStyle = "#ffffff";
|
|
3828
|
+
ctx.fillRect(0, 0, finalCanvas.width, finalCanvas.height);
|
|
3829
|
+
for (const canvas of allCanvases) {
|
|
3830
|
+
ctx.drawImage(
|
|
3831
|
+
canvas,
|
|
3832
|
+
0,
|
|
3833
|
+
0,
|
|
3834
|
+
canvas.width,
|
|
3835
|
+
canvas.height,
|
|
3836
|
+
0,
|
|
3837
|
+
textHeight,
|
|
3838
|
+
mapWidth,
|
|
3839
|
+
mapHeight
|
|
3840
|
+
);
|
|
3841
|
+
}
|
|
3842
|
+
for (const svg of svgs) {
|
|
3843
|
+
try {
|
|
3844
|
+
const clonedSvg = svg.cloneNode(true);
|
|
3845
|
+
if (!clonedSvg.hasAttribute("width")) {
|
|
3846
|
+
clonedSvg.setAttribute("width", String(mapWidth));
|
|
3847
|
+
}
|
|
3848
|
+
if (!clonedSvg.hasAttribute("height")) {
|
|
3849
|
+
clonedSvg.setAttribute("height", String(mapHeight));
|
|
3850
|
+
}
|
|
3851
|
+
const svgData = new XMLSerializer().serializeToString(clonedSvg);
|
|
3852
|
+
const svgBlob = new Blob([svgData], {
|
|
3853
|
+
type: "image/svg+xml;charset=utf-8"
|
|
3854
|
+
});
|
|
3855
|
+
const url = URL.createObjectURL(svgBlob);
|
|
3856
|
+
const img = new Image();
|
|
3857
|
+
await new Promise((resolve, reject) => {
|
|
3858
|
+
img.onload = () => {
|
|
3859
|
+
ctx.drawImage(img, 0, textHeight, mapWidth, mapHeight);
|
|
3860
|
+
URL.revokeObjectURL(url);
|
|
3861
|
+
resolve();
|
|
3862
|
+
};
|
|
3863
|
+
img.onerror = () => {
|
|
3864
|
+
URL.revokeObjectURL(url);
|
|
3865
|
+
reject(new Error("Failed to load SVG image"));
|
|
3866
|
+
};
|
|
3867
|
+
img.src = url;
|
|
3868
|
+
});
|
|
3869
|
+
} catch (error) {
|
|
3870
|
+
console.warn("Failed to render SVG layer:", error);
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
const textY = 30;
|
|
3874
|
+
const lineHeight = 25;
|
|
3875
|
+
ctx.fillStyle = "#000000";
|
|
3876
|
+
ctx.font = "bold 18px Arial, sans-serif";
|
|
3877
|
+
ctx.textAlign = "left";
|
|
3878
|
+
ctx.textBaseline = "top";
|
|
3879
|
+
const titleText = __privateMethod(this, _getMapTitleText, getMapTitleText_fn).call(this);
|
|
3880
|
+
const lines = __privateMethod(this, _wrapText, wrapText_fn).call(this, ctx, titleText, mapWidth - 40, 16);
|
|
3881
|
+
lines.forEach((line, index) => {
|
|
3882
|
+
ctx.fillText(line, 20, textY + index * lineHeight);
|
|
3883
|
+
});
|
|
3884
|
+
await __privateMethod(this, _drawLegend, drawLegend_fn).call(this, ctx, textHeight);
|
|
3885
|
+
const mimeType = format === "jpg" ? "image/jpeg" : "image/png";
|
|
3886
|
+
const fileExtension = format === "jpg" ? "jpg" : "png";
|
|
3887
|
+
const quality = format === "jpg" ? 0.92 : void 0;
|
|
3888
|
+
finalCanvas.toBlob(
|
|
3889
|
+
(blob) => {
|
|
3890
|
+
if (!blob) {
|
|
3891
|
+
console.warn("Failed to create blob from canvas");
|
|
3892
|
+
return;
|
|
3893
|
+
}
|
|
3894
|
+
const url = URL.createObjectURL(blob);
|
|
3895
|
+
const a = document.createElement("a");
|
|
3896
|
+
const locationStr = this.location ? `_${this.location.replace(/,/g, "_")}` : "";
|
|
3897
|
+
const dateRange = this.startDate && this.endDate ? `_${this.startDate.split("T")[0]}_to_${this.endDate.split("T")[0]}` : "";
|
|
3898
|
+
const variableEntryId = getVariableEntryId(this);
|
|
3899
|
+
const filename = `${variableEntryId || "map"}${locationStr}${dateRange}.${fileExtension}`;
|
|
3900
|
+
a.href = url;
|
|
3901
|
+
a.download = filename;
|
|
3902
|
+
a.style.display = "none";
|
|
3903
|
+
document.body.appendChild(a);
|
|
3904
|
+
a.click();
|
|
3905
|
+
document.body.removeChild(a);
|
|
3906
|
+
URL.revokeObjectURL(url);
|
|
3907
|
+
},
|
|
3908
|
+
mimeType,
|
|
3909
|
+
quality
|
|
3910
|
+
);
|
|
3911
|
+
} catch (error) {
|
|
3912
|
+
console.error("Error exporting map as PNG:", error);
|
|
3913
|
+
}
|
|
3914
|
+
});
|
|
3915
|
+
}
|
|
3916
|
+
set cache(value) {
|
|
3917
|
+
console.warn(
|
|
3918
|
+
"<terra-time-average-map> `cache` is deprecated and enabled by default; use `no-cache` to disable caching instead."
|
|
3919
|
+
);
|
|
3920
|
+
this.noCache = !value;
|
|
3921
|
+
}
|
|
3922
|
+
get cache() {
|
|
3923
|
+
return !this.noCache;
|
|
3924
|
+
}
|
|
3925
|
+
handlePropertyChange() {
|
|
3926
|
+
if (!this.startDate || !this.endDate || !this.location || !this.catalogVariable) {
|
|
3927
|
+
return;
|
|
3928
|
+
}
|
|
3929
|
+
__privateGet(this, _controller).jobStatusTask.run();
|
|
3930
|
+
}
|
|
3931
|
+
handlePlotOptionsChange() {
|
|
3932
|
+
this.emit("terra-plot-options-change", {
|
|
3933
|
+
detail: {
|
|
3934
|
+
colorMapName: this.colorMapName,
|
|
3935
|
+
opacity: this.opacity
|
|
3936
|
+
}
|
|
3937
|
+
});
|
|
3938
|
+
}
|
|
3939
|
+
connectedCallback() {
|
|
3940
|
+
super.connectedCallback();
|
|
3941
|
+
this.addEventListener(
|
|
3942
|
+
"terra-time-average-map-error",
|
|
3943
|
+
__privateGet(this, _handleMapError)
|
|
3944
|
+
);
|
|
3945
|
+
this.addEventListener(
|
|
3946
|
+
"terra-plot-toolbar-export-image",
|
|
3947
|
+
__privateGet(this, _handleExportImage)
|
|
3948
|
+
);
|
|
3949
|
+
this.addEventListener(
|
|
3950
|
+
"terra-map-pointer-move",
|
|
3951
|
+
__privateGet(this, _handlePointerMove)
|
|
3952
|
+
);
|
|
3953
|
+
}
|
|
3954
|
+
async firstUpdated() {
|
|
3955
|
+
this._fetchVariableTask.run();
|
|
3956
|
+
}
|
|
3957
|
+
updated(changedProps) {
|
|
3958
|
+
var _a, _b, _c, _d;
|
|
3959
|
+
super.updated(changedProps);
|
|
3960
|
+
const taskStatus = (_b = (_a = __privateGet(this, _controller)) == null ? void 0 : _a.jobStatusTask) == null ? void 0 : _b.status;
|
|
3961
|
+
if (taskStatus === s.PENDING && this.timeAverageMapError) {
|
|
3962
|
+
this.timeAverageMapError = null;
|
|
3963
|
+
}
|
|
3964
|
+
if (taskStatus === s.ERROR && !this.timeAverageMapError) {
|
|
3965
|
+
const taskError = (_d = (_c = __privateGet(this, _controller)) == null ? void 0 : _c.jobStatusTask) == null ? void 0 : _d.error;
|
|
3966
|
+
if (taskError) {
|
|
3967
|
+
const errorDetails = extractHarmonyError(taskError);
|
|
3968
|
+
if (errorDetails.isCancellation) {
|
|
3969
|
+
return;
|
|
3970
|
+
}
|
|
3971
|
+
this.timeAverageMapError = {
|
|
3972
|
+
code: errorDetails.code,
|
|
3973
|
+
message: errorDetails.message,
|
|
3974
|
+
context: errorDetails.context
|
|
3975
|
+
};
|
|
3976
|
+
}
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
disconnectedCallback() {
|
|
3980
|
+
super.disconnectedCallback();
|
|
3981
|
+
this.removeEventListener(
|
|
3982
|
+
"terra-time-average-map-error",
|
|
3983
|
+
__privateGet(this, _handleMapError)
|
|
3984
|
+
);
|
|
3985
|
+
this.removeEventListener(
|
|
3986
|
+
"terra-plot-toolbar-export-image",
|
|
3987
|
+
__privateGet(this, _handleExportImage)
|
|
3988
|
+
);
|
|
3989
|
+
this.removeEventListener(
|
|
3990
|
+
"terra-map-pointer-move",
|
|
3991
|
+
__privateGet(this, _handlePointerMove)
|
|
3992
|
+
);
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* Captures the current map view as a thumbnail Blob (JPEG, 200×200).
|
|
3996
|
+
* Composites all OpenLayers canvas layers without text overlay or legend.
|
|
3997
|
+
* Returns undefined if the map is not ready.
|
|
3998
|
+
*/
|
|
3999
|
+
async captureMapThumbnail(thumbWidth = 200, thumbHeight = 200) {
|
|
4000
|
+
var _a, _b;
|
|
4001
|
+
if (!this.innerMap) {
|
|
4002
|
+
return void 0;
|
|
4003
|
+
}
|
|
4004
|
+
try {
|
|
4005
|
+
await this.innerMap.renderComplete();
|
|
4006
|
+
const mapSize = this.innerMap.getSize();
|
|
4007
|
+
if (!mapSize)
|
|
4008
|
+
return void 0;
|
|
4009
|
+
const [mapWidth, mapHeight] = mapSize;
|
|
4010
|
+
const allCanvases = (_b = (_a = this.innerMap.getCanvasElements()) == null ? void 0 : _a.canvases) != null ? _b : [];
|
|
4011
|
+
if (allCanvases.length === 0)
|
|
4012
|
+
return void 0;
|
|
4013
|
+
const composite = document.createElement("canvas");
|
|
4014
|
+
composite.width = mapWidth;
|
|
4015
|
+
composite.height = mapHeight;
|
|
4016
|
+
const ctx = composite.getContext("2d");
|
|
4017
|
+
if (!ctx)
|
|
4018
|
+
return void 0;
|
|
4019
|
+
for (const canvas of allCanvases) {
|
|
4020
|
+
if (canvas.width > 0 && canvas.height > 0) {
|
|
4021
|
+
ctx.drawImage(canvas, 0, 0, mapWidth, mapHeight);
|
|
4022
|
+
}
|
|
4023
|
+
}
|
|
4024
|
+
const thumb = document.createElement("canvas");
|
|
4025
|
+
thumb.width = thumbWidth;
|
|
4026
|
+
thumb.height = thumbHeight;
|
|
4027
|
+
const thumbCtx = thumb.getContext("2d");
|
|
4028
|
+
if (!thumbCtx)
|
|
4029
|
+
return void 0;
|
|
4030
|
+
thumbCtx.drawImage(composite, 0, 0, thumbWidth, thumbHeight);
|
|
4031
|
+
return new Promise(
|
|
4032
|
+
(resolve, reject) => thumb.toBlob(
|
|
4033
|
+
(b2) => b2 ? resolve(b2) : reject(new Error("toBlob failed")),
|
|
4034
|
+
"image/jpeg",
|
|
4035
|
+
0.8
|
|
4036
|
+
)
|
|
4037
|
+
);
|
|
4038
|
+
} catch (error) {
|
|
4039
|
+
console.error("Failed to capture map thumbnail", error);
|
|
4040
|
+
return void 0;
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
async updateGeoTIFFLayer(blob) {
|
|
4044
|
+
var _a, _b;
|
|
4045
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
4046
|
+
const { default: GeoTIFF } = await import("./GeoTIFF.VXDS234A.js");
|
|
4047
|
+
const gtSource = new GeoTIFF({
|
|
4048
|
+
sources: [
|
|
4049
|
+
{
|
|
4050
|
+
url: blobUrl,
|
|
4051
|
+
bands: [1],
|
|
4052
|
+
nodata: this.noDataValue
|
|
4053
|
+
}
|
|
4054
|
+
],
|
|
4055
|
+
wrapX: true,
|
|
4056
|
+
// Enable wrapping so GeoTIFF is always visible when scrolling
|
|
4057
|
+
interpolate: false,
|
|
4058
|
+
normalize: false
|
|
4059
|
+
});
|
|
4060
|
+
__privateSet(this, _gtLayer, new WebGLTile_default({
|
|
4061
|
+
source: gtSource
|
|
4062
|
+
}));
|
|
4063
|
+
if (this.innerMap) {
|
|
4064
|
+
this.innerMap.removeLayer("geotiff");
|
|
4065
|
+
this.innerMap.addLayer(__privateGet(this, _gtLayer), { name: "geotiff" });
|
|
4066
|
+
}
|
|
4067
|
+
this.metadata = await this.fetchGeotiffMetadata(gtSource);
|
|
4068
|
+
this.long_name = (_a = this.metadata["long_name"]) != null ? _a : "";
|
|
4069
|
+
if (this.innerMap && __privateGet(this, _gtLayer)) {
|
|
4070
|
+
this.applyColorToLayer(gtSource, this.colorMapName);
|
|
4071
|
+
try {
|
|
4072
|
+
const view = await ((_b = __privateGet(this, _gtLayer).getSource()) == null ? void 0 : _b.getView());
|
|
4073
|
+
if ((view == null ? void 0 : view.extent) && view.projection) {
|
|
4074
|
+
this.innerMap.fitToExtent(view.extent, {
|
|
4075
|
+
projection: view.projection,
|
|
4076
|
+
padding: [50, 50, 50, 50],
|
|
4077
|
+
duration: 300
|
|
4078
|
+
});
|
|
4079
|
+
}
|
|
4080
|
+
} catch (error) {
|
|
4081
|
+
console.warn("Failed to fit map to GeoTIFF extent:", error);
|
|
4082
|
+
}
|
|
4083
|
+
}
|
|
4084
|
+
}
|
|
4085
|
+
async fetchGeotiffMetadata(gtSource) {
|
|
4086
|
+
var _a;
|
|
4087
|
+
await gtSource.getView();
|
|
4088
|
+
const internal = gtSource;
|
|
4089
|
+
const gtImage = internal.sourceImagery_[0][0];
|
|
4090
|
+
const gtMetadata = (_a = gtImage.fileDirectory) == null ? void 0 : _a.GDAL_METADATA;
|
|
4091
|
+
const parser = new DOMParser();
|
|
4092
|
+
const xmlDoc = parser.parseFromString(gtMetadata, "application/xml");
|
|
4093
|
+
const items = xmlDoc.querySelectorAll("Item");
|
|
4094
|
+
const dataObj = {};
|
|
4095
|
+
for (let i = 0; i < items.length; i++) {
|
|
4096
|
+
const item = items[i];
|
|
4097
|
+
const name = item.getAttribute("name");
|
|
4098
|
+
const value = item.textContent ? item.textContent.trim() : "";
|
|
4099
|
+
if (name) {
|
|
4100
|
+
dataObj[name] = value;
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
console.log("Data obj: ", dataObj);
|
|
4104
|
+
return dataObj;
|
|
4105
|
+
}
|
|
4106
|
+
// Get the fill value from the GeoTIFF file
|
|
4107
|
+
getNoDataValue(gtSource) {
|
|
4108
|
+
let ndv = this.noDataValue;
|
|
4109
|
+
if (gtSource == null) {
|
|
4110
|
+
return ndv;
|
|
4111
|
+
}
|
|
4112
|
+
gtSource.getView().then(() => {
|
|
4113
|
+
var _a, _b;
|
|
4114
|
+
const gtImage = gtSource.sourceImagery_[0][0];
|
|
4115
|
+
ndv = parseFloat(
|
|
4116
|
+
(_b = (_a = gtImage.fileDirectory) == null ? void 0 : _a.GDAL_NODATA) != null ? _b : this.noDataValue.toString()
|
|
4117
|
+
);
|
|
4118
|
+
});
|
|
4119
|
+
return ndv;
|
|
4120
|
+
}
|
|
4121
|
+
async getMinMax(gtSource) {
|
|
4122
|
+
await gtSource.getView();
|
|
4123
|
+
const gtImage = gtSource.sourceImagery_[0][0];
|
|
4124
|
+
const rasterData = await gtImage.readRasters({ samples: [0] });
|
|
4125
|
+
const pixels = rasterData[0];
|
|
4126
|
+
let min = Infinity;
|
|
4127
|
+
let max = -Infinity;
|
|
4128
|
+
for (let i = 0; i < pixels.length; i++) {
|
|
4129
|
+
const val = pixels[i];
|
|
4130
|
+
if (!isNaN(val) && val !== this.getNoDataValue(gtSource)) {
|
|
4131
|
+
if (val < min)
|
|
4132
|
+
min = val;
|
|
4133
|
+
if (val > max)
|
|
4134
|
+
max = val;
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
return { min, max };
|
|
4138
|
+
}
|
|
4139
|
+
// Referencing workshop example from https://openlayers.org/workshop/en/cog/colormap.html
|
|
4140
|
+
async getColorStops(name, min, max, steps, reverse) {
|
|
4141
|
+
const delta = (max - min) / (steps - 1);
|
|
4142
|
+
const stops = new Array(steps * 2);
|
|
4143
|
+
const { default: colormap } = await import("./colormap.BMZ7G2OU.js");
|
|
4144
|
+
const colors = colormap({
|
|
4145
|
+
colormap: name,
|
|
4146
|
+
nshades: steps,
|
|
4147
|
+
format: "rgba"
|
|
4148
|
+
});
|
|
4149
|
+
const dataVals = [];
|
|
4150
|
+
if (reverse) {
|
|
4151
|
+
colors.reverse();
|
|
4152
|
+
}
|
|
4153
|
+
for (let i = 0; i < steps; i++) {
|
|
4154
|
+
stops[i * 2] = min + i * delta;
|
|
4155
|
+
stops[i * 2 + 1] = colors[i];
|
|
4156
|
+
dataVals.push((min + i * delta).toExponential(2));
|
|
4157
|
+
}
|
|
4158
|
+
this.generatePalette(colors, dataVals, min, max);
|
|
4159
|
+
return stops;
|
|
4160
|
+
}
|
|
4161
|
+
generatePalette(clrs, dv, min, max) {
|
|
4162
|
+
this.legendValues = [];
|
|
4163
|
+
for (let i = clrs.length - 1; i > 0; i--) {
|
|
4164
|
+
const curVal = parseFloat(dv[i]);
|
|
4165
|
+
if (curVal >= min && curVal <= max) {
|
|
4166
|
+
this.legendValues.push({ value: dv[i], rgb: clrs[i] });
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
this.min = min.toExponential(3);
|
|
4170
|
+
this.max = max.toExponential(3);
|
|
4171
|
+
}
|
|
4172
|
+
async applyColorToLayer(gtSource, color) {
|
|
4173
|
+
var _a;
|
|
4174
|
+
var { min, max } = await this.getMinMax(gtSource);
|
|
4175
|
+
let gtStyle = {
|
|
4176
|
+
color: [
|
|
4177
|
+
"case",
|
|
4178
|
+
["==", ["band", 2], 0],
|
|
4179
|
+
[0, 0, 0, 0],
|
|
4180
|
+
[
|
|
4181
|
+
"interpolate",
|
|
4182
|
+
["linear"],
|
|
4183
|
+
["band", 1],
|
|
4184
|
+
...await this.getColorStops(color, min, max, 72, false)
|
|
4185
|
+
]
|
|
4186
|
+
]
|
|
4187
|
+
};
|
|
4188
|
+
(_a = __privateGet(this, _gtLayer)) == null ? void 0 : _a.setStyle(gtStyle);
|
|
4189
|
+
}
|
|
4190
|
+
render() {
|
|
4191
|
+
var _a, _b, _c, _d;
|
|
4192
|
+
return b`
|
|
4193
|
+
${__privateMethod(this, _isVariableNotFound, isVariableNotFound_fn).call(this) ? b`
|
|
4194
|
+
<terra-alert
|
|
4195
|
+
class="no-data-alert"
|
|
4196
|
+
variant="danger"
|
|
4197
|
+
open
|
|
4198
|
+
closable
|
|
4199
|
+
>
|
|
4200
|
+
<terra-icon
|
|
4201
|
+
slot="icon"
|
|
4202
|
+
name="outline-exclamation-triangle"
|
|
4203
|
+
library="heroicons"
|
|
4204
|
+
></terra-icon>
|
|
4205
|
+
The selected variable was not found in the catalog
|
|
4206
|
+
</terra-alert>
|
|
4207
|
+
` : ""}
|
|
4208
|
+
${this.timeAverageMapError ? b`
|
|
4209
|
+
<terra-alert
|
|
4210
|
+
class="error-alert"
|
|
4211
|
+
variant="danger"
|
|
4212
|
+
open
|
|
4213
|
+
closable
|
|
4214
|
+
@terra-after-hide=${() => this.timeAverageMapError = null}
|
|
4215
|
+
>
|
|
4216
|
+
<terra-icon
|
|
4217
|
+
slot="icon"
|
|
4218
|
+
name="outline-exclamation-triangle"
|
|
4219
|
+
library="heroicons"
|
|
4220
|
+
></terra-icon>
|
|
4221
|
+
${__privateMethod(this, _getErrorMessage, getErrorMessage_fn).call(this, this.timeAverageMapError)}
|
|
4222
|
+
</terra-alert>
|
|
4223
|
+
` : ""}
|
|
4224
|
+
<div class="toolbar-container">
|
|
4225
|
+
${h(
|
|
4226
|
+
this.catalogVariable ? b`<terra-plot-toolbar
|
|
4227
|
+
dataType="geotiff"
|
|
4228
|
+
.catalogVariable=${this.catalogVariable}
|
|
4229
|
+
.timeSeriesData=${(_a = __privateGet(this, _controller).jobStatusTask) == null ? void 0 : _a.value}
|
|
4230
|
+
.location=${this.location}
|
|
4231
|
+
.startDate=${this.startDate}
|
|
4232
|
+
.endDate=${this.endDate}
|
|
4233
|
+
.cacheKey=${__privateGet(this, _controller).getCacheKey()}
|
|
4234
|
+
.variableEntryId=${getVariableEntryId(this)}
|
|
4235
|
+
@show-opacity-value=${__privateMethod(this, _handleOpacityChange, handleOpacityChange_fn)}
|
|
4236
|
+
@show-color-map=${__privateMethod(this, _handleColorMapChange, handleColorMapChange_fn)}
|
|
4237
|
+
@show-check-box-toggle=${__privateMethod(this, _handleCheckBoxToggle, handleCheckBoxToggle_fn)}
|
|
4238
|
+
.pixelValue=${this.pixelValue}
|
|
4239
|
+
.pixelCoordinates=${this.pixelCoordinates}
|
|
4240
|
+
show-date-range
|
|
4241
|
+
.colormaps=${this.colormaps}
|
|
4242
|
+
.colorMapName=${this.colorMapName}
|
|
4243
|
+
.opacity=${this.opacity}
|
|
4244
|
+
.showHelp=${this.showHelp}
|
|
4245
|
+
></terra-plot-toolbar>` : b`<div class="spacer"></div>`
|
|
4246
|
+
)}
|
|
4247
|
+
</div>
|
|
4248
|
+
|
|
4249
|
+
<div class="map-container">
|
|
4250
|
+
<terra-map fill show-graticule></terra-map>
|
|
4251
|
+
|
|
4252
|
+
<div id="settings">
|
|
4253
|
+
<div>
|
|
4254
|
+
<strong>Value:</strong>
|
|
4255
|
+
<span id="pixelValue">${this.pixelValue}</span>
|
|
4256
|
+
</div>
|
|
4257
|
+
|
|
4258
|
+
<div>
|
|
4259
|
+
<strong>Coordinate: </strong>
|
|
4260
|
+
<span id="cursorCoordinates">${this.pixelCoordinates}</span>
|
|
4261
|
+
</div>
|
|
4262
|
+
</div>
|
|
4263
|
+
|
|
4264
|
+
<div id="legend">
|
|
4265
|
+
<div class="stats" id="statsMax">${this.max}</div>
|
|
4266
|
+
<div class="palette">
|
|
4267
|
+
${this.legendValues.map(
|
|
4268
|
+
(value) => b`
|
|
4269
|
+
<div
|
|
4270
|
+
class="color-box"
|
|
4271
|
+
style="background-color: rgba(${value.rgb})"
|
|
4272
|
+
title="${value.value}"
|
|
4273
|
+
></div>
|
|
4274
|
+
`
|
|
4275
|
+
)}
|
|
4276
|
+
</div>
|
|
4277
|
+
<div class="stats" id="statsMin">${this.min}</div>
|
|
4278
|
+
</div>
|
|
4279
|
+
</div>
|
|
4280
|
+
|
|
4281
|
+
${this.harmonyJobId ? b`
|
|
4282
|
+
<div class="harmony-job-link">
|
|
4283
|
+
<a
|
|
4284
|
+
href=${`https://harmony${this.environment === "uat" /* UAT */ ? ".uat" : ""}.earthdata.nasa.gov/jobs/${this.harmonyJobId}`}
|
|
4285
|
+
target="_blank"
|
|
4286
|
+
rel="noopener noreferrer"
|
|
4287
|
+
>
|
|
4288
|
+
Request Status: ${this.harmonyJobId}
|
|
4289
|
+
</a>
|
|
4290
|
+
</div>
|
|
4291
|
+
` : A}
|
|
4292
|
+
|
|
4293
|
+
<!-- Floating Popover for Plot -->
|
|
4294
|
+
${this.toggleState && this.plotData && Object.keys(this.plotData).length && this.layout && Object.keys(this.layout).length ? b`
|
|
4295
|
+
<div class="plot-popover ${this.minimized ? "minimized" : ""}">
|
|
4296
|
+
<terra-plot
|
|
4297
|
+
style="display: ${this.minimized ? "none" : "block"}"
|
|
4298
|
+
.data=${this.plotData}
|
|
4299
|
+
plotTitle="Data Profile"
|
|
4300
|
+
.layout=${this.layout}
|
|
4301
|
+
>
|
|
4302
|
+
</terra-plot>
|
|
4303
|
+
|
|
4304
|
+
<terra-button
|
|
4305
|
+
class="minify-btn"
|
|
4306
|
+
@click=${__privateMethod(this, _minifyMapPopover, minifyMapPopover_fn)}
|
|
4307
|
+
>
|
|
4308
|
+
${this.minimized ? "Restore" : "Minimize"}
|
|
4309
|
+
</terra-button>
|
|
4310
|
+
</div>
|
|
4311
|
+
` : null}
|
|
4312
|
+
|
|
4313
|
+
<dialog
|
|
4314
|
+
?open=${((_c = (_b = __privateGet(this, _controller)) == null ? void 0 : _b.jobStatusTask) == null ? void 0 : _c.status) === s.PENDING}
|
|
4315
|
+
>
|
|
4316
|
+
<terra-loader indeterminate variant="orbit"></terra-loader>
|
|
4317
|
+
<p>Plotting ${(_d = this.catalogVariable) == null ? void 0 : _d.dataFieldId}…</p>
|
|
4318
|
+
<terra-button @click=${__privateMethod(this, _abortJobStatusTask, abortJobStatusTask_fn)}>Cancel</terra-button>
|
|
4319
|
+
</dialog>
|
|
4320
|
+
`;
|
|
4321
|
+
}
|
|
4322
|
+
};
|
|
4323
|
+
_controller = new WeakMap();
|
|
4324
|
+
_gtLayer = new WeakMap();
|
|
4325
|
+
_vectorSource = new WeakMap();
|
|
4326
|
+
_vectorLayer = new WeakMap();
|
|
4327
|
+
_draw = new WeakMap();
|
|
4328
|
+
_handleMapError = new WeakMap();
|
|
4329
|
+
_handlePointerMove = new WeakMap();
|
|
4330
|
+
_handleExportImage = new WeakMap();
|
|
4331
|
+
_drawLegend = new WeakSet();
|
|
4332
|
+
drawLegend_fn = async function(ctx, textHeight) {
|
|
4333
|
+
var _a, _b;
|
|
4334
|
+
const legendElement = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("legend");
|
|
4335
|
+
if (!legendElement) {
|
|
4336
|
+
return;
|
|
4337
|
+
}
|
|
4338
|
+
const mapContainer = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector(".map-container");
|
|
4339
|
+
if (!mapContainer) {
|
|
4340
|
+
return;
|
|
4341
|
+
}
|
|
4342
|
+
const legendRect = legendElement.getBoundingClientRect();
|
|
4343
|
+
const mapRect = mapContainer.getBoundingClientRect();
|
|
4344
|
+
const legendX = legendRect.left - mapRect.left;
|
|
4345
|
+
const legendY = legendRect.top - mapRect.top + textHeight;
|
|
4346
|
+
const legendWidth = legendRect.width;
|
|
4347
|
+
const legendHeight = legendRect.height;
|
|
4348
|
+
ctx.fillStyle = "#ffffff";
|
|
4349
|
+
ctx.fillRect(legendX, legendY, legendWidth, legendHeight);
|
|
4350
|
+
ctx.strokeStyle = "#cccccc";
|
|
4351
|
+
ctx.lineWidth = 1;
|
|
4352
|
+
ctx.strokeRect(legendX, legendY, legendWidth, legendHeight);
|
|
4353
|
+
const computedStyle = window.getComputedStyle(legendElement);
|
|
4354
|
+
const fontSize = parseFloat(computedStyle.fontSize) || 12;
|
|
4355
|
+
const fontFamily = computedStyle.fontFamily || "monospace";
|
|
4356
|
+
const padding = parseFloat(computedStyle.padding) || 8;
|
|
4357
|
+
const statsMax = legendElement.querySelector("#statsMax");
|
|
4358
|
+
if (statsMax) {
|
|
4359
|
+
ctx.fillStyle = "#000000";
|
|
4360
|
+
ctx.font = `${fontSize}px ${fontFamily}`;
|
|
4361
|
+
ctx.textAlign = "center";
|
|
4362
|
+
ctx.textBaseline = "top";
|
|
4363
|
+
ctx.fillText(
|
|
4364
|
+
statsMax.textContent || "",
|
|
4365
|
+
legendX + legendWidth / 2,
|
|
4366
|
+
legendY + padding
|
|
4367
|
+
);
|
|
4368
|
+
}
|
|
4369
|
+
const palette = legendElement.querySelector(".palette");
|
|
4370
|
+
if (palette) {
|
|
4371
|
+
const paletteRect = palette.getBoundingClientRect();
|
|
4372
|
+
const paletteX = paletteRect.left - mapRect.left;
|
|
4373
|
+
const paletteY = paletteRect.top - mapRect.top + textHeight;
|
|
4374
|
+
const paletteWidth = paletteRect.width;
|
|
4375
|
+
const colorDivs = Array.from(
|
|
4376
|
+
palette.querySelectorAll("div")
|
|
4377
|
+
);
|
|
4378
|
+
let currentY = paletteY;
|
|
4379
|
+
for (const div of colorDivs) {
|
|
4380
|
+
const divRect = div.getBoundingClientRect();
|
|
4381
|
+
const divHeight = divRect.height;
|
|
4382
|
+
const style = div.getAttribute("style") || "";
|
|
4383
|
+
const bgColorMatch = style.match(
|
|
4384
|
+
/background-color:\s*rgba?\(([^)]+)\)/
|
|
4385
|
+
);
|
|
4386
|
+
if (bgColorMatch) {
|
|
4387
|
+
const colorStr = bgColorMatch[1];
|
|
4388
|
+
const [r2, g, b2, a = 1] = colorStr.split(",").map((s2) => parseFloat(s2.trim()));
|
|
4389
|
+
ctx.fillStyle = `rgba(${r2}, ${g}, ${b2}, ${a})`;
|
|
4390
|
+
ctx.fillRect(paletteX, currentY, paletteWidth, divHeight);
|
|
4391
|
+
}
|
|
4392
|
+
currentY += divHeight;
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
const statsMin = legendElement.querySelector("#statsMin");
|
|
4396
|
+
if (statsMin) {
|
|
4397
|
+
ctx.fillStyle = "#000000";
|
|
4398
|
+
ctx.font = `${fontSize}px ${fontFamily}`;
|
|
4399
|
+
ctx.textAlign = "center";
|
|
4400
|
+
ctx.textBaseline = "bottom";
|
|
4401
|
+
ctx.fillText(
|
|
4402
|
+
statsMin.textContent || "",
|
|
4403
|
+
legendX + legendWidth / 2,
|
|
4404
|
+
legendY + legendHeight - padding
|
|
4405
|
+
);
|
|
4406
|
+
}
|
|
4407
|
+
};
|
|
4408
|
+
_getMapTitleText = new WeakSet();
|
|
4409
|
+
getMapTitleText_fn = function() {
|
|
4410
|
+
if (!this.catalogVariable) {
|
|
4411
|
+
return "Time Averaged Map";
|
|
4412
|
+
}
|
|
4413
|
+
const parts = [];
|
|
4414
|
+
parts.push("Time Averaged Map of");
|
|
4415
|
+
if (this.catalogVariable.dataFieldLongName) {
|
|
4416
|
+
parts.push(this.catalogVariable.dataFieldLongName);
|
|
4417
|
+
}
|
|
4418
|
+
if (this.catalogVariable.dataProductTimeInterval && this.catalogVariable.dataProductTimeInterval.toLowerCase() !== "not applicable") {
|
|
4419
|
+
parts.push(this.catalogVariable.dataProductTimeInterval);
|
|
4420
|
+
}
|
|
4421
|
+
if (this.catalogVariable.dataProductSpatialResolution && this.catalogVariable.dataProductSpatialResolution.toLowerCase() !== "not applicable") {
|
|
4422
|
+
parts.push(this.catalogVariable.dataProductSpatialResolution);
|
|
4423
|
+
}
|
|
4424
|
+
if (this.catalogVariable.dataProductShortName) {
|
|
4425
|
+
let datasetInfo = `[${this.catalogVariable.dataProductShortName}`;
|
|
4426
|
+
if (this.catalogVariable.dataProductVersion) {
|
|
4427
|
+
datasetInfo += ` v${this.catalogVariable.dataProductVersion}`;
|
|
4428
|
+
}
|
|
4429
|
+
datasetInfo += "]";
|
|
4430
|
+
parts.push(datasetInfo);
|
|
4431
|
+
}
|
|
4432
|
+
if (this.startDate && this.endDate) {
|
|
4433
|
+
const startFormatted = formatDate(this.startDate);
|
|
4434
|
+
const endFormatted = formatDate(this.endDate);
|
|
4435
|
+
parts.push(`over ${startFormatted} - ${endFormatted}`);
|
|
4436
|
+
}
|
|
4437
|
+
return parts.join(" ");
|
|
4438
|
+
};
|
|
4439
|
+
_wrapText = new WeakSet();
|
|
4440
|
+
wrapText_fn = function(ctx, text, maxWidth, fontSize) {
|
|
4441
|
+
ctx.font = `bold ${fontSize}px Arial, sans-serif`;
|
|
4442
|
+
const words = text.split(" ");
|
|
4443
|
+
const lines = [];
|
|
4444
|
+
let currentLine = words[0];
|
|
4445
|
+
for (let i = 1; i < words.length; i++) {
|
|
4446
|
+
const word = words[i];
|
|
4447
|
+
const width = ctx.measureText(currentLine + " " + word).width;
|
|
4448
|
+
if (width < maxWidth) {
|
|
4449
|
+
currentLine += " " + word;
|
|
4450
|
+
} else {
|
|
4451
|
+
lines.push(currentLine);
|
|
4452
|
+
currentLine = word;
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4455
|
+
lines.push(currentLine);
|
|
4456
|
+
return lines;
|
|
4457
|
+
};
|
|
4458
|
+
_handleOpacityChange = new WeakSet();
|
|
4459
|
+
handleOpacityChange_fn = function(e2) {
|
|
4460
|
+
this.opacity = e2.detail;
|
|
4461
|
+
if (__privateGet(this, _gtLayer)) {
|
|
4462
|
+
__privateGet(this, _gtLayer).setOpacity(this.opacity);
|
|
4463
|
+
}
|
|
4464
|
+
};
|
|
4465
|
+
_handleColorMapChange = new WeakSet();
|
|
4466
|
+
handleColorMapChange_fn = function(e2) {
|
|
4467
|
+
const selectedColormap = e2.detail;
|
|
4468
|
+
if (__privateGet(this, _gtLayer) && __privateGet(this, _gtLayer).getSource()) {
|
|
4469
|
+
this.colorMapName = selectedColormap;
|
|
4470
|
+
this.applyColorToLayer(__privateGet(this, _gtLayer).getSource(), this.colorMapName);
|
|
4471
|
+
}
|
|
4472
|
+
};
|
|
4473
|
+
_abortJobStatusTask = new WeakSet();
|
|
4474
|
+
abortJobStatusTask_fn = function() {
|
|
4475
|
+
__privateGet(this, _controller).cancelJob();
|
|
4476
|
+
};
|
|
4477
|
+
_getNumberOfPoints = new WeakSet();
|
|
4478
|
+
getNumberOfPoints_fn = function(line) {
|
|
4479
|
+
const length = getLength(line);
|
|
4480
|
+
let pointCount;
|
|
4481
|
+
if (length > 100) {
|
|
4482
|
+
pointCount = length / 1e3 / 60;
|
|
4483
|
+
} else {
|
|
4484
|
+
pointCount = length / 10;
|
|
4485
|
+
}
|
|
4486
|
+
return Math.max(2, Math.round(pointCount));
|
|
4487
|
+
};
|
|
4488
|
+
_quantizeLineString = new WeakSet();
|
|
4489
|
+
quantizeLineString_fn = function(geo) {
|
|
4490
|
+
const numPoints = __privateMethod(this, _getNumberOfPoints, getNumberOfPoints_fn).call(this, geo);
|
|
4491
|
+
const points = [];
|
|
4492
|
+
for (let i = 0; i <= numPoints; i++) {
|
|
4493
|
+
const fraction = i / numPoints;
|
|
4494
|
+
points.push(geo.getCoordinateAt(fraction));
|
|
4495
|
+
}
|
|
4496
|
+
return points;
|
|
4497
|
+
};
|
|
4498
|
+
_minifyMapPopover = new WeakSet();
|
|
4499
|
+
minifyMapPopover_fn = function() {
|
|
4500
|
+
this.minimized = !this.minimized;
|
|
4501
|
+
};
|
|
4502
|
+
_cleanUpMap = new WeakSet();
|
|
4503
|
+
cleanUpMap_fn = function() {
|
|
4504
|
+
var _a;
|
|
4505
|
+
this.toggleState = false;
|
|
4506
|
+
if (this.innerMap && __privateGet(this, _draw)) {
|
|
4507
|
+
this.innerMap.removeInteraction(__privateGet(this, _draw));
|
|
4508
|
+
this.innerMap.removeLayer("profile-line");
|
|
4509
|
+
}
|
|
4510
|
+
(_a = __privateGet(this, _vectorSource)) == null ? void 0 : _a.clear();
|
|
4511
|
+
__privateSet(this, _draw, null);
|
|
4512
|
+
__privateSet(this, _vectorLayer, null);
|
|
4513
|
+
__privateSet(this, _vectorSource, null);
|
|
4514
|
+
};
|
|
4515
|
+
_getRasterValueAtCoordinate = new WeakSet();
|
|
4516
|
+
getRasterValueAtCoordinate_fn = function(coord) {
|
|
4517
|
+
if (!this.innerMap || !__privateGet(this, _gtLayer))
|
|
4518
|
+
return NaN;
|
|
4519
|
+
const pixel = this.innerMap.getPixelFromCoordinate(coord);
|
|
4520
|
+
if (!pixel)
|
|
4521
|
+
return NaN;
|
|
4522
|
+
const data = __privateGet(this, _gtLayer).getData(pixel);
|
|
4523
|
+
if (!data)
|
|
4524
|
+
return NaN;
|
|
4525
|
+
if (data instanceof Uint8Array || data instanceof Uint8ClampedArray || data instanceof Float32Array) {
|
|
4526
|
+
return !isNaN(data[0]) ? data[0] : NaN;
|
|
4527
|
+
}
|
|
4528
|
+
if (data instanceof DataView) {
|
|
4529
|
+
const val = data.getFloat32(0, true);
|
|
4530
|
+
return !isNaN(val) ? val : NaN;
|
|
4531
|
+
}
|
|
4532
|
+
return NaN;
|
|
4533
|
+
};
|
|
4534
|
+
_handleCheckBoxToggle = new WeakSet();
|
|
4535
|
+
handleCheckBoxToggle_fn = function(e2) {
|
|
4536
|
+
var isToggled = e2.detail;
|
|
4537
|
+
if (isToggled) {
|
|
4538
|
+
this.toggleState = isToggled;
|
|
4539
|
+
__privateSet(this, _vectorSource, new Vector_default({ wrapX: false }));
|
|
4540
|
+
__privateSet(this, _vectorLayer, new Vector_default2({
|
|
4541
|
+
source: __privateGet(this, _vectorSource)
|
|
4542
|
+
}));
|
|
4543
|
+
__privateSet(this, _draw, new Draw_default({
|
|
4544
|
+
source: __privateGet(this, _vectorSource),
|
|
4545
|
+
type: "LineString"
|
|
4546
|
+
}));
|
|
4547
|
+
if (this.innerMap) {
|
|
4548
|
+
this.innerMap.addLayer(__privateGet(this, _vectorLayer), {
|
|
4549
|
+
name: "profile-line",
|
|
4550
|
+
position: "top"
|
|
4551
|
+
});
|
|
4552
|
+
this.innerMap.addInteraction(__privateGet(this, _draw));
|
|
4553
|
+
__privateGet(this, _draw).on("drawend", (event) => {
|
|
4554
|
+
var _a;
|
|
4555
|
+
const line = event.feature.getGeometry();
|
|
4556
|
+
const coords = __privateMethod(this, _quantizeLineString, quantizeLineString_fn).call(this, line);
|
|
4557
|
+
const pointFeatures = coords.map(
|
|
4558
|
+
(coord) => new Feature_default({
|
|
4559
|
+
geometry: new Point_default(coord)
|
|
4560
|
+
})
|
|
4561
|
+
);
|
|
4562
|
+
(_a = __privateGet(this, _vectorSource)) == null ? void 0 : _a.addFeatures(pointFeatures);
|
|
4563
|
+
const rasterValues = coords.map(
|
|
4564
|
+
(coord) => __privateMethod(this, _getRasterValueAtCoordinate, getRasterValueAtCoordinate_fn).call(this, coord)
|
|
4565
|
+
);
|
|
4566
|
+
const xValues = coords.map((_, index) => index);
|
|
4567
|
+
const lonLatCoords = coords.map((coord) => {
|
|
4568
|
+
const [lon, lat] = toLonLat(coord);
|
|
4569
|
+
const val = __privateMethod(this, _getRasterValueAtCoordinate, getRasterValueAtCoordinate_fn).call(this, coord);
|
|
4570
|
+
const rastervalue = !isNaN(val) ? val.toExponential(4) : "N/A";
|
|
4571
|
+
return [
|
|
4572
|
+
parseFloat(lon.toFixed(2)),
|
|
4573
|
+
parseFloat(lat.toFixed(2)),
|
|
4574
|
+
rastervalue
|
|
4575
|
+
];
|
|
4576
|
+
});
|
|
4577
|
+
const hoverTexts = lonLatCoords.map((coord, idx) => {
|
|
4578
|
+
const x = idx;
|
|
4579
|
+
const value = coord[2];
|
|
4580
|
+
return `Index: ${x}<br>Value: ${value}<br>Coordinates: [${coord[0]}, ${coord[1]}]`;
|
|
4581
|
+
});
|
|
4582
|
+
this.plotData = [
|
|
4583
|
+
{
|
|
4584
|
+
x: xValues,
|
|
4585
|
+
y: rasterValues,
|
|
4586
|
+
text: hoverTexts,
|
|
4587
|
+
hoverinfo: "text",
|
|
4588
|
+
type: "scatter",
|
|
4589
|
+
mode: "lines+markers",
|
|
4590
|
+
line: { color: "blue" }
|
|
4591
|
+
}
|
|
4592
|
+
];
|
|
4593
|
+
this.layout = {
|
|
4594
|
+
title: "Data Profile",
|
|
4595
|
+
xaxis: {
|
|
4596
|
+
title: "Point Index"
|
|
4597
|
+
},
|
|
4598
|
+
yaxis: {
|
|
4599
|
+
title: `Cloud Coverage (${this.metadata["units"]})`,
|
|
4600
|
+
tickformat: ".2e"
|
|
4601
|
+
}
|
|
4602
|
+
};
|
|
4603
|
+
});
|
|
4604
|
+
}
|
|
4605
|
+
} else {
|
|
4606
|
+
__privateMethod(this, _cleanUpMap, cleanUpMap_fn).call(this);
|
|
4607
|
+
}
|
|
4608
|
+
};
|
|
4609
|
+
_isVariableNotFound = new WeakSet();
|
|
4610
|
+
isVariableNotFound_fn = function() {
|
|
4611
|
+
const variableTaskStatus = this._fetchVariableTask.status;
|
|
4612
|
+
if (variableTaskStatus !== s.COMPLETE) {
|
|
4613
|
+
return false;
|
|
4614
|
+
}
|
|
4615
|
+
const hasVariableRequest = Boolean(this.collection && this.variable);
|
|
4616
|
+
return hasVariableRequest && !this.catalogVariable;
|
|
4617
|
+
};
|
|
4618
|
+
_getErrorMessage = new WeakSet();
|
|
4619
|
+
getErrorMessage_fn = function(error) {
|
|
4620
|
+
return formatHarmonyErrorMessage(error);
|
|
4621
|
+
};
|
|
4622
|
+
TerraTimeAverageMap.styles = [component_styles_default, time_average_map_styles_default];
|
|
4623
|
+
TerraTimeAverageMap.dependencies = {
|
|
4624
|
+
"terra-button": TerraButton,
|
|
4625
|
+
"terra-icon": TerraIcon,
|
|
4626
|
+
"terra-plot-toolbar": TerraPlotToolbar,
|
|
4627
|
+
"terra-loader": TerraLoader,
|
|
4628
|
+
"terra-plot": TerraPlot,
|
|
4629
|
+
"terra-alert": TerraAlert,
|
|
4630
|
+
"terra-map": TerraMap
|
|
4631
|
+
};
|
|
4632
|
+
__decorateClass([
|
|
4633
|
+
n({ reflect: true })
|
|
4634
|
+
], TerraTimeAverageMap.prototype, "collection", 2);
|
|
4635
|
+
__decorateClass([
|
|
4636
|
+
n({ reflect: true })
|
|
4637
|
+
], TerraTimeAverageMap.prototype, "variable", 2);
|
|
4638
|
+
__decorateClass([
|
|
4639
|
+
n({ attribute: "start-date", reflect: true })
|
|
4640
|
+
], TerraTimeAverageMap.prototype, "startDate", 2);
|
|
4641
|
+
__decorateClass([
|
|
4642
|
+
n({ attribute: "end-date", reflect: true })
|
|
4643
|
+
], TerraTimeAverageMap.prototype, "endDate", 2);
|
|
4644
|
+
__decorateClass([
|
|
4645
|
+
n({ reflect: true })
|
|
4646
|
+
], TerraTimeAverageMap.prototype, "location", 2);
|
|
4647
|
+
__decorateClass([
|
|
4648
|
+
n({
|
|
4649
|
+
attribute: "bearer-token",
|
|
4650
|
+
reflect: false,
|
|
4651
|
+
converter: undefinedStringConverter
|
|
4652
|
+
})
|
|
4653
|
+
], TerraTimeAverageMap.prototype, "bearerToken", 2);
|
|
4654
|
+
__decorateClass([
|
|
4655
|
+
n({ type: String })
|
|
4656
|
+
], TerraTimeAverageMap.prototype, "long_name", 2);
|
|
4657
|
+
__decorateClass([
|
|
4658
|
+
n({ type: String, attribute: "color-map-name", reflect: true })
|
|
4659
|
+
], TerraTimeAverageMap.prototype, "colorMapName", 2);
|
|
4660
|
+
__decorateClass([
|
|
4661
|
+
n({ type: Number })
|
|
4662
|
+
], TerraTimeAverageMap.prototype, "opacity", 2);
|
|
4663
|
+
__decorateClass([
|
|
4664
|
+
n({ attribute: "application-id" })
|
|
4665
|
+
], TerraTimeAverageMap.prototype, "applicationId", 2);
|
|
4666
|
+
__decorateClass([
|
|
4667
|
+
n({ type: Boolean, attribute: "no-cache" })
|
|
4668
|
+
], TerraTimeAverageMap.prototype, "noCache", 2);
|
|
4669
|
+
__decorateClass([
|
|
4670
|
+
n({ type: Boolean })
|
|
4671
|
+
], TerraTimeAverageMap.prototype, "cache", 1);
|
|
4672
|
+
__decorateClass([
|
|
4673
|
+
n({ attribute: "job-id" })
|
|
4674
|
+
], TerraTimeAverageMap.prototype, "jobId", 2);
|
|
4675
|
+
__decorateClass([
|
|
4676
|
+
n({ type: Boolean, attribute: "show-help" })
|
|
4677
|
+
], TerraTimeAverageMap.prototype, "showHelp", 2);
|
|
4678
|
+
__decorateClass([
|
|
4679
|
+
r()
|
|
4680
|
+
], TerraTimeAverageMap.prototype, "catalogVariable", 2);
|
|
4681
|
+
__decorateClass([
|
|
4682
|
+
r()
|
|
4683
|
+
], TerraTimeAverageMap.prototype, "pixelValue", 2);
|
|
4684
|
+
__decorateClass([
|
|
4685
|
+
r()
|
|
4686
|
+
], TerraTimeAverageMap.prototype, "pixelCoordinates", 2);
|
|
4687
|
+
__decorateClass([
|
|
4688
|
+
r()
|
|
4689
|
+
], TerraTimeAverageMap.prototype, "metadata", 2);
|
|
4690
|
+
__decorateClass([
|
|
4691
|
+
r()
|
|
4692
|
+
], TerraTimeAverageMap.prototype, "toggleState", 2);
|
|
4693
|
+
__decorateClass([
|
|
4694
|
+
r()
|
|
4695
|
+
], TerraTimeAverageMap.prototype, "minimized", 2);
|
|
4696
|
+
__decorateClass([
|
|
4697
|
+
r()
|
|
4698
|
+
], TerraTimeAverageMap.prototype, "noDataValue", 2);
|
|
4699
|
+
__decorateClass([
|
|
4700
|
+
r()
|
|
4701
|
+
], TerraTimeAverageMap.prototype, "min", 2);
|
|
4702
|
+
__decorateClass([
|
|
4703
|
+
r()
|
|
4704
|
+
], TerraTimeAverageMap.prototype, "max", 2);
|
|
4705
|
+
__decorateClass([
|
|
4706
|
+
r()
|
|
4707
|
+
], TerraTimeAverageMap.prototype, "legendValues", 2);
|
|
4708
|
+
__decorateClass([
|
|
4709
|
+
r()
|
|
4710
|
+
], TerraTimeAverageMap.prototype, "timeAverageMapError", 2);
|
|
4711
|
+
__decorateClass([
|
|
4712
|
+
e("terra-map")
|
|
4713
|
+
], TerraTimeAverageMap.prototype, "innerMap", 2);
|
|
4714
|
+
__decorateClass([
|
|
4715
|
+
r()
|
|
4716
|
+
], TerraTimeAverageMap.prototype, "colormaps", 2);
|
|
4717
|
+
__decorateClass([
|
|
4718
|
+
r()
|
|
4719
|
+
], TerraTimeAverageMap.prototype, "plotData", 2);
|
|
4720
|
+
__decorateClass([
|
|
4721
|
+
r()
|
|
4722
|
+
], TerraTimeAverageMap.prototype, "layout", 2);
|
|
4723
|
+
__decorateClass([
|
|
4724
|
+
r()
|
|
4725
|
+
], TerraTimeAverageMap.prototype, "harmonyJobId", 2);
|
|
4726
|
+
__decorateClass([
|
|
4727
|
+
watch(["startDate", "endDate", "location", "catalogVariable"])
|
|
4728
|
+
], TerraTimeAverageMap.prototype, "handlePropertyChange", 1);
|
|
4729
|
+
__decorateClass([
|
|
4730
|
+
watch(["colorMapName", "opacity"])
|
|
4731
|
+
], TerraTimeAverageMap.prototype, "handlePlotOptionsChange", 1);
|
|
4732
|
+
|
|
4733
|
+
export {
|
|
4734
|
+
TerraTimeAverageMap
|
|
4735
|
+
};
|