An interactive map of Cluj-Napoca, built in 1999.
Recovered from its own binaries and made to run again.

Open the map →

Why it took two languages

In 1999 no single browser technology could draw a vector city map and pan, zoom and search it. So the map used two, and neither one could do the other's job.

Macromedia Flash 4

Could draw vectors beautifully and scale them smoothly — a whole city in 87 KB.

Could not think. ActionScript at that point was gotoAndPlay, tellTarget and a handful of fscommands. No arrays worth the name, no string handling, no way to load a data file.

A Java applet

Could think. Load a 737-entry street index over HTTP, run a search, track a viewport, drive an interface.

Could not draw. Rendering a smooth, scalable vector map in AWT 1.1 was not going to happen.

The fix was to let each do only what it was good at, and to pass messages between them through the one thing both could reach — JavaScript in the hosting page.

   zoom3 applet  ──JSObject.eval()──▶  operate.js  ──SetZoomRect──▶  map.swf
    owns the state                     translates                  draws

The entire contract between the two runtimes is four numbers and a bitfield. The applet worked out which rectangle of the city should be on screen and said so; the movie zoomed to it and asked no questions.

// Java: viewport centre and size, plus which layers are lit
win.eval("ShowPlace(" + x + "," + y + "," + dx + "," + dy + "," + opt + ")");

// JavaScript: stage pixels become twips, 1px = 20
mm.SetZoomRect(x*20, y*20, (x+dx)*20, (y+dy)*20);

The control panel

The 1999 Java applet control panel
The applet, 165 × 380, drawn by hand over a photograph. It sat to the right of the map.

There is no layout manager here and no widget toolkit doing the work. The applet painted itself over a background photograph and did its own hit-testing in arithmetic: a city thumbnail with a draggable viewport rectangle, a zoom bar running green to olive, a compass rose lettered N E S VVest, in Romanian — and six buttons blitted from a sprite sheet.

Two of those buttons opened real operating-system windows floating outside the browser, which is a thing applets could do and nothing since can. A third, Photos, was greyed out. It was never implemented, and it is still greyed out here.

The rebuilt panel keeps the same furniture in the same order, and takes its colours from this image.

What the rebuild found

Nothing here was redrawn. A parser reads map.swf byte by byte and re-emits its shape records as SVG paths, so every street is the same curve the 1999 file described. Three things came back that were not expected.

The diacritics the search had lost

The street index shipped as flat ASCII — Fat Frumos, Scolii, Piata Abator. The labels drawn on the map did not. Flash 4 predates Unicode, so its font tables store raw codepage bytes, and the only clue as to which codepage is the font's name: one font is Times New Roman CE, which is CP1250, and one is plain Times New Roman, which is CP1252. Reading each correctly restores the spelling on 340 street names.

Fat Frumos Făt Frumos  ·  Scolii Şcolii  ·  Jean Jaurcs Jean Jaurès

The character set spans both languages of the city — ăâîşţ for Romanian and áéóöő for Hungarian — which is why Zrinyi Miklós, József Attila and Mikszáth Kálmán all come back intact.

A city renaming itself

Fourteen entries in the index carry two names. They were written by hand, as it happened, in three different notations that all mean exactly what they say in Romanian — acum is "now", f. is fost, "former". The map settles which half was current, because it prints the pair as New (Old).

Grigore Ignat acum ColectivistilorColectiviştilor (Grigore Ignat)
Octavian Goga acum Jozsa BelaJózsa Béla (Octavian Goga)
Karl Marx (f. Decebal)Karl Marx (Decebal)

Both names are searchable. Typing Decebal finds the street that stopped being called that.

A spelling reform, in the way

One street refused to match anything: the index says Tirnavelor, the map says Târnavelor. That is Romania's 1993 reform swapping î for â — the same street and the same sound, but stripping the accents sends the two spellings to different letters. It needed a rule of its own.

1999 or today

Two decisions could go either way, so the map does both and lets you choose with a switch in the panel.

Spelling. CP1250 writes Romanian with a cedilla under s and t. Unicode later gave the language its own comma-below letters, and the cedilla forms are now considered wrong for it. 1999 mode keeps what the file actually says; today mode corrects it.

Labels. Flash scaled the lettering with the artwork, so at full extent all 727 labels are a few pixels tall and unreadable. Today mode holds them at a legible size instead — which means showing fewer of them, thinned by the movie's own three-tier type hierarchy, the largest tier being the 44 major boulevards.