Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new map
 /// </summary>
 /// <param name="size">Size of map in pixels</param>
 public Map(Size size)
 {
     Size                 = size;
     _Layers              = new LayerCollection();
     _Layers.ListChanged += new System.ComponentModel.ListChangedEventHandler(_Layers_ListChanged);
     _variableLayers      = new VariableLayerCollection(_Layers);
     BackColor            = Color.Transparent;
     _MaximumZoom         = double.MaxValue;
     _MinimumZoom         = 0;
     _MapTransform        = new Matrix();
     MapTransformInverted = new Matrix();
     _Center              = new Point(0, 0);
     _Zoom                = 1;
     _PixelAspectRatio    = 1.0;
 }
        private void timer1_Tick(object sender, EventArgs e)
        {
            double dx, dy;

            if (movingLeft)
            {
                dx = -100;
            }
            else
            {
                dx = 100;
            }

            if (movingUp)
            {
                dy = 100;
            }
            else
            {
                dy = -100;
            }

            position.X = position.X + dx;
            position.Y = position.Y + dy;

            if (position.X < this.mapBox1.Map.Envelope.MinX)
            {
                movingLeft = false;
            }
            else if (position.X > this.mapBox1.Map.Envelope.MaxX)
            {
                movingLeft = true;
            }

            if (position.Y < this.mapBox1.Map.Envelope.MinY)
            {
                movingUp = true;
            }
            else if (position.Y > this.mapBox1.Map.Envelope.MaxY)
            {
                movingUp = false;
            }

            VariableLayerCollection.TouchTimer();
            //this.mapBox1.Refresh();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new map
        /// </summary>
        /// <param name="size">Size of map in pixels</param>
        public Map(Size size)
        {
            _mapViewportGuard = new MapViewPortGuard(size, 0d, Double.MaxValue);

            Factory              = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(_srid);
            _layers              = new LayerCollection();
            _backgroundLayers    = new LayerCollection();
            _variableLayers      = new VariableLayerCollection(_layers);
            BackColor            = Color.Transparent;
            _mapTransform        = new Matrix();
            MapTransformInverted = new Matrix();
            _center              = new Point(0, 0);
            _zoom = 1;

            WireEvents();

            if (_logger.IsDebugEnabled)
            {
                _logger.DebugFormat("Map initialized with size {0},{1}", size.Width, size.Height);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Move the object
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void m_timer_Tick(object sender, EventArgs e)
 {
     VariableLayerCollection.TouchTimer();
     //RefreshMap();
 }