<?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 Polyline with large SimpleLineSymbol looks blocky in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303693#M81556</link>
    <description>&lt;P&gt;Hello everyone, I'm looking to have a polyline with a large graphic over another polyline following the same path, like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CalvinLe360_2-1687912352815.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74325iFAE0FB6ED72578A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CalvinLe360_2-1687912352815.png" alt="CalvinLe360_2-1687912352815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, when the SimpleLineSymbol's width gets too large, it seems to get cropped with blocky chunks, like so:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CalvinLe360_0-1687912177949.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74323i64E4F177FA05E76E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CalvinLe360_0-1687912177949.png" alt="CalvinLe360_0-1687912177949.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to not have this grey polyline get cropped like this?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2023 00:36:06 GMT</pubDate>
    <dc:creator>CalvinLe360</dc:creator>
    <dc:date>2023-06-28T00:36:06Z</dc:date>
    <item>
      <title>Polyline with large SimpleLineSymbol looks blocky</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303693#M81556</link>
      <description>&lt;P&gt;Hello everyone, I'm looking to have a polyline with a large graphic over another polyline following the same path, like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CalvinLe360_2-1687912352815.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74325iFAE0FB6ED72578A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CalvinLe360_2-1687912352815.png" alt="CalvinLe360_2-1687912352815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, when the SimpleLineSymbol's width gets too large, it seems to get cropped with blocky chunks, like so:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CalvinLe360_0-1687912177949.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74323i64E4F177FA05E76E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CalvinLe360_0-1687912177949.png" alt="CalvinLe360_0-1687912177949.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to not have this grey polyline get cropped like this?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 00:36:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303693#M81556</guid>
      <dc:creator>CalvinLe360</dc:creator>
      <dc:date>2023-06-28T00:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline with large SimpleLineSymbol looks blocky</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303707#M81557</link>
      <description>&lt;P&gt;can you post the code so we can better assist?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 01:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303707#M81557</guid>
      <dc:creator>RichardMoussopo</dc:creator>
      <dc:date>2023-06-28T01:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline with large SimpleLineSymbol looks blocky</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303720#M81558</link>
      <description>&lt;P&gt;Sure, apologies for the vaguely-named variables.&lt;/P&gt;&lt;P&gt;This is split in two parts where the first part builds the grey polyline (the small blue one is drawn in a separate function, I'll deal with it some other time) and the second part updates the radius of the polyline upon mapview scale change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const drawLayer = useCallback(
        (id: Id, data: Data[]) =&amp;gt; {
            if (!mapRef.current) return;

            const positions = data.map(({position}) =&amp;gt; [
                radiansToDegrees(position.longitude),
                radiansToDegrees(position.latitude),
            ]);

            let layer = layerRecord.current[id]?.layer;

            if (!layer) {
                layer = new GraphicsLayer();

                if (!layerRecord.current[id]) {
                    layerRecord.current[id] = {};
                }

                layerRecord.current[id].layer = layer;

                mapRef.current.add(layer);
            }

            const existingPolylineGraphic = layer.graphics.find(
                graphic =&amp;gt; graphic.geometry.type === 'polyline'
            );

            if (existingPolylineGraphic) {
                const existingPolyline =
                    existingPolylineGraphic.geometry as Polyline;

                existingPolylineGraphic.geometry = new Polyline({
                    paths: [
                        [
                            ...(existingPolyline?.paths?.flat() || []),
                            ...positions,
                        ],
                    ],
                });

                layer.remove(existingPolylineGraphic);
                layer.add(existingPolylineGraphic);
            } else {
                const polyline = new Polyline({
                    paths: [positions],
                });
                const simpleLineSymbol = new SimpleLineSymbol({
                    color: [100, 100, 100, 0.5],
                    width: 0,
                });

                const polylineGraphic = new Graphic({
                    geometry: polyline,
                    symbol: simpleLineSymbol,
                });

                layer.add(polylineGraphic);
            }
        },
        []
    );&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;    const radius = 20000;
    const updateLayer = (scale: number) =&amp;gt; {
        if (!layerRecord.current) return;

        for (const layerString in layerRecord.current) {
            const layer = layerRecord.current[layerString].layer;
            if (!layer) continue;

            const existingPolylineGraphic = layer.graphics.find(
                graphic =&amp;gt; graphic.geometry.type === 'polyline'
            );

            if (existingPolylineGraphic) {
                const multiplier = radius / scale;
                existingPolylineGraphic.symbol = new SimpleLineSymbol({
                    color: [100, 100, 100, 0.5],
                    width: (radius * multiplier).toString() + 'px',
                });

                layer.remove(existingPolylineGraphic);
                layer.add(existingPolylineGraphic);
            }
        }
    };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Again, sorry for the vaguely-named variables, I'm open to clarify within reason.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 04:23:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303720#M81558</guid>
      <dc:creator>CalvinLe360</dc:creator>
      <dc:date>2023-06-28T04:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline with large SimpleLineSymbol looks blocky</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303737#M81559</link>
      <description>&lt;P&gt;Depending on what you are trying to achieve, you probably won't need the second part of the code to change the width on scale change if you just clone the first graphic and style the cloned graphic as you wish&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// clone existing graphic to create a copy
const clonedGraphic = existingPolylineGraphic.clone();
clonedGraphic.symbol = {
   type: 'simple-line',
   color: [255, 0, 0, 0.4],
   width: 45, // you can make this a variable as well if needed
};
layer.add(clonedGraphic);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 Jun 2023 04:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1303737#M81559</guid>
      <dc:creator>RichardMoussopo</dc:creator>
      <dc:date>2023-06-28T04:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline with large SimpleLineSymbol looks blocky</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1304265#M81578</link>
      <description>&lt;P&gt;I appreciate the improvement but I have chosen to instead use circle graphics since I was unable to find a way to not make these lines blocky.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 23:37:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/polyline-with-large-simplelinesymbol-looks-blocky/m-p/1304265#M81578</guid>
      <dc:creator>CalvinLe360</dc:creator>
      <dc:date>2023-06-28T23:37:49Z</dc:date>
    </item>
  </channel>
</rss>

