Mapbox-gl-js: expose an api to remove an event Listener

Created on 31 Aug 2016  路  4Comments  路  Source: mapbox/mapbox-gl-js

mapbox-gl-js version: 0.23.0

Steps to Trigger Behavior

https://jsbin.com/tukobihume/edit?html,console,output

Expected Behavior

Actual Behavior

Most helpful comment

Can you elaborate on how to remove an event listener? I did this:

map.on('drag', setPinCoords);
map.off('drag', setPinCoords);

but the second line ("off") didn't work.

All 4 comments

it's seems that there is an api to do that : this.off

Can you elaborate on how to remove an event listener? I did this:

map.on('drag', setPinCoords);
map.off('drag', setPinCoords);

but the second line ("off") didn't work.

@justswim I also got this problem.

@wandergis @justswim the solution is on #3484

Was this page helpful?
0 / 5 - 0 ratings