<?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: Labeling bug with RangeDomain (4.26 and previous) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1349984#M82779</link>
    <description>&lt;P&gt;Updated code and information below to correspond with recent changes in the SDK.&lt;/P&gt;&lt;P&gt;Revised demonstration code since promiseUtils.create was removed in 4.27:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      require([
        "esri/Map",
        "esri/views/MapView",
        "esri/layers/FeatureLayer",
        "esri/layers/support/LabelClass",
        "esri/layers/support/RangeDomain",
        "esri/core/promiseUtils",
        "esri/Graphic",
        "esri/geometry/Point",
        "esri/rest/locator"
      ], (
        Map,
        MapView,
        FeatureLayer,
        LabelClass,
        RangeDomain,
        promiseUtils,
        Graphic,
        Point,
        locator
      ) =&amp;gt; {
        var labelIndex = 1;
        const view = new MapView({
          map: new Map({
            basemap: "gray-vector"
          }),
          container: "viewDiv",
          extent: {
            spatialReference: {
              wkid: 102100
            },
            xmin: -14488954,
            ymin: 3457304,
            xmax: -10656095,
            ymax: 5250211
          },
          popup: {
            dockEnabled: true,
            dockOptions: {
              position: "top-right",
              breakpoint: false
            }
          }
        });

        view
          .when()
          .then(fetchImages)
          .then(getFeaturesFromPromises)
          .then(createLayer)
          .then(addToView)
          .catch((e) =&amp;gt; {
            console.error("Creating FeatureLayer from photos failed", e);
          });

        /**
         * Fetches a list of images and returns a list of promises
         */
        function fetchImages() {
          const numPhotos = 18;
          const graphicPromises = [];
          const baseUrl =
            "https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-";

          for (let i = 1; i &amp;lt;= numPhotos; i++) {
            const url = baseUrl + i.toString() + ".jpg";
            const graphicPromise = exifToGraphic(url, i);
            graphicPromises.push(graphicPromise);
          }

          return promiseUtils.eachAlways(graphicPromises);
        }

        // Filters only promises that resolve with valid values (a graphic
        // in this case) and resolves them as an array of graphics.
        // In other words, each attempt at fetching an image returns a promise.
        // Images that fail to fetch will be filtered out of the response array
        // so the images that successfully load can be added to the layer.
        function getFeaturesFromPromises(eachAlwaysResponses) {
          return eachAlwaysResponses
            .filter((graphicPromise) =&amp;gt; {
              return graphicPromise.value;
            })
            .map((graphicPromise) =&amp;gt; {
              return graphicPromise.value;
            });
        }

        //  Creates a client-side FeatureLayer from an array of graphics
        function createLayer(graphics) {
          return new FeatureLayer({
            source: graphics,
            objectIdField: "OBJECTID",
            fields: [
              {
                name: "OBJECTID",
                type: "oid"
              },
              {
                name: "url",
                type: "string"
              },
              {
                name: "labeltest",
                type: "integer",
                domain: RangeDomain.fromJSON({
                  type: "range",
                  name: "d_LABELTEST",
                  range: [1,10000000]
                })
              }
            ],
            labelingInfo: [
              LabelClass.fromJSON({
                "labelPlacement": "esriServerPolygonPlacementAlwaysHorizontal",
                "where": null,
                "labelExpression": "[labeltest]",
                "useCodedValues": true,
                "symbol": {
                  "type": "esriTS",
                  "color": [
                    230,
                    76,
                    0,
                    255
                  ],
                  "backgroundColor": null,
                  "borderLineColor": null,
                  "borderLineSize": null,
                  "verticalAlignment": "bottom",
                  "horizontalAlignment": "left",
                  "rightToLeft": false,
                  "angle": 0,
                  "xoffset": 0,
                  "yoffset": 0,
                  "kerning": true,
                  "haloColor": [
                    255,
                    255,
                    255,
                    178
                  ],
                  "haloSize": 1.25,
                  "font": {
                    "family": "Arial",
                    "size": 16,
                    "style": "normal",
                    "weight": "bold",
                    "decoration": "none"
                  }
                },
                "minScale": 0,
                "maxScale": 0
              })
            ],
            popupTemplate: {
              title: (event) =&amp;gt; {
                return locator
                  .locationToAddress({
                    location: event.graphic.geometry
                  })
                  .then((response) =&amp;gt; {
                    return response.address;
                  })
                  .catch((error) =&amp;gt; {
                    return "The middle of nowhere";
                  });
              },
              content: "&amp;lt;img src='{url}'&amp;gt;"
            },
            renderer: {
              type: "simple",
              symbol: {
                type: "text",
                color: "#7A003C",
                text: "\ue661",
                font: {
                  size: 20,
                  family: "CalciteWebCoreIcons"
                }
              }
            }
          });
        }

        // Adds a given layer to the map in the view
        function addToView(layer) {
          view.map.add(layer);
        }

        /**
         * Fetches and loads an image from a url and gets the latitude/longitude
         * GPS data from the EXIF data of the image. Returns a promise that
         * resolves to a Graphic with a point geometry representing the location
         * where the photo was taken.
         */
        function exifToGraphic(url, id) {
          return new Promise((resolve, reject) =&amp;gt; {
            const image = document.createElement("img");
            image.src=url;
            image.onload = () =&amp;gt; {
              image.load = image.onerror = null;
              EXIF.getData(image, function () {
                const latitude = EXIF.getTag(this, "GPSLatitude");
                const latitudeDirection = EXIF.getTag(this, "GPSLatitudeRef");
                const longitude = EXIF.getTag(this, "GPSLongitude");
                const longitudeDirection = EXIF.getTag(this, "GPSLongitudeRef");

                if (!latitude || !longitude) {
                  reject(
                    new Error(
                      "Photo doesn't contain GPS information: ",
                      this.src
                    )
                  );
                  return;
                }

                const location = new Point({
                  latitude: dmsDD(latitude, latitudeDirection),
                  longitude: dmsDD(longitude, longitudeDirection)
                });

                resolve(
                  new Graphic({
                    geometry: location,
                    attributes: {
                      url: url,
                      OBJECTID: id,
                      labeltest: labelIndex++
                    }
                  })
                );
              });
            };

            image.onerror = () =&amp;gt; {
              image.load = image.onerror = null;
              reject(new Error("Error while loading the image"));
            };
          });
        }

        // Converts a DMS coordinate to decimal degrees
        function dmsDD([degrees, minutes, seconds], direction) {
          let dd = degrees + minutes / 60 + seconds / 3600;
          if (direction === "S" || direction === "W") {
            dd *= -1;
          }
          return dd;
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite changes being made to the offending function within labelFormatUtils.js in 4.28, the bug still remains.&amp;nbsp; The problem occurs on line 15 below; instead of "return g.name" it should be "return a".&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    function v(a, e) {
        if (null == a)
            return "";
        const g = e.domain;
        if (g)
            if ("codedValue" === g.type || "coded-value" === g.type)
                for (var f of g.codedValues) {
                    if (f.code === a)
                        return f.name
                }
            else if ("range" === g.type) {
                const {max: h, min: b} = z.getDomainRange(e);
                f = +a;
                if (null != b &amp;amp;&amp;amp; null != h &amp;amp;&amp;amp; b &amp;lt;= f &amp;amp;&amp;amp; f &amp;lt;= h)
                    return g.name
            }
        t.isDateField(e) ? a = r.formatDate(a, r.convertDateFormatToIntlOptions("short-date")) : t.isNumericField(e) &amp;amp;&amp;amp; (a = y.formatNumber(+a));
        return a || ""
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2023 21:37:10 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-11-15T21:37:10Z</dc:date>
    <item>
      <title>Labeling bug with RangeDomain (4.26 and previous)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1280469#M80917</link>
      <description>&lt;P&gt;A bug in the JavaScript Maps SDK causes features to be labeled improperly when the field from which labels are derived has a range domain (i.e. &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html" target="_self"&gt;RangeDomain&lt;/A&gt;).&amp;nbsp; Rather than the field's value being displayed, the field's domain name is displayed instead, as shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="range_dom.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68495i8DB8013D8179AE63/image-size/large?v=v2&amp;amp;px=999" role="button" title="range_dom.png" alt="range_dom.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Displayed above is the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=layers-featurelayer-collection" target="_self"&gt;Create a FeatureLayer with client-side graphics&lt;/A&gt; sample with some modifications that cause the issue to be seen.&amp;nbsp; This can be reproduced by replacing the contents of the third script tag with the code below (a simple diff utility can show the changes):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      require([
        "esri/Map",
        "esri/views/MapView",
        "esri/layers/FeatureLayer",
        "esri/layers/support/LabelClass",
        "esri/layers/support/RangeDomain",
        "esri/core/promiseUtils",
        "esri/Graphic",
        "esri/geometry/Point",
        "esri/rest/locator"
      ], (
        Map,
        MapView,
        FeatureLayer,
        LabelClass,
        RangeDomain,
        promiseUtils,
        Graphic,
        Point,
        locator
      ) =&amp;gt; {
        var labelIndex = 1;
        const view = new MapView({
          map: new Map({
            basemap: "gray-vector"
          }),
          container: "viewDiv",
          extent: {
            spatialReference: {
              wkid: 102100
            },
            xmin: -14488954,
            ymin: 3457304,
            xmax: -10656095,
            ymax: 5250211
          },
          popup: {
            dockEnabled: true,
            dockOptions: {
              position: "top-right",
              breakpoint: false
            }
          }
        });

        view
          .when()
          .then(fetchImages)
          .then(getFeaturesFromPromises)
          .then(createLayer)
          .then(addToView)
          .catch((e) =&amp;gt; {
            console.error("Creating FeatureLayer from photos failed", e);
          });

        /**
         * Fetches a list of images and returns a list of promises
         */
        function fetchImages() {
          const numPhotos = 18;
          const graphicPromises = [];
          const baseUrl =
            "https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-";

          for (let i = 1; i &amp;lt;= numPhotos; i++) {
            const url = baseUrl + i.toString() + ".jpg";
            const graphicPromise = exifToGraphic(url, i);
            graphicPromises.push(graphicPromise);
          }

          return promiseUtils.eachAlways(graphicPromises);
        }

        // Filters only promises that resolve with valid values (a graphic
        // in this case) and resolves them as an array of graphics.
        // In other words, each attempt at fetching an image returns a promise.
        // Images that fail to fetch will be filtered out of the response array
        // so the images that successfully load can be added to the layer.
        function getFeaturesFromPromises(eachAlwaysResponses) {
          return eachAlwaysResponses
            .filter((graphicPromise) =&amp;gt; {
              return graphicPromise.value;
            })
            .map((graphicPromise) =&amp;gt; {
              return graphicPromise.value;
            });
        }

        //  Creates a client-side FeatureLayer from an array of graphics
        function createLayer(graphics) {
          return new FeatureLayer({
            source: graphics,
            objectIdField: "OBJECTID",
            fields: [
              {
                name: "OBJECTID",
                type: "oid"
              },
              {
                name: "url",
                type: "string"
              },
              {
                name: "labeltest",
                type: "integer",
                domain: RangeDomain.fromJSON({
                  type: "range",
                  name: "d_LABELTEST",
                  range: [1,10000000]
                })
              }
            ],
            labelingInfo: [
              LabelClass.fromJSON({
                "labelPlacement": "esriServerPolygonPlacementAlwaysHorizontal",
                "where": null,
                "labelExpression": "[labeltest]",
                "useCodedValues": true,
                "symbol": {
                  "type": "esriTS",
                  "color": [
                    230,
                    76,
                    0,
                    255
                  ],
                  "backgroundColor": null,
                  "borderLineColor": null,
                  "borderLineSize": null,
                  "verticalAlignment": "bottom",
                  "horizontalAlignment": "left",
                  "rightToLeft": false,
                  "angle": 0,
                  "xoffset": 0,
                  "yoffset": 0,
                  "kerning": true,
                  "haloColor": [
                    255,
                    255,
                    255,
                    178
                  ],
                  "haloSize": 1.25,
                  "font": {
                    "family": "Arial",
                    "size": 16,
                    "style": "normal",
                    "weight": "bold",
                    "decoration": "none"
                  }
                },
                "minScale": 0,
                "maxScale": 0
              })
            ],
            popupTemplate: {
              title: (event) =&amp;gt; {
                return locator
                  .locationToAddress({
                    location: event.graphic.geometry
                  })
                  .then((response) =&amp;gt; {
                    return response.address;
                  })
                  .catch((error) =&amp;gt; {
                    return "The middle of nowhere";
                  });
              },
              content: "&amp;lt;img src='{url}'&amp;gt;"
            },
            renderer: {
              type: "simple",
              symbol: {
                type: "text",
                color: "#7A003C",
                text: "\ue661",
                font: {
                  size: 20,
                  family: "CalciteWebCoreIcons"
                }
              }
            }
          });
        }

        // Adds a given layer to the map in the view
        function addToView(layer) {
          view.map.add(layer);
        }

        /**
         * Fetches and loads an image from a url and gets the latitude/longitude
         * GPS data from the EXIF data of the image. Returns a promise that
         * resolves to a Graphic with a point geometry representing the location
         * where the photo was taken.
         */
        function exifToGraphic(url, id) {
          return promiseUtils.create((resolve, reject) =&amp;gt; {
            const image = document.createElement("img");
            image.src=url;
            image.onload = () =&amp;gt; {
              image.load = image.onerror = null;
              EXIF.getData(image, function () {
                const latitude = EXIF.getTag(this, "GPSLatitude");
                const latitudeDirection = EXIF.getTag(this, "GPSLatitudeRef");
                const longitude = EXIF.getTag(this, "GPSLongitude");
                const longitudeDirection = EXIF.getTag(this, "GPSLongitudeRef");

                if (!latitude || !longitude) {
                  reject(
                    new Error(
                      "Photo doesn't contain GPS information: ",
                      this.src
                    )
                  );
                  return;
                }

                const location = new Point({
                  latitude: dmsDD(latitude, latitudeDirection),
                  longitude: dmsDD(longitude, longitudeDirection)
                });

                resolve(
                  new Graphic({
                    geometry: location,
                    attributes: {
                      url: url,
                      OBJECTID: id,
                      labeltest: labelIndex++
                    }
                  })
                );
              });
            };

            image.onerror = () =&amp;gt; {
              image.load = image.onerror = null;
              reject(new Error("Error while loading the image"));
            };
          });
        }

        // Converts a DMS coordinate to decimal degrees
        function dmsDD([degrees, minutes, seconds], direction) {
          let dd = degrees + minutes / 60 + seconds / 3600;
          if (direction === "S" || direction === "W") {
            dd *= -1;
          }
          return dd;
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem occurs in the esri/layers/support/labelFormatUtils module - in particular, line 15 of the function below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    function t(b, f) {
        if (null == b)
            return "";
        const a = f.domain;
        if (a)
            if ("codedValue" === a.type || "coded-value" === a.type)
                for (var g of a.codedValues) {
                    if (g.code === b)
                        return g.name
                }
            else if ("range" === a.type) {
                g = +b;
                const h = "range"in a ? a.range[1] : a.maxValue;
                if (("range"in a ? a.range[0] : a.minValue) &amp;lt;= g &amp;amp;&amp;amp; g &amp;lt;= h)
                    return a.name
            }
        "date" === f.type || "esriFieldTypeDate" === f.type ? b = q.formatDate(b, q.convertDateFormatToIntlOptions("short-date")) : z.isNumericField(f) &amp;amp;&amp;amp; (b = y.formatNumber(+b));
        return b ? b : ""
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As can be seen, if the value is within the range of the domain, the domain's name is returned.&amp;nbsp; This issue can be fixed by replacing "return a.name" with "return b".&amp;nbsp; The code shown above is from version 4.26, but the problem goes at least as far back as 4.23.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 20:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1280469#M80917</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-04-19T20:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling bug with RangeDomain (4.26 and previous)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1349984#M82779</link>
      <description>&lt;P&gt;Updated code and information below to correspond with recent changes in the SDK.&lt;/P&gt;&lt;P&gt;Revised demonstration code since promiseUtils.create was removed in 4.27:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      require([
        "esri/Map",
        "esri/views/MapView",
        "esri/layers/FeatureLayer",
        "esri/layers/support/LabelClass",
        "esri/layers/support/RangeDomain",
        "esri/core/promiseUtils",
        "esri/Graphic",
        "esri/geometry/Point",
        "esri/rest/locator"
      ], (
        Map,
        MapView,
        FeatureLayer,
        LabelClass,
        RangeDomain,
        promiseUtils,
        Graphic,
        Point,
        locator
      ) =&amp;gt; {
        var labelIndex = 1;
        const view = new MapView({
          map: new Map({
            basemap: "gray-vector"
          }),
          container: "viewDiv",
          extent: {
            spatialReference: {
              wkid: 102100
            },
            xmin: -14488954,
            ymin: 3457304,
            xmax: -10656095,
            ymax: 5250211
          },
          popup: {
            dockEnabled: true,
            dockOptions: {
              position: "top-right",
              breakpoint: false
            }
          }
        });

        view
          .when()
          .then(fetchImages)
          .then(getFeaturesFromPromises)
          .then(createLayer)
          .then(addToView)
          .catch((e) =&amp;gt; {
            console.error("Creating FeatureLayer from photos failed", e);
          });

        /**
         * Fetches a list of images and returns a list of promises
         */
        function fetchImages() {
          const numPhotos = 18;
          const graphicPromises = [];
          const baseUrl =
            "https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-";

          for (let i = 1; i &amp;lt;= numPhotos; i++) {
            const url = baseUrl + i.toString() + ".jpg";
            const graphicPromise = exifToGraphic(url, i);
            graphicPromises.push(graphicPromise);
          }

          return promiseUtils.eachAlways(graphicPromises);
        }

        // Filters only promises that resolve with valid values (a graphic
        // in this case) and resolves them as an array of graphics.
        // In other words, each attempt at fetching an image returns a promise.
        // Images that fail to fetch will be filtered out of the response array
        // so the images that successfully load can be added to the layer.
        function getFeaturesFromPromises(eachAlwaysResponses) {
          return eachAlwaysResponses
            .filter((graphicPromise) =&amp;gt; {
              return graphicPromise.value;
            })
            .map((graphicPromise) =&amp;gt; {
              return graphicPromise.value;
            });
        }

        //  Creates a client-side FeatureLayer from an array of graphics
        function createLayer(graphics) {
          return new FeatureLayer({
            source: graphics,
            objectIdField: "OBJECTID",
            fields: [
              {
                name: "OBJECTID",
                type: "oid"
              },
              {
                name: "url",
                type: "string"
              },
              {
                name: "labeltest",
                type: "integer",
                domain: RangeDomain.fromJSON({
                  type: "range",
                  name: "d_LABELTEST",
                  range: [1,10000000]
                })
              }
            ],
            labelingInfo: [
              LabelClass.fromJSON({
                "labelPlacement": "esriServerPolygonPlacementAlwaysHorizontal",
                "where": null,
                "labelExpression": "[labeltest]",
                "useCodedValues": true,
                "symbol": {
                  "type": "esriTS",
                  "color": [
                    230,
                    76,
                    0,
                    255
                  ],
                  "backgroundColor": null,
                  "borderLineColor": null,
                  "borderLineSize": null,
                  "verticalAlignment": "bottom",
                  "horizontalAlignment": "left",
                  "rightToLeft": false,
                  "angle": 0,
                  "xoffset": 0,
                  "yoffset": 0,
                  "kerning": true,
                  "haloColor": [
                    255,
                    255,
                    255,
                    178
                  ],
                  "haloSize": 1.25,
                  "font": {
                    "family": "Arial",
                    "size": 16,
                    "style": "normal",
                    "weight": "bold",
                    "decoration": "none"
                  }
                },
                "minScale": 0,
                "maxScale": 0
              })
            ],
            popupTemplate: {
              title: (event) =&amp;gt; {
                return locator
                  .locationToAddress({
                    location: event.graphic.geometry
                  })
                  .then((response) =&amp;gt; {
                    return response.address;
                  })
                  .catch((error) =&amp;gt; {
                    return "The middle of nowhere";
                  });
              },
              content: "&amp;lt;img src='{url}'&amp;gt;"
            },
            renderer: {
              type: "simple",
              symbol: {
                type: "text",
                color: "#7A003C",
                text: "\ue661",
                font: {
                  size: 20,
                  family: "CalciteWebCoreIcons"
                }
              }
            }
          });
        }

        // Adds a given layer to the map in the view
        function addToView(layer) {
          view.map.add(layer);
        }

        /**
         * Fetches and loads an image from a url and gets the latitude/longitude
         * GPS data from the EXIF data of the image. Returns a promise that
         * resolves to a Graphic with a point geometry representing the location
         * where the photo was taken.
         */
        function exifToGraphic(url, id) {
          return new Promise((resolve, reject) =&amp;gt; {
            const image = document.createElement("img");
            image.src=url;
            image.onload = () =&amp;gt; {
              image.load = image.onerror = null;
              EXIF.getData(image, function () {
                const latitude = EXIF.getTag(this, "GPSLatitude");
                const latitudeDirection = EXIF.getTag(this, "GPSLatitudeRef");
                const longitude = EXIF.getTag(this, "GPSLongitude");
                const longitudeDirection = EXIF.getTag(this, "GPSLongitudeRef");

                if (!latitude || !longitude) {
                  reject(
                    new Error(
                      "Photo doesn't contain GPS information: ",
                      this.src
                    )
                  );
                  return;
                }

                const location = new Point({
                  latitude: dmsDD(latitude, latitudeDirection),
                  longitude: dmsDD(longitude, longitudeDirection)
                });

                resolve(
                  new Graphic({
                    geometry: location,
                    attributes: {
                      url: url,
                      OBJECTID: id,
                      labeltest: labelIndex++
                    }
                  })
                );
              });
            };

            image.onerror = () =&amp;gt; {
              image.load = image.onerror = null;
              reject(new Error("Error while loading the image"));
            };
          });
        }

        // Converts a DMS coordinate to decimal degrees
        function dmsDD([degrees, minutes, seconds], direction) {
          let dd = degrees + minutes / 60 + seconds / 3600;
          if (direction === "S" || direction === "W") {
            dd *= -1;
          }
          return dd;
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite changes being made to the offending function within labelFormatUtils.js in 4.28, the bug still remains.&amp;nbsp; The problem occurs on line 15 below; instead of "return g.name" it should be "return a".&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    function v(a, e) {
        if (null == a)
            return "";
        const g = e.domain;
        if (g)
            if ("codedValue" === g.type || "coded-value" === g.type)
                for (var f of g.codedValues) {
                    if (f.code === a)
                        return f.name
                }
            else if ("range" === g.type) {
                const {max: h, min: b} = z.getDomainRange(e);
                f = +a;
                if (null != b &amp;amp;&amp;amp; null != h &amp;amp;&amp;amp; b &amp;lt;= f &amp;amp;&amp;amp; f &amp;lt;= h)
                    return g.name
            }
        t.isDateField(e) ? a = r.formatDate(a, r.convertDateFormatToIntlOptions("short-date")) : t.isNumericField(e) &amp;amp;&amp;amp; (a = y.formatNumber(+a));
        return a || ""
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 21:37:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1349984#M82779</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-11-15T21:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling bug with RangeDomain (4.26 and previous)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1419539#M84515</link>
      <description>&lt;P&gt;This problem has resurfaced in 4.29 because the file is no longer imported directly.&amp;nbsp; Instead, the module is now included in the file&amp;nbsp;esri/views/2d/layers/features/FeaturePipelineWorker.js, so the fix has to be applied there instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(null!=B&amp;amp;&amp;amp;null!=y&amp;amp;&amp;amp;B&amp;lt;=v&amp;amp;&amp;amp;v&amp;lt;=y)return n.name&lt;/LI-CODE&gt;&lt;P&gt;Replace with:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(null!=B&amp;amp;&amp;amp;null!=y&amp;amp;&amp;amp;B&amp;lt;=v&amp;amp;&amp;amp;v&amp;lt;=y)return g&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 17:36:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/labeling-bug-with-rangedomain-4-26-and-previous/m-p/1419539#M84515</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-05-06T17:36:25Z</dc:date>
    </item>
  </channel>
</rss>

