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 example for trackPointer #9575

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
9 changes: 7 additions & 2 deletions src/ui/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,13 @@ export default class Popup extends Evented {
}

/**
* Tracks the popup anchor to the cursor position, on screens with a pointer device (will be hidden on touchscreens). Replaces the setLngLat behavior.
* For most use cases, `closeOnClick` and `closeButton` should also be set to `false` here.
* Tracks the popup anchor to the cursor position on screens with a pointer device (it will be hidden on touchscreens). Replaces the `setLngLat` behavior.
* For most use cases, set `closeOnClick` and `closeButton` to `false`.
* @example
* var popup = new mapboxgl.Popup({ closeOnClick: false, closeButton: false })
* .setHTML("<h1>Hello World!</h1>")
* .trackPointer()
* .addTo(map);
* @returns {Popup} `this`
*/
trackPointer() {
Expand Down