bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.24k stars 196 forks source link

I see nothing on my mobile screen(android emulator) #214

Open ankur1163 opened 1 year ago

ankur1163 commented 1 year ago

import MapView, { Marker } from "react-native-maps"; import { useEffect, useRef } from "react"; import React from "react"; import { StyleSheet } from "react-native"; import MapViewDirections from "react-native-maps-directions"; export default function Navigation() { const origin = { latitude: 37.3318456, longitude: -122.0296002 }; const destination = { latitude: 37.771707, longitude: -122.4053769 }; const GOOGLE_MAPS_APIKEY = "mykey";

return ( <MapView initialRegion={{ latitude: origin.latitude, longitude: origin.longitude, latitudeDelta: 0.005, longitudeDelta: 0.005, }}

<MapViewDirections origin={origin} destination={destination} apikey={GOOGLE_MAPS_APIKEY} /> ); } I have very simple code and i see nothing on screen, no map nothing. https://prnt.sc/SyoQ6ynnLQJQ

matheuspbmarques commented 1 year ago

I believe that MapView must been inside View.