Commit 76e1af60c2742f26355ab101f9fa3745e1d9c7a0

Authored by Maksym Dudnik
1 parent c5171f00

improved polygon coordinates parser

... ... @@ -546,7 +546,13 @@ export default class TbMapWidgetV2 {
546 546 function mapPolygonArray (rawArray) {
547 547 let latLngArray = rawArray.map(function (el) {
548 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 556 } else if (el.length > 2) {
551 557 return mapPolygonArray(el);
552 558 } else {
... ...