[mapguide-users] Modify the PHPViewerSample
Michael L.
bjoern07-web at yahoo.de
Thu Jan 10 04:09:23 EST 2008
Hi,
i'd like to modify the query from the phpviewersample that the user can only
select the layer properties which are shown in the properties pane. What do
I have to change in this code to do this?
Thanks in advance
Michael
function GetLayerProperties()
{
$properties = array();
$resourceService =
$this->site->CreateService(MgServiceType::ResourceService);
$map = new MgMap();
$map->Open($resourceService, $this->args['MAPNAME']);
$layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
$featureService =
$this->site->CreateService(MgServiceType::FeatureService);
$resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
$schemaClass = explode(':', $layer->GetFeatureClassName());
$classDef = $featureService->GetClassDefinition($resId,
$schemaClass[0], $schemaClass[1]);
for ($i = 0; $i < $classDef->GetProperties()->GetCount(); $i++)
{
$propertyDef = $classDef->GetProperties()->GetItem($i);
if ($propertyDef->GetPropertyType() ==
MgFeaturePropertyType::DataProperty)
{
$dataType = $propertyDef->GetDataType();
if ($this->IsValidDataType($dataType))
{
array_push($properties, new
Property($propertyDef->GetName(), $dataType == MgPropertyType::String));
}
}
}
return $properties;
}
--
View this message in context: http://www.nabble.com/Modify-the-PHPViewerSample-tp14730187s16610p14730187.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list