l am trying to get objects keys from JSON API url , content on latitude and longitude from server . The data json api content on Object keys and those keys are change all time . l want to get only the coordinates inside of those Object keys and add it to leaflet map marker as array then show on map .
protected points: { lng: number, lat: number }[] = [];
Data : any
data(){
this.http.get("xxxxxxxxxxxx",{},{}).
then((data) => {
this.Data = JSON.parse(data.data);
this.points = Object.keys(this.Data)
.map(key => this.Data[key])
.map((position) => ({
lat: position[0],
lon: position[1]
}));
this.points.forEach((point) => {
new L.Marker([point]