Near Me Widget: Slider Interval Issue

171
3
12-01-2017 01:38 PM
DavidColey
Frequent Contributor

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

Tags (1)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

David,

   The slider steps are decided by the min, max and discreteValues properties if the discreteValues is 3 then the slider will have a minimum a maximum and one value in the middle of those ranges. So is the this.config.maxBufferDistance and the slider length are what really controls the the slider steps. Try adjusting the maxBufferDistance.

0 Kudos
DavidColey
Frequent Contributor

Yeah I tried several different maxBufferDistance settings. So far, a middle value is always skipped.  If set to 11, value 6 is skipped.  If set to 10, value 5, etc.  Not sure if this is the case with the online WAB

0 Kudos
DavidColey
Frequent Contributor

Yes the behavior is the same for the online version as well

0 Kudos