Select to view content in your preferred language

Where is layer.id to be set?

333
1
02-01-2024 11:10 AM
SterlingWalsh
New Contributor

according to https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id, the layer.id can be set so that it remains unique and, presumably static. This is not the numeric  layerID value, but layer.id of the form 18d65c0f0b2-layer-29. Where is this changed?

Tags (1)
0 Kudos
1 Reply
JoelBennett
MVP Regular Contributor

You would include the id in the parameters passed to the layer's constructor, for example:

var layer = new FeatureLayer({
	id: "myLayerID",
	url: "https://myServer/arcgis/rest/services/MyService/MapServer/0"
});
0 Kudos