import L from 'leaflet'; import $ from 'jquery'; export function qpActive() { return $('#map.qp').length > 0; } export function getQP(dossierId, coordinates) { return $.ajax({ method: 'post', url: `/users/dossiers/${dossierId}/carte/qp`, data: { coordinates: JSON.stringify(coordinates) }, dataType: 'json' }).done(({ quartier_prioritaires }) => values(quartier_prioritaires)); } let qpItems; export function displayQP(map, qps) { if (!qpActive()) return; $('#qp.list ul').html(''); newQPLayer(map); if (qps.length > 0) { qps.forEach(function(qp) { $('#qp.list ul').append('