Open($userInfo); // If any parcels have been selected, recenter the image on the first selected parcel. if ($xmlSelection != '') { $queryOptions = new MgFeatureQueryOptions(); $map = new MgMap($siteConnection); $map->Open($mapName); $selection = new MgSelection($map, $xmlSelection); $layers = $selection->GetLayers(); if ($layers) { for ($i = 0; $i < $layers->GetCount(); $i++) { // Only check selected features in the Parcels layer. $layer = $layers->GetItem($i); if ($layer && $layer->GetName() == 'Parcels') { $featureReader = $selection->GetSelectedFeatures($layer, $layer->GetFeatureClassName(), false); // Create the report details using the first selected parcel. Position the image so the // centroid of the selected parcel is in the center of the map. $featureReader->ReadNext(); $featureAgfGeometry = $featureReader->GetGeometry('SHPGEOM'); $agfReaderWriter = new MgAgfReaderWriter(); $featureGeometry = $agfReaderWriter->Read($featureAgfGeometry); $centroid = $featureGeometry->GetCentroid(); $mapCenterX = $centroid->GetCoordinate()->GetX(); $mapCenterY = $centroid->GetCoordinate()->GetY(); $owner = $featureReader->GetString('RNAME'); $address = $featureReader->GetString('RPROPAD'); $billingAddress = $featureReader->GetString('RBILAD'); $description = $featureReader->GetString('RLDESCR1') . '
' . $featureReader->GetString('RLDESCR2') . '
' . $featureReader->GetString('RLDESCR3') . '
'; } } } } } catch (MgException $e) { echo '

' . $e->GetExceptionMessage() . '

'; echo '

' . $e->GetDetails() . '

'; } $selectionEncoded = urlencode($xmlSelection); $imageUrl = "createmapimage.php?SESSION=$sessionId&SELECTION=$selectionEncoded&MAPNAME=$mapName&SCALE=$mapScale" . "&HEIGHT=$imageHeight&WIDTH=$imageWidth&CENTERX=$mapCenterX&CENTERY=$mapCenterY"; ?> Property Report

Property Report

\n"; echo "Address: $address
\n"; echo "Billing Address: $billingAddress
\n"; echo "Description: $description
\n"; } ?>