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:
//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
//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 = {
tick: 0,
labels: labels,
style: "width:2em; font-family:Verdana; font-size:65%; color:#fff; padding-left:2px;"
};
//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
//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();