diff --git a/index.js b/index.js index d075c02..9cd223e 100644 --- a/index.js +++ b/index.js @@ -25,20 +25,15 @@ function testLines(ring1, ring2) { } function getCoordinates(polygon) { - var coords = [[[]]]; - switch (polygon.geometry.type) { case 'LineString': - coords = [[polygon.geometry.coordinates]]; - break; + return [[polygon.geometry.coordinates]]; case 'Polygon': - coords = [polygon.geometry.coordinates]; - break; + return [polygon.geometry.coordinates]; case 'MultiPolygon': - coords = polygon.geometry.coordinates; - break; + return polygon.geometry.coordinates; } - return coords; + return [[[]]]; } /**