Select to view content in your preferred language

Save layer to kml

982
5
06-21-2010 07:42 PM
LedonneJuan
Emerging Contributor
Hi, it is possible to save a dynamic or tiled map layer to kml? if yes, can anyone post a sample code.

and also how can i dynamically add a kml file?

thanks and God Bless
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
To create KML files, you can use the GP tools : MapToKML and/or LayerToKml.

To create a kml layer in a ESRI silverlight application, there is a sample here : http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=164...

and a thread here : http://forums.arcgis.com/threads/4897-KML-layer
0 Kudos
LedonneJuan
Emerging Contributor
Thanks for the reply. is it possible to add kml layer from local hard disk, just like in arc explorer
0 Kudos
DominiqueBroux
Esri Frequent Contributor
The sample is not designed to allow adding kml layer from local hard disk.
But I guess, it's possible to modify it in order to get a file by 'OpenFileDialog' and to use this file to populate the kml layer.
0 Kudos
DanielWalton
Frequent Contributor
This is very easily done. Search through the KML sample code and you will eventually find the code that converts a stream object into an XDocument object. You just have to write code to connect an OpenFileDialog.File.OpenRead() (Filestream) object to that routine.
0 Kudos
LedonneJuan
Emerging Contributor
thanks for the replies. i will try your advices.

God Bless
0 Kudos