diff --git a/projects/portal-core-ui/src/lib/service/cesium-map/cs-clipboard.service.ts b/projects/portal-core-ui/src/lib/service/cesium-map/cs-clipboard.service.ts index e3b4ab4..91a046d 100644 --- a/projects/portal-core-ui/src/lib/service/cesium-map/cs-clipboard.service.ts +++ b/projects/portal-core-ui/src/lib/service/cesium-map/cs-clipboard.service.ts @@ -79,19 +79,23 @@ export class CsClipboardService { } return lngLatList.join(' '); } + /** * Method for extract a polygon coords string from geometry. * @param geometry string * @returns the string of a polygon string. */ public getCoordinates(geometry: string): string { - const tag = ''; - const coordsString = geometry.substring( - geometry.indexOf(tag) + tag.length, - geometry.indexOf('') - ); - return coordsString; + let coordString = ''; + const gmlCoordsTagPos = geometry.indexOf('', gmlCoordsTagPos); + coordString = geometry.substring(closingGmlCoordsTagPos + 1, geometry.indexOf('')); + } + return coordString; } + + /** * swap coordinates for geometry. * @param geometry string @@ -103,6 +107,7 @@ export class CsClipboardService { const swapedGeometry = this.getGeometry(swappedCoords); return swapedGeometry; } + /** * Method for construct a polygon geometry. * @param coords string @@ -191,8 +196,8 @@ export class CsClipboardService { }; reader.readAsText(file); } - } + /** * Load a polygon on map from ROI * @@ -216,6 +221,7 @@ export class CsClipboardService { this.polygonsBS.next(this.polygonBBox); return; } + /** * Add a polygon to the clipboard, usually from a layer * @param newPolygon polygon object