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

maxBounds in config #291

Closed
edenh opened this issue Feb 14, 2014 · 9 comments
Closed

maxBounds in config #291

edenh opened this issue Feb 14, 2014 · 9 comments
Assignees
Milestone

Comments

@edenh
Copy link
Contributor

edenh commented Feb 14, 2014

The equivalent of http://leafletjs.com/reference.html#map-maxbounds would be nice for editorial/datavis projects. Low priority.

cc @mourner @ansis

@edenh
Copy link
Contributor Author

edenh commented Jun 3, 2014

Bump here. Would be great for demo purposes.

@mourner mourner added this to the v1.0.0 milestone Jun 5, 2014
@mourner mourner self-assigned this Jun 24, 2014
@mourner
Copy link
Member

mourner commented Jun 26, 2014

Grabbing.

@mourner
Copy link
Member

mourner commented Jun 26, 2014

How should enforcing max bounds work when rotating the map? Does it zoom in as well so that viewable region is still fully contained within max bounds? cc @kkaefer @incanus

@mourner
Copy link
Member

mourner commented Jun 26, 2014

Or should we restrict it in a way that just map center doesn't go out of it, not screen edges? That would solve the rotation problem.

@incanus
Copy link
Contributor

incanus commented Jun 26, 2014

Native equivalent: mapbox/mapbox-gl-native#236

I have not approached rotation with bounds before, as the iOS SDK did constraints, but not free rotation. Do any other vendors do this? I've not seen it before, and may be why SDKs don't tackle it :-)

We could disallow rotation when constrained.

This is handled in native at low (< 3) zooms, but that makes a bit more sense when out at the full-world view. mapbox/mapbox-gl-native#242 mapbox/mapbox-gl-native#296

@mourner
Copy link
Member

mourner commented Jun 26, 2014

Not sure disallowing rotation when constrained is a good option — e.g. suppose we have an SF data viz — then rotation would be disabled as well, even though user could browse the map zoomed in enough most of the time.

@edenh
Copy link
Contributor Author

edenh commented Jun 26, 2014

In native, it was a little confusing the first time I tried rotating the map at low zooms and it not responding, but I think this is preferable to bounds based on map center.

I'm wondering if we could shoot for a configurable spring effect? This way there is feedback when you've hit the edge.

http://f.cl.ly/items/2I2g0q02101d1f0Z0m2b/spring.mov

@incanus
Copy link
Contributor

incanus commented Jun 26, 2014

The gold standard for this is Apple's MapKit -- exactly. Check out how it works in the Maps.app -- it does this exact springiness as a physical cue. This is what I tried to implement in mapbox/mapbox-gl-native#279 but was causing locking issues.

@mourner
Copy link
Member

mourner commented Aug 6, 2014

Implemented in #646, lets track there

@mourner mourner closed this as completed Aug 6, 2014
bensleveritt pushed a commit to bensleveritt/mapbox-gl-js that referenced this issue Oct 24, 2016
zoom to bounds of polygons too small to see
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

3 participants