Javascript 4.x zoomEnd Event / Scale Text

1157
6
Jump to solution
10-30-2017 04:14 PM
DavidPlume1
New Contributor III

Hi

I'm trying to generate scale text (e.g. 1/100,000 ) in the JS 4.5 API.  I can find MapView.scale but have not been able to locate anything like a "zoomEnd" event.

In 4.x API -- where might I find and event at the end zooming in our out please?

Thanks

David

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

David,

   In 4.x you need to dismiss the old ideas of having events for everything and you need to get use to watching properties. 

view.watch('extent', function(){
  //do something because the extent has changed. 
});‍‍‍

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

David,

   In 4.x you need to dismiss the old ideas of having events for everything and you need to get use to watching properties. 

view.watch('extent', function(){
  //do something because the extent has changed. 
});‍‍‍
DavidPlume1
New Contributor III

Robert,

As usual your very helpful suggestions are welcome -- I'll check it out!

Thanks

David

0 Kudos
DavidPlume1
New Contributor III

Robert -- very nice, I'm watching now!

David

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

David,

  FYI, you should mark the reply that answered your question as the correct answer so that people can find the answer easier.

LeoDeng
Occasional Contributor II

Hi @Robert,

   When I watch the extent property, there will be lots of triggers when zoom the map only once.

   My question is:

   How to determine the zoom event is end?

Thanks,

Leo

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Leo,

   You can watch the stationary property.

0 Kudos