Esempio n. 1
0
File: views.py Progetto: eknuth/pimh
def browse_neighborhoods(request):
    all_n = Neighborhood.objects.all()
    gz = GoogleZoom()
    return render_to_response('map.html', {
            'n': all_n,
            'centroid': all_n.unionagg().centroid, 
            'key': api_key,
            'title': 'All Neighborhoods',
            'zoom': gz.get_zoom(all_n.unionagg())
            })
Esempio n. 2
0
def map( request, timezone):  
  #  all_tz = Zone.objects.all()
    gz = GoogleZoom()
    all_tz = Zone.objects.filter(tzid=timezone)
    centoid = all_tz.unionagg().centroid
    return render_to_response('map.html', {
            'all_tz': all_tz,
            'zoom': gz.get_zoom(all_tz.unionagg())

            })
Esempio n. 3
0
File: views.py Progetto: eknuth/pimh
def map_neighborhood(request, neighborhood_slug):
    n = Neighborhood.objects.get(slug=neighborhood_slug)
    surrounding_n = Neighborhood.objects.filter(poly__intersects=n.poly)
    gz = GoogleZoom()
    return render_to_response('map.html', {
            'n': surrounding_n,
            'centroid_x': surrounding_n.unionagg().centroid, 
            'key': api_key,
            'title': n.name,
            'zoom': gz.get_zoom(surrounding_n.unionagg())
            })