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.
 
 

13 lines
5.1 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/Evented ../../../core/handleUtils ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/support/coordsUtils ./EditGeometry ./interfaces ./operations/AppendVertex ./operations/UpdateVertices ./operations/RemoveVertices ./operations/SplitEdge ./operations/SetVertexPosition ./operations/CloseComponent ./operations/MoveMesh ./operations/MoveVertex ./operations/OffsetEdgeVertex ./operations/RotateVertex ./operations/ScaleVertex ./operations/SetAllVertexPositions ./operations/UndoGroup".split(" "),
function(m,q,h,r,t,g,e,u,k,v,w,x,y,n,z,A,B,C,D,E){class p extends q{constructor(a,b){super();this.data=a;this.viewingMode=b;this._undoStack=[];this._redoStack=[];this._listener=this.data.on("change",c=>{c.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:c.addedVertices,operation:c.operation});c.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:c.removedVertices,operation:c.operation});c.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:c.updatedVertices,
operation:c.operation})})}destroy(){this._listener.remove()}splitEdge(a,b){return this._apply(new w.SplitEdge(this.data,a,b))}updateVertices(a,b,c=e.AccumulationBehavior.ACCUMULATE_STEPS){return this._apply(new k.UpdateVertices(this.data,a,b),c)}move(a,b,c,d=e.AccumulationBehavior.ACCUMULATE_STEPS){return g.isMeshEditGeometry(this.data)?this._apply(new n.MoveMesh(this.data,a,b,c),d):this.moveVertices(this.data.allVertices,a,b,c,d)}moveVertices(a,b,c,d,f=e.AccumulationBehavior.ACCUMULATE_STEPS){return g.isMeshEditGeometry(this.data)?
this._apply(new n.MoveMesh(this.data,b,c,d),f):this.updateVertices(a,new z.MoveVertex(this.data.coordinateHelper,b,c,d),f)}scale(a,b,c,d,f=e.AccumulationBehavior.ACCUMULATE_STEPS,l=k.AccumulationType.CUMULATIVE){return this.scaleVertices(this.data.allVertices,a,b,c,d,f,l)}scaleVertices(a,b,c,d,f,l=e.AccumulationBehavior.ACCUMULATE_STEPS,F=k.AccumulationType.CUMULATIVE){return this.updateVertices(a,new C.ScaleVertex(b,c,d,f,F),l)}rotate(a,b,c=e.AccumulationBehavior.ACCUMULATE_STEPS,d=k.AccumulationType.CUMULATIVE){return this.rotateVertices(this.data.allVertices,
a,b,c,d)}rotateVertices(a,b,c,d=e.AccumulationBehavior.ACCUMULATE_STEPS,f=k.AccumulationType.CUMULATIVE){return this.updateVertices(a,new B.RotateVertex(b,c,f),d)}removeVertices(a){return this._apply(new v.RemoveVertices(this.data,a,this._minNumVerticesPerType))}appendVertex(a){return 0===this.data.components.length?null:this._apply(new u.AppendVertex(this.data,this.data.components[0],a))}setVertexPosition(a,b){return this._apply(new x.SetVertexPosition(this.data,a,b))}offsetEdge(a,b,c,d=e.AccumulationBehavior.ACCUMULATE_STEPS){return this.updateVertices([b.leftVertex,
b.rightVertex],new A.OffsetEdgeVertex(this.data.coordinateHelper,a,b,c),d)}trySetGeometry(a,b=e.AccumulationBehavior.ACCUMULATE_STEPS){const {data:c}=this,{coordinateHelper:d}=c;if(c.type===a.type&&c.spatialReference.equals(a.spatialReference)&&d.hasZ()===a.hasZ&&d.hasM()===a.hasM&&t.hasCompatibleTopology(c.geometry,a)&&!g.isMeshEditGeometry(c))return a=Array.from(g.EditGeometry.fromGeometry(a,this.viewingMode).iterateVertices(),f=>f.pos),this.setVertexPositions(a,b)}setVertexPositions(a,b=e.AccumulationBehavior.ACCUMULATE_STEPS){return this._apply(new D.SetAllVertexPositions(this.data,
a),b)}createResetState(){if(g.isMeshEditGeometry(this.data))return this._createResetStateMesh();const a=this.data.geometry.clone();return h.makeHandle(()=>this.trySetGeometry(a))}closeComponent(a){return this.data.components.includes(a)?this._apply(new y.CloseComponent(this.data,a)):null}canRemoveVertex(a){return a.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const a=new E.UndoGroup;this._apply(a);return h.makeHandle(()=>a.close())}undo(){if(0<this._undoStack.length){const a=this._undoStack.pop();
a.undo();this._redoStack.push(a);return a}return null}redo(){if(0<this._redoStack.length){const a=this._redoStack.pop();a.apply();this._undoStack.push(a);return a}return null}get canUndo(){return 0<this._undoStack.length}get canRedo(){return 0<this._redoStack.length}get lastOperation(){return 0<this._undoStack.length?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case "point":return 1;case "polyline":return 2;case "polygon":return 3;default:return 0}}_apply(a,
b=e.AccumulationBehavior.ACCUMULATE_STEPS){b!==e.AccumulationBehavior.NEW_STEP&&null!=this.lastOperation&&this.lastOperation.accumulate(a)||(a.apply(),this._undoStack.push(a),this._redoStack=[]);return a}_createResetStateMesh(){if(!g.isMeshEditGeometry(this.data))return h.makeHandle();const a=this.data.geometry,{vertexSpace:b}=a;if(b.origin){const d=r.clone(b.origin);return h.makeHandle(()=>{a.vertexSpace.origin=d})}const c=a.vertexAttributes.clonePositional();return h.makeHandle(()=>{a.vertexAttributes=
c;a.vertexAttributesChanged()})}static fromGeometry(a,b){return new p(g.EditGeometry.fromGeometry(a,b),b)}}m.EditGeometryOperations=p;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});