Is there is anyway to use Custom Icon in Worldmap node?

Hey There.

i would like to plot points on the map using worldmap node, so far i have been successful in that, the problem is that i would like to use custom icons which are not part of the font-awesome or the emojis which are accepted by the worldmap.

i have seen an earlier post that showed that the worldmap can get the icon from a website, however this doesn't work for me as my project is offline and not connected to the internet.

is it possible to fetch the icons from a local folder and plot them on the map??, any help would be appreciated.

Node-RED is itself a web server - which is where you are loading the worldmap from - so you can edit your settings.js file to set up a local directory to serve files from. se the httpStatic setting.

Hey dceejay.

thank you for your reply, i have setup the folder in the httpstatic to serve my files from, however i am still having difficulty in placing the name of the icon in my payload so it gets displayed on the map any hint on how i can make it?

you should be able to just set msg.payload.icon to the required url something like http://my-node-red-server:1880/my-static-path/icon.png . You should also be able to load that direct for another browser session.
You can also set msg.payload.iconSize to set the size of icon - otherwise it will get forced to 32x32px

Hey dceejay.
i have tried the solution above yet i got an error

my httpstatic is in the below pic:

when i have tried the link as per your solution above its providing me the following error:


i have tried it in http and https and both were not able to provide the icon in the browser.

Note: i have restarted the node red once i have done changes on the settings file.

so that would then be served as http://{your server is address}:1880/Computer.png

Dear dceejay.

i managed to figure it out, turns out that there is no need to write down the "my-static-path" in the url.

it is sufficient to write only https://node-red-server:1880/icon.png, this worked like a charm for me hope it will help the others.

1 Like

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