Avaiga / taipy-gui

Graphical User Interface generator for Taipy
Apache License 2.0
60 stars 18 forks source link

BUG- Map not loading in multi-page application #612

Closed FlorianJacta closed 1 year ago

FlorianJacta commented 1 year ago

Description A strange behavior has appeared in Taipy 2.1 (not present in Taipy 2.0). Loading a map on a page doesn't work sometimes, markers are not displayed. It seems to happen when the application is multi-page and when the user goes from one page to the other.

How to reproduce You should land on the chart page. Going from one page to another, no markers are present on the map, even if marker texts can be found on the map. Refreshing the page will show the markers again.

from taipy.gui import Gui 

data = {"number":[50,78,95,78,12,46],
        "size":[50,78,95,63,45,23],
        "lat":[39.83049768,49.83049768,59.83049768,69.83049768,35.83049768,33.83049768],
        "lon":[39.83049768,49.83049768,59.83049768,69.83049768,35.83049768,33.83049768],}

marker_map = {"color":"number", "size": "size"}
layout_map = {"mapbox": { "style": "open-street-map"}}

map = "<|{data}|chart|type=scattermapbox|lat=lat|lon=lon|marker={marker_map}|layout={layout_map}|mode=markers|height=800px|>"

pages = {"/":"<|navbar|>",
        "chart":"# Chart",
         "map":map}

Gui(pages=pages).run()

Expected behavior The map should always show the markers directly going from one page to the other.

Screenshots map

Runtime environment Please specify relevant indications.

FredLL-Avaiga commented 1 year ago

To be oinvestigated but looks like a plotly issue to me (if the text markers are visible) ...

FredLL-Avaiga commented 1 year ago

Looks like an issue between plotly and mapboxGL https://stackoverflow.com/questions/68562009/what-does-error-there-is-already-a-source-with-this-id-anonymous-function-m

FredLL-Avaiga commented 1 year ago

the browser console shows: image.png

FredLL-Avaiga commented 1 year ago

I guess we'll have to wait for plotly to fix this ...

FlorianJacta commented 1 year ago

Why did it work in previous versions of Taipy? I have two users having this kind of problem on maps and I told them to test if it is working on Taipy 2.0. I am waiting for their answers.

FredLL-Avaiga commented 1 year ago

Change in plotly version ?