Esempio n. 1
0
                /// <summary><para>Die Methode gibt zusätzlich zur <see cref="Area(Info.MapDirection, bool)"/>-Methode den Bildpunkt (x/y)
                /// auf dem Satellitenbild zurück, der der Koordinate entspricht.</para></summary>
                ///
                /// <param name="direction">Bestimmt die Richtung in der die Bilder zusammengefügt werden sollen.</param>
                /// <param name="extended">Wenn True, wird ein erweiterter Umgebungsbereich geladen.</param>
                /// <param name="pointInArea">Der out-Parameter gibt den Bildpunkt der Koordinate im Umgebungsbild zurück.</param>
                /// <returns>Ein zusammengesetztes Bild vom Typ <see cref="System.Drawing.Image"/></returns>
                public Image Area(Info.MapDirection direction, bool extended, out GeoUtility.GeoSystem.Helper.GeoPoint pointInArea)
                {
                    GeoUtility.GeoSystem.Helper.GeoPoint gp = Parent.TileInfo.GeoPosition;
                    pointInArea   = new GeoUtility.GeoSystem.Helper.GeoPoint();
                    pointInArea.X = gp.X;
                    pointInArea.Y = gp.Y;

                    if ((direction == Info.MapDirection.Northwest) || (direction == Info.MapDirection.North) || (direction == Info.MapDirection.West) || (direction == Info.MapDirection.Center))
                    {
                        pointInArea.X += TILE_SIZE;
                        pointInArea.Y += TILE_SIZE;
                    }
                    if ((direction == Info.MapDirection.Northeast) || (direction == Info.MapDirection.East))
                    {
                        pointInArea.Y += TILE_SIZE;
                    }
                    if ((direction == Info.MapDirection.Southwest) || (direction == Info.MapDirection.South))
                    {
                        pointInArea.X += TILE_SIZE;
                    }
                    if (extended == true)
                    {
                        pointInArea.X += TILE_SIZE;
                        pointInArea.Y += TILE_SIZE;
                    }

                    return(Area(direction, extended));
                }
Esempio n. 2
0
                /// <summary><para>Die Funktion ruft Einzelbilder aus der Umgebung des aktuellen Satellitenbilds ab, und fügt sie zu
                /// einem Bild zusammen. Der Parameter vom Typ <see cref="Info.MapDirection"/> bestimmt die Richtung, in der
                /// die Bilder abgerufen werden. Der Wert <see cref="Info.MapDirection.Center"/> fügt alle angrenzenden Luftbilder,
                /// also 9 Einzelbilder in einer 3x3 Matrix, zu einem Bild zusammen. Die Werte <see cref="Info.MapDirection.North"/>,
                /// <see cref="Info.MapDirection.South"/>, <see cref="Info.MapDirection.West"/> und <see cref="Info.MapDirection.East"/>
                /// fügen 6 Einzelbilder in einer 2x3 bzw. 3x2 Matrix zusammen. Alle anderen Werte der <see cref="Info.MapDirection"/>-Enumeration
                /// fügen 4 Einzelbilder in einer 2x2 Matrix zusammen. Bitte beachten Sie, dass der Vorgang je nach Verbindung oder
                /// Serverauslastung längern andauern kann, und es möglicherweise zu Fehlern kommt.</para></summary>
                ///
                /// <example>Das Beispiel zeigt eine mögliche Anwendung der Methode, indem das aktuelle Satellitenbild, und alle
                /// angrenzenden Bilder (9x9 Matrix) zu einem Gesamtbild verschmolzen werden.
                /// <code>
                /// using System.Drawing;
                /// using GeoUtility.GeoSystem;
                /// Geographic geo = new Geographic(8.12345, 50.56789);
                /// MapService.Info.MapServer server = MapService.Info.MapServer.GoogleMaps;
                /// MapService map = new MapService(geo, server);
                /// map.Zoom = 18;
                /// Image imageArea = map.Image.Area(MapService.Info.MapDirection.Center);
                /// </code>
                /// </example>
                ///
                /// <param name="direction">Bestimmt die Richtung in der die Bilder zusammengefügt werden sollen.</param>
                /// <param name="extended">Wenn True, wird ein erweiterter Umgebungsbereich geladen.</param>
                /// <returns>Ein zusammengesetztes Bild vom Typ <see cref="System.Drawing.Image"/></returns>
                public Image Area(Info.MapDirection direction, bool extended)
                {
                    Image[,] array = null;
                    //MapService maps = Parent.MemberwiseClone();
                    MapService maps = new MapService(Parent.Tile);
                    int        rows, row, cols, col;

                    rows = row = cols = col = 0;

                    if (direction == Info.MapDirection.Center)
                    {
                        rows = 3;
                        cols = 3;
                        maps.Move(MapService.Info.MapDirection.Northwest, 1, true);
                    }
                    else if ((direction == Info.MapDirection.Northwest) || (direction == Info.MapDirection.Northeast) || (direction == Info.MapDirection.Southwest) || (direction == Info.MapDirection.Southeast))
                    {
                        rows = 2;
                        cols = 2;
                        if (direction == Info.MapDirection.Northwest)
                        {
                            maps.Move(MapService.Info.MapDirection.Northwest, 1, true);
                        }
                        else if (direction == Info.MapDirection.Northeast)
                        {
                            maps.Move(MapService.Info.MapDirection.North, 1, true);
                        }
                        else if (direction == Info.MapDirection.Southwest)
                        {
                            maps.Move(MapService.Info.MapDirection.West, 1, true);
                        }
                    }
                    else if ((direction == Info.MapDirection.North) || (direction == Info.MapDirection.South))
                    {
                        rows = 2;
                        cols = 3;
                        if (direction == Info.MapDirection.North)
                        {
                            maps.Move(MapService.Info.MapDirection.Northwest, 1, true);
                        }
                        else
                        {
                            maps.Move(MapService.Info.MapDirection.West, 1, true);
                        }
                    }
                    else if ((direction == Info.MapDirection.West) || (direction == Info.MapDirection.East))
                    {
                        rows = 3;
                        cols = 2;
                        if (direction == Info.MapDirection.West)
                        {
                            maps.Move(MapService.Info.MapDirection.Northwest, 1, true);
                        }
                        else
                        {
                            maps.Move(MapService.Info.MapDirection.North, 1, true);
                        }
                    }
                    if (extended == true)
                    {
                        rows += 2;
                        cols += 2;
                        maps.Move(MapService.Info.MapDirection.Northwest, 1, true);
                    }

                    array = new Image[rows, cols];
                    for (row = 0; row < rows; row++)
                    {
                        for (col = 0; col < cols; col++)
                        {
                            Image image = maps.Images.Load(true);
                            if (image == null)
                            {
                                return(null);
                            }

                            array[row, col] = image;
                            maps.Move(MapService.Info.MapDirection.East, 1, true);
                        }
                        maps.Move(MapService.Info.MapDirection.West, cols, true);
                        maps.Move(MapService.Info.MapDirection.South, 1, true);
                    }

                    return(this.Merge(array));
                }