diff --git a/ui/src/App.vue b/ui/src/App.vue index 880be8f..8168ea5 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -91,6 +91,7 @@ +
= minLng && lng <= maxLng && lat >= minLat && lat <= maxLat) { + return true; + } + } + + return false; +} + // Extend a line from point1 through point2 to map bounds function extendRay(lng1, lat1, lng2, lat2, bounds) { const bearing = calculateBearing(lng1, lat1, lng2, lat2); @@ -595,6 +707,33 @@ function clearAllGeometry() { } } +// Request a tile for a specific location +async function requestTile() { + const { lng, lat } = contextMenu.value.lngLat; + + // TODO: Call backend endpoint + // For now, just log what we would send + const requestData = { + longitude: lng, + latitude: lat, + // Backend will: + // 1. Transform to Ohio State Plane South (EPSG:3735) in US Survey Feet + // 2. Call https://maps.ohio.gov/arcgis/rest/services/OGRIP/3DepTiles/MapServer/0/query + // 3. Extract TileName, County, Block + // 4. Return tile info and download URL + }; + + console.log('=== Tile Request ==='); + console.log('Would send to backend:', requestData); + console.log('Backend endpoint: POST /api/tiles/request'); + + // Close the context menu + contextMenu.value.visible = false; + + // TODO: Show loading indicator + // TODO: Handle response and update UI +} + function updateGeometryLayer() { if (!map || !map.getSource('geometry')) return; @@ -665,11 +804,13 @@ onMounted(() => { // Context menu handler map.on('contextmenu', (e) => { e.preventDefault(); + const hasTile = hasLidarAtPoint(e.lngLat.lng, e.lngLat.lat); contextMenu.value = { visible: true, x: e.point.x, y: e.point.y, - lngLat: e.lngLat + lngLat: e.lngLat, + hasTile: hasTile }; });