【问题标题】:react-native map using Leaflet line direction使用 Leaflet 线方向的 react-native 地图
【发布时间】:2021-01-01 05:48:57
【问题描述】:

我已经通过 Expo 设置了一个带有 react-native 的地图。

目前,航班/轨道与传单和“贝塞尔”模块配合得非常好。但是,当我尝试飞往檀香山 -> 东京时,路线不正确。实际上,应该从右到左(大致是卡片的两端)而不是从左到右。

我正在使用网络视图,

<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" }}
            />

在网页端我的坐标看起来像:

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"}
               ], 
...
                         

我不知道如何设置它,你有什么线索吗?非常感谢!

【问题讨论】:

标签: react-native leaflet bezier direction


【解决方案1】:

将 360 从您的位置添加到 lng,然后从右到左

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-14
    • 2017-09-22
    • 1970-01-01
    • 2022-07-06
    • 1970-01-01
    • 2023-02-05
    相关资源
    最近更新 更多