react-native-webviewでGoogleMapを表示する
ReactNativeでwebのGoogleMapを使う必要があったのでそのメモ。
セットアップ
yarn add react-native-webview cd ios pod install
// android/gradle.propertiesに以下2行追加 android.useAndroidX=true android.enableJetifier=true
使用
<WebView source={{ html: `<iframe src="<url>" width="100%" height="100%"></iframe>`, }} />
iframeを使う必要があったので
source={{uri: "
ではなく、htmlを返すようにする。