{% 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 %}