You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a published map with the legend tool activated it will be deactivated when editing the map. It is saved originally as it works in the published map but I assume its state is not returned when a user wants to edit the map.
Looks like this is a timing issue. If you have a layer that has a map legend on the map when you open the publisher (at least if it is one that is used in the embedded map), the publisher tool initializes correctly. The same is true if you have had that layer on the map (so it has been fully loaded from the server) before you open the publisher even if you don't have it on the map at the time publisher is opened.
So it seems this is a timing issue/race-condition with layer being added to the map which triggers a DescribeLayer call to get the full layer metadata from the server to the frontend and is async when called for the first time (hence having had the layer on map previously before entering publisher is not affected by this) and the publisher tools initialing (which is synchronous for most parts). The map legend tool in publisher is disabled if there are no maplayers on the map when it is being initialized and it might not check if it should be checked if there are no layers with map legends. Because of all this, the map legend is left unchecked if the layers of the embedded map are loaded for the first time on the session when the publisher is being opened.
Another interesting edge-case might arise if the layers that are on the embedded map had a legend at the time the embedded map was published, but when editing those layers no longer have a legend. Not sure what should happen then. The map legend toggle should be disabled since there are no layers that have legends at that time, but if the checkbox is left checked because of previous saved data the user can't then uncheck it. So I think it makes sense that the tools is unchecked if it is disabled.
If you have a published map with the legend tool activated it will be deactivated when editing the map. It is saved originally as it works in the published map but I assume its state is not returned when a user wants to edit the map.
Reproduction (e.g. https://demo.oskari.org):
-> The legend tool will be deactivated
Fix:
Correctly set the legend tool's status according to what has been configured by the user.
The text was updated successfully, but these errors were encountered: