MCPcopy Index your code
hub / github.com/google-map-react/google-map-react / fitBounds

Function fitBounds

src/lib/index.js:150–167  ·  view source on GitHub ↗
({ nw, se, ne, sw }, { width, height })

Source from the content-addressed store, hash-verified

148}
149
150export function fitBounds({ nw, se, ne, sw }, { width, height }) {
151 let fittedData;
152
153 if (nw && se) {
154 fittedData = fitNwSe(nw, se, width, height);
155 } else {
156 const calculatedNwSe = convertNeSwToNwSe({ ne, sw });
157 fittedData = fitNwSe(calculatedNwSe.nw, calculatedNwSe.se, width, height);
158 }
159
160 return {
161 ...fittedData,
162 newBounds: {
163 ...fittedData.newBounds,
164 ...convertNwSeToNeSw(fittedData.newBounds),
165 },
166 };
167}
168
169// -------------------------------------------------------------------
170// Helpers to calc some markers size

Callers

nothing calls this directly

Calls 3

fitNwSeFunction · 0.85
convertNeSwToNwSeFunction · 0.85
convertNwSeToNeSwFunction · 0.85

Tested by

no test coverage detected