GeoServer layers extent issue

40 Views Asked by At

I've built a website that features a map using OpenLayers technology and GeoServer for hosting geographic data. On this map, I've included various layers such as buffer zones, tree locations, building footprints, and road networks. My goal was to enable users to click on these map features and retrieve specific information associated with them, such as the name, unique identifier, and number of floors for buildings.

However, I encountered an issue during interaction with the map layers. Whenever I clicked anywhere on the map, the website responded as though I had clicked on the first layer I uploaded, which happened to be the buffer zone with a radius of 350 meters. Surprisingly, even after removing this initial layer and attempting to interact with the other layers, the same behavior persisted. Each time I clicked on the map, it seemed to register as though I had clicked on the subsequent layer in the upload sequence, such as the 300-meter buffer zone layer.

when i clicked on random point on the map it shows 350mBuffer building layer

Upon closer examination, it became apparent that the layers were being stacked on top of each other based on the order in which I uploaded them to the website. This layer stacking order influenced the interaction behaviour, causing the topmost layer to always respond to clicks, while the layers beneath it remained inaccessible.

uploading layers

click event on layer

1

There are 1 best solutions below

3
Ian Turton On

That is how WMS servers work - You can tailor the layers being searched by changing the getFeatureInfo request you generate and send to the server. There is a parameter called QUERYLAYERS that you should set to the layer(s) that you want information from.