Sorry I meant to write this:
- I get an error -> ReferenceError: Can't find variable: ikke_listet

So it does not kick on "gbif_ns" which is the namespace but on the
"ikke_listet" which is the name of the layer in GeoServer. In
GeoServer the layer shows up like this: ikke_liste and I create the
wms layer by calling the layer "gbif_ns:ikke_rodlistet". So how do I
reference it in the function with "mergeNewParams" ?
Thanks.
~asle



2012/5/9 Asle Benoni <[email protected]>:
> 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 <[email protected]>:
>> 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
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to