1
2
3
4
5
6
7
8
9
// Get the sublayer to exploreconst ancestrySublayer = layer.sublayers.find((sublayer) => {
return sublayer.title === "% population with selected ancestry";
});
ancestrySublayer.createFeatureLayer().then((ancestryFeatureLayer) => {
// use the feature layer instance for some other purpose,// such as generating a renderer});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Set LayerList with two content elements in the same panel// 1. A div element containing the select elements for data exploration// 2. a legend instanceconst layerList = new LayerList({
view: view,
listItemCreatedFunction: (event) => {
const item = event.item;
item.panel = {
content: [document.getElementById("infoDiv"), "legend"],
open: true };
}
});
view.ui.add(layerList, "top-right");