Using Leafmap library in Dash

I have used Dash Leaflet some, but saw the Leafmap lib ( https://leafmap.org/)(package for geospatial analysis and interactive mapping in a Jupyter environment) and wondered if anyone has tried using it within Dash?

Hi @bruzzy

Give dash-leaflet a try - it’s one of the most popular dash community libraries

Hi. Thanks for the reply. I have used Dash Leaflet and I do like it. I just came across the Leafmap lib and it seemed compelling (at least for jupyter) because it seems to have abstracted away any javascript and has a large number of methods.

Oops, I missed that you were asking about a different package :see_no_evil:

Hey bruzzy,

Noticed this library a few weeks ago and also found it interesting, however i don’t understand the reasoning for your use case. For example, it sounds like you want to build a Jupyter notebook environment which runs dash while also running a library that wasn’t specifically designed for dash but was specifically designed for Jupyter.

You could run a block of code building your leafmap.org component within Jupyter then just create a new block of code and create a dash app from: Dash in Jupyter Environments | Dash for Python Documentation | Plotly (keeping them separate)

But whats been built in leafmap.org can be built into dash-leaflet, just takes the time for you to code it.

Jupyter is also practically just a testing environment, not sure what your goals are but dash-leafet partnered with dash is very flexible. You could build it out custom to reach or exceed the level of functionality provided in leafmap.org. What I would say doing is create two code blocks in Jupyter, when finished matching the designs and features your looking for move from Juypter to an actual application and publish it.

Best of luck,
Pip

Hi. Sorry, I was not very clear. I’m not interested in Jupyter but only in being able to use Leafmap components within a Dash app so was wondering if anyone had considered that, similar to this example of using Leafmap in Streamlit (https://www.youtube.com/watch?v=hn2WqRX75DI)

Thanks

1 Like

I’ll experiment a little on this in my free time and see if i can figure anything out. Will get back to this form post if i find anything.

Thanks. It seems AI thinks the Leafmap components can be saved as html file in the assets folder, then used in an Iframe in a dash app, but I have not tried yet.