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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

[Leaflet] Power BI custom visual - Script keep loading and is not working

Hello everyone,

 

It's my first post to this forum, I hope I will find some help.

I am a beginner using R and Power Bi but my goal is to be able scripting on leaflet maps using R in Power Bi.

 

Here is a link to my actual folder  (I don't know if i provide enough informations here so .. )

 

Here is my script.r file : 

source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
install.packages("tidyverse")

####################################################

################### Actual code ####################
library(leaflet)
library(plotly)
library(tidyverse)
library(ggplot2)
library(htmlwidgets)
library(XML)
library(sp)
library(maps)


m <- leaflet() %>%
  addTiles() %>%  # Add default OpenStreetMap map tiles
  addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
m  # Print the map

####################################################

############# Create and save widget ###############
p = ggplotly(g);
internalSaveWidget(p, 'out.html');
####################################################

I would like to get it working like the first example from this website

 

And this is what I get  , it keeps loading for 5 minutes then a message that says that the script stop loading after 5 minutes.

 

Pbiprob.JPG

 

(the arrow is supposed to show the loading circle)

 

Thanks for your help ! 

 

Have a nice day

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

We suggest to send email to R-script support: Power BI R Custom Visuals Support <pbircvsupport@microsoft.com>

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @jamesdales @RyanBentham  @Anomimous,

Have you got a workaround to this issue? Having the same issue here trying to create a viz with leaflet and some polygons. It freezes loading the viz and stops after 5 min. 

I can't find the solution mentioned by @Anomimous. Do you have a suggestion on how to solve this?

Thanks

Regards

Nicolas

 

v-viig
Community Champion
Community Champion

We suggest to send email to R-script support: Power BI R Custom Visuals Support <pbircvsupport@microsoft.com>

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Anonymous
Not applicable

Okay, I will try this ! 

 

Thank you very much Smiley Happy

@Anonymous   Did you get any joy using leaflet in PowerBI?

 

Anonymous
Not applicable

@RyanBentham 

 

I finally could get the visual working.

 

Yes, I finally had the possibility to design the map that my company was looking for and that the basics bing power BI features did not meet. 

Here is a GIF of a beta sample previzualisation of my project

 

 

 

how did you solve this . for me some errors like lint validation error

Nice work!

 

To save you re-inventing the wheel too much, you might also want to check out the Icon Map custom visual. The new version (which hopefully will be out any time now once I hear back from the custom visuals team) should be able to display pins and shaded areas on the same map.

 

It's based on Leaflet too.

 

https://community.powerbi.com/t5/Data-Stories-Gallery/Icon-Map-custom-visual-examples/td-p/789914

https://powerbi.jamesdales.com/how-to-use-icon-map/

 

Hey @jamesdales .  The Icon Map is excellent, really is.  I've been using it quite a bit as at the moment I'm pretty sure it's the only way to get Icons/image URLS binded to data points on a map in PBI.

 

Personally I'm not looking to reinvent the wheel or anything like that but just determined to get some leaflet script showing in PBI.   I'm right in saying that r-script hasn't been used for this and it's all via the d3/leaflet libraries ?

 

Thanks

 

Cool - just didn't want you having to go to a load of effort if you didn't need to.

 

Yes - Icon Map is all JavaScript and Leaflet. I wouldn't know where to start with R - so good luck 🙂

Good work!....it's still completely baffling me Smiley LOL

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.