Hi! I use Google Maps in my application, in Expo Client it works perfectly. I have an Google Place autocomplete field too in the same page working with the same api-key, but MapView doesn’t seem to take it. The map is there, but there’s no textures, it’s only blank. I set a marker in it with a circle, both are rendered. I don’t want to eject expo until it’s my final step.
Really simple usage:
<MapView
camera={{
center: this.state.center,
pitch: 0,
heading: 0,
altitude: 0,
zoom: 10,
}}
style={styles.map}
provider={PROVIDER_GOOGLE}
onMapReady={(e) => {
alert('map is ready ' + Constants.manifest.ios.config.googleMapsApiKey)
alert(JSON.stringify(e.nativeEvent))
}}
>
<Marker coordinate={this.state.center} />
<Circle
center={this.state.center}
radius={this.state.range * 1000}
strokeColor="rgba(255,0,0,0.8)"
strokeWidth={2}
fillColor="rgba(255,0,0,0.35)"
/>
</MapView>
This is my application. the map is there, but no textures. Just below (Company address) is a Google place autocomplete field with the same API key by I pass the key directly and it works well
I tried to alert Constants.manifest.ios.config.googleMapsApiKey
but it makes my application crash (only on TestFlight) and says that it’s undefined.
Unhandled JS Exception: undefined is not an object (evaluating 'C.default.manifest.ios.config.googleMapsApiKey')
{
"expo": {
...
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.my.app",
"config": {
"googleMapsApiKey": "*******************"
}
}
}
}
Update: I tried to alert(Constants.manifest)
and there’s no googleMapsApiKey
in it. When in Expo, it shows the api key.
If it is, how my api key is passed?
Thank you for your help!