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

flyTo=false disables all map movement, not just animation #78

Closed
tmcw opened this issue Nov 14, 2016 · 1 comment
Closed

flyTo=false disables all map movement, not just animation #78

tmcw opened this issue Nov 14, 2016 · 1 comment

Comments

@tmcw
Copy link
Contributor

tmcw commented Nov 14, 2016

if (this.options.flyTo) {
if (!exceptions[selected.id] &&
(selected.bbox && selected.context && selected.context.length <= 3 ||
selected.bbox && !selected.context)) {
var bbox = selected.bbox;
this._map.fitBounds([[bbox[0], bbox[1]],[bbox[2], bbox[3]]]);
} else if (exceptions[selected.id]) {
// Certain geocoder search results return (and therefore zoom to fit)
// an unexpectedly large bounding box: for example, both Russia and the
// USA span both sides of -180/180, or France includes the island of
// Reunion in the Indian Ocean. An incomplete list of these exceptions
// at ./exceptions.json provides "reasonable" bounding boxes as a
// short-term solution; this may be amended as necessary.
this._map.fitBounds(exceptions[selected.id].bbox);
} else {
this._map.flyTo({
center: selected.center,
zoom: this.options.zoom
});
}
}

All map movement is within a if (this.options.flyTo) clause. I'm assuming that this is not the intent: flyTo is documented as disabling animation, but I can't imagine that implying that it disables all map movement, because that's essentially what the function of this control.

But it looks like this has been the behavior of flyTo since the beginning - can you confirm if "no movement" is the intent @tristen ? If so, we need to rename and redocument the option.

@tristen
Copy link
Member

tristen commented Nov 14, 2016

This is terrible. flyTo should just hand off options to the map object. Related: #51

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