Hello Dario,
I'm not sure why your code is not working in 1.5, but I have my suspicions.
Most/all of the examples in 1.5 use OWSContext instead of WMC.
WMC provides a list of WMS layers. OWSContext lists WFS, GML, Cached 
WMS, Google Map layers as well. Unfortunately it has a slightly 
different syntax, which means it is not backwardly compatible with WMC. 
Our MapPaneOL widget should render both WMC and OWSContext files, but it 
might not. (Note that the MapPane widget has been depreated - that might 
also be your problem).

On another note,
I'm interested to know what your end goal is. Adding filter 
functionality to Mapbuilder is a highly requested feature. I'm 
interested to know how you plan to achieve this (your design) and 
whether you are able to return the code back into Mapbuilder.

Andreas may have more to say - he has been looking into Filters as well.

Of note, manipulating a WMC using a filter, or building a filter should 
probably be in a widget or tool rather than in the Context.js. Our 
design aim is to keep the model classes small so that other applications 
which don't use Filter don't need to include the extra code.

Dario Zarro wrote:
> hi,
> I have developed a new function, initFilter, in Context.js. It's a simple
> function to set wmc:Literal value, in wmc:Filter, with parameter passed by
> URL.  
>
> For example:
>
> --- WMC : tasmania.xml ----
>
> <Layer>
> ....
> <SLD>
>     ...
>        <Filter>
>               ...
>               <PropertyIsEqualTo>
>                       <PropertyName>
>                               TYPE
>                         </PropertyName>
>               <Literal id="type"></Literal>  // the id attribute determine 
> url parameter
> name
>               </PropertyIsEqualTo>
>                  <PropertyIsEqualTo>
>                       <PropertyName>
>                               LENGTH
>                         </PropertyName>
>               <Literal id="length"></Literal>  // the id attribute determine 
> url
> parameter name
>               </PropertyIsEqualTo>
>              ...
>        </Filter>
>    ...
> </SLD>
> ...
> </Layer>
>
> --------- end WMC ------
> -------- Context.js ------
> ...
> //my function
>  this.initFilter=function(objRef) {
>     // Set wmc:Filter of context from URL CGI params
>     
>     if(window.cgiArgs["filter"]){
>     var filter=window.cgiArgs["filter"].split(',');   
>     
>     var basicXpath='//wmc:[EMAIL PROTECTED]"value"]';
>     var re="value";
>     
>     for(var i=0;i<filter.length;i++){
>       var keyValue = filter[i].split(':');
>       
>       var currentXpath=basicXpath.replace(re,keyValue[0]);
>       
>       objRef.setXpathValue(objRef,currentXpath,keyValue[1],true);
>     }
>     
>    }
>       
>   }
>   this.addListener( "loadModel", this.initFilter, this );
> ...
> -------- end Context.js-----
> In this example, I can change value at '<Literal id="type"></Literal>'
> passing "../index.html?filter=type:newTypeValue,length:newLengthValue" in
> URL.
>
> THE PROBLEM:
> This function executes correctly in Mapbuilder 1.0.1 but it don't work in
> Mapbuilder 1.5 .
> Why?
>
>
>   


-- 
Cameron Shorter
Geospatial Systems Architect
Tel: +61 (0)2 8570 5050
Mob: +61 (0)419 142 254

Think Globally, Fix Locally
Commercial Support for Geospatial Open Source Solutions
http://www.lisasoft.com/LISAsoft/SupportedProducts.html


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

Reply via email to