You can include a Keyhole Markup Language (KML) file in a Maps Engine map. KML is a file format that can display multiple types of geographic data in new ways. For background information, refer to the KML documentation.
To use KML in a Maps Engine map, you can use one of these methods:
- Upload a KML or KMZ file to Maps Engine, for use in a Maps Engine layer and map. A KMZ file consists of a zipped KML file, possibly with associated files.
- Supply a link to a KML file or KMZ file that's already hosted on the Internet. You can then include the reference as if it were a layer in a Maps Engine map.
- Upload a KML file as a vector data source. When you do so, the KML content is converted to a vector table. Internal style specifications and 3D capabilities are lost, but you can style the data using the Maps Engine style editor.
The last use case is described in Supported data formats and limits. This article describes the top two cases.
For information about KMZ files, refer to this description in the KML Developer's Guide.
About uploaded KML
At upload, a KML file and its associated files can be uploaded as they are or they can be compressed into a KMZ file. If you upload a KML or KMZ file, Maps Engine serves it as it is, without modification. The bounds of the root KML file are shown as the bounds on the Data Details page.
Maps Engine respects the hierarchy and styles contained in uploaded KML or KMZ files, including intensity maps, custom icons, and other special effects that Maps Engine doesn't natively provide. You can't modify the style of an uploaded KML or KMZ file from within Maps Engine.To change the contents of the data, you'll need to remove the data source from Maps Engine, modify the file, and then upload it again. Alternatively, if you want to be able to change the style in Maps Engine, upload the KML file as a vector table.
<visibility>element to disable visibility, Maps Engine can't display a preview of the data source. When the map that contains the KML is displayed in Google Earth client, however, a user can view the layer.
Standard features apply to KML data sources, including access control; download options; the use of disk quota for uploaded data and internal view quota for Maps Engine views. You can use standard layer features, such as making layers visible by default, locking that setting, and modifying stacking order in a map.
There are differences in the way that clients handle a map created from a KML data source:
- Google Earth: KML is best viewed through Google Earth, where the contents of a KML-based Maps Engine map looks just like they would if Google Earth were displaying KML directly, with the exception that the map appears to contain the layers.
- Google Maps: If a KML layer is viewed in Google Maps, some features may be lost.
- WMS: KML is not supported in WMS clients.
- Maps Engine supports all the KML elements that Google Earth supports, but Google Maps supports only partial KML capabilities. For more information about Google Maps support for KML, refer to the overview of Google Maps support and related details in the KML developer documentation.
- Maps Engine does not impose size restrictions and if your KML-based map will be viewed in Google Earth, there's no size restriction at the client. However, there are size and complexity restrictions for use in Google Maps.
- A Maps Engine layer can contain only one KML data source.
- A Maps Engine map can contain an unlimited number of KML layers.
When you view the map in the Google Earth client, layers composed of KML data sources look like KML files that are viewed in a native form.
About linked KML
You can specify the URL for a KML link when you add layers to a map. Maps Engine links to the file and lists it with the layers in the map, using a display name that you specify. When you publish the map, Google Earth client users view the linked KML as if it were a layer.
Linked KML files in Maps Engine maps are not currently exposed through Google Maps or the Google Earth plug-in.
- You can add any number of KML or KMZ links to a map.
- You must use the protocol HTTP or HTTPS when you specify the link. The map won't process if you omit the
- There are no restrictions on the size or content of the linked files.
- If the linked file contains nested KML files, the nested files are included, nested as they are in the source file.
When you view the map in the Google Earth client, you'll notice that a KMZ link can be opened to show all the KML files that it includes.