Inheritance: IViewport
Ejemplo n.º 1
0
 public Viewport(Viewport viewport) : this()
 {
     _resolution = viewport._resolution;
     _width = viewport._width;
     _height = viewport._height;
     _rotation = viewport._rotation;
     RenderResolutionMultiplier = viewport.RenderResolutionMultiplier;
 }
Ejemplo n.º 2
0
 public static void Pan(Viewport view, Point currentMap, Point previousMap)
 {
     Geometries.Point current = view.ScreenToWorld(currentMap.X, currentMap.Y);
     Geometries.Point previous = view.ScreenToWorld(previousMap.X, previousMap.Y);
     double diffX = previous.X - current.X;
     double diffY = previous.Y - current.Y;
     view.Center = new Geometries.Point(view.CenterX + diffX, view.CenterY + diffY);
 }
Ejemplo n.º 3
0
 public Viewport(Viewport viewport)
 {
     resolution = viewport.resolution;
     centerX = viewport.centerX;
     centerY = viewport.centerY;
     width = viewport.width;
     height = viewport.height;
     UpdateExtent();
 }
        public System.Collections.Generic.IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
        {
            var features = new Features();

            IRaster raster = null;
            var view = new Viewport { Resolution = resolution, Center = box.GetCentroid(), Width = (box.Width / resolution), Height = (box.Height / resolution) };
            if (TryGetMap(view, ref raster))
            {
                IFeature feature = features.New();
                feature.Styles.Add(new VectorStyle()); // this is not my fault
                feature.Geometry = raster;
                features.Add(feature);
            }
            return features;
        }
Ejemplo n.º 5
0
 public Viewport(Viewport viewport)
     : this()
 {
     _resolution = viewport._resolution;
     _width = viewport._width;
     _height = viewport._height;
     _rotation = viewport._rotation;
     _center.X = viewport._center.X;
     _center.Y = viewport._center.Y;
     if (viewport.Extent!= null) _extent = new BoundingBox(viewport.Extent);
     if (viewport.WindowExtent != null) _windowExtent = new Quad(
         viewport.WindowExtent.BottomLeft, viewport.WindowExtent.TopLeft,
         viewport.WindowExtent.TopRight, viewport.WindowExtent.BottomRight);
     _center.PropertyChanged += (sender, args) => _modified = true;
     RenderResolutionMultiplier = viewport.RenderResolutionMultiplier;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new map
 /// </summary>
 public Map()
 {
     BackColor = Color.White;
     Layers = new LayerCollection();
     Viewport =  new Viewport { Center = { X = double.NaN, Y = double.NaN }, Resolution = double.NaN };
 }