Node-Red-contrib-worldmap using HTML icon in legend

Hi, I was wondering if someone knows if this is possible. The documentation states that it accepts title and color. This is the input string that is sent to do that.

msg.payload = {"command": { "legend": "<b>Title</b></br><i style=\"background: #477AC2\"></i> Water<br><i style=\"background: #448D40\"></i> Forest<br>" } };

return msg;

I have no experience with HTML and was wondering if the <i style="background: #477AC2"> can be changed for an icon.

image

Thanks for your help

Have you tried the example on the flows website?
Note: The example only has one set of curly brackets

msg.payload.command = { "legend": "<b>Title</b></br><i style=\"background: #477AC2\"></i> Water<br><i style=\"background: #448D40\"></i> Forest<br>" };
return msg;

By-the-way, I think you'll find the title of the node is... 'node-red-contrib-web-worldmap'.

It's just html so you can do whatever you like

[{"id":"06bbf073412c4599","type":"function","z":"ba9351cf.2e3e1","name":"function 1","func":"msg.payload= {\n    command : { \n        legend: \"<b>Legend Title</b></br><table><tr width=400px><td><i class=\\\"fa fa-camera-retro\\\"></i> Speed Camera</td></tr><tr><td><i class=\\\"fa fa-shower\\\"></i> Showers</td></tr></table>\" \n    }\n};\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":580,"wires":[["b85644f7c4bf65e7"]]}]

image

2 Likes

Thank you for getting back and this is great news. My application is coming along very nicely, manly because of the amazing job you have done. I’m thinking about making a video about the challenges I had with it and the solution I found. I’m very new to all of this but somehow I get done what I need to.

Cheers

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.