onExtentChange on esri 4.X

1140
5
Jump to solution
07-28-2017 08:26 AM
UdyWa
by
New Contributor III

Does esri 4.x versions has an event equivalent to onExtentChange for Map?

map.on("extent-change", function(){//do things});
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor

Read the section "Watching properties" here: Working with properties | ArcGIS API for JavaScript 4.4 

view.watch("extent", (newValue, oldValue, property, object)=>{
  console.info("Extent has changed: ", newValue);
});‍‍‍‍‍‍

View solution in original post

5 Replies
JohnGrayson
Esri Regular Contributor

Read the section "Watching properties" here: Working with properties | ArcGIS API for JavaScript 4.4 

view.watch("extent", (newValue, oldValue, property, object)=>{
  console.info("Extent has changed: ", newValue);
});‍‍‍‍‍‍
UdyWa
by
New Contributor III

Does this work in 4.3 or is this new feature in 4.4?

0 Kudos
JohnGrayson
Esri Regular Contributor

Since 4.0; watching properties is the 4.x way of handling this use case.

0 Kudos
UdyWa
by
New Contributor III

This is only for setting new values to the existing values. What I need to is load some markers to exact points on extent change so the markers will be loaded only in the visible area. 

0 Kudos
JohnGrayson
Esri Regular Contributor

Please read the section "Watching properties".