[OpenLayers-Users] [Possible spoofed sender] Re: [Possible spoofed sender] Re: Like query with "singleChar" does not work correctly in OpenLayers.StyleMap

Ruff, Thomas Thomas.Ruff at solers.com
Mon Apr 27 20:17:22 PDT 2015


I'm not the best guy to answer regex questions.  I merely noticed that the line 

filter.value = filter.value.replace(/\*/g, '!*');

in your example resulted in no change to the value of filter.value and that when I changed your regex value to something very simple I saw that the OL filter worked on the vector layer styling.  

Tom

________________________________________
From: openlayers-users-bounces at lists.osgeo.org [openlayers-users-bounces at lists.osgeo.org] on behalf of joaorodr84 [joaorodr84 at gmail.com]
Sent: Monday, April 27, 2015 3:50 PM
To: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] [Possible spoofed sender] Re: [Possible spoofed sender] Re: Like query with "singleChar" does not work correctly in OpenLayers.StyleMap

Hi again, Thomas

I used this line

        filter.value = filter.value.replace(/\*/g, '!*');

because I want a filter like this:

        var filter = new OpenLayers.Filter.Comparison({
                property: 'STATE_NAME',
                type: '~',
                value: '*'
        });

to match ALL the state names.

But, you are right, it is not necessary for the "singleChar" --> "." example
that I want to make work.

---

About what you said, that you messed around with RegExp and it worked. Did
you try to use the singleChar "."?

For example, I want all the states which name has 5 letters. So, I use 5
times the singleChar, which supposedly matches *any single character*.

I may be wrong, but I don't know why. Do you think "." does not represent
the singleChar?

Look t the example, please. In green stroke you see the same layer but in
WMS. The style (SLD Body) here works fine. It matches the states: Idaho,
Texas and Maine. The y are the only ones with 5 letters.

But, in the vector layer, which uses an OpenLayers.StyleMap, it shows all
the states with 5 or more letters. But the filter used in the rule of the
style is *exactly the same*.

I don't understand this.

Thanks for your help.

João






--
View this message in context: https://urldefense.proofpoint.com/v2/url?u=http-3A__osgeo-2Dorg.1560.x6.nabble.com_Like-2Dquery-2Dwith-2DsingleChar-2Ddoes-2Dnot-2Dwork-2Dcorrectly-2Din-2DOpenLayers-2DStyleMap-2Dtp5203061p5203183.html&d=BQIGaQ&c=gpp0UHgwH8jd0f0gRc5QaF0zPfGT1csUQXD9eLov3hQ&r=iiS-4SY2BTp-9WmUwQb3-zEL2tnO_1j_07NMJG-MZ0s&m=vSBwIgMhfpjrbaDD_KvBHCP_7pH-Dml6oDJF2n0vjMc&s=64lC_lCUZcqXK9bjkZzo0LPBF9LST3iVsV-0XHlGfdg&e=
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.osgeo.org_mailman_listinfo_openlayers-2Dusers&d=BQIGaQ&c=gpp0UHgwH8jd0f0gRc5QaF0zPfGT1csUQXD9eLov3hQ&r=iiS-4SY2BTp-9WmUwQb3-zEL2tnO_1j_07NMJG-MZ0s&m=vSBwIgMhfpjrbaDD_KvBHCP_7pH-Dml6oDJF2n0vjMc&s=S1rrZdmFyWzVQgz8mSeV1r3vaxFSNhwrN9DFhbFA4ek&e=


More information about the Users mailing list