Welcome @ItsVenyou
Did you try your solution using an Android or only tested on ios? Does your algorithm work correctly on an Android? (this will indicate whether the problem is an issue with your algorithm or with ios,) or did you forget something? 
Here are several examples that calculate distance (straight line distance) between coordinates that definitely work on Android devices, using different methods.
To calculate distance between the two locations, use one of the methods shown here
An example that calculates a distance matrix isSocial Distancing ... a CloudDB / Location Marker Tutorial
An easy way to create a map from a List of Markers (not a kml or geojson) is shown in the National Parks tutorial. The tutorial demonstrates how to plot multiple run time markers using a csv file to an OpenStreetMap. Use the list from csv Block to convert the csv to a List. What you do depends on how you make your List, where it is stored or is downloaded from. That tutorial might be a good starting point to learn about using the App Inventor Map creation tools. It calculates your distance from your location to all the map Markers and indicates the closest destination marker.
A good way to get directions from one place to a Marker and the actual driving distance (not straight line distance) is described in HOW TO: Use the Navigate control