Get Your Own DaylightMap

On an Android Phone

Mobile phones running the Android operating system - the Droid, Galaxy S, Nexus, and more - can now have DaylightMap on board. The app is called TerraTime, and it also offers the daylight map plus globe, as well as a portable version of my DaylightClock. Give it a try!

Or, in the best mashup tradition, you can put DaylightMap on your own website if you'd like. Take a look at the options below, and pick the one that works best for you.

On Google's My Maps

The basic day/night display can be overlaid onto maps.google.com, thanks to Google's My Maps feature. Click this button to add DaylightMap to your list of map content providers: Add Daylight to My Google Maps

On Your Google Home Page

There's a minimalist version of DaylightMap that you can place on your Google home page with one click (okay, two, but that's still pretty easy). This button will get you halfway there: Add DaylightMap gadget to iGoogle

On Your Own Web Page

The same Google Gadget from above can also be added to any web page, anywhere. You'll need to have the ability to edit your page's HTML source, but if that doesn't bother you, off you go then. Configure the gadget and get the code.

On Any Google Map

If you're a JavaScript programmer yourself, you're welcome to add our night-side shadow to your own Google Maps API integration. The layer is free of charge for most users, but an access fee is required for high-traffic sites:

Max Hits per MonthPrice per MonthCost per 1000 hits
20,000Free-
60,000US $30$0.50
200,000US $60$0.30
600,000US $120$0.20
2,000,000US $240$0.12
6,000,000US $480$0.08

A hit is defined as a single client map access, typically a single pageview of a page containing the map with the daylight layer. For more information, or to get started at a paid access level, please contact me.

To get started, add the following line to the <head> section of your HTML, after the line where you include the Google Map API itself:

    <script src="http://www.daylightmap.com/daylight_packed.js"
            type="text/javascript"></script>

Then in your JavaScript, after initializing your version 2 Google Map (using a statement like map = new GMap2(document.getElementById('map'));), add the following two lines of code:

    var daylight = new daylightMap.daylightLayer();
    daylight.addToMap(map);

obviously, changing map to match your own GMap2 object name as needed. Note also that this needs to occur before the first call to map.setCenter() in your code.

You can also add the daylight layer to a single map type (such as Satellite or Hybrid) if desired by using

    daylight.addToMapType(G_SATELLITE_MAP);

instead of the addToMap method. Any valid GMapType should work as a parameter.

The daylightLayer object has the following properties you may find useful:

when
Date/time of the daylight plot. Type: Date. Default: current date/time
opacity
Effectively, the "darkness" of the shadow, where 0 is fully transparent (and hence invisible) and 1 is fully opaque. Type: Numeric. Default: 0.5 for map view, 0.75 for satellite/hybrid
active
Whether the daylight layer is displayed when the map is redrawn. Type: Boolean. Default: true
cityLights
Whether city lights are displayed on the night side. Type: Boolean. Default: true