Control/WMSQuery

Version 9 (modified by ominiverdi, 6 years ago)

--

!WMSQuery Control


Description

This Control is an enhanced version of Control/PanZoomBar. Clicking on the Query button (third button with "i" inside) you'll activate this function:

  • Click on a map to query all queryable layers
    • Queryable layers are signed with a "(q)" in the legend.
    • An AJAX call is made to all WMS server to get text/html output
    • the output is redirected to the queryTarget object.

code sample

  //set the target div for query output
  var queryTarget = $('queryOut');
  
  //create the Control
  WMSToolbar = new OpenLayers.Control.WMSToolbar({queryTarget: queryTarget});

  // add control to map instance
  map.addControl(WMSToolbar);

know bugs or open issues

  • QueryByRect is returning a stupid alert message. should be better to have a QueryByPoint on the center of the rectangular.
  • Query are made only in text/html mode. Would be better to offer a GML parser or a way to choose the mode.