Hide Table of Contents
esri
esri/arcgis
esri/dijit
esri/dijit/analysis
esri/dijit/geoenrichment
esri/dijit/geoenrichment/ReportPlayer
esri/geometry
esri/layers
esri/renderers
esri/symbols
esri/tasks
esri/tasks/datareviewer
esri/tasks/geoenrichment
esri/tasks/locationproviders
require(["esri/geometry/scaleUtils"], function(scaleUtils) { /* code goes here */ });
esri.geometry.getExtentForScale().| Name | Return type | Summary |
|---|---|---|
| getExtentForScale(map, scale) | Extent | Get the extent for the specified scale. |
| getScale(map) | Number | Gets the current scale of the map. |
| getUnitValueForSR(sr) | Number | Returns the value of one map unit for the given spatial reference (in meters). |
Extent
require([
"esri/geometry/scaleUtils", ...
], function(scaleUtils, ... ) {
var extent = scaleUtils.getExtentForScale(map, 10000);
...
});
Number<> map |
Required | The map whose scale should be calculated. |
require([
"esri/geometry/scaleUtils", ...
], function(scaleUtils, ... ) {
var scale = scaleUtils.getScale(map);
...
});
sr parameter can be a SpatialReference, WKID, or WKT. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references. (Added at v3.13)Number<> sr |
Required | The spatial reference represented as a SpatialReference class, Number, or String. |
require([
"esri/geometry/scaleUtils", ...
], function(scaleUtils, ... ) {
var mapUnit = scaleUtils.getUnitValueForSR(map.spatialReference);
...
});