JeremieLitzler / mws-restaurant-stage-2

Starter Code for the Udacity's "Mobile Web Specialist Restaurant Reviews App: Stage 2" Project
https://resto-reviews.puzzlout.com
GNU General Public License v3.0
0 stars 0 forks source link

Make Google Maps non blocking #12

Closed JeremieLitzler closed 6 years ago

JeremieLitzler commented 6 years ago

Blog post: https://medium.com/@nikjohn/speed-up-google-maps-and-everything-else-with-async-defer-7b9814efb2b

Options

Consider the following options:

  1. Using a static map
  2. Hidding the maps by default and show on request (remark: but then how to deal with the desktop layout where the map is on the left / right ?)

Solution for option 2

JeremieLitzler commented 6 years ago

Solution for option 1

Use the Static map api to load an image of the area.

The static map api url is something like:

var staticApi = `https://maps.googleapis.com/maps/api/staticmap?center=40.7125844,-73.9713328&zoom=12&size=320x240&key=API_KEY`

API Key for Static API: AIzaSyB8mGRExPGJ5-h6QjBu1-MsUoAm4kWKaqY