JS API 4.17 layerView.queryExtent is incorrect?

1431
2
11-02-2020 12:49 PM
Tim_McGinnes
Occasional Contributor III

I am having some issues when doing a layerView.queryExtent in 4.17 - it is always returning 0,0 for xmin,ymin. If you simply change the JS API back to 4.16 it works fine. I am using EPSG:7856 for basemap and featurelayer if that makes any difference.

4.17 Console:

XMin: 0,  YMin: 0,  XMax: 496267.40614137735,  YMax: 7044933.36744386

4.16 Console:

XMin: 484190.3556723228,  YMin: 7034270.401998081,  XMax: 496267.40614137735,  YMax: 7044933.36744386

<script src="https://js.arcgis.com/4.17/"></script>
<script>
require(["esri/WebMap","esri/views/MapView","esri/layers/FeatureLayer"], function (WebMap, MapView, FeatureLayer) {
  const map = new WebMap({portalItem: {id:"997b15031351498d9266a664f7843a8a"}});
  const featureLayer = new FeatureLayer({url:"https://services3.arcgis.com/NvTosUQn3ZE5keno/arcgis/rest/services/big_data_test/FeatureServer/0",outFields: ["*"]});
  map.add(featureLayer);
  const view = new MapView({container: "viewDiv",map: map,popup: {dockEnabled: true,dockOptions: {breakpoint: false}}});
  view.when(function () {
    view.whenLayerView(featureLayer).then(function (layerView) {
      layerView.watch("updating", function(val) {
        if (!val) {
          layerView.queryExtent().then(function(response) {
            console.log("XMin: " + response.extent.xmin + "," + "  YMin: " + response.extent.ymin + "," + "  XMax: " + response.extent.xmax + "," + "  YMax: " + response.extent.ymax)
          });
        }
      });
    });
  });
});
</script>
0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

Thank you for reporting this issue and providing a reproducible case. We were able to reproduce the issue and will get it fixed as soon as we can. I will update you once it is fixed. 

Thanks,

-Undral 

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

This issue will be fixed at the JS API version 4.18. It is planned to be released end of December. You can test the fix using the `next` version of the api sometime next week. 

Please find more information about the next version here:https://github.com/Esri/feedback-js-api-next#:~:text=Welcome%20to%20the%20next%20version,production%....

 

Thanks,

-Undral

0 Kudos