I have an object array like this
polyPaths: LatLngLiteral[] = [{lat: 12.994169219614097, lng: 77.62397007054658}
{lat: 12.984802167360343, lng: 77.67581180638642}
{lat: 12.957702635784846, lng: 77.65864566869111}
{lat: 12.974765648082716, lng: 77.61538700169892}];
I want to show this object array as string in textarea
(12.994169219614097,77.62397007054658)
(12.984802167360343,77.67581180638642)
(12.957702635784846,77.65864566869111)
(12.974765648082716,77.61538700169892)
On text input change, I want string revert back to object array of polyPaths.
I tried with following js example:
let stringPath = this.polyPaths.map(path => {
return '(' + path.lat + ',' + path.lng + ')';
});
var convertedPath = stringPath.join('');
this.polyControls.area.setValue(convertedPath);
But not able to revert it back on input change.