<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reproject a Geolocation event in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403664#M9425</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;any thoughts? I added an info click onto the map so i can see where the point is being reprojected to and it has some funky coordinates. Does not make sense, the point is being reprojected just now to where it is supposed to be&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jun 2011 18:10:32 GMT</pubDate>
    <dc:creator>AaronNash</dc:creator>
    <dc:date>2011-06-13T18:10:32Z</dc:date>
    <item>
      <title>Reproject a Geolocation event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403662#M9423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can take a geolocation event and add a graphic to the map and recenter the map on the graphic. I would like to reproject the graphic to a state plane coordinate system and have reviewed samples and past threads and cannot seem to get it to work. I have an if else statement so i can just change the map services to see if the point is reprojecting, it works great on a WGS 84 projection. When i change the map service to a state plane it puts the graphic at some crazy coordiantes. Not sure what i am going wrong, any help would be appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; private function onTravel(event:GeolocationEvent):void 
&amp;nbsp; { 
&amp;nbsp;&amp;nbsp; if (GPSCheck.selected==true)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var long:String = event.longitude.toString();
&amp;nbsp;&amp;nbsp;&amp;nbsp; var lat:String = event.latitude.toString();
&amp;nbsp;&amp;nbsp;&amp;nbsp; var longnew:Number = Number(long);
&amp;nbsp;&amp;nbsp;&amp;nbsp; var latnew:Number = Number(lat);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (map.spatialReference.wkid == 4326)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var centerPoint:MapPoint = new MapPoint(longnew, latnew);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic:Graphic = new Graphic(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.geometry = centerPoint; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myGraphicsLayer.clear(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myGraphicsLayer.add(graphic); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var centerPoint1:MapPoint = new MapPoint(longnew, latnew);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var outSR:SpatialReference = new SpatialReference(2234);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.project([centerPoint1 as Geometry], outSR);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ptGraphic:Graphic = new Graphic(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mapPoint2:MapPoint = centerPoint1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPoint2.spatialReference = map.spatialReference; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptGraphic.geometry = mapPoint2; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myGraphicsLayer.clear()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myGraphicsLayer.add(ptGraphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptGraphic.addEventListener(GeometryServiceEvent.PROJECT_COMPLETE, projectCompleteHandler);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
}
&amp;nbsp;&amp;nbsp; else 
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; geolocation.removeEventListener(GeolocationEvent.UPDATE, onTravel);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; private function projectCompleteHandler(event:GeometryServiceEvent):void
&amp;nbsp; {&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; // Note: As of version 2.0, GeometryService returns geometries (instead of graphics)
&amp;nbsp;&amp;nbsp; var pt:MapPoint = (event.result as Array)[0]as MapPoint;
&amp;nbsp; } &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 13:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403662#M9423</guid>
      <dc:creator>AaronNash</dc:creator>
      <dc:date>2011-06-07T13:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reproject a Geolocation event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403663#M9424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;BTW this application is running in adobe air on an android phone&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 17:54:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403663#M9424</guid>
      <dc:creator>AaronNash</dc:creator>
      <dc:date>2011-06-07T17:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reproject a Geolocation event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403664#M9425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;any thoughts? I added an info click onto the map so i can see where the point is being reprojected to and it has some funky coordinates. Does not make sense, the point is being reprojected just now to where it is supposed to be&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 18:10:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/reproject-a-geolocation-event/m-p/403664#M9425</guid>
      <dc:creator>AaronNash</dc:creator>
      <dc:date>2011-06-13T18:10:32Z</dc:date>
    </item>
  </channel>
</rss>

