NASA Logo, National Aeronautics and Space Administration

NASA Extensions to the Google Maps API


Frameworks like the Google Maps API have revolutionized the way people share geospatial information. However, these platforms often lack key features that would make them more valuable to the Earth, Lunar, and planetary science communities. We are developing a set of NASA Extensions to the Google Maps API—and soon to other frameworks such as OpenLayers as well—that will make these platforms more useful to NASA scientists and our colleagues elsewhere.

The first release focuses on adding support polar maps of the Moon and Mars as well as a new global visible base map of Mars. Future updates to the NASA Extensions will provide additional fundamental features to the planetary science and GIS communities, so stay tuned! The NASA Extensions are as easy to use as the Google Maps API itself.

How to Use the NASA Maps Extensions

All you need to is include a link to the NASA Maps API JavaScript file in your web page right after you include Google Maps. In this excerpt, the red code is what loads the NASA Maps Extensions:

<script src="[YOUR_KEY]"
<script src=""

Of course, you will probably also have other things inside your <head> tag, and you should replace the symbol [YOUR_KEY] with your Google Maps API key.

List of Available NASA Map Types

Moon Maps
The Moon maps are the same as those present in Google Moon: a visible map derived from Clementine imagery and an elevation map that combines ULCN 2005 terrain data with an airbrushed shaded relief map. Much of this data is courtesy of the USGS—see our Google Moon info page for more information.


Mars Maps
The Mars visible map is a new merged base map described below. The Mars elevation map is the same as is currently used in Google Mars, created from MOLA shaded relief data made available by ASU.


Arrays and Other Map Types
Six array types are defined, to make it easy to build maps that let users switch back and forth between visible and elevation data:

  • NASA_MOON_MAP_TYPES: Mercator maps of the Moon
  • NASA_MOON_MAP_TYPES_NPOLAR: North polar stereograhic maps of the Moon
  • NASA_MOON_MAP_TYPES_SPOLAR: South polar stereograhic maps of the Moon
  • NASA_MARS_MAP_TYPES: Mercator maps of Mars
  • NASA_MARS_MAP_TYPES_NPOLAR: North polar stereograhic maps of Mars
  • NASA_MARS_MAP_TYPES_SPOLAR: South polar stereograhic maps of Mars

Of course, you can also still continue to use existing Google Maps map types including the old Mars map types, such as G_MARS_VISIBLE_MAP, as well as the Google Sky base map, G_SKY_VISIBLE_MAP. See the Google Maps API Reference for more information about the built-in map types.

Understanding the Polar Stereographic Projection

These polar maps use a polar stereographic projection, a special type of shape-preserving map projection. The particular projection used here places the north or south pole at the center of the map and extends to the equator, which forms a circle around the edge of the map.

These extensions provide a map projection object, PolarStereographicProjection, that you can use if you want to create your own custom map types using this projection. It adheres to the Google Maps API's GProjection interface, and its constructor takes two arguments:

PolarStereographicProjection( zoomlevels, type )
Construct a polar stereo projection object with the given number of zoom levels. The type argument should be one of the predefined constants NORTH or SOUTH, specifying the type of polar projection object to be created.

Much like the Mercator projection used by the Google Maps API, these particular polar stereographic projections convert latitude and longitude to pixel locations using simplifed projection formulae that assume a spherical planetary surface. This is true even in cases where the standard coordinate system for the planetary body, which defines the interpretation of latitude and longitude, is based on an ellipsoidal model (e.g. the Earth and WGS84). This behavior is counter-intuitive for professional cartographers, but it simplifies the projection software that must run inside your web browser. You only need to be aware of this difference in a few rare situations, such as if you are writing your own image projection software for use with these Maps extensions.

About the Updated Mars Visible Imagery

kml_feed_small  Open in Google Earth

The global visible Mars maps provided through these API extensions use a combination of data to create a more useful base map for overlays than other global visible base maps to date. To provide good global context when zoomed out, this base map uses low-frequency data from the MGS MOC Wide Angle Map of Mars, also available from the ASU JMars Site, but sharpens it using high-frequency data from the USGS Mars Digital Image Model 2.1, also availble from the JPL OnMoon WMS server. The result is a global base map with roughly 256 pixels/degree resolution that is useful both at high and low zoom levels and is accurate to rougly one pixel.

First Gov logo
NASA Logo -