diff --git a/README.md b/README.md index 3795c38..6ccf07e 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,28 @@ Manages user sessions. - **`login(identifier, password, type)`**: Validates credentials against `MOCK_USERS`. - **`user` object**: Contains `role`, `name`, `id`, and permissions. +## πŸ—ΊοΈ Map Functionality & Geospatial Logic + +The map interface (`src/pages/Maps.jsx`) is the core operational view, overlaying business data on real-world geography. + +### 1. Visualization & Overlays +- **Rendering Engine**: Powered by `react-leaflet`. +- **Polygons**: Property boundaries are drawn using the `Polygon` component, taking an array of `[lat, lng]` coordinates. +- **Status Styling**: + - **Hot Lead**: Red Fill (`#ef4444`) + - **Customer**: Emerald Fill (`#10b981`) + - **Renovated**: Blue Fill (`#3b82f6`) + - **Neutral**: Zinc Fill (Default) + +### 2. Interaction & Data Retrieval +- **Click-to-Reveal**: Clicking a polygon triggers `onSelect(property)`, opening the **Property Drawer**. + - **Returns**: Full `propertyData` (Address, Build Year, Value) and `ownerData` (Name, Contact, Intent). +- **Reverse Geocoding (New Property)**: + - **Trigger**: Clicking an empty map area (Field Agents only). + - **API Call**: `https://nominatim.openstreetmap.org/reverse` + - **Parameters**: `lat`, `lon`, `format='json'`. + - **Return**: Returns a JSON object where `display_name` is extracted as the property address. + ## πŸ“š Function Documentation ### `useMockStore: addMeeting(meeting)`