feat: add Jordan 3D topographic platform, Siro Map cinematic orbit studio, sun-shadow simulation, and sovereign intelligence security gating
This commit is contained in:
@@ -179,6 +179,103 @@ class IntaleqMapController {
|
||||
? CameraPosition.fromMapLibre(_raw.cameraPosition!)
|
||||
: null;
|
||||
|
||||
/// Direct access to underlying MapLibreMapController.
|
||||
mgl.MapLibreMapController get raw => _raw;
|
||||
|
||||
/// Sets camera tilt (0.0 to 60.0 degrees) smoothly.
|
||||
Future<void> setTilt(double tilt, {Duration duration = const Duration(milliseconds: 300)}) async {
|
||||
final pos = cameraPosition;
|
||||
if (pos == null) return;
|
||||
await _raw.animateCamera(
|
||||
mgl.CameraUpdate.newCameraPosition(
|
||||
mgl.CameraPosition(
|
||||
target: pos.target,
|
||||
zoom: pos.zoom,
|
||||
bearing: pos.bearing,
|
||||
tilt: tilt.clamp(0.0, 60.0),
|
||||
),
|
||||
),
|
||||
duration: duration,
|
||||
);
|
||||
}
|
||||
|
||||
/// Sets camera bearing (0.0 to 360.0 degrees) smoothly.
|
||||
Future<void> setBearing(double bearing, {Duration duration = const Duration(milliseconds: 100)}) async {
|
||||
final pos = cameraPosition;
|
||||
if (pos == null) return;
|
||||
await _raw.animateCamera(
|
||||
mgl.CameraUpdate.newCameraPosition(
|
||||
mgl.CameraPosition(
|
||||
target: pos.target,
|
||||
zoom: pos.zoom,
|
||||
bearing: (bearing % 360.0 + 360.0) % 360.0,
|
||||
tilt: pos.tilt,
|
||||
),
|
||||
),
|
||||
duration: duration,
|
||||
);
|
||||
}
|
||||
|
||||
/// Smooth cinematic orbit step by [deltaDegrees].
|
||||
Future<void> orbitStep(double deltaDegrees, {Duration duration = const Duration(milliseconds: 60)}) async {
|
||||
final pos = cameraPosition;
|
||||
if (pos == null) return;
|
||||
final newBearing = (pos.bearing + deltaDegrees) % 360.0;
|
||||
await _raw.animateCamera(
|
||||
mgl.CameraUpdate.newCameraPosition(
|
||||
mgl.CameraPosition(
|
||||
target: pos.target,
|
||||
zoom: pos.zoom,
|
||||
bearing: newBearing,
|
||||
tilt: pos.tilt,
|
||||
),
|
||||
),
|
||||
duration: duration,
|
||||
);
|
||||
}
|
||||
|
||||
/// Sets layer visibility in the active style.
|
||||
Future<void> setLayerVisibility(String layerId, bool visible) async {
|
||||
if (!_isStyleLoaded) return;
|
||||
try {
|
||||
await _raw.setLayerVisibility(layerId, visible);
|
||||
} catch (e) {
|
||||
print("⚠️ [IntaleqController] setLayerVisibility error for $layerId: $e");
|
||||
}
|
||||
}
|
||||
|
||||
/// Updates sun lighting and shadows simulation across terrain and 3D buildings.
|
||||
Future<void> updateSunSimulation({
|
||||
required double sunAzimuth,
|
||||
required String shadowColorHex,
|
||||
required String highlightColorHex,
|
||||
required String buildingColorHex,
|
||||
double buildingOpacity = 0.88,
|
||||
double hillshadeExaggeration = 0.75,
|
||||
}) async {
|
||||
if (!_isStyleLoaded) return;
|
||||
try {
|
||||
await _raw.setLayerProperties(
|
||||
'hillshading',
|
||||
mgl.HillshadeLayerProperties(
|
||||
hillshadeIlluminationDirection: sunAzimuth % 360.0,
|
||||
hillshadeShadowColor: shadowColorHex,
|
||||
hillshadeHighlightColor: highlightColorHex,
|
||||
hillshadeExaggeration: hillshadeExaggeration,
|
||||
),
|
||||
);
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
final buildingProps = mgl.FillExtrusionLayerProperties(
|
||||
fillExtrusionColor: buildingColorHex,
|
||||
fillExtrusionOpacity: buildingOpacity,
|
||||
);
|
||||
await _raw.setLayerProperties('building-3d', buildingProps);
|
||||
await _raw.setLayerProperties('building-3d-osm', buildingProps);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
/// Returns the current zoom level.
|
||||
Future<double> getZoomLevel() async => _raw.cameraPosition?.zoom ?? 14.0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user