0

我目前正在尝试将我在 Mapbox Studio 中创建的自定义地图实现到我的 RN 应用程序中。这是代码的样子:

render() {
 const {StyleURL} = 'url';
 const {mapLight} = 'url';
 return(
   <View style={styles.container}>
   <Mapbox.MapView
       accessToken={'token'}
       styleURL= {mapLight}
       zoomLevel={16}
       centerCoordinate={[this.state.xCoord, this.state.yCoord]}
       style={{flex: 1}}
       showUserLocation={true}
       pitchEnabled={false}>

   </Mapbox.MapView>
   </View>
 )

}

我在我的应用程序上确实实现了地图视图,但是,它不是我在 Mapbox Studio 中设计的地图。是的,我使用了正确的样式 url,是的,它是正确的访问令牌。关于为什么会这样的任何帮助/解释?谢谢,我真的很感激在这一点上的任何见解。

4

1 回答 1

-1

地图盒工作室 鉴于手头的信息,这是一个非常简单的选项:根据上图从 Mapbox Studio 仪表板下载样式,并在包含地图的组件中要求它。

const mapboxStyle = require("./downloadedFolderName/style.json")
于 2019-01-28T18:11:56.313 回答