Printable versions
This Page
All Pages
PDF (2.0MB)

Index

Component
GpsViewCE

Class
Map

Properties
Position
OffsetX
OffsetY
Zoom
Rotation
Background
UpdateInterval

Layers
MapLib

Events
OnObjectDown
OnObjectUp
OnMouseDown
OnMouseUp
OnMouseMove
OnDraw
OnDrawComplete

Methods
Open
Merge
Close
Update
UpdateAsync
CancelUpdate

NewMapShape
NewMapShapeFile
NewIcon
NewLine
NewRectangle
NewEllipse
NewLabel
Delete

GetByID
GetByIndex
GetByPosition
SetIndex
GetIndex

ActiveLayer
ActiveMapData

Position2Point
Point2Position

ZoomByBoundingBox

Map.ActiveMapData GpsTools v2.10 and later

ActiveMapData sets the active MapData to be displayed for a Map control. If you only use one MapData in a MapLib file you don't need to care about this method, or any methods that has to do with the MapLib or MapData classes.

MapData is everything that defines a map, its graphics and its scale. The MapData can be defined in GpsTools Studio, or at runtime. At runtime only blank MapData objects can be created. Raster maps must be defined in GpsTools Studio. Zero or more MapData objects plus zero or more Icon objects builds up a MapLib. The MapData is displayed using the Map control.

To create a new blank MapData object call this method with a new MapData name. This will create a new MapData object and make that object active, that is it will be displayed in the Map control. If ActiveMapData is called with the name of an existing MapData object that object is activated and returned. Map names are not case sensitive.

After a new MapData object is created it must be scaled using MapData.SetScale.

Names that starts with "_" are reserved for future GpsTools usage. Currently "_main" and "_active" are defined. "_main" represents the default map in a MapLib that is used until ActiveMapData is called to activate a new map. "_active" represents the current active map. Calling ActiveMapData with "_active" as argument will return a handle to the map last activated.

Note that changing the MapData for a Map control does not affect the objects which are drawn on its layers. The objects will remain unchanged when the MapData is changed.

See MapLib for how to manage all MapData objects.

Sample in VB 6. Creates and activates a new map:

Dim position1 As New GpsToolsXP.Position
Dim position2 As New GpsToolsXP.Position
Dim point1 As New GpsViewXPCtl.Point
Dim point2 As New GpsViewXPCtl.Point
    
position1.Longitude = 180
position1.Latitude = -90
    
point1.X = 1000
point1.Y = 500
    
position2.Longitude = -180
position2.Latitude = 90
    
point2.X = -1000
point2.Y = -500
    
Dim objMapData As MapData
   
' Creates and activates map, MapLib.NewMapData can also be used
Set objMapData = Map1.ActiveMapData("blank")
' Scales blank Map
objMapData.SetScale position1, point1, position2, point2, Nothing, Nothing

objMap.Update  ' Updates changes

Syntax
objMapData = objMap.ActiveMapData( Name )

Part Type Description
objMap GpsViewCECtl.Map An object that evaluates to an GpsViewCECtl.Map object.
objMapData GpsToolsCE.MapData (Variant)
MapData.
Name String (Variant) Name of map.



Pocket PC
© 2016 Franson Technology AB, All rights reserved, Contact | | Affiliate | Login