getSource method

dynamic getSource(
  1. String id
)

Returns the source with the specified ID in the map's style.

@param {string} id The ID of the source to get. @returns {?Object} The style source with the specified ID, or undefined if the ID corresponds to no existing sources. @example var sourceObject = map.getSource('points'); @see Create a draggable point @see Animate a point @see Add live realtime data

Implementation

dynamic getSource(String id) {
  var source = jsObject.getSource(id);
  if (source is GeoJsonSourceJsImpl) {
    return GeoJsonSource.fromJsObject(source);
  }
  if (source is VectorSourceJsImpl) {
    return VectorSource.fromJsObject(source);
  }
  return source;
}