generate kml

969
2
07-11-2011 12:30 PM
LisaT
by
Occasional Contributor III
Hi, I am trying to export a kml using the javascript REST api.  I see in the documentation that there is a "generateKml" operation (see: http://atlas.resources.ca.gov/ArcGIS/SDK/REST/mapserver.html) however it does not seem to be available.  I am getting an error: "generateKml is not a function".  If I look at it in firebug, I see available methods "exportMap" and "queryLayer", but no "generateKml". Does anyone know what I may be doing wrong?  We have the most current API downloaded.  How can I export a kml via the rest api?

EDIT:
I have the following working...kinda:  //myServer/ArcGIS/rest/services/myService/MapServer/generatekml?docName=Test+Name&layers=1,2&layerOptions=separateImage

This creates a KML with a big red X in the correct location in google earth.  So, it seems to be doing something right, just not displaying the image correctly.  If I use the URL above with "nonComposite" (vector) as a parameter, I get no image.

//myServer/ArcGIS/rest/services/myService/MapServer/kml/mapImage.kmz seems to work, but I need a vector representation instead of one large image.

So, I guess the question has changed to: how can I export a vector KML?  And/or how do I use "generateKml" ??
0 Kudos
2 Replies
ar4
by
New Contributor
I was unable to get this to work reliably.

I wound up using an external java library.

As I bonus I got much more control over my results.
0 Kudos
LisaT
by
Occasional Contributor III
I am really hoping someone can help me? 

I have my mapservice in arccatalog with kml web access for single, separate, and vector images. Capability mode is google earth.  If I use the URL given: http://server/arcgis/services/folder/MapServer/KmlServer...I get "Page cannot be found" in both Mozilla and IE.

Any ideas what I am doing wrong?
0 Kudos