Commit a3d1c9652aba339d1cfcd1e340660f9b9240a472
Committed by
GitHub
Merge pull request #1543 from MrKartoshka/improved_polygon_coordinates_parser
improved polygon coordinates parser
Showing
1 changed file
with
7 additions
and
1 deletions
@@ -546,7 +546,13 @@ export default class TbMapWidgetV2 { | @@ -546,7 +546,13 @@ export default class TbMapWidgetV2 { | ||
546 | function mapPolygonArray (rawArray) { | 546 | function mapPolygonArray (rawArray) { |
547 | let latLngArray = rawArray.map(function (el) { | 547 | let latLngArray = rawArray.map(function (el) { |
548 | if (el.length === 2) { | 548 | if (el.length === 2) { |
549 | - return tbMap.map.createLatLng(el[0], el[1]); | 549 | + if (!angular.isNumber(el[0]) && !angular.isNumber(el[1])) { |
550 | + return el.map(function (subEl) { | ||
551 | + return mapPolygonArray(subEl); | ||
552 | + }) | ||
553 | + } else { | ||
554 | + return tbMap.map.createLatLng(el[0], el[1]); | ||
555 | + } | ||
550 | } else if (el.length > 2) { | 556 | } else if (el.length > 2) { |
551 | return mapPolygonArray(el); | 557 | return mapPolygonArray(el); |
552 | } else { | 558 | } else { |