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.
 
 

14 lines
5.6 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 ../../chunks/tslib.es6 ../../core/Accessor ../../core/Evented ../../core/reactiveUtils ../../core/screenUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../core/libs/gl-matrix-2/math/vec2 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../geometry/projection ../../geometry/projection/projectPointToVector ../../support/elevationInfoUtils ../../symbols/support/defaults ../../symbols/support/ElevationInfo ./support/utils ../support/drapedUtils".split(" "),
function(c,f,t,u,m,k,h,G,H,I,v,n,w,x,p,y,z,A,B,C,D){c.GraphicManipulator=class extends t{set graphic(a){this._circleCollisionCache=null;this._originalSymbol=a.symbol;this._set("graphic",a);this.attachSymbolChanged()}get elevationInfo(){var {layer:a}=this.graphic;a=a&&"elevationInfo"in a?a.elevationInfo:null;const d=z.getGraphicEffectiveElevationMode(this.graphic);return new B({mode:d,offset:a?a.offset:0})}set focusedSymbol(a){a!==this._get("focusedSymbol")&&(this._set("focusedSymbol",a),this._updateGraphicSymbol(),
this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(a){a!==this._get("grabbing")&&(this._set("grabbing",a),this._updateGraphicSymbol())}set hovering(a){a!==this._get("hovering")&&(this._set("hovering",a),this._updateGraphicSymbol())}set selected(a){a!==this._get("selected")&&(this._set("selected",a),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:a?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(a){super(a);
this.layer=null;this.interactive=!0;this.selectable=!1;this.grabbable=!0;this.dragging=!1;this.cursor=null;this.consumesClicks=!0;this.events=new u.EventEmitter;this._originalSymbol=this._graphicSymbolChangedHandle=this._circleCollisionCache=null}destroy(){this.detachSymbolChanged();this._resetGraphicSymbol();this._set("view",null)}intersectionDistance(a){const d=this.graphic;if(!1===d.visible)return null;const e=d.geometry;if(null==e)return null;var b=this._get("focusedSymbol");b=null!=b?b:d.symbol;
return"2d"===this.view.type?this._intersectDistance2D(this.view,a,e,b):this._intersectDistance3D(this.view,a,d)}attach(){this.attachSymbolChanged();null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged();this._resetGraphicSymbol();null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged();this._graphicSymbolChangedHandle=m.watch(()=>this.graphic?.symbol,a=>{null!=a&&a!==this.focusedSymbol&&a!==this._originalSymbol&&(this._originalSymbol=
a,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))},m.sync)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(a,d,e,b){b=b||A.getDefaultSymbol2D(e);
if(null==b)return null;var g=this._circleCollisionCache;if("point"===e.type&&"cim"===b.type&&"CIMPointSymbol"===b.data.symbol?.type&&b.data.symbol.symbolLayers){const {offsetX:l,offsetY:E,size:F}=C.getSymbolInfo(b);b=k.screenPointObjectToArray(d,q);g=F/2;a=a.toScreen(e);return n.squaredDistance(b,[a.x+l,a.y+E])<g*g?1:null}if("point"!==e.type||"simple-marker"!==b.type)return D.intersectsDrapedGeometry(d,e,a)?1:null;if(null==g||!g.originalPoint.equals(e)){const l=a.spatialReference;p.canProjectWithoutEngine(e.spatialReference,
l)&&(g=p.project(e,l),this._circleCollisionCache=g={originalPoint:e.clone(),mapPoint:g,radiusPx:k.pt2px(b.size)})}if(null!=g){e=k.screenPointObjectToArray(d,q);a=a.toScreen?.(g.mapPoint);if(!a)return null;g=g.radiusPx;d=a.x+k.pt2px(b.xoffset);b=a.y-k.pt2px(b.yoffset);return n.squaredDistance(e,[d,b])<g*g?1:null}return null}_intersectDistance3D(a,d,e){return(d=a.toMap(d,{include:[e]}))&&y.projectPointToVector(d,r,a.renderSpatialReference)?w.distance(r,a.state.camera.eye):null}};f.__decorate([h.property({constructOnly:!0,
nonNullable:!0})],c.GraphicManipulator.prototype,"graphic",null);f.__decorate([h.property()],c.GraphicManipulator.prototype,"elevationInfo",null);f.__decorate([h.property({constructOnly:!0,nonNullable:!0})],c.GraphicManipulator.prototype,"view",void 0);f.__decorate([h.property({value:null})],c.GraphicManipulator.prototype,"focusedSymbol",null);f.__decorate([h.property({constructOnly:!0})],c.GraphicManipulator.prototype,"layer",void 0);f.__decorate([h.property()],c.GraphicManipulator.prototype,"interactive",
void 0);f.__decorate([h.property()],c.GraphicManipulator.prototype,"selectable",void 0);f.__decorate([h.property()],c.GraphicManipulator.prototype,"grabbable",void 0);f.__decorate([h.property({value:!1})],c.GraphicManipulator.prototype,"grabbing",null);f.__decorate([h.property()],c.GraphicManipulator.prototype,"dragging",void 0);f.__decorate([h.property()],c.GraphicManipulator.prototype,"hovering",null);f.__decorate([h.property({value:!1})],c.GraphicManipulator.prototype,"selected",null);f.__decorate([h.property()],
c.GraphicManipulator.prototype,"cursor",void 0);c.GraphicManipulator=f.__decorate([v.subclass("esri.views.interactive.GraphicManipulator")],c.GraphicManipulator);const r=x.create(),q=k.createScreenPointArray();Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});