# Line pointing towards specific location. Worldmap GPSD

**URL:** <https://discourse.nodered.org/t/line-pointing-towards-specific-location-worldmap-gpsd/58802>\
**Category:** Dashboard\
**Created:** [22 February 2022 09:41 UTC](https://discourse.nodered.org/t/line-pointing-towards-specific-location-worldmap-gpsd/58802 "2022-02-22T09:41:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HollaDieWaldfee](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@HollaDieWaldfee](https://discourse.nodered.org/u/HollaDieWaldfee)\
**Post date:** [22 February 2022 09:41 UTC](https://discourse.nodered.org/t/line-pointing-towards-specific-location-worldmap-gpsd/58802/1 "2022-02-22T09:41:09Z")

</div>

Hey!  
I am currently building a gps tracker :

```auto
[
    {
        "id": "edd053d57a890bfa",
        "type": "gpsd",
        "z": "1bfea58c27520ad5",
        "name": "",
        "hostname": "localhost",
        "port": "2947",
        "tpv": true,
        "sky": true,
        "info": false,
        "device": false,
        "gst": false,
        "att": true,
        "x": 130,
        "y": 400,
        "wires": [
            [
                "2b73428fbe98e7cc",
                "909c0fc218f24b91",
                "afa924e8cd09b5d9",
                "256a2efdb683a1ba",
                "4470c68ef5843a91",
                "cc0512b5b772ea7d",
                "a06bc5439a0e432c",
                "6c52e3028e3485a2",
                "39b2902a54cf76f3"
            ]
        ]
    },
    {
        "id": "4470c68ef5843a91",
        "type": "function",
        "z": "1bfea58c27520ad5",
        "name": "",
        "func": "msg.payload = {\n name:\"\",\n color: \"rgb(0,32,91)\",\n icon : \"fa-crosshairs\",\n iconColor : \"rgb(0,32,91)\",\n iconSize : 500,\n dasharray : \"30 20\",\n lat : msg.payload.lat,\n lon : msg.payload.lon,\n \n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 400,
        "y": 400,
        "wires": [
            [
                "c0838482385fd77c",
                "136616a1efc48c37"
            ]
        ]
    },
    {
        "id": "c0838482385fd77c",
        "type": "worldmap-tracks",
        "z": "1bfea58c27520ad5",
        "name": "",
        "depth": "5",
        "layer": "combined",
        "smooth": false,
        "x": 630,
        "y": 400,
        "wires": [
            [
                "136616a1efc48c37"
            ]
        ]
    },
    {
        "id": "136616a1efc48c37",
        "type": "ui_worldmap",
        "z": "1bfea58c27520ad5",
        "group": "0a1f43e2696f8d80",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "",
        "lat": "",
        "lon": "",
        "zoom": "18",
        "layer": "OSMC",
        "cluster": "17",
        "maxage": "",
        "usermenu": "show",
        "layers": "hide",
        "panit": "true",
        "panlock": "false",
        "zoomlock": "false",
        "hiderightclick": "false",
        "coords": "deg",
        "showgrid": "true",
        "allowFileDrop": "false",
        "path": "/worldmap",
        "overlist": "DR,CO,RA,DN,HM",
        "maplist": "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW",
        "mapname": "",
        "mapurl": "",
        "mapopt": "",
        "mapwms": false,
        "x": 640,
        "y": 440,
        "wires": []
    },
    {
        "id": "0a1f43e2696f8d80",
        "type": "ui_group",
        "name": "GNSS Tracker",
        "tab": "eb8313f9cc4c2238",
        "order": 1,
        "disp": false,
        "width": "20",
        "collapse": false,
        "className": ""
    },
    {
        "id": "eb8313f9cc4c2238",
        "type": "ui_tab",
        "name": "GNSS Tracker",
        "icon": "fa-map-o",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

It is really simple so far. so if you have a look at it, it gets the location through gpsd and displays the driven path.

Now I was wandering if there is a possibility to display a line pointing towars a specific Lat- and Longitude even if your GNSS receiver is moving?

Thanks in advance!

---

<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:** [22 February 2022 09:46 UTC](https://discourse.nodered.org/t/line-pointing-towards-specific-location-worldmap-gpsd/58802/2 "2022-02-22T09:46:02Z")

</div>

normally we try to draw a leader line in the direction the device is heading based on the speed. However you can override this by setting your own `msg.payload.bearing` and `msg.payload.length` - so yes if you calculate the bearing to the lat lon required based on your current position you can draw whatever line you want.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 March 2022 09:46 UTC](https://discourse.nodered.org/t/line-pointing-towards-specific-location-worldmap-gpsd/58802/3 "2022-03-24T09:46:16Z")

</div>

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