<?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>idea Keep feature layer labels visible while zooming map in Developers Ideas</title>
    <link>https://community.esri.com/t5/developers-ideas/keep-feature-layer-labels-visible-while-zooming/idi-p/938581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;In ArcGIS API for Javascript version 4.x, when feature layer has defined labeling info and when map is zoomed in or out, labels disappear during zoom animation. They appear again once the animation is complete. Video showing this issue: &lt;A href="https://streamable.com/ceor3"&gt;https://streamable.com/ceor3&lt;/A&gt;. In this video after application loads, I zoom map using mouse scrollwheel and it is visible how labels disappear and reappear after some time. Here is a sample app to check this issue: &lt;A class="link-titled" href="https://jsbin.com/zibokemeze/edit?html,output" title="https://jsbin.com/zibokemeze/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Expected behavior in this situation is to keep labels visible during zoom animation and only hide those labels, which start colliding with other labels after zoom.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Notes after looking more into this issue: it seems like the cause of this issue is in esri/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel class drawGeometry function. In that function there is a check to only render labels once required zoom level to display labels is strictly equal to the current level of data tile being rendered.&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Code line looks like this:&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;if (e.requiredLevel === t.key.level || p) {&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;But when zooming map, those zoom level are not always equal during animation and that is when labels are not visible.&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Here is another sample app, which includes workaround to this issue:&amp;nbsp;&lt;A class="link-titled" href="https://jsbin.com/zetusehosi/edit?html,output" title="https://jsbin.com/zetusehosi/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;. This app is the same as the first one, except there is added monkey-patched&amp;nbsp;WGLGeometryBrushLabel.default.prototype.drawGeometry function, making those two zoom levels always equal. This change fixes described issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;I have already reported this issue in my.esri.com support (case number 02412498), but bug or enhancement was refused to be logged, because this behavior "is as per design of JS API 4.x version", so I was directed to the ArcGIS ideas&amp;nbsp;to report this issue here.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Oct 2019 10:12:41 GMT</pubDate>
    <dc:creator>DziugasPocius</dc:creator>
    <dc:date>2019-10-11T10:12:41Z</dc:date>
    <item>
      <title>Keep feature layer labels visible while zooming map</title>
      <link>https://community.esri.com/t5/developers-ideas/keep-feature-layer-labels-visible-while-zooming/idi-p/938581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;In ArcGIS API for Javascript version 4.x, when feature layer has defined labeling info and when map is zoomed in or out, labels disappear during zoom animation. They appear again once the animation is complete. Video showing this issue: &lt;A href="https://streamable.com/ceor3"&gt;https://streamable.com/ceor3&lt;/A&gt;. In this video after application loads, I zoom map using mouse scrollwheel and it is visible how labels disappear and reappear after some time. Here is a sample app to check this issue: &lt;A class="link-titled" href="https://jsbin.com/zibokemeze/edit?html,output" title="https://jsbin.com/zibokemeze/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Expected behavior in this situation is to keep labels visible during zoom animation and only hide those labels, which start colliding with other labels after zoom.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Notes after looking more into this issue: it seems like the cause of this issue is in esri/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel class drawGeometry function. In that function there is a check to only render labels once required zoom level to display labels is strictly equal to the current level of data tile being rendered.&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Code line looks like this:&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;if (e.requiredLevel === t.key.level || p) {&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;But when zooming map, those zoom level are not always equal during animation and that is when labels are not visible.&lt;/SPAN&gt;&lt;BR style="color: #4c4c4c; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Here is another sample app, which includes workaround to this issue:&amp;nbsp;&lt;A class="link-titled" href="https://jsbin.com/zetusehosi/edit?html,output" title="https://jsbin.com/zetusehosi/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;. This app is the same as the first one, except there is added monkey-patched&amp;nbsp;WGLGeometryBrushLabel.default.prototype.drawGeometry function, making those two zoom levels always equal. This change fixes described issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;I have already reported this issue in my.esri.com support (case number 02412498), but bug or enhancement was refused to be logged, because this behavior "is as per design of JS API 4.x version", so I was directed to the ArcGIS ideas&amp;nbsp;to report this issue here.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2019 10:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-ideas/keep-feature-layer-labels-visible-while-zooming/idi-p/938581</guid>
      <dc:creator>DziugasPocius</dc:creator>
      <dc:date>2019-10-11T10:12:41Z</dc:date>
    </item>
  </channel>
</rss>

