From 365f17956ff50cb3b7d557a6bbc783cc1bcc96e4 Mon Sep 17 00:00:00 2001 From: Moreau Elise <moreau.elise13@gmail.com> Date: Sun, 25 Oct 2020 18:16:47 +0100 Subject: [PATCH] add script for map view in group view --- templates/group/group_view.twig | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/templates/group/group_view.twig b/templates/group/group_view.twig index b472c11..7e3cc6f 100644 --- a/templates/group/group_view.twig +++ b/templates/group/group_view.twig @@ -85,5 +85,18 @@ {% endif %} <script type="text/javascript" src="/assets/js/users-search.js"></script> -{% endblock %} - +<script> +window.addEventListener('load', function(){ + const { viewMap } = parcelRequire('map.js'); + groupid = {{ group.id }} ; + $.ajax({ + type: 'GET', + url: '/api/'+ groupid + '/userscontaminated', + dataType: 'json', + success: function (body) { + viewMap({ lat: 48.6833, long: 6.2 }, body.data); + } + }); +}); +</script> +{% endblock %} \ No newline at end of file -- GitLab