Get a list of waypoints assuming that there is a map

I’m a beginner learning ROS. I’m developing an android application that will control my robot and that includes getting the list of waypoints to display it to my spinner. just wanted to ask on how do you get the list of waypoints from the topic /waypoints assuming that there is a map?