[Google Maps API v3] Geocoder is not a constructor

3,329 views
Skip to first unread message

Map-h

unread,
Apr 25, 2010, 8:02:01 AM4/25/10
to Google Maps JavaScript API v3
I'm trying to use the geo_autocomplete extension (http://
code.google.com/p/geo-autocomplete/) but I allways get the message
"Geocoder is not a constructor", I guess I'm calling geocoder too
soon, so the enviroment is not ready, but I'm using
"google.setOnLoadCallback();" to be sure everything is ok:

function initialize()
{
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
$('#location').geo_autocomplete(new google.maps.Geocoder,
{
mapkey: 'ABQ',
selectFirst: false,
minChars: 3,
cacheLength: 50,
width: 300,
scroll: true,
scrollHeight: 330
}).result(function(_event, _data)
{
if (_data) map.fitBounds(_data.geometry.viewport);
})
}

$().ready(function()
{
google.setOnLoadCallback(initialize);
}

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Chad Killingsworth

unread,
Apr 26, 2010, 9:35:14 AM4/26/10
to Google Maps JavaScript API v3

Rossko

unread,
Apr 26, 2010, 2:31:30 PM4/26/10
to Google Maps JavaScript API v3
> var map = new google.maps.Map2(document.getElementById("map"));

That's not v3 syntax

Ignacio Guarinos

unread,
Apr 26, 2010, 2:53:49 PM4/26/10
to google-map...@googlegroups.com
This is already fixed and working. Thanks to everyone.
I have a new question now.
Which steps should I follow to create an overlay based on a div with a predefined css class and some other divs inside with it's own ID.
I find the lack of jquery compatibility a real pain...

2010/4/26 Rossko <ros...@culzean.clara.co.uk>

Esa

unread,
Apr 27, 2010, 5:42:59 PM4/27/10
to Google Maps JavaScript API v3


On Apr 26, 9:53 pm, Ignacio Guarinos <ignacio.guari...@gmail.com>
wrote:

> Which steps should I follow to create an overlay based on a div with a
> predefined css class and some other divs inside with it's own ID.

This is one of the libraries that create an OverlayView <div>
http://koti.mbnet.fi/ojalesa/boundsbox/

You can create the inner div's in html.

> I find the lack of jquery compatibility a real pain...

What do you mean by "jquery compatibility"?
Reply all
Reply to author
Forward
0 new messages