<?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: Geolocation and tracking path. Use Graphics Layer of Feature Layer? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geolocation-and-tracking-path-use-graphics-layer/m-p/17099#M1584</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been using geoLocation as well with mixed result.&amp;nbsp; You are right that a lot of points are getting processed.&amp;nbsp; You have likely hit the threshold of the # of points that can be handled through a standard request.&amp;nbsp; You should look under the Concepts tab &amp;gt; ArcGIS Server Services &amp;gt; Using the proxy page.&amp;nbsp; The #1 reason listed for using a proxy page is "the application creates requests that exceed 2048 characters".&amp;nbsp; I'm also noticing that different browsers have different limitations.&amp;nbsp; So something that debugs fine in Firefox might fail in IE.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2012 20:29:49 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2012-11-19T20:29:49Z</dc:date>
    <item>
      <title>Geolocation and tracking path. Use Graphics Layer of Feature Layer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geolocation-and-tracking-path-use-graphics-layer/m-p/17098#M1583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a javascript newbie. I am working on a mobile app that will use geolocating to map the user's path along a trail. Eventually I'd like it to return the distance they travelled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I'm on the right track but I'm having some issues. I got it to map the path, but when the button to end is clicked the app hangs and becomes unresponsive. This only happens if it is a long path and I would imagine it is because the polyline I'm creating is becoming too large. I am using a custom basemap in my application and have to project the points returned by the geolocator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I use a Feature layer rather than the graphics layer? Is there another solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
function startWatch(){
&amp;nbsp;&amp;nbsp; if (navigator.geolocation) { 
&amp;nbsp;&amp;nbsp; map.graphics.clear();
&amp;nbsp;&amp;nbsp; pnts = [];&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; watchID = navigator.geolocation.watchPosition(showLocation, locationError, {maximumAge:30000, timeout:30000}); 
&amp;nbsp; } 
 }
 
 function endWatch(){
&amp;nbsp;&amp;nbsp; navigator.geolocation.clearWatch(watchID);&amp;nbsp; 
 }
 
 function showLocation(location) { 
&amp;nbsp; if (location.coords.accuracy &amp;lt;= 100) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var geoService = new esri.tasks.GeometryService("http://myserver/ArcGIS/rest/services/Tools/Geometry/GeometryServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; //var pt = esri.geometry.geographicToWebMercator(new esri.geometry.Point(location.coords.longitude, location.coords.latitude)); 
&amp;nbsp;&amp;nbsp; var pt = new esri.geometry.Point(location.coords.longitude, location.coords.latitude, new esri.SpatialReference ({wkid:4236}));&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var outSR = new esri.SpatialReference({wkid: 3421}); 

&amp;nbsp;&amp;nbsp; geoService.project([pt], outSR, function(projectedPoints) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; pt = projectedPoints[0]; // current location
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnts.push(pt);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pnts.length === 1){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAndZoom(pt, 4);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline = new esri.geometry.Polyline(map.spatialReference); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; startGraphic = new esri.Graphic(pt, startSymbol); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(startGraphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pnts.length &amp;gt;= 2){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pnt1 = new esri.geometry.Point(pnts[pnts.length - 2], map.spatialReference); // last point
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (location.coords.speed &amp;gt; 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline.addPath([pnt1, pt]); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(new esri.Graphic(polyline, polylineSymbol));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (endGraphic) { //if an end symbol already exists remove it 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.remove(endGraphic); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endGraphic = new esri.Graphic(pt, endSymbol); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(endGraphic);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; } 
&amp;nbsp; else { 
&amp;nbsp;&amp;nbsp; console.log("Point not added due to low accuracy: " + location.coords.accuracy); 
&amp;nbsp; } 
 } &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 15:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geolocation-and-tracking-path-use-graphics-layer/m-p/17098#M1583</guid>
      <dc:creator>BrendanLee</dc:creator>
      <dc:date>2012-11-19T15:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Geolocation and tracking path. Use Graphics Layer of Feature Layer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geolocation-and-tracking-path-use-graphics-layer/m-p/17099#M1584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been using geoLocation as well with mixed result.&amp;nbsp; You are right that a lot of points are getting processed.&amp;nbsp; You have likely hit the threshold of the # of points that can be handled through a standard request.&amp;nbsp; You should look under the Concepts tab &amp;gt; ArcGIS Server Services &amp;gt; Using the proxy page.&amp;nbsp; The #1 reason listed for using a proxy page is "the application creates requests that exceed 2048 characters".&amp;nbsp; I'm also noticing that different browsers have different limitations.&amp;nbsp; So something that debugs fine in Firefox might fail in IE.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 20:29:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geolocation-and-tracking-path-use-graphics-layer/m-p/17099#M1584</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-11-19T20:29:49Z</dc:date>
    </item>
  </channel>
</rss>

