[TOWS-114] add townstreet flyTo btn (desktop geoloc helper)
This commit is contained in:
parent
67863a368d
commit
6757799993
|
@ -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 %}
|
Loading…
Reference in New Issue