Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

6 lines
1.4 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("exports ../../core/Collection ../../core/asyncUtils ../../core/Error ../../core/Logger ../../core/accessorSupport/watch ../../core/accessorSupport/trackingUtils".split(" "),function(h,p,t,u,v,w,q){function l(a){return null!=a&&"object"===typeof a&&"refreshInterval"in a&&"refresh"in a}function m(a,b){return Number.isFinite(a)&&Number.isFinite(b)?0>=b?a:m(b,a%b):0}function n(){var a=Date.now();let b=!1;for(const f of d){const c=f.deref();if(!c)b=!0;else if(c.refreshInterval){const r=e.get(c)??
0;a-r+5>=6E4*c.refreshInterval&&(e.set(c,a),c.refresh(a))}}if(b)for(a=d.length-1;0<=a;a--)d.at(a).deref()||d.removeAt(a)}const d=new p,e=new WeakMap;let k=0,g=0;q.autorun(()=>{const a=Date.now();let b=0;for(const f of d){const c=f.deref();c&&(b=m(Math.round(6E4*c.refreshInterval),b),c.refreshInterval?e.get(c)||e.set(c,a):e.delete(c))}b!==g&&(g=b,clearInterval(k),k=0===g?0:setInterval(n,g))});h.registerLayer=function(a){l(a)&&d.push(new WeakRef(a))};h.test={get hasRefreshTimer(){return 0<k},get tickInterval(){return g},
forceRefresh(){n()},hasLayer(a){return l(a)&&d.some(b=>b.deref()===a)},clear(){for(const a of d){const b=a.deref();b&&e.delete(b)}d.removeAll()}};h.unregisterLayer=function(a){const b=d.find(f=>f.deref()===a);b&&d.remove(b)};Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});