defmodule PyrauiWeb.DocsLive.MapDocs do use PyrauiWeb, :html def render(assigns) do ~H"""
Interactive map component for displaying locations and events. Uses OpenStreetMap tiles for rendering.
<.map latitude={37.7749} longitude={-122.4194} zoom={13} />
<.map
latitude={40.7128}
longitude={-74.0060}
zoom={12}
markers={[
%{lat: 40.7128, lng: -74.0060, label: "New York"},
%{lat: 40.7589, lng: -73.9851, label: "Times Square"}
]}
/>
<.map latitude={51.5074} longitude={-0.1278} zoom={10} width="600px" height="300px" />
| Prop | Type | Default | Description |
|---|---|---|---|
| latitude | float | - | Center latitude coordinate |
| longitude | float | - | Center longitude coordinate |
| zoom | integer | 13 | Zoom level (1-18) |
| markers | list | [] | List of marker maps with :lat, :lng, and optional :label |
| width | string | "100%" | Map width (CSS value) |
| height | string | "400px" | Map height (CSS value) |
The map component requires a JavaScript hook (MapHook) for full interactivity.
For production use, consider integrating with Mapbox, Google Maps, or Leaflet.js for enhanced features.