GraphicsLayerProxy.js
2.43 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/extendsHelper ../core/tsSupport/decorateHelper ../core/typescript dojo/_base/lang ./core/messageHandler".split(" "),function(g,h,k,d,e,f,c){return function(){function b(a,b,c){this._id=this._mapWidgetProxy=this._uniqueId=this.renderer=this.maxScale=this.minScale=this.opacity=this.visible=null}b.prototype.dojoConstructor=function(a,b,c){this._uniqueId=0;this._mapWidgetProxy=a;this._id=b;f.mixin(this,c||{})};b.prototype.setVisibility=function(a){this.visible=
a;c._sendMessage({functionName:"setGraphicsLayerVisibility",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,visible:a}})};b.prototype.setOpacity=function(a){0>a&&(a=0);1<a&&(a=1);this.opacity=a;c._sendMessage({functionName:"setGraphicsLayerOpacity",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,opacity:a}})};b.prototype.setMinScale=function(a){this.minScale=a;c._sendMessage({functionName:"setGraphicsLayerMinScale",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,
minScale:a}})};b.prototype.setMaxScale=function(a){this.maxScale=a;c._sendMessage({functionName:"setGraphicsLayerMaxScale",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,maxScale:a}})};b.prototype.setRenderer=function(a){this.renderer=a;c._sendMessage({functionName:"setGraphicsLayerRenderer",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,renderer:a?a.toJSON():void 0}})};b.prototype.removeGraphic=function(a){a.attributes&&(a=a.attributes.__id)&&c._sendMessage({functionName:"removeGraphic",
args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,graphicId:a}})};b.prototype.addOrUpdateGraphic=function(a){this.addOrUpdateGraphics([a])};b.prototype.addOrUpdateGraphics=function(a){var b=this;Array.isArray(a)&&0!==a.length&&(a=a.map(function(a){a.attributes||(a.attributes={});a.attributes.__id||(a.attributes.__id=++b._uniqueId);return a.toJSON()}),c._sendMessage({functionName:"updateGraphics",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id,graphics:a}}))};b.prototype.clear=
function(){c._sendMessage({functionName:"clearGraphics",args:{mapWidgetId:this._mapWidgetProxy.id,graphicsLayerId:this._id}})};d([e.shared("esri.opsdashboard.GraphicsLayerProxy")],b.prototype,"declaredClass",void 0);return b=d([e.subclass()],b)}()});