Graphic.js 3.18 KB
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.6/esri/copyright.txt for details.
//>>built
define("require exports ./core/tsSupport/declareExtendsHelper ./core/tsSupport/decorateHelper ./core/accessorSupport/decorators dojo/_base/lang ./core/lang ./core/JSONSupport ./PopupTemplate ./symbols/support/typeUtils ./symbols/support/jsonUtils ./geometry ./geometry/support/typeUtils".split(" "),function(v,w,g,d,c,h,k,l,m,n,p,q,r){var t=0;return function(f){function a(b,u,a,c){b=f.call(this,b,u,a,c)||this;b.layer=null;Object.defineProperty(b,"uid",{value:t++});return b}g(a,f);e=a;a.prototype.normalizeCtorArgs=
function(b,a,c,d){return b&&!b.declaredClass?b:{geometry:b,symbol:a,attributes:c,popupTemplate:d}};Object.defineProperty(a.prototype,"attributes",{set:function(b){var a=this._get("attributes");a!==b&&(this._set("attributes",b),this._notifyLayer("attributes",a,b))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"geometry",{set:function(b){var a=this._get("geometry");a!==b&&(this._set("geometry",b),this._notifyLayer("geometry",a,b))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"popupTemplate",{get:function(){return this.get("layer.popupTemplate")||null},set:function(b){void 0===b?this._clearOverride("popupTemplate"):this._override("popupTemplate",b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"symbol",{set:function(b){var a=this._get("symbol");a!==b&&(this._set("symbol",b),this._notifyLayer("symbol",a,b))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"visible",{set:function(b){var a=this._get("visible");a!==b&&(this._set("visible",
b),this._notifyLayer("visible",a,b))},enumerable:!0,configurable:!0});a.prototype.getAttribute=function(b){return this.attributes&&this.attributes[b]};a.prototype.setAttribute=function(b,a){if(this.attributes){var c=this.getAttribute(b);this.attributes[b]=a;this._notifyLayer("attributes",c,a,b)}else this.attributes=(c={},c[b]=a,c),this._notifyLayer("attributes",void 0,a,b)};a.prototype.toJSON=function(){return{geometry:this.geometry&&this.geometry.toJSON(),symbol:this.symbol&&this.symbol.toJSON(),
attributes:h.mixin({},this.attributes),popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}};a.prototype.clone=function(){return new e({attributes:k.clone(this.attributes),geometry:this.geometry&&this.geometry.clone()||null,popupTemplate:this.popupTemplate&&this.popupTemplate.clone(),symbol:this.symbol&&this.symbol.clone()||null,visible:this.visible})};a.prototype._notifyLayer=function(b,a,c,d){this.layer&&(b={graphic:this,property:b,oldValue:a,newValue:c},d&&(b.attributeName=d),this.layer.graphicChanged(b))};
d([c.property({value:null})],a.prototype,"attributes",null);d([c.property({value:null,types:r.types,json:{read:q.fromJSON}})],a.prototype,"geometry",null);d([c.property()],a.prototype,"layer",void 0);d([c.property({dependsOn:["layer.popupTemplate"],type:m})],a.prototype,"popupTemplate",null);d([c.property({value:null,types:n.types,json:{read:p.read}})],a.prototype,"symbol",null);d([c.property({value:!0,set:function(a){}})],a.prototype,"visible",null);return a=e=d([c.subclass("esri.Graphic")],a);var e}(c.declared(l))});