PShape get Children target name afterwards

Hi, i’m working on the next iteration of my corona virus data viz apllication and got stuck in a PShape issue. Is there a way to get PShape children target names?

Above is the current situation of the dashboard. The issue is related with the two choreopletic maps in right.
The first map is working fine, I have the first SVG, a full list of cities in a given state, and an ArrayList with all the cities and it’s data. The connection between data and shape child is working fine.
I’m having trouble with the second map. it’s a differnt svg file, the path names/ids are equal on both maps.
what i intend to do but cannot right now is get the child name on the second map and retrieve the data from the ArrayList.

to build the base map is quite simple:
obs. rmPG is a specific PGraphics for the second map. there’s no reason to rebuild the map each cycle.

      int numChild=rm.getChildCount();
      for (int i=0; i<numChild; i++) {
        rmPG.strokeWeight(.25);
        rmPG.stroke(32);
        rmPG.fill(64);
        PShape temp=rm.getChild(i);
        rmPG.shape(temp, 0, 0);
      }

the issue is
i can use to retrieve an specific child of an SVG PShape

getChild(int)
getChild(String)

what i need
use getChild(int)
get the target name of that given child to search for the same city in the cities ArrayList and retrieve that city data.

i don’t know it my doubt is clear.
thanks in advance

1 Like

i’ve solved it.
in the PShape documentation there’s getName() method

String s=shape.getName();
1 Like