0

I have set up a map with react-native via Expo.

Currently, the flights / tracks work very well with the leaflet and the "bezier" module. However, when i tried to make a flight Honolulu -> Tokyo , the route was not right. Indeed, it should be done from right to left (roughly the ends of the card) and not from left to right.

I'm using a webview,

<WebView
              geolocationEnabled={true}
              javaScriptEnabled={true}
              source={{
                uri:
                  "https://www.ttt.org/fr/mes-voyages" +
                  "?society_id=" + ttt_SOCIETYID +
                  "&user_id=" + this.state.user_id +
                  "&lang=" + this.state.lang +
                  "&access_token=" + this.state.access_token +
                  "&screen=" + this.state.screen_updated,
              }}
              originWhitelist={[
                "https://www.ttt.org",
                "https://www.yyy.com",
              ]}
              injectedJavaScript={`const meta = document.createElement('meta');
                meta.setAttribute('content', 'width=device-width, initial-scale=0.5, maximum-
                scale=0.5, user-scalable=0'); meta.setAttribute('name', 'viewport');
                document.getElementsByTagName('head')[0].appendChild(meta);`}
              scalesPageToFit={true}
              onMessage={(m) => this.performMessageFromWebView(m)}
              style={{ marginHorizontal: 0, backgroundColor: "transparent" }}
            />

and on the web side my coordinates look like :

function getTrips1() {
       return [                  
                                                                                                                [
       {id: 215, lat: 33.94250107, lng: -118.4079971, deep:"8", popup: "Los Angeles International Airport"},
       {id: 215, lat: 49.012798, lng: 2.55, deep:"8", popup: "Charles de Gaulle International Airport"}
               ], 
...
                         

I have no idea on how I can set up this, do you have any clue ? Thanks a lot !

Kimako
  • 615
  • 2
  • 11
  • 26
  • 1
    Does this answer your question? [Wrapping lines/polygons across the antimeridian in Leaflet.js](https://stackoverflow.com/questions/40532496/wrapping-lines-polygons-across-the-antimeridian-in-leaflet-js) – IvanSanchez Sep 14 '20 at 14:04
  • thank you so much for taking the time to answer. it helps me understand a little but I don't really know how to make it fit my code. – Kimako Sep 15 '20 at 06:39

1 Answers1

1

add 360 to the lng from your point, then it goes from right to left

Falke Design
  • 10,635
  • 3
  • 15
  • 30