Init() public method

public Init ( GroupLayer gl, MapPoint start, MapPoint finish, System.Windows.ResourceDictionary rd ) : void
gl GroupLayer
start MapPoint
finish MapPoint
rd System.Windows.ResourceDictionary
return void
示例#1
0
        private void BCircleIconMoved(object sender, IconMovedEventArgs e)
        {
            if (_direction == null) _firstMove = true;
            if (CanBeDragged && _direction == null)
            {
                _direction = new DirectionTool() { Layer = this._layer };


                var p = e.Position;
                SharpMap.Geometries.Point pos = AppState.ViewDef.ViewToWorld(p.X, p.Y);
                var mpStart = (MapPoint)Mercator.FromGeographic(new MapPoint(pos.Y, pos.X));

                var p2 = e.Position;
                SharpMap.Geometries.Point pos2 = AppState.ViewDef.ViewToWorld(p2.X + 65, p2.Y - 65);
                var mpFinish = (MapPoint)Mercator.FromGeographic(new MapPoint(pos2.Y, pos2.X));

                var eSender = (FrameworkElement) sender;

                _direction.Init(_layer, mpStart, mpFinish, this.Resources);

                CanBeDragged = false;

                //e.TouchDevice.Capture(bCircle);
                //e.Handled = true;
            }
            else
            {
                if (_direction != null)
                {
                    var pos = e.Position;
                    var w = AppState.ViewDef.ViewToWorld(pos.X, pos.Y);
                    _direction.UpdatePoint(_state, (MapPoint)Mercator.FromGeographic(new MapPoint(w.Y, w.X)));
                    UpdateDirection();
                    //_center = e.GetTouchPoint(AppState.MapControl).Position;
                    //e.TouchDevice.Capture(bCircle);
                    //e.Handled = true;

                }
            }


        }