Browse Source
Merge pull request #1543 from MrKartoshka/improved_polygon_coordinates_parser
improved polygon coordinates parser
pull/1558/head
Igor Kulikov
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
ui/src/app/widget/lib/map-widget2.js
|
|
|
@ -546,7 +546,13 @@ export default class TbMapWidgetV2 { |
|
|
|
function mapPolygonArray (rawArray) { |
|
|
|
let latLngArray = rawArray.map(function (el) { |
|
|
|
if (el.length === 2) { |
|
|
|
return tbMap.map.createLatLng(el[0], el[1]); |
|
|
|
if (!angular.isNumber(el[0]) && !angular.isNumber(el[1])) { |
|
|
|
return el.map(function (subEl) { |
|
|
|
return mapPolygonArray(subEl); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return tbMap.map.createLatLng(el[0], el[1]); |
|
|
|
} |
|
|
|
} else if (el.length > 2) { |
|
|
|
return mapPolygonArray(el); |
|
|
|
} else { |
|
|
|
|