- URL:
- https://<mapservice-url>/generateKml
- Methods:
GET
- Required Capability:
- Map
- Version Introduced:
- 9.3
Description
The generate
operation is performed on a map service resource and returns a KML document wrapped in a KMZ file. The document contains a network link to the KML Service endpoint with properties and parameters you specify.
Request parameters
Parameter | Details |
---|---|
| The name of the resulting KML document. This is the name that appears in the Places panel of Google Earth. Example
|
| The layers to perform the Syntax
Example
|
| The layer drawing options. Based on the option chosen, the layers are drawn as one composite image, as separate images, or as vectors. When the KML capability is enabled, the ArcGIS Server administrator has the option of setting the layer operations that are allowed. If vectors are not allowed, the caller will not be able to get vectors. Instead, the caller receives a single composite image. The following options are supported values for the
Values: |
Example usage
The following is a sample request URL used for the generate
operation:
https://machine.domain.com/webadaptor/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/generateKml?docName=Test+Name&layers=1,2&layerOptions=separateImage
KML Response example
Below is a typical KML document wrapped in an example KMZ response:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="https://earth.google.com/kml/2.1">
<NetworkLink>
<open>1</open>
<name>Test Name</name>
<Snippet>Test Map Service Description</Snippet>
<Url>
<viewRefreshMode>onStop</viewRefreshMode>
<viewRefreshTime>2</viewRefreshTime>
<href>https://myhost:8399/arcgis/services/Maps/USGeo/MapServer/KmlServer</href>
<viewFormat>
<![CDATA[
Composite=true&LayerIDs=0,1&BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]&ImageSize=[horizPixels],[vertPixels]
]]>
</viewFormat>
</Url>
</NetworkLink>
</kml>