lorenzsell/Geocoded-Autocomplete — Issue #3: Safari headjs compatibility?
Author: drauschenbach
Created: 2011-11-08 03:53:19+00:00
State: open

Anybody know how to make this work with headjs?

This is not working for me, because $ / jquery is not ready by the time initMap completes, and initMap never seems to be ready by the time headjs says jquery is ready.

````
head.js(
'/javascripts/jquery-1.6.2.min.js',
'/javascripts/jquery.autogeocomplete.js',
'http://maps.google.com/maps/api/js?sensor=false&callback=initMap'
);
...
script(type="text/javascript)
function initMap() {
var mapOptions = {
zoom:10,
mapTypeId:google.maps.MapTypeId.ROADMAP,
center:new google.maps.LatLng(41.06,28.987)
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
var geocoder = new google.maps.Geocoder();

var options = {
map_frame_id: 'mapframe',
map_window_id: 'mapwindow',
lat_id: 'filter_lat',
lng_id: 'filter_lng',
addr_id: 'filter_address',
lat: '37.7749295',
lng: '-122.4194155',
map_zoom: 13
}
$('#Location').autogeocomplete(options);
}