@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.61 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
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){const o=super.updateGeometry(r);if(o&&this._calloutSymbolLayer){const o=r.calloutLayer;if(o)return this._calloutSymbolLayer.updateGeometry?.(r.graphic,o)??!1}return o}_createCalloutGraphic(r){const o=r.renderingInfo;return r.renderingInfo=new l(o.renderer,o.symbol),this._calloutSymbolLayer.createGraphics3DGraphic(r)}}export{s as Graphics3DPointSymbol};