[mapguide-users] Re: SetVisible worked in 2.0, fails in 2.1

Tom Chadwin tom.chadwin at nnpa.org.uk
Fri Mar 19 06:21:09 EDT 2010


Confirmed that SetVisible(True) is the issue. This is the code:

MgInitializeWebTier ($configFilePath);
$userInfo = new MgUserInformation($mgSessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
$map = new MgMap($siteConnection);
$map->Open($mapName);

//Create a filter to select the desired features.
$queryOptions = new MgFeatureQueryOptions();
$filterQuery = $_GET['searchColumn'] . " LIKE '%" . $_GET['searchValue'] .
"%'";
$queryOptions->SetFilter($filterQuery);

// Select the features.
$layer = $map->GetLayers()->GetItem($_GET['layerName']);
$featureReader = $layer->SelectFeatures($queryOptions);	

//display the layer
$layer->SetVisible(True);
$map->Save();

The stack trace gives:

- MgLayerBase.SetVisible() line 181 file
c:\osgeo\mapguide_21\mgdev\common\platformbase\MapLayer/LayerBase.cpp 

If I comment out the SetVisible(True) line, the rest of the script throws no
exceptions, and I get some data back.

Can anyone help?

Thanks

Tom
-- 
View this message in context: http://n2.nabble.com/SetVisible-worked-in-2-0-fails-in-2-1-tp4757366p4762023.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list