//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))); }
//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); }
//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); }