Fix geolocation centers

This commit is contained in:
2023-12-15 21:18:18 -05:00
parent 22f3b94448
commit b44af1f79d

View File

@ -20,12 +20,12 @@
crossorigin=""></script> crossorigin=""></script>
<script> <script>
var map = L.map('map').setView([{{latest.lat}}, {{latest.lon}}], 17); var map = L.map('map').setView([{{object_list.0.lat}}, {{object_list.0.lon}}], 15);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 20, maxZoom: 20,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map); }).addTo(map);
var marker = L.marker([{{latest.lat}}, {{latest.lon}}]).addTo(map); var marker = L.marker([{{object_list.0.lat}}, {{object_list.0.lon}}]).addTo(map);
var latest_path = [ var latest_path = [
{% for l in object_list %} {% for l in object_list %}
[{{l.lat}}, {{l.lon}}]{% if not forloop.last %},{% endif %} [{{l.lat}}, {{l.lon}}]{% if not forloop.last %},{% endif %}
@ -70,7 +70,7 @@
{% for location in object_list %} {% for location in object_list %}
<tr> <tr>
<td>{{location.scrobble_set.count}}</td> <td>{{location.scrobble_set.count}}</td>
<td>{{location.title}}</td> <td>{{location.title}}</td>
<td><a href="{{location.get_absolute_url}}">{{location.lat}}x{{location.lon}}</a></td> <td><a href="{{location.get_absolute_url}}">{{location.lat}}x{{location.lon}}</a></td>
</tr> </tr>
{% endfor %} {% endfor %}