<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create a Custom Layer Selector in ExB Developer Edition. Calcite or Other Approach? in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1525652#M14435</link>
    <description>&lt;P&gt;Thanks Tim. &amp;nbsp;I’m going to unpack your response and thanks for the kickstart. I’ll have a look at the react approach as well. Very helpful.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 10:41:48 GMT</pubDate>
    <dc:creator>GregReinecke</dc:creator>
    <dc:date>2024-08-22T10:41:48Z</dc:date>
    <item>
      <title>Create a Custom Layer Selector in ExB Developer Edition. Calcite or Other Approach?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1523339#M14359</link>
      <description>&lt;P&gt;I'm trying to create a custom layer widget which would be open and look something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LayerSelector.png" style="width: 363px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112716i8D4A819D1E003E57/image-size/large?v=v2&amp;amp;px=999" role="button" title="LayerSelector.png" alt="LayerSelector.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the above example using the calcite component example provided in the resources folder and then put it in my &amp;gt; client &amp;gt; your-extensions &amp;gt; widgets folder.&amp;nbsp; I modified the widget.tsx code to reflect my target layers.&amp;nbsp; I just don't know where or with what code to add the layers URL/feature layer info that would correspond to each checkbox.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import { React, type AllWidgetProps } from 'jimu-core'
import { type IMConfig } from '../config'
/**
 * Use this way, the @esri/calcite-components-react code will be compiled into widget entry, which makes widget size large.
 *    `import { CalciteButton, CalciteIcon, CalciteSlider } from '@esri/calcite-components-react'`
 * So, we should use the below way.
 */
import { CalciteButton, CalciteIcon, CalciteSlider } from 'calcite-components'

const Widget = (props: AllWidgetProps&amp;lt;IMConfig&amp;gt;) =&amp;gt; {
  const text = props.config.text

  const [sliderValue, setSliderValue] = React.useState(50)

  return (
    &amp;lt;div className="widget-calcite jimu-widget m-2"&amp;gt;
      &amp;lt;div className="App"&amp;gt;
        &amp;lt;h5&amp;gt; Ancillary Layer Selector&amp;lt;/h5&amp;gt;
	&amp;lt;calcite-label layout="inline"&amp;gt;
    		&amp;lt;calcite-checkbox&amp;gt;&amp;lt;/calcite-checkbox&amp;gt;
    		Parks
	&amp;lt;/calcite-label&amp;gt;
	&amp;lt;calcite-label layout="inline"&amp;gt;
    		&amp;lt;calcite-checkbox&amp;gt;&amp;lt;/calcite-checkbox&amp;gt;
    		Transit Stops
	&amp;lt;/calcite-label&amp;gt;
	&amp;lt;calcite-label layout="inline"&amp;gt;
    		&amp;lt;calcite-checkbox&amp;gt;&amp;lt;/calcite-checkbox&amp;gt;
    		Grocery Stores
	&amp;lt;/calcite-label&amp;gt;
	&amp;lt;calcite-label layout="inline"&amp;gt;
    		&amp;lt;calcite-checkbox&amp;gt;&amp;lt;/calcite-checkbox&amp;gt;
    		Libraries
	&amp;lt;/calcite-label&amp;gt;
	&amp;lt;calcite-label layout="inline"&amp;gt;
    		&amp;lt;calcite-checkbox&amp;gt;&amp;lt;/calcite-checkbox&amp;gt;
    		Unfavorable POIs
	&amp;lt;/calcite-label&amp;gt;
     &amp;lt;CalciteIcon icon/&amp;gt; 
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

export default Widget&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Any advice or a different approach would be helpful. Thanks in advance.&lt;/P&gt;&lt;P&gt;GRMapper&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 21:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1523339#M14359</guid>
      <dc:creator>GregReinecke</dc:creator>
      <dc:date>2024-08-18T21:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Layer Selector in ExB Developer Edition. Calcite or Other Approach?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1525158#M14413</link>
      <description>&lt;P&gt;There are a couple of ways to approach this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You may need to create a settings.tsx file and have named sources to setup for each layer.&lt;/LI&gt;&lt;LI&gt;You have the option of hard coding them, but I usually prefer to avoid that, because if the experience is ever shifted to another domain, then if those services move, you have to update and republish the custom widget.&amp;nbsp; Using a settings screen in the dashboard editor allows you to reassign them more dynamically, and not be slaved to&amp;nbsp; a programing GIS developer's availability to make those changes.&lt;BR /&gt;&lt;BR /&gt;Note: I see you are using the more HTML version of Calcite, rather than the react calcite component versions.&amp;nbsp; I believe those can still work, but that also may play a role in the ultimate look of this one.&lt;BR /&gt;&lt;BR /&gt;Once you have a way to add all the layers you want to control.&amp;nbsp; (And in theory you could have a text box for the name of each one to capture and associate with each one you add so you can add layers easily too), you would then need a way based on the index of the check box buttons, to decide which layers you are hiding/making visible.&lt;BR /&gt;&lt;BR /&gt;Now once you know the index, and how it maps in code to the data source, then you may be able to toggle visibility I believe.&amp;nbsp; &amp;nbsp;(I don't have a good example of doing the visibility toggle in code handy though)&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 21 Aug 2024 15:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1525158#M14413</guid>
      <dc:creator>TimWestern</dc:creator>
      <dc:date>2024-08-21T15:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Layer Selector in ExB Developer Edition. Calcite or Other Approach?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1525652#M14435</link>
      <description>&lt;P&gt;Thanks Tim. &amp;nbsp;I’m going to unpack your response and thanks for the kickstart. I’ll have a look at the react approach as well. Very helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 10:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/create-a-custom-layer-selector-in-exb-developer/m-p/1525652#M14435</guid>
      <dc:creator>GregReinecke</dc:creator>
      <dc:date>2024-08-22T10:41:48Z</dc:date>
    </item>
  </channel>
</rss>

