Custom Map Markers API
So you want to have a bunch of custom map markers on the interactive galaxy map? Perhaps locations
of your squadron's fleet carriers? Or notable places of interest? Look no further! We've got you
covered. We currently offer two methods of getting your custom marker pins into the galmap. Both
will require crafting a custom JSON that contains your markers.
Method #1: Internet-Hosted JSON Data
This method requires web hosting in which you can enable CORS (Cross-Origin Resource Sharing),
such that "edastro.com" is a valid website permitted to access your file from a Javascript program.
Or you can use a site that already has open permissions (GitHub's "raw" user content, for instance).
Known to work:
- raw.githubusercontent.com
It's as simple as calling up the map, and providing it with a URL to a file containing JSON data
for your markers. Instead of calling the normal URL:
- https://edastro.com/galmap/
You will add a parameter with the URL to your JSON data:
- https://edastro.com/galmap/?custom=URL
Alternatively, if you wish to include multiple custom JSON sets, you can specify them with a
semicolon separator, thusly:
- https://edastro.com/galmap/?custom=URL1;URL2
Method #2: Server Fetched JSON Data
Nearly the same as the above method, however the server will pre-fetch your JSON data before
loading the map into your browser screen. This method is more reliable, but is slower to load.
The URL format is as follows:
- https://edastro.com/galmap/cgi/fetch?custom=URL
Alternatively, if you wish to include multiple custom JSON sets, you can specify them with a
semicolon separator, thusly:
- https://edastro.com/galmap/cgi/fetch?custom=URL1;URL2
JSON Data Format:
The data in the referenced file(s) must be JSON, in this format:
{
"markers" : [
{
"pin" : "green",
"text" : "This is a sample marker!\nIt spans two lines of text.",
"x" : -104.625,
"y" : -0.8125,
"z" : -151.906
},
{
"pin" : "carrier",
"text" : "This is a sample marker too!",
"x" : -247.812,
"y" : -43.8438,
"z" : 64.0312
}
],
"lines" : [
{
"x1" : 0,
"y1" : 0,
"z1" : 0,
"x2" : 1000,
"y2" : 0,
"z2" : 26000,
"color" : "#F00"
},
{
"x1" : 0,
"y1" : 0,
"z1" : 0,
"x2" : -10000,
"y2" : 0,
"z2" : 45000,
"color" : "#F00"
}
]
}
In the above data, you will notice that the JSON contains an array called "markers". Within this array, each
element will contain a "pin" designation, the mouse-over text to display, and coordinates. These coordinates are
actual galaxy locations from in-game. The coordinate numbers may be in either string or numeric context.
Optionally, you can also include a second array called "lines", in which you can give galactic coordinates for
both ends of a line to be drawn on the map. The "color" variable is optional, and lines will be assumed to be
white if it is absent. The color uses standard HTML color hex codes. (The "y" coordinates are not currently used,
so these can be omitted as well).
Available marker pins, image and its associated name to use in the JSON: