GlobalNOC / globalnoc-networkmap-panel

A network map panel for Grafana
Other
196 stars 29 forks source link

Coordinates not correct #118

Closed Steen3S closed 4 years ago

Steen3S commented 4 years ago

Dear contributors,

I have a problem with coordinates. When given in the json they appear in different parts of the world. For example trying London coordinates (51.507407, -0.127665) they will show up at the coastline of Somalia.

API URL: http://api.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=xxxx.xxxx.xxxx

JSON:

{
  "results": [
    {
      "links": [
        {
          "endpoints": [
            {
              "name": "A: endpoint1 to endpoint3 input",
              "label": "label for endpoint"
            },
            {
              "name": "A: endpoint1 to endpoint3 output",
              "label": "label for endpoint"
            }
          ],
          "path": [
            {
              "lon": "51.507407",
              "lat": "-0.127665",
              "name": "ep1",
              "order": "1"
            },
            {
              "lon": "52.381058",
              "lat": "4.902243",
              "name": "ep3",
              "order": "2"
            }
          ],
          "name": "A: endpoint1 to endpoint3"
        }
      ],
      "endpoints": [
        {
          "lon": "51.507407",
          "lat": "-0.127665",
          "name": "endpoint1 cpu",
          "label": "endpoint1 label"
        },
        {
          "lon": "52.381058",
          "lat": "4.902243",
          "name": "endpoint2 cpu",
          "label": "endpoint2 label"
        }
      ]
    }
  ]
}

OUTPUT:

Screenshot 2020-11-23 at 13 44 18

Is there anything I'm doing wrong?

Thank you in advance.

wiku-PSNC commented 4 years ago

Hi, try to change latitude <-> longitude (lat and lon), in your example it seems to be swapped.

Steen3S commented 4 years ago

Dear @wiku-PSNC , Thank you in advance. This morning i swapped the lat/lon to check this fix and probably didn't save my changes so the endpoints stayed in Somalia :) Thanks to you I tried again (with correct save) and it works perfectly now!

Many thanks, have a great day. Cheers!