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 inline snippet to marker#addTo #9592

Merged
merged 4 commits into from
Apr 20, 2020
Merged
Changes from 3 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
6 changes: 5 additions & 1 deletion src/ui/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,13 @@ export default class Marker extends Evented {
}

/**
* Attaches the marker to a map
* Attaches a `Marker` to a `Map` object.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just nit picking here, but addTo doesn't add any Marker, it only adds this Marker, so should that be:
attaches the Marker to...

maybe I'm overthinking it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I'm overthinking it.

@andrewharvey Not at all! That distinction makes it a lot clearer - I will update the PR. Thank you!

* @param {Map} map The Mapbox GL JS map to add the marker to.
* @returns {Marker} `this`
* @example
* var marker = new mapboxgl.Marker()
* .setLngLat([30.5, 50.5])
* .addTo(map); // add the marker to the map
*/
addTo(map: Map) {
this.remove();
Expand Down