Overview
There are three ways to access Google Maps Engine maps and layers through API libraries:
- Google Maps API (Visualization Library) - a JavaScript API with a Visualization Library (containing a MapsEngineLayer class) that enables an application to render Maps Engine maps and layers.
- Google Maps Engine API - a RESTful API that lets you programmatically access values for maps and layers stored in the Maps Engine database.
- Google Earth API - a JavaScript API that enables an application to render a Maps Engine 3D map using the Google Earth Plug-in.
Google Maps API (Visualization Library)
Requirements:
- An application based on the Google Maps API.
- OAuth 2.0 authentication to validate user access to privately published maps.
- Users who belong to the relevant Maps Engine access lists.
Details:
In the Google Maps API visualization library, the Maps Engine layer lets you render layers of a published Maps Engine map in a map application. When you program with the MapsEngineLayer class, you can display a Google Maps Engine layer on a Maps API map in two different ways:
- Specify the layer by its
mapIdandlayerKey - Specify the layer using its
layerId
Obtaining values for mapId and layerKey
- In Google Maps Engine, display the Map Details page for the map whose layers you want to use.
- Click the link shown here in bold italics:
Maps API ID: Details
- The Maps API ID dialog appears, displaying information similar to what you see in this example:
Maps API ID Map ID: 16802594301115717071-018062511912823249 Layer Name Layer key California ZIP codes layer_00001 California state parks layer_00002
- Use the long numeric Map ID value shown in the dialog for the
MapsEngineLayer mapIdvalue.
- Use the Layer key value for the
MapsEngineLayer layerKeyvalue.
You can edit the default layer keys to make them more user-friendly and meaningful. You can use any characters, including spaces.
To edit a layer key:
- Position the mouse pointer over the current layer key until an edit link appears.
- Click the layer key and type the new key into the edit field.
- Press the Return or Enter key.
Here's an example of how you can edit names so that they immediately describe the layer content to the user:
Maps API ID
Map ID: 16802594301115717071-01806251191282324927
Layer Name Layer key
California ZIP codes ZIP codes
California state parks state parks
|
Obtaining the value for layerId
- In Google Maps Engine, display the Layer Details page for the layer you want to use.
- Click the link shown here in bold italics:
Links: Asset ID
- The Layer API ID dialog appears, displaying information similar to what you see in this example:
13933004153574033452-03932489302544561878
- Use the long numeric Asset ID value shown in the dialog for the
MapsEngineLayer layerIdvalue.
Example application:
For an example of a MapsEngineLayer web application, see this map, which shows an imagery layer of NOAA coastline change analysis and a vector layer of urban areas throughout the US. Also see the Google Earth Gallery for additional examples of high-quality Google Maps Engine applications.
Google Maps Engine API
Requirements:
- An application based on the Google Maps Engine API. The application accesses data stored in the Maps Engine platform.
- OAuth 2.0 authentication to validate user access to privately published maps.
- Users who belong to the relevant Maps Engine access lists.
Google Earth API for the Google Earth Plug-in
Requirements:
- Google Earth Plug-in Client version 6.0.3 or later.
- To view access-controlled maps, a Google or Google Apps account that is a member of the relevant Maps Engine access list.
- On a web page, custom JavaScript code that uses Google Earth API to connect to Maps Engine; code must include authentication for private maps.
Details:
To make a Maps Engine 3D map available through Google Earth Plug-in, a web developer must create a custom JavaScript application that uses Google Earth API to connect to a public Maps Engine map. The application can also contain these functions:
- Perform authentication using OAuth (OAuth 2.0 preferred) for private maps.
- Request and display published maps.
- Display the layers of a map that a user requests.
A map viewer must have a supported browser and a supported version of the Google Earth Plug-in.
