Skip to content

Instantly share code, notes, and snippets.

@nommuna2
Last active April 26, 2019 21:35
Show Gist options
  • Save nommuna2/d77ba0317f9e01e7a14142fa75a827c1 to your computer and use it in GitHub Desktop.
Save nommuna2/d77ba0317f9e01e7a14142fa75a827c1 to your computer and use it in GitHub Desktop.
(ArcGIS API for JavaScript) Sample of how to add an arrow to the end of a line in the Legend using js
//Make sure the layer is loaded, the query all path elements and add the attribute to the specific path you want
fl.on("update-end", (e) => {
document.querySelectorAll("* path").forEach((e,i) => {
if(i === 3){
e.setAttribute("marker-start", "url(#marker_map_0_0_0_start)");
e.setAttribute("marker-end", "url(#marker_map_0_0_0_end)");
}
console.log(e);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment