When I clone the project you have sent I get a message that I need to upgrade my account as this is not operational in free version. ( I can only look on the code )
The code you wrote, (I assume) suppose to be in Anvil side, and again since I don’t have the full version I can’t import third parties libs.
Is there a way to use the free version and check the Folium?
Btw, changing the uplink code to the app provided I get this error:
[An internal error has occurred] - see browser console for more details
Please provide a clone link of your app, you’ve provided a link to the live app above but not a clone link.
(without a clone link I can’t test your code properly)
I’ve tested the code above as an uplink script and it works as expected.
So there must be a difference between uplink script/client side script compared with the one above.
Thanks for the clone - I added the uplink code above and I saw a map loaded with no errors.
If you want to try the paid version you can request a trial for the Python 3.10 beta
Going to settings → Python Version
Then you’d need to add folium to the packages once your trial was ready.
This might be useful while you’re in the initial stages of your project.
That said there should be no obvious difference between having a python callable registered on Anvil’s server vs your own uplink script.
I’d also try a couple of other browsers - see if it’s different in chrome vs firefox etc.
(I’m using chrome on mac)
The Python interpreter uses indentation instead of braces, so it is absolutely essential. If the indentation is messed up, all the interpreters (machine and human) will not see the needed nesting and scoping.
Just to be sure, you say that you run the code I provided without any changes, and you saw a map?
( I also tried Google Chrome and I still don’t get any map. )
Btw how do you run the Colab side?
If I run your original uplink code I don’t see a map. (I don’t see any errors either) (If I add width and height parameters to your original colab code I do see a map)
I didn’t use a colab notebook - instead I ran a local script that does the same job.
Maybe worth double checking which version of folium you are running
>>> folium.__version__
'0.14.0'
Also double checking the code you expect to be executing is running by logging print statements inside the colab function calls
These should be output in your colab notebook
But other than that I’m not able to reproduce the errors you’re seeing and I’m out of suggestions i’m afraid.
What do you mean by: (If I add width and height parameters to your original colab code I do see a map)
What did you add?
Here is my full Colab code, can you tell me what should I add to it?
Please notice the difference in the method used to generate the html string.
Also you shouldn’t post your uplink key publicly. You’ll want to reset your uplink key (otherwise anyone can register a callable function for your app).
re width and height you can do m = folium.Map(location=[45.5236, -122.6750], zoom_start=13, width=500, height=500)