feat: extend map targeting and overlay controls
Support batch feature targeting and clear map highlights and overlays from the More panel. Remove misleading action chevrons and unused configuration export entries. Validated the isolated patch with lint, typecheck, 36 focused tests and 5 browser cases using mocked data.
This commit is contained in:
@@ -1108,25 +1108,16 @@ function MapWorkbenchContent({
|
||||
}
|
||||
}
|
||||
|
||||
function handleExportConfig() {
|
||||
const config = {
|
||||
exportedAt: new Date().toISOString(),
|
||||
activeBaseLayerId,
|
||||
layerVisibility,
|
||||
activeToolId,
|
||||
activeMeasureModeId,
|
||||
activeMeasureUnitId
|
||||
};
|
||||
const blob = new Blob([JSON.stringify(config, null, 2)], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = "supply-network-map-config.json";
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
showMapNotice({ tone: "success", message: "当前地图配置已导出。" });
|
||||
function handleClearMapOverlays() {
|
||||
mapController.clearOverlays();
|
||||
presentation.clearMapOverlays();
|
||||
handleClearSelection();
|
||||
dispatchWorkspaceContext({ type: "clear-spatial-feature" });
|
||||
measurement.clear();
|
||||
drawing.clear();
|
||||
geocoding.clear();
|
||||
handleToggleLayer("simulation", false);
|
||||
showMapNotice({ tone: "success", message: "已清空所有高亮和覆盖层。" });
|
||||
}
|
||||
|
||||
const toolbarPanelProps: ToolbarPanelProps = {
|
||||
@@ -1167,7 +1158,7 @@ function MapWorkbenchContent({
|
||||
onRefreshTiles: handleRefreshTiles,
|
||||
onShowDataStatus: handleShowDataStatus,
|
||||
onShowShortcuts: handleShowShortcuts,
|
||||
onExportConfig: handleExportConfig
|
||||
onClearMapOverlays: handleClearMapOverlays
|
||||
};
|
||||
const selectedOperationalEvent =
|
||||
operationalEvents.find((event) => event.id === workspaceContext.operational.selectedEventId) ??
|
||||
@@ -1377,7 +1368,6 @@ function MapWorkbenchContent({
|
||||
onShowDataStatus={handleShowDataStatus}
|
||||
onRefreshTiles={handleRefreshTiles}
|
||||
onShowShortcuts={handleShowShortcuts}
|
||||
onExportConfig={handleExportConfig}
|
||||
onLogout={onLogout}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user