UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.68 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{result as r}from"../../../../core/asyncUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{make as a}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutSymbolLayerRenderingInfo as l}from"./Graphics3DLineCalloutSymbolLayer.js";import{Graphics3DSymbol as e}from"./Graphics3DSymbol.js";class s extends e{constructor(r,o,t){super(r,o,t),this._calloutSymbolLayer=null,this.symbol.hasVisibleCallout()&&(this._calloutSymbolLayer=a(this.symbol,o))}async doLoad(o){const a=this._calloutSymbolLayer?r(this._calloutSymbolLayer.load()):null;try{await super.doLoad(o),t(o)}catch(l){throw this._calloutSymbolLayer?.abortLoad(),l}a&&await a}destroy(){super.destroy(),this._calloutSymbolLayer=o(this._calloutSymbolLayer)}createGraphics3DGraphic(r,o){const t=super.createGraphics3DGraphic(r,o);if(null!=this._calloutSymbolLayer&&null!=t){const o=this._createCalloutGraphic(r);o&&t.setCalloutGraphic(o)}return t}globalPropertyChanged(r,o){return!!super.globalPropertyChanged(r,o)&&(!this._calloutSymbolLayer||this._calloutSymbolLayer.globalPropertyChanged(r,o,(r=>r.calloutLayer)))}updateGeometry(r,o){const t=super.updateGeometry(r,o);if(t&&this._calloutSymbolLayer){const t=r.calloutLayer;if(t)return this._calloutSymbolLayer.updateGeometry(t,o)}return t}_createCalloutGraphic(r){const o=r.renderingInfo;return r.renderingInfo=new l(o.renderer,o.symbol),this._calloutSymbolLayer.createGraphics3DGraphic(r)}}export{s as Graphics3DPointSymbol};