[OpenLayers-Dev] Format: inheriting writers

Tim Schaub tschaub at opengeo.org
Mon May 11 13:35:02 EDT 2009


Hey-

bartvde at osgis.nl wrote:
> Hi list,
> 
> currently the SLD Format writers property uses the Filter Format writer
> property. The Filter Format uses ogc as the prefix, e.g.:
> 
> var node = this.createElementNSPlus("ogc:PropertyIsEqualTo");
> 
> So this will work fine.
> 
> Now I want to use the Format.SLD writers in my OWSContext Format for
> MinScaleDenominator and MaxScaleDenominator, but the problem here is that
> there is no prefix, so:
> 
>             "MaxScaleDenominator": function(scale) {
>                 return this.createElementNSPlus(
>                     "MaxScaleDenominator", {value: scale}
>                 );
>             },
> 
> This will create MaxScaleDenominator in the default namespace, which is
> incorrect.
> 

Yeah, you cannot currently extend a new format with the writers from the 
sld prototype.

http://trac.openlayers.org/ticket/2087

Let me know if this patch addresses your issue.

Tim

> Is there any way to work around this? Ofcourse changing the above to:
> 
>             "MaxScaleDenominator": function(scale) {
>                 return this.createElementNSPlus(
>                     "sld:MaxScaleDenominator", {value: scale}
>                 );
>             },
> 
> will make things work in either cases.
> 
> Best regards,
> Bart
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list