Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6211

It's possible to use google maps types with react native?

$
0
0

I'm try to use google maps types with react native maps.

yarn add -D @types/googlemapsyarn add -D @types/react-native-maps

tsconfig.json

"typeRoots": ["./node_modules/@types"],

When I use google show me typescript error

google is not defined

const centerPolygon = (paths: LatLng[]): LatLng => {  const bounds = new google.maps.LatLngBounds()  paths.forEach((path): void => {    bounds.extend(new google.maps.LatLng(path.lat, path.lng))  })  return {    lat: bounds.getCenter().lat(),    lng: bounds.getCenter().lng(),  }}

Viewing all articles
Browse latest Browse all 6211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>