Imagine we are working with the following JSON information
var example = [{
latitude: 11.1111,
longitude: 111.111,
name: "for example1",
altitude: 88
},
{
latitude: 22.2222,
longitude: 222.222,
name: "for example2",
altitude: 89
},
{
latitude: 33.3333,
longitude: 333.333,
name: "for example3",
altitude: 90
}
]
I am looking to extract only the latitude and longitude data from the list or object provided, as my Map API in my react-native application specifically requires this information. Due to performance concerns, I cannot use a loop to achieve this. While querying a database like MySQL separately could solve this problem, I am hesitant to take this approach as it may not be ideal. (I would appreciate any alternate suggestions if available)
Thank you for taking the time to read this. How would you recommend solving this issue?