3

I added the kmz layer to my map

www.spc.noaa.gov/products/md/ActiveMD.kmz

However when I click on it, all I get in the infowindow is "MD 1558". (This may change for you since it is updated in near realtime)

If I download the kmz file and rename to a kml and open in Notepad I see the following code below.

Is it possible to include the http://www.spc.noaa.gov/products/md/MD1558.kmz link in the infowindow? If not, is it possible to configure an infoWindow with the KMLLayer so that I could add my own link?

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Folder>
<name>SPC Active MDs as of Fri Aug 15 18:11:02 UTC 2014</name>
<open>1</open>
<description>
<![CDATA[
Visit http://www.spc.noaa.gov/products/md/ for more info.
]]>
</description>
<NetworkLink>
<open>1</open>
<name>MD 1558 Active Till 1915 UTC</name>
<visibility>1</visibility>
<refreshVisibility>1</refreshVisibility>
<description>
<![CDATA[
MD 1558 Active Till 1915 UTC.<br />
Visit http://www.spc.noaa.gov/products/md/md1558.html for more info.
]]>
</description>
<Link>
<href>http://www.spc.noaa.gov/products/md/MD1558.kmz</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>60</refreshInterval>
</Link>
</NetworkLink>
</Folder>
</Document>
</kml>

1 Answer 1

2

The answer depends on how robust your KML reader is and what you want to do. I downloaded both kmz files and renamed each file to .zip like you did. They are just zip files after all. I took the section of the code you posted above from

<Folder>
...
</Folder>

and put it in the MD1558.kml file right after the MD1558.kml

...
</Folder>

tag. The KML standard supports having multiple folders, etc. All the ActiveMD.kml file does is to describe how to refresh your KML reader with a new file. This configuration would allow you to see the current file and a refreshed file after the <refreshInterval>60</refreshInterval> fires.

If you don't care about the refresh or if the refresh is not displaying properly in your KML client as you hint, then rename the MD1558.KMZ to zip. Open that MD1558.kml file that is found in the MD1158.zip archive in your KML reader. The zip/kmz file allows the KML author to include icons and other media. The MD1558.kml file that I looked at only has style information in the beginning of the file.

3
  • Thank you for the reply. I'll have to think about this. Since the kmz is updated in near real-time I will have to create a script to download/parse the data. every ten minutes or so.
    – Andrew
    Commented Aug 17, 2014 at 23:01
  • Andrew does this answer the question in the last paragraph of your post? If so, then would you please mark it as answered?
    – Greg
    Commented Aug 17, 2014 at 23:18
  • Yes thank you. Just to be sure, but can a popup be configured for a kml layer using ArcGIS API for JS? I was hoping to go that route. If not, I will try your method. developers.arcgis.com/javascript/jssamples/layers_kml.html
    – Andrew
    Commented Aug 18, 2014 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.