public static object changeMark() { return(new ThunkAction <AppState>((dispatcher, getState) => { List <Mark> newMarks = new List <Mark>(); foreach (Mark _mark in getState().mapState.marksJustLoading) { bool isNew = true; foreach (Mark mark in getState().mapState.marks) { if (_mark.id.Equals(mark.id)) { isNew = false; break; } } if (isNew) { newMarks.Add(_mark); } } dispatcher.dispatch(new AddMarkInViewAction { newMarks = newMarks }); return MapApi.AddMark(newMarks).Then((list) => { dispatcher.dispatch(new AddMarkOnMapAction { newMarks = list }); }).Catch((ex) => { Debug.LogError(ex.Message); }); })); }
public static object moveMap() { return(new ThunkAction <AppState>((dispatcher, getState) => { var offsetX = getState().mapState.offsetX; var offsetY = getState().mapState.offsetY; return MapApi.MoveMap(offsetX, offsetY); })); }
public static object zoomMap() { return(new ThunkAction <AppState>((dispatcher, getState) => { var scale = getState().mapState.scale; var scaleLastFrame = getState().mapState.scaleLastFrame; return MapApi.ZoomMap(scale, scaleLastFrame); })); }
protected virtual async Task <TDal> ToDal(TDetailModel model, TDal dal) { var mappedResult = MapApi.GetInstance().Map(model, dal); await AddAdditionalMappings(model, mappedResult); return(mappedResult); }
// Update is called once per frame void Update() { velocity_x -= a * Time.deltaTime; velocity_y -= a * Time.deltaTime; if (velocity_x < 0) { velocity_x = 0; } if (velocity_y < 0) { velocity_y = 0; } if (velocity_x == 0 && velocity_y == 0) { } else { Debug.LogError(velocity_y); MapApi.MoveMap(-velocity_x * Time.deltaTime, velocity_y * Time.deltaTime); } }
public void AssertConfigurationIsValid_OnMapApi_ShouldNotFail() { // assert MapApi.AssertConfigurationIsValid(); }
public override Widget build(BuildContext context) { return(new Container( padding: EdgeInsets.zero, height: 2000, width: 1000, child: new GestureDetector( child: new Container( padding: EdgeInsets.zero, height: 1000, width: 2000, alignment: Alignment.center, color: CColors.Transparent ), onTapDown: detail => { Vector2 t = new Vector2(detail.globalPosition.dx, detail.globalPosition.dy); this.widget.actionModel.selectMark(t); }, onPanStart: detail => { //this.widget.actionModel.markPositionUpdate(false); }, onPanEnd: detail => { if (am_horizontal != null) { am_horizontal.dispose(); } if (am_vertical != null) { am_vertical.dispose(); } am_horizontal = new AnimationController(vsync: this, duration: new System.TimeSpan(0, 0, 0, 0, 500)); am_vertical = new AnimationController(vsync: this, duration: new System.TimeSpan(0, 0, 0, 0, 500)); animation_horizontal = new FloatTween(0, -detail.velocity.pixelsPerSecond.dx * 0.1f).chain(new CurveTween(Curves.decelerate)).animate(am_horizontal); animation_vertical = new FloatTween(0, detail.velocity.pixelsPerSecond.dy * 0.1f).chain(new CurveTween(Curves.decelerate)).animate(am_vertical); animation_horizontal.addListener(() => { MapApi.MoveMap(animation_horizontal.value - lastHorizontal, animation_vertical.value - lastVertical); lastHorizontal = animation_horizontal.value; lastVertical = animation_vertical.value; }); animation_horizontal.addStatusListener(status => { if (status == AnimationStatus.completed) { lastHorizontal = 0; lastVertical = 0; } }); am_horizontal.forward(); am_vertical.forward(); updateMarks(); //Window.instance.startCoroutine(wait_500()); }, onPanUpdate: details => { this.widget.actionModel.mapMoveOffsetY(details.delta.dy); this.widget.actionModel.mapMoveOffsetX(-details.delta.dx); this.widget.actionModel.moveMap(); }, onScaleUpdate: details => { this.widget.actionModel.mapZoom(details.scale); this.widget.actionModel.zoomMap(); if ((int)(this.widget.viewModel.zoomLevel) != (int)(Globals.instance.mapController.GetZoomLevel())) { this.widget.actionModel.changeZoomLevel(Globals.instance.mapController.GetZoomLevel()); Debug.Log("zoomlevel change!"); } }, onScaleStart: detail => { this.widget.actionModel.changeZoomLevel(Globals.instance.mapController.GetZoomLevel()); }, onScaleEnd: detail => { if (am_scale != null) { am_scale.dispose(); } am_scale = new AnimationController(vsync: this, duration: new System.TimeSpan(0, 0, 0, 0, 500)); animation_scale = new FloatTween(widget.viewModel.scale, widget.viewModel.scale + (widget.viewModel.scale - widget.viewModel.scaleLastFrame) * 0.3f).chain(new CurveTween(Curves.decelerate)).animate(am_scale); lastScale = widget.viewModel.scale; animation_scale.addListener(() => { MapApi.ZoomMap(animation_scale.value, lastScale); lastScale = animation_scale.value; }); am_scale.forward(); this.widget.actionModel.mapZoom(1); } ) )); }
public void AssertConfigurationIsValid_WhenCalled_ShouldBeValid() { MapApi.GetInstance(); MapApi.AssertConfigurationIsValid(); }
public MapApiTests() { instance = new MapApi(); }
protected virtual IEnumerable <TReferenceModel> ToReferenceModelList(IEnumerable <TDal> arg) { return(MapApi.GetInstance().Map <IEnumerable <TDal>, IEnumerable <TReferenceModel> >(arg)); }
protected virtual TModel ToModel(TDal arg) { return(MapApi.GetInstance().Map <TDal, TModel>(arg)); }
public void Init() { instance = new MapApi(); }