Here I have a nArray function which return me a bigArray - JSON so with nArray function I create a bigArray objects
Example:
Array[5]
0: Object
1: Object
DISTANCE_FROM_PREVIOUS_OBJECT_LOCATION: 2.087970147789207
lat: "48.866588"
leftPosition: 183
lng: "2.309037999999987"
topPosition: 57
__proto__: Object
2: Object
3: Object
4: Object
length: 5
__proto__: Array[0]
As you can see I have Objetcs in bigArray that contain: lat,left,lng,top and DISTANCE_
Now I need with function updateTooltipContent to get DISTANCE from OBJECT where is latt=lat:
function updateTooltipContent() {
var latt = $(this).attr("lat");
//FIND IN WHICH OBJECT IS latt = lat and from that OBJECT[i] get DISTANCE_ ...
return "Distance is" + DISTANCE_FROM_PREVIOUS_LOCATION;
}
});
Is there any way to do that? So I need to call function nArray which will create bigArray and from thee find in which objet is latt = lat and get from that OBJECT[i] DISTANCE