1

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.

enter image description here

asked Mar 4, 2020 at 6:46

1 Answer 1

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"); 
answered Apr 4, 2020 at 18:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.