How to code to generate waypoints and set mission

I’m trying to build an app and want it to have a guided path by setting missions. But i’m not able to generate/load the waypoints and also to set and start the mission.
i’m using getAttribute to know the latitude longitude and altitude. But i’m not able to retrieve values from the map to set the guided path.
is there anything I’m missing out??