| Property | Type | Description |
|---|---|---|
| config | Object | ArcGIS JavaScript API default configurations that can be overridden programatically. For details, see Default API configurations. |
| documentBox | Object | Represents the size of the client side window or document at first load. The size contains width and height properties, and these do not change on window resize. |
| version | Number | Current version of the JavaScript API. |
| Method | Return Value | Description |
|---|---|---|
| esri.filter(object, callback, thisObject) | Object | Creates a new object with all properties that pass the test implemented by the filter provided in the function. |
| esri.graphicsExtent(graphics) | Extent | Utility function that returns the extent of an array of graphics. If the extent height and width are 0, null is returned. |
| esri.hide(element) | none | Hides an HTML element such as a DIV or TABLE. |
| esri.request(request, useProxy?) | Object | A wrapper around dojo.io.script.get and dojo.xhrPost. To request data from a server, this method handles sending requests when esriConfig.defaults.io.proxyURL and esriConfig.defaults.io.alwaysUseProxy are set. This method includes a default error handler in cases when the server response is an error. The returned object is dojo.Deferred. |
| esri.show(element) | none | Shows an HTML element such as a DIV or TABLE. |
| esri.substitute(data, template?, first?) | String | A wrapper around dojo.string.substitute that can also handle wildcard substitution. A wildcard uses the format of ${*}. If no template is provided, it is assumed to be a wildcard. This method is useful if you are not using Graphic or an InfoTemplate, but you want to embed result values in HTML, for example. |
| esri.toggle(element) | none | If an HTML element is currently visible, the element is hidden. If the element is hidden, it becomes visible. |
| esri.urlToObject(url) | Object | Converts the URL arguments to an object representaion. The object format is
{path: <String>, query:{key:<Object>}} |
| esri.valueOf(array, value) | Object | Iterates through the argument array and searches for the identifier to which the argument value matches. Returns null if no matching identifier is found. |
| <Object> object | Required | Object to filter. |
| <Function> callback | Required | Function or string implementing the filtering. |
| <Object> thisObject | Required | Optional object used to scope the call to the callback. |
function showResults(results) {
var filterFunction = function(value) {
if ((value !== ' ') & (Number(value) !== 0)) {
return true;
}
};
var filteredResults = esri.filter(results.features[0].attributes, filterFunction);
var s = "";
for (att in filteredResults) {
s = s + "" + att + ": " + filteredResults[att] + "
";
}
dojo.byId("info").innerHTML = s;
}
| <Graphics> graphics | Required | The input graphics array. |
var myFeatureExtent = esri.graphicsExtent(myFeatureSet.features);
| <Element> element | Required | The name of the HTML element. |
esri.hide(myTable);
| <Object> request | Required | The request object. |
| <Boolean> useProxy | Optional | When true, it forces a request to be posted through the proxy even if the content length is less than 2k. (As of v1.3) |
The following example sends a request and calls back the 'load' function on completion.
esri.request({
url:"",
content:{},
callbackParamName:"callback",
load:function(response, io) {...},
error:esriConfig.defaults.io.errorHandler
});| <Element> element | Required | The name of the HTML element. |
esri.show(myDiv);
${*}. If no template is provided, it is assumed to be a wildcard. This method is useful if you are not using Graphic or an InfoTemplate, but you want to embed result values in HTML, for example.| <Object> data | Required | The data object used in the substitution. |
| <String> template | Optional | The template used for the substitution. Can be any valid HTML. If no template is included, the wildcard template is used. |
| <Boolean> first | Optional | When true, returns only the first property found in the data object. The default is false. |
Example 1: no wildcard is included but is assumed.
esri.substitute({state_name: "Arizona", state_capital: "Phoenix"});
Returns: state_name = Arizona <br/> state_capital = PHoenix
Example 2: no wildcard is included and only the first property is displayed.
esri.substitute({state_name: "Arizona", state_capital: "Phoenix"},null,true);
Returns: state_name = Arizona <br/>
Example 3: a template is included for display.
esri.substitute({state_name: "Arizona", state_capital: "Phoenix"},"The capital of ${state_name} is ${state_capital}.");
Returns: The capital of Arizona is Phoenix.
| <Element> element | Required | The name of the HTML element. |
{path: <String>, query:{key:<Object>}}| <String> url | Required | The input URL. |
esri.urlToObject("http://www.myworld.com?state_name=Ohio&city_name=Akron");
Returns: { path: "http://www.myworld.com", query: {state_name: "Ohio", city_name: "Akron"} }
| <Array> array | Required | The argument array for testing. |
| <Object> value | Required | The value used in the search. If the value is a String, the value is case sensitive. |
Example 1:
esri.valueOf([firststring: "Oregon", secondstring: "Washington"], "Washington");
Returns: secondstring
Example 2:
esri.valueOf([firststring: "Oregon", secondstring: "Washington"], "Virginia");
Returns: null