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
Solved! Go to Solution.
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.
Jason,
Have you ever used this widget before 2.13 with this web map?
No I have not. Should I use a different version?
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?
AGS 10.7.1. I have used this widget extensively with other web maps in 2.7 and previous and never had any issues.
So you have used the identify widget before but just not with this particular web map?
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
OK, just to be sure you did not use the identify widget in 2.7 with this particular web map though.
that is correct. this is a new web map
Is the app or web map or service public where you could share it with me for testing?