Forum:Update to InfoboxSector Template

From Traveller Wiki - Science-Fiction Adventure in the Far future
Jump to navigation Jump to search
Forums: Index > Watercooler > Update to InfoboxSector Template

InfoboxSector Template[edit]

Just in case everyone missed it, last week I was in contact with Joshua Bell, the operator of the Traveller map site. Traveller map is a google maps style (interactive, scrollable, zoomable) map of Traveller's charted space. The coolest map site ever.

I figured out how to work the traveller map iframe interface into the wiki. And Joshua gave permission to create the external links. So I updated the InfoboxSector to include the Traveller map link. This means the map in the Sector infobox is interactive, scrollable, zoomable, and other cool things.

My plan is (at some point) to do the Subsectors (more zoomed map to start with) and perhaps a J-6 (or J-4) map for the worlds. Assuming the worlds are actually in the Traveller map database.

Just want to know what you think. Tjoneslo 17:03, 21 January 2008 (UTC)

This looks good. It can take some time to load up though. We will also need to add this to the InfoboxSectorNoSS template as well. Dcorrin 19:37, 21 January 2008 (UTC)
There are a number of changes I've made to the InfoboxSector that have not been reflected in the InfoboxSectorNoSS. I'd just as soon update the InfoboxSector to omit the Subsector table as try and keep two Infoboxes in synch. Tjoneslo 19:58, 21 January 2008 (UTC)
I guess you could just do a check if the SS1 is defined and not display the subsector information otherwise. Dcorrin 20:08, 21 January 2008 (UTC) I guess doing it is better than talking about it. Dcorrin 20:56, 21 January 2008 (UTC)
It may be a good idea to increase the size of the window vertically to show the adjacent sectors and also eliminate the pic of the sector (upper right) from the screen, because we'll be able to get the same info form the template. Overall great job and excellent collaboration.--Sstefan 01:36, 22 January 2008 (UTC)
I am thinking of replacing the traveller map image with a "you are here" type image, basically at a smaller scale. Dcorrin 14:24, 22 January 2008 (UTC)
I might be able to add a "you are here" overlay to the map site, e.g. do an IFRAME but add in highlight_sx/sy/hx/hy parameters at the end of the URL to position an overlay image. Think about what you'd need. JoshuaBell 23:11, 26 January 2008 (UTC)
See - I've added Jump maps and a preliminary "You Are Here" indicator (API is likely to change). Feedback appreciated.
That You Are Here looks excellent for a planet or possibly a subsector location (I created a YAH template and placed this in Mora for feedback), for the sector orientation I was thinking of either a quarter image with the sector highlighted, or the whole map, for example: Q1Deneb.jpg. Note that I had a problem and needed to reverse the sign on the yah_sy parameter. Dcorrin 18:23, 6 February 2008 (UTC)
I'll ponder... I think I can do a box-style overlay pretty quickly (specify the top-left and bottom-right coordinates and you get a translucent overlay)
re: the sy parameter - my map has 0,0 for Core sector and positive Y is down - I think I inherited that from Galactic, but I'm not sure. Internally my coordinates are centered on Reference (Core 0140), intending to match the classic Traveller reference but with the origin in charted space rather than at the galactic core.
JoshuaBell 06:07, 7 February 2008 (UTC)
For the parameter I pass sy as the sector y co-ordinate, so (trimming the code bits) yah_sy=0 - sy but for the y value I seem to use the opposite e.g y=sy * 40 + 20 (a sector to hex translation). This seems to me to indicate yah_sy is +rimward, while y is +coreward or am I completely confused? Dcorrin 13:56, 7 February 2008 (UTC)
Okay, check out - you can now do overlay rectangles. And yes, my map's internal coordinate system is flipped (+y is coreward); you can get these numbers on the fly by dragging the map and then using permalink.JoshuaBell 23:17, 17 February 2008 (UTC)
This is excellent, I was dreading having to photoshop (gimp actually) 128 overlay maps. This would also work for identifying domains in the Imperium, but unfortunately not Zhodani provinces (as they are not rectangular).
As for the co-ordinates, I was not doubting that +y is coreward, just that the yah_sy for the you are here pointer is the opposite, I would think for consistency it should use the same orientation. Dcorrin 16:00, 19 February 2008 (UTC)
I've added support for multiple overlays - use ox/oy/ow/oh for the first, ox1/oy1/ow1/oh1 for the second, ox2/oy2/ow2/oh2 for the third and so forth. You can use as many as you want, but they must be contiguous (i.e. you can't start with ox1). This should let you get those pesky Zhodani provinces. Sorry about the odd numbering.--JoshuaBell 23:47, 23 February 2008 (UTC)
Great that works fine, actually only one of the provinces required this (all are oddly shaped). Dcorrin 20:32, 26 February 2008 (UTC)

