mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
fix: resolve 5 confirmed bugs from code review
- MapView.jsx: extract addBoundaryLayer function, use getComputedStyle for accent color (MapLibre rejects CSS vars in paint properties) - PlaceCard.jsx: gate fetchNearbyContacts on auth.authenticated - PlaceDetail.jsx: gate fetchNearbyContacts on auth.authenticated - api.js: replace invalid timeout option with AbortSignal.timeout() - RadialMenu.jsx: remove user-select from SVG style (Firefox rejects) - Panel.jsx: add Cancel button for pending directions state
This commit is contained in:
parent
0d4a807a05
commit
a40f68fa26
39 changed files with 728 additions and 21085 deletions
|
|
@ -593,6 +593,28 @@ function removeContoursTest10ft(map) {
|
|||
if (map.getLayer(CONTOUR_TEST_10FT_MINOR)) map.removeLayer(CONTOUR_TEST_10FT_MINOR)
|
||||
if (map.getSource(CONTOUR_TEST_10FT_SOURCE)) map.removeSource(CONTOUR_TEST_10FT_SOURCE)
|
||||
}
|
||||
/** Add boundary polygon layer with computed accent color (MapLibre rejects CSS vars in paint) */
|
||||
function addBoundaryLayer(map) {
|
||||
if (!map || map.getLayer(BOUNDARY_LAYER)) return
|
||||
if (!map.getSource(BOUNDARY_SOURCE)) {
|
||||
map.addSource(BOUNDARY_SOURCE, {
|
||||
type: "geojson",
|
||||
data: { type: "FeatureCollection", features: [] },
|
||||
})
|
||||
}
|
||||
const accentColor = getComputedStyle(document.documentElement).getPropertyValue("--accent").trim() || "#7a9a6b"
|
||||
map.addLayer({
|
||||
id: BOUNDARY_LAYER,
|
||||
type: "line",
|
||||
source: BOUNDARY_SOURCE,
|
||||
paint: {
|
||||
"line-color": accentColor,
|
||||
"line-width": 2,
|
||||
"line-opacity": 0.7,
|
||||
"line-dasharray": [3, 2],
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const MapView = forwardRef(function MapView(_, ref) {
|
||||
const mapRef = useRef(null)
|
||||
|
|
@ -977,22 +999,8 @@ const MapView = forwardRef(function MapView(_, ref) {
|
|||
data: { type: 'FeatureCollection', features: [] },
|
||||
})
|
||||
|
||||
// Boundary polygon source for selected places
|
||||
map.addSource(BOUNDARY_SOURCE, {
|
||||
type: 'geojson',
|
||||
data: { type: 'FeatureCollection', features: [] },
|
||||
})
|
||||
map.addLayer({
|
||||
id: BOUNDARY_LAYER,
|
||||
type: 'line',
|
||||
source: BOUNDARY_SOURCE,
|
||||
paint: {
|
||||
'line-color': 'var(--accent)',
|
||||
'line-width': 2,
|
||||
'line-opacity': 0.7,
|
||||
'line-dasharray': [3, 2],
|
||||
},
|
||||
})
|
||||
// Boundary polygon layer for selected places
|
||||
addBoundaryLayer(map)
|
||||
|
||||
// Restore overlay layers from localStorage prefs
|
||||
try {
|
||||
|
|
@ -1125,22 +1133,8 @@ const MapView = forwardRef(function MapView(_, ref) {
|
|||
data: { type: 'FeatureCollection', features: [] },
|
||||
})
|
||||
|
||||
// Boundary polygon source
|
||||
map.addSource(BOUNDARY_SOURCE, {
|
||||
type: 'geojson',
|
||||
data: { type: 'FeatureCollection', features: [] },
|
||||
})
|
||||
map.addLayer({
|
||||
id: BOUNDARY_LAYER,
|
||||
type: 'line',
|
||||
source: BOUNDARY_SOURCE,
|
||||
paint: {
|
||||
'line-color': 'var(--accent)',
|
||||
'line-width': 2,
|
||||
'line-opacity': 0.7,
|
||||
'line-dasharray': [3, 2],
|
||||
},
|
||||
})
|
||||
// Boundary polygon layer
|
||||
addBoundaryLayer(map)
|
||||
|
||||
// Re-add active overlay layers
|
||||
if (activeLayersRef.current.hillshade) addHillshade(map)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue