<?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 RouteResult toJSON() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361831#M33485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We need to convert RouteResult to JSON. When we try&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;RouteResult.toJSON() we get a {} result. We are using JavaScript 4.11. toJSON() does work on the properties (directions, etc.) of RouteResult.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px;"&gt;&lt;PRE&gt;&lt;SPAN&gt;// Example of issue.&lt;/SPAN&gt;&lt;SPAN&gt;routeTask.solve(routeParams).then(function (data) {&lt;/SPAN&gt;&lt;SPAN&gt;const routeResult = data.routeResults[0];&lt;/SPAN&gt;&lt;SPAN&gt;const routeResultJson = routeResult.toJSON();&lt;/SPAN&gt;&lt;SPAN&gt;console.log(routeResultJson) /* Result is {} */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank, Jay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Apr 2019 17:13:26 GMT</pubDate>
    <dc:creator>JayAgnew</dc:creator>
    <dc:date>2019-04-25T17:13:26Z</dc:date>
    <item>
      <title>RouteResult toJSON()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361831#M33485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We need to convert RouteResult to JSON. When we try&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;RouteResult.toJSON() we get a {} result. We are using JavaScript 4.11. toJSON() does work on the properties (directions, etc.) of RouteResult.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px;"&gt;&lt;PRE&gt;&lt;SPAN&gt;// Example of issue.&lt;/SPAN&gt;&lt;SPAN&gt;routeTask.solve(routeParams).then(function (data) {&lt;/SPAN&gt;&lt;SPAN&gt;const routeResult = data.routeResults[0];&lt;/SPAN&gt;&lt;SPAN&gt;const routeResultJson = routeResult.toJSON();&lt;/SPAN&gt;&lt;SPAN&gt;console.log(routeResultJson) /* Result is {} */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank, Jay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361831#M33485</guid>
      <dc:creator>JayAgnew</dc:creator>
      <dc:date>2019-04-25T17:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: RouteResult toJSON()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361832#M33486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you checked the below community link:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/225679-routeresulttojson-returns-empty-object-in-arcgis-49"&gt;https://community.esri.com/thread/225679-routeresulttojson-returns-empty-object-in-arcgis-49&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Biraja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2019 00:46:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361832#M33486</guid>
      <dc:creator>BirajaNayak</dc:creator>
      <dc:date>2019-04-26T00:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: RouteResult toJSON()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361833#M33487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;Hi Biraja,&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;Thanks for the quick response! We did see this community link and unfortunately, it does not address our question.&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;The solution it provides actually does not address using toJSON on a RouteResult. It addresses turning the route property of a RouteResult to JSON. The solution is also using.JSON.stringify (not toJSON()).&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;We are trying to convert the RouteResult using the toJSON() method. We did try JSON.stringify and it returned "{}" as well.&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;We need to know if we are doing something wrong or the &lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;RouteResult &lt;/SPAN&gt;object itself cannot be converted to JSON, only the properties. &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#toJSON" style="color: #2989c5; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#toJSON&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks, Jay.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2019 12:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361833#M33487</guid>
      <dc:creator>JayAgnew</dc:creator>
      <dc:date>2019-04-26T12:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: RouteResult toJSON()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361834#M33488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue will be fixed at version 4.12 which will be released end of June, 2019.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2019 21:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/routeresult-tojson/m-p/361834#M33488</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2019-06-04T21:54:58Z</dc:date>
    </item>
  </channel>
</rss>

