我正在寻找一种在我的反应本机应用程序中使用 OpenStreetMap 数据的方法。
在我最近的研究中,我发现MapLibre https://maplibre.org/,这是基于MapBox GL旧版本的免费选项。
我面临的问题是,除了@react-native-mapbox-gl/地图 https://www.npmjs.com/package/@react-native-mapbox-gl/maps。因此,在他们的文档中说:“我们现在也支持 Mapbox SDK 的 MapLibre 风格”,但他们提出的示例如下:
import { StyleSheet, View } from "react-native";
import MapboxGL from "@react-native-mapbox-gl/maps";
MapboxGL.setAccessToken("<YOUR_ACCESSTOKEN>");
const styles = StyleSheet.create({
page: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
},
container: {
height: 300,
width: 300,
backgroundColor: "tomato"
},
map: {
flex: 1
}
});
export default class App extends Component {
render() {
return (
<View style={styles.page}>
<View style={styles.container}>
<MapboxGL.MapView style={styles.map} />
</View>
</View>
);
}
}
需要有 MapBox GL 的访问令牌,并且没有 MapLibre 的描述
否则,如果有免费的瓷砖供应商可以告诉我,我将非常欢迎。
iOS 指南here https://github.com/rnmapbox/maps/blob/main/ios/install.md#maplibre
安卓指南here https://github.com/rnmapbox/maps/blob/main/android/install.md#using-maplibre
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)