Layers Display Order Error
When selecting a map theme, and then clicking record, sometimes the layer selected by default is actually the 2nd layer in the layer tree. It is also 2nd in alphabetical order (due to numbers assigned at the start of each layer name for order purposes). Obviously, the order of the layer tree is supposed to depict the order when recording a point.
Additional information can be required if requested.
Hi Mergin Maps Team,
I would like to please follow up on this issue. Please see the video and screen shots below. The default layer to edit should be 5.1. (M) Pest Monitoring but this isn't the case. This happens in several other Map Themes as well. The order and naming convention should result in it being the default layer. Is there perhaps a work-around I could implement?
https://github.com/MerginMaps/input/assets/90187049/3a0b5f1a-f667-458a-afff-726d96cfd4b3
Hi @Hackster93,
thanks for reporting this. In the video, it seems like you haven't changed the map theme, only tapped on the one that has been already selected. Indeed the active layer is by default set to the first one in alphabetical order, but only under condition of changing the map theme. If your "5. Pest Monitor" theme is selected and you record a point within "5.2 (M) Nematode Sample" layer and then go to map themes and select the same "5. Pest Monitor" theme, the active layer remains the same - "5.2 (M) Nematode Sample" (although in your case you have just downloaded the project it's hard to say which layer was active previously). You need to change to other map theme and then to this one again and the default - first layer is selected automatically. Can you please confirm this is the case? Before this conclusion I have conducted some testing and couldn't replicate the issue under any other conditions so if this is not the case, more details would be helpful on the matter (exact description of layer, group, themes... and whole project creation). Thank you!
Kind regards
Tadeas
Hi @Tadeo98,
Thank you for your response.
Please see the attached video with me changing between map themes. You can see this is the case in several themes that the first layer is not selected.
https://github.com/MerginMaps/input/assets/90187049/a57c96a3-0e5a-45a6-a4f1-a582b2bc0cb7
I am happy to share the project with you if this would help? The one thing I thought it could be is we have 'duplicate' layers in some of the map themes, so for example 5.2. (M) Nematode Sample and 5.3. (M) Diseased Tree Sample both point to the same layer sample_monitor with different Attribute Forms and styling. However, the 1. Layouts & List Setup theme has no duplicate layers in it.
Hi and thank you for more details on this issue. Please proceed with sharing the project to Mergin Maps user [email protected] (have you not done this prior to this message/issue) and let me know your workspace and project name for identification. Please follow the tutorial if in doubt: https://merginmaps.com/docs/tutorials/working-collaboratively/#share-a-project-with-a-specific-mergin-maps-user
Hopefully I will be able to replicate the issue and provide proper information to the devs.
Kind regards
Tadeas
@Tadeo98 shared with support 👍 agmc/FutureFarm1_DEV
So I was able to replicate the issue by duplicating layers, although your notes suggest this doesn't need to be the cause as not all of the layers were duplicated. Indeed by duplicating the same original layer and putting the duplicates into one group and the one group is in theme, the first layer will be the one that was created first, thus the order is not alphanumerical but time creation based. At least we have something now. Hopefully we have something useful for the devs to deal with it. Thank you!
Hi @Tadeo98, thanks for the feedback and great that you were able to recreate the issue and that it is not just me being stupid!
How would you suggest I go about trying to resolve this issue? Should I delete all the layers in a single theme, and delete the theme. Then sync, then create the theme again and load the first layer I want to be selected into the layer? And try re-build the qgz like this? Any suggestions/guidance would be greatly appreciated.
Apart from the duplication cause I have also found, that even renaming original layernames to new ones can result in alphanumerical order not being taken into account. Say you have created layers "1_survey" and "2_survey". The layers are saved under these names no matter what, even if you rename the layers in Table of contents in QGIS. In the app you would see "1_survey" first and "2_survey" second. Now rename the "1_survey" to "3_survey". This layer still will be selected/shown first despite its name starting with "3" which is naturally behind "2". I don't think this explains all the cases of the issue and I have provided my findings to the devs, perhaps renaming all the layers that are selected automatically as the first one in each theme would help. Well, renaming and manually reordering accordingly within groups and then updating the themes. If it's "5.2 (M) Nematode Sample" layer that is selected automatically, just rename it to "5.1 (M) Nematode Sample" and put it first in the list (above original "5.1. (M) Pest Monitoring"). I know it's not the best workaround, but please consider it.
Hi @Tadeo98,
Some feedback which you are welcome to pass onto the devs if it helps. In the specific project I shared with you, I deleted all the layers in a map theme and then added them back in the order I needed them to be displayed. This worked for 3 out of 5 map themes where the first layer was not selected (by default, the first layer in the theme is used the most and we want it to be selected). Two of the themes still don't show correctly, even after adding them in the order I want them to display. One of them the order didn't pull correctly from how I imported them, but it was both duplicates of the same layer so I could swap them around to resolve this.
Obviously there is still a bug somewhere, and would be great if the devs could investigate at some point.
Let me know if you need any more info on this issue.
Thank you very much for letting me know. I will update the devs with this and hopefully they get to it soon!
This was automatically closed by github, do you think you could reopen it @Withalion ?
Yeah, thanks @ValentinBuira I missed that it was closed
This should no longer happen.
@RastoHu are you sure about it? I was able to replicate it a week ago
superseeded by #4011