Constructor
new GatheringMapController()
<div data-controller="gathering-map"
data-gathering-map-location-value="123 Main St, City, State"
data-gathering-map-gathering-name-value="Great Western War">
<div data-gathering-map-target="map"></div>
</div>Methods
connect()
Connect function - runs when controller connects to DOM
(async) createMarker(location)
Create marker on the map
| Name | Type | Description |
|---|---|---|
location | Object | Google Maps LatLng or {lat, lng} object |
disconnect()
Cleanup when controller disconnects
(async) geocodeAndDisplayGoogle()
Geocode location and display on Google Maps with AdvancedMarkerElement Uses stored lat/lng if available to avoid geocoding API call
getDirections()
Get directions to location in Google Maps Uses stored lat/lng if available for precise destination, otherwise uses address string
(async) initGoogleMap()
Initialize Google Maps
initialize()
Initialize the controller
loadGoogleMapsScript()
Load Google Maps Script dynamically with marker library Memoized to prevent concurrent script injections and share a single Promise
openInAppleMaps()
Open location in Apple Maps (works on supported devices) Uses stored lat/lng if available for precise location, otherwise uses address string
openInGoogleMaps()
Open location in Google Maps (new window/tab) Uses stored lat/lng if available for precise location, otherwise uses address string
showError()
Show error message