All Apps and Add-ons

Missile map Change of starting point

spl109
Explorer

How can I change the starting point?

  1. Current
    alt text

  2. How can I express it like this?
    alt text

0 Karma
1 Solution

cameronjust
Path Finder

As Luke said the issue is related to the underlying javascript leaflet this visualisation uses.

https://github.com/lit-forest/leaflet.migrationLayer/blob/master/README.md

Similar issue with solution - https://github.com/Leaflet/Leaflet/issues/82

Tweaking your negative longitudes should resolve it for you like this example below.

| makeresults 
| eval start_lat=47.67, start_lon=-122.34, end_lat=37, end_lon=126 
| eval start_lon = if (start_lon < 0, 360+start_lon,start_lon) 
| append 
    [| makeresults 
    | eval start_lat=60.69, start_lon=140.68, end_lat=37, end_lon=126 
    | eval start_lon = if (start_lon < 0, 360+start_lon,start_lon)]

https://imgur.com/1cV5RCr

Edit: It looks like this fix breaks other arrows. You could do a much more complex fix by working out the 360 degree adjusted coordinates and the normal coordinates. Detemine the distance between both and the intended destination and pick the shortest one.

Example on how to calculate distances can be found here - https://answers.splunk.com/answers/752171/distance-between-two-geocoordinates.html#answer-752516

View solution in original post

0 Karma

cameronjust
Path Finder

As Luke said the issue is related to the underlying javascript leaflet this visualisation uses.

https://github.com/lit-forest/leaflet.migrationLayer/blob/master/README.md

Similar issue with solution - https://github.com/Leaflet/Leaflet/issues/82

Tweaking your negative longitudes should resolve it for you like this example below.

| makeresults 
| eval start_lat=47.67, start_lon=-122.34, end_lat=37, end_lon=126 
| eval start_lon = if (start_lon < 0, 360+start_lon,start_lon) 
| append 
    [| makeresults 
    | eval start_lat=60.69, start_lon=140.68, end_lat=37, end_lon=126 
    | eval start_lon = if (start_lon < 0, 360+start_lon,start_lon)]

https://imgur.com/1cV5RCr

Edit: It looks like this fix breaks other arrows. You could do a much more complex fix by working out the 360 degree adjusted coordinates and the normal coordinates. Detemine the distance between both and the intended destination and pick the shortest one.

Example on how to calculate distances can be found here - https://answers.splunk.com/answers/752171/distance-between-two-geocoordinates.html#answer-752516

0 Karma

luke_monahan
Path Finder

I think that this is due to the way that Leaflet.js (an underlying library for this viz) handles lines that cross the date line. It will generally go the long way around rather than cross the date line.

There's a workaround presented here: https://github.com/Leaflet/Leaflet/issues/82

I'll have to spend some time trying to figure out how that workaround could be applied in the context of this Splunk viz. I'll try have a go at this on the weekend and report back.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...