3

The case: A lot of features need to be rendered on an openlayers map. Drawing all features on the map (WFS) causes performance issues (especially in IE). Therefore I have chosen to use WMS so that the client is spared the heavy rendering load.

The problem: To get information about certain features I use "Openlayers.Control.GetFeature". This works, but only when you use one layer.

I have multiple layers with different feature types. I still need to be able to use the box selection method. It may be that this exceeds the openlayers limits.

Adding multiple select controls did not seem to have any effect.

  • 2
    why not use getFeatureInfo - you can specify as many layers as you need. – Ian Turton Oct 31 '11 at 14:24
  • @iant That is a possibility indeed, but how would I setup a box selection? Using spatial filter with 4 coordinates? – Boedy Oct 31 '11 at 14:31
  • 3
    depends on your WMS server - with GeoServer you can append a filter element to the request docs.geoserver.org/latest/en/user/services/wms/vendor.html – Ian Turton Oct 31 '11 at 14:43
  • @iant Thanks! That link helped me so much! I'm thinking of writing my own functions to get the data. This way I can adjust it to my needs. I'll try and update this thread when I figured out the most of it. – Boedy Oct 31 '11 at 16:16
  • see gis.stackexchange.com/questions/15616/… for why writing your own function is a bad idea. – Ian Turton Nov 1 '11 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.