I know how to get pins to show up on the map by using their latitude and longitude but the trouble that I am having is getting the current position pin to show up.

I have followed the tutorial: 
<https://www.youtube.com/watch?v=cx5O9GfOnS4>

But when I try to do "position.Longitude" or "position.Latitude", line 34, it says that the position cannot be found. I need help trying to fix this error and understanding how to make it work.

```
using Plugin.Geolocator;
using System;
using Xamarin.Forms;
using Xamarin.Forms.Maps;

namespace WorkingWithMaps
{
    public class PinPage : ContentPage
    {
        Map map;

        public PinPage()
        {
            map = new Map {
                IsShowingUser = true,
                HeightRequest = 100,
                WidthRequest = 960,
                VerticalOptions = LayoutOptions.FillAndExpand

            };

            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;
            var position = locator.GetPositionAsync(timeoutMilliseconds: 10000);
            map.MoveToRegion (MapSpan.FromCenterAndRadius (

            new Position (position.Longitude, position.Latitude), Distance.FromMiles (1))); // current pos

            //var position = new Position(-26.077740, 28.010100); // Latitude, Longitude

            var pin = new Pin {
                Type = PinType.Place,
                //Position = position,
                Label = "Test",
                Address = "Test..."
            };
            map.Pins.Add(pin);

            //this works but I need current location not hard coded lat/lng   
            //map.MoveToRegion (MapSpan.FromCenterAndRadius (
            //new Position (-26.077740, 28.010100), Distance.FromMiles (1))); // S4C location

            //var position = new Position(-26.077740, 28.010100); // Latitude, Longitude
            //  var pin = new Pin {
            //  Type = PinType.Place,
            //  Position = position,
            //  Label = "Test",
            //  Address = "Test..."
            //  };
            //  map.Pins.Add(pin);

            // create buttons
            var morePins = new Button { Text = "Show Pins Near Me" };
            morePins.Clicked += (sender, e) => {
                map.Pins.Add(new Pin {
                    Position = new Position(-26.074932, 28.012136),
                    Label = "123"
                });
                map.Pins.Add(new Pin {
                    Position = new Position(-26.080752, 28.026094),
                    Label = "321"
                });
                map.MoveToRegion (MapSpan.FromCenterAndRadius (
                    new Position (-26.077740, 28.010100), Distance.FromMiles (2))); // this distance shows dealerships to current position

            };
            var reLocate = new Button { Text = "Re-center" };
            reLocate.Clicked += (sender, e) => {
                map.MoveToRegion (MapSpan.FromCenterAndRadius (
                    new Position (-26.077740, 28.010100), Distance.FromMiles (0.5)));
            };
            var buttons = new StackLayout {
                Orientation = StackOrientation.Horizontal,
                Children = {
                    morePins, reLocate
                }
            };

            // put the page together
            Content = new StackLayout { 
                Spacing = 0,
                Children = {
                    map,
                    buttons
                }
            };
        }
    }
}

```

**EDIT: New Code**
Current Issue:
\* It does not show my current location and compare it to the "Test" locations to show the distance between "Current Location" and them.

Please note, if I use coordinates eg.(022225,555552) instead of "position.Longitude, position.Latitude" then it works but it does not use to GPS to get my current location. Please advise on where I went wrong and how to fix it.

Here's the new code:

```
using Plugin.Geolocator;
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Maps;

namespace WorkingWithMaps
{
public class PinPage : ContentPage
{

    Map map;

    public PinPage()
    {
        map = new Map {
            IsShowingUser = true,
            HeightRequest = 100,
            WidthRequest = 960,
            VerticalOptions = LayoutOptions.FillAndExpand

        }; }

        protected async override void OnAppearing()
    {

        // create buttons

            var morePins = new Button { Text = "Show Tests Near Me" };
            //current pos
            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;

            var position = await locator.GetPositionAsync(timeoutMilliseconds: 10000);
            var reLocate = new Button { Text = "Re-center" };
            reLocate.Clicked += (sender, e) => {
            map.MoveToRegion(MapSpan.FromCenterAndRadius(
            new Position(position.Longitude, position.Latitude), Distance.FromMiles(0.5)));

            };

            var buttons = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children = {
                morePins, reLocate
            }
            };

            morePins.Clicked += (sender, e) => {
            map.Pins.Add(new Pin {
                Position = new Position(-26.074932, 28.012136),
                Label = "Test 1"

            });
            map.Pins.Add(new Pin {
                Position = new Position(-26.080752, 28.026094),
                Label = "Test 2"
            });
            map.MoveToRegion(MapSpan.FromCenterAndRadius(
            new Position(position.Longitude, position.Latitude), Distance.FromMiles(2))); // this distance shows tests to current position

            };

        // put the page together
        Content = new StackLayout { 
            Spacing = 0,
            Children = {
                map,
                buttons
            }};

        }
    }
    }

```

**FIXED:**
I had the order of the lat and long swapped so that's why it wasn't finding my position. Stupid mistake. Thanks everyone for the input!