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AEC,UAAWoB,EAAUnB,SAAU,WAAYC,MAAO,GAClE,CACF,CAxDIoB,CAAkBtC,EAAUyB,IAAKzB,EAAUK,MA0D/CN,eAA4BM,EAAMJ,GAChC,IAAIsC,EAAeV,SAASC,cAAc,OAC1CS,EAAaR,UAAY,+CACzB,IAAIS,EAAqBX,SAASC,cAAc,OAGhD,GAFAS,EAAaN,OAAOO,GAEhBvC,EAAsBwC,QAAUC,OAAOC,KAAK1C,EAAsBwC,QAAQd,OAAS,EAAG,CACxE,IAAI,IAAU,CAC5BtB,KAAMA,EACN8B,UAAWK,EACXI,wBAA0BC,IACxB,MAAMC,EAAOD,EAAMC,KACf7C,EAAsBwC,OAAOK,EAAKC,QAAQC,iBAC5CF,EAAKG,gBAAkB,CACrB,CACE,CAAEF,MAAO,mBAAoBG,UAAW,eAAgBC,GAAI,oBAC5D,CAAEJ,MAAO,mBAAoBG,UAAW,iBAAkBC,GAAI,sBAGpE,IAIMC,GAAG,kBAAmBP,IAC9B,MAAMQ,EAAeR,EAAMC,KAAKQ,MAC1BH,EAAKN,EAAMU,OAAOJ,GACb,qBAAPA,EACEE,EAAaG,QAAU,IACzBH,EAAaG,SAAW,KAEV,qBAAPL,GACLE,EAAaG,QAAU,IACzBH,EAAaG,SAAW,IAE5B,IAGF,IAAIC,EAAe,IAAI,IAAO,CAC5BpD,KAAMA,EACNQ,QAAS0B,EACTF,WAAY,WAEdhC,EAAKS,GAAGC,IAAI0C,EAAc,WAAY,EACxC,CACF,CArGIC,CAAa1D,EAAUK,KAAMJ,GAE7BE,GAAS,GAEb,C","sources":["webpack://wingismaps/./src/UI/simpleUI.js"],"sourcesContent":["import Home from \"@arcgis/core/widgets/Home.js\";\r\nimport Compass from \"@arcgis/core/widgets/Compass.js\";\r\nimport Zoom from \"@arcgis/core/widgets/Zoom.js\";\r\nimport ScaleBar from \"@arcgis/core/widgets/ScaleBar.js\";\r\nimport Print from \"@arcgis/core/widgets/Print.js\";\r\nimport Expand from \"@arcgis/core/widgets/Expand.js\";\r\nimport LocalBasemapsSource from \"@arcgis/core/widgets/BasemapGallery/support/LocalBasemapsSource.js\";\r\nimport BasemapGallery from \"@arcgis/core/widgets/BasemapGallery.js\";\r\nimport LayerList from \"@arcgis/core/widgets/LayerList.js\";\r\nimport mobileAndTabletCheck from \"../util/checkifmobile\";\r\n\r\n\r\n\r\nexport default async function (WinGISMap, conditionalMapOptions) {\r\n return new Promise((resolve, reject) => {\r\n addMiscControls(WinGISMap.view); \r\n addBasemapGallery(WinGISMap.map, WinGISMap.view);\r\n addLayerList(WinGISMap.view, conditionalMapOptions);\r\n\r\n resolve();\r\n });\r\n}\r\n\r\nasync function addMiscControls(view) {\r\n\r\n let prExpand = new Expand({ view: view });\r\n let print = new Print({\r\n mode: \"auto\",\r\n view: view,\r\n printServiceUrl: wgPrintService,\r\n templateOptions: { legendEnabled: false }\r\n });\r\n prExpand.content = print;\r\n view.ui.add({ component: prExpand, position: \"top-left\", index: 1 });\r\n\r\n let home = new Home({ view: view });\r\n view.ui.add({ component: home, position: \"top-left\", index: 4 });\r\n\r\n let zoom = new Zoom({ view: view });\r\n view.ui.add({ component: zoom, position: \"top-left\", index: 3 });\r\n\r\n\r\n\r\n let compass = new Compass({ view: view });\r\n view.ui.add({ component: compass, position: \"top-right\", index: 0 });\r\n\r\n let scaleBar = new ScaleBar({ view: view, unit: \"imperial\" });\r\n view.ui.add(scaleBar, \"bottom-right\");\r\n}\r\n\r\nasync function addBasemapGallery(map, view) {\r\n if (map.basemaps.length > 1) {\r\n let basemapDiv = document.createElement('div'); \r\n basemapDiv.innerHTML = ``; \r\n let basemapContainer = document.createElement('div');\r\n basemapDiv.append(basemapContainer);\r\n\r\n let basemapGallery = new BasemapGallery({\r\n source: new LocalBasemapsSource({ basemaps: map.basemaps }),\r\n view: view,\r\n container: basemapContainer\r\n });\r\n\r\n let bgExpand = new Expand({\r\n view: view,\r\n content: basemapDiv,\r\n mode: \"floating\",\r\n expandIcon: \"basemap\"\r\n });\r\n\r\n view.ui.add({ component: bgExpand, position: \"top-left\", index: 2 });\r\n }\r\n}\r\n\r\nasync function addLayerList(view, conditionalMapOptions) {\r\n let layerListDiv = document.createElement('div');\r\n layerListDiv.innerHTML = ``;\r\n let layerListContainer = document.createElement('div');\r\n layerListDiv.append(layerListContainer);\r\n\r\n if (conditionalMapOptions.layers && Object.keys(conditionalMapOptions.layers).length > 0) {\r\n let layerList = new LayerList({\r\n view: view,\r\n container: layerListContainer,\r\n listItemCreatedFunction: (event) => {\r\n const item = event.item;\r\n if (conditionalMapOptions.layers[item.title]?.opacityToggler) {\r\n item.actionsSections = [\r\n [\r\n { title: \"Increase opacity\", className: \"esri-icon-up\", id: \"increase-opacity\" },\r\n { title: \"Decrease opacity\", className: \"esri-icon-down\", id: \"decrease-opacity\" }\r\n ]\r\n ];\r\n }\r\n }\r\n });\r\n\r\n layerList.on(\"trigger-action\", (event) => {\r\n const visibleLayer = event.item.layer;\r\n const id = event.action.id;\r\n if (id === \"increase-opacity\") {\r\n if (visibleLayer.opacity < 1) {\r\n visibleLayer.opacity += 0.25;\r\n }\r\n } else if (id === \"decrease-opacity\") {\r\n if (visibleLayer.opacity > 0) {\r\n visibleLayer.opacity -= 0.25;\r\n }\r\n }\r\n });\r\n\r\n let layersExpand = new Expand({\r\n view: view,\r\n content: layerListDiv,\r\n expandIcon: \"layers\"\r\n });\r\n view.ui.add(layersExpand, \"top-left\", 5);\r\n }\r\n}\r\n"],"names":["async","WinGISMap","conditionalMapOptions","Promise","resolve","reject","view","prExpand","print","mode","printServiceUrl","wgPrintService","templateOptions","legendEnabled","content","ui","add","component","position","index","home","zoom","compass","scaleBar","unit","addMiscControls","map","basemaps","length","basemapDiv","document","createElement","innerHTML","basemapContainer","append","source","container","bgExpand","expandIcon","addBasemapGallery","layerListDiv","layerListContainer","layers","Object","keys","listItemCreatedFunction","event","item","title","opacityToggler","actionsSections","className","id","on","visibleLayer","layer","action","opacity","layersExpand","addLayerList"],"sourceRoot":""}