AnsweredAssumed Answered

Near Me Widget: Slider Interval Issue

Question asked by dcoley on Dec 1, 2017
Latest reply on Dec 4, 2017 by dcoley

Hi all -

So I've noticed a buggy behavior with the distance slider intervals on the Near Me widget since probably WAB 2.4.  Seems that the slider interval doesn't honor the second interval unit.  For example, if I set a max distance of 5, units miles, the slider will show 1, 3, 4, 5 skipping mile 2.  Changing units or distances doesn't seem to matter.  Maybe there's something that can be added to intermediateChanges property in the _createSlider function?

/**
* This function create horizontal slider and set minimum maximum value of slider
* @memberOf widgets/NearMe/Widget
**/

_createSlider: function () {
// initialize and set the parameter of slider
this._slider = new HorizontalSlider({
name: "slider",
discreteValues: this.config.maxBufferDistance,
minimum: 0,
maximum: this.config.maxBufferDistance,
value: this.config.defaultBufferDistance,
intermediateChanges: true,
"class": "esriCTHorizantalSlider"
}, this.horizantalSliderContainer);
this._bufferParams = {
BufferDistance: this._slider.value.toString(),
BufferUnit: this.nls.units[this.config.bufferDistanceUnit.value].displayText
};
// set slider content
domAttr.set(this.silderText, "innerHTML", string.substitute(
this.nls.bufferSliderText, this._bufferParams));
// on change event of slider
this.own(this._slider.on("change", lang.hitch(this, this._sliderChange)));
// set maximum and minimum value of horizontal slider
this.sliderMinValue.innerHTML = this._slider.minimum.toString();
this.sliderMaxValue.innerHTML = this._slider.maximum.toString();
},

 

Thanks,

David

Outcomes