off method

MapboxMap off(
  1. String type, [
  2. dynamic layerIdOrListener,
  3. Listener? listener
])

Removes a previously registered event listener.

@param {string} type The event type to remove listeners for. @param {Function} listener The listener function to remove. @returns {Object} this

Implementation

MapboxMap off(String type, [dynamic layerIdOrListener, Listener? listener]) {
  if (layerIdOrListener is Listener) {
    return MapboxMap.fromJsObject(
      jsObject.off(type, allowInterop(
        (EventJsImpl object) {
          layerIdOrListener(Event.fromJsObject(object));
        },
      )),
    );
  }
  return MapboxMap.fromJsObject(
      jsObject.off(type, layerIdOrListener, allowInterop(
    (EventJsImpl object) {
      listener!(Event.fromJsObject(object));
    },
  )));
}