KML Layer help.

Discussion created by skyillusion on Jun 23, 2012
Latest reply on Jul 9, 2012 by jeff.pace
    I am sort of new to this. And I am having a problem 'importing' kml files into my base map. I am quite sure that my links for my kml files is public accessible, and have no idea what is wrong. I have followed the examples provided by the Arcgis javascript API with no avail. I am hoping to get some help here.

The following is the snippet of my javascript codes:

        var myMap, myTiledMapServiceLayer;
        function init() {
            myMap = new esri.Map("mapDiv");
            myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("");
            var kmlUrl = '';
            var kml = new esri.layers.KMLLayer(kmlUrl);

            dojo.connect(kml, 'onLoad', function () {
      'loading'), 'display', 'none');

            dojo.connect(myMap, 'onLoad', function() {
            //resize the map when the browser resizes
                 dojo.connect(dijit.byId('mapDiv'), 'resize', map,map.resize);

I have tried importing the hardcopy of the kml file to the server (they have a function to allow the overlaying of personal kml files) and it works perfectly.
I am also not sure if I need to set the extent of the map in order to get it to work. But as for now, the onemap's map is showing on my browser, but not the overlay.
Any help would be appreciated.