[mapguide-users] Problem with MgSelection's GetSelectedFeatures

Jackie Ng jumpinjackie at gmail.com
Thu Jul 23 00:23:39 EDT 2009


Have you tried using the MgMap(MgSiteConnection) constructor? I get a feeling
the selection you've created assumes the map was created with this
constructor.

Note that if you do change constructors, you should be calling the overloads
of Open(), Create() and Save() without the service parameters.

- Jackie


Tom Lazo / Stygy wrote:
> 
> Hi, 
> 
> Well, srry about my last post, quiet stupid...dun worry..i erased it.
> Ok, i'm using the MgSelection as it follows	
> 
>         include ("Common.php");
>         include('../../common/php/Utilities.php');
>         include('Utilities.php');
> 	
> 	$featureService =
> $siteConnection->CreateService(MgServiceType::FeatureService);
> 
>         $map = new MgMap();
>         $map->Open($resourceService, $mapName);
> 	
> 	$selection = new MgSelection($map);
> 	$selection->Open($resourceService,$mapName);
> 		
> 	$layers = $map->GetLayers();
> 	
> 	$layer = $layers->GetItem("LOTES"); // Ya tengo mi MgLayerBase
> 	$className = $layer->GetFeatureClassName();
> 	
> 	$layersS = $selection->GetLayers();
> 	
> 	$ind = $layersS->IndexOf($layer);
> 	echo $ind . " \n ";
> 	
> 	$boolS = true;
> 	
> 	$featureCount = $selection->GetSelectedFeaturesCount($layer,$className); 
> 	echo $featureCount . " \n ";
> 
> 	$featureReader =
> $selection->GetSelectedFeatures($layer,$className,$boolS); 
> 
> I have no problem with the GetSelectedFeaturesCount ( it gives me the
> correct number), my problem is the  GetSelectedFeatures function... my app
> crashes when i uncomment it. Could somebody tell me why ?
> 
> Thanks.
> 
> Tom 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Problem-with-MgSelection%27s-GetSelectedFeatures-tp3305494p3307505.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list