I have a map, the very bottom (behind) layer contains united states (polygons for each state); and the very top layer contains my study locations (points layer).
The layers are displaying correctly, but when I hover over one of my study location points, the information is given as "Montana", which is the information for my "behind" united states layer and not for my "top" study locations layer. (Please see photo 1)
I changed the order of my layers (put the field locations behind the US polygons). I can't see my field locations, because they are hidden behind the polygons, BUT now when I hover over my study site locations (even though I can't see them) the information for my study site appears.
It seems that even though the map is displaying layers in the correct order, the information for popup-on-hover is accessed in reverse order. This is true for qgis2web preview within the QGIS desktop and once I extract the files and look at my Index.html in a web browser.
I added a duplicate of my study sites layer, behind the united states layer (but this is an ugly fix and the "Study Sites copy" layer shows up in the layer switcher, which will confuse the user) (Please see photo 2)
Can someone help me understand the connection between the order of layers which I think is determined in the layers.js:
var layersList = [lyr_USA1,lyr_MajorUSCities2,lyr_MT3,lyr_MTRoads4,lyr_MTCities5,lyr_StudySites6];
--> The USA layer already has 1 attached to it?
and the qgis2web.js code
map.forEachFeatureAtPixel(pixel, function(feature, layer)
How can I order layers in a different way (one layersList to display the layers and reverse layersList to extract hover popup information)?