Uncaught exception 'mginvalidpropertytypeexception'...when click
on added point to map.
Maciej Skorczewski
maciej.skorczewski at procad.pl
Mon Dec 4 03:17:14 EST 2006
hi!
In my project i add some markers on layer. ex. add image on layer who
type='test'
When i click on layer i get xml whit selection option...it work great
but when i add new symbol (market) and i clik on it i get xml (who looks
fine) but i get error:
----
Fatal error: Uncaught exception 'mginvalidpropertytypeexception' in
Unknown on line 0
----
whit this code i get name of selected layer (i work whit all layer on
map,it even take a name od new layer whit markets)
//$xml --> i take it form user selecton (when he clik on object)
$sel = new MgSelection($map, $xml);
$layers2 = $sel->GetLayers();
for($i = 0; $i < $layers2->GetCount(); $i++)
{
$layer2 = $layers2->GetItem($i);
//name of selected layer.
$selected_layer=$layer2->GetName();
}
..when i have name of selected layer i get properties of selected
point(like ID,NAME etc..)
----- code ------
$selectedFeatures=array();
$layers= $selection->GetLayers();
if($layers)
{
for($i=0; $i<$layers->GetCount(); $i++)
{
// only check selected features in our layer
$layer=$layers->GetItem($i);
if($layer && (!isset($selected_layer) ||
$layer->GetName()==$selected_layer))
{
// create a filter containing the IDs of the selected features on
this layer
$layerClassName=$layer->GetFeatureClassName();
$selectionString=$selection->GenerateFilter($layer, $layerClassName);
// get the feature resource for the selected layer
$layerFeatureId=$layer->GetFeatureSourceId();
$layerFeatureResource=new MgResourceIdentifier($layerFeatureId);
// apply the filter to the feature resource for the
selected layer. this returns MgFeatureReader for all the selected features
$queryOptions->SetFilter($selectionString);
$featureReader =
$featureService->SelectFeatures($layerFeatureResource, $layerClassName,
$queryOptions);
// process items
while($featureReader->ReadNext())
// po jakiej zmniennej z plku
$selectedFeatures[]=$featureReader->GetDouble('ID');
}
}
}
----- end code --------
where error is? what is wrong?
--
Maciej Skorczewski
More information about the Mapguide_users
mailing list