[mapguide-users] Petitions too slow?

Andy Morsell amorsell at spatialgis.com
Thu Jun 1 12:06:59 EDT 2006


Hi Jose,
I'm curious how you got the object Properties to appear programmatically
after selecting the object?  I have some similar functionality and when I
select the object programmatically (using MGSelection.AddFeatureID), it is
only highlighted on the map with the Properties pane empty.

Thank you. 


Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

-----Original Message-----
From: Jose Manuel C G [mailto:gis at mapas-sll.com] 
Sent: Thursday, June 01, 2006 7:57 AM
To: users at mapguide.osgeo.org
Subject: Re: [mapguide-users] Petitions too slow?


Here is the modified code in php, the basic is here, the rest you can
imagine...

<?php
    include 'appconstants.php';   //In this file I've included the code to
$siteConnection, $resourceService and $featureService.

	$matches = 0;
	
		$StrAddr = trim($_GET['StrAddr']);
		$NumVia = trim($_GET['HouseNumber']);
        if (strlen($owner) > 0){
			if (strlen($NumVia) > 0){
				$filter = "NOMBREVIA LIKE '" . $StrAddr . "'
AND PRIMERNUM = " . $NumVia . "";

				$featureResId = new
MgResourceIdentifier("Library://<path to your
FSource>/Callejero.FeatureSource");
				$queryOptions = new MgFeatureQueryOptions();
				$queryOptions->SetFilter($filter);

				$geometryReaderWriter = new
MgAgfReaderWriter();
		
				$featureReader =
$featureService->SelectFeatures($featureResId,
"Callejero", $queryOptions); // Callejero is the name of the layer

				while ($featureReader->ReadNext()){
					$name =
$featureReader->GetString('NOMBREVIA');
					$tipovia =
$featureReader->GetString('TIPOVIA');
					$refcat =
$featureReader->GetString('CRT');
	
					$byteReader =
$featureReader->GetGeometry('Geometry');
	
					$geometry =
$geometryReaderWriter->Read($byteReader);
					$point = $geometry->GetCentroid();
					$x =
$point->GetCoordinate()->GetX();
					$y =
$point->GetCoordinate()->GetY();
	
					echo "setArrayElement(' $tipovia
$name, $NumVia ');";
					$matches++;
				}            
			}else{
			//  If the user only input Street Name 
				$filter = "NOMBREVIA LIKE '" . $StrAddr .
"'";

				$featureResId = new
MgResourceIdentifier("Library://<path to your
FSource>/Calles.FeatureSource");
				$queryOptions = new MgFeatureQueryOptions();
				$queryOptions->SetFilter($filter);

				$geometryReaderWriter = new
MgAgfReaderWriter();
		
				$featureReader =
$featureService->SelectFeatures($featureResId,
"Calles", $queryOptions); //Calles is the name of another layer

				while ($featureReader->ReadNext()){
					$idc =
$featureReader->GetString('IDC');
					$tipovia =
$featureReader->GetString('TIPOVIA');
					$name =
$featureReader->GetString('NOMBREVIA');
					$escala =
$featureReader->GetString('ESC');
	
					$byteReader =
$featureReader->GetGeometry('Geometry');
	
					$geometry =
$geometryReaderWriter->Read($byteReader);
					$point = $geometry->GetCentroid();
					$x =
$point->GetCoordinate()->GetX();
					$y =
$point->GetCoordinate()->GetY();
	
					echo "setArrayElement(' $tipovia
$name ');";
					$matches++;
				}
			}
		$featureReader->Close();
        }else{
		// The user doesn't input a Street Name
		echo "traducir('Bsq03');"; // traducir is a function in
javascript to translate.
        }
		if ($matches == 0){
		echo "traducir('Bsq04');";
		}
?>
--
View this message in context:
http://www.nabble.com/Petitions+too+slow--t1715911.html#a4663663
Sent from the OSGeo MapGuide forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org







More information about the Mapguide_users mailing list