Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dear all,
I'm converting my visual to the API v.1.2.0 and was happy to see "externalJS" files are now supported.
I've implemented this and I see the code of these third party files when debugging.
The strange thing is, jQuery ($) does work in my visual, however Leaflet (L) is undefined from within my code, but actually is declared (lib initialization code is invoked). Somehow PowerBI seems to clear these globals.
How do I solve this?
With kind regards
Based on my test, you could add the library by using tsconfig.json file. See https://github.com/Microsoft/PowerBI-visuals/blob/master/Tutorial/ExternalLibraries.md.
I was able to use the library using window.L (and not just L)
This is strange because outside Power BI it is without the window prefix, just like the $ for jQuery
How do you implement the constructor method?
I'm not sure I understand your question.
When adding the external libs to the tsconfig, the code is initialized just before mine and are accessible through the window object
Where do you use Leaflet? Could you please post the related code snippet here, as well as some screenshots?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
5 | |
2 | |
2 |
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
2 |