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/time"],function(m,n){m.Path=class{constructor(){this.segments=[]}get time(){return this.segments.reduce((b,a)=>n.Seconds(b+a.time),n.Seconds(0))}interpolateComponentsAt(b,a){b=Math.min(Math.max(b,0),1);b*=this.time;var c=0,h=0;const e=this.definition,p=this.segments.reduce((f,d)=>f||d.definition.hasZoom,!1);for(let f=0;f<this.segments.length;f++){const d=this.segments[f],g=d.definition;if(b<=d.time||f===this.segments.length-1){this.segmentInterpolateComponentsAt(d,
0===d.time?0:b/d.time,a);e.hasPan&&!isNaN(a.pan)&&isFinite(e.compared.pan)?a.pan=(c+g.compared.pan*a.pan)/e.compared.pan:a.pan=1;e.hasRotate&&!isNaN(a.rotate)&&isFinite(e.compared.rotate)?a.rotate=(h+g.compared.rotate*a.rotate)/e.compared.rotate:a.rotate=1;if(p&&!isNaN(a.zoom)&&isFinite(g.compared.targetZoom)){const {sourceZoom:k,targetZoom:l}=g.compared;b=a.zoom*(l-k)+k;c=this.segments[0].definition.compared.sourceZoom;h=Math.abs(l-c)>Math.abs(k-c)?l:k;a.zoomOffset=h-this.segments[this.segments.length-
1].definition.compared.targetZoom;a.zoom=(b-c)/(h-c)}else a.zoom=1;return a}b-=d.time;c+=g.compared.pan;h+=g.compared.rotate}}segmentInterpolateComponentsAt(b,a,c){b.interpolateComponentsAt(a,c)}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});