react-native-maps-osmdroid icon indicating copy to clipboard operation
react-native-maps-osmdroid copied to clipboard

Grey map or not even drawing on Android

Open mbrucher opened this issue 6 years ago • 5 comments

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.

mbrucher avatar Sep 09 '19 21:09 mbrucher

Do you still experience this problem?

fqborges avatar Sep 13 '19 14:09 fqborges

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

mbrucher avatar Sep 13 '19 18:09 mbrucher

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

slavikdenis avatar Dec 02 '19 09:12 slavikdenis

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}} />

franamu avatar Mar 26 '20 13:03 franamu

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!

aardvarkk avatar Oct 28 '20 20:10 aardvarkk