diff --git a/lostplaces/lostplaces_app/templates/home.html b/lostplaces/lostplaces_app/templates/home.html
index 726fbf5..c16bd0e 100644
--- a/lostplaces/lostplaces_app/templates/home.html
+++ b/lostplaces/lostplaces_app/templates/home.html
@@ -2,8 +2,8 @@
{% load static %}
{% block additional_head %}
-
-
+
+
{% endblock additional_head %}
# {% block title %}Start{% endblock %}
@@ -14,7 +14,7 @@
-{% include 'partials/osm_map.html' %}
+{% include 'partials/osm_map.html' with config=map_config %}
Explore the latest locations
diff --git a/lostplaces/lostplaces_app/views/views.py b/lostplaces/lostplaces_app/views/views.py
index b0c29c2..57b05dd 100644
--- a/lostplaces/lostplaces_app/views/views.py
+++ b/lostplaces/lostplaces_app/views/views.py
@@ -27,10 +27,12 @@ class SignUpView(SuccessMessageMixin, CreateView):
class HomeView(IsAuthenticated, View):
def get(self, request, *args, **kwargs):
place_list = Place.objects.all().order_by('-submitted_when')[:10]
- place_map_center = Place.average_latlon(place_list)
context = {
'place_list': place_list,
- 'place_map_center': place_map_center
+ 'map_config': {
+ 'point_list': place_list,
+ 'map_center': Place.average_latlon(place_list)
+ }
}
return render(request, 'home.html', context)