Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I am having issues with displaying leaflet tiles in power bi custom visuals. I mainly followed the example from
https://community.powerbi.com/t5/Developer/Power-BI-Cannot-set-height/td-p/140854
I am able to display the map. However, the map zoom and tiles does not seem to be rendering correctly. I appreciate if somebody could help me figure out what's going on with the map.
Map rendering
Visuals.ts
part of the code.
Solved! Go to Solution.
Please include leaflet's CSS into your custom visual by adding the import to style.less:
@import (less) "node_modules/leaflet/dist/leaflet.css";
Please also note you should specify width and height explicitly for #map div element (you might use 100% size).
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
You may inspect the generated HTML in Web Console.
Are you still facing issues with leaflet?
If so, please share the source code of your custom visual as a zip file for debugging.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Dear Ignat,
Thank you for your response.
Please find attached source code for your reference.
Best regards,
Punya
Please include leaflet's CSS into your custom visual by adding the import to style.less:
@import (less) "node_modules/leaflet/dist/leaflet.css";
Please also note you should specify width and height explicitly for #map div element (you might use 100% size).
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Thank you very much. It works.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!