Skip to content

Classes

WorldMap

Properties

markers
ts
markers: readonly WorldMapMarker[];

Gets list of World Map markers.

Note: this list is readonly, use addMarker or removeMarker to manage the World Map markers.

Methods

addMarker()
ts
addMarker(marker: WorldMapMarker | WorldMapMarkerPartial): WorldMapMarker

Adds a marker to the World Map.

Parameters
ParameterTypeDescription
markerWorldMapMarker | WorldMapMarkerPartial
Returns

WorldMapMarker

Example
ts
const marker = worldMap.addMarker({ name: 'Here', x: player.x, y: player.y, color: 'green' });

close()
ts
close(): void

Closes the World Map gump.

Example
ts
worldMap.close();

goTo()
ts
goTo(coords: object): void

Changes the current location of the World Map, which also enables Free View.

Parameters
ParameterTypeDescription
coordsobject
coords.xnumber-
coords.ynumber-
Example
ts
worldMap.goTo({ x: player.x, y: player.y });

open()
ts
open(): void

Opens the World Map gump.

Example
ts
worldMap.open();

parseLocation()
ts
parseLocation(input: string): undefined | object

Attempts to parse a location string and convert into map coordinates.

Note: Currently only supports Sextant coordinates, e.g. 100o25'S,40o04'E

Parameters
ParameterTypeDescription
inputstring
Returns

undefined | object

Example
ts
const marker = worldMap.addMarker({
  name: 'Sextant Loc',
  color: 'green',
  ...worldMap.parseLocation("100o25'S,40o04'E")
});

removeAllMarkers()
ts
removeAllMarkers(): void

Removes all World Map markers.


removeMarker()
ts
removeMarker(marker: string | object): boolean

Remove a marker from the World Map.

Parameters
ParameterTypeDescription
markerstring | object
Returns

boolean

Example
ts
worldMap.removeMarker('Here');

Interfaces

WorldMapMarker

Properties

color
ts
color: string;

Color of the marker, e.g. "blue"


mapId
ts
mapId: number;

Map Index/Id to place the marker on


name
ts
name: string;

Name of the marker


x
ts
x: number;

X coordinate


y
ts
y: number;

Y coordinate


zoomLevel
ts
zoomLevel: number;

ZoomLevel at which the marker appears


WorldMapMarkerPartial

Properties

color?
ts
optional color: string;

mapId?
ts
optional mapId: number;

name
ts
name: string;

x
ts
x: number;

y
ts
y: number;

zoomLevel?
ts
optional zoomLevel: number;