bruce-cesium 6.9.5 → 6.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-cesium.es5.js +53 -3
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +51 -1
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine-polygon.js +14 -0
- package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +36 -0
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/cesium-entity-styler.d.ts +6 -0
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -1724,6 +1724,9 @@
|
|
|
1724
1724
|
function getDefaultTextureImage(graphic) {
|
|
1725
1725
|
return graphic[STORE_TEXTURE_IMAGE_KEY];
|
|
1726
1726
|
}
|
|
1727
|
+
function clearDefaultTextureImage(graphic) {
|
|
1728
|
+
delete graphic[STORE_TEXTURE_IMAGE_KEY];
|
|
1729
|
+
}
|
|
1727
1730
|
/**
|
|
1728
1731
|
* Returns a color property from a graphic.
|
|
1729
1732
|
* This will turn materials properties into colors before returning them.
|
|
@@ -2256,6 +2259,39 @@
|
|
|
2256
2259
|
}
|
|
2257
2260
|
}
|
|
2258
2261
|
CesiumEntityStyler.SetDefaultColor = SetDefaultColor;
|
|
2262
|
+
/*
|
|
2263
|
+
* Updates (or clears) the baked default texture image for a graphic's polygon parts.
|
|
2264
|
+
*/
|
|
2265
|
+
function SetDefaultTextureImage(params) {
|
|
2266
|
+
const { viewer, entity, image, requestRender } = params;
|
|
2267
|
+
if (!entity) {
|
|
2268
|
+
return;
|
|
2269
|
+
}
|
|
2270
|
+
const parts = exports.EntityUtils.GatherEntity({
|
|
2271
|
+
entity: entity,
|
|
2272
|
+
selectable: true
|
|
2273
|
+
});
|
|
2274
|
+
for (let i = 0; i < parts.length; i++) {
|
|
2275
|
+
const part = parts[i];
|
|
2276
|
+
if (!isAlive(viewer, part)) {
|
|
2277
|
+
continue;
|
|
2278
|
+
}
|
|
2279
|
+
// Texture fill only applies to polygons.
|
|
2280
|
+
if (part instanceof Cesium.Entity && part.polygon) {
|
|
2281
|
+
if (image == null) {
|
|
2282
|
+
clearDefaultTextureImage(part.polygon);
|
|
2283
|
+
}
|
|
2284
|
+
else {
|
|
2285
|
+
storeDefaultTextureImage(part.polygon, image);
|
|
2286
|
+
}
|
|
2287
|
+
refreshColor(viewer, part.polygon, getAppliedOpacity(part.polygon));
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
if (requestRender != false) {
|
|
2291
|
+
viewer.scene.requestRender();
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
CesiumEntityStyler.SetDefaultTextureImage = SetDefaultTextureImage;
|
|
2259
2295
|
/**
|
|
2260
2296
|
* Updates the opacity of the graphic.
|
|
2261
2297
|
* This will multiply against the current colour's opacity before applying.
|
|
@@ -36754,9 +36790,23 @@
|
|
|
36754
36790
|
cEntity.polygon.classificationType = new Cesium.ConstantProperty(classification);
|
|
36755
36791
|
// TODO: animate the texture!
|
|
36756
36792
|
if (textureDataUri) {
|
|
36793
|
+
// Rebaking texture to ensure we don't revert to the wrong one later.
|
|
36757
36794
|
cEntity.polygon.material = fillMaterial;
|
|
36795
|
+
exports.CesiumEntityStyler.SetDefaultTextureImage({
|
|
36796
|
+
entity: cEntity,
|
|
36797
|
+
image: textureDataUri,
|
|
36798
|
+
viewer: params.viewer,
|
|
36799
|
+
requestRender: false
|
|
36800
|
+
});
|
|
36758
36801
|
}
|
|
36759
36802
|
else {
|
|
36803
|
+
// Clear any baked texture from a previous textured style so reverting to default uses the colour fill.
|
|
36804
|
+
exports.CesiumEntityStyler.SetDefaultTextureImage({
|
|
36805
|
+
entity: cEntity,
|
|
36806
|
+
image: null,
|
|
36807
|
+
viewer: params.viewer,
|
|
36808
|
+
requestRender: false
|
|
36809
|
+
});
|
|
36760
36810
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
36761
36811
|
// WARNING: polygon does not support animation (yet?).
|
|
36762
36812
|
exports.CesiumEntityStyler.SetDefaultColor({
|
|
@@ -38469,7 +38519,7 @@
|
|
|
38469
38519
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
38470
38520
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
38471
38521
|
|
|
38472
|
-
const VERSION = "6.9.
|
|
38522
|
+
const VERSION = "6.9.6";
|
|
38473
38523
|
/**
|
|
38474
38524
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
38475
38525
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|