User Tools

Site Tools


Sidebar

Network and communication

k24:k24.8:k24.8.2:start

24.8.2 Geo

The Geo (gb.map) class provides tools for editing map projections and formatting geographic data.

24.8.2.1 Methods

The Geo class has these methods:

MethodReturnTypeDescription
DecToSex(Value As Float, Type As Integer)StringThe function formats the value into a sexagesimal value. For the type: Latitude = 1 and Longitude = 2.
SexToDec(Value as String) As Float FloatThe function calculates a latitude or longitude value from a suitably formatted sexagesimal (string) value.
MapPointToPixel(hMapPoint as MapPoint, Zoom As Integer)PointThe function converts the coordinates of a geographic point (latitude/longitude) into an image point at a specified zoom level.
MapPointToTile(hMapPoint as MapPoint, Zoom As Integer)PointThe function converts the coordinates of a geographical point (latitude/longitude) into map coordinates (xTile/yTile) to a specified zoom level.
PixelToMapPoint(hPoint As Point, Zoom As Integer) MapPointThe function converts the coordinates of a point in pixel coordinates at a specified zoom factor into the geographical coordinates latitude and longitude.
PixelToTile(hPoint As Point)PointThe function converts pixel coordinates into map coordinates.
TileBounds ( X As Integer, y As Integer, Zoom As Integer )MapBoundsReturns a MapBounds object to a given tile (xTile / yTile) with given zoom factor.
TileToMapPoint ( X As Integer, y As Integer, Zoom As Integer )MapPointReturns the top left MapPoint to a given tile (xTile / yTile) with given Zoom factor.

Table 24.8.2.1.1 : Methods of the class Geo

24.8.3 Map

The Map class contains the routines to draw the maps. After initialisation you have the possibility to change the map section as well as the zoom factor. Here is an example of how to initialise and display a map:

Public Sub ShowMap()
  Dim iZoom As Integer
  Dim fLatitude, fLongitude As Float
  Dim sCacheName, sTileName, sTilePattern As String
  Dim cArguments As New Collection
 
' Initialisierung
  iZoom = 13
  sTileName = "OpenStreetMap"
  sTilePattern = "85.30.190.241/{z}/{x}/{y}.png"
  cArguments = Null
  sCacheName = Null
  fLatitude = 52.7905  ' °Breite Osterburg
  fLongitude = 11.7531 ' °Länge Osterburg
 
  MapView1.Map.AddTile(sTileName, sTilePattern, cArguments, sCacheName)
  MapView1.Map[sTileName].Copyright = " © OpenStreetMap"
  MapView1.Map[sTileName].Visible = True ' optional; Standard-Einstellung ist TRUE
  MapView1.Map.AddShape("P1")
  MapView1.Map!P1.AddPoint("Osterburg", MapPoint(fLatitude, fLongitude))
  MapView1.Map.Center = MapPoint(fLatitude, fLongitude)
' MapView1.Map.Center = MapView1.Map!P1!Osterburg.Points ' Alternative Zentrierung auf die Marke P1
  MapView1.Map.Zoom = iZoom
  MapView1.AllowEffect = True
 
End ' ShowMap()


With these two lines from the source code excerpt above, you insert a prominent marker into the displayed map:

MapView1.Map.AddShape("P1")
MapView1.Map!P1.AddPoint("Osterburg", MapPoint(fLatitude, fLongitude))
The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k24/k24.8/k24.8.2/start.txt · Last modified: 16.08.2022 (external edit)

Page Tools