[mapguide-users] please provide guidance

Zac Spitzer zac.spitzer at gmail.com
Mon Mar 22 04:03:35 EDT 2010


On 22 March 2010 18:50, padmini godavarthi <godavarthi.padmini at gmail.com> wrote:
>
> Hi,
> iam trying to do zoom+selection features on map.its working fine.

if you are going to pepper the mailing list with nearly every single problem you
have, at least you can take the time to follow up your questions with
an explanation of how you solved the problem.

> Now i want to pass the parcel id dynamically from textbox .......how is it possible?

dynamically where?

>
>
>
>
>
> <?php
>       try
> {
>   include 'utilityfunctions.php';
> $webExtensionsDirectory = 'C:\Program Files\OSGeo\MapGuide\Web\\';
> $MapGuideServerDirectory = 'C:\Program Files\OSGeo\MapGuide\Server\\';
> $viewerFilesDirectory = $webExtensionsDirectory . 'www\viewerfiles\\';
> $schemaDirectory = $MapGuideServerDirectory . 'Schema\\';
> $webconfigDirectory = $webExtensionsDirectory . 'www\\';
> $webconfigFilePath = $webconfigDirectory . 'webconfig.ini';
>  $args =  ($_SERVER['REQUEST_METHOD'] == "POST") ? $_POST : $_GET;
>      $sessionId = $args['SESSION'];
> echo $sessionId;
> MgInitializeWebTier($webconfigFilePath);
>  $siteConnection = new MgSiteConnection();
>  $userinfo = new MgUserInformation($sessionId);
>   $siteConnection->Open($userinfo);
>
> $resourceService =
> $siteConnection->CreateService(MgServiceType::ResourceService);
> $featureService =
> $siteConnection->CreateService(MgServiceType::FeatureService);
>      $map = new MgMap($siteConnection);
>      $map->Open('map');
>      $layers = $map->GetLayers();
>      $count = $layers->GetCount();
>      for ($i = 0; $i < $count; $i++)
>      {
>        $layer = $layers->GetItem($i);
>      }
>                $layerClassName1 = $layer->GetFeatureClassName();
>                $FeatureResId = new
> MgResourceIdentifier("Library://data/resource.FeatureSource");
>                $queryOptions = new MgFeatureQueryOptions();
>                $val="PARCEL";
>                $val1="17330100001001";
>                $query=$val . "=" . $val1;
>                $queryOptions->SetFilter($query);
>                $layer=$map->GetLayers()->GetItem('property');
>               $featureReader = $layer->SelectFeatures($queryOptions);
>                $featureAgfGeometry =
> $featureReader->GetGeometry('Geometry');
>                $agfReaderWriter = new MgAgfReaderWriter();
>                $featureGeometry =
> $agfReaderWriter->Read($featureAgfGeometry);
>                $centroid = $featureGeometry->GetCentroid();
>                $mapCenterX = $centroid->GetCoordinate()->GetX();
>                $mapCenterY = $centroid->GetCoordinate()->GetY();
>                $selection = new MgSelection($map);
>                $selection->AddFeatures($layer, $featureReader,1);
>                $selectionXml = $selection->ToXml();
>        }
>        catch (MgException $e)
>        {
>                echo "<p><strong>Error:</strong> ";
>                echo $e->GetDetails();
>                echo "</p>";
>        }
> ?>
>
>
> <html>
> <head>
>  <title>Zoom Feature</title>
>    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
>    <meta http-equiv="content-script-type" content="text/javascript">
>    <meta http-equiv="content-style-type" content="text/css">
>    <link href="../styles/globalStyles.css" rel="stylesheet"
> type="text/css">
>    <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
>    <script language="javascript">
>                        function Zoom1(x,y) {
>                            var xval=x;
>                            var yval=y;
>                            selectionXml = '<?php echo $selectionXml;?>';
>
>                            parent.parent.mapFrame.ZoomToView(xval, yval,
> 1000, true);
>
> parent.parent.mapFrame.SetSelectionXML(selectionXml);
>
>                        }
>
>
>    </script>
> </head>
> <body>
>        <input type="text" name="id" size="15" value="parcel">
>        <input type="button" name="button" value="Click" size="10"
> onclick="Zoom1(<?php echo $mapCenterX;?>,<?php echo $mapCenterY;?>)">
>
> </body>
> </html>
>
> regards,
> Padmini G.
> --
> View this message in context: http://n2.nabble.com/please-provide-guidance-tp4776619p4776619.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>



-- 
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168


More information about the mapguide-users mailing list