AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

How to hook into MapboxGeocoder's lifecycle events #71

Closed robigan closed 9 months ago

robigan commented 9 months ago

How would I go about using MapboxGeocoder component, access the underlying geocoder and listen to its event emitter? At the moment I have to manually grab the map using useMapbox() and add Geocoder's controls to map in JS/TS. I have no idea how to access MapboxGeocoder's geocoderRef value, so I can hook into it's event emitter.

AlexLavoie42 commented 9 months ago

Currently this is not easily possible. I will work on adding events directly to the geocoder component for v1.5.0 as well as giving direct access to the geocoder using a composable. For now adding the geocoder manually is probably the best solution.

AlexLavoie42 commented 9 months ago

Added in #73