Geocoded-Autocomplete icon indicating copy to clipboard operation
Geocoded-Autocomplete copied to clipboard

Safari headjs compatibility?

Open drauschenbach opened this issue 13 years ago • 0 comments

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);
  } 

drauschenbach avatar Nov 08 '11 03:11 drauschenbach