I am trying to load both the maps library and the places library with javascript so I can embed a map into my page, use google.maps.geometry.spherical functions and make places search requests but I'm having trouble loading all 3 libraries. At the moment I am importing:
<script type="text/javascript"src="http://maps.google.com/maps?key=mykey"></script> <script type="text/javascript"src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
But I get the errors:
syntax error [Break On This Error] ...gs4d .gbmac,.gbes#gbg4 #gbgs4d .gbmac{margin:34px 0 0}.gbemi#gb #gbgs4d .gbmac,.... maps?k...hrkDAmw (line 1) GClientGeocoder is not defined [Break On This Error] var geocoder = new GClientGeocoder();
Where am I going wrong?
Thanks a lot.
You can load additional libraries by specifying a libraries parameter in the bootstrap request, and supplying the name of the library or libraries. You can specify multiple libraries as a comma-separated list. You then access the libraries via the google. maps.
The Maps JavaScript API uses a pay-as-you-go pricing model. Maps JavaScript API requests generate calls to two different SKUs depending on the type of request: map loads or panoramas.
A library for using arbitrary DOM elements as map markers in the Google Maps JavaScript API v3. This library enables developers to easily build store locator-type applications using the Google Maps JavaScript API v3.
The first script doesn't point to a javascript, this will try to load the maps-homepage as a script(of course this will fail).
There is no need to include multiple scripts, simply use:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=geometry,places&sensor=false">
This will load the maps-API(V3) and includes the places+geometry-libraries
https://developers.google.com/maps/documentation/javascript/libraries?hl=en
However, as Colin said, this looks like V2-code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With