
The example at the link above uses the simple locationsensor that is part of the Map component to provide its location information. The AI LocationSensor component is not necessary or used. The code required to use the AI LocationSensor component with Maps is slightly involved. I believe using the included locationsensor in Maps is the prefered method for those developers just learning how to use the Map component. The Maps link to the GPS works just fine. Once you get this working, you might experiment using the LocationSensor in conjunction with Maps.

The code in Button3.Click adds a Marker to the example App. The code places the Marker about 0.1 kilometers North of the device location (see below). When you code
your app don't use the blocks at the top (they are what works in the example and they work for anyone recreating this example).. Yes, the app knows where you are if you code your project
this way. Use the upper blocks to test placing a Marker and when they work, use the lower blocks to position the marker in your app.

The code in Button4.Click calculates the "straight line" distance between the Marker1 and the device location using spherical geometry (essentially a Great circle algorithm) in the Map object. The Map component calculates distances in meters. To calculate distance in kilometers the forumula should be: kilometers= meters/1000 ; to calculate feet: feet = meters x 3.28084 ; to calculate miles: miles = meters x 0.000621371 . Adjust the code apropriately.
When you first run the modified example, do not attempt to use Button3 or Button 4 in the app example until after the map renders. There is no error control in this simple example. The blocks demonstrate one way to use markers and to calculate a distance. Early use before calling for the map will result in an error.
There are other ways to add markers and calculate distance to the marker. Experiment. The Map component description provides the required information.

Above is a way to place several markers at one time The MyMapMarker variable is there to show what the Marker ID is. That is needed to identify the Marker so the developer can calculate from it to another location.
Regards,
Steve