Popups don't honor query in Residential Comp Finder (site selector)

333
1
Jump to solution
02-13-2018 01:14 PM
PhilLarkin1
Occasional Contributor III

Records included in popup do not always honor the query applied to the data. This is scale dependent. If a user is at a fine scale the popups do not include incorrect sales records. The popup seems bring back all records in an area, as opposed to the individual point clicked. This is replicated in the demo site: Site Selector... 

Demo Site:

residential comp finder incorrect popup

Local Implementation:

residential comp finder incorrect popup

Mike Tschudi

Lindsay King

 Chris Buscaglia

Lindsay Thomas

0 Kudos
1 Solution

Accepted Solutions
PhilLarkin1
Occasional Contributor III

Applying the correct query appears to fix this issue. However im not sure what the concept of workflows is in this app, so this could not be a good fix for someone who has applied this for some other workflow...

from js\library\widgets\mapSettings\mapSettings.js near line 361

        _executeQueryTask: function (index, mapPoint, QueryURL, onMapFeaturArray) {
            var esriQuery, queryTask, queryOnRouteTask, currentTime, layerIndex = index,
                queryString;
            queryTask = new QueryTask(QueryURL);
            esriQuery = new Query();
            currentTime = new Date().getTime() + index.toString();
            queryString = currentTime + "=" + currentTime;
            //set where clause to honor definition expression configured in webmap
            if (appGlobals.operationalLayers[index].layerObject.webmapDefinitionExpression) {
                queryString += " AND " + appGlobals.operationalLayers[index].layerObject.webmapDefinitionExpression;
            }
            
            //
            //Add IF here
            //overwrite querystring if a filter has been applied.
            if (appGlobals.shareOptions.arrWhereClause) {
                queryString = appGlobals.shareOptions.arrWhereClause[0]
            };‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
            //

View solution in original post

0 Kudos
1 Reply
PhilLarkin1
Occasional Contributor III

Applying the correct query appears to fix this issue. However im not sure what the concept of workflows is in this app, so this could not be a good fix for someone who has applied this for some other workflow...

from js\library\widgets\mapSettings\mapSettings.js near line 361

        _executeQueryTask: function (index, mapPoint, QueryURL, onMapFeaturArray) {
            var esriQuery, queryTask, queryOnRouteTask, currentTime, layerIndex = index,
                queryString;
            queryTask = new QueryTask(QueryURL);
            esriQuery = new Query();
            currentTime = new Date().getTime() + index.toString();
            queryString = currentTime + "=" + currentTime;
            //set where clause to honor definition expression configured in webmap
            if (appGlobals.operationalLayers[index].layerObject.webmapDefinitionExpression) {
                queryString += " AND " + appGlobals.operationalLayers[index].layerObject.webmapDefinitionExpression;
            }
            
            //
            //Add IF here
            //overwrite querystring if a filter has been applied.
            if (appGlobals.shareOptions.arrWhereClause) {
                queryString = appGlobals.shareOptions.arrWhereClause[0]
            };‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
            //
0 Kudos