Select to view content in your preferred language

Adding KML file in map control by JavaScript API

4024
3
02-19-2013 05:53 AM
AmmarAssem1
Emerging Contributor
I Have kml file and i need to display it into map control by using javascript api.

In this example http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/layers_kml

kml file already published in server when i replace kml url in server by url in my local disk but not work
0 Kudos
3 Replies
KellyHutchins
Esri Notable Contributor
Locally hosted kml files are not supported. The kml must be available via  a publicly accessible url. See the API reference for the KML layer for details:

http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#kmllayer
0 Kudos
NitinShinde
Emerging Contributor
I have KML accessible by public IP. but still I am not able to overlay KML on the basemap. "it is giving error spatial reference mismatch. cannot change it at client side."
Then I assigned spatial reference to kml layer as per basemap spatial reference but still not able to overlay.

Plz suggest
0 Kudos
derekswingley1
Deactivated User
Please the code you're using to create your KML Layer.
0 Kudos