Black Lives Matter. Please consider donating to Black Girls Code today.

Satellite graph is not working in multi page dash app

Created separate UI for satellite graph in dash app. but graph is not loading.

@sumitchansouliya - This should work. Can you create a small, reproducable example?

all other graph is loading only satellite graph is not working.

is it coming like this. When I am checking for data. callback function is calling and data is coming. When I am using same code for single app. It is working fine.

mapbox apis are not calling.

I tried and found when calling display function, Satellite graph is not loading. Mapbox Api calling only when the app is loading. After app has been loaded and going different pages, Mapbox api is not calling.
@app.callback(dash.dependencies.Output(‘app_info_content’, ‘children’),
[dash.dependencies.Input(‘url’, ‘pathname’)])
def display_page(pathname):
if pathname==’/oil_and_gas’:
print(pathname)
return oil_and_gas.layout
elif pathname==’/stocks’:
return stocks.layout
elif pathname=="/contactUs":
return contactUs.layout
else:
return oil_and_gas.layout

Are you using the correct Mapbox API token?

yes. I am using same code that is available in dash sample app oil and gas. It is running when running alone but in multipage site it is not working.

@app.callback(dash.dependencies.Output(‘app_info_content’, ‘children’),
[dash.dependencies.Input(‘url’, ‘pathname’)])
def display_page(pathname):
if pathname==’/oil_and_gas’:
print(pathname)
return oil_and_gas.layout
elif pathname==’/stocks’:
return stocks.layout
elif pathname=="/contactUs":
return contactUs.layout
else:
return oil_and_gas.layout