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

[Bug] dragRotate enabled unexpectedly when dragging the map by right mouse button in maplibregl map #391

Open
erlzhang opened this issue Jan 3, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@erlzhang
Copy link
Contributor

erlzhang commented Jan 3, 2025

Describe the bug
I use the maplibregl adapter and set dragRotate:false. When I drag the map by right mouse button, dragRotate was enabled unexpectedly. I think the problem is from the following function, dragRotate and dragPan should keep the original setting if enabled is true.

/**
	 * Enables or disables the draggable functionality of the map.
	 * @param enabled Set to true to enable map dragging, or false to disable it.
	 */
	public setDraggability(enabled: boolean) {
		if (enabled) {
			// Mapbox GL has both drag rotation and drag panning interactions
			// hence having to enable/disable both
			this._map.dragRotate.enable();
			this._map.dragPan.enable();
		} else {
			this._map.dragRotate.disable();
			this._map.dragPan.disable();
		}
	}

Terra Draw npm version
1.0.0-beta.8

@erlzhang erlzhang added the bug Something isn't working label Jan 3, 2025
@JamesLMilner
Copy link
Owner

Hi @erlzhang thanks for raising, I will investigate and get back to you about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants