mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 19:37:06 +00:00
feature: add map of all people
This commit is contained in:
@@ -1,23 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block extra_head %}
|
||||
{{ map_markers|json_script:'map-markers' }}
|
||||
|
||||
{% load staticfiles %}
|
||||
<script type="application/javascript">
|
||||
const data = [
|
||||
{
|
||||
name: '{{ person.name }}',
|
||||
lat: '{{ answer_set.latitude }}',
|
||||
lng: '{{ answer_set.longitude }}'
|
||||
},
|
||||
]
|
||||
|
||||
const settings = {
|
||||
zoom: 8,
|
||||
centre_lat: '{{ answer_set.latitude }}',
|
||||
centre_lng: '{{ answer_set.longitude }}',
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="{% static 'js/map.js' %}"></script>
|
||||
|
||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key={{ settings.GOOGLE_MAPS_API_KEY }}&callback=initMap"
|
||||
|
||||
@@ -42,13 +42,6 @@
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% if answer_set.latitude and answer_set.longitude %}
|
||||
<tr>
|
||||
<td>Location</td>
|
||||
<td>{{ answer_set.latitude }}, {{ answer_set.longitude }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% for answer in answer_set.question_answers.all %}
|
||||
<tr>
|
||||
<td>{{ answer.question }}</td>
|
||||
|
||||
28
people/templates/people/person/map.html
Normal file
28
people/templates/people/person/map.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block extra_head %}
|
||||
{{ map_markers|json_script:'map-markers' }}
|
||||
|
||||
{% load staticfiles %}
|
||||
<script src="{% static 'js/map.js' %}"></script>
|
||||
|
||||
<script async defer
|
||||
src="https://maps.googleapis.com/maps/api/js?key={{ settings.GOOGLE_MAPS_API_KEY }}&callback=initMap"
|
||||
type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'people:person.list' %}">People</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Map</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<h1>Map</h1>
|
||||
|
||||
<div id="map" style="height: 800px; width: 100%"></div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user