In my project, I am working on creating markers for each user in my loop. These markers need to be generated in a way that allows me to later select them based on the corresponding userId
.
$.each($.parseJSON(window.usersArray), function (i, user) {
window.userMarkers[user['id']] = L.marker(98.76, 12.34).addTo(map);
console.log(window.userMarkers[user['id']]);
});
AFTER UPDATE
Unfortunately, during this process, I encountered the following error message:
Cannot set property '3' of undefined
, with '3' referring to the specific user's ID.