# DRY Leaflet layers & the HTML template literal

**URL:** <https://talk.observablehq.com/t/dry-leaflet-layers-the-html-template-literal/2727>\
**Category:** Help\
**Created:** [January 9, 2020, 4:12am UTC](https://talk.observablehq.com/t/dry-leaflet-layers-the-html-template-literal/2727 "2020-01-09T04:12:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![j-f1](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/j-f1/32/368_2.png) [@j-f1](https://talk.observablehq.com/u/j-f1)\
**Post date:** [January 9, 2020, 12:37pm UTC](https://talk.observablehq.com/t/dry-leaflet-layers-the-html-template-literal/2727/2 "2020-01-09T12:37:50Z")

</div>

Something like this should work:

```auto
Promise.all(["https://geospatial-analysis.s3.amazonaws.com/NEP/50059-002/barhabise-access-road_line.geojson", "another URL"].map(url => d3.json(url).then(data => L.geoJson(data).addTo(map)))

```

I’m not sure what you’re trying to do with the `html` template tag so I can’t help you with that.

---

_[View the full topic](https://talk.observablehq.com/t/dry-leaflet-layers-the-html-template-literal/2727)._
