Skip to content
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