mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
feat: display organisations on map
Add buttons to toggle organisations and people Resolves #87
This commit is contained in:
44
people/templates/people/map.html
Normal file
44
people/templates/people/map.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% 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 active" aria-current="page">Map</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<h1>Map</h1>
|
||||
|
||||
<script type="application/javascript">
|
||||
function toggleMarkerType(type) {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].type === type) {
|
||||
markers[i].setVisible(!markers[i].getVisible());
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-3">
|
||||
<button class="btn btn-info btn-block" onclick="toggleMarkerType('Person');">Toggle People</button>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button class="btn btn-info btn-block" onclick="toggleMarkerType('Organisation');">Toggle Organisations</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="map" style="height: 800px; width: 100%"></div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,28 +0,0 @@
|
||||
{% 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