/// <summary> /// Function to set up a basic pin for the rider. /// </summary> /// <param name="pos">Position to create the pin at.</param> /// <returns>The pin object created.</returns> public static KCPin CreateRiderPin(Position pos) { var pin = new KCPin { Type = PinType.Place, Position = new Position(pos.Latitude, pos.Longitude), Id = "Next Rider" }; return(pin); }
/// <summary> /// Function to update the GoogleMap with the new /// position of the rider marker. /// </summary> public void UpdateMarker() { lock (nativeMapLock) { Device.BeginInvokeOnMainThread(() => { try { NativeMap.Clear(); riderPin = KCPin.CreateRiderPin(new Position(KCApi.Properties.CurrentRide.ClientLat, KCApi.Properties.CurrentRide.ClientLong)); MarkerOptions mo = riderPin.CreateMarker(); NativeMap.AddMarker(mo); } catch (Exception e) { KCApi.OutputException(e); } }); } }