# Node-red-contrib-worldmap

**URL:** <https://discourse.nodered.org/t/node-red-contrib-worldmap/2969>\
**Category:** General\
**Created:** [8 September 2018 15:24 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969 "2018-09-08T15:24:52Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 September 2018 15:24 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/1 "2018-09-08T15:24:52Z")

</div>

I was wondering if someone could embarrass me and just post a simple inject-\>worldmap node example that draws a circle around a location as I can't get it do do that ☹

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 September 2018 15:59 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/2 "2018-09-08T15:59:02Z")

</div>

doesn't the example in the readme work for you ?

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [8 September 2018 16:33 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/3 "2018-09-08T16:33:35Z")

</div>

I found this example in my node-RED projects. Probably is the same one from the flows page or perhaps with some modification. Anyway, it is quite simple.

```auto
[{"id":"8118e0cc.d91e5","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"e6ac1fc6.e3157","type":"worldmap","z":"8118e0cc.d91e5","name":"","x":670,"y":200,"wires":[]},{"id":"70f8c8be.5478e8","type":"function","z":"8118e0cc.d91e5","name":"30 meters circle","func":"msg.payload = { lat:51.05, lon:-1.35, name:\"A3090\", radius:30 }\nreturn msg;","outputs":1,"noerr":0,"x":460,"y":200,"wires":[["e6ac1fc6.e3157"]]},{"id":"f5cebbf1.137988","type":"inject","z":"8118e0cc.d91e5","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":290,"y":200,"wires":[["70f8c8be.5478e8"]]}]

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 September 2018 16:54 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/4 "2018-09-08T16:54:04Z")

</div>

> [@dceejay](#):
>
> doesn't the example in the readme work for you ?

I tried this

coverting ths

```auto
msg.payload = { name:"Joe", lat:51.05, lon:-1.35 }

```

to this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1a0c008d177d2b5338f11ee46b554d8d01f38c78.png)

I get very confused with JSON but tried sticking quotes around stuff and still doesn't seem to do anything

I know its me but I've not been lucky with what I've tried ☹

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 September 2018 16:55 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/5 "2018-09-08T16:55:15Z")

</div>

@Andrei  
I can import your flow but nothing appears in my broswer ☹

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [8 September 2018 17:00 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/6 "2018-09-08T17:00:07Z")

</div>

> [@cymplecy](#):
>
> I can import your flow but nothing appears in my broswer

The map will not open in the dashboard. As per the worldmap help it is necessary to key ctr+shift+m (in windows)

```auto
Shortcut - `⌘⇧m` - ctrl-shift-m to jump to Map.

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 September 2018 17:02 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/7 "2018-09-08T17:02:40Z")

</div>

> [@Andrei](#):
>
> he map will not open in the dashboard. As per the worldmap help it is necessary to key ctr+shigt+m (in windows)

i know that bit 🙂

What I mean is - I can copy and paste your flow into my editor( via normal menu-import-paste from clipboard) tab but nothing appears in the editor

Very stange - not had it happen before

Really not being lucky with one

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 September 2018 17:13 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/8 "2018-09-08T17:13:35Z")

</div>

There is a specific example in the readme about circles...

> **[node-red-contrib-web-worldmap](https://flows.nodered.org/node/node-red-contrib-web-worldmap#circles)**
>
> A Node-RED node to provide a web page of a world map for plotting things on.

```auto
[{"id":"c0e71a8c.e22e48","type":"inject","z":"dfe4ec36.0a5a5","name":"","topic":"","payload":"{ \"lat\":51.05, \"lon\":-1.35, \"name\":\"A3090\", \"radius\":3000 }","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":1180,"wires":[["f22e5b4f.f7bf28"]]},{"id":"f22e5b4f.f7bf28","type":"worldmap","z":"dfe4ec36.0a5a5","name":"","lat":"","lon":"","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","x":370,"y":1180,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [8 September 2018 17:22 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/9 "2018-09-08T17:22:32Z")

</div>

> [@cymplecy](#):
>
> nothing appears in the editor

Really strange. The flow TAB name is Flow 5. I tested by importing and it shows up in the editor.

Here is the configuration in the function node. Nothing configured in the worldmap node.

```auto
msg.payload = { lat:51.05, lon:-1.35, name:"A3090", radius:30 }
return msg;

```

 ![r-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/ad641f57aa572cfbadeb2f77df397a6e6a70ad73.png)

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [8 September 2018 17:30 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/10 "2018-09-08T17:30:12Z")

</div>

> [@cymplecy](#):
>
> I get very confused with JSON but tried sticking quotes around stuff and still doesn't seem to do anything

I see now... this sems to be the issue. Comparing with Dave´s flow you can see how the JSON is supposed to be . Missing quotes in your inject node. Also missing the radius property on your flow.

```auto
{
    "lat": 51.05,
    "lon": -1.35,
    "name": "A3090",
    "radius": 3000
}

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 September 2018 17:31 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/11 "2018-09-08T17:31:57Z")

</div>

> [@dceejay](#):
>
> There is a specific example in the readme about circles..

Tried that - no errors in JSON this time but I think this is where that lat/lon should be but I can't see anything - something must be broken at my end

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0f7c304c1d599031bd436a4db09d2a6dedee7772.jpeg)

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [8 September 2018 17:33 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/12 "2018-09-08T17:33:55Z")

</div>

> [@cymplecy](#):
>
> must be broken at my end

missing the radius property ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 September 2018 17:35 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/13 "2018-09-08T17:35:12Z")

</div>

have you hit inject AFTER the map has connected to the server ? (plus zoom out a little)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f5b580f16f802dd336093a54a29db46ebc29e594.jpeg)

**top tip** the label bottom left is green for connected, red for disconnected/error  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/67ff628850acfa6e25431c3bc4af86b3a6051cd1.jpeg)

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [8 September 2018 17:36 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/14 "2018-09-08T17:36:44Z")

</div>

I do think I see it, u r hitting the ball,,,yes,,,hole-in-one

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 September 2018 17:50 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/15 "2018-09-08T17:50:50Z")

</div>

> [@dceejay](#):
>
> have you hit inject AFTER the map has connected to the server ?

#shame

It (of course) works now - thank you

I think I was getting in such a knot with my json syntax original problem and then I forgot that i should PRESS THE BUTTON! was my last error 🙂

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 September 2018 18:02 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/16 "2018-09-08T18:02:07Z")

</div>

the worldmap-in node does provide an event when someone connects (and other things) that you could of course use to trigger that automatically if required.

---

<div class="post-metadata">

**Author:** ![shinebar](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shinebar/32/5394_2.png) [@shinebar](https://discourse.nodered.org/u/shinebar)\
**Post date:** [24 January 2019 22:49 UTC](https://discourse.nodered.org/t/node-red-contrib-worldmap/2969/17 "2019-01-24T22:49:13Z")

</div>

Any hints for using worldmap behind a reverse proxy? I'm struggling with apache and the websockets…

Edit: I did it:

```
<Location /red/worldmap>

    RewriteEngine on
    RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
    RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
    RewriteRule /socket/(.*) ws://127.0.0.1:1880/red/worldmap/socket/$1 [P]

</Location>
```
