I am able to plot a map with pin point as a circle using dash .However, I am willing to show custom image as pin point inside map.
i have gone through the plotly dash code & found below class
`class Marker(PlotlyDict):
“”"
Valid attributes for ‘marker’ at path under parents ():
['autocolorscale', 'blend', 'border', 'cauto', 'cmax', 'cmin', 'color',
'colorbar', 'colors', 'colorscale', 'colorsrc', 'colorssrc',
'gradient', 'line', 'maxdisplayed', 'opacity', 'opacitysrc',
'outliercolor', 'reversescale', 'showscale', 'size', 'sizemax',
'sizemin', 'sizemode', 'sizeref', 'sizesrc', 'symbol', 'symbolsrc']
Run <marker-object>.help('attribute')
on any of the above.
‘’ is the object at
“”"
`
The Marker has symbolsrc option.Hence I tried below code to get the image i wanted
Scattermapbox(lat = lat ,lon = lon ,marker=Marker(size=13,color=‘rgb(6, 91, 112)’,symbolsrc=url_for(“static”,filename=‘pin.jpg’)), text = text )
Its giving error RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
I tried alternative like below giving the complete path of file.
Scattermapbox(lat = lat ,lon = lon ,marker=Marker(size=13,color=‘rgb(6, 91, 112)’,symbolsrc=r’D:\dashboard\static\pin.jpg’), text = text )
This do not give any error but not giving expected output i wanted.
I have mentioned the question in github below is link
i will close once i get answer from either community.