예제 #1
0
        public override Geoposition GetResponderPosition(ResponderModel responder)
        {
            Marker marker = GetMarkerForResponder(responder);

            return(marker != null
                ? CoordinateConverter.ConvertToAbstraction(marker.Position)
                : default(Geoposition));
        }
예제 #2
0
        protected override void DrawRouteInMap(IEnumerable <Geoposition> positions)
        {
            var polyLine = new PolylineOptions();

            foreach (var position in positions)
            {
                LatLng nativePosition = CoordinateConverter.ConvertToNative(position);
                polyLine.Add(nativePosition);
            }

            polyLine.InvokeColor(FormsMap.RouteColor.ToAndroid());

            _currentUserRoute = _nativeMap.AddPolyline(polyLine);
        }
        protected override void DrawSearchAreaPolygon(Geoposition[] polygonData)
        {
            Color color = FormsMap.SearchPolygonColor.ToAndroid();

            var polygonOptions = new PolygonOptions();

            polygonOptions.InvokeFillColor(color);
            polygonOptions.InvokeStrokeColor(color);
            polygonOptions.InvokeStrokeWidth(1.0f);

            foreach (var position in polygonData)
            {
                var nativeCoordinate = CoordinateConverter.ConvertToNative(position);
                polygonOptions.Add(nativeCoordinate);
            }

            _currentSearchPolygon = _nativeMap.AddPolygon(polygonOptions);
        }
        protected override void UpdatePushpinPosition(Route e)
        {
            Marker marker         = null;
            var    androidManager = PushpinManager as MarkerManager;

            if (e is Route <UserRole> )
            {
                marker = androidManager.UserMarker;
            }
            else if (e is Route <ResponderModel> )
            {
                var responderRoute = e as Route <ResponderModel>;
                marker = androidManager.GetMarkerForResponder(responderRoute.Element);
            }

            if (marker != null)
            {
                LatLng newPosition = CoordinateConverter.ConvertToNative(e.CurrentPosition);
                marker.Position = newPosition;
            }
        }
예제 #5
0
 public override Geoposition GetCurrentUserPosition()
 {
     return(UserMarker != null
         ? CoordinateConverter.ConvertToAbstraction(UserMarker.Position)
         : default(Geoposition));
 }