A fun little script, could be useful if you are in dire need of some clip art -- or just want to see something else than text, text, text: worldmap.js
This is a Javascript implementation of a program I had on the hard disc of several consecutive computers, going back to the late '80s. This version was an implementation in C, which in turn was based upon a Pascal program: CARTOG.PAS, accompanying "Mapping the World in Pascal" by Robert Miller and Francis Reddy, BYTE, December 1987, page 329
What does it do? It draws a world map. That's all ![]()
Written for CS4 (it just might work on CS3, but not on older versions). Simply double-click to run -- it ought to do the rest automatically. If you want to see your location from outer space, go to LATITUDE et LONGITUDE de quelques Villes (which was the first comprehensive listing I found; there are lots of others) and see if your hamlet is listed. You can enter coordinates either as positive/negative values, or succeed them with "E" or "W" and "N" or "S". Only decimal notation is supported -- sorry, minutes & seconds was too much work.
What does it look like? Well, here's where I live:
So now you can wave if you fly over my house!
HOW TO USE
Download the script and unzip it somewhere on your hard disc. Put the file "worldmap.js" in your User Scripts Panel -- a fast way to get there is to right-click any script in the Scripts Panel and select "Reveal in Explorer/Finder". If copied to the correct location, it will automatically appear in the Script Panel list. Double-click to run; nothing else is needed.
KNOWN BUGS
There is one difficult-to-track-down bug that ruins the view where only a small part of huge, globe spanning Asia should be drawn. If that happens ... try some other coordinates ...
TECHNICAL INFO
The original C (slash Pascal) file came with a coordinate file, but that was extremely rough. I thought it would look nicer with a few more decimals of accuracy, so I visited the Natural Earth website and downloaded their coastal outlines set. Being unnaturally cautious, I downloaded their smallest file -- it's still more than 5,000 coordinates. I don't think it's worth to throw in more vectors at this scale (no, I'm not going to write a full browse-zoom-and-draw-map applet). The outline files are binary encoded, so it took some sleuthing to write out the info I needed in ASCII form. No problem at all! (And I suspect the file format is somewhere on that site, but I didn't even bother to check ;-) ). Then I had to manually close all open paths, so ID could fill the objects for me.
Then it came down to getting the vectors on screen, first in a Mercator (plain) projection -- that code is still in the script somewhere --, then in orthogonal projection. The original program only could handle lines, so I had to find a way to draw the solid objects going over the edge (and that's where the large-land-mass bug slipped in). For the rest, it's all maths, maths, maths, with some JS cleverness to make it run at a fair speed.
-- a small improvement in case anyone wants to give the world some color: in the new version (still called worldmap.js, though), you can ungroup once and you get three separate parts: the globe, the land masses (a group in itself), and the meridians (also a group of its own).
InDesign even allows the hundreds of little land masses to be combined into a single Compound path, so you can give them a shared gradient:
I also wrote a high-resolution version but it does not nearly run as fast as this one (suddenly it takes minutes to draw even a tiny part). Much lower on the sheer fun-factor :-( Wouldn't want to keep this image for myself, though :-)
The data set is so big, poor Javascript cannot handle that array size (and InDesign "unexpectedly quits"), so I have to read it from an external file. And it's much too much work to manually close all polylines, as I did with the lo-res version ![]()
If you feel like experimenting, this data set is a to-ASCII conversion of the coast outline data on the website I mentioned. I could send you the quick-and-dirty C program I used to convert the data set. Theoretically, if you can get that data into the current script, it ought to work the same.
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).