{% set idmap = id|default('mapid') %} <script> $(function () { $('[data-toggle="tooltip"]').tooltip() if ($('#{{idmap}}').length) { var mymap = L.map('{{idmap}}').setView({{ KOH_MAP_CENTER }}, {{ KOH_MAP_ZOOM }}); L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {maxZoom: 18, attribution: '© Openstreetmap France | © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(mymap); {# AJOUTER LES MARQUEURS SUR LA CARTE #} {% set groupegroupeprestataires = getAllGroupePrestataires(groupetype) %} {% set count = 1 %} {% for groupepresta in groupegroupeprestataires %} {% if groupepresta.geoloc != null and groupepresta.geoloc.lat != null and groupepresta.geoloc.lon != null%} var marker_{{count}} = L.marker([{{ groupepresta.geoloc.lat }}, {{ groupepresta.geoloc.lon }}]).addTo(mymap); marker_{{count}}.bindPopup("{% apply spaceless %} {% if groupepresta.image != null %} {% set media %} {% thumbnail groupepresta.image, 'small' %} {% endset %} {{ media|raw|replace({'"' : "'", "\n":' ', "\r":' '})|raw }} <br/><br/> {% endif %} <a href='{{ path('show_groupeprestataire', {'slug': groupepresta.slug}) }}'> <strong>{{ groupepresta.__toString()|raw|replace({'"' : "'", "\n":' ', "\r":' '})|capitalize }}</strong> </a> <br/> {% if groupepresta.horaires is not null %} <p>{{ groupepresta.horaires|replace({'"' : "'", "\n":' ', "\r":' '})|raw }}</p> {% endif %} <br/> {% endapply %}"); {% set count = count+1 %} {% endif %} {% endfor %} } }) </script>