(startProps, endProps, t, options)
| 80662 | speed: 1.2 |
| 80663 | }; |
| 80664 | function flyToViewport(startProps, endProps, t, options) { |
| 80665 | const { startZoom , startCenterXY , uDelta , w0 , u1 , S , rho , rho2 , r0 } = getFlyToTransitionParams(startProps, endProps, options); |
| 80666 | if (u1 < EPSILON) { |
| 80667 | const viewport = {}; |
| 80668 | for (const key of VIEWPORT_TRANSITION_PROPS){ |
| 80669 | const startValue = startProps[key]; |
| 80670 | const endValue = endProps[key]; |
| 80671 | viewport[key] = (0, _mathUtils.lerp)(startValue, endValue, t); |
| 80672 | } |
| 80673 | return viewport; |
| 80674 | } |
| 80675 | const s = t * S; |
| 80676 | const w = Math.cosh(r0) / Math.cosh(r0 + rho * s); |
| 80677 | const u = w0 * ((Math.cosh(r0) * Math.tanh(r0 + rho * s) - Math.sinh(r0)) / rho2) / u1; |
| 80678 | const scaleIncrement = 1 / w; |
| 80679 | const newZoom = startZoom + (0, _webMercatorUtils.scaleToZoom)(scaleIncrement); |
| 80680 | const newCenterWorld = _vec2.scale([], uDelta, u); |
| 80681 | _vec2.add(newCenterWorld, newCenterWorld, startCenterXY); |
| 80682 | const newCenter = (0, _webMercatorUtils.worldToLngLat)(newCenterWorld); |
| 80683 | return { |
| 80684 | longitude: newCenter[0], |
| 80685 | latitude: newCenter[1], |
| 80686 | zoom: newZoom |
| 80687 | }; |
| 80688 | } |
| 80689 | exports.default = flyToViewport; |
| 80690 | function getFlyToDuration(startProps, endProps, options) { |
| 80691 | const opts = { |
nothing calls this directly
no test coverage detected