Day/Night Overlay
Version 1.0

This class provides a custom overlay which shows an approximation of where the day/night line runs at any given date. The overlay uses an HTML5 canvas to draw the night area, therefore a HTML5 compatible browser (or a polyfill) should be used.

For a description and examples of how to use this library, check out the examples.

class DayNightOverlay

This class extends google.maps.OverlayView.

Constructor

Constructor Description
DayNightOverlay(opt_params:DayNightOverlayOptions=) The Class which represents the Overlay.

Methods

Methods Return Value Description
draw() None
onAdd() None
onRemove() None

class DayNightOverlayOptions

This class represents the optional parameter passed to the DayNightOverlay constructor. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.

Properties

Properties Type Description
date Date A specific point of time for which the day/night- overview shall be calculated (UTC date is taken).
fillColor string A color string that will be used when drawing the night area.
id string A unique identifiert which will be assigned to the canvas on which we will draw.
map google.maps.Map A handle to the Google Maps map on which the overlay shall be shown.