Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ClassicUO/classicuo-web/llms.txt

Use this file to discover all available pages before exploring further.

The WorldMap class controls the in-game World Map gump and its custom marker layer. It is available globally as worldMap. Use it to open or close the map, jump the view to any coordinate, and manage named map markers that persist across your session.
// Mark your current position on the map and open it
worldMap.open();
worldMap.addMarker({ name: 'Start', x: player.x, y: player.y, color: 'green' });
worldMap.goTo({ x: player.x, y: player.y });

Interfaces

WorldMapMarker

A fully-populated marker object as stored in the markers list.
PropertyTypeDescription
namestringDisplay name of the marker.
xnumberX coordinate on the map.
ynumberY coordinate on the map.
colorstringMarker colour, e.g. 'blue', 'red', 'green'.
mapIdnumberMap/facet index the marker belongs to.
zoomLevelnumberMinimum zoom level at which the marker is visible.

WorldMapMarkerPartial

A partial version used when adding new markers. Only name, x, and y are required — the rest use defaults.
PropertyTypeRequired
namestring
xnumber
ynumber
colorstringOptional
mapIdnumberOptional
zoomLevelnumberOptional

Properties

markers

readonly markers: WorldMapMarker[];
A read-only array of all currently active map markers. To modify the list, use addMarker() and removeMarker() rather than mutating this array directly.
console.log(`You have ${worldMap.markers.length} map markers.`);

Methods

open()

open(): void
Opens the World Map gump.
worldMap.open();

close()

close(): void
Closes the World Map gump.
worldMap.close();

goTo()

goTo(coords: { x: number; y: number }): void
Moves the World Map view to the specified coordinates and enables Free View mode.
coords
object
required
An object with x and y coordinates.
worldMap.goTo({ x: player.x, y: player.y });

addMarker()

addMarker(marker: WorldMapMarker | WorldMapMarkerPartial): WorldMapMarker
Adds a new marker to the World Map and returns the completed WorldMapMarker object (with defaults applied for any omitted fields).
marker
WorldMapMarker | WorldMapMarkerPartial
required
The marker definition to add. Must include at least name, x, and y.
const marker = worldMap.addMarker({
  name: 'Here',
  x: player.x,
  y: player.y,
  color: 'green'
});

removeMarker()

removeMarker(marker: string | object): boolean
Removes a marker by name (string) or by reference (object). Returns true if the marker was found and removed.
marker
string | object
required
The marker name or marker object to remove.
worldMap.removeMarker('Here');

removeAllMarkers()

removeAllMarkers(): void
Removes every marker from the World Map.
worldMap.removeAllMarkers();

parseLocation()

parseLocation(input: string): undefined | object
Parses a location string and converts it into map coordinates. Returns undefined if the string cannot be parsed.
input
string
required
A location string to parse. Currently supports sextant format, e.g. 100o25'S,40o04'E.
const marker = worldMap.addMarker({
  name: 'Sextant Loc',
  color: 'green',
  ...worldMap.parseLocation("100o25'S,40o04'E")
});
parseLocation currently only supports sextant coordinate strings in the format DDDoMM'N/S,DDDoMM'E/W.

Examples

Track a farming route

worldMap.removeAllMarkers();

const stops = [
  { name: 'Stop 1', x: 1234, y: 2345 },
  { name: 'Stop 2', x: 1240, y: 2350 },
  { name: 'Stop 3', x: 1250, y: 2360 },
];

for (const stop of stops) {
  worldMap.addMarker({ ...stop, color: 'blue' });
}

worldMap.open();
worldMap.goTo(stops[0]);

Mark a sextant location from chat

const sextantStr = "135o25'N,32o04'W";
const coords = worldMap.parseLocation(sextantStr);

if (coords) {
  worldMap.addMarker({ name: 'Sextant Mark', color: 'red', ...coords });
  worldMap.goTo(coords);
} else {
  client.sysMsg('Could not parse sextant location.');
}

Clean up markers on script exit

// Add a temporary marker
const tempMarker = worldMap.addMarker({
  name: 'Temp',
  x: player.x,
  y: player.y,
  color: 'yellow'
});

// ... do some work ...

// Remove just this one marker when done
worldMap.removeMarker(tempMarker);

Build docs developers (and LLMs) love