Esempio n. 1
0
        //Adds the first pin to the map and pans to that pins location
        private async void AddPinOnLoad()
        {
            await MapUtils.RetrieveLocation();

            lat = MapUtils.getLat();
            lng = MapUtils.getLng();

            var customPin = new CustomPin
            {
                Type     = PinType.Place,
                Position = new Position(lat, lng),
                Label    = "My Position!",
                Id       = "myPin",
                Url      = "homepages.uc.edu/~ringjy"
            };

            //Add pin to map
            customMap.Pins.Clear();
            customMap.Pins.Add(customPin);
            updateGroupPins();
            NetworkUtils.updateCoords(lat, lng);

            //Center map on user/pin location
            customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(lat, lng), Distance.FromMiles(0.1)));
        }
Esempio n. 2
0
        //Method that runs every 3 seconds and updates the users pin location - prevents panning to that location every 3s
        private async void AddPinsToMap()
        {
            await MapUtils.RetrieveLocation();

            lat = MapUtils.getLat();
            lng = MapUtils.getLng();

            var customPin = new CustomPin
            {
                Type     = PinType.Place,
                Position = new Position(lat, lng),
                Label    = "My Position!",
                Id       = "myPin",
                Url      = "homepages.uc.edu/~ringjy"
            };

            //Add pin to map
            customMap.Pins.Clear();
            customMap.Pins.Add(customPin);
        }
Esempio n. 3
0
        //Add pins to map
        private async void AddPinsToMap()
        {
            await MapUtils.RetrieveLocation();

            lat = MapUtils.getLat();
            lng = MapUtils.getLng();

            //Create map pin
            var customPin = new CustomPin
            {
                Type     = PinType.Place,
                Position = new Position(lat, lng),
                Label    = "My Position!",
                Id       = "Xamarin",
                Url      = "homepages.uc.edu/~ringjy"
            };

            //Add pin to map
            customMap.Pins.Clear();
            customMap.Pins.Add(customPin);
            updateGroupPins();

            NetworkUtils.updateCoords(lat, lng);
        }