nesterapp / react-native-streetview

React Native Google's Panorama/StreetView component for iOS and Android.
MIT License
99 stars 52 forks source link

I see only black view instead of StreetView (Android) #8

Closed code-by closed 4 years ago

code-by commented 6 years ago

I have linked and add RN-streetview into my android project and add KEY into manifest file, Both on the my android-smartphone and in Genymotion 2.10 (with GAPPS installed - https://www.genymotion.com/blog/2-10-open-gapps-widget/, I have Play market installed and I can use StreetView from Google Maps) there only black view instead of street view (

part of manifest:

    <application
      android:name=".MainApplication"
      ....
      <meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="AI...s"/>
    </application>

build.gradle compile project(':react-native-streetview')

settings.gradle

include ':react-native-streetview'
project(':react-native-streetview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-streetview/android')

MainApplication.java import co.il.nester.android.react.streetview.NSTStreetViewPackage;

Component

const StreetViewModal = () => (
  <ModalWrapper>
    <Text>Street View</Text>
    <View
      style={{
        width: 400,
        height: 300,
        backgroundColor: 'white'
      }}
    >
      <StreetView
        style={styles.streetView}
        allGesturesEnabled
        coordinate={{
          latitude: -33.852,
          longitude: 151.211
        }}
      />
    </View>
  </ModalWrapper>
);

const styles = StyleSheet.create({
  streetView: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
  },
});

So I see only text and black rectangle. If I comment/remove <StreetView>, I see my View with white background. log-android not inform me about any error/warning when I open app with component. Is there something I have missing? Thank you

amitpdev commented 6 years ago

Make sure you have 'Google Maps Android API' enabled on your google console.

ghost commented 6 years ago

I am having a similar issue - although streetview works, when I try to dismiss the streetview screen a black panel shows over it, and goes away when I background/foreground the app. This is on Android only, iOS seems to work fine. Anyone else seen that and know how to get around it ?

amitpdev commented 6 years ago

@orloffmarket which navigator are you using? please reply on #12