TRAVELLER MAP

NEWS SERVICE

Updates to the Traveller Map, an interactive web-based map for the Traveller universe.

2010-03-16

PNG and DOM

Two hopefully invisible changes today, but scream if anything breaks:

I've changed the map to generating PNGs by default instead of GIFs. This is to work around a bug in embedded WebKit (seen in the Second Life Viewer 2.0 Beta) where it may not display GIFs correctly.

I've rewritten the event handling code for the map to more correctly manage DOM events, in both the W3C and IE models. This is to try and make dragging work correctly in the IE9 Platform Preview (I'll test tomorrow), clean up the code (this was my first interactive web site!), and as a side effect it fixes mouse wheel support in Chrome.

4 comments:

I have a collection of URLs for printing sectors to US Letter, and was adding a couple of links to it today.

In doing so, I noticed that the images I produced earlier (10/2/2009) resulted in images (GIF) sized 900 x 1296,whereas the images I produce today (including links I had worked out and stored earlier) now produce images (PNG) sized 1350 x 1944.

The change to PNG is a good thing, but the change in output size is unfortunate.

Weird - the old behavior must have been a bug. The scale is pixels/parsec, so you can easily compute:

width = 32pc * 48px/pc * cos(30) = 1330height = 40pc * 48px/pc = 1920

The differences (1350-1330 = 20, 1944-1920=24) are due to padding around the edges so hexes aren't cut off.

The 900x1296 number is what you'd expect for scale=32. It's possible that the Poster API didn't used to respect scale and I fixed it. If I have a chance I'll dig into it, but I can't call the current behavior a bug, unless I'm missing something.