mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
feat(radial): remove redundant 'What's here' wedge
Left-click on the map already reverse-geocodes and opens the place panel, making the 'What's here' wedge redundant. Radial drops from 6 to 5 wedges (72° each). Remaining wedges (all stubs except they show toast): - Drop pin - Directions to here - Save place (auth-gated) - Add as stop - Directions from here
This commit is contained in:
parent
15e6267022
commit
19b8c6e23b
1 changed files with 1 additions and 28 deletions
|
|
@ -7,7 +7,7 @@ import { useStore } from '../store'
|
||||||
import { decodePolyline } from '../utils/decode'
|
import { decodePolyline } from '../utils/decode'
|
||||||
import { fetchReverse } from '../api'
|
import { fetchReverse } from '../api'
|
||||||
import { getConfig, hasFeature } from '../config'
|
import { getConfig, hasFeature } from '../config'
|
||||||
import { MapPin, Navigation, ArrowUpRight, ArrowDownLeft, Plus, Star, Info } from 'lucide-react'
|
import { MapPin, Navigation, ArrowUpRight, ArrowDownLeft, Plus, Star } from 'lucide-react'
|
||||||
import RadialMenu from './RadialMenu'
|
import RadialMenu from './RadialMenu'
|
||||||
import useContextMenu from '../hooks/useContextMenu'
|
import useContextMenu from '../hooks/useContextMenu'
|
||||||
import toast from 'react-hot-toast'
|
import toast from 'react-hot-toast'
|
||||||
|
|
@ -650,33 +650,6 @@ const MapView = forwardRef(function MapView(_, ref) {
|
||||||
requiresAuth: true,
|
requiresAuth: true,
|
||||||
onSelect: () => toast('Save place coming soon', { icon: '⭐' }),
|
onSelect: () => toast('Save place coming soon', { icon: '⭐' }),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'whats-here',
|
|
||||||
label: "What's here",
|
|
||||||
icon: Info,
|
|
||||||
onSelect: async ({ lat, lon }) => {
|
|
||||||
setRadialMenu((m) => ({ ...m, open: false }))
|
|
||||||
// Immediately show dropped pin
|
|
||||||
useStore.getState().setSelectedPlace({
|
|
||||||
lat,
|
|
||||||
lon,
|
|
||||||
name: 'Dropped pin',
|
|
||||||
address: null,
|
|
||||||
type: null,
|
|
||||||
source: 'radial_menu',
|
|
||||||
matchCode: null,
|
|
||||||
raw: {},
|
|
||||||
})
|
|
||||||
// Reverse geocode in background
|
|
||||||
const place = await fetchReverse(lat, lon)
|
|
||||||
if (place) {
|
|
||||||
const current = useStore.getState().selectedPlace
|
|
||||||
if (current && Math.abs(current.lat - lat) < 0.00001 && Math.abs(current.lon - lon) < 0.00001) {
|
|
||||||
useStore.getState().setSelectedPlace({ ...place, lat, lon })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'add-stop',
|
id: 'add-stop',
|
||||||
label: 'Add stop',
|
label: 'Add stop',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue