R: [mapguide-users] Filter features in the viewer

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Mon May 25 07:28:06 EDT 2009


Arh yes, my mistake.

You need to:
1) Create a copy of the LayerDefinition Xml
2) Set the <filter> property
3) Save the LayerDefinition xml as a session based resource
4) Call SetLayerDefinition to point to the session based copy
5) Save the MgMap instance

(A bit more difficult than just setting the property :))

Regards, Kenneth Skovhede, GEOGRAF A/S



vittorio skrev:
>
> MgLayers.Filter? I don’t found this in the MapGuide Java API
>
>  
>
> *Da:* Kenneth Skovhede, GEOGRAF A/S (via Nabble) 
> [mailto:ml-user+64672-363962087 at ... 
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2969134&i=0>]
> *Inviato:* lunedì 25 maggio 2009 12.38
> *A:* vittorio
> *Oggetto:* Re: [mapguide-users] Filter features in the viewer
>
>  
>
> Try this instead:
>
> MgLayers.Filter = "FG = '3'";
> map.Save();
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> vittorio skrev:
>
> Where can I find code examples regarding filter on the run-time layer?
>  
> I post my code used:
>  
>     String whereClause = "FG = '3'";
>     String layerNameDaFiltrare = "par10";
>     MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
>     queryOptions.SetFilter(whereClause);
>     MgLayer layer = (MgLayer) map.GetLayers().GetItem(layerNameDaFiltrare);
>     MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
>  
> Thanks for your reponse.
>  
> Vittorio.
>  
>  
>  
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>
>     You must set the filter on the RuntimeLayer, not the LayerDefinition.
>
>     Also, look in the server log for clues.
>
>     There is a quirk in MapGuide, that it will render the entire layer 
>
>     without filters, if the filter fails.
>
>     I'm not sure you get a log message in that case, but start out with a 
>
>     simple filter like:
>
>     ID = 3
>
>      
>
>     Regards, Kenneth Skovhede, GEOGRAF A/S
>
>      
>
>      
>
>      
>
>     Vittorio Ricchiuto skrev:
>
>         
>
>         Hi,
>
>          
>
>          
>
>          
>
>         I would filter features in the viewer, how can I do? I filter with the 
>
>         web API by SetFilter, but I do not see the effect on the map 
>
>         although I refresh the map.
>
>          
>
>          
>
>          
>
>         Thank you for your help.
>
>          
>
>          
>
>          
>
>         Vittorio.
>
>          
>
>          
>
>          
>
>         ------------------------------------------------------------------------
>
>          
>
>         _______________________________________________
>
>         mapguide-users mailing list
>
>         mapguide-users at ... <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2969000&i=0>
>
>         http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>           
>
>               
>
>     _______________________________________________
>
>     mapguide-users mailing list
>
>     mapguide-users at ... <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2969000&i=1>
>
>     http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>      
>
>      
>
>         
>
>  
>   
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at ... 
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2969000&i=2>
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
> ------------------------------------------------------------------------
>
> This email is a reply to your post @ 
> http://n2.nabble.com/Filter-features-in-the-viewer-tp2939889p2969000.html
> You can reply by email or by visting the link above.
>
>  
>
>
> ------------------------------------------------------------------------
> View this message in context: R: [mapguide-users] Filter features in 
> the viewer 
> <http://n2.nabble.com/Filter-features-in-the-viewer-tp2939889p2969134.html>
> Sent from the MapGuide Users mailing list archive 
> <http://n2.nabble.com/MapGuide-Users-f1803227.html> at Nabble.com.
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090525/47dbc10e/attachment.html


More information about the mapguide-users mailing list