fqborges / react-native-maps-osmdroid

React Native Mapview component for iOS + Android
MIT License
67 stars 22 forks source link

Grey map or not even drawing on Android #9

Open mbrucher opened 5 years ago

mbrucher commented 5 years ago

Is this a bug report?

Yes

Have you read the Installation Instructions?

As far as I know, everything was installed properly.

Environment

react-native: 0.60.5
react: 16.8.6
react-native-maps: 0.23.0rc4

Target Platform: Android Pixel 3a, API 29 (emulator and Nokia 7+)

Steps to Reproduce

I added a Map in a View like this:

    return <MapView
      provider={Platform.OS === "ios" ? null : "osmdroid"}
      initialRegion={region}
    >
      <UrlTile
        maximumZ={18}
        urlTemplate="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png"
      />
    </MapView>;

Expected Behavior

Should display a map.

Actual Behavior

The map stays grey (interaction works).

I suppose I missed a step while installing the package, but I can't figure out what.

fqborges commented 5 years ago

Do you still experience this problem?

mbrucher commented 5 years ago

Yes, currently, I have to use the original react-native-maps instead :(

slavikdenis commented 4 years ago

Having the same issue, but only on release version of the app.

franamu commented 4 years ago

Try giving it a style

const { width, height } = Dimensions.get('window');

inside your return put

<MapView initialRegion={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.0922, longitudeDelta: 0.0421, }} style={{height: height, width: width}} />

aardvarkk commented 4 years ago

Not having a defined size was my problem. This should be called out in the README I would think. Spent a long time trying to figure out why nothing was rendering!