mapbox / mapbox-gl-leaflet

binding from Mapbox GL JS to the Leaflet API
ISC License
522 stars 155 forks source link

Adds `interactive` option #102

Closed w8r closed 5 years ago

w8r commented 5 years ago

Now, you can create L.MapboxGL layer that will handle the built-in events, too:

var gl = L.mapboxGL({
    accessToken: 'no-token',
    interactive: true
  }).addTo(map);
var mapObject = gl.getMapboxMap();
mapObject.on('mouseenter', 'state-fills', (e) => {
  console.log('state-fills mouseenter', e)
});