I have a DB query which returns a bunch of location based data from my DB. I end up with a list of objects (which I put in to a single object and console.log() it to see whats inside).
Each object represents an entry from a user which contains notes on the location:
It contains: store name, address, userID, notes.
So many people can visit the location and write different notes. What I want to do is put the locations on a Google Map (JS API) and kind of group by location, so when a marker is clicked, it contains all notes for that location.
SO I thought about grouping the objects returned by address, then for each address, plot the marker and loop through.
for (var i = 0; i < rowCountVisits; i++) {
var storelatlng = new google.maps.LatLng(
parseFloat(result[2].latVisit[i]),
parseFloat(result[2].lngVisit[i]));
locationsObjVisits.push({
storelatlng: storelatlng,
vName: result[2].vName[i],
address: result[2].locationVisit[i],
date: result[2].dateVisit[i],
notes: result[2].notes[i],
usersName: result[2].user.thisName[i],
thisColour: result[2].user.thisColour[i]
});
}
So the locationsObjVisits... I am not sure what to do with this. Any ideas?