<?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 Dereference texture error logged when text symbol is removed from graphics layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1485685#M84806</link>
    <description>&lt;P&gt;I have a 3d SceneView with a graphics layer and a point graphic with icon and text symbol layers. When the graphic is removed from the graphics layer, the console logs this error message:&lt;BR /&gt;"4.29/:132 [esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl] Cannot dereference texture that has no references!"&lt;BR /&gt;&lt;BR /&gt;The error only seems to happen when the&amp;nbsp;&lt;SPAN&gt;TextSymbol3DLayer() is included in the symbol layers. If it is commented out, there is no error message.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;How can I avoid or suppress this error message?&lt;BR /&gt;&lt;BR /&gt;I created the html page below which replicates the error when the "add/remove" button is clicked.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stackblitz.com/edit/stackblitz-starters-adfukf?file=index.html" target="_self"&gt;https://stackblitz.com/edit/stackblitz-starters-adfukf?file=index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    /&amp;gt;
    &amp;lt;title&amp;gt;
      Add Graphics to a SceneView | Sample | ArcGIS Maps SDK for JavaScript 4.29
    &amp;lt;/title&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.29/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.29/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 80%;
        width: 100%;
      }
    &amp;lt;/style&amp;gt;

    &amp;lt;script async defer&amp;gt;
      require([
        "esri/Map",
        "esri/views/SceneView",
        "esri/layers/GraphicsLayer",
        "esri/Graphic",
      ], (Map, SceneView, GraphicsLayer, Graphic) =&amp;gt; {
        const map = new Map({
          basemap: "hybrid",
        });

        const view = new SceneView({
          container: "viewDiv",
          map: map,

          camera: {
            // autocasts as new Camera()
            position: {
              // autocasts as new Point()
              x: -0.178,
              y: 51.48791,
              z: 1266.7049653716385,
            },
          },
        });

        /*********************
         * Add graphics layer
         *********************/

        const graphicsLayer = new GraphicsLayer();
        map.add(graphicsLayer);

        /*************************
         * Add a 3D point graphic
         *************************/
        function addGraphic() {
          // London
          const point = {
            type: "point", // autocasts as new Point()
            x: -0.178,
            y: 51.48791,
          };

          const markerSymbol = {
            type: "point-3d",
            symbolLayers: [
              {
                type: "icon", // autocasts as new IconSymbol3DLayer()
                size: 8, // points
                resource: { primitive: "circle" },
                material: { color: "red" },
              },
              {
                type: "text", // autocasts as new TextSymbol3DLayer()
                text: `\n\n 100 m`,
                size: 10, // points
                material: { color: "red" },
                halo: {
                  color: "white",
                  size: 1,
                },
                horizontalAlignment: "center",
                verticalAlignment: "top",
              },
            ],
          };

          const pointGraphic = new Graphic({
            geometry: point,
            symbol: markerSymbol,
          });

          graphicsLayer.add(pointGraphic);
        }
        addGraphic();
        const removeButton = document.getElementById("remove-button");

        removeButton.addEventListener("click", (e) =&amp;gt; {
          if (graphicsLayer.graphics.items.length) {
            try{
              graphicsLayer.removeAll();
            } catch (err){
              console.log('trying to catch the error', err)
            }
          } else {
            addGraphic();
          }
        });
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;p&amp;gt;Open the console to see the error logged when removing a graphic with TextSymbol3DLayer&amp;lt;/p&amp;gt;
    &amp;lt;button id="remove-button"&amp;gt;add/remove&amp;lt;/button&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2024 21:18:32 GMT</pubDate>
    <dc:creator>TonySchwebach</dc:creator>
    <dc:date>2024-06-05T21:18:32Z</dc:date>
    <item>
      <title>Dereference texture error logged when text symbol is removed from graphics layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1485685#M84806</link>
      <description>&lt;P&gt;I have a 3d SceneView with a graphics layer and a point graphic with icon and text symbol layers. When the graphic is removed from the graphics layer, the console logs this error message:&lt;BR /&gt;"4.29/:132 [esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl] Cannot dereference texture that has no references!"&lt;BR /&gt;&lt;BR /&gt;The error only seems to happen when the&amp;nbsp;&lt;SPAN&gt;TextSymbol3DLayer() is included in the symbol layers. If it is commented out, there is no error message.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;How can I avoid or suppress this error message?&lt;BR /&gt;&lt;BR /&gt;I created the html page below which replicates the error when the "add/remove" button is clicked.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stackblitz.com/edit/stackblitz-starters-adfukf?file=index.html" target="_self"&gt;https://stackblitz.com/edit/stackblitz-starters-adfukf?file=index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    /&amp;gt;
    &amp;lt;title&amp;gt;
      Add Graphics to a SceneView | Sample | ArcGIS Maps SDK for JavaScript 4.29
    &amp;lt;/title&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.29/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.29/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 80%;
        width: 100%;
      }
    &amp;lt;/style&amp;gt;

    &amp;lt;script async defer&amp;gt;
      require([
        "esri/Map",
        "esri/views/SceneView",
        "esri/layers/GraphicsLayer",
        "esri/Graphic",
      ], (Map, SceneView, GraphicsLayer, Graphic) =&amp;gt; {
        const map = new Map({
          basemap: "hybrid",
        });

        const view = new SceneView({
          container: "viewDiv",
          map: map,

          camera: {
            // autocasts as new Camera()
            position: {
              // autocasts as new Point()
              x: -0.178,
              y: 51.48791,
              z: 1266.7049653716385,
            },
          },
        });

        /*********************
         * Add graphics layer
         *********************/

        const graphicsLayer = new GraphicsLayer();
        map.add(graphicsLayer);

        /*************************
         * Add a 3D point graphic
         *************************/
        function addGraphic() {
          // London
          const point = {
            type: "point", // autocasts as new Point()
            x: -0.178,
            y: 51.48791,
          };

          const markerSymbol = {
            type: "point-3d",
            symbolLayers: [
              {
                type: "icon", // autocasts as new IconSymbol3DLayer()
                size: 8, // points
                resource: { primitive: "circle" },
                material: { color: "red" },
              },
              {
                type: "text", // autocasts as new TextSymbol3DLayer()
                text: `\n\n 100 m`,
                size: 10, // points
                material: { color: "red" },
                halo: {
                  color: "white",
                  size: 1,
                },
                horizontalAlignment: "center",
                verticalAlignment: "top",
              },
            ],
          };

          const pointGraphic = new Graphic({
            geometry: point,
            symbol: markerSymbol,
          });

          graphicsLayer.add(pointGraphic);
        }
        addGraphic();
        const removeButton = document.getElementById("remove-button");

        removeButton.addEventListener("click", (e) =&amp;gt; {
          if (graphicsLayer.graphics.items.length) {
            try{
              graphicsLayer.removeAll();
            } catch (err){
              console.log('trying to catch the error', err)
            }
          } else {
            addGraphic();
          }
        });
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;p&amp;gt;Open the console to see the error logged when removing a graphic with TextSymbol3DLayer&amp;lt;/p&amp;gt;
    &amp;lt;button id="remove-button"&amp;gt;add/remove&amp;lt;/button&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 21:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1485685#M84806</guid>
      <dc:creator>TonySchwebach</dc:creator>
      <dc:date>2024-06-05T21:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dereference texture error logged when text symbol is removed from graphics layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1485861#M84812</link>
      <description>&lt;P&gt;We have the same problem in our application. I tried a lot of things, but I didn't come to a solution. But I do know that this bug already came up with 4.28. Maybe this helps the developers of esri.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 06:28:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1485861#M84812</guid>
      <dc:creator>AndreV</dc:creator>
      <dc:date>2024-06-06T06:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dereference texture error logged when text symbol is removed from graphics layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1491746#M84858</link>
      <description>&lt;P&gt;Hi Tony,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for reaching out on this topic and the good repro case. This error shouldn't occour anymore in the upcoming release.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Thomas&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 14:26:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1491746#M84858</guid>
      <dc:creator>ThomasKnabl</dc:creator>
      <dc:date>2024-06-13T14:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dereference texture error logged when text symbol is removed from graphics layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1546114#M85829</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/88867"&gt;@ThomasKnabl&lt;/a&gt;&amp;nbsp;@ We are using 4.30.9 version and still appearing this error in 3D mode using the following code. Should it be already solved? Thank&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;graphicsLayer.removeAll();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 13:16:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dereference-texture-error-logged-when-text-symbol/m-p/1546114#M85829</guid>
      <dc:creator>LuisSolaRuiz</dc:creator>
      <dc:date>2024-10-07T13:16:08Z</dc:date>
    </item>
  </channel>
</rss>

