diff --git a/src/circle/CesiumCircleOverlayRenderer.ts b/src/circle/CesiumCircleOverlayRenderer.ts index 0568984..c2bf0ac 100644 --- a/src/circle/CesiumCircleOverlayRenderer.ts +++ b/src/circle/CesiumCircleOverlayRenderer.ts @@ -12,7 +12,7 @@ import { CesiumMapViewHolder } from '../CesiumMapViewHolder'; import { toCesiumColor } from '../color'; import { toCartesian3 } from '../helpers'; import { cesiumEntityId } from '../entityId'; -import { CIRCLE_Z_BASE } from '../zOrder'; +import { groundZIndex } from '../zOrder'; export class CesiumCircleOverlayRenderer implements CircleOverlayRenderer { constructor(readonly holder: CesiumMapViewHolder) {} @@ -29,7 +29,7 @@ export class CesiumCircleOverlayRenderer implements CircleOverlayRenderer { constructor(readonly holder: CesiumMapViewHolder) { } @@ -30,7 +31,10 @@ export class CesiumGroundImageOverlayRenderer implements GroundImageOverlayRende // transparent pixels; `color`'s alpha only scales the overall opacity, not // the per-pixel alpha, so both are needed. material: new ImageMaterialProperty({ image: state.imageUrl, color: Color.WHITE.withAlpha(state.opacity), transparent: true }), - height: 0, + // Ground geometry (no height) so Cesium orders it by zIndex with the polygons, circles and + // polylines: under them, in the ground-image band. With `height: 0` it was an ordinary + // primitive drawn after every ground primitive, i.e. over the polygons. + zIndex: groundZIndex('groundImage', 0), }); } } diff --git a/src/polygon/CesiumPolygonOverlayRenderer.ts b/src/polygon/CesiumPolygonOverlayRenderer.ts index 8ef4446..51596fa 100644 --- a/src/polygon/CesiumPolygonOverlayRenderer.ts +++ b/src/polygon/CesiumPolygonOverlayRenderer.ts @@ -4,7 +4,7 @@ import { CesiumMapViewHolder } from '../CesiumMapViewHolder'; import { toCesiumColor } from '../color'; import { pointsToDegrees } from '../helpers'; import { cesiumEntityId } from '../entityId'; -import { POLYGON_Z_BASE } from '../zOrder'; +import { groundZIndex } from '../zOrder'; // Same segment length react-for-arcgis uses for polygons: coarser than // polylines so world-scale rings don't densify into huge geometries. @@ -60,7 +60,7 @@ export class CesiumPolygonOverlayRenderer implements PolygonOverlayRenderer 0 ? new PolylineGraphics({ @@ -73,7 +73,7 @@ export class CesiumPolygonOverlayRenderer implements PolygonOverlayRenderer { constructor(readonly holder: CesiumMapViewHolder) {} @@ -33,7 +33,7 @@ export class CesiumPolylineOverlayRenderer implements PolylineOverlayRenderer