Group Filter _queryExtentToZoom Errors in WAB 2.2

795
6
10-27-2016 12:26 PM
SowjanyaSunkara3
New Contributor III

Clare Price

I have a GroupFilter setup with multiple groups. When switching between the groups and querying," zoom to" doesnt seem to work properly. It either zooms to full extent or doesnt zoom at all and then i have to hit "Apply" twice or more to get the widget to query and zoom again. Is this a known issue?

The widget works fine when I only have one group in the filter.

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Sowjanya,

   Are you using an esri base map in WKID 102100 or some custom basemap in another WKID?

SowjanyaSunkara3
New Contributor III

rscheitlin

We are using the ESRI Basemap clipped to our territory.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Sowjanya,

   The reason I ask is the error is coming from this line:

var newExt = (geometryEngine.geodesicBuffer(results.extent, 10, 9002, false)).getExtent();

Which means the geometryEngine.geodesicBuffer(results.extent, 10, 9002, false) is returning null.

geodesicBuffer should only be used on WebMercator or Geographic geometry. So either the results.extent is null or is in some wkid besides WebMercator or Geographic.

Probably best to call tech support and see if this is a bug.

SowjanyaSunkara3
New Contributor III

Thanks rscheitlin‌.

Just verified that all our data thats being used is in WebMercator.

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Initial troubleshooting in tech support concluded that the error 'getExtent' of null is the result of the query request that has no extent in the result. 

 

Like below.

{"count":0,"extent":{"xmin":"NaN","ymin":"NaN","xmax":"NaN","ymax":"NaN"}}

ErwinSoekianto
Esri Regular Contributor

the error 'getExtent' of null is the result of the query request that has no extent in the result. 

 

Like below.

{"count":0,"extent":{"xmin":"NaN","ymin":"NaN","xmax":"NaN","ymax":"NaN"}}

we can add additional checking in the Widgets/GroupFilter/widget.js line ~~1327 for function _queryExtentToZoom to check if the xmax,xmin,ymax.xmin value is not NaN like below

_queryExtentToZoom: function(results) {
   if(typeof(results.extent) !== 'undefined' && results.extent !== null ) {
 if(results.extent.xmax !== 'NaN' || results.extent.xmin !== 'NaN' || results.extent.ymax !== 'NaN' || results.extent.ymin !== 'NaN') {
         var newExt = (geometryEngine.geodesicBuffer(results.extent, 10, 9002, false)).getExtent();   
          ......

         ......
      }
   }
},

0 Kudos