diff --git a/client/wfnews-war/src/main/angular/src/app/services/common-utility.service.ts b/client/wfnews-war/src/main/angular/src/app/services/common-utility.service.ts index d49ad66ad7..7ae98c61d7 100644 --- a/client/wfnews-war/src/main/angular/src/app/services/common-utility.service.ts +++ b/client/wfnews-war/src/main/angular/src/app/services/common-utility.service.ts @@ -302,24 +302,15 @@ export class CommonUtilityService { } extractPolygonData(response) { - const isWebkitBrowser = navigator.userAgent.indexOf('AppleWebKit') > -1; - const polygonData = []; - - if (this.capacitorService.isIOS() || isWebkitBrowser) { - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (let i = 0; i < response.length; i++) { - // iOS does not like the splat operator - polygonData.push(response[i][0], response[i][1]); - } - } else { - for (const element of response) { - polygonData.push(...element); - } + let polygonData = []; + + for (const element of response) { + polygonData = polygonData.concat(element); } - + return polygonData; } - + createConvex(polygonData) { const turfPoints = polygonData.map(coord => window['turf'].point(coord)); const pointsFeatureCollection = window['turf'].featureCollection(turfPoints);