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

Method zoomTo

src/map-feature.js:745–756  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

743
744 // a method that can the viewport to be centred on the feature's extent
745 zoomTo() {
746 let extent = this.extent,
747 map = this.getMapEl()._map;
748 let tL = extent.topLeft.pcrs,
749 bR = extent.bottomRight.pcrs,
750 bound = bounds(
751 point(tL.horizontal, tL.vertical),
752 point(bR.horizontal, bR.vertical)
753 ),
754 center = map.options.crs.unproject(bound.getCenter(true));
755 map.setView(center, this.getZoomToZoom(), { animate: false });
756 }
757 whenReady() {
758 return new Promise((resolve, reject) => {
759 let interval, failureTimer;

Callers

nothing calls this directly

Calls 3

getMapElMethod · 0.95
getZoomToZoomMethod · 0.95
boundsFunction · 0.85

Tested by

no test coverage detected