且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将OpenStreetMap集成到本机项目中?

更新时间:2023-02-08 09:20:53

您可以在 react-native-maps 包中使用自定义的Tile Overlay(也是OpenStreetMap):their GitHub account.

The only thing I can find relating to these to topics is the link below, in which there is no proper answer.

https://www.reddit.com/r/reactnative/comments/5fi6bg/how_to_add_openstreetmap_to_a_react_native_project/

But I heard once that Mapbox uses OpenStreetMap as their source. Mapbox suggests a good way to integrate it into a React Native project:

https://github.com/mapbox/react-native-mapbox-gl

Is there a way to integrate OpenStreetMap into a React Native project or is it the case there's not proper support for it yet.

You can use a custom Tile Overlay (OpenStreetMap too) in react-native-maps package: https://github.com/react-native-maps/react-native-maps

(scroll to Using a custom Tile Overlay section)

You need to add api key. You don't need to use Maps API at all and the key won't be used in that case.