Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docsprint] Add more details to getSource #9587

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1460,14 +1460,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