实际情况是在Map初始化的开始定义了带有附加CQL参数的WMS请求。
当选择后更改CQL参数时,初始WMSGetFeatureInfo(wmsGetFeatureInfoOptions)似乎无法更改。
另一方面,当更改用于显示WMS的CQL参数时,可以使用mergeNewParams在GWT-OPenLayers中完成此操作
final WMSParams wmsParams = new WMSParams(); wmsParams.setCQLFilter(this.makeCqlString()); wmsParams.setParameter(((Double)Math.random())。toString(),((Double)Math.random())。toString()); this.infoWMS.mergeNewParams(wmsParams);
buildWMSOptions(openLayers)应该为wmsGetFeatureInfoOptions做类似的事情。
答案 0 :(得分:0)
对问题的回答是重新发出原始的wmsGetFeatureInfo并在原始时更改CQL参数时重建它
public void reDrawInfoLayer()
{
final WMSParams wmsParams = new WMSParams();
wmsParams.setCQLFilter(this.makeCqlString());
wmsParams.setParameter(((Double) Math.random()).toString(), ((Double) Math.random()).toString());
this.infoWMS.mergeNewParams(wmsParams);
this.infoWMS.redraw();
if (mapPanel.getWmsGetFeatureInfo() != null)
{
mapPanel.getWmsGetFeatureInfo().disable();
mapPanel.getWmsGetFeatureInfo().deactivate();
mapPanel.getMap().removeControl(mapPanel.getWmsGetFeatureInfo());
}
mapPanel.getWmsGetFeatureInfoOptions().setInfoFormat(GetFeatureInfoFormat.GML.toString());
mapPanel.getWmsGetFeatureInfoOptions().setMaxFeaturess(1);
// determine the currently visible WMS layers
final List<WMS> lLayers = this.getVisibleWmsLayers();
mapPanel.getWmsGetFeatureInfoOptions().setLayers(lLayers.toArray(new WMS[lLayers.size()]));
// create the WmsGetFeatureInfo
mapPanel.setWmsGetFeatureInfo(new WMSGetFeatureInfo(mapPanel.getWmsGetFeatureInfoOptions()));
mapPanel.getMap().addControl(mapPanel.getWmsGetFeatureInfo());
mapPanel.getWmsGetFeatureInfo().activate();
// Add get FeatureListener
mapPanel.getWmsGetFeatureInfo().addGetFeatureListener(new GetFeatureInfoListener()
{