| 168 | return this.previousElementSibling; |
| 169 | } |
| 170 | zoomTo() { |
| 171 | let extent = this.extent; |
| 172 | let map = this.getMapEl()._map, |
| 173 | xmin = extent.topLeft.pcrs.horizontal, |
| 174 | xmax = extent.bottomRight.pcrs.horizontal, |
| 175 | ymin = extent.bottomRight.pcrs.vertical, |
| 176 | ymax = extent.topLeft.pcrs.vertical, |
| 177 | bounds = Lbounds(Lpoint(xmin, ymin), Lpoint(xmax, ymax)), |
| 178 | center = map.options.crs.unproject(bounds.getCenter(true)), |
| 179 | maxZoom = extent.zoom.maxZoom, |
| 180 | minZoom = extent.zoom.minZoom; |
| 181 | map.setView(center, Util.getMaxZoom(bounds, map, minZoom, maxZoom), { |
| 182 | animate: false |
| 183 | }); |
| 184 | } |
| 185 | getMapEl() { |
| 186 | return Util.getClosest(this, 'mapml-viewer,map[is=web-map]'); |
| 187 | } |