Skip to content

Commit

Permalink
Fix order of loading map.js and the map api (PokemonGoF#2043)
Browse files Browse the repository at this point in the history
* Let's load map.js first. The callback for the api requires initMap
  to be defined or things break.
* Furthermore, defer, but don't async, the api call so we're sure
  everything is ready to go before it fires.
  • Loading branch information
invisiblek authored and DerScreever committed Jul 25, 2016
1 parent a32287e commit d0357b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ <h3>Notify with sound</h3>
var center_lng = {{lng}};
</script>

<script async defer src="https://maps.googleapis.com/maps/api/js?key={{ gmaps_key }}&amp;callback=initMap&amp;libraries=places,geometry"></script>
<script src="static/map.js"></script>
<script defer src="https://maps.googleapis.com/maps/api/js?key={{ gmaps_key }}&amp;callback=initMap&amp;libraries=places,geometry"></script>

</body>
</html>

0 comments on commit d0357b4

Please sign in to comment.