<?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: Combining Multiple Graphics in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397018#M36582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you've got access to a geometryServer I would suggest using &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#union" rel="nofollow" target="_blank"&gt;GeometryService.union&lt;/A&gt;&lt;SPAN&gt; to combine the geometries of your routes together.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jssamples/util_reshape.html" rel="nofollow" target="_blank"&gt;Here is an example&lt;/A&gt;&lt;SPAN&gt; using the geometry service but it is performing a reshape. I think the main thing you would have to change is to get it to do a union instead that is passed an array of your graphics geometries.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jan 2014 17:42:39 GMT</pubDate>
    <dc:creator>JamieSimko</dc:creator>
    <dc:date>2014-01-31T17:42:39Z</dc:date>
    <item>
      <title>Combining Multiple Graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397015#M36579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an array of individual route graphics that I would like to be combined into one graphics layer.&amp;nbsp; I am looking for the best way to do this.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now I add the routes to the map using map.graphics.add(solveResult.routeResults[0].route.setSymbol(routeSymbol));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be the best method of combining these routes into one polyline graphics layer?&amp;nbsp; Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 02:06:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397015#M36579</guid>
      <dc:creator>WesleyAskew</dc:creator>
      <dc:date>2014-01-30T02:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Multiple Graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397016#M36580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have an array of individual route graphics that I would like to be combined into one graphics layer.&amp;nbsp; I am looking for the best way to do this.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Right now I add the routes to the map using map.graphics.add(solveResult.routeResults[0].route.setSymbol(routeSymbol));&lt;BR /&gt;&lt;BR /&gt;What would be the best method of combining these routes into one polyline graphics layer?&amp;nbsp; Thanks in advance.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not tested but this should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require([
&amp;nbsp; "dojo/_base/array",
&amp;nbsp; "esri/map",
&amp;nbsp; "esri/layers/GraphicsLayer"
], function(array, Map, GraphicsLayer){

&amp;nbsp; var map = new Map("mapDiv");
&amp;nbsp; var graphics = new GraphicsLayer();
&amp;nbsp; map.addLayer("graphics");

&amp;nbsp; //Create your array here

&amp;nbsp; array.forEach(solveResult.routeResults, function(routeResult){
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics.add(routeResult.route.setSymbol(routeSymbol));
&amp;nbsp; });

});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:09:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397016#M36580</guid>
      <dc:creator>JohnathanBarclay</dc:creator>
      <dc:date>2021-12-11T18:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Multiple Graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397017#M36581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Not tested but this should work:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require([
&amp;nbsp; "dojo/_base/array",
&amp;nbsp; "esri/map",
&amp;nbsp; "esri/layers/GraphicsLayer"
], function(array, Map, GraphicsLayer){

&amp;nbsp; var map = new Map("mapDiv");
&amp;nbsp; var graphics = new GraphicsLayer();
&amp;nbsp; map.addLayer("graphics");

&amp;nbsp; //Create your array here

&amp;nbsp; array.forEach(solveResult.routeResults, function(routeResult){
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics.add(routeResult.route.setSymbol(routeSymbol));
&amp;nbsp; });

});&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your response.&amp;nbsp; However, this does not seem to work as I had hoped.&amp;nbsp; I guess the best way for me to describe what i need is something similar to a merge in ArcMap.&amp;nbsp; I am not concerned with the attributes, I just need for each route that is calculated by the routeTask to be combined into one in order to perform tasks like zooming to extent, symbolizing, etc.&amp;nbsp; Am I missing something with this method or is there another way of going about this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:09:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397017#M36581</guid>
      <dc:creator>WesleyAskew</dc:creator>
      <dc:date>2021-12-11T18:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Multiple Graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397018#M36582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you've got access to a geometryServer I would suggest using &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#union" rel="nofollow" target="_blank"&gt;GeometryService.union&lt;/A&gt;&lt;SPAN&gt; to combine the geometries of your routes together.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jssamples/util_reshape.html" rel="nofollow" target="_blank"&gt;Here is an example&lt;/A&gt;&lt;SPAN&gt; using the geometry service but it is performing a reshape. I think the main thing you would have to change is to get it to do a union instead that is passed an array of your graphics geometries.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 17:42:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397018#M36582</guid>
      <dc:creator>JamieSimko</dc:creator>
      <dc:date>2014-01-31T17:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Multiple Graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397019#M36583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you've got access to a geometryServer I would suggest using &lt;A href="https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#union"&gt;GeometryService.union&lt;/A&gt; to combine the geometries of your routes together.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/util_reshape.html"&gt;Here is an example&lt;/A&gt; using the geometry service but it is performing a reshape. I think the main thing you would have to change is to get it to do a union instead that is passed an array of your graphics geometries.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is exactly what I have been looking for.&amp;nbsp; For some reason I didn't think to look in the geometry server api.&amp;nbsp; Thanks for the response.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 18:13:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/combining-multiple-graphics/m-p/397019#M36583</guid>
      <dc:creator>WesleyAskew</dc:creator>
      <dc:date>2014-01-31T18:13:35Z</dc:date>
    </item>
  </channel>
</rss>

