Open MaryamTaeb opened 5 years ago
Hey @MaryamMoghadam, as far as I can tell from glancing over your ticket it seems to be this:
import Mapbox from '@mapbox/react-native-mapbox-gl';
MapboxGL.setAccessToken(<YOUR_TOKEN>);
You're importing MapboxGL
as Mapbox
however you're calling setAccessToken
on MapboxGL
. Makes sense?
Feel free to ignore them, however it will help you on future issue tickets,
either here or on other repos on github or elsewhere.
please make sure to properly format your pasted code:
As is, the code within the issue ticket is either formatted or not.
make sure to use the 3 backticks to start your codeblock and
to close it.
make sure to not paste any sensitive data: you posted your personal mapbox accesstoken within the ticket
hope this helps
Hi @ferdicus, thank you for your reply. I Understood my mistake and I think I fixed it by importing mapboxGL as you can see in the code below.
import React, { Component } from 'react';
import {View, Text} from 'react-native';
import MapboxGL from '@mapbox/react-native-mapbox-gl';
MapboxGL.setAccessToken(MyToken);
const style =
{
viewStyle :
{
flex: 1,
flexDirection: 'column',
backgroundColor: '#db0139'
},
logoStyle:
{
alignSelf: 'center',
top: '25%',
fontSize: 60,
color: '#fff',
fontWeight: '700'
},
containerStyle:
{
flex: 1,
}
};
class Map extends Component
{
static navigationOptions =
{
header: null,
};
render()
{
return (
<View style={style.viewStyle}>
<Text style={style.logoStyle}>Comapny Name</Text>
<View style={styles.containerStyle}>
<MapboxGL.MapView
ref={(c) => this._map = c}
style={{flex: 1}}
zoomLevel={15}>
</MapboxGL.MapView>
</View>
</View>
);
}
}
export default Map;
But I'm receiving a new error:
Can't find variable: pk
<unknown>
index.delta?platform=android&dev=true&minify=false:187307:49
loadModuleImplementation
index.delta?platform=android&dev=true&minify=false:276:14
<unknown>
index.delta?platform=android&dev=true&minify=false:98337:48
loadModuleImplementation
index.delta?platform=android&dev=true&minify=false:276:14
<unknown>
index.delta?platform=android&dev=true&minify=false:1383:48
loadModuleImplementation
index.delta?platform=android&dev=true&minify=false:276:14
guardedLoadModule
index.delta?platform=android&dev=true&minify=false:152:47
global code
index.delta?platform=android&dev=true&minify=false:193701:4
That seems to be an error in your code outside of the repo. I'd disable the Delta feature (I find it to be buggy) in the Development Menu in React Native and try again. Also PK is a usual variable name for prmary key.
@MaryamMoghadam, I agree with @sfratini, seems to be something outside the scope of this lib.
Does it build without the mapbox dependency?
Hi, I have been struggling with this error for the past few days, I followed all of the instruction on the installation page for both Android and IOS platforms but when I compile my project on the simulator it prompts this error. I would really appreciate that if you could help me resolve it.
The erro on simulator
Map component inside of the project
Root Build.gradle
Settings.gradle file
App Build.gradle file
AndroidManifest.xml file
Package.json file
MainApplication.java file
Please let me know if there is further information required