174 lines
5.7 KiB
HTML
174 lines
5.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Boundary Tracer</title>
|
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='map-ui.css') }}">
|
|
<style>
|
|
.polygon-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin: 4px 0;
|
|
padding: 4px 6px;
|
|
background: #f8f9fa;
|
|
border-radius: 4px;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.polygon-swatch {
|
|
width: 11px;
|
|
height: 11px;
|
|
border-radius: 2px;
|
|
flex-shrink: 0;
|
|
border: 1px solid rgba(0,0,0,0.25);
|
|
}
|
|
|
|
.polygon-item .polygon-name {
|
|
flex: 1;
|
|
}
|
|
|
|
.polygon-item button {
|
|
width: auto;
|
|
margin: 0;
|
|
padding: 2px 7px;
|
|
font-size: 10px;
|
|
background: #dc3545;
|
|
}
|
|
|
|
.polygon-item button:hover {
|
|
background: #b02a37;
|
|
}
|
|
|
|
.draw-hint {
|
|
font-size: 10px;
|
|
color: #999;
|
|
margin: 4px 0 8px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #6c757d !important;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #565e64 !important;
|
|
}
|
|
|
|
.controls input[type="text"] {
|
|
width: 100%;
|
|
font-size: 11px;
|
|
padding: 4px 6px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
margin-bottom: 6px;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.overlay-row {
|
|
display: flex;
|
|
gap: 6px;
|
|
}
|
|
|
|
.overlay-row button {
|
|
flex: 1;
|
|
margin-top: 0;
|
|
}
|
|
|
|
.overlay-opacity-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.overlay-opacity-row label {
|
|
font-size: 11px;
|
|
color: #666;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.overlay-opacity-row input[type="range"] {
|
|
flex: 1;
|
|
}
|
|
|
|
.overlay-warning {
|
|
font-size: 10px;
|
|
color: #a15c00;
|
|
background: #fff3cd;
|
|
border-radius: 4px;
|
|
padding: 5px 6px;
|
|
margin: 4px 0 8px;
|
|
line-height: 1.4;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
|
|
<button class="hamburger-button" id="hamburgerButton" aria-label="Toggle menu">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</button>
|
|
|
|
<div class="overlay" id="overlay"></div>
|
|
|
|
<div class="controls" id="controls">
|
|
<a href="/" class="btn-back">← Back</a>
|
|
<h3>Boundary Tracer</h3>
|
|
<p style="font-size:11px;color:#666;margin-bottom:8px;">
|
|
Open a reference map (e.g. thevillages.com/map) in another tab, then
|
|
hand-trace its boundary here by clicking vertices. Tracing itself
|
|
never fetches from any third-party site — you're just drawing on
|
|
our own map based on what you see elsewhere. The optional overlay
|
|
layer below is the exception: it fetches tiles live from whatever
|
|
URL you give it.
|
|
</p>
|
|
|
|
<h3>Overlay layer (optional)</h3>
|
|
<p class="overlay-warning">
|
|
This fetches tiles directly from the URL you paste in. Check that
|
|
source's Terms of Use permit automated/robotic access first —
|
|
thevillages.com's ToS, for example, explicitly prohibit it, so
|
|
don't point this at their tile servers.
|
|
</p>
|
|
<p style="font-size:10px;color:#666;margin:-2px 0 6px;line-height:1.4;">
|
|
Accepts a standard <code>{z}/{x}/{y}</code> tile URL, or the base
|
|
URL of an ArcGIS tiled MapServer (e.g. <code>.../MapServer</code>)
|
|
— its own tiling scheme (including a plain-geographic/WGS84 grid)
|
|
is read automatically from that service's metadata.
|
|
</p>
|
|
<input type="text" id="overlayUrlInput" placeholder="https://.../{z}/{x}/{y}.png or .../MapServer">
|
|
<div class="overlay-row">
|
|
<button id="addOverlayBtn">Add overlay</button>
|
|
<button id="removeOverlayBtn" class="btn-secondary" disabled>Remove</button>
|
|
</div>
|
|
<div class="overlay-opacity-row" id="overlayOpacityRow" style="display:none;">
|
|
<label for="overlayOpacitySlider">Opacity</label>
|
|
<input type="range" id="overlayOpacitySlider" min="0" max="100" value="70">
|
|
</div>
|
|
|
|
<button id="newPolygonBtn" style="margin-top:12px;">New polygon</button>
|
|
<button id="undoPointBtn" class="btn-secondary" disabled>Undo last point</button>
|
|
<button id="finishPolygonBtn" disabled>Finish polygon</button>
|
|
<button id="cancelPolygonBtn" class="btn-secondary" disabled>Cancel</button>
|
|
<p class="draw-hint" id="drawHint">Click "New polygon" to start tracing.</p>
|
|
|
|
<h3 style="margin-top:10px;">Polygons</h3>
|
|
<div id="polygonList"><p style="font-size:11px;color:#999;">None yet.</p></div>
|
|
|
|
<button id="saveBtn" style="background:#28a745;margin-top:12px;">Save to server</button>
|
|
<button id="downloadBtn" class="btn-secondary">Download GeoJSON</button>
|
|
|
|
<div id="status" class="status hidden"></div>
|
|
</div>
|
|
|
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
|
<script src="{{ url_for('static', filename='map-ui.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='boundary-tracer.js') }}"></script>
|
|
</body>
|
|
</html>
|