TransWikia.com

OpenLayers pass character parameters problem

Geographic Information Systems Asked by Nemo on October 17, 2020

I want send character parameter (‘GREEN’) to GeoServer as following:

var untiled = new ol.layer.Image({
    source: new ol.source.ImageWMS({
      ratio: 1,
      url: 'http://localhost:8080/geoserver/newyork/wms',
      params: {         
            "LAYERS": 'newyork:viewStation',
            "viewparams": 'col:'+'GREEN'
      }
    })
  });

viewStation is a SQL query:

SELECT * FROM station WHERE color=%col%

but the code doesn’t work, I also tried ‘col:GREEN’

What can I change?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP