Hi everyone!
I have a problem with displaying clicked marker in scattermapbox in different style than other markers.
In docs I saw selected property for scattermapbox and I have set it to change color and opacity of clicked point on the map but when I click, nothing changes on the map itself.
Here is my map figure code:
fig = go.Figure(go.Scattermapbox(
lat=get_latitude(),
lon=get_longitude(),
mode='markers',
marker=go.scattermapbox.Marker(
size=9, color='green'
),
selected=go.scattermapbox.Selected(
marker = {
"color":"red",
"size":25,
'opacity': 0.3
}
),
text=get_locations_name(),
customdata=stations_general['id'],
))
fig.update_layout(
uirevision='foo',
hovermode='closest',
clickmode='event+select',
mapbox=dict(
accesstoken=token,
bearing=0,
center=go.layout.mapbox.Center(
lat=21,
lon=-158
),
pitch=0,
zoom=6
),
margin = dict(l=0, r=0, t=0, b=0)
)
So after a click marker stays size 9 and green, it never updates to 25-red.
Maybe selected is not the right property to address this at the first place, but my primary goal is not to redraw the map each time, if possible.
Could you please help me on this?
Thanks!