智慧水务管理系统 - 精河县供水工程综合管理平台

Cesium3DTilePointFeature.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. import Cartographic from "../Core/Cartographic.js";
  2. import Color from "../Core/Color.js";
  3. import defined from "../Core/defined.js";
  4. import Cesium3DTileFeature from "./Cesium3DTileFeature.js";
  5. import createBillboardPointCallback from "./createBillboardPointCallback.js";
  6. /** @import Billboard from "./Billboard.js"; */
  7. /** @import Cesium3DTileContent from "./Cesium3DTileContent.js"; */
  8. /** @import Cesium3DTileset from "./Cesium3DTileset.js"; */
  9. /** @import DistanceDisplayCondition from "../Core/DistanceDisplayCondition.js"; */
  10. /** @import HorizontalOrigin from "./HorizontalOrigin.js"; */
  11. /** @import Label from "./Label.js"; */
  12. /** @import NearFarScalar from "../Core/NearFarScalar.js"; */
  13. /** @import Polyline from "./Polyline.js"; */
  14. /** @import VerticalOrigin from "./VerticalOrigin.js"; */
  15. /** @ignore */
  16. const scratchCartographic = new Cartographic();
  17. /**
  18. * A point feature of a {@link Cesium3DTileset}.
  19. * <p>
  20. * Provides access to a feature's properties stored in the tile's batch table, as well
  21. * as the ability to show/hide a feature and change its point properties
  22. * </p>
  23. * <p>
  24. * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's
  25. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  27. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  28. * </p>
  29. * <p>
  30. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  31. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  32. * </p>
  33. *
  34. * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
  35. *
  36. * @example
  37. * // On mouse over, display all the properties for a feature in the console log.
  38. * handler.setInputAction(function(movement) {
  39. * const feature = scene.pick(movement.endPosition);
  40. * if (feature instanceof Cesium.Cesium3DTilePointFeature) {
  41. * const propertyIds = feature.getPropertyIds();
  42. * const length = propertyIds.length;
  43. * for (let i = 0; i < length; ++i) {
  44. * const propertyId = propertyIds[i];
  45. * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);
  46. * }
  47. * }
  48. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  49. */
  50. class Cesium3DTilePointFeature {
  51. static defaultColor = Color.WHITE;
  52. static defaultPointOutlineColor = Color.BLACK;
  53. static defaultPointOutlineWidth = 0.0;
  54. static defaultPointSize = 8.0;
  55. /**
  56. * @param {Cesium3DTileContent} content
  57. * @param {number} batchId
  58. * @param {Billboard} billboard
  59. * @param {Label} label
  60. * @param {Polyline} polyline
  61. */
  62. constructor(content, batchId, billboard, label, polyline) {
  63. this._content = content;
  64. this._billboard = billboard;
  65. this._label = label;
  66. this._polyline = polyline;
  67. this._batchId = batchId;
  68. this._billboardImage = undefined;
  69. this._billboardColor = undefined;
  70. this._billboardOutlineColor = undefined;
  71. this._billboardOutlineWidth = undefined;
  72. this._billboardSize = undefined;
  73. this._pointSize = undefined;
  74. this._color = undefined;
  75. this._pointSize = undefined;
  76. this._pointOutlineColor = undefined;
  77. this._pointOutlineWidth = undefined;
  78. this._heightOffset = undefined;
  79. this._pickIds = new Array(3);
  80. setBillboardImage(this);
  81. }
  82. /**
  83. * Gets or sets if the feature will be shown. This is set for all features
  84. * when a style's show is evaluated.
  85. *
  86. * @type {boolean}
  87. *
  88. * @default true
  89. */
  90. get show() {
  91. return this._label.show;
  92. }
  93. set show(value) {
  94. this._label.show = value;
  95. this._billboard.show = value;
  96. this._polyline.show = value;
  97. }
  98. /**
  99. * Gets or sets the color of the point of this feature.
  100. * <p>
  101. * Only applied when <code>image</code> is <code>undefined</code>.
  102. * </p>
  103. *
  104. * @type {Color}
  105. */
  106. get color() {
  107. return this._color;
  108. }
  109. set color(value) {
  110. this._color = Color.clone(value, this._color);
  111. setBillboardImage(this);
  112. }
  113. /**
  114. * Gets or sets the point size of this feature.
  115. * <p>
  116. * Only applied when <code>image</code> is <code>undefined</code>.
  117. * </p>
  118. *
  119. * @type {number}
  120. */
  121. get pointSize() {
  122. return this._pointSize;
  123. }
  124. set pointSize(value) {
  125. this._pointSize = value;
  126. setBillboardImage(this);
  127. }
  128. /**
  129. * Gets or sets the point outline color of this feature.
  130. * <p>
  131. * Only applied when <code>image</code> is <code>undefined</code>.
  132. * </p>
  133. *
  134. * @type {Color}
  135. */
  136. get pointOutlineColor() {
  137. return this._pointOutlineColor;
  138. }
  139. set pointOutlineColor(value) {
  140. this._pointOutlineColor = Color.clone(value, this._pointOutlineColor);
  141. setBillboardImage(this);
  142. }
  143. /**
  144. * Gets or sets the point outline width in pixels of this feature.
  145. * <p>
  146. * Only applied when <code>image</code> is <code>undefined</code>.
  147. * </p>
  148. *
  149. * @type {number}
  150. */
  151. get pointOutlineWidth() {
  152. return this._pointOutlineWidth;
  153. }
  154. set pointOutlineWidth(value) {
  155. this._pointOutlineWidth = value;
  156. setBillboardImage(this);
  157. }
  158. /**
  159. * Gets or sets the label color of this feature.
  160. * <p>
  161. * The color will be applied to the label if <code>labelText</code> is defined.
  162. * </p>
  163. *
  164. * @type {Color}
  165. */
  166. get labelColor() {
  167. return this._label.fillColor;
  168. }
  169. set labelColor(value) {
  170. this._label.fillColor = value;
  171. this._polyline.show = this._label.show && value.alpha > 0.0;
  172. }
  173. /**
  174. * Gets or sets the label outline color of this feature.
  175. * <p>
  176. * The outline color will be applied to the label if <code>labelText</code> is defined.
  177. * </p>
  178. *
  179. * @type {Color}
  180. */
  181. get labelOutlineColor() {
  182. return this._label.outlineColor;
  183. }
  184. set labelOutlineColor(value) {
  185. this._label.outlineColor = value;
  186. }
  187. /**
  188. * Gets or sets the outline width in pixels of this feature.
  189. * <p>
  190. * The outline width will be applied to the point if <code>labelText</code> is defined.
  191. * </p>
  192. *
  193. * @type {number}
  194. */
  195. get labelOutlineWidth() {
  196. return this._label.outlineWidth;
  197. }
  198. set labelOutlineWidth(value) {
  199. this._label.outlineWidth = value;
  200. }
  201. /**
  202. * Gets or sets the font of this feature.
  203. * <p>
  204. * Only applied when the <code>labelText</code> is defined.
  205. * </p>
  206. *
  207. * @type {string}
  208. */
  209. get font() {
  210. return this._label.font;
  211. }
  212. set font(value) {
  213. this._label.font = value;
  214. }
  215. /**
  216. * Gets or sets the fill and outline style of this feature.
  217. * <p>
  218. * Only applied when <code>labelText</code> is defined.
  219. * </p>
  220. *
  221. * @type {LabelStyle}
  222. */
  223. get labelStyle() {
  224. return this._label.style;
  225. }
  226. set labelStyle(value) {
  227. this._label.style = value;
  228. }
  229. /**
  230. * Gets or sets the text for this feature.
  231. *
  232. * @type {string}
  233. */
  234. get labelText() {
  235. return this._label.text;
  236. }
  237. set labelText(value) {
  238. if (!defined(value)) {
  239. value = "";
  240. }
  241. this._label.text = value;
  242. }
  243. /**
  244. * Gets or sets the background color of the text for this feature.
  245. * <p>
  246. * Only applied when <code>labelText</code> is defined.
  247. * </p>
  248. *
  249. * @type {Color}
  250. */
  251. get backgroundColor() {
  252. return this._label.backgroundColor;
  253. }
  254. set backgroundColor(value) {
  255. this._label.backgroundColor = value;
  256. }
  257. /**
  258. * Gets or sets the background padding of the text for this feature.
  259. * <p>
  260. * Only applied when <code>labelText</code> is defined.
  261. * </p>
  262. *
  263. * @type {Cartesian2}
  264. */
  265. get backgroundPadding() {
  266. return this._label.backgroundPadding;
  267. }
  268. set backgroundPadding(value) {
  269. this._label.backgroundPadding = value;
  270. }
  271. /**
  272. * Gets or sets whether to display the background of the text for this feature.
  273. * <p>
  274. * Only applied when <code>labelText</code> is defined.
  275. * </p>
  276. *
  277. * @type {boolean}
  278. */
  279. get backgroundEnabled() {
  280. return this._label.showBackground;
  281. }
  282. set backgroundEnabled(value) {
  283. this._label.showBackground = value;
  284. }
  285. /**
  286. * Gets or sets the near and far scaling properties for this feature.
  287. *
  288. * @type {NearFarScalar}
  289. */
  290. get scaleByDistance() {
  291. return this._label.scaleByDistance;
  292. }
  293. set scaleByDistance(value) {
  294. this._label.scaleByDistance = value;
  295. this._billboard.scaleByDistance = value;
  296. }
  297. /**
  298. * Gets or sets the near and far translucency properties for this feature.
  299. *
  300. * @type {NearFarScalar}
  301. */
  302. get translucencyByDistance() {
  303. return this._label.translucencyByDistance;
  304. }
  305. set translucencyByDistance(value) {
  306. this._label.translucencyByDistance = value;
  307. this._billboard.translucencyByDistance = value;
  308. }
  309. /**
  310. * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
  311. *
  312. * @type {DistanceDisplayCondition}
  313. */
  314. get distanceDisplayCondition() {
  315. return this._label.distanceDisplayCondition;
  316. }
  317. set distanceDisplayCondition(value) {
  318. this._label.distanceDisplayCondition = value;
  319. this._polyline.distanceDisplayCondition = value;
  320. this._billboard.distanceDisplayCondition = value;
  321. }
  322. /**
  323. * Gets or sets the height offset in meters of this feature.
  324. *
  325. * @type {number}
  326. */
  327. get heightOffset() {
  328. return this._heightOffset;
  329. }
  330. set heightOffset(value) {
  331. const offset = this._heightOffset ?? 0.0;
  332. const ellipsoid = this._content.tileset.ellipsoid;
  333. const cart = ellipsoid.cartesianToCartographic(
  334. this._billboard.position,
  335. scratchCartographic,
  336. );
  337. cart.height = cart.height - offset + value;
  338. const newPosition = ellipsoid.cartographicToCartesian(cart);
  339. this._billboard.position = newPosition;
  340. this._label.position = this._billboard.position;
  341. this._polyline.positions = [this._polyline.positions[0], newPosition];
  342. this._heightOffset = value;
  343. }
  344. /**
  345. * Gets or sets whether the anchor line is displayed.
  346. * <p>
  347. * Only applied when <code>heightOffset</code> is defined.
  348. * </p>
  349. *
  350. * @type {boolean}
  351. */
  352. get anchorLineEnabled() {
  353. return this._polyline.show;
  354. }
  355. set anchorLineEnabled(value) {
  356. this._polyline.show = value;
  357. }
  358. /**
  359. * Gets or sets the color for the anchor line.
  360. * <p>
  361. * Only applied when <code>heightOffset</code> is defined.
  362. * </p>
  363. *
  364. * @type {Color}
  365. */
  366. get anchorLineColor() {
  367. return this._polyline.material.uniforms.color;
  368. }
  369. set anchorLineColor(value) {
  370. this._polyline.material.uniforms.color = Color.clone(
  371. value,
  372. this._polyline.material.uniforms.color,
  373. );
  374. }
  375. /**
  376. * Gets or sets the image of this feature.
  377. *
  378. * @type {string}
  379. */
  380. get image() {
  381. return this._billboardImage;
  382. }
  383. set image(value) {
  384. const imageChanged = this._billboardImage !== value;
  385. this._billboardImage = value;
  386. if (imageChanged) {
  387. setBillboardImage(this);
  388. }
  389. }
  390. /**
  391. * Gets or sets the distance where depth testing will be disabled.
  392. *
  393. * @type {number}
  394. */
  395. get disableDepthTestDistance() {
  396. return this._label.disableDepthTestDistance;
  397. }
  398. set disableDepthTestDistance(value) {
  399. this._label.disableDepthTestDistance = value;
  400. this._billboard.disableDepthTestDistance = value;
  401. }
  402. /**
  403. * Gets or sets the horizontal origin of this point, which determines if the point is
  404. * to the left, center, or right of its anchor position.
  405. *
  406. * @type {HorizontalOrigin}
  407. */
  408. get horizontalOrigin() {
  409. return this._billboard.horizontalOrigin;
  410. }
  411. set horizontalOrigin(value) {
  412. this._billboard.horizontalOrigin = value;
  413. }
  414. /**
  415. * Gets or sets the vertical origin of this point, which determines if the point is
  416. * to the bottom, center, or top of its anchor position.
  417. *
  418. * @type {VerticalOrigin}
  419. */
  420. get verticalOrigin() {
  421. return this._billboard.verticalOrigin;
  422. }
  423. set verticalOrigin(value) {
  424. this._billboard.verticalOrigin = value;
  425. }
  426. /**
  427. * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
  428. * to the left, center, or right of its anchor position.
  429. *
  430. * @type {HorizontalOrigin}
  431. */
  432. get labelHorizontalOrigin() {
  433. return this._label.horizontalOrigin;
  434. }
  435. set labelHorizontalOrigin(value) {
  436. this._label.horizontalOrigin = value;
  437. }
  438. /**
  439. * Get or sets the vertical origin of this point's text, which determines if the point's text is
  440. * to the bottom, center, top, or baseline of it's anchor point.
  441. *
  442. * @type {VerticalOrigin}
  443. */
  444. get labelVerticalOrigin() {
  445. return this._label.verticalOrigin;
  446. }
  447. set labelVerticalOrigin(value) {
  448. this._label.verticalOrigin = value;
  449. }
  450. /**
  451. * Gets the content of the tile containing the feature.
  452. *
  453. * @type {Cesium3DTileContent}
  454. *
  455. * @readonly
  456. * @private
  457. */
  458. get content() {
  459. return this._content;
  460. }
  461. /**
  462. * Gets the tileset containing the feature.
  463. *
  464. * @type {Cesium3DTileset}
  465. *
  466. * @readonly
  467. */
  468. get tileset() {
  469. return this._content.tileset;
  470. }
  471. /**
  472. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  473. * the tileset containing the feature.
  474. *
  475. * @type {Cesium3DTileset}
  476. *
  477. * @readonly
  478. */
  479. get primitive() {
  480. return this._content.tileset;
  481. }
  482. /**
  483. * @private
  484. */
  485. get pickIds() {
  486. const ids = this._pickIds;
  487. ids[0] = this._billboard.pickId;
  488. ids[1] = this._label.pickId;
  489. ids[2] = this._polyline.pickId;
  490. return ids;
  491. }
  492. /**
  493. * Returns whether the feature contains this property. This includes properties from this feature's
  494. * class and inherited classes when using a batch table hierarchy.
  495. *
  496. * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}
  497. *
  498. * @param {string} name The case-sensitive name of the property.
  499. * @returns {boolean} Whether the feature contains this property.
  500. */
  501. hasProperty(name) {
  502. return this._content.batchTable.hasProperty(this._batchId, name);
  503. }
  504. /**
  505. * Returns an array of property IDs for the feature. This includes properties from this feature's
  506. * class and inherited classes when using a batch table hierarchy.
  507. *
  508. * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}
  509. *
  510. * @param {string[]} [results] An array into which to store the results.
  511. * @returns {string[]} The IDs of the feature's properties.
  512. */
  513. getPropertyIds(results) {
  514. return this._content.batchTable.getPropertyIds(this._batchId, results);
  515. }
  516. /**
  517. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  518. * class and inherited classes when using a batch table hierarchy.
  519. *
  520. * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}
  521. *
  522. * @param {string} name The case-sensitive name of the property.
  523. * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.
  524. *
  525. * @example
  526. * // Display all the properties for a feature in the console log.
  527. * const propertyIds = feature.getPropertyIds();
  528. * const length = propertyIds.length;
  529. * for (let i = 0; i < length; ++i) {
  530. * const propertyId = propertyIds[i];
  531. * console.log(`{propertyId} : ${feature.getProperty(propertyId)}`);
  532. * }
  533. */
  534. getProperty(name) {
  535. return this._content.batchTable.getProperty(this._batchId, name);
  536. }
  537. /**
  538. * Returns a copy of the value of the feature's property with the given name.
  539. * If the feature is contained within a tileset that has metadata (3D Tiles 1.1)
  540. * or uses the <code>3DTILES_metadata</code> extension, tileset, group and tile metadata is
  541. * inherited.
  542. * <p>
  543. * To resolve name conflicts, this method resolves names from most specific to
  544. * least specific by metadata granularity in the order: feature, tile, group,
  545. * tileset. Within each granularity, semantics are resolved first, then other
  546. * properties.
  547. * </p>
  548. * @param {string} name The case-sensitive name of the property.
  549. * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.
  550. * @private
  551. * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
  552. */
  553. getPropertyInherited(name) {
  554. return Cesium3DTileFeature.getPropertyInherited(
  555. this._content,
  556. this._batchId,
  557. name,
  558. );
  559. }
  560. /**
  561. * Sets the value of the feature's property with the given name.
  562. * <p>
  563. * If a property with the given name doesn't exist, it is created.
  564. * </p>
  565. *
  566. * @param {string} name The case-sensitive name of the property.
  567. * @param {*} value The value of the property that will be copied.
  568. *
  569. * @exception {DeveloperError} Inherited batch table hierarchy property is read only.
  570. *
  571. * @example
  572. * const height = feature.getProperty('Height'); // e.g., the height of a building
  573. *
  574. * @example
  575. * const name = 'clicked';
  576. * if (feature.getProperty(name)) {
  577. * console.log('already clicked');
  578. * } else {
  579. * feature.setProperty(name, true);
  580. * console.log('first click');
  581. * }
  582. */
  583. setProperty(name, value) {
  584. this._content.batchTable.setProperty(this._batchId, name, value);
  585. // PERFORMANCE_IDEA: Probably overkill, but maybe only mark the tile dirty if the
  586. // property is in one of the style's expressions or - if it can be done quickly -
  587. // if the new property value changed the result of an expression.
  588. this._content.featurePropertiesDirty = true;
  589. }
  590. /**
  591. * Returns whether the feature's class name equals <code>className</code>. Unlike {@link Cesium3DTilePointFeature#isClass}
  592. * this function only checks the feature's exact class and not inherited classes.
  593. * <p>
  594. * This function returns <code>false</code> if no batch table hierarchy is present.
  595. * </p>
  596. *
  597. * @param {string} className The name to check against.
  598. * @returns {boolean} Whether the feature's class name equals <code>className</code>
  599. *
  600. * @private
  601. */
  602. isExactClass(className) {
  603. return this._content.batchTable.isExactClass(this._batchId, className);
  604. }
  605. /**
  606. * Returns whether the feature's class or any inherited classes are named <code>className</code>.
  607. * <p>
  608. * This function returns <code>false</code> if no batch table hierarchy is present.
  609. * </p>
  610. *
  611. * @param {string} className The name to check against.
  612. * @returns {boolean} Whether the feature's class or inherited classes are named <code>className</code>
  613. *
  614. * @private
  615. */
  616. isClass(className) {
  617. return this._content.batchTable.isClass(this._batchId, className);
  618. }
  619. /**
  620. * Returns the feature's class name.
  621. * <p>
  622. * This function returns <code>undefined</code> if no batch table hierarchy is present.
  623. * </p>
  624. *
  625. * @returns {string} The feature's class name.
  626. *
  627. * @private
  628. */
  629. getExactClassName() {
  630. return this._content.batchTable.getExactClassName(this._batchId);
  631. }
  632. }
  633. /**
  634. * @param {Cesium3DTilePointFeature} feature
  635. * @ignore
  636. */
  637. function setBillboardImage(feature) {
  638. const b = feature._billboard;
  639. if (defined(feature._billboardImage) && feature._billboardImage !== b.image) {
  640. b.image = feature._billboardImage;
  641. return;
  642. }
  643. if (defined(feature._billboardImage)) {
  644. return;
  645. }
  646. const newColor = feature._color ?? Cesium3DTilePointFeature.defaultColor;
  647. const newOutlineColor =
  648. feature._pointOutlineColor ??
  649. Cesium3DTilePointFeature.defaultPointOutlineColor;
  650. const newOutlineWidth =
  651. feature._pointOutlineWidth ??
  652. Cesium3DTilePointFeature.defaultPointOutlineWidth;
  653. const newPointSize =
  654. feature._pointSize ?? Cesium3DTilePointFeature.defaultPointSize;
  655. const currentColor = feature._billboardColor;
  656. const currentOutlineColor = feature._billboardOutlineColor;
  657. const currentOutlineWidth = feature._billboardOutlineWidth;
  658. const currentPointSize = feature._billboardSize;
  659. if (
  660. Color.equals(newColor, currentColor) &&
  661. Color.equals(newOutlineColor, currentOutlineColor) &&
  662. newOutlineWidth === currentOutlineWidth &&
  663. newPointSize === currentPointSize
  664. ) {
  665. return;
  666. }
  667. feature._billboardColor = Color.clone(newColor, feature._billboardColor);
  668. feature._billboardOutlineColor = Color.clone(
  669. newOutlineColor,
  670. feature._billboardOutlineColor,
  671. );
  672. feature._billboardOutlineWidth = newOutlineWidth;
  673. feature._billboardSize = newPointSize;
  674. const centerAlpha = newColor.alpha;
  675. const cssColor = newColor.toCssColorString();
  676. const cssOutlineColor = newOutlineColor.toCssColorString();
  677. const textureId = JSON.stringify([
  678. cssColor,
  679. newPointSize,
  680. cssOutlineColor,
  681. newOutlineWidth,
  682. ]);
  683. b.setImage(
  684. textureId,
  685. createBillboardPointCallback(
  686. centerAlpha,
  687. cssColor,
  688. cssOutlineColor,
  689. newOutlineWidth,
  690. newPointSize,
  691. ),
  692. );
  693. }
  694. export default Cesium3DTilePointFeature;