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!

New Case Study: How LSU’s Student-Powered SOCs and Splunk Are Shaping the Future of ...

Louisiana State University (LSU) is shaping the next generation of cybersecurity professionals through its ...

Splunk and Fraud

Join us on November 13 at 11 am PT / 2 pm ET!Join us for an insightful webinar where we delve into the ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...