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!

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...

AI Adoption Hub Launch | Curated Resources to Get Started with AI in Splunk

Hey Splunk Practitioners and AI Enthusiasts! It’s no secret (or surprise) that AI is at the forefront of ...