Create a legend on the map

Hello everyone, I have a problem with obtaining a legend on the map that presents the "worldmap" node. I have accessed the document: "node-red-contrib-web-worldmap 2.37.4" and in its "command" section it says to obtain the legend: "(To add and remove a legend
If you want to add a small legend overlay

msg.payload.command = { "legend": "Title
<i style="background: #477AC2"> Water
<i style=\ "background: #448D40">Forest
" };
To remove set the legend to an empty string ."")". dedicating a function node to it and applying the message, I can't see the example.
Could someone help me? How should I compose the message? I don't know JSON very well.
Thank you

Here is that example as a flow

[{"id":"580d66cc9df1f9f5","type":"inject","z":"abdd6f69c1e320b7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":130,"y":180,"wires":[["b76750ca4e7343c9"]]},{"id":"b76750ca4e7343c9","type":"function","z":"abdd6f69c1e320b7","name":"function 1","func":"msg.payload ={};\nmsg.payload.command = { \"legend\": \"<b>Title</b></br><i style=\\\"background: #477AC2\\\"></i> Water<br><i style=\\\"background: #448D40\\\"></i> Forest<br>\" };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":180,"wires":[["59a42f2604899c31"]]},{"id":"59a42f2604899c31","type":"worldmap","z":"abdd6f69c1e320b7","name":"","lat":"","lon":"","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"false","showgrid":"false","showruler":"false","allowFileDrop":"false","path":"/worldmap","overlist":"DR,CO,RA,DN,HM","maplist":"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS","mapname":"","mapurl":"","mapopt":"","mapwms":false,"x":520,"y":180,"wires":[]}]

Hello and thank you very much for giving me a hand so soon. I see that you have described the complete FLOW to me, thank you very much.
Jaime

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