[core] Check if frameZoom is NaN in Transform::flyTo callback

This commit is contained in:
Bruno de Oliveira Abinader
2017-06-28 14:36:28 +03:00
parent 433e54e636
commit 1df45a5e42
2 changed files with 10 additions and 0 deletions

View File

@@ -293,6 +293,11 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima
Point<double> framePoint = util::interpolate(startPoint, endPoint, us);
double frameZoom = startZoom + state.scaleZoom(1 / w(s));
// Zoom can be NaN if size is empty.
if (std::isnan(frameZoom)) {
frameZoom = zoom;
}
// Convert to geographic coordinates and set the new viewpoint.
LatLng frameLatLng = Projection::unproject(framePoint, startScale);
state.setLatLngZoom(frameLatLng, frameZoom);