Closed GraplnMonkey closed 2 years ago
Can you be more specific with what you're trying to do? The GmapMap
component emits events already, so you can do <GmapMap @click=mapAction>
, mapAction
will receive lat/lng data relative to where the user clicked on the map.
We're good. What I needed to do was add an event listener to the map for clicks:
google.maps.event.addListener(this.map, "click", (e) => { new window.google.maps.Marker({ position: {lat: e.latLng.lat(), lng: e.latLng.lng()}, map: this.map
I might be using this wrong, but most of the point of using Google Maps is the ability to capture user interactions and transfer that event object to functions that use features like Markers. If this doesn't work this package is pretty useless...