Get the current extents of the map

4643
1
Jump to solution
10-14-2016 01:45 PM
MuktaPuri
New Contributor II

I've added a map by setting the center and zoom on the mapView like so:

var view = new MapView({
    container: "viewDiv",
    map: map,
    zoom: 4,
    center: [15, 65]
});

After the map loads, we need to determine the current bounds of the map so we can query our database for data within those extents.

What is the best way to determine the current map extent after the map has loaded?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
thejuskambi
Occasional Contributor III

view.extent property should give you the current extents of the map.

extentExtent

The extent represents the visible portion of a map within the view as an instance of Extent.

View solution in original post

1 Reply
thejuskambi
Occasional Contributor III

view.extent property should give you the current extents of the map.

extentExtent

The extent represents the visible portion of a map within the view as an instance of Extent.