(latlngs, levelsDeep, closed, precision)
| 9173 | // `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default. |
| 9174 | // Coordinates values are rounded with [`formatNum`](#util-formatnum) function. |
| 9175 | function latLngsToCoords(latlngs, levelsDeep, closed, precision) { |
| 9176 | var coords = []; |
| 9177 | |
| 9178 | for (var i = 0, len = latlngs.length; i < len; i++) { |
| 9179 | // Check for flat arrays required to ensure unbalanced arrays are correctly converted in recursion |
| 9180 | coords.push(levelsDeep ? |
| 9181 | latLngsToCoords(latlngs[i], isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) : |
| 9182 | latLngToCoords(latlngs[i], precision)); |
| 9183 | } |
| 9184 | |
| 9185 | if (!levelsDeep && closed && coords.length > 0) { |
| 9186 | coords.push(coords[0].slice()); |
| 9187 | } |
| 9188 | |
| 9189 | return coords; |
| 9190 | } |
| 9191 | |
| 9192 | function getFeature(layer, newGeometry) { |
| 9193 | return layer.feature ? |
no test coverage detected