Google Maps & Google Places in React

Leigh Halliday · 142K views · 2020 · 53:09

Open on YouTube

Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they followed when asking about or building Google Maps, InfoWindow and Places autocomplete features in React.

Recommended by 1 people across 1 different months, 2020 to 2021.

What it is

A 53-minute React tutorial by Leigh Halliday that builds a 'Bear Sighting' app with Google Maps, Google Places autocomplete and browser geolocation. It uses React hooks, the @react-google-maps/api and use-places-autocomplete packages, and Reach Combobox, with markers, info windows and programmatic panning.

What people said

Recommends chichi · 2020-07 · Stack Overflow · on “Creating Custom Buttons in React Google Maps”

I am using @react-google-maps/api now. I think it has your functionality [LINK] I am watching [this video] his tutorial. Added the autocomplete on top of the map. I think this is what you want?

Cites krishna · 2020-07 · Stack Overflow · on “ReactJS useState, onClick show InfoWindow”

In my react google maps code I am not able to set onclick open InfoWindow. I am referring to this tutorial: [this video] my code: import React, { useState } from "react"; import { GoogleMap, useLoadScript, Marker, InfoWindow, } from "@react-google-maps/api"; // --> using @react package const libraries = ["places"]; const mapContainerStyle = { width: "100%", height: "100vh", }; const center = { lat: 51.103807, lng: 10.057477, }; export default function App() { const [setSState, sstate] = React.useState(null); const { isLoaded, loadError } = useLoadScript({ googleMapsApiKey: process.env.REACT_APP_GOOGLE_KEY, libraries, }); if (loadError) return "error loading maps"; if (!isLoaded) return "loading m

Cites kboy · 2020-12 · Stack Overflow · on “TypeError: Object(...) is not a function (React)”

I was following a tutorial on how to add google maps to a react/expo javascript project. I am new to the javascript language and have had a bug that I cannot find an answer to. when compiling the app I am given the error " TypeError: Object(...) is not a function ". here is the link to the tutorial: [this video] . Thank you. The error is on the line 25 of the script: 22 | 23 | 24 | } > 25 | export default function App() { 26 | const {isLoaded, LoadError} = UseLoadScript({ 27 | googleMapsApiKey: process.env.REACT_APP_GOOGLE_MAPS_API_KEY, 28 | libraries,``` Full script: import React from 'react'; import { GoogleMap, UseLoadScript, Marker, InfoWindow, } from "@react-google-maps/api"; const libraries

Cites CVerica · 2021-12 · Stack Overflow · on “Why does google places autocomplete return an empty status and no data?”

I am following a tutorial from Leigh Halliday about Google Maps in react [this video] . I am deviating slightly, as I need the map for different purposes than he is demonstrating. Here is my code so far: import React, { useState, useRef, useCallback } from "react"; import { GoogleMap, useLoadScript, // Marker, // InfoWindow, } from "@react-google-maps/api"; import usePlacesAutocomplete, { getGeocode, getLatLng, } from "use-places-autocomplete"; import { Combobox, ComboboxInput, ComboboxPopover, ComboboxList, ComboboxOption } from "@reach/combobox"; import "@reach/combobox/styles.css"; import { GOOG_API } from "../keys"; import styles from "./mapStyles"; const libraries = ["places"]; const mapCont