+ Reply to Thread
Results 1 to 4 of 4

Thread: Loading KML

  1. #1
    Christopher Piggott
    Join Date
    May 2012
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Loading KML

    I am having trouble loading KML. I'm surprised, because from the docs it looks like it should be really simple. My init looks like this:

    Code:
    var map = new esri.Map('map')
    
    var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
    map.addLayer(basemap);
    
    var kmlUrl = 'https://myserver.something.com/maptest/status.kml';
    var kml = new esri.layers.KMLLayer(kmlUrl);
    map.addLayer(kml);

    What I notice is that it doesn't ever hit my server to retrieve the kml file.

    Do I need to somehow trigger a refresh so that it loads the kml? Or is what I did above enough?

    --Chris

  2. #2
    Derek Swingley

    Join Date
    May 2010
    Posts
    1,859
    Points
    892
    Answers Provided
    165


    0

    Default Re: Loading KML

    Is your KML file publicly accessible?
    --
    @derekswingley | ArcGIS API for JavaScript Team Member.

    If you're posting a code or html sample, please wrap it in code tags.

  3. #3
    Raphael Siebenmann
    Join Date
    Sep 2010
    Posts
    5
    Points
    0
    Answers Provided
    0


    0

    Default Re: Loading KML

    Quote Originally Posted by swingley View Post
    Is your KML file publicly accessible?
    This is the second thread where I have read that the KML file needs to be publicly available. I find it very frustrating that this is not explicitly mentioned in the documentation. For example,

    http://help.arcgis.com/en/webapi/jav...kmlbuffer.html

    and

    http://help.arcgis.com/en/webapi/jav...ayers_kml.html

    Should probably be modified to mention this very important piece of information!

  4. #4
    Kelly Hutchins

    Join Date
    Oct 2009
    Posts
    885
    Points
    622
    Answers Provided
    106


    0

    Default Re: Loading KML

    Hi Raphael,

    We do mention that the KML layer needs to be publicly accessible in the API reference (see the first paragraph):

    http://help.arcgis.com/en/webapi/jav...i/kmllayer.htm

    But I agree that we should probably add this info to the sample descriptions too. We'll work on getting this info added to the sample descriptions for a future release.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts