I need to generate a specific tab based on the data in my JSON response. Here is what I require:
markers: [
position: {
lat:50.8999208,
lng:20.6258000
},
vin: vinfromresponse
},
{
position: {
lat:50.8911111,
lng:20.6259999
},
vin: vinfromresponse
},
]
The JSON response from my REST API is structured like this (although typically there are multiple objects rather than just one):
[{"id":1,"vin":58222,"register_number":"TK2332","cost":1.32,"latitude":20.6285908,"longitude":50.872941,"service":false,"reservation":false}]
However, the new array I want to create must have field names 'lat' and 'lng' for it to work with Google Maps API markers. I am unsure how to properly assign the data from my JSON response to fit this structure. I lack experience with JavaScript and could use some guidance.