Default API configurations for v1.2 and lowerE-mail This Topic Printable Version Give Us Feedback

Note: "esriConfig" is deprecated as of version 1.3. If you are using version 1.2 or lower, you should continue using the methods on this page. Each method starts with "esriConfig". If you are using version 1.3 or higher, you should refer to Default API configurations for v1.3 and higher, which uses "esri.config" in place of "esriConfig".

The ArcGIS JavaScript API has some default configurations that can be overridden programatically. An example configuration is the symbol used for the rubber band zoom box. In the following code, the variable zoomSymbol is initialized. In the next line, the default zoomSymbol is overridden with the new symbol.

        var zoomSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([0,0,255]), 2), new dojo.Color([255,255,0,0.5]));
        esriConfig.defaults.map.zoomSymbol = zoomSymbol.toJson();

The following list contains the default JavaScript API configurations:

esriConfig.defaults.map.panDuration

The length of time in milliseconds that the map will take to pan from one extent to another.
Default: 250
Sample:
//configure map pan animation to be slower
esriConfig.defaults.map.panDuration = 1000; //time in milliseconds; default panDuration:250
esriConfig.defaults.map.panRate = 50; //refresh rate of zoom animation; default panRate:25 
	

esriConfig.defaults.map.panRate

The length of time in milliseconds that the map will refresh as it pans to the next extent.
Default: 25

esriConfig.defaults.map.slider

The parameters that define the location, size, and orientation of the slider.
Default: {left:"30px",top:"30px",width:null,height:"200px"}
Sample:
//configure map slider to be horizontally place at bottom right
esriConfig.defaults.map.slider = { right:"10px", bottom:"10px", width:"200px", height:null };
	

esriConfig.defaults.map.sliderLabel

The parameters that define the slider tick and accompanying tick label. If this is null then the slider will not show tick marks.
Default: {tick:5,labels:null,style:"width:2em; font-family:Verdana; font-size:75%;"}
Sample:
esriConfig.defaults.map.sliderLabel = {
  tick: 0,
  labels: labels,
  style: "width:2em; font-family:Verdana; font-size:65%; color:#fff; padding-left:2px;"
};

esriConfig.defaults.map.zoomDuration

The length of time in milliseconds that the map will take to zoom from one extent to another.
Default: 250
Sample:
//configure map zoom animation to be slower
esriConfig.defaults.map.zoomDuration = 1000; //time in milliseconds; default is 250
esriConfig.defaults.map.zoomRate = 50; //refresh rate of zoom animation; default is 25
	

esriConfig.defaults.map.zoomRate

The length of time in milliseconds that the map will refresh as it zooms to the next extent.
Default: 25

esriConfig.defaults.map.zoomSymbol

The SimpleFillSymbol to use to represent the color, fill, and outline properties of the RubberBand zoom. This is the JSON representation of the SimpleFillSymbol.
Default: {color:[0,0,0,64],outline:{color:[255,0,0,255],width:1.5,style:"esriSLSSolid"},style:"esriSFSSolid"}
Sample:
//configure map zoom rectangle fill by setting style by calling esri.symbol.SimpleFillSymbol.toJson()
var zoomSymbol = new esri.symbol.SimpleFillSymbol(...);
esriConfig.defaults.map.zoomSymbol = zoomSymbol.toJson();

esriConfig.defaults.io.alwaysUseProxy

Whether or not to always use the proxy for communication to a REST endpoint.
Default: FALSE

esriConfig.defaults.io.proxyUrl

The location of the proxy url that should be used when posting large payloads to an endpoint. This must reside on the same domain as the HTML application.
Default: null