I have two arrays of objects that I'm trying to feed into a function. One array is a test array that contains 4 objects, the other array contains 1600 objects. The test array is functioning as expected, while the large array is not.
The only difference I can see is here in the console of the browser when logged:
Can someone tell me what the difference in these two arrays is?
Here's the code I'm using to populate the arrays:
let featureGeometriesArray = [];
function geoJsonPointsToArray(data) {
// Select just the features of the input GeoJSON data
let features = data.features;
// console.log(features);
// Create an empty array to hold a lat-lng coordinate array of each feature
// let featureGeometriesArray = [];
// Iterate through each feature (f) in features
features.forEach(function (f) {
// Create an array containing the latitude and longitude values for the feature and push that array into featureGeometriesArray
// console.log(f.geometry.coordinates[1])
// featureGeometriesArray.push([f.geometry.coordinates[1], f.geometry.coordinates[0]])
featureGeometriesArray.push({"lat":f.geometry.coordinates[1], "lng":f.geometry.coordinates[0]})
});
// Return featureGeometriesArray now populated with lat-lng coordinate array for each of the points in the input GeoJSON file
return featureGeometriesArray
}
var testData = {
max: 8,
data: [{
lat: 33.0634804,
lng: -80.0935456
}, {
lat: 33.15065,
lng: -80.145799
},
{
lat: 33.6523106,
lng: -78.9350132
},
{
lat: 34.645637,
lng: -82.600961
}]
};
console.log(testData.data)
var testData = {
// max: 8,
data: featureGeometriesArray
};
// console.log(featureGeometriesArray)
console.log(testData.data.length)