<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:#606420;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.keyword
        {color:green;}
span.comment
        {color:maroon;}
span.stringliteral
        {color:#002080;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 77.95pt 72.0pt 77.95pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-CA link=blue vlink="#606420">
<div class=Section1>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Hello Everyone:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>I am reading the coordinate values from the selected features and
creating an inset map for each. The features are in LL83 and I need to specify
the map coordinates in UTM83-17 with the scale to produce the maps via URL.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Existing code - works if map is in LL83<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$agfReaderWriter
= new MgAgfReaderWriter();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$MikeSelected_feat_geom_data
= $agfReaderWriter->Read($mike_GeometryData);<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$firstTime =
true;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>
$extentGeometry = $agfReaderWriter->Read($mike_GeometryData);<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>
$iterator = $extentGeometry->GetCoordinates();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>
while($iterator->MoveNext())<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> {<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $x
= $iterator->GetCurrent()->GetX();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> <o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $y
= $iterator->GetCurrent()->GetY();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> <o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> if($firstTime)<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> {<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $maxX
= $x;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $minX
= $x;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $maxY
= $y;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $minY
= $y;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $firstTime
= false;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> }<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> if($maxX>$x)<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $maxX
= $x;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> if($minX<$x||$minX==0)<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $minX
= $x;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> if($maxY<$y)<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $maxY
= $y;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> if($minY>$y||$minY==0)<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> $minY
= $y;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> }<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mike_x =
($minX + (($minX - $maxX)* -1)/2);<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mike_y =
($maxY + $minY)/2;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> //Echo
$x;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>// Echo
"<br>" . $y; <o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$masterscale
= $map->GetViewScale();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mscale =
"15000";<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>if ($shpArea
< 3)<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mscale =
"5000";<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mapdef =
$map->GetMapDefinition();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mapdef_name
= $mapdef->GetName();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mapdef_path
= $mapdef->GetPath();<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> echo
"<Hr><Hr>";<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> echo
"Scale: " . $mscale;<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> echo
"<br>";<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>//----------------------------------switch
coordinates<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:36.0pt'><font size=2 face="Courier New"><span
style='font-size:10.0pt'>//HERE is where I need the code to switch $mike_x and
$mike_y to UTM83-17 coordinates!<o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>//--------------------------------------
SWITCH Coords END<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>$mapdef_path_enc
= urlencode("Library://" . $mapdef_path . "/" .
$mapdef_name . ".MapDefinition");<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'> echo
"<br>";<o:p></o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoPlainText style='margin-left:144.0pt'><b><font size=2
face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>echo
"<img align='center' border='1'
bordercolor='FFCC33'src='http://142.142.41.157:8008/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&VERSION=1.0.0&MAPNAME=$mapName&LOCALE=en&MAPDEFINITION=$mapdef_path_enc&FORMAT=PNG&SETVIEWCENTERX=$mike_x&SETVIEWCENTERY=$mike_y&SETVIEWSCALE=$mscale&SETDISPLAYDPI=140&SETDISPLAYWIDTH=650&SETDISPLAYHEIGHT=500&HIDELAYERS=$high_layer&USERNAME=Administrator&PASSWORD=admin'>";<o:p></o:p></span></font></b></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>I have tried a few of the examples including:<o:p></o:p></span></font></p>
<div style='mso-element:para-border-div;border:solid #CCCCCC 1.0pt;padding:
3.0pt 5.0pt 3.0pt 5.0pt;background:whitesmoke;margin-left:1.5pt;margin-right:
6.0pt'><pre style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:
3.0pt;margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font
size=1 color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $xGeog = -71.061342;<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $yGeog = 42.355892;<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $geometryFactory = </span></font><span
class=keyword><font size=1 color=green><span style='font-size:7.0pt'>new</span></font></span><font
size=1 color=black><span style='font-size:7.0pt;color:black'> <a
href="http://mapguide.osgeo.org/files/mapguide/docs/webapi/d4/d46/class_mg_geometry_factory.htm"><span
style='text-decoration:none'>MgGeometryFactory</span></a>();<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $coordinate = $geometryFactory->CreateCoordinateXY($xGeog, $yGeog);<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> </span></font><span
class=comment><font size=1 color=maroon><span style='font-size:7.0pt'>// See the example code for the creation of the $coordSys object</span></font></span><font
size=1 color=black><span style='font-size:7.0pt;color:black'><o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> </span></font><span
class=comment><font size=1 color=maroon><span style='font-size:7.0pt'>// in the comments on the Create method of the MgCoordinateSystemFactory class.</span></font></span><font
size=1 color=black><span style='font-size:7.0pt;color:black'><o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $convertedCoordinate = $coordSys->ConvertFromLonLat($coordinate);<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $xConv = $convertedCoordinate->GetX();<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> $yConv = $convertedCoordinate->GetY();<o:p></o:p></span></font></pre><pre
style='mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;
margin-left:0cm;background:whitesmoke;border:none;padding:0cm'><font size=1
color=black face="Courier New"><span style='font-size:7.0pt;color:black'> echo </span></font><span
class=stringliteral><font size=1 color="#002080"><span style='font-size:7.0pt'>"($xGeog, $yGeog) to ($xConv, $yConv)\n"</span></font></span><font
size=1 color=black><span style='font-size:7.0pt;color:black'>;<o:p></o:p></span></font></pre></div>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>With supporting coordinate systems – not working for me – <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Any help would be appreciated.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Mike<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>