[Geojs-users] Question about LegendWidget
Olsen.Erik
Olsen.Erik at ensco.com
Thu Dec 15 11:29:01 EST 2016
All,
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?
Here is some example code of what I'm trying to do:
Note that the uilayer is a reference to a layer that I already made before instantiating the legendWidget.
var legend = uilayer.createWidget('legend', {
position : {
bottom : 0,
right: 0
}
});
legend.categories([{
name : "Test",
style: {
fill : true,
fillColor: {'r' : 1, 'b' : 1, 'g': 0}
},
type : 'rect'
}]);
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)
Any help would be appreciated.
Thanks,
Erik
________________________________
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/geojs-users/attachments/20161215/80d3c363/attachment.html>
More information about the Geojs-users
mailing list