Map image demo
Below is a map that is created on demand, there is no stored bitmap file:
It is made by having a div tag with the ID set to "theTarget" and placing this function call in the onload() method of the body tag:
createImage('Maps/olddranik.txt', 1, 0, 0, 0, 0, true, 'theTarget', 500, 200,
[[-799, 37, 255, 0, 0, 5, ''],
[-2455, -1203, 0, 255, 0, 5, ''],
[-3019, -867, 0, 0, 255, 5, ''],
[-2222, -976, 255, 255, 0, 5, 'A'],
[-2490, -651, 255, 0, 255, 5, ''],
[-2060, -695, 0, 255, 255, 5, ''],
[-1120, -729, 128, 64, 192, 5, '']]
)"
The paramaters to the function:
- 'Maps/olddranik.txt' - local path to the file with old dranik map from Seeds of Destruction.
- 1 - zoom factor, 1 is default and scaled to put the entire map into the image size.
- 0, 0 - this is the center point of the displayed map. 0,0 is a special setting that instead of setting a point, it calculates and uses the center of the zone.
- 0, 0 - this is the height filter. 0,0 again is special, meaning show all heights.
- true - this says to use colored lines based on z-axis. If set it makes low z-axis red and high z-axis blue. If set false all lines are black.
- 'theTarget' - this is the div element in HTML which gets the canvas.
- 500, 200 - the size of the canvas to create. The image is automatically scaled to the canvas size making it easier to place.
- *array of numbers* - this is the location of the dots. Each line is an x, y coord (in map file coords, NOT in game /loc format), an RGB color code, a size (5 pixels), and an optional text entry to put in circle. It is hard coded black, so doesn't always show well. In this case each marker is where a rare mob pops.
This second example shows Tellivar's location in Korafax, with the image zoomed in (scale factor 5), centered at -900, 600, with a height filter of -100 to 100 to hide the lines of the floor beneath it, with a single purple marker with a T in it, and colored lines turned off (so solid black).
The map files MUST be stored on the same domain due to sandbox restrictions.