<?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: Line Of Sight Widget produced lines partially in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1635871#M87404</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/922856"&gt;@JuanMarvinW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to replicate the problem with another dataset I had, but it is something we cannot quickly fix.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem occurs when&amp;nbsp;creating the line-of-sight with clicks on datasets with big extents, e.g. where lot of buildings are grouped into one feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Why?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It occurs because of a mechanism that makes the analysis more stable in case of changing LODs (e.g. when one zooms in and out in the scene). When the line-of-sight is created with clicks, the widget automatically saves a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="andale mono,times"&gt;feature&lt;/FONT&gt;&amp;nbsp;property to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#observer" target="_blank" rel="noopener nofollow noreferrer"&gt;observer&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and each&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#targets" target="_blank" rel="noopener nofollow noreferrer"&gt;target&lt;/A&gt;&amp;nbsp;classes.&amp;nbsp;This is an ID of the clicked building/feature to exclude it from the intersection tests. This mechanism of course assumes that each building is a separate feature - which is not the case in this data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Workaround&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;A workaround is to set the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="andale mono,times"&gt;feature = null&lt;/FONT&gt;.&amp;nbsp;&lt;SPAN&gt;Here's the app showing this:&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://codepen.io/gsoosalu/pen/GgpZvYB" target="_blank" rel="nofollow noopener noreferrer"&gt;https://codepen.io/gsoosalu/pen/GgpZvYB&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The app loads a line-of-sight layer with an analysis I had created with clicks, and connects the widget to it. You can see an incomplete visualization similar to your report. If you click the two buttons at the bottom left, the visualization becomes complete. Those buttons set the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;feature = null&lt;/FONT&gt;. But if you now create a new line-of-sight with the widget, the problem will show up again. This is because, whenever creating new observer/targets, automatically the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;feature&lt;/FONT&gt;&amp;nbsp;property gets set again. So your app should watch the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#observer" target="_blank" rel="noopener nofollow noreferrer"&gt;observer&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#targets" target="_blank" rel="noopener nofollow noreferrer"&gt;targets&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;array for changes and make sure the&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="andale mono,times"&gt;feature&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;gets cleared.&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Grete&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;PS: here's a simpler app that doesn't use the already existing line-of-sight layer/analysis. This shows that the same workaround also functions for cases where the line-of-sight is created only with the widget:&lt;BR /&gt;&lt;A href="https://codepen.io/gsoosalu/pen/vENKJNy" target="_blank"&gt;https://codepen.io/gsoosalu/pen/vENKJNy&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jul 2025 10:37:04 GMT</pubDate>
    <dc:creator>GreteSoosalu</dc:creator>
    <dc:date>2025-07-24T10:37:04Z</dc:date>
    <item>
      <title>Line Of Sight Widget produced lines partially</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634110#M87386</link>
      <description>&lt;P&gt;Hello All, I need help on solving problem regarding Line Of Sight Widget's lines. I was using ArcGIS Javascript 4.33. And I was using the Line Of Sight widget on my code, like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;lineOfSight&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;LineOfSight&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;container&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"losWidget"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;which originally I followed from this sample:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-line-of-sight/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-line-of-sight/&lt;/A&gt;, and modified it by using my own WebScene layers.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, the lines that comes from the LOS widget seems weird. They are not completely hidden, nor completely showed. This is what happen when I created the observer and the target from clicking the points on the map:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lineOfSight_javascriptwidget.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/136751i1715BDA8E6395E44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lineOfSight_javascriptwidget.png" alt="lineOfSight_javascriptwidget.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, I also tried to use the same WebScene (all the layers are the same), and created and used the LOS widget by using WebExperience. The result is different. LOS Widget from the Experience Builder created the lines properly after creating the observer point and target point on the map. These lines below were created from Experience Builder's LOS widget.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lineOfSight_experiencebuilder.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/136752i20AA2D0B50886369/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lineOfSight_experiencebuilder.png" alt="lineOfSight_experiencebuilder.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Does anyone know why the results are different between LOS Widget from Javascript and LOS Widget from Experience Builder? Does anyone know any reference I can read/follow to produce the proper LOS lines using Javscript API like the one from Experience Builder's LOS Widget?&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 Jul 2025 03:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634110#M87386</guid>
      <dc:creator>JuanMarvinW</dc:creator>
      <dc:date>2025-07-18T03:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Line Of Sight Widget produced lines partially</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634164#M87387</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/922856"&gt;@JuanMarvinW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reaching out! Could you maybe share the apps or the layer with me (either here or via direct message) so that we can look more into this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a chance that all these buildings are one feature? Also, what I didn't 100% understand - did you create the lines of sight in the EB also by clicking in the scene/map?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2025 11:18:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634164#M87387</guid>
      <dc:creator>GreteSoosalu</dc:creator>
      <dc:date>2025-07-18T11:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Line Of Sight Widget produced lines partially</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634495#M87392</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/503459"&gt;@GreteSoosalu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your reply. As you expected, all of these buildings are one feature, with Scene Layer Type = 3DObject. When I select one building, all buildings are selected.&lt;/P&gt;&lt;P&gt;Also, when I created the lines of sight in the EB, I also did the same thing as the Javascript &amp;amp;colon;&lt;BR /&gt;- Created the observer point by clicking the side of a building&lt;BR /&gt;- Created target points by clicking the scene/map at locations behind a building.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 08:41:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634495#M87392</guid>
      <dc:creator>JuanMarvinW</dc:creator>
      <dc:date>2025-07-21T08:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Line Of Sight Widget produced lines partially</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634498#M87393</link>
      <description>&lt;P&gt;Hi again,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the additional infos! We'll investigate this further - there are some limitation for 3DObject features with big extents but I wonder why you get different results in JS-app vs Experience Builder.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 09:25:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1634498#M87393</guid>
      <dc:creator>GreteSoosalu</dc:creator>
      <dc:date>2025-07-21T09:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Line Of Sight Widget produced lines partially</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1635871#M87404</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/922856"&gt;@JuanMarvinW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to replicate the problem with another dataset I had, but it is something we cannot quickly fix.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem occurs when&amp;nbsp;creating the line-of-sight with clicks on datasets with big extents, e.g. where lot of buildings are grouped into one feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Why?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It occurs because of a mechanism that makes the analysis more stable in case of changing LODs (e.g. when one zooms in and out in the scene). When the line-of-sight is created with clicks, the widget automatically saves a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="andale mono,times"&gt;feature&lt;/FONT&gt;&amp;nbsp;property to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#observer" target="_blank" rel="noopener nofollow noreferrer"&gt;observer&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and each&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#targets" target="_blank" rel="noopener nofollow noreferrer"&gt;target&lt;/A&gt;&amp;nbsp;classes.&amp;nbsp;This is an ID of the clicked building/feature to exclude it from the intersection tests. This mechanism of course assumes that each building is a separate feature - which is not the case in this data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Workaround&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;A workaround is to set the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="andale mono,times"&gt;feature = null&lt;/FONT&gt;.&amp;nbsp;&lt;SPAN&gt;Here's the app showing this:&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://codepen.io/gsoosalu/pen/GgpZvYB" target="_blank" rel="nofollow noopener noreferrer"&gt;https://codepen.io/gsoosalu/pen/GgpZvYB&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The app loads a line-of-sight layer with an analysis I had created with clicks, and connects the widget to it. You can see an incomplete visualization similar to your report. If you click the two buttons at the bottom left, the visualization becomes complete. Those buttons set the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;feature = null&lt;/FONT&gt;. But if you now create a new line-of-sight with the widget, the problem will show up again. This is because, whenever creating new observer/targets, automatically the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;feature&lt;/FONT&gt;&amp;nbsp;property gets set again. So your app should watch the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#observer" target="_blank" rel="noopener nofollow noreferrer"&gt;observer&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html#targets" target="_blank" rel="noopener nofollow noreferrer"&gt;targets&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;array for changes and make sure the&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="andale mono,times"&gt;feature&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;gets cleared.&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Grete&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;PS: here's a simpler app that doesn't use the already existing line-of-sight layer/analysis. This shows that the same workaround also functions for cases where the line-of-sight is created only with the widget:&lt;BR /&gt;&lt;A href="https://codepen.io/gsoosalu/pen/vENKJNy" target="_blank"&gt;https://codepen.io/gsoosalu/pen/vENKJNy&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 10:37:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1635871#M87404</guid>
      <dc:creator>GreteSoosalu</dc:creator>
      <dc:date>2025-07-24T10:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Line Of Sight Widget produced lines partially</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1637235#M87429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/503459"&gt;@GreteSoosalu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This is a great and working workaround. I can use your solution for now. Thank you so much for your help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For others, please note that the observer and target classes exist in both: viewModel AND viewModel.analysis. Use the classes in&amp;nbsp;viewModel.analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marvin&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 09:11:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/line-of-sight-widget-produced-lines-partially/m-p/1637235#M87429</guid>
      <dc:creator>JuanMarvinW</dc:creator>
      <dc:date>2025-07-29T09:11:22Z</dc:date>
    </item>
  </channel>
</rss>

