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

Gray out zoom buttons at maxZoom/minZoom #8023

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

andycalder
Copy link
Contributor

@andycalder andycalder commented Mar 12, 2019

This is a simple UI enhancement. When the map is at maxZoom, the NavigationControl looks like this:
zoomingrayed
And likewise at minZoom:
zoomoutgrayed

This is standard behaviour for zoom controls in many applications. I was going to implement my own buttons because I wanted this functionality, but then I thought "why not just add it to the library?"

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality (NavigationControl has no unit tests. Should it?)
  • manually test the debug page
  • fix flickering issue on Safari/Firefox

On Safari and Firefox there is an almost imperceptible flicker when the background-image changes. The geolocate icon has the same problem. Chrome seems to render perfectly. I haven't tested IE/Edge. Does anyone have any advice on the best way to fix this?

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

Could we avoid duplicating the icon SVGs by doing some CSS magic instead? E.g. some semitransparent white overlay with :after?

@ryanhamley
Copy link
Contributor

A CSS blend mode could be helpful

@andycalder
Copy link
Contributor Author

Thanks for the suggestions. I managed to get it working using opacity, which fixes the flickering issue and avoids duplicating SVGs.

@mourner mourner merged commit ceeb899 into mapbox:master Mar 13, 2019
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

Successfully merging this pull request may close these issues.

3 participants