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.ActiveLayer GpsTools v2.10 and later

ActiveLayer sets the active layer for a Map. If you don't want to draw and manage object on several layers you don't need to care about this method, or any methods that has to do with layers.

To create a new layer call this method with a new layer name. This will create a new layer and make that layer active. A new layer is always placed on top of all existing layers. If ActiveLayer is called with the name of an existing layer that layer is activated. A Layer object is returned that represents the activated layer. Layer names are not case sensitive.

By default all objects are drawn on the "_main" layer. Names that starts with "_" are reserved for future GpsTools usage. Currently "_main" and "_active" are defined. "_main" represents the default layer that is used until ActiveLayer is called to activate a new layer. "_main" cannot be deleted. "_active" represents the current active layer. Calling ActiveLayer with "_active" as argument will return a handle to the layer last activated with ActiveLayer.

See Layers for how to manage layers.

Creates and activates a new layer:
objMap.ActiveLayer("MyLayer") 

' Draws an icon on new layer
Set objIcon = objMap.NewIcon("car")
Set objIcon.Position = objPos1

objMap.Update  ' Updates changes

Draw object on main layer:
objMap.ActiveLayer("_main")  ' Activates main layer.

Set objIcon = objMap.NewIcon("car")
objIcon.Position = objPos2

objMap.Update ' Update changes

Disable a layer. The objects on that layer will now be invisible
Set objLayer = ActiveLayer("MyLayer")
objLayer.Enabled = False

objMap.Update ' Update changes

Clear all objects on active layer:
Set objLayer = ActiveLayer("_active")
objLayer.Clear

objMap.Update ' Update changes

Delete a layer
Set objLayers = objMap.Layers
Set objLayer = objLayers.GetByName("MyLayer")
objLayers.Delete objLayer

objMap.Update ' Update changes

Syntax
objLayer = objMap.ActiveLayer( Name )

Part Type Description
objMap GpsViewCECtl.Map An object that evaluates to an GpsViewCECtl.Map object.
objLayer GpsToolsCE.Layer (Variant)
Layer.
Name String (Variant) Name of layer.



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