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

Move scale bar when zooming #178

Open
jywarren opened this issue Feb 17, 2019 · 3 comments
Open

Move scale bar when zooming #178

jywarren opened this issue Feb 17, 2019 · 3 comments

Comments

@jywarren
Copy link
Member

Currently, dragging the scale bar zooms the map, but not the inverse -- zooming the map should automatically move the scale bar too. We'd love help implementing this!

image

Here's the slider code:

var changeZoom = function() {
var zoom = slider.getValue();
blurredLocation.map.setZoom(zoom);
}
var slider = $('#ex1').slider()
.on('slide', changeZoom)
.data('slider');

We could wire it up to change the scale bar on the map's zoom event:

options.map.on('zoom', options.onDrag);

@jywarren
Copy link
Member Author

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!


@lohitha02
Copy link
Member

Can I claim this issue?

@grvsachdeva
Copy link
Member

Go ahead @lohitha02!

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

No branches or pull requests

4 participants