Esempio n. 1
0
        private void MapControl_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            MapControl.Focus();
            if (_currentTool == Tool.Region)
            {
                Point curPoint = e.GetPosition(MapControl);
                if (_intermediateRegionMarker == null)
                {
                    PointLatLng latLng = MapControl.FromLocalToLatLng((int)curPoint.X, (int)curPoint.Y);
                    _intermediateRegionMarker = new IntermediateRegionMarker(latLng);
                    MapControl.Markers.Add(_intermediateRegionMarker);
                    _nextPointMarker = new GMapMarker(latLng);
                    MapControl.Markers.Add(_nextPointMarker);
                }

                if (_intermediateRegionMarker.AddPoint(curPoint))
                {
                    AddCurrentRegion();
                }
                else
                {
                    _nextPointMarker.Position = _intermediateRegionMarker.Points.Last();
                    _nextPointMarker.Shape    = null;
                }
            }
        }
Esempio n. 2
0
 private void ClearCurrentRegion()
 {
     _intermediateRegionMarker.Dispose();
     _intermediateRegionMarker = null;
     _nextPointMarker.Clear();
     MapControl.Markers.Remove(_nextPointMarker);
     _nextPointMarker           = null;
     SelectToolButton.IsChecked = true;
 }
Esempio n. 3
0
        private void MapControl_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            MapControl.Focus();
            if (_currentTool == Tool.Region)
            {
                Point curPoint = e.GetPosition(MapControl);
                if (_intermediateRegionMarker == null)
                {
                    PointLatLng latLng = MapControl.FromLocalToLatLng((int) curPoint.X, (int) curPoint.Y);
                    _intermediateRegionMarker = new IntermediateRegionMarker(latLng);
                    MapControl.Markers.Add(_intermediateRegionMarker);
                    _nextPointMarker = new GMapMarker(latLng);
                    MapControl.Markers.Add(_nextPointMarker);
                }

                if (_intermediateRegionMarker.AddPoint(curPoint))
                {
                    AddCurrentRegion();
                }
                else
                {
                    _nextPointMarker.Position = _intermediateRegionMarker.Points.Last();
                    _nextPointMarker.Shape = null;
                }
            }
        }
Esempio n. 4
0
 private void ClearCurrentRegion()
 {
     _intermediateRegionMarker.Dispose();
     _intermediateRegionMarker = null;
     _nextPointMarker.Clear();
     MapControl.Markers.Remove(_nextPointMarker);
     _nextPointMarker = null;
     SelectToolButton.IsChecked = true;
 }