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.3 KiB
14 lines
5.3 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("./chunks/tslib.es6 ./geometry ./PopupTemplate ./symbols ./core/Clonable ./core/deprecate ./core/JSONSupport ./core/Logger ./core/reactiveUtils ./core/uid ./core/accessorSupport/decorators/property ./core/has ./core/RandomLCG ./core/accessorSupport/decorators/subclass ./geometry/support/jsonUtils".split(" "),function(e,p,q,r,d,t,k,u,l,m,f,w,x,v,n){var h;d=h=class extends d.ClonableMixin(k.JSONSupport){constructor(a){super(a);this.isAggregate=!1;this.sourceLayer=this.popupTemplate=this.origin= |
|
this.layer=null;Object.defineProperty(this,"uid",{value:m.generateUID(),configurable:!0});Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1});1<arguments.length&&t.deprecatedConstructorSignature(u.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(a){const b=this._get("aggregateGeometries");JSON.stringify(b)!==JSON.stringify(a)&&this._set("aggregateGeometries",a)}set attributes(a){const b= |
|
this._get("attributes");b!==a&&(this._set("attributes",a),this._notifyLayer("attributes",b,a))}set geometry(a){const b=this._get("geometry");b!==a&&(this._set("geometry",a),"mesh"!==a?.type&&this._notifyLayer("geometry",b,a))}set symbol(a){const b=this._get("symbol");b!==a&&(this._set("symbol",a),this._notifyLayer("symbol",b,a))}set visible(a){const b=this._get("visible");b!==a&&(this._set("visible",a),this._notifyLayer("visible",b,a))}cloneShallow(){return new h({aggregateGeometries:this.aggregateGeometries, |
|
attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(a=!1){if(this.popupTemplate)return this.popupTemplate;const b=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const c of[b,this.sourceLayer,this.layer])if(c){if("popupTemplate"in c&&c.popupTemplate)return c.popupTemplate;if(a&&"defaultPopupTemplate"in |
|
c&&null!=c.defaultPopupTemplate)return c.defaultPopupTemplate}return null}getAttribute(a){return this.attributes?.[a]}setAttribute(a,b){if(this.attributes){const c=this.getAttribute(a);this.attributes[a]=b;this._notifyLayer("attributes",c,b,a)}else this.attributes={[a]:b},this._notifyLayer("attributes",void 0,b,a)}getObjectId(){return this.sourceLayer?"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null:null}toJSON(){var a=this.aggregateGeometries; |
|
if(null==a)a=null;else{var b={};for(const c in a){const g=a[c];g&&(b[c]=g.toJSON())}a=0!==Object.keys(b).length?b:null}return{aggregateGeometries:a,geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:k.isSerializable(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(a={}){var {geometry:b}=this;"mesh"===b?.type&&(b={origin:b.origin,transform:b.transform}, |
|
this._notifyLayer("origin-transform",b,b,a.action))}_notifyLayer(a,b,c,g){this.layer&&"graphicChanged"in this.layer&&(b={graphic:this,property:a,oldValue:b,newValue:c},"origin-transform"===a&&(b.action=g),"attributes"===a&&(b.attributeName=g),this.layer.graphicChanged(b))}_watchMeshGeometryChanges(){this.addHandles([l.when(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:a, |
|
origin:b})=>{if(this._lastMeshTransform.localMatrix!==a||this._lastMeshTransform.origin!==b)this._lastMeshTransform.localMatrix=a,this._lastMeshTransform.origin=b,this.notifyMeshTransformChanged()}),l.when(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const a=this.geometry;"mesh"===a?.type&&a.vertexSpace.origin?(this._lastMeshTransform.localMatrix=a.transform?.localMatrix,this._lastMeshTransform.origin=a.vertexSpace.origin):(this._lastMeshTransform.localMatrix= |
|
void 0,this._lastMeshTransform.origin=void 0);this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(a,b)=>a===b,sync:!0})])}};e.__decorate([f.property({value:null,json:{read:function(a){if(!a)return null;const b={};for(const c in a){const g=n.fromJSON(a[c]);g&&(b[c]=g)}return 0!==Object.keys(b).length?b:null}}})],d.prototype,"aggregateGeometries",null);e.__decorate([f.property({value:null})],d.prototype,"attributes",null);e.__decorate([f.property({value:null,types:p.geometryTypes,json:{read:n.fromJSON}})], |
|
d.prototype,"geometry",null);e.__decorate([f.property({type:Boolean})],d.prototype,"isAggregate",void 0);e.__decorate([f.property({clonable:"reference"})],d.prototype,"layer",void 0);e.__decorate([f.property({clonable:"reference"})],d.prototype,"origin",void 0);e.__decorate([f.property({type:q})],d.prototype,"popupTemplate",void 0);e.__decorate([f.property({clonable:"reference"})],d.prototype,"sourceLayer",void 0);e.__decorate([f.property({value:null,types:r.symbolTypes})],d.prototype,"symbol",null); |
|
e.__decorate([f.property({type:Boolean,value:!0})],d.prototype,"visible",null);d=h=e.__decorate([v.subclass("esri.Graphic")],d);(d||={}).generateUID=m.generateUID;return d}); |