When it comes to displaying dynamic data with markers on a map, everything works fine up until this point. However, I've encountered some issues that I'm currently stuck on and not sure how to proceed.
Dynamic data:
{
"page": 2,
"data": [
{
"id": 4,
"first_name": "Eve",
"last_name": "Holt",
"lat":"25.6599899",
"lng":"45.3664646",
"status":"0"
},
{
"id": 5,
"first_name": "Charles",
"last_name": "Morris",
"lat":"25.99899",
"lng":"45.4646",
"status":"1"
},
{
"id": 6,
"first_name": "Tracey",
"last_name": "Ramos",
"lat":"25.2339899",
"lng":"45.56664646",
"status":"1"
}
]
}
Issue 1: Count the occurrences of 'Status' value being 0 and 1
Issue 2: After counting, if there are 3 people with Status 1, display individual buttons dynamically for each person; likewise for Status 0
Issue 3: Clicking on a specific button should trigger an info window to open on the map at the corresponding marker location
This is my Dynamic Marker Code:
addMarker(latlng, mapobj, markerLabel, iconColor) {
this.iconDisplay =[];
if(iconColor === "0"){
this.iconDisplay = this.red;
}else if(iconColor === "1"){
this.iconDisplay = this.green;
}else if(iconColor === "2"){
this.iconDisplay = this.orange;
}else if(iconColor === "3"){
this.iconDisplay = this.building;
};
// Additional marker code here...