# How to require @antv/l7

**URL:** <https://talk.observablehq.com/t/how-to-require-antv-l7/2957>\
**Category:** Help\
**Created:** [March 20, 2020, 12:44am UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957 "2020-03-20T00:44:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiazhewang](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jiazhewang/32/2803_2.png) [@jiazhewang](https://talk.observablehq.com/u/jiazhewang)\
**Post date:** [March 20, 2020, 12:44am UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957/1 "2020-03-20T00:44:20Z")

</div>

We are trying to require the library L7:

Demo: [https://l7.antv.vision/en/examples/gallery/animate#animate\_line](https://l7.antv.vision/en/examples/gallery/animate#animate_line)  
Github: [https://github.com/antvis/L7](https://github.com/antvis/L7)  
npm: [https://www.npmjs.com/package/@antv/l7](https://www.npmjs.com/package/@antv/l7)

we have tried a lot of ways and followed [https://observablehq.com/@observablehq/how-to-require-stubborn-modules](https://observablehq.com/@observablehq/how-to-require-stubborn-modules) and the “module require debugger” but it still does not work. We even try to change the way of packaging the library.

The import works on stackblitz and CodeSandbox. Could anyone help? THANKS!

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 20, 2020, 2:11am UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957/2 "2020-03-20T02:11:57Z")

</div>

Sure, here’s a demo:

> **[Hello, AntV L7 / Mike Bostock / Observable](https://observablehq.com/@mbostock/hello-antv-l7)**
>
> The magic notebook for visualization.

The problem is that AntV L7 appears to be publishing an invalid AMD bundle: it depends on a variety of core-js modules which aren’t available as AMD modules. But those core-js modules aren’t needed anyway, apparently: you can get the module to load just fine by having them all resolve to null using require.alias.

In cases like this, I’d probably fork their repository and then use Rollup to build my own bundle that works correctly. Stackblitz and CodeSandbox effectively do this for you using Webpack, but Observable doesn’t provide a built-in bundler. I’d also consider posting a PR to the L7 repo that fixes the bundle, but I’m not sure what the intent was in crafting the AMD bundle this way.

---

<div class="post-metadata">

**Author:** ![jiazhewang](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jiazhewang/32/2803_2.png) [@jiazhewang](https://talk.observablehq.com/u/jiazhewang)\
**Post date:** [March 20, 2020, 2:23am UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957/3 "2020-03-20T02:23:00Z")

</div>

Thank you, Mike! You saved my day!

I believe the authors of L7 would be super happy to get your help, you are the best!

---

<div class="post-metadata">

**Author:** ![lzxue](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@lzxue](https://talk.observablehq.com/u/lzxue)\
**Post date:** [March 20, 2020, 12:18pm UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957/4 "2020-03-20T12:18:00Z")

</div>

Thanks，I have solved this problemin L7 library。 [https://observablehq.com/@lzxue/l7-line-layer](https://observablehq.com/@lzxue/l7-line-layer)

Welcome to star L7， I will be honored。

> **[antvis/L7](https://github.com/antvis/L7)**
>
> 🌎 Large-scale WebGL-powered Geospatial Data Visualization analysis framework which relies on Mapbox GL or AMap to render basemaps. - antvis/L7

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 20, 2020, 2:54pm UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957/5 "2020-03-20T14:54:11Z")

</div>

Awesome, thanks for the fast fix! I’ve updated my notebook accordingly.

---

<div class="post-metadata">

**Author:** ![lzxue](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@lzxue](https://talk.observablehq.com/u/lzxue)\
**Post date:** [March 23, 2020, 2:14am UTC](https://talk.observablehq.com/t/how-to-require-antv-l7/2957/6 "2020-03-23T02:14:54Z")

</div>

the demo of hello antV L7 not work can you fix it . L7 = require("@antv/l7") thanks.
