| 121 | } |
| 122 | |
| 123 | zoomTo() { |
| 124 | let extent = this.extent; |
| 125 | let map = this.getMapEl()._map, |
| 126 | xmin = extent.topLeft.pcrs.horizontal, |
| 127 | xmax = extent.bottomRight.pcrs.horizontal, |
| 128 | ymin = extent.bottomRight.pcrs.vertical, |
| 129 | ymax = extent.topLeft.pcrs.vertical, |
| 130 | bounds = Lbounds(Lpoint(xmin, ymin), Lpoint(xmax, ymax)), |
| 131 | center = map.options.crs.unproject(bounds.getCenter(true)), |
| 132 | maxZoom = extent.zoom.maxZoom, |
| 133 | minZoom = extent.zoom.minZoom; |
| 134 | map.setView(center, Util.getMaxZoom(bounds, map, minZoom, maxZoom), { |
| 135 | animate: false |
| 136 | }); |
| 137 | } |
| 138 | |
| 139 | getMapEl() { |
| 140 | return Util.getClosest(this, 'mapml-viewer,map[is=web-map]'); |