docs: function getNearby() {
    // Check for and use cached data
    if (nearbyPlaces)
      return;
  
    logResponse("[getNearby] get nearby data.");
  
    // First use browser's geolocation API to obtain location
    navigator.geolocation.getCurrentPosition(function(location) {
      //curLocation = location;
      logResponse(location);
  
        $.ajax({
            url: '/search',
            data: {
                type: 'place',
                q: 'restaurant',
                center: location.coords.latitude + ',' + location.coords.longitude,
                distance: 1000,
                fields: 'id,name,picture'
            }
        }).success(function (response) {
            nearbyPlaces = response.data;
            logResponse(nearbyPlaces);
            displayPlaces(nearbyPlaces);
        }).error(function(err) {
            logResponse("Error fetching nearby place data.");
        });
    });
  }