Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Selecting points on a geographic map#7948

jacowp357 started this conversation inIdeas
Jan 23, 2026· 1 comments· 1 reply
Discussion options

Hi, is there a way to get interactivity with a geographic map like folium or geopandas? I'd like to select points on a map like what is already possible with plotly, altair etc.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

You can use Anywidgets, like opengeos/anymap. Just wrap the widget inmo.ui.anywidget

You must be logged in to vote
1 reply
@jacowp357
Comment options

I managed to use plotly go.Scattermap() but when selecting points it returns empty values. See mock example below:

df_mock = pd.DataFrame(    {        "id": ["WC_0001", "WC_0002", "WC_0003", "WC_0004", "WC_0005"],        "Region": ["WC", "WC", "WC", "WC", "WC"],        "lon": [18.42, 18.46, 18.50, 18.54, 18.58],        "lat": [-33.93, -33.95, -33.91, -33.97, -33.89],        "cluster": [0, 1, 0, 2, 1],    })figg = go.Figure()figg.add_trace(    go.Scattermap(        lon=df_mock["lon"],        lat=df_mock["lat"],        mode="markers",        marker=dict(size=12, color="red", opacity=0.9),        customdata=df_mock[["id", "cluster"]].values,        hovertemplate=(            "<b>%{customdata[0]}</b><br>"            "cluster: %{customdata[1]}<br>"            "<extra></extra>"        ),        name="Mock sites",    ))figg.update_layout(    dragmode="lasso",    map=dict(       ,        zoom=10,        center=dict(lat=df_mock["lat"].mean(), lon=df_mock["lon"].mean()),    ),    margin=dict(l=0, r=0, t=0, b=0),)plot = mo.ui.plotly(figg)plot
plot.value
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
2 participants
@jacowp357@stephenlf

[8]ページ先頭

©2009-2026 Movatter.jp