HMS-FAC / BoatlaunchMVP

MVP for Boatlaunch App
Creative Commons Zero v1.0 Universal
5 stars 0 forks source link

Map doesn't render until you refresh the page #43

Closed hdrdavies closed 8 years ago

hdrdavies commented 8 years ago

This error appears in console:

Uncaught TypeError: window.initAutocomplete is not a function

Both when running locally and when on heroku

hdrdavies commented 8 years ago

This problem was rediscovered this morning - perhaps it's something to do with this line:

  <script src="https://maps.googleapis.com/maps/api/js?libraries=places&callback=initAutocomplete" async defer></script>

Where the initAutocomplete callback is called before the src file has completely loaded? Just a guess.

tormod17 commented 8 years ago

yeah that sounds about right as it calls that function before the rest of the page is rendered.

tormod17 commented 8 years ago

okay I think I've fixed window.init is not a function - moved script tag that calls it to bottom of index.html- will commit

hdrdavies commented 8 years ago

Nice work :+1: