Esempio n. 1
0
	def get(self):
		lat = self.request.get('lat') or 37.85
		lat = float(lat)
		lng = self.request.get('lng') or -122.25
		lng = float(lng)

		# Search for the nearest sites
		query = find_site.buildQuery(lat, lng, 1000, 1000000)
		nearby_sites = find_site.runSearch(query)

		self.render_json(nearby_sites)
Esempio n. 2
0
	def get(self):
		address = self.request.get('address') or 'Address'
		lat = self.request.get('lat') or 37.85
		lat = float(lat)
		lng = self.request.get('lng') or -122.25
		lng = float(lng)
		zoom = 13 if self.request.get('address') else 10

		# Search for the nearest sites
		query = find_site.buildQuery(lat, lng, limit=6)
		nearby_sites = find_site.runSearch(query)
		logging.info(nearby_sites[0])

		template_values = { 'site_list' : nearby_sites,
												'pins' : json.dumps(nearby_sites),
												'lat' : lat,
												'lng' : lng,
												'address' : address, 
												'zoom' : zoom}
		self.render_template('index.html', template_values)