Serial port and GPS

Map Class

Contains one map definition

For a list of all members of this type, see Map Members.


[Visual Basic]
Public Class Map
public class Map

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


A map definition consists of a name of a bitmap file, containing for example the scan or screenshot of the map itself, and of the coordinates of the boundaries of the map: left upper and right bottom corner. An instance of this class can bi initialized from a string, consisting of 5 fields separated by whitespaces, commas or semicilons:

  1. The longitude of the left boundary. The coordinate strings should be defined according to Utils.coord2dec().
  2. The latitude of the top boundary.
  3. The longitude of the right boundary.
  4. The latitude of the bottom boundary.
  5. The name of the bitmap file. If the name is an absolute path, then it is used as it is. Else the name is completed by the path of the exexuting assembly. This class doesn't validate the type of the bitmap, but generally bitmap types should be used, which can be presented in the form BndBmpForm. The form uses System.Drawing.Graphics.DrawImage() which is able to handle the most popular formats like bmp, jpg or png.


using System;
using serial;
public void maptest() {
  Map      m;
  MapPoint p;
  m = new Map("11d59m05.60sE 49d33m16.05sN 12d00m36.03sE 49d32m21.97sN sbach.bmp"));
  p = new MapPoint("12d00m00.00sE 49d00m00.00sN");
  if (m.pointInside(p))
    Console.WriteLine("Point {0} is inside of the map {1}", m, p);
    Console.WriteLine("Point {0} is not inside of the map {1}", m, p);


Namespace: serial

Assembly: sgps (in sgps.exe)

See Also

Map Members | serial Namespace | Utils.coord2dec() | Maps | MapBound