[OpenLayers-Users] OpenLayers.Filter.Comparison.LIKE and
singleChar
Eric Lemoine
eric.lemoine at camptocamp.com
Thu Aug 5 11:31:34 EDT 2010
On Thu, Aug 5, 2010 at 2:28 PM, Arnd Wippermann <arnd.wippermann at web.de> wrote:
> Hi Eric,
>
> thanks for the reply and the hint. It's a more complex situation.
>
> It's not a problem with the filter, but with OpenLayers.Format.SLD().read:
>
> I create a SLD and apply it to a vector layer
>
> var formatSLD = new OpenLayers.Format.SLD();
> var sld = formatSLD.read(theSLD_BODY);
> ...
>
> It works perfect, but only the LIKE-filter with "." works not.
>
> The filterpart from theSLD_BODY for this case looks like
>
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
> <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
> <ogc:PropertyName>indice</ogc:PropertyName>
> <ogc:Literal>.2</ogc:Literal>
> </ogc:PropertyIsLike>
> </ogc:Filter>
>
> The ".2" enters the function OpenLayers.Filter.Comparison.value2regex
>
> as 0.2 as number (typeof this.value -> number ?!)
>
> and causes the error "this.value.replace is not a function".
>
> if I overwrite the function by adding this.value=this.value.toString(), then
> the error vanishes, but the applied rule to the vector layer doesn't result
> in a correct style.
>
> Appling the same SLD to the WMS layer, shows the correct style. It seems,
> the SLD is correct.
>
> I remember a case with labels like 02.09, that change to 2.09. Perhaps the
> same issue.
>
> If you have any hint, where to further look?
Does the attached patch solve the problem?
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 877 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100805/8ebf4d3a/patch.obj
More information about the Users
mailing list