|
From: Asle B. <asl...@gm...> - 2012-05-09 14:27:03
|
Thanks for pointing me to the CQL filter. I have looked at this and found this page with a starter insight: http://www.azavea.com/blogs/labs/2011/06/using-the-cql_filter-parameter-with-openlayers-wms-layers/ Still I do not know how to call this in my page. In the example above it says: wms_layer.mergeNewParams({'CQL_FILTER':..... Since I am a newbie I don't know how to call my layer. I.ex. I make a layer this way: var createWmsLayer = function(name, url, params, options) { map.addLayer(new OpenLayers.Layer.WMS(name, url, params, options)); }; createWmsLayer("<span class='locc'>Ikke listet</span>", "http://localhost/geoserver/wms", {layers: 'gbif_ns:ikke_listet',format: 'image/png', transparent: 'true'}, {singleTile: true, ratio: 1, isBaseLayer:false, visibility: false} ); So what do I put in the "wms_layer" in the example above? I tried to make a function like this: function CQLfilter(param){ filter_list = [] filter_list.append("collector LIKE '%H%' ") var cql = ' AND '.join(filter_list) gbif_ns:ikke_listet.mergeNewParams({'CQL_FILTER': "collector LIKE '%H%' "}) } - I get an error -> ReferenceError: Can't find variable: ikke_rodlistet So how do I reference the layer exactly? Any help in the right direction is highly appreciated! ~asle 2012/4/30 Phil Scadden <p.s...@gn...>: > whoops too quick with send. > Add it in OL with > filterParams["cql_filter"] = my CQL filter; > layer.mergeNewParams(filterParams); > > > Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Geoserver-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geoserver-users |