[TOWS-114] add townstreet flyTo btn (desktop geoloc helper)

This commit is contained in:
Daniel Muyshond 2022-08-10 14:58:19 +02:00
parent 67863a368d
commit 6757799993
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{% extends "qommon/forms/widget.html" %}
{% block widget-content %}
<a class="i_am_lost_btn" style="cursor: pointer;" onclick="resetMapWidget()">Localisation incorrecte / je suis perdu : réinitialiser la carte (positionne la carte sur la commune)</a>
<script type = "text/javascript">
function resetMapWidget() {
var $map = $('.qommon-map');
initial_lat = $map[0].attributes['data-def-lat'].value;
initial_lng = $map[0].attributes['data-def-lng'].value;
$map[0].leaflet_map.flyTo([initial_lat, initial_lng]);
}
</script>
<style>
@media screen and (max-width: 800px) {
.i_am_lost_btn {
display: none;
}
}
</style>
{% endblock %}