When there is no legend to display (e.g. layers are turned off or otherwise not visible) the legend div defaults to some text "No legend". I would like to change the text used. How do I do this?
Mark,
You will need to replace the default sting in the esriNLS strings:
sample snippet:
<SPAN class="keyword token">var</SPAN> map<SPAN class="punctuation token">;</SPAN> <SPAN class="token function">require</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">"esri/map"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"dojo/i18n!esri/nls/jsapi"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"dojo/domReady!"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>Map<SPAN class="punctuation token">,</SPAN> bundle<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> bundle<SPAN class="punctuation token">.</SPAN>widgets<SPAN class="punctuation token">.</SPAN>legend<SPAN class="punctuation token">.</SPAN>NLS_noLegend <SPAN class="operator token">=</SPAN> <SPAN class="string token">"My No Legend"</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Localization | Guide | ArcGIS API for JavaScript 3.19
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.