Hello,
I have the following map:
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
mapbox_access_token = 'pk.eyJ1IjoiZ2lsdHJhcG8iLCJhIjoiY2o4eWJyNzY4MXQ1ZDJ3b2JsZHZxb3N0ciJ9.MROnmydnXtfjqjIBtC-P5g'
app = dash.Dash()
app.layout = html.Div([
dcc.Graph(
id = "mapbox",
figure={
"data": [
dict(
type = "scattermapbox",
lat = ["40.394283311799995"],
lon = ["-3.69347283089"],
mode = "markers",
marker = dict(size = 14),
text = ["Miguel de Unamuno"]
)
],
"layout": dict(
autosize = True,
hovermode = "closest",
margin = dict(l = 0, r = 0, t = 0, b = 0),
mapbox = dict(
accesstoken = mapbox_access_token,
bearing = 0,
center = dict(lat = 40.395, lon = -3.69),
style = "light",
pitch = 0,
zoom = 14,
layers = [
dict(
type = "fill",
sourcetype = "geojson",
source = {'crs': {'properties': {'name': 'urn:ogc:def:crs:OGC:1.3:CRS84'},
'type': 'name'},
'features': [{'geometry': {'coordinates': [[[-3.691048, 40.401499],
[-3.704480, 40.398590],
[-3.697786, 40.385843],
[-3.684224, 40.40394668]]],
'type': 'Polygon'},
'type': 'Feature'}],
'type': 'FeatureCollection'},
color = "#eef5db",
below = "mapbox",
opacity = 0.8
)
]
)
)
},
style = {"height": "100%"}
)
], style = {"border-style": "solid", "height": "98vh"})
app.run_server()
My question is if it is possible to show the point above the choropleth layer.
I’ve tried adding “below” to the choropleth layer, but then layer shows below the map, and I do not like it.
I have also tried to add the point inside “layers”, instead of including it within “data”, but that subtracts possibilities when instead of a point there are many (for example, when coloring the points according to some value).
Any ideas?
Thank you very much.