[mapguide-users] Show Name Property in task pane
Dhirendra Kumar
dhirendra.mgos at gmail.com
Sat Mar 17 05:14:36 EDT 2007
Hi All,
I am devloping Election GIS using MGOS. I want to navigate village by their
name so for that resion i write code :->
======================================================================
try
{
// Initialize the Web Extensions and connect to the Server using
// the Web Extensions session identifier stored in PHP session
state.
MgInitializeWebTier ($configFilePath);
$userInfo = new MgUserInformation($mgSessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
// Create a FeatureService object and use it to query all of the
// districts from the "VotingDistricts" feature source. Get the
// name and geometry properties of each district feature and use
// that to construct the table of hyperlinks.
$featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
$resId = new
MgResourceIdentifier("Library://Project/Pandua/Data/Village_region.FeatureSource");
$featureReader = $featureService->SelectFeatures($resId,
"Village_region", null);
$tableData = new MgPropertyCollection();
$geometryReaderWriter = new MgAgfReaderWriter();
while ($featureReader->ReadNext())
{
$key = $featureReader->GetInt32('FeatId'); // For fetching Unique Int
values
$name = $featureReader->GetString('NAME'); // Fetch Village name for
Display (Dhirendra Kumar)
$byteReader = $featureReader->GetGeometry('Geometry');
$geometry = $geometryReaderWriter->Read($byteReader);
$point = $geometry->GetCentroid();
$x = $point->GetCoordinate()->GetX();
$y = $point->GetCoordinate()->Gety();
$tableData->Add(new MgStringProperty($key,
"gotopoint.php?X=$x&Y=$y&Scale=25000"));//************** Original
}
$featureReader->Close();
// Output the hyperlinks in sorted order. The SDF+ FDO
// Provider does not support the OrderingFilter in
// FeatureQueryOptions yet...
for ($i = 1; $i <= $tableData->GetCount(); $i++)
{
$property = $tableData->GetItem((string)$i);
echo '<tr><td><hr> . GetValue() . '"' . 'target="scriptFrame">Village '
. $property->GetName() . ' </td></tr>';
}
}
catch (MgException $e)
{
echo $e->GetMessage();
echo $e->GetDetails();
}
======================================================================
But when i click on navigate button then i saw only Vilage1 instead of
village <village name>. how should iterate proerty name. any boady suggest
me.
Thankyou in Advance
Dhirendra Kumar
--
View this message in context: http://www.nabble.com/Show-Name-Property-in-task-pane-tf3418457s16610.html#a9527618
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list