nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

show map not work in android #1490

Closed javadmohammadis closed 5 years ago

javadmohammadis commented 5 years ago

i'm use this code , but my map not displaying!!

import Mapbox from '@mapbox/react-native-mapbox-gl';
Mapbox.setAccessToken('<my token >');
export class googleMap extends Component<{}>{ 
    render() {
        return (
        <View style={{flex:1}}>
        <Mapbox.MapView
        logoEnabled={false}
        styleURL={Mapbox.StyleURL.Street}
        zoomLevel={15}
        centerCoordinate={[11.256, 43.770]}
        style={styles.container}>
        </Mapbox.MapView>
        </View>
        );
        }
    } ;
const styles = StyleSheet.create({

    container: {
        flex: 1,
      },

})
export default googleMap;

screenshot_1548852827

systemlevel commented 5 years ago

Mine crashes when I call: Mapbox.setAccessToken() ... Application just stops and closes in the Android simulator.

systemlevel commented 5 years ago

@javadmohammadis Mine ended up being a problem with the Android Studio emulators. I switched to another emulator (genymotion) and now the maps appear.

javadmohammadis commented 5 years ago

thanks. I run the app on an Android device, is ok

onitzschke commented 5 years ago

@nitaliano issue can be closed, it's an known problem with android emulators.

kristfal commented 5 years ago

This is fixed in master.