I am working on arcgis map JavaScript API and i want to show map layer legend with close icon but i am unable to find legend load event to show the same. Legend along with close icon is shown in below image.
1 Answer 1
Create a container div first. add the close button on it. Then create a child div inside it and attach the legend to the child div.
<div id="containerDiv">
<button type="button">X</button>
<div id="legendDiv"><div>
</div>
var legend = new Legend({
map: map,
layerInfos: [{
layer: layer1,
title: "Layer1 Legend"
}]
}, "legendDiv");
Explore related questions
See similar questions with these tags.
lang-js