google.maps.places is undefined

Now, you have to use https instead of http.

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&key=....&sensor=false&callback=initializeMap&libraries=places"></script>

Everything else is same as previous answer mentioned.


You should add the option libraries=places in the Google API URL

In your case you should replace the following:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&key=....&sensor=false&callback=initializeMap"></script>

With this:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&key=....&sensor=false&callback=initializeMap&libraries=places"></script>

Look at the end of the src=""


Since the top answer addresses the vanilla version, this is for those using google-maps-react:

add libraries: ['places'] to your GoogleMapReact Component:

   <GoogleMapReact
        bootstrapURLKeys={{ key: apiKey, libraries: ['places'] }}
    ...
   />