Does esri 4.x versions has an event equivalent to onExtentChange for Map?
map.on("extent-change", function(){//do things});
Read the section "Watching properties" here: Working with properties | ArcGIS API for JavaScript 4.4
view<SPAN class="punctuation token">.</SPAN><SPAN class="token function">watch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"extent"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">(</SPAN>newValue<SPAN class="punctuation token">,</SPAN> oldValue<SPAN class="punctuation token">,</SPAN> property<SPAN class="punctuation token">,</SPAN> object<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN><SPAN class="punctuation token">{</SPAN> console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">info</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Extent has changed: "</SPAN><SPAN class="punctuation token">,</SPAN> newValue<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Please read the section "Watching properties".
Since 4.0; watching properties is the 4.x way of handling this use case.
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.
Does this work in 4.3 or is this new feature in 4.4?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.