How to use leaflet.js with react-native(如何将 Leaflet.js 与 react-native 一起使用)
问题描述
我很难用 react-native
设置 Leaflet.js
.文档告诉我在我的 html 中添加以下脚本...
I am having a difficult time setting up Leaflet.js
with react-native
. The documentation tells me to add the following script in my html...
<script src="aHR0cHM6Ly91bnBrZy5jb20vbGVhZmxldEAxLjAuMS9kaXN0L2xlYWZsZXQuanM="></script>
但我不确定我是如何使用 react 来做到这一点的.现在我的主页呈现如下...
But I am not sure how I do this using react. Right now my main page is being rendered as follows...
AppRegistry.registerComponent('beacon', () => Home);
而我的 Home
就是...
export default Home = () => {
return (
<Provider store={store}>
<MainMap />
</Provider>
);
}
在哪里/如何添加此脚本标记以包含 Leaflet.js
?甚至可能吗?是否有其他解决方案?
Where/How do I add this script tag to include Leaflet.js
? Is it even possible? Is there perhaps another solution?
我还没有看到任何 react-native
和 Leaflet.js
的示例,如果有的话,在 github 上或其他什么地方,我很乐意看看吧.
I haven't seen any examples of react-native
and Leaflet.js
, if there is one, on github or what not, I'd be happy to see it.
推荐答案
有个项目react-leaflet 通过它你可以使用leaflet.js 和react.
There is a project react-leaflet through which you can use leaflet.js with react.
但目前 不支持 在 react-native 中使用 leaflet.js.有关详细信息,请参阅此问题.
But currently there is no support for using leaflet.js in react-native. See this issue for more info.
这篇关于如何将 Leaflet.js 与 react-native 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将 Leaflet.js 与 react-native 一起使用


- android 4中的android RadioButton问题 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01