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

[Zoom] Respect zoom limits #356

Open
3 tasks done
artmarks opened this issue Sep 11, 2024 · 1 comment
Open
3 tasks done

[Zoom] Respect zoom limits #356

artmarks opened this issue Sep 11, 2024 · 1 comment

Comments

@artmarks
Copy link
Contributor

Issue description

Issue description

The current Zoom-component doesn't completely respect the zoom / scale limits if set.

  1. When zoom limits are set, and the user is in the max / min zoom level, the Zoom-component trys to zoom in / out further and cancels its anitmation, whichs leads to a wobbling in and out effect on the map.
  2. If the user should only be able to zoom to the given resolutions, (with constrainResolution: true in the MapConfigProviderImpl), the user can "cheat" in between, if the zoom button is clicked while it is still animating.

Reproduce

Example configuration in MapConfigProviderImpl

{
	initialView: {
	  kind: "position",
	  center: { x: 404747, y: 5757920 },
	  zoom: 14
	},
	advanced: {
	  view: {
		maxZoom: 15,
		minZoom: 13,
                constrainResolution: true
	  },
	},
	layers: [
	  new SimpleLayer({
		  title: "OSM",
		  isBaseLayer: true,
		  olLayer: new TileLayer({
			  source: new OSM()
		  })
	  })
	]
};

Try the showcase demo mapNavigation

Validations

@mbeckem
Copy link
Contributor

mbeckem commented Sep 12, 2024

PR: #357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants