Files
MapStudio/index.html
dearsky a36b14dc45 上传文件至「/」
将所有图层处理为瓦片,并新增瓦片管理能力
2026-11-09 00:01:21 +08:00

846 lines
43 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="地图、等高线、国铁地铁、地形图与经纬网格的低成本在线地图原型。">
<script>
(function () {
var path = window.location.pathname;
var slash = path.lastIndexOf("/");
var lastSegment = path.slice(slash + 1);
var basePath;
if (path.endsWith("/")) {
basePath = path;
} else if (lastSegment.includes(".")) {
basePath = path.slice(0, slash + 1);
} else {
basePath = path + "/";
}
var base = document.createElement("base");
base.href = basePath;
document.head.appendChild(base);
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register(new URL("sw.js?v=20261108-9", document.baseURI).href, {
updateViaCache: "none"
})
.catch(function () {});
}
[
"vendor/leaflet/leaflet.css?v=1.9.4",
"styles.css?v=20261108-54"
].forEach(function (href) {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = new URL(href, document.baseURI).href;
document.head.appendChild(link);
});
})();
</script>
<title>Map Studio|在线地图工作台</title>
<link rel="icon" href="data:,">
</head>
<body>
<div class="app-shell">
<header class="topbar">
<div class="brand">
<div class="brand-mark" aria-hidden="true">
<svg viewBox="0 0 32 32"><path d="M5 8.5 12 5l8 3.5L27 5v18.5L20 27l-8-3.5L5 27V8.5Z"/><path d="M12 5v18.5M20 8.5V27"/></svg>
</div>
<div>
<strong>Map Studio</strong>
<span>在线地图工作台</span>
</div>
</div>
<label class="coordinate-system-switcher" for="coordinateSystemSelect">
<span>坐标系</span>
<select id="coordinateSystemSelect" aria-label="切换坐标显示系统" title="切换实时坐标、节点位置和出图坐标所采用的坐标系">
<option value="wgs84" selected>WGS84</option>
<option value="gcj02">GCJ02</option>
<option value="webmercator">Web墨卡托</option>
<option value="beijing54">北京54坐标系</option>
<option value="xian80">西安80坐标系</option>
<option value="cgcs2000">CGCS2000</option>
<option value="bd09">BD09</option>
<option value="nad">NAD27 / NAD83</option>
<option value="etrs89">ETRS89</option>
<option value="osgb36">OSGB36</option>
</select>
</label>
<div class="topbar-status">
<span class="status-dot"></span>
<span id="statusText">地图已就绪</span>
</div>
<nav class="topbar-actions" aria-label="主要操作">
<button class="icon-button" id="toggleSidebar" type="button" aria-label="显示或隐藏图层面板">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16M4 12h16M4 19h16"/></svg>
</button>
<button class="secondary-button" id="locateButton" type="button">
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3"/></svg>
定位
</button>
<button class="secondary-button" id="printModeButton" type="button">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9V3h12v6M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><path d="M6 14h12v7H6z"/></svg>
制图模式
</button>
<a class="primary-button" href="api-comparison.html">
成本对比
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg>
</a>
</nav>
</header>
<div class="usage-notice" role="note" aria-label="内部使用与地图合规提示">
<div class="usage-notice-copy">
<strong>仅限内部使用</strong>
<span>应当严格执行《地图管理条例》有关规定;编制的地图如需向社会公开的,还应当依法履行地图审核程序。</span>
</div>
<div class="usage-notice-actions">
<a href="regulations.html">查看有关规定</a>
<a class="usage-notice-report" href="mailto:serveradmin@mail.dearsky.top">报告:serveradmin@mail.dearsky.top</a>
</div>
</div>
<aside class="sidebar" id="sidebar">
<details class="panel fold-panel" open>
<summary class="section-heading">
<div>
<span class="eyebrow">BASE MAP</span>
<h2>底图与地形</h2>
</div>
</summary>
<div class="base-grid" id="baseMapButtons">
<button class="base-card active" type="button" data-base="clean">
<span class="base-preview preview-clean"></span>
<span><strong>简洁底图</strong><small>无内置铁路线条</small></span>
</button>
<button class="base-card" type="button" data-base="standard">
<span class="base-preview preview-standard"></span>
<span><strong>标准地图</strong><small>道路与地名</small></span>
</button>
<button class="base-card" type="button" data-base="satellite">
<span class="base-preview preview-satellite"></span>
<span><strong>卫星影像</strong><small>高分辨率影像</small></span>
</button>
<button class="base-card" type="button" data-base="topo">
<span class="base-preview preview-topo"></span>
<span><strong>地形图</strong><small>Esri Topo · 服务端缓存</small></span>
</button>
<button class="base-card" type="button" data-base="tdt-vec">
<span class="base-preview preview-standard"></span>
<span><strong>天地图矢量</strong><small>仅显示已下载瓦片</small></span>
</button>
<button class="base-card" type="button" data-base="tdt-ter">
<span class="base-preview preview-relief"></span>
<span><strong>天地图地形</strong><small>仅显示已下载瓦片</small></span>
</button>
<button class="base-card" type="button" data-base="tdt-img">
<span class="base-preview preview-satellite"></span>
<span><strong>天地图影像</strong><small>仅显示已下载瓦片</small></span>
</button>
</div>
<label class="switch-row hillshade-overlay-row">
<span class="switch-copy">
<strong>叠加地形晕渲</strong>
<small>DEM 山体阴影,可叠加在任意底图上</small>
</span>
<input type="checkbox" id="hillshadeToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<details class="options-fold" id="tiandituOverlayOptions">
<summary>天地图注记与行政区划</summary>
<div class="terrain-feature-controls">
<label class="switch-row compact-switch-row">
<span class="switch-copy"><strong>矢量注记</strong><small>cva:地名与兴趣点</small></span>
<input type="checkbox" id="tdtVectorLabelToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<label class="switch-row compact-switch-row">
<span class="switch-copy"><strong>地形注记</strong><small>cta:地名、道路与地形线索</small></span>
<input type="checkbox" id="tdtTerrainLabelToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<label class="switch-row compact-switch-row">
<span class="switch-copy"><strong>影像注记</strong><small>cia:影像用道路与地名</small></span>
<input type="checkbox" id="tdtImageryLabelToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="field-hint">三种注记互斥显示;选择天地图底图时会自动匹配对应注记。</p>
<label class="switch-row compact-switch-row">
<span class="switch-copy"><strong>行政区划</strong><small>国界、省界、地级界、县级界</small></span>
<input type="checkbox" id="tdtBoundaryToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<div class="boundary-color-heading">
<strong>行政区划颜色</strong>
<span>按边界级别设置</span>
</div>
<div class="boundary-colors">
<label>国/省界
<input id="boundaryHighColor" type="color" value="#8f2e1f">
</label>
<label>地级界
<input id="boundaryMiddleColor" type="color" value="#bd4f2e">
</label>
<label>县级界
<input id="boundaryLocalColor" type="color" value="#d47a2c">
</label>
</div>
<p class="field-hint" id="boundaryStatus">开启后加载当前视窗的省、地级和县级行政边界,并使用本地缓存。</p>
</div>
</details>
</details>
<details class="panel fold-panel" open>
<summary class="section-heading">
<div>
<span class="eyebrow">OVERLAYS</span>
<h2>专题图层</h2>
</div>
<button class="text-button" id="resetLayers" type="button">重置</button>
</summary>
<label class="switch-row">
<span class="switch-copy">
<strong>经纬网格</strong>
<small>使用当前选择的坐标系,随缩放级别自动调整间距</small>
</span>
<input type="checkbox" id="gridToggle" checked>
<span class="switch" aria-hidden="true"></span>
</label>
<details class="options-fold" id="gridOptions">
<summary>网格设置</summary>
<div class="grid-controls" id="gridControls">
<div class="grid-spacing-field">
<label>网格间距
<span class="grid-spacing-input">
<input id="gridInterval" type="number" min="0.000001" step="any" placeholder="自动(留空)" inputmode="decimal">
<select id="gridIntervalUnit" aria-label="网格间距单位">
<option value="degree" selected>度 °</option>
<option value="minute">分 ′</option>
<option value="second">秒 ″</option>
<option value="meter">米 m</option>
</select>
</span>
</label>
<output id="gridIntervalEquivalent">自动</output>
</div>
<p class="field-hint grid-hint" id="gridSystemHint">当前:WGS84 经纬网格。可手动输入小数;留空时随缩放自动计算。</p>
<div class="control-grid single-grid">
<label>颜色
<input id="gridColor" type="color" value="#2f5543">
</label>
</div>
<div class="control-grid">
<label><span id="gridStartLonLabel">起始经度</span>
<input id="gridStartLon" type="number" value="0" step="0.001">
</label>
<label><span id="gridStartLatLabel">起始纬度</span>
<input id="gridStartLat" type="number" value="0" step="0.001">
</label>
</div>
<label class="range-label">线宽 <output id="gridWidthValue">0.7 px</output>
<input id="gridWidth" type="range" min="0.3" max="3" step="0.1" value="0.7">
</label>
</div>
</details>
<label class="switch-row">
<span class="switch-copy">
<strong>等高线</strong>
<small>叠加到当前底图,可调样式</small>
</span>
<input type="checkbox" id="contourToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<details class="options-fold" id="contourOptions" hidden>
<summary>等高线设置</summary>
<div class="contour-controls" id="contourControls">
<div class="control-grid">
<label>等高距
<select id="contourInterval">
<option value="auto">自动(随缩放)</option>
<option value="1">1 m</option>
<option value="2">2 m</option>
<option value="5">5 m</option>
<option value="10">10 m</option>
<option value="20" selected>20 m</option>
<option value="50">50 m</option>
<option value="100">100 m</option>
<option value="200">200 m</option>
<option value="500">500 m</option>
</select>
</label>
<label>起始高程
<input id="contourStart" type="number" value="0" step="1" inputmode="numeric">
</label>
</div>
<div class="control-grid">
<label>加粗每
<select id="contourBoldEvery">
<option value="0">不加粗</option>
<option value="2">2 条</option>
<option value="5" selected>5 条</option>
<option value="10">10 条</option>
</select>
</label>
<label>颜色
<input id="contourColor" type="color" value="#76512d">
</label>
</div>
<label class="range-label">基础线宽 <output id="contourWidthValue">1.0 px</output>
<input id="contourWidth" type="range" min="0.5" max="3" step="0.1" value="1">
</label>
<label class="range-label">加粗线宽 <output id="contourBoldWidthValue">2.2 px</output>
<input id="contourBoldWidth" type="range" min="1" max="6" step="0.1" value="2.2">
</label>
</div>
</details>
<label class="switch-row">
<span class="switch-copy">
<strong>地形特征点</strong>
<small>当前视窗内的近似山顶与山谷</small>
</span>
<input type="checkbox" id="terrainFeatureToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<details class="options-fold" id="terrainFeatureOptions" hidden>
<summary>山顶 / 山谷设置</summary>
<div class="terrain-feature-controls">
<label class="switch-row compact-switch-row">
<span class="switch-copy"><strong>显示山顶</strong><small>局部相对高点</small></span>
<input type="checkbox" id="terrainPeakToggle" checked>
<span class="switch" aria-hidden="true"></span>
</label>
<label class="switch-row compact-switch-row">
<span class="switch-copy"><strong>显示山谷</strong><small>局部相对低点</small></span>
<input type="checkbox" id="terrainValleyToggle" checked>
<span class="switch" aria-hidden="true"></span>
</label>
<label class="terrain-threshold">最小起伏阈值(米)
<input id="terrainProminenceThreshold" type="number" min="2" max="100" step="1" value="30" inputmode="numeric">
</label>
<p class="field-hint">阈值越大,越能过滤平原和小范围起伏;仅统计当前视窗内的局部高差。</p>
</div>
</details>
<p class="terrain-feature-status" id="terrainFeatureStatus">地形特征点默认关闭。</p>
<label class="switch-row">
<span class="switch-copy">
<strong>天地图图素</strong>
<small>本地矢量 · 1:100 万 / 1:25 万自动补充</small>
</span>
<input type="checkbox" id="localVectorToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<details class="options-fold" id="localVectorOptions" hidden>
<summary>本地矢量图层设置</summary>
<div class="local-vector-controls">
<div class="local-vector-layer-grid">
<label><input type="checkbox" class="local-vector-layer-toggle" value="roads" checked> 道路</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="railways" checked> 铁路</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="water" checked> 水系</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="administration"> 图幅行政</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="province" checked> 省界</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="city" checked> 市界</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="county" checked> 区县界</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="settlements"> 居民地</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="vegetation" checked> 植被</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="terrain"> 地形</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="facilities"> 设施</label>
<label><input type="checkbox" class="local-vector-layer-toggle" value="heritage"> 古迹</label>
</div>
<p class="field-hint">1:100 万支持 Z3–Z16;1:25 万支持 Z8–Z18。Z8 以上优先使用 1:25 万,缺失区域自动回退 1:100 万。本地矢量的全部类别均从 Z3 开始显示。</p>
<p class="field-hint" id="localVectorStatus">开启后加载当前视窗的本地矢量数据。</p>
</div>
</details>
<label class="switch-row">
<span class="switch-copy">
<strong>水域</strong>
<small>OpenFreeMap · Z3–Z16 本地分块</small>
</span>
<input type="checkbox" id="waterToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="water-status" id="waterStatus" hidden>水域图层未加载。</p>
<label class="switch-row">
<span class="switch-copy">
<strong>港口</strong>
<small>港口、码头、渡轮终端</small>
</span>
<input type="checkbox" id="portToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="water-status" id="portStatus" hidden>港口图层未加载。</p>
<label class="switch-row">
<span class="switch-copy">
<strong>植被</strong>
<small>OpenFreeMap · Z3–Z16 本地分块</small>
</span>
<input type="checkbox" id="vegetationToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="water-status" id="vegetationStatus" hidden>植被图层未加载。</p>
<label class="switch-row">
<span class="switch-copy">
<strong>铁路基础设施</strong>
<small>OpenRailwayMap 铁路网瓦片</small>
</span>
<input type="checkbox" id="railTileToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="water-status" id="railTileStatus" hidden>铁路基础设施未加载。</p>
<label class="switch-row">
<span class="switch-copy">
<strong>国铁线路</strong>
<small>OpenFreeMap 全球国铁主线与支线</small>
</span>
<input type="checkbox" id="nationalRailToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="water-status" id="nationalRailStatus" hidden>国铁线路未加载。</p>
<details class="options-fold" id="nationalRailCategoryOptions">
<summary>国铁线路分类</summary>
<div class="local-vector-layer-grid rail-category-grid">
<label><input type="checkbox" id="nationalRailMainCategoryToggle" checked> 主线</label>
<label><input type="checkbox" id="nationalRailHighSpeedCategoryToggle" checked> 高速/客专</label>
<label><input type="checkbox" id="nationalRailBranchCategoryToggle"> 支线/专用线</label>
<label><input type="checkbox" id="nationalRailYardCategoryToggle"> 站场</label>
<label><input type="checkbox" id="nationalRailDepotCategoryToggle"> 车辆段/停车场</label>
<label><input type="checkbox" id="nationalRailSidingCategoryToggle"> 侧线</label>
<label><input type="checkbox" id="nationalRailCrossoverCategoryToggle"> 渡线</label>
<label><input type="checkbox" id="nationalRailConnectionCategoryToggle"> 联络线</label>
<label><input type="checkbox" id="nationalRailTestCategoryToggle"> 试车线</label>
<label><input type="checkbox" id="nationalRailLoopCategoryToggle"> 环线</label>
<label><input type="checkbox" id="nationalRailFreightCategoryToggle"> 货运/工业</label>
<label><input type="checkbox" id="nationalRailOtherCategoryToggle"> 其他</label>
</div>
</details>
<label class="switch-row">
<span class="switch-copy">
<strong>地铁线路</strong>
<small>OpenFreeMap 全球地铁 / 轻轨 / 单轨</small>
</span>
<input type="checkbox" id="metroToggle">
<span class="switch" aria-hidden="true"></span>
</label>
<p class="water-status" id="metroStatus" hidden>地铁线路未加载。</p>
<details class="options-fold" id="metroRailCategoryOptions">
<summary>地铁线路分类</summary>
<div class="local-vector-layer-grid rail-category-grid">
<label><input type="checkbox" id="metroRailMainCategoryToggle" checked> 主线</label>
<label><input type="checkbox" id="metroRailHighSpeedCategoryToggle" checked> 高速/客专</label>
<label><input type="checkbox" id="metroRailBranchCategoryToggle"> 支线/专用线</label>
<label><input type="checkbox" id="metroRailYardCategoryToggle"> 站场</label>
<label><input type="checkbox" id="metroRailDepotCategoryToggle"> 车辆段/停车场</label>
<label><input type="checkbox" id="metroRailSidingCategoryToggle"> 侧线</label>
<label><input type="checkbox" id="metroRailCrossoverCategoryToggle"> 渡线</label>
<label><input type="checkbox" id="metroRailConnectionCategoryToggle"> 联络线</label>
<label><input type="checkbox" id="metroRailTestCategoryToggle"> 试车线</label>
<label><input type="checkbox" id="metroRailLoopCategoryToggle"> 环线</label>
<label><input type="checkbox" id="metroRailFreightCategoryToggle"> 货运/工业</label>
<label><input type="checkbox" id="metroRailOtherCategoryToggle"> 其他</label>
</div>
</details>
<div class="rail-actions">
<button class="secondary-button full-width" id="refreshRailButton" type="button">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 7v5h-5"/><path d="M4 17v-5h5"/><path d="M6.1 9a7 7 0 0 1 11.7-2L20 12M4 12l2.2 5a7 7 0 0 0 11.7-2"/></svg>
重新加载当前视窗铁路
</button>
<p id="railStatus">铁路矢量图层尚未加载。</p>
</div>
</details>
<details class="panel compact-panel fold-panel" id="elementColorOptions">
<summary class="section-heading">
<div>
<span class="eyebrow">LEGEND &amp; STYLE</span>
<h2>图例与颜色</h2>
</div>
</summary>
<div class="element-color-controls">
<div class="element-rail-style-grid">
<label class="element-color-style">铁路展示样式
<select id="railwayLineStyleSelect">
<option value="plain">普通彩色线条</option>
<option value="railway" selected>黑白相间铁路线</option>
</select>
</label>
<label class="element-color-style">地铁展示样式
<select id="metroLineStyleSelect">
<option value="plain" selected>普通彩色线条</option>
<option value="railway">黑白相间铁路线</option>
</select>
</label>
</div>
<p class="field-hint">铁路样式作用于国铁和天地图图素铁路;地铁使用独立样式和颜色。</p>
<div class="element-color-grid">
<label>国铁颜色<input id="nationalRailColor" type="color" value="#5c43c6"></label>
<label>地铁颜色<input id="metroColor" type="color" value="#e15b3c"></label>
<label>水域颜色<input id="waterElementColor" type="color" value="#4fb6dc"></label>
<label>港口颜色<input id="portElementColor" type="color" value="#166a86"></label>
<label>植被颜色<input id="vegetationElementColor" type="color" value="#68a94f"></label>
<label>山顶颜色<input id="terrainPeakColor" type="color" value="#a45d2c"></label>
<label>山谷颜色<input id="terrainValleyColor" type="color" value="#2e628d"></label>
<label>图素道路<input id="localRoadsColor" type="color" value="#d16a35"></label>
<label>图素铁路<input id="localRailwaysColor" type="color" value="#6847a6"></label>
<label>图素水系<input id="localWaterColor" type="color" value="#378db7"></label>
<label>图幅行政<input id="localAdministrationColor" type="color" value="#98462e"></label>
<label>图素居民地<input id="localSettlementsColor" type="color" value="#795334"></label>
<label>图素植被<input id="localVegetationColor" type="color" value="#4a8050"></label>
<label>图素地形<input id="localTerrainColor" type="color" value="#84633f"></label>
<label>图素设施<input id="localFacilitiesColor" type="color" value="#8b7358"></label>
<label>图素古迹<input id="localHeritageColor" type="color" value="#a4544f"></label>
</div>
<p class="field-hint">网格、等高线、行政区划和通视颜色在各自设置中调整;所有颜色都会同步到屏幕与打印图例。</p>
</div>
</details>
<details class="panel compact-panel fold-panel">
<summary class="section-heading">
<div>
<span class="eyebrow">QUICK VIEW</span>
<h2>快速定位</h2>
</div>
</summary>
<div class="chip-list">
<button type="button" data-place="31.2304,121.4737,12">上海</button>
<button type="button" data-place="39.9042,116.4074,11">北京</button>
<button type="button" data-place="23.1291,113.2644,11">广州</button>
<button type="button" data-place="30.5728,104.0668,11">成都</button>
<button type="button" data-place="34.3416,108.9398,11">西安</button>
<button type="button" data-place="29.5630,106.5516,11">重庆</button>
<button type="button" data-place="30.1300,118.1700,11">黄山</button>
</div>
</details>
<details class="panel fold-panel">
<summary class="section-heading">
<div>
<span class="eyebrow">DRAW & ANALYSIS</span>
<h2>绘制与分析</h2>
</div>
</summary>
<div class="tool-fields">
<label class="tool-field">观察点视线高度(米)
<input id="viewshedHeight" type="number" min="0" max="100" step="0.1" value="1">
</label>
</div>
<div class="tool-grid">
<button class="tool-button" id="pathDrawButton" type="button">绘制路径</button>
<button class="tool-button" id="rangeDrawButton" type="button">绘制范围</button>
<button class="tool-button" id="viewshedButton" type="button">两点通视</button>
<button class="tool-button" id="visibilityObservationButton" type="button">通视观察</button>
<button class="tool-button secondary-tool" id="finishDrawingButton" type="button" hidden>完成绘制</button>
</div>
<details class="options-fold" id="visibilityOptions">
<summary>通视观察设置</summary>
<div class="visibility-controls">
<p class="field-hint">在地图上指定观察点。仅标记内半径到外半径之间可见的地表;内半径可设为 0。</p>
<div class="control-grid">
<label>内半径(米)
<input id="visibilityInnerRadius" type="number" min="0" max="19999" step="10" value="0">
</label>
<label>外半径(米)
<input id="visibilityOuterRadius" type="number" min="1" max="20000" step="50" value="1000">
</label>
</div>
<div class="visibility-color-heading">
<strong>距离颜色</strong>
<span>近 → 远</span>
</div>
<div class="visibility-colors">
<label>近距
<input id="visibilityNearColor" type="color" value="#1f9d62">
</label>
<label>中距
<input id="visibilityMidColor" type="color" value="#54ad55">
</label>
<label>远距
<input id="visibilityFarColor" type="color" value="#94bd4c">
</label>
</div>
</div>
</details>
<button class="text-button clear-tool" id="clearDrawButton" type="button">清除全部绘制与分析</button>
<p class="autosave-note">绘制内容会自动保存在此浏览器,下次打开时自动恢复。</p>
<p class="tool-status" id="drawingStatus">选择一个工具开始绘制。</p>
<div class="drawing-list" id="drawingList" aria-live="polite"></div>
</details>
<section class="project-file-card">
<div class="project-file-heading">
<div>
<span class="eyebrow">PROJECT FILE</span>
<strong>工程文件</strong>
</div>
<span>.mpstd</span>
</div>
<p>保存视图、全部设置和绘制内容,便于备份或迁移到另一台电脑。</p>
<div class="project-file-actions">
<button class="secondary-button" id="exportProjectButton" type="button">导出工程</button>
<button class="secondary-button" id="importProjectButton" type="button">导入工程</button>
<input id="importProjectInput" type="file" accept=".mpstd,application/json" hidden>
</div>
</section>
<section class="cost-card">
<div>
<span class="eyebrow">LOW-COST STACK</span>
<strong>当前原型:软件费 ¥0</strong>
<p>使用开放瓦片与开放数据;正式上线前请按访问量选择托管或自建方案。</p>
</div>
<a href="api-comparison.html">查看对比 →</a>
</section>
<div class="sidebar-footer-links">
<a class="openmap-admin-link" href="regulations.html">内部使用与地图合规规定</a>
<a class="openmap-admin-link" href="openmap-admin.html" target="_blank" rel="noopener noreferrer">地图离线下载后台</a>
<a class="tdt-admin-link" href="tianditu-admin.html" target="_blank" rel="noopener noreferrer">天地图瓦片下载后台</a>
<a class="openmap-admin-link" href="cache-admin.html" target="_blank" rel="noopener noreferrer">缓存管理</a>
</div>
</aside>
<main class="map-stage">
<div id="map" role="application" aria-label="可交互地图"></div>
<div class="map-toolbar" aria-label="地图工具">
<button type="button" id="zoomInButton" aria-label="放大">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</button>
<button type="button" id="zoomOutButton" aria-label="缩小">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h14"/></svg>
</button>
<button type="button" id="homeButton" aria-label="回到默认视图">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m3 11 9-8 9 8"/><path d="M5 10v10h14V10M9 20v-6h6v6"/></svg>
</button>
</div>
<div class="map-legend">
<div class="legend-title">图例 · 简洁底图</div>
<div data-map-legend="railway"><span class="legend-line railway"></span>铁路基础设施</div>
<div data-map-legend="national"><span class="legend-line national"></span>国铁 / 主要铁路</div>
<div data-map-legend="metro"><span class="legend-line metro"></span>地铁</div>
<div data-map-legend="hillshade"><span class="legend-swatch hillshade"></span>地形晕渲</div>
<div data-map-legend="grid"><span class="legend-line grid"></span>经纬网格</div>
<div data-map-legend="contour"><span class="legend-symbol contour"></span>等高线</div>
<div data-map-legend="terrain-peak"><span class="legend-symbol terrain-peak">▲</span>山顶</div>
<div data-map-legend="terrain-valley"><span class="legend-symbol terrain-valley">▼</span>山谷</div>
<div data-map-legend="boundary"><span class="legend-line boundary"></span>行政边界</div>
<div class="legend-subgroup" data-local-legend-heading>天地图图素</div>
<div data-map-legend="local-roads"><span class="legend-line local-roads"></span>道路</div>
<div data-map-legend="local-railways"><span class="legend-line local-railways"></span>铁路</div>
<div data-map-legend="local-water"><span class="legend-line local-water"></span>水系</div>
<div data-map-legend="local-administration"><span class="legend-swatch local-administration"></span>图幅行政</div>
<div data-map-legend="local-province"><span class="legend-line local-province"></span>省界</div>
<div data-map-legend="local-city"><span class="legend-line local-city"></span>市界</div>
<div data-map-legend="local-county"><span class="legend-line local-county"></span>区县界</div>
<div data-map-legend="local-settlements"><span class="legend-swatch local-settlements"></span>居民地</div>
<div data-map-legend="local-vegetation"><span class="legend-swatch local-vegetation"></span>植被</div>
<div data-map-legend="local-terrain"><span class="legend-line local-terrain"></span>地形</div>
<div data-map-legend="local-facilities"><span class="legend-swatch local-facilities"></span>设施</div>
<div data-map-legend="local-heritage"><span class="legend-symbol local-heritage">●</span>古迹</div>
<div data-map-legend="water"><span class="legend-swatch water"></span>水域</div>
<div data-map-legend="port"><span class="legend-swatch port"></span>港口 / 码头</div>
<div data-map-legend="vegetation"><span class="legend-swatch vegetation"></span>植被</div>
<div data-map-legend="viewshed"><span class="legend-swatch viewshed"></span>通视观察可见范围</div>
<div class="legend-empty" data-legend-empty hidden>当前未开启专题图层</div>
</div>
<div class="map-readout" aria-live="polite">
<span id="coordReadout">39.9042° N, 116.4074° E</span>
<button class="readout-format-toggle" id="coordinateReadoutFormat" type="button" aria-pressed="false">小数</button>
<span class="divider"></span>
<span id="zoomReadout">Z 12</span>
<span class="divider"></span>
<span id="elevationReadout">高程 —</span>
<span class="divider"></span>
<span id="baseReadout">标准地图</span>
</div>
<div class="print-decor">
<div class="print-frame" id="printFrame" aria-label="出图范围边框">
<div class="frame-edge frame-top"></div>
<div class="frame-edge frame-bottom"></div>
<div class="frame-edge frame-left"></div>
<div class="frame-edge frame-right"></div>
<div class="frame-inner"></div>
<span class="frame-handle corner" data-handle="nw"></span>
<span class="frame-handle edge ns" data-handle="n"></span>
<span class="frame-handle corner" data-handle="ne"></span>
<span class="frame-handle edge ew" data-handle="e"></span>
<span class="frame-handle corner" data-handle="se"></span>
<span class="frame-handle edge ns" data-handle="s"></span>
<span class="frame-handle corner" data-handle="sw"></span>
<span class="frame-handle edge ew" data-handle="w"></span>
<div class="print-title">
<input id="printTitleInput" type="text" value="地图" aria-label="打印图名">
<span id="printTitleMeta">Map Studio</span>
</div>
<div class="print-guide">拖动边框移动 · 拖角或边调整大小</div>
<div class="print-north">N<br><span>↑</span></div>
<div class="print-scale">
<div class="print-scale-bar"><span></span><span></span><span></span><span></span></div>
<div id="printScaleLabel">比例尺</div>
</div>
<div class="print-legend" id="printLegend" aria-label="打印图例">
<strong>图例 · 简洁底图</strong>
<div data-print-legend="railway"><span class="legend-line railway"></span>铁路基础设施</div>
<div data-print-legend="national"><span class="legend-line national"></span>国铁 / 主要铁路</div>
<div data-print-legend="metro"><span class="legend-line metro"></span>地铁</div>
<div data-print-legend="hillshade"><span class="legend-swatch hillshade"></span>地形晕渲</div>
<div data-print-legend="grid"><span class="legend-line grid"></span>经纬网格</div>
<div data-print-legend="contour"><span class="legend-symbol contour"></span>等高线</div>
<div data-print-legend="terrain-peak"><span class="legend-symbol terrain-peak">▲</span>山顶</div>
<div data-print-legend="terrain-valley"><span class="legend-symbol terrain-valley">▼</span>山谷</div>
<div data-print-legend="boundary"><span class="legend-line boundary"></span>行政边界</div>
<div class="legend-subgroup" data-local-legend-heading>天地图图素</div>
<div data-print-legend="local-roads"><span class="legend-line local-roads"></span>道路</div>
<div data-print-legend="local-railways"><span class="legend-line local-railways"></span>铁路</div>
<div data-print-legend="local-water"><span class="legend-line local-water"></span>水系</div>
<div data-print-legend="local-administration"><span class="legend-swatch local-administration"></span>图幅行政</div>
<div data-print-legend="local-province"><span class="legend-line local-province"></span>省界</div>
<div data-print-legend="local-city"><span class="legend-line local-city"></span>市界</div>
<div data-print-legend="local-county"><span class="legend-line local-county"></span>区县界</div>
<div data-print-legend="local-settlements"><span class="legend-swatch local-settlements"></span>居民地</div>
<div data-print-legend="local-vegetation"><span class="legend-swatch local-vegetation"></span>植被</div>
<div data-print-legend="local-terrain"><span class="legend-line local-terrain"></span>地形</div>
<div data-print-legend="local-facilities"><span class="legend-swatch local-facilities"></span>设施</div>
<div data-print-legend="local-heritage"><span class="legend-symbol local-heritage">●</span>古迹</div>
<div data-print-legend="water"><span class="legend-swatch water"></span>水域</div>
<div data-print-legend="port"><span class="legend-swatch port"></span>港口 / 码头</div>
<div data-print-legend="vegetation"><span class="legend-swatch vegetation"></span>植被</div>
<div data-print-legend="viewshed"><span class="legend-swatch viewshed"></span>通视观察可见范围</div>
<div class="legend-empty" data-legend-empty hidden>当前未开启专题图层</div>
</div>
<div class="print-actions">
<button type="button" id="exportPrintButton">打印 / 保存 PDF</button>
<button type="button" id="exitPrintButton">退出制图</button>
</div>
</div>
</div>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
</main>
</div>
<script>
(function () {
var scripts = [
{ source: "vendor/d3.min.js?v=7.9.0", required: true },
{ source: "vendor/leaflet/leaflet.js?v=1.9.4", required: true },
{ source: "coordinate-systems.js?v=20261108-3", required: true },
{ source: "compliance-gate.js?v=20261108-1", required: true },
{ source: "app.js?v=20261108-107", required: true },
{ source: "vendor/rail-beijing.js?v=20261105-1", required: false }
];
function loadNext(index) {
if (index >= scripts.length) return;
var entry = scripts[index];
var source = entry.source;
var attempt = 0;
var maxAttempts = entry.required ? 5 : 2;
function showError() {
var errorBox = document.createElement("div");
errorBox.textContent = "Map Studio 资源加载失败:" +
new URL(source, document.baseURI).href;
errorBox.style.cssText =
"position:fixed;inset:0;z-index:9999;padding:24px;background:#fff;color:#8a2d20;font:14px sans-serif";
document.body.prepend(errorBox);
}
function tryLoad() {
var script = document.createElement("script");
var url = new URL(source, document.baseURI);
var settled = false;
var timeout = window.setTimeout(function () {
fail();
}, entry.required ? 30000 : 12000);
function finish() {
if (settled) return false;
settled = true;
window.clearTimeout(timeout);
return true;
}
function fail() {
if (!finish()) return;
script.onload = null;
script.onerror = null;
script.remove();
if (attempt + 1 < maxAttempts) {
attempt += 1;
window.setTimeout(tryLoad, 250 * attempt);
return;
}
if (entry.required) {
showError();
return;
}
console.warn("Map Studio optional resource skipped after retries:", url.href);
loadNext(index + 1);
}
if (attempt) {
url.searchParams.set("retry", attempt + "-" + Date.now());
}
script.src = url.href;
script.onload = function () {
if (!finish()) return;
if (!entry.required) {
window.dispatchEvent(new CustomEvent("mapstudio:optional-data-ready", {
detail: { source: source }
}));
}
loadNext(index + 1);
};
script.onerror = fail;
document.body.appendChild(script);
};
tryLoad();
}
loadNext(0);
})();
</script>
</body>
</html>