In my array, I am storing multiple values together such as:
var locations = [
'Bhopal','Mobile',new google.maps.LatLng(18.40,78.81),'images/mobile.png',
'Bangalore','Television',new google.maps.LatLng(18.30,83.90),'images/television.png',
'Hyderabad','Footwear',new google.maps.LatLng(22.95,88.42),'images/footwear.png',
'Kolkata','Kitchen',new google.maps.LatLng(22.58,88.33),'images/kitchen.png',
'Mumbai','Furniture',new google.maps.LatLng(26.16,85.88),'images/furniture.png'
];
Now, when using the drop function, it retrieves the new LatLng values from the array.
function drop() {
clearMarkers();
for (var i = 0; i < locations.length; i++) {
addMarkerWithTimeout(locations[i], i * 200);
}
}
I want to not only get the LatLng values in the drop function but also obtain the first two values like 'Bhopal' and 'Mobile' and alert them. How can I achieve this?