Skip to content

Instantly share code, notes, and snippets.

View DavidSpriggs's full-sized avatar

David Spriggs DavidSpriggs

View GitHub Profile
/* This patch should be removed at JSAPI 3.8 */
require([
"dojo/_base/lang",
"dojo/Deferred",
"esri/dijit/Directions"
], function(lang, Deferred, Directions){
Directions.prototype._getCandidate = function(stop, index) {
var def = new Deferred();
var stopType = typeof stop;
var emptyStop = {
@DavidSpriggs
DavidSpriggs / GeoCoder Filter Fix.js
Last active December 24, 2015 21:48
Geocoder suggest filtering.
The suggest service does not honor the sourceCountry parameter. This function works to filter results based on a regEx.
In post create:
this.own(aspect.before(this.geocoder, '_hydrateResults', lang.hitch(this, 'scrubGeocodeAutoComplete')));
member function:
scrubGeocodeAutoComplete: function(results) {
var re = /United States/i;
var scrubedResults = [];