Last active
August 29, 2015 14:21
-
-
Save raykendo/a107b9417d62839a02c5 to your computer and use it in GitHub Desktop.
ArcGIS JSAPI: Query Return Distinct - Precallback Request (V < 3.11)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["esri/request"], function (esriRequest) { | |
esriRequest.setRequestPreCallback(function(ioArgs){ | |
// test if we're sending the request to a mapservice query | |
if(/query\/?$/.test(ioArgs.url)){ | |
// if not requesting ObjectIds, count, or querying with a list of ObjectIDs, return distinct values. | |
if (ioArgs.content && !ioArgs.content.returnIdsOnly && !ioArgs.content.returnCountOnly && !ioArgs.content.objectIds) { | |
ioArgs.content.returnDistinctValues = true; | |
} | |
} | |
return ioArgs; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment