Select to view content in your preferred language

How to change layer name using map components

332
2
Jump to solution
03-28-2025 11:48 AM
JaredPilbeam2
MVP Alum

JaredPilbeam2_0-1743187411167.png

  <arcgis-map zoom="13" center="-88.1, 41.5">
    <arcgis-zoom position="top-left"></arcgis-zoom>
    <arcgis-swipe swipe-position="32"></arcgis-swipe>
    <arcgis-expand position="top-right">
      <arcgis-layer-list 
      label="1862 Imagery"
      visibility="checkbox"
      ></arcgis-layer-list>
    </arcgis-expand>
  </arcgis-map>

 

I thought I would be able to change the layer name from AerialBW1862 by using a label property in the Layer List component, but it has no effect. I've tried most other relevant-sounding properties, but still no effect. Here is a sample

0 Kudos
2 Solutions

Accepted Solutions
ReneRubalcava
Esri Frequent Contributor

The layer name comes from the "layer.title", so you can add your own title when you create the layer.

View solution in original post

SteveCole
Honored Contributor

Was just coming to post that. Example mod to your code:

      const image1862 = new ImageryLayer({
        url: "https://gis.willcountyillinois.com/image/rest/services/Orthoimagery/AerialBW1862/ImageServer",
        title: "Aerial Photo",
        maxScale: 3000,
      });

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Esri Frequent Contributor

The layer name comes from the "layer.title", so you can add your own title when you create the layer.

SteveCole
Honored Contributor

Was just coming to post that. Example mod to your code:

      const image1862 = new ImageryLayer({
        url: "https://gis.willcountyillinois.com/image/rest/services/Orthoimagery/AerialBW1862/ImageServer",
        title: "Aerial Photo",
        maxScale: 3000,
      });
0 Kudos