Enes T.
Enes T.

Reputation: 167

How to use google maps with both IOS and Android while using Expo

I need to use google maps for both IOS and android for a react-native expo app. I found the react-native-maps library that makes it easy to use maps, but it renders the default IOS map for IOS. There are some tutorials out there that show you how to integrate google maps to IOS, but those are plain react-native apps created by react-native init and not expo.

Upvotes: 3

Views: 4410

Answers (2)

angry kiwi
angry kiwi

Reputation: 11445

Adding to the answer above. to use google map in expo for both platform ios and android you need to do it like this

import {MapView} from 'expo'
<MapView 
    provider={MapView.PROVIDER_GOOGLE}
    initialRegion={this.state.region} 
    showCompass={true} 
    rotateEnabled={false}
    showUserLocation={true} 
    style={css.map} />

Upvotes: 7

markymark
markymark

Reputation: 145

We used the one from Expo for a project last year which is react-native-maps under the hood. It worked fine for us.

https://docs.expo.io/versions/latest/sdk/map-view

Upvotes: 3

Related Questions