Identify Widget - Point Selection Issue

381
20
Jump to solution
10-03-2019 06:51 AM
JasonStanton__GISP
Occasional Contributor

Robert,

I am using the Identify widget in WAB DE 2.13.  I am using the point selection tool to select points.  Some times it works, some times it doesn't, and most oddly - sometimes it selects a point up to 100 feet away.  The data, data frame/service and basemap are all WKID 10200.  I have tried to play with the Identify Tolerance to no avail.  Any ideas what might be happening here?


Jason

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   These two functions have to updated in the Widget.js.

      createQueryParams: function (layers, geom) {
var queryParamsList = [];
array.forEach(layers, lang.hitch(this, function (layer) {
var queryParams = new Query();
queryParams.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
if(geom.type === 'point'){
geom = this.pointToExtent(geom , this.identifytolerance);
if (layer.geometryType === 'esriGeometryPoint') {
queryParams.spatialRelationship = Query.SPATIAL_REL_CONTAINS;
}
}
queryParams.geometry = geom;
queryParams.outFields = ['*'];
queryParams.returnGeometry = this.returngeometryforzoom;
queryParams.outSpatialReference = this.map.spatialReference;
queryParamsList.push(queryParams);
}));
return queryParamsList;
},

pointToExtent: function(objPoint, distance){
var clickOffset = distance || 6;
var scrnPnt = this.map.toScreen(objPoint);
scrnPnt.update(scrnPnt.x + clickOffset, scrnPnt.y + clickOffset);
var nPnt = this.map.toMap(scrnPnt);
var queryExtent = new Extent(
Math.min(objPoint.x, nPnt.x),
Math.min(objPoint.y, nPnt.y),
Math.max(objPoint.x, nPnt.x),
Math.max(objPoint.y, nPnt.y),
objPoint.spatialReference);
return queryExtent.centerAt(objPoint);
},

and find this line in the Widget.js and delete the "+"

this.iResultLen += this.list.items.length;

so it looks like this:

this.iResultLen = this.list.items.length;

I will be releasing a 2.13 version soon that has these changes.

View solution in original post

0 Kudos
20 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   Have you ever used this widget before 2.13 with this web map? 

0 Kudos
JasonStanton__GISP
Occasional Contributor

No I have not. Should I use a different version?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

No I was just wondering if you had past experience with it working correctly. I have not had any reports of this type of issue. The layers you are identifying are coming from AGOL or your own ArcGIS Server?

0 Kudos
JasonStanton__GISP
Occasional Contributor

AGS 10.7.1.  I have used this widget extensively with other web maps in 2.7 and previous and never had any issues.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

So you have used the identify widget before but just not with this particular web map?

0 Kudos
JasonStanton__GISP
Occasional Contributor

I have used previous versions of the Identify widget in previous versions of WAB.  This is the first time I am using the 2.12 version of the Identify widget in WAB 2.13

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

OK, just to be sure you did not use the identify widget in 2.7 with this particular web map though.

0 Kudos
JasonStanton__GISP
Occasional Contributor

that is correct.  this is a new web map

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Is the app or web map or service public where you could share it with me for testing?

0 Kudos