<?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: Is it possible to merge line features with the Javascript API? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83003#M7560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have your own API deployed on your server go to the file (&lt;A class="link-titled" href="https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js" title="https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js"&gt;https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js&lt;/A&gt;) and find:&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;function(a){return"esriGeometryPolygon"===a.geometryType&amp;amp;&amp;amp;a.visible&amp;amp;&amp;amp;a._isMapAtVisibleScale()}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;To fix the bug with merging the above must be replaced with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;function(a){return a.geometryType&amp;amp;&amp;amp;a.visible&amp;amp;&amp;amp;a._isMapAtVisibleScale()}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;For some reason Esri is checking if the geometry type is polygon before UNION function is used on the geometry server? WHY???&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Removed &lt;STRONG&gt;"esriGeometryPolygon"===a.geometryType&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Everything working as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Andrzej&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Dec 2016 17:21:30 GMT</pubDate>
    <dc:creator>AndrzejBieniek</dc:creator>
    <dc:date>2016-12-12T17:21:30Z</dc:date>
    <item>
      <title>Is it possible to merge line features with the Javascript API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83001#M7558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Has anyone been able to successfully merge two or more line geometries with the JAPI?&amp;nbsp; If so, is there sample code somewhere?&amp;nbsp; The editor widget in the api provides a union tool but that only works for polygons.&amp;nbsp; Interestingly, the doc for the editor widget calls this operation a merge and not a union, but it is just a union of polygons.&amp;nbsp; That's a bit confusing since there is a difference between a merge and union operation.&amp;nbsp; And according to the doc, the geometry service only allows for a union and not a merge like you can do in ArcMap.&amp;nbsp; I'm trying to create a web app that will allow my editors to merge line features.&amp;nbsp; The following older post asked a similar question but it was never answered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/47155-Editor-Widget-Union-Tool-and-Polyline-features?highlight=merge+polyline+javascript"&gt;http://forums.arcgis.com/threads/47155-Editor-Widget-Union-Tool-and-Polyline-features?highlight=merge+polyline+javascript&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate any insight as to how to do this with JAPI.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 18:41:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83001#M7558</guid>
      <dc:creator>SteveClarke</dc:creator>
      <dc:date>2014-05-05T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to merge line features with the Javascript API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83002#M7559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't explored using the editor widget but here is a code sample that should get you started:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function mergeLines(graphicsArray) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // merge geometries of polyline graphics into one geometry (graphics array could be map.graphics.graphics, featureLayer.graphics, etc.)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var polyline = new Polyline(map.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; graphics.length; i++){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var paths = graphics&lt;I&gt;.geometry.paths;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var j = 0; j &amp;lt; paths.length; j++){ //needed for multi part lines
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline.addPath(paths&lt;J&gt;);&lt;/J&gt;
&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; return polyline;
}
&amp;nbsp; 
var mergedGraphicGeometry = mergeLines();&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:11:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83002#M7559</guid>
      <dc:creator>BrandonFlessner</dc:creator>
      <dc:date>2021-12-10T23:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to merge line features with the Javascript API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83003#M7560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have your own API deployed on your server go to the file (&lt;A class="link-titled" href="https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js" title="https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js"&gt;https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js&lt;/A&gt;) and find:&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;function(a){return"esriGeometryPolygon"===a.geometryType&amp;amp;&amp;amp;a.visible&amp;amp;&amp;amp;a._isMapAtVisibleScale()}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;To fix the bug with merging the above must be replaced with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;function(a){return a.geometryType&amp;amp;&amp;amp;a.visible&amp;amp;&amp;amp;a._isMapAtVisibleScale()}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;For some reason Esri is checking if the geometry type is polygon before UNION function is used on the geometry server? WHY???&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Removed &lt;STRONG&gt;"esriGeometryPolygon"===a.geometryType&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Everything working as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Andrzej&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2016 17:21:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-merge-line-features-with-the/m-p/83003#M7560</guid>
      <dc:creator>AndrzejBieniek</dc:creator>
      <dc:date>2016-12-12T17:21:30Z</dc:date>
    </item>
  </channel>
</rss>

