Draw a line in nodered-world-map

Hi nodered experts,

Is there an easier version on how to draw a "link" or a line to world-map dashboard?
similar to this:

If this is not possible, and I need to hard coded all the "linked" devices manually, then any suggestion to make easier is highly appreciated.

Thanks!

Regards,
Henjoe

Hi @Henjoe

I'm no expert at dashboard, but this sounds like something the SVG node is for? by @BartButenaers

Hi, I'm not quite sure what you are asking for, but you can add lines as per the docs https://flows.nodered.org/node/node-red-contrib-web-worldmap.
If you are recording movement then the tracks node may be able to capture the points needed.

1 Like

Hi @dceejay how track node works? Do we have sample sample flow to use this?
I think that's what I need, basically I want to create "pipelines" for water distribution network, however, hardcoding all those "pipes" in a map is a bunch of work. I need something that simply just draw a line from the world map and animate it via "hardcoding".

Ah no - the tracks node is more for tracking (say) a car or phone as it moves... If you want to draw lines then the drawing layer is probably more useful. If you use that to draw a layer - and add a worldmap in node set to watch for drawing events - when you draw a line you should get a set of points back that you caould save and replay whenever you need it.

Hi @dceejay thanks for the information, I will look on this.

Upon searching I also found this tool geojson.io that allows you draw (lines, circle, polygons and arcs) and automatically create a geojson file for you, you can then feed this geojson to worldmap panel and it works fine.

Here is a sample: (geojson was created in geojson.io then fed in worldmap node)

However, I am actually afraid for it's scalability and performance specially when getting "real-time" live data from sensors, supposed I have 10,000 of sensors and feeding in here in the geojson file could make the performance slow.
Other point I noticed:

  1. I cannot customized icon in the geojson of type "point" while the node-red-map it allows it by just using payload = {icon: "your icon"}
  2. I tried to load almost 325Mb size of Geojson file and it crashed the system (lol).

Any thoughts of this? @dceejay

Thanks and regards,
Henjoe

  1. I think if you add a "marker-symbol" property to each feature (as per Mapbox spec - https://github.com/mapbox/simplestyle-spec/tree/master/1.1.0` ) - but using the Font Awesome 4.7 icon names then you should be able to customise the markers. (and also "marker-color" )

  2. yeah - well - need more memory dedicated to Node-RED :slight_smile: ... I would think you would be better having your geojson somehow split into sections (eld in some sort of store/db) - that can be loaded only when needed - eg when in the view window - and at a certain zoom level.

From the pop-up in the geojson sample I wonder whether you have a ton of metadata associated with each line. If so, strip that for the stuff you load into the world map. You have to keep the data in the worldmap minimal. If you want to display additional data when the user clicks on a line, then use a "line_id" or similar identifier to query a database and retrieve the extra data from there.

Thanks for confirmation, I am thinking the same too to have it split in a section :slightly_smiling_face:

Regards,
Henjoe

Hi @tve , thanks for suggesting, I am actually new in worlmap node, how does metadata works in relation to geojson?

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