When I create my legend, the name from my published map service is listed at the top of the legend pane. How do I turn if off? I tried setting the title in the Legend widget, and I also tried hiding and replacing the label in my css (see below). Note: I added my feature layer using the URL.
css:
.esri-legend {
background-color: #f3f3f3;
}
.esri-legend__service-label span {
visibility: hidden;
}
.esri-legend__service-label span::after {
content: "Legend";
}
javascript:
view.then(function() {
var legend = new Legend({
view: view,
layerInfos: [{
layer: lyrADT,
title: "Average Daily Traffic"
}]
}, "legendDiv");
legend.startup();
Solved! Go to Solution.
Hi there,
Hopefully, this is what you are asking for.
This will hide layer title in the legend.
.esri-legend__layer-caption {
display: none;
}
This will hide legend title in the legend.
.esri-legend__service-label {
display: none;
}
Hi there,
Hopefully, this is what you are asking for.
This will hide layer title in the legend.
.esri-legend__layer-caption {
display: none;
}
This will hide legend title in the legend.
.esri-legend__service-label {
display: none;
}
Undral,
Yes, that did it! Thanks so much for your help.
I recommend watching the ESRI training video online called Time-Saving Tips for JavaScript Developers, for anyone else who has similar CSS issues with widgets.