GoogleMaps JSP Taglibrary  

Example 29 - Day and Night

Ever wanted to show where it was light and where it was dark? Now you can. All you have to do is add a new attribute to your <googlemaps:map> tag, the showDaylight attribute. By setting it to true your map will display the current day & night zones as an overlay on your map.

This functionality it provided courtesy of daylightmap.com and requires no downloads. All the scripts and tiles are provided by their service. If you like & use this feature you should drop them a line and let them know.

Here's the code we used:

<googlemaps:map id="map" width="780" height="300" version="2" type="STREET" zoom="15" 
	showDaylight="true">
  	<googlemaps:key domain="localhost" key="xxxx"/>
  	<googlemaps:point id="point1" address="74 Connors Lane" city="Elkton" 
  			state="MD" zipcode="21921" country="US"/>
	<googlemaps:marker id="marker1" point="point1"/>
</googlemaps:map> 
  

The coordinates tag requires version 2 maps.

Our next example shows how to display day & night zones on your map.

Google
Search for Google Maps technology:

Java JSP PHP ASP
Google™ and the GoogleMaps API are copyright of Google.