Data :
const zones = [
{
"ID":"4131",
"RID":"f1438b",
"Name":"Hero"
},
{
"ID":"6266",
"RID":"cd074d",
"Name":"Villan"
}
]
My Code :
<Polygon positions={}>
<Popup>
{poly.ID}
</Popup>
</Polygon>
Where, poly.ID is "4131".
I need to display Name instead of poly.ID. And Name is obtained from the above Data, where poly.ID is mapped to get the Name.
I tried,
<Polygon positions={}>
<Popup>
{zones.map((zone) => poly.ID === zone.Name)}
</Popup>
</Polygon>
But it, doesn't seem to render Name nor nothing