Compare commits
5 Commits
9af55d3f24
...
5f3be5fc83
Author | SHA1 | Date | |
---|---|---|---|
5f3be5fc83 | |||
f916ac9742 | |||
03af8a0c02 | |||
65f3642272 | |||
e00a0f687b |
@ -57,8 +57,7 @@ class Place (models.Model):
|
||||
|
||||
# Get center position of all LP-geocoordinates.
|
||||
|
||||
def average_latlon():
|
||||
place_list = Place.objects.all()
|
||||
def average_latlon(place_list):
|
||||
amount = len(place_list)
|
||||
longitude = 0
|
||||
latitude = 0
|
||||
|
@ -0,0 +1,6 @@
|
||||
# Keeping these files up-to-date is something for CI / release management.
|
||||
# But for now I noted the source urls down here for later reference.
|
||||
|
||||
https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css
|
||||
https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js
|
||||
https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js.map
|
@ -1,8 +1,8 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
{% block additional_head %}
|
||||
<link rel="stylesheet" href="{% static 'ol.css' %}" type="text/css">
|
||||
<script src="{% static 'ol.js' %}"></script>
|
||||
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css">
|
||||
<script src="{% static 'maps/ol.js' %}"></script>
|
||||
{% endblock additional_head %}
|
||||
|
||||
# {% block title %}Start{% endblock %}
|
||||
|
@ -1,4 +1,3 @@
|
||||
{% load static %}
|
||||
|
||||
<div id="map" class="map"></div>
|
||||
<div id="info" class="map-popup"></div>
|
||||
|
@ -64,7 +64,7 @@ class PlaceDetailView(IsAuthenticated, View):
|
||||
class HomeView(View):
|
||||
def get(self, request, *args, **kwargs):
|
||||
place_list = Place.objects.all().order_by('-submitted_when')[:10]
|
||||
place_map_center = Place.average_latlon()
|
||||
place_map_center = Place.average_latlon(place_list)
|
||||
context = {
|
||||
'place_list': place_list,
|
||||
'place_map_center': place_map_center
|
||||
|
Loading…
Reference in New Issue
Block a user