MCPcopy Index your code
hub / github.com/Maps4HTML/MapML.js / zoomTo

Method zoomTo

src/map-tile.js:170–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 1

getMapElMethod · 0.95

Tested by

no test coverage detected