<div dir="ltr">You are correct, it isn't currently possible to add a title, but a PR to add that would be welcome :).</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 15, 2016 at 1:44 PM, Olsen.Erik <span dir="ltr"><<a href="mailto:Olsen.Erik@ensco.com" target="_blank">Olsen.Erik@ensco.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_4174607184779574664WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Jon,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Thanks for the quick response on this, that fixed my problem. Also, just wondering is there a way to add a title to the default legendWidget? Or would I need to extend it and
 write custom code in order to do that?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Erik
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Jonathan Beezley [mailto:<a href="mailto:jonathan.beezley@kitware.com" target="_blank">jonathan.beezley@<wbr>kitware.com</a>]
<br>
<b>Sent:</b> Thursday, December 15, 2016 12:09 PM<br>
<b>To:</b> Olsen.Erik <<a href="mailto:Olsen.Erik@ensco.com" target="_blank">Olsen.Erik@ensco.com</a>><br>
<b>Cc:</b> <a href="mailto:geojs-users@public.kitware.com" target="_blank">geojs-users@public.kitware.com</a><br>
<b>Subject:</b> Re: [Geojs-users] Question about LegendWidget<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Hi Erik,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">The legend predates when we were attempting to normalize how colors are represented.  It looks like it expects a valid CSS representation of color.  You can use the method
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenGeoscience_geojs_blob_master_src_util_init.js-23L305&d=CwMFaQ&c=DsZY2bea7iNIzyp-7sZ0t0F2UfNQZUfZhEPCv_2wBI0&r=sdAMZxqAoPTtVpp0WTsUGE05dS9lBt3NjsK7CxSH_Bc&m=Hy-tQTuLetyz8nCqNejq9Io68RW4huSJDI2WADFlvbM&s=H_DU9f2z_BZkqjS47SJk7eRIDrX7lx_5EBLjX3LckI8&e=" target="_blank">
geo.util.convertColorToHex</a> to convert anything accepted elsewhere in geojs to a hex string.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Jon<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, Dec 15, 2016 at 11:29 AM, Olsen.Erik <<a href="mailto:Olsen.Erik@ensco.com" target="_blank">Olsen.Erik@ensco.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">All,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I have been trying to set a custom color for my rectangles in a LegendWidget I am using. I was looking into the provided example code that said that the fillColor could be a string
 or object. Is there an example of how the fillColor object should be constructed?  <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Here is some example code of what I’m trying to do:<u></u><u></u></p>
<p class="MsoNormal">Note that the uilayer is a reference to a layer that I already made before instantiating the legendWidget.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<pre style="background:white"><b><span style="font-size:9.0pt;color:navy">var </span></b><span style="font-size:9.0pt;color:black">legend = </span><b><span style="font-size:9.0pt;color:green">uilayer</span></b><span style="font-size:9.0pt;color:black">.createWidget(</span><b><span style="font-size:9.0pt;color:green">'legend'</span></b><span style="font-size:9.0pt;color:black">, {<br>    position : {<br>        bottom : </span><span style="font-size:9.0pt;color:blue">0</span><span style="font-size:9.0pt;color:black">,<br>        right: </span><span style="font-size:9.0pt;color:blue">0<br>    </span><span style="font-size:9.0pt;color:black">}<br>});</span><u></u><u></u></pre>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal" style="background:white">
<span style="font-size:9.0pt;font-family:"Courier New";color:black">legend.categories([{<br>
   name : </span><b><span style="font-size:9.0pt;font-family:"Courier New";color:green">"Test"</span></b><span style="font-size:9.0pt;font-family:"Courier New";color:black">,<br>
   style: {<br>
     fill : </span><b><span style="font-size:9.0pt;font-family:"Courier New";color:navy">true</span></b><span style="font-size:9.0pt;font-family:"Courier New";color:black">,<br>
     fillColor: {</span><b><span style="font-size:9.0pt;font-family:"Courier New";color:green">'r'
</span></b><span style="font-size:9.0pt;font-family:"Courier New";color:black">: </span>
<span style="font-size:9.0pt;font-family:"Courier New";color:blue">1</span><span style="font-size:9.0pt;font-family:"Courier New";color:black">,
</span><b><span style="font-size:9.0pt;font-family:"Courier New";color:green">'b'
</span></b><span style="font-size:9.0pt;font-family:"Courier New";color:black">: </span>
<span style="font-size:9.0pt;font-family:"Courier New";color:blue">1</span><span style="font-size:9.0pt;font-family:"Courier New";color:black">,
</span><b><span style="font-size:9.0pt;font-family:"Courier New";color:green">'g'</span></b><span style="font-size:9.0pt;font-family:"Courier New";color:black">:
</span><span style="font-size:9.0pt;font-family:"Courier New";color:blue">0</span><span style="font-size:9.0pt;font-family:"Courier New";color:black">}<br>
    },<br>
   type : </span><b><span style="font-size:9.0pt;font-family:"Courier New";color:green">'rect'<br>
</span></b><span style="font-size:9.0pt;font-family:"Courier New";color:black">}]);</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I was under the assumption that the color object would be an rgb object with values 0 to 1 as I have seen in other places in the geo.js code (specifically the geoJson reader)<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Any help would be appreciated.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Erik<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<h5><span style="color:#969696">The information contained in this email message is intended only for the use of the individual(s) to whom it is addressed and may contain information that is privileged and sensitive. If you are not the intended recipient, or
 otherwise have received this communication in error, please notify the sender immediately by email at the above referenced address and note that any further dissemination, distribution or copying of this communication is strictly prohibited.
<br>
<br>
The U.S. Export Control Laws regulate the export and re-export of technology originating in the United States. This includes the electronic transmission of information and software to foreign countries and to certain foreign nationals. Recipient agrees to abide
 by these laws and their regulations -- including the U.S. Department of Commerce Export Administration Regulations and the U.S. Department of State International Traffic in Arms Regulations -- and not to transfer, by electronic transmission or otherwise, any
 content derived from this email to either a foreign national or a foreign destination in violation of such laws.
</span><u></u><u></u></h5>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
Geojs-users mailing list<br>
<a href="mailto:Geojs-users@public.kitware.com" target="_blank">Geojs-users@public.kitware.com</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__public.kitware.com_mailman_listinfo_geojs-2Dusers&d=CwMFaQ&c=DsZY2bea7iNIzyp-7sZ0t0F2UfNQZUfZhEPCv_2wBI0&r=sdAMZxqAoPTtVpp0WTsUGE05dS9lBt3NjsK7CxSH_Bc&m=Hy-tQTuLetyz8nCqNejq9Io68RW4huSJDI2WADFlvbM&s=AzwwU4RVNu996YFGolsLS-j2MMiuGb7L3RZW3jkr9lo&e=" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/geojs-users</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>