Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jii2021
Regular Visitor

Create custom visual using mapbox-gl

Hi,

 

Has anyone experienced including mapbox-gl on a custom visual and using Satellite View? The satellite imagery is not loading.

 

I created my custom visual using mapbox-gl. I installed mapbox-gl from npm.

At first, I was getting a transpiling issue. I added "!" to exclude it from transpiling (according to mapbox troubleshooting). Then It worked ok. Although, I'm getting the "Failed to read the 'caches' property from Window: Cache storage is disabled because the context is sandbox and lacks the 'allow-same-origin' flag". I just ignored the error because the map was loading fine.

But when I tried to use satellite view, I'm only getting a black, without the satellite imagery. Is it because of the 'allow-same-origin flag' error? I've also wrote a support ticket with mapbox and hoping they will reply.

 

Thank you very much!

 

3 REPLIES 3
dm-p
Super User
Super User

Hi @jii2021,

If mapbox-gl requires the allow-same-origin-flag, then unfortunately this is not possible from within a custom visual. and is highly likely why you're just seeing the black display. All custom visuals are executed within a sandboxed iframe and this flag is set by MS to prevent scripts from accessing the main window.  I have a page for one of my visuals that explains in a bit more detail, which may help clarify the limitation further. Unless Mapbox have a suitable workaround from their end to avoid the CORS restrictions imposed by Power BI, then this is not solvable via custom visuals.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




I can see videos online of Mapbox Satellite base map being used in Power BI.  I am assuming there must be some other setting that is being missed.  Any insight into how to troubleshoot that would throw that error?

Hi @dm-p ,

 

Thank you for the clarification and nice documentation about the limitations.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.