Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: VisibleScaleRangeSlider

require(["esri/dijit/VisibleScaleRangeSlider"], function(VisibleScaleRangeSlider) { /* code goes here */ });

Description

(Added at v3.13)
A widget that sets the displayed visible scale values.

Samples

Search for samples that use this class.

Constructors

NameSummary
new VisibleScaleRangeSlider(params, srcNodeRef)Creates a new VisibleScaleRangeSlider widget.

CSS

esri/dijit/VisibleScaleRangeSlider | Download source

Properties

NameTypeSummary
layerLayerSetting the layer will update the suggested scale range, minScale and maxScale.
mapMapSetting this property will update the slider's minimum/maximum values and current scale indicator.
maxScaleNumberThe current maxScale value.
maximumNumberRead-only: The maxScale bound in the slider range.
minScaleNumberThe current minScale value.
minimumNumberRead-only: The minScale bound in the slider range.

Methods

NameReturn typeSummary
startup()NoneFinalizes the creation of the widget.

Events

[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.

Events

NameEvent ObjectSummary
scale-range-change
{
  maxScale: <Number>,
  minScale: <Number>
}
Dispatched whenever minScale or maxScale changes.
Constructor Details

new VisibleScaleRangeSlider(params, srcNodeRef)

Creates a new VisibleScaleRangeSlider widget.
Parameters:
<Object> params Required Set of parameters used to specify the VisibleScaleRangeSlider widget options.
<Node | String> srcNodeRef Required Reference or ID of the HTMLElement where the widget should be rendered.
params properties:
<Layer> layer Optional Layer used to determine the suggested scale range and set the minScale, maxScale values. The layer is used to set the min/max scale values.
<Map> map Required Reference to the map. Needed to show the current scale and to set the slider's minimum/maximum.
<String> region Optional Region of preview scale thumbnails. Default is 'en-US'.
Sample:
require(["esri/dijit/VisibleScaleRangeSlider", ...
  ], function(VisibleScaleRangeSlider, ... ) {
       var visibleScaleRangeSlider = new VisibleScaleRangeSlider({
       map: map, //required reference to the map
       layer: newLayer //optional, this sets min/max scale. If no layer, scale may be specifically set 
      }, srcNodeRef);
     visibleScaleRangeSlider.startup();
    });
Property Details

<Layer> layer

Setting the layer will update the suggested scale range, minScale and maxScale.
Default value:

<Map> map

Setting this property will update the slider's minimum/maximum values and current scale indicator.
Default value:

<Number> maxScale

The current maxScale value. Default is 0.
Default value: 0
Sample:
visibleScaleRangeSlider.set("maxScale",5000);
visibleScaleRangeSlider.set("minScale", 600000);

<Number> maximum

Read-only: The maxScale bound in the slider range
Default value:

<Number> minScale

The current minScale value. Default is 0.
Default value: 0
Sample:
visibleScaleRangeSlider.set("maxScale",5000);
visibleScaleRangeSlider.set("minScale", 600000);

<Number> minimum

Read-only: The minScale bound in the slider range.
Default value:
Method Details

startup()

Finalizes the creation of the widget.
Event Details
[ On Style Events | Connect Style Event ]

scale-range-change

Dispatched whenever minScale or maxScale changes.
Event Object Properties:
<Number> maxScale The maximum scale for the slider.
<Number> minScale The minimum scale for the slider.