beyonk-group / svelte-mapbox

MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
MIT License
343 stars 61 forks source link

event #19

Closed chun49 closed 3 years ago

chun49 commented 4 years ago

on:click can not be used at Map component

GenieTim commented 4 years ago

I suppose you should be able to use the events listed here: https://docs.mapbox.com/mapbox-gl-js/api/map/#map-events

For example, in the script section of the example in the README you could use:

mapComponent.on('click', (e) => { console.log(e.lngtlat); })