This is useful for behaviour customization, but very useful for detecting whether a camera event was triggered by the user or programatically, as discussed here mapbox-gl-js/issues/9700
This library already has a single function that initializes all camera moves, _fly, with two usages of fitBounds and one usage of flyTo.
Adding an eventData argument (which is just a user defined object) to these invocations (as the 2nd/3rd parameter respectively) works as expected. Passing undefined as eventData works as expected, too, there is no change compared to the current behaviour and events are not modified.
The eventData could be supplied by the user through the geocoder initialization options, as well as through a function that could update it after instance creation.
Camera move functions can have additional
eventData
passed to them, which is passed to event listeners of camera events ('move', 'zoom', etc)https://docs.mapbox.com/mapbox-gl-js/api/map/#map#flyto https://docs.mapbox.com/mapbox-gl-js/api/map/#map#fitbounds
This is useful for behaviour customization, but very useful for detecting whether a camera event was triggered by the user or programatically, as discussed here mapbox-gl-js/issues/9700
This library already has a single function that initializes all camera moves, _fly, with two usages of
fitBounds
and one usage offlyTo
.Adding an
eventData
argument (which is just a user defined object) to these invocations (as the 2nd/3rd parameter respectively) works as expected. Passingundefined
aseventData
works as expected, too, there is no change compared to the current behaviour and events are not modified.The
eventData
could be supplied by the user through the geocoder initialization options, as well as through a function that could update it after instance creation.