1

Using the panzoom library, assuming the containing div is 400x300px, and an interesting item is found on 120-150x200-250 (Before zooming), how can one programmatically zoom to this rectangle with a smooth zoom in?

Udi
  • 29,222
  • 9
  • 96
  • 129
  • What have you tried so far? – evolutionxbox Jul 05 '20 at 22:16
  • I've tried `smoothZoom()`, `smoothZoomAbs()`, `zoomTo()`, `moveTo()`, `centerOn()`, and even manually with `getTransform()`. The lib is very simple to set up - but the API docs are missing. – Udi Jul 05 '20 at 22:20
  • Which panzoom? There's a bunch of them. – evolutionxbox Jul 05 '20 at 22:22
  • @evolutionxbox: question updated with lib link. – Udi Jul 05 '20 at 22:26
  • May you share an [mcve] of your `zoomTo`/`moveTo` attempt? I can't see how else you can do it, unless you use `kinetic.js` directly? – evolutionxbox Jul 05 '20 at 22:31
  • @evolutionxbox: no. This is a basic question. Compare with leaflet's [`panTo()`](https://leafletjs.com/reference-1.6.0.html#map-panto) or [`fitBounds()`](https://leafletjs.com/reference-1.6.0.html#map-fitbounds) methods. – Udi Jul 05 '20 at 22:40
  • `pz.showRectangle` looks promising, but it doesn't look like the library has an equivalent to `fitBounds()`. – evolutionxbox Jul 05 '20 at 23:07

0 Answers0