skip to Main Content

Simplifying multiple accesses to JSON files in a Javascript script

I am creating a map based on online datasets using the following code: <script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin=""></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.1.0/chroma.min.js" integrity="sha512-yocoLferfPbcwpCMr8v/B0AB4SWpJlouBwgE0D3ZHaiP1nuu5djZclFEIj9znuqghaZ3tdCMRrreLoM8km+jIQ==" crossorigin="anonymous"></script> <script> const API_IRIS_CONTOUR = new Request("https://www.loicbertrand.eu/accidentologie/json/iris_75.json"); const API_INSEE_STAT = new Request("https://www.loicbertrand.eu/accidentologie/json/base-ic-logement-2020_paris.json"); var layer_iris = L.layerGroup() var color_scale = chroma.scale(['yellow',…

VIEW QUESTION
Back To Top
Search