コード例 #1
0
ファイル: api-json.go プロジェクト: refugeemaps/refugeemaps
// 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)
}
コード例 #2
0
ファイル: api-json.go プロジェクト: refugeemaps/refugeemaps
// 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),
	})
}