markers.package#

Classes#

class markers.package.markerpack#

A markerpack is a collection of categories, markers, trails and associated data.

path: string#

The path of this marker pack, specified when creating it.

Version History

Version

Notes

0.1.0

Added

db: sqlitedb#

The underlying SQLite database.

Version History

Version

Notes

0.1.0

Added

open(path)#

Similar to new() but does not create a new markerpack if path does not exist. In that case nil is returned.

Parameters:

path (string)

Return type:

markerpack

Version History

Version

Notes

0.1.0

Added

new(path)#

Open or create a new markerpack. If path does not exist, a new markerpack at that location will be created.

If path does exist, it will be verified as a valid markerpack.

If path can not be created or exists and is not a valid markerpack an error is raised.

Parameters:

path (string)

Return type:

markerpack

Implementation Detail

All data for the markerpack is stored in a SQLite database. path is the path to this database and should end in .db.

Version History

Version

Notes

0.1.0

Added

category(typeid[, create])#

Retrieve a category from this markerpack. If create is true, it will be created if it does not exist. If create is false and the category does not already exist, nil is returned instead.

Parameters:
Return type:

category

Version History

Version

Notes

0.1.0

Added

toplevelcategories()#

Return a sequence of all of the top level categories in this markerpack.

Return type:

sequence

Version History

Version

Notes

0.1.0

Added

toplevelcategoriesiter()#

Returns an iterator function that will return a category on each invocation until all top level categories in this markerpack have been returned, at which point nil is returned.

Return type:

category

Version History

Version

Notes

0.1.0

Added

activecategoriesiter()#

Returns an iterator function that will return a category on each invocation until all active categories in this markerpack have been returned, at which point nil is returned.

Return type:

function

Version History

Version

Notes

0.1.0

Added

datafile(path)#

Get a data file in this markerpack.

Parameters:

path (string)

Return type:

datafile

Version History

Version

Notes

0.1.0

Added

class markers.package.category#

A category within a markerpack. A category is a named grouping of POIs and trails and is the primary method users use to control the visibility of those elements.

Categories are also used to set properties of POIs and trails contained within them.

Category properties can be accessed directly as fields on the category object. Setting a field to nil will remove it completely.

Example#
local mp = require 'markers.package'
local pack = mp.markerpack:new('data/markers/test.db')

-- create a new category
local cat = pack:category('newcategory', true)

-- set properties
cat.displayName = 'A new category'

-- or access them like this
cat['displayname'] = 'Another category'

-- access properties
print(cat.displayName)

-- properties are not case sensitive
cat.DISPLAYNAME = 'Hello EG-Overlay'
local foo = cat.displayname -- 'Hello EG-Overlay'

-- active is not a property
cat:active(true)
local isactive = cat:active()
typeid: string#

This category’s typeid, its unique ID.

Version History

Version

Notes

0.1.0

Added

markerpack: markerpack#

The markerpack this category belongs to.

Version History

Version

Notes

0.1.0

Added

ancestorsactive()#

Returns true if this category and all of its ancestors are active.

Return type:

boolean

Version History

Version

Notes

0.1.0

Added

active([value])#

Get or set if this category is active (shown).

Parameters:

value (boolean) – (Optional)

Return type:

boolean

Version History

Version

Notes

0.1.0

Added

hasmarkersinmap(mapid[, includechildren])#

Return true if this category, or its descendants if includechildren is true, have markers or trails in mapid.

Parameters:

includechildren (boolean)

Return type:

boolean

Version History

Version

Notes

0.1.0

Added

childcount()#

Return the number of children of this category.

Return type:

integer

Version History

Version

Notes

0.1.0

Added

children()#

Return the immediate children of this category, as a sequence of category.

Return type:

sequence

Version History

Version

Notes

0.1.0

Added

childreniter()#

Return a function that will return the immediate children of this category on each invocation.

Return type:

function

Version History

Version

Notes

0.1.0

Added

delete()#

Delete this category.

Danger

This will remove this category, all of its stored properties and associated POIs and trails.

Once this method has been invoked this object and any related objects become invalid. Attempting to use them will raise an error.

Version History

Version

Notes

0.1.0

Added

newmarker()#

Create a new marker in this category.

Return type:

marker

Version History

Version

Notes

0.1.0

Added

newtrail()#

Create a new trail in this category.

Return type:

trail

Version History

Version

Notes

0.1.0

Added

parent()#

Return the parent category of this category or nil.

Return type:

category

Version History

Version

Notes

0.1.0

Added

markersinmapiter(mapid)#

Return an iterator function that returns a marker each time it is invoked until all markerss in this category in the given mapid are returned.

Return type:

marker

Version History

Version

Notes

0.1.0

Added

trailsinmapiter(mapid)#

Return an iterator that returns a trail each time it is invoked until all trails in the category in the given mapid are returned.

Return type:

trail

Version History

Version

Notes

0.1.0

Added

class markers.package.marker#

A marker is a point at which an icon is displayed in the GW2 scene to mark the location of something. Markers belong to a category and have properties. Any properties that a marker does not define will be derived from properties of the category that contains it.

category: category#

The category this marker belongs to.

Version History

Version

Notes

0.1.0

Added

mapid([value])#

Get or set the MapID of this marker. If value is present, it is the new MapID. Otherwise the current MapID is returned.

Parameters:

value (integer) – (Optional) The new MapID

Return type:

integer

Returns:

The current MapID

Version History

Version

Notes

0.1.0

Added

delete()#

Delete this POI and all associated properties.

Danger

This object will no longer be valid after calling this method.

Version History

Version

Notes

0.1.0

Added

class markers.package.trail#

A marker trail. Trails are paths that indicate a route to follow. properties that a trail does not define will be derived from the properties of the category that contains it.

mapid([value])#

Get or set the MapID of this trail. If value is present, it is the new MapID. Otherwise the current MapID is returned.

Parameters:

value (integer) – (Optional) The new MapID

Return type:

integer

Returns:

The current MapID

Version History

Version

Notes

0.1.0

Added

addpoint(x, y, z)#

Append a point to this trail.

Parameters:

Version History

Version

Notes

0.1.0

Added

pointsiter()#

Return an iterator that returns x,y,z coordinates on each invocation until all points in this trail have been returned.

Version History

Version

Notes

0.1.0

Added

delete()#

Delete this trail and all associated properties/coordinates.

Danger

This object will no longer be valid after calling this method.

Version History

Version

Notes

0.1.0

Added

class markers.package.datafile#

A data file. This can be any binary data, but is usually an image to be used for markers or trail textures.

markerpack: markerpack#

The markerpack this datafile belongs to.

Version History

Version

Notes

0.1.0

Added

path: string#

This datafile’s path.

Version History

Version

Notes

0.1.0

Added

data([value])#

Get or set the content of this data file.

Parameters:

value (string) – (Optional) Binary data.

Return type:

string

Version History

Version

Notes

0.1.0

Added

delete()#

Delete this data file.

Version History

Version

Notes

0.1.0

Added