In edit mode, the coordinate text is replaced with a small map showing a draggable marker; dropping it autosaves the new lat/lng. Name and country stay editable via text fields only. New-city creation still uses the search box and shows plain coordinates. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
13 lines
417 B
TypeScript
13 lines
417 B
TypeScript
import L from 'leaflet';
|
|
import type { CityStatus } from '@citytracker/shared';
|
|
|
|
export function cityMarkerIcon(status: CityStatus): L.DivIcon {
|
|
const color = status === 'visited' ? '#2f9e44' : '#1971c2';
|
|
return L.divIcon({
|
|
className: 'city-marker',
|
|
html: `<span class="marker-pin" style="background:${color}"></span>`,
|
|
iconSize: [22, 22],
|
|
iconAnchor: [11, 11],
|
|
popupAnchor: [0, -14],
|
|
});
|
|
}
|