Exemplo n.º 1
0
// LocationPoisJSON returns pois
func LocationPoisJSON(w http.ResponseWriter, r *http.Request) {
	c := appengine.NewContext(r)

	vars := mux.Vars(r)
	selectedLocation, exists := locations.GetById(r, vars["locationId"])
	if !exists {
		NotFoundJSON(w, r)
		return
	}

	locationPois := selectedLocation.GetPois(c)

	writeJSON(c, w, locationPois)
}
Exemplo n.º 2
0
// LocationJSON returns a location
func LocationJSON(w http.ResponseWriter, r *http.Request) {
	c := appengine.NewContext(r)

	vars := mux.Vars(r)
	selectedLocation, exists := locations.GetById(r, vars["locationId"])
	if !exists {
		NotFoundJSON(w, r)
		return
	}

	writeJSON(c, w, locations.LocationData{
		Pois:       selectedLocation.GetPois(c),
		Categories: selectedLocation.GetUsedCategories(c),
		Languages:  selectedLocation.GetUsedLanguages(c),
	})
}