If you look at sectors with a far X offset, the coordinates used for the map display/overlay are skewed. See Freedom Sector for an example. I can't figure out where the coordinate calculations are happening, but if you can point me to them I may be able to fix them. Inexorabletash (talk)

I found the right spot - Template:TravellermapSector. Calculations are adjusted so that even remote sectors will be correctly centered. Inexorabletash (talk) 19:58, 30 April 2016 (EDT)
Thank you, Josh. Awesome work. Maksim-Smelchak (talk) 09:46, 2 May 2016 (EDT)

Jump maps[edit]

I wanted to use the Jump Maps for the world articles. But I need to write up the DPL code to extract the sector/hex information. I've not had time for it just yet. But I have played with it and it looks great.

One new fix/feature: In order to get the jump map to fit in the Infobox, I'm started with a J6 map at a small scale (~32 pixels/parsec). At that scale only the high pop (or important) worlds have names. I'd like to override that, at least for the selected hex.

An integration problem: Since the URL doesn't end with a ".jpg" or other image format, the default way of displaying the link is as a link rather than as an image. Also Wiki doesn't like externally hosted images. So I may need to reproduce the renderTravellerMap() code for the jump maps. Tjoneslo 14:02, 6 February 2008 (UTC)

I've updated the style associated with the JumpMap so that if names are shown at all, all names are shown. This should satisfy that problem. (Longer term I plan to allow you to glob on CSS-like styles to the request to tweak rendering more precisely.)
Regarding the file suffix... yeah, that kinda sucks. I'm not hosting my own site so I'd have to pester the sysadmins repeatedly to replace "foo.aspx" with "foo.jpg". In our mediawiki at work can define templates for custom tags, e.g. <foo>blah</foo> and can have those turn into <bar a="prefix-blah"> ... </bar> tags. If we can do that on this wiki you could define <link>...</link> and have that resolve without script. Feasible?
JoshuaBell 06:07, 7 February 2008 (UTC)
Unfortunately we don't have that kind of access to the mediawiki software on this host. The reason that the renderTravellerMap() came about is because I copied it from the main Wikia site, where people were wanting to use it for Google charts (which does very similar things to the Jump-Map). So I know it will work. It's just not as clean as we might like. Tjoneslo 18:00, 7 February 2008 (UTC)

Are you planning to use the YAH infobox or make up another one for the Jump Maps? Rycharde 22:30, 24 February 2008 (UTC)

I was going to make a new one. No point in loosing the old templates, even if they aren't used. Tjoneslo 02:17, 25 February 2008 (UTC)

I take it you are trying to set up a jump map using the following iframe info:

JumpMap - render an image of an arbitrary rectangle of space at any size and scale
jump - jump distance to render (1 through 6, default is 6)
sector - specify the sector by name (URL encoded), e.g. "Spinward%20Marches"
hex - specify hex within the named sector (required if sector is specified)
x - map coordinate
y - map coordinate
scale - scale in pixels/parsec (default is 64)
options - rendering style options
Generate a GIF or JPEG image of the specified region.
Either sector and hex or x and y must be specified.
The x and y coordinates are in tile-space coordinates (optimized for tile rendering, not navigation);
conversion functions are in the script
Image format depends on selected options ("Candy" produces JPEG, otherwise GIF)


<img src="" />

Pulled off of Rycharde 19:00, 7 March 2008 (UTC)

To be clear, the jumpmap is NOT an iframe; that URL returns an image (media type "image/gif" or "image/jpeg", depending on options). You have to kinda ignore the "aspx" suffix. It's either non-trivial or just beyond my ASP.NET skills to do arbitrary URL-to-code mapping on my site without pestering the my hosting company for every new file while still maintaining static files. --JoshuaBell 04:53, 8 March 2008 (UTC)
Understand. Was curious is all. Here's hoping someone figures it out. Thanx. Rycharde 22:32, 8 March 2008 (UTC)