Change layer name in Editor Widget?

164
0
06-06-2021 04:04 AM
lightpro
New Contributor III

I'm trying to change the display name of a layer in the Editor Widget and I can't get it to work. 

  • Tried to change the title when creating "myfeaturelayer". This only changes the title of the "top-level" not the title of the polygon layer pointed to by the url 
  • Tried to change the title when definings my LayerInfos for the editor widget. This does nothing.

I guess I'm doing something wrong but can't figure it out so any help would be appreciated!

Example code:

 

 

const ordersLayer = new FeatureLayer({
    title: "New Title",
url: "myurl"    
  });
  map.add(ordersLayer);

var editConfigMyLayer = {
    layer: myfeatuelayer,
    title: "New Name",
  };

const editor = new Editor({
    view: view,
    // Pass in the configurations created above
    layerInfos: [
      editConfigMyLayer]
})

view.ui.add(editor, "bottom-right");

 

 

 

0 Replies