Files
osm-import-tools/web/index.html
2025-12-05 14:29:17 -08:00

208 lines
5.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GeoJSON Map Viewer</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
height: 100vh;
display: flex;
flex-direction: column;
}
#map {
flex: 1;
width: 100%;
}
.controls {
position: absolute;
top: 10px;
right: 10px;
z-index: 1000;
background: white;
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
min-width: 200px;
}
.controls h3 {
margin: 0 0 10px 0;
font-size: 14px;
color: #333;
}
.controls label {
display: flex;
align-items: center;
margin: 8px 0;
cursor: pointer;
font-size: 13px;
}
.layer-item {
display: flex;
align-items: center;
margin: 8px 0;
padding: 5px;
background: #f8f9fa;
border-radius: 4px;
cursor: move;
font-size: 13px;
}
.layer-item.dragging {
opacity: 0.5;
}
.layer-item input[type="checkbox"] {
margin-right: 8px;
}
.controls input[type="checkbox"] {
margin-right: 8px;
}
.controls button {
width: 100%;
padding: 10px;
margin-top: 10px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
}
.controls button:hover {
background: #0056b3;
}
.controls button:disabled {
background: #ccc;
cursor: not-allowed;
}
.status {
margin-top: 10px;
padding: 8px;
border-radius: 4px;
font-size: 12px;
text-align: center;
}
.status.success {
background: #d4edda;
color: #155724;
}
.status.error {
background: #f8d7da;
color: #721c24;
}
.status.hidden {
display: none;
}
.file-input-group {
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.file-input-group:last-of-type {
border-bottom: none;
}
.file-input-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
}
.file-input-group input[type="file"] {
width: 100%;
font-size: 11px;
}
.load-button {
background: #28a745 !important;
}
.load-button:hover {
background: #218838 !important;
}
</style>
</head>
<body>
<div id="map"></div>
<div class="controls">
<h3>Layer Controls (top to bottom)</h3>
<div id="layerList">
<div class="layer-item" draggable="true" data-layer="diff">
<input type="checkbox" id="diffToggle" checked>
<span>Diff Layer</span>
</div>
<div class="layer-item" draggable="true" data-layer="osm">
<input type="checkbox" id="osmToggle" checked>
<span>OSM Roads (Gray)</span>
</div>
<div class="layer-item" draggable="true" data-layer="county">
<input type="checkbox" id="countyToggle">
<span>County Layer (Purple)</span>
</div>
</div>
<h3 style="margin-top: 15px;">Diff Filters</h3>
<label>
<input type="checkbox" id="showAdded" checked>
Show Added (Green)
</label>
<label>
<input type="checkbox" id="showRemoved" checked>
Show Removed (Red)
</label>
<label>
<input type="checkbox" id="hideService">
Hide highway=service
</label>
<h3 style="margin-top: 15px;">Load Files</h3>
<div class="file-input-group">
<label for="diffFile">Diff File:</label>
<input type="file" id="diffFile" accept=".geojson,.json">
</div>
<div class="file-input-group">
<label for="osmFile">OSM File:</label>
<input type="file" id="osmFile" accept=".geojson,.json">
</div>
<div class="file-input-group">
<label for="countyFile">County File:</label>
<input type="file" id="countyFile" accept=".geojson,.json">
</div>
<button id="loadButton" class="load-button">Load Files</button>
<button id="saveButton" disabled>Save Accepted Items</button>
<div id="status" class="status hidden"></div>
</div>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script src="app.js"></script>
</body>
</html>