I am trying to create a bounding box for my map in ArcGIS 3.28. I want the bounding box to stay in a given area based on the coordinates given. I found a class called Extent in the API Reference that can set a bounding box, but it does not look like there's a way to implement the bonding box. This is what I have at the moment:`
var map;
require([
"esri/map",
"esri/dijit/InfoWindowLite",
"esri/InfoTemplate",
"esri/config",
"esri/layers/FeatureLayer",
"dojo/dom-construct",
"esri/geometry/Extent",
"esri/dijit/Search",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/SpatialReference",
"dojo/domReady!"
],
function(
Map,
InfoWindowLite,
InfoTemplate,
esriConfig,
FeatureLayer,
domConstruct,
Extent,
Search,
ArcGISTiledMapServiceLayer,
SpatialReference
){
var boundingBox = new Extent(-122.3737, 37.454, -121.467, 37.9067, new SpatialReference({ wkid:4326 }));
//creating the map
map = new Map("map", {
extent: boundingBox,
basemap: "streets", //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd
center: [-121.91, 37.65], // longitude, latitude
zoom: 11
});
Using this, is there a way to create a bounding box or is something I can add to it to make it work?