[mapguide-users] problem with SelectFeature

Jackie Ng jackie.ng at aecsystems.com.au
Wed Jan 16 17:42:59 EST 2008


Did you instantiate an MgMap instance via the empty constructor, or the one
that takes an MgSiteConnection object?

Using the code that way requires your MgMap instance be initialized with a
MgSiteConnection object first.

Otherwise, you should be using the SelectFeatures() method of
MgFeatureService.

- Jackie


A H wrote:
> 
> hello everyone, i'm quite new in MapGuide. i spent half of the day today
> because i can't get this filter to work.
> 
> MgLayer areaLayer = GetLayerByName(map, "area");
> 
> MgFeatureQueryOptions areaQuery = new MgFeatureQueryOptions();
> areaQuery.SetFilter("area_id like '%'");
> 			
> MgFeatureReader featureReader = areaLayer.SelectFeatures(areaQuery);
> 
> 
> i can get the areaLayer, but when i apply the filter, i got this message:
> 
> Null reference.Null reference. Exception occurred in method
> MgMap.GetService at line 93 in file
> c:\build_bond_area\mapguide_open_source_v1.2\build_18.1\mgdev\common\mapguidecommon\MapLayer/Map.cpp
> 
> 
> the code was working for other parts of the system. but this time i'm
> trying to use the filter on this "area" layer, which is a permanent layer
> on the map. usually i use the filter on a temporary layer. i'm not sure
> whats the problem. i suspect its my filter text :(
> 
> what i want to do with this later is get the geometry and redraw it on a
> temporary layer.
> 

-- 
View this message in context: http://www.nabble.com/problem-with-SelectFeature-tp14877647s16610p14896458.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list