[mapguide-users] Filter features in the viewer

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Mon May 25 04:03:36 EDT 2009


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 lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>   
>>>       
>> _______________________________________________
>> 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/e2e6e39f/attachment.html


More information about the mapguide-users mailing list