GatheringMapController

GatheringMapController

Handles interactive map display for gathering locations using Google Maps. Displays the location on a map and provides options to open in external mapping services for directions and navigation.

Constructor

new GatheringMapController()

Example
<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

Parameters:
NameTypeDescription
locationObject

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