Skip to content

Commit

Permalink
add more details to getSource (#9587)
Browse files Browse the repository at this point in the history
  • Loading branch information
Colleen McGinnis authored Apr 20, 2020
1 parent 6228c72 commit ea0f47e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1531,14 +1531,22 @@ class Map extends Camera {
/**
* Returns the source with the specified ID in the map's style.
*
* This method is often used to update a source using the instance members for the relevant
* source type as defined in [Sources](#sources).
* For example, setting the `data` for a GeoJSON source or updating the `url` and `coordinates`
* of an image source.
*
* @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.
* @returns {?Object} The style source with the specified ID or `undefined` if the ID
* corresponds to no existing sources.
* The shape of the object varies by source type.
* A list of options for each source type is available on the Mapbox Style Specification's
* [Sources](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/) page.
* @example
* var sourceObject = map.getSource('points');
* @see [Create a draggable point](https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/)
* @see [Animate a point](https://www.mapbox.com/mapbox-gl-js/example/animate-point-along-line/)
* @see [Add live realtime data](https://www.mapbox.com/mapbox-gl-js/example/live-geojson/)
* @see [Create a draggable point](https://docs.mapbox.com/mapbox-gl-js/example/drag-a-point/)
* @see [Animate a point](https://docs.mapbox.com/mapbox-gl-js/example/animate-point-along-line/)
* @see [Add live realtime data](https://docs.mapbox.com/mapbox-gl-js/example/live-geojson/)
*/
getSource(id: string) {
return this.style.getSource(id);
Expand Down

0 comments on commit ea0f47e

Please sign in to comment.