feat: add location search to picker

Requires API key with Google Places API access
Currently untested
This commit is contained in:
James Graham
2020-12-16 12:09:10 +00:00
parent 9e6d1a495e
commit 1a27774177
2 changed files with 61 additions and 6 deletions

View File

@@ -12,7 +12,7 @@
]
const settings = {
zoom: 8,
zoom: 2,
centre_lat: '{{ answer_set.latitude }}',
centre_lng: '{{ answer_set.longitude }}',
}
@@ -20,7 +20,7 @@
<script src="{% static 'js/location_picker.js' %}"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key={{ settings.GOOGLE_MAPS_API_KEY }}&callback=initMap"
<script async defer src="https://maps.googleapis.com/maps/api/js?key={{ settings.GOOGLE_MAPS_API_KEY }}&callback=initMap&libraries=places"
type="text/javascript"></script>
{% endblock %}
@@ -58,6 +58,7 @@
<hr>
<input id="location-search" class="controls" type="text" placeholder="Location Search"/>
<div id="map" style="height: 800px; width: 100%"></div>
<hr>