How to Draw a Day/Night World Map

Actually, there is nothing too hard, especially if you have a good astronomical algorithm library. Nowadays we could do this using only plain JavaScript and HTML5 canvas.