I am trying to deploy a place library using Google Maps apiv3, but I get an error.

Asked 1 years ago, Updated 1 years ago, 44 views

I am referring to samples from various sites, but I get an error.

I have written the library loading in the libraries parameter of the api bootstrap URL.Other than that, I am writing the same way after reading and Google references, but I get an error.

ERROR: Uncaught TypeError: Cannot read property 'PlacesService' of undefined
Enter a description of the image here

This error does not disappear.

javascript html5 api

2022-09-30 14:30

1 Answers

ERROR: Uncaught TypeError: Cannot read property 'PlacesService' of undefined

Google.maps.places appears to be undefined.

There are two possible causes.

(1) The places library is not enabled when loading the Google Maps API
http://maps.google.com/maps/api/js?sensor=true&libraries=places

not
http://maps.google.com/maps/api/js?sensor=true
Are you trying to do something like that?
But

I have written the library loading in the libraries parameter of the api bootstrap URL.

It says...
It might be better to check the spelling just in case.
(Is there no place for places?)etc.)

(2) Google.maps.places with undefined ones

google.maps.places=undefined;

It's a little hard to think about, but if you do something like the above somewhere, the error will be reproduced.

I don't think (1) and (2) are the deciding factors...


2022-09-30 14:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.