mapsense / mapsense.js

Mapsense.js
Other
88 stars 22 forks source link

Missing AMD support for D3, TopoJSON #15

Open nrabinowitz opened 9 years ago

nrabinowitz commented 9 years ago

The UMD wrapper is great for providing AMD support, but topojson and d3 are expected as globals. Unfortunately, both of those libraries also use a UMD wrapper, so if AMD support (i.e. RequireJS) is available, they will not be available as globals. So there's basically no way to use the library with RequireJS.

I think the "right" way to fix this is to define a factory that takes the globals as arguments - see https://www.npmjs.com/package/umd-wrap for one approach.

francoisromain commented 9 years ago

I am trying to use mapsense.js npm.
Topojson and d3 are required with npm in the same file, but the console shows this error:

 mapsense.js:1548 Uncaught ReferenceError: topojson is not defined

I think it's related to this issue.