feat(workbench): integrate operational workflows and map state
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
import type { LayerSpecification, SourceSpecification } from "maplibre-gl";
|
||||
import type { LayerSpecification, LightSpecification, SourceSpecification } from "maplibre-gl";
|
||||
import { z } from "zod";
|
||||
import { BASE_LAYER_IDS } from "./map-control-config";
|
||||
import { INTERACTIVE_HIT_LAYER_IDS } from "./layers";
|
||||
import { MAP_STYLE_TOKENS as colors } from "./map-colors";
|
||||
|
||||
export const CITY_ROOT = "/city-model";
|
||||
export const CITY_PREFIX = "fengxian-city-";
|
||||
export const CITY_BUILDING_LAYER_ID = CITY_PREFIX + "buildings";
|
||||
export const CITY_LIGHT = {
|
||||
anchor: "map",
|
||||
position: [1.5, 225, 35],
|
||||
color: "#EAF2F4",
|
||||
intensity: 0.42
|
||||
} satisfies LightSpecification;
|
||||
|
||||
export function findCitySceneInsertionLayerId(layers: readonly LayerSpecification[]) {
|
||||
const basemapLayerIds = new Set<string>(BASE_LAYER_IDS);
|
||||
return layers.find((layer) => layer.id !== "background" && !basemapLayerIds.has(layer.id))?.id;
|
||||
// Layers painted after a 3D extrusion bypass depth testing, so ground overlays stay below it.
|
||||
const hitLayerIds = new Set<string>(INTERACTIVE_HIT_LAYER_IDS);
|
||||
return layers.find((layer) => hitLayerIds.has(layer.id))?.id;
|
||||
}
|
||||
|
||||
export const cityManifestSchema = z
|
||||
@@ -44,7 +52,7 @@ export function citySources(): Record<string, SourceSpecification> {
|
||||
|
||||
export const CITY_LAYERS: LayerSpecification[] = [
|
||||
{
|
||||
id: CITY_PREFIX + "buildings",
|
||||
id: CITY_BUILDING_LAYER_ID,
|
||||
source: CITY_PREFIX + "buildings",
|
||||
"source-layer": "buildings",
|
||||
type: "fill-extrusion",
|
||||
|
||||
Reference in New Issue
Block a user