({ nw, se, ne, sw }, { width, height })
| 148 | } |
| 149 | |
| 150 | export 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 |
nothing calls this directly
no test coverage detected