Skip to content

Better handling of trips which cross the antimeridian#164

Open
lucas42 wants to merge 2 commits intoowntracks:mainfrom
lucas42:antimeridian
Open

Better handling of trips which cross the antimeridian#164
lucas42 wants to merge 2 commits intoowntracks:mainfrom
lucas42:antimeridian

Conversation

@lucas42
Copy link
Copy Markdown
Contributor

@lucas42 lucas42 commented Aug 2, 2025

Problem this solves

When a line crosses the antimeridian (ie the 180th meridian), the default leaflet behaviour is to draw the line going the other way around the world. For example, San Francisco to Tokyo is drawn like so:
image

This change will now draw that same journey using the shorter route, across the Pacific Ocean:

image

Fixes #157

Implementation

Caveats

  • Leaflet.Antimeridian hasn't been update since 2017, so is unlikely to receive ongoing support.
  • I've never written any vue or leaflet before attempting this. If anyone wants to review the module I wrote, I'm happy to take feedback on that too.

Reason for doing this

To be fully honest, I only did this because I recently completed a round-the-world trip and I wanted to make a nice map of my journey so I can brag on social media:
image

lucas42 added 2 commits August 2, 2025 18:09
…hich pass the antimeridian

Installs module `vue-leaflet-antimeridian` and uses its version of LPolyline, instead of the native leaflet version.
Fixes owntracks#157
…ndencies differently, to avoid Docker build issues
lucas42 added a commit to lucas42/lucos_locations that referenced this pull request Feb 8, 2026
This is done by checking out the frontend source in a new stage in the Dockerfile.
Fixes #6
If owntracks/frontend#164 is merged, this additional stage can be removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Location history line wrong way round when crossing the 180th meridian

1 participant