Renaming map config
This commit is contained in:
@@ -23,8 +23,8 @@ class PlaceListView(IsAuthenticatedMixin, ListView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['map_config'] = {
|
||||
'point_list': context['place_list'],
|
||||
context['mapping_config'] = {
|
||||
'all_points': context['place_list'],
|
||||
'map_center': Place.average_latlon(context['place_list'])
|
||||
}
|
||||
return context
|
||||
@@ -34,8 +34,8 @@ class PlaceDetailView(IsAuthenticatedMixin, View):
|
||||
place = Place.objects.get(pk=pk)
|
||||
context = {
|
||||
'place': place,
|
||||
'map_config': {
|
||||
'point_list': [ place ],
|
||||
'mapping_config': {
|
||||
'all_points': [ place ],
|
||||
'map_center': {'latitude': place.latitude, 'longitude': place.longitude},
|
||||
},
|
||||
'tagging_config': {
|
||||
|
@@ -28,8 +28,8 @@ class HomeView(IsAuthenticatedMixin, View):
|
||||
def get(self, request, *args, **kwargs):
|
||||
place_list = Place.objects.all().order_by('-submitted_when')[:10]
|
||||
context = {
|
||||
'place_list': place_list,
|
||||
'map_config': {
|
||||
'all_points': place_list,
|
||||
'mapping_config': {
|
||||
'point_list': place_list,
|
||||
'map_center': Place.average_latlon(place_list)
|
||||
}
|
||||
|
Reference in New Issue
Block a user