<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic KML Placemarks in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299755#M27497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might have been discussed before but I couldn't find anything doing a search.&amp;nbsp; I'm trying to pull in the following kml and display it using the esri js api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml" title="http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml"&gt;http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the placemarks are not displayed correctly.&amp;nbsp; Is there a way to remove them altogether, or display them correctly?&amp;nbsp; I tried using the getLayers() method but it just returns an empty array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2015 14:04:07 GMT</pubDate>
    <dc:creator>CharlesGant</dc:creator>
    <dc:date>2015-07-24T14:04:07Z</dc:date>
    <item>
      <title>KML Placemarks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299755#M27497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might have been discussed before but I couldn't find anything doing a search.&amp;nbsp; I'm trying to pull in the following kml and display it using the esri js api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml" title="http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml"&gt;http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the placemarks are not displayed correctly.&amp;nbsp; Is there a way to remove them altogether, or display them correctly?&amp;nbsp; I tried using the getLayers() method but it just returns an empty array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 14:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299755#M27497</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2015-07-24T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: KML Placemarks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299756#M27498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you looking to remove the pushpins?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/118820_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 17:55:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299756#M27498</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-07-24T17:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: KML Placemarks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299757#M27499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes sir!&amp;nbsp; All I want are the contours and the shaded graphics.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 18:10:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299757#M27499</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2015-07-24T18:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: KML Placemarks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299758#M27500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hide() does not work as anticipated, for some reason. Maybe it's a bug, maybe I'm not understanding it correctly. Using this sample - &lt;A href="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=layers_kml" title="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=layers_kml" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS API for JavaScript Sandbox&lt;/A&gt; - I modified the kml to use the one you posted and here's what I found...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; var layers;
&amp;nbsp;&amp;nbsp;&amp;nbsp; kml.on("load", function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domStyle.set("loading", "display", "none");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layers = kml.getLayers();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(layers, function(layer){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(layer.visible);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the console, both layers have visible as false, but they still show. As a workaround, try something like this (using opacity):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta charset="utf-8"&amp;gt;
&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;


&lt;SPAN&gt;&amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://js.arcgis.com/3.14/dijit/themes/tundra/tundra.css" target="_blank"&gt;http://js.arcgis.com/3.14/dijit/themes/tundra/tundra.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&lt;SPAN&gt;&amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://js.arcgis.com/3.14/esri/css/esri.css" target="_blank"&gt;http://js.arcgis.com/3.14/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&amp;lt;style&amp;gt;
&amp;nbsp; html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
&amp;nbsp; #map { height: 100%; margin: 0; padding: 0; }
&amp;nbsp; #meta {
&amp;nbsp;&amp;nbsp;&amp;nbsp; position: absolute;
&amp;nbsp;&amp;nbsp;&amp;nbsp; left: 20px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; bottom: 20px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 300px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 100px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 40;
&amp;nbsp;&amp;nbsp;&amp;nbsp; background: #fff;
&amp;nbsp;&amp;nbsp;&amp;nbsp; color: #777;
&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 5px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border: 2px solid #666;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -webkit-border-radius: 5px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -moz-border-radius: 5px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border-radius: 5px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; font-family: arial;
&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 0.9em;
&amp;nbsp; }
&amp;nbsp; #meta h3 {
&amp;nbsp;&amp;nbsp;&amp;nbsp; color: #666;
&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 1.1em;
&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 0px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; margin: 0px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; display: inline-block;
&amp;nbsp; }
&amp;nbsp; #loading {
&amp;nbsp;&amp;nbsp;&amp;nbsp; float: right;
&amp;nbsp; }
&amp;lt;/style&amp;gt;


&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://js.arcgis.com/3.14/" target="_blank"&gt;http://js.arcgis.com/3.14/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;
&amp;lt;script&amp;gt;
&amp;nbsp; var map;
&amp;nbsp; require([
&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/map", "esri/layers/KMLLayer",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "dojo/parser", "dojo/dom-style",


&amp;nbsp;&amp;nbsp;&amp;nbsp; "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"
&amp;nbsp; ], function(
&amp;nbsp;&amp;nbsp;&amp;nbsp; Map, KMLLayer,
&amp;nbsp;&amp;nbsp;&amp;nbsp; parser, domStyle
&amp;nbsp; ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new Map("map", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basemap: "topo",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: [-108.663, 42.68],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 6
&amp;nbsp;&amp;nbsp;&amp;nbsp; });


&amp;nbsp;&amp;nbsp;&amp;nbsp; parser.parse();


&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var kmlUrl = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml" target="_blank"&gt;http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var kml = new KMLLayer(kmlUrl);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(kml);
&amp;nbsp;&amp;nbsp;&amp;nbsp; var layers;
&amp;nbsp;&amp;nbsp;&amp;nbsp; kml.on("load", function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domStyle.set("loading", "display", "none");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layers = kml.getLayers();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layers[1].opacity = 0.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp; });
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;


&amp;lt;body class="tundra"&amp;gt;
&amp;lt;div data-dojo-type="dijit/layout/BorderContainer"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data-dojo-props="design:'headline',gutters:false"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style="width: 100%; height: 100%; margin: 0;"&amp;gt;
&amp;nbsp; &amp;lt;div id="map"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data-dojo-type="dijit/layout/ContentPane"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data-dojo-props="region:'center'"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="meta"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span id="loading"&amp;gt;&amp;lt;img src="images/loading_black.gif" /&amp;gt;&amp;lt;/span&amp;gt;
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h3&amp;gt;Display KML Using a &amp;lt;a href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https://developers.arcgis.com/javascript/jsapi/kmllayer-amd.html" target="_blank"&gt;https://developers.arcgis.com/javascript/jsapi/kmllayer-amd.html&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;KMLLayer&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The map displays a simple KML file that was created using Google Earth and
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is hosted on an Esri server. Symbology and attributes are honored.
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;
&amp;nbsp; &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="118821" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/118821_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:22:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299758#M27500</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2021-12-11T14:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: KML Placemarks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299759#M27501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so it looks like hide will work, but you can't key off of the KML load event... it must be too early to call the hide method. It works if I use "update-end":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kml.on("update-end", function() { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layers = kml.getLayers(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layers[1].hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("layer hidden");
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't seem to fire this more than twice. Panning and zooming doesn't cause the "update-end" to fire on a KML.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299759#M27501</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2021-12-11T14:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: KML Placemarks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299760#M27502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I plugged that code snippet in and it didn't work.&amp;nbsp; I printed to console the layers array and it printed the array twice with only one entry.&amp;nbsp; The code you provided should hide the first layer, correct?&amp;nbsp; That said, I'm only getting an one entry array, not two.&amp;nbsp; Its like its creating the array as it loops through the layers, not creating the array once with two layers in it.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that you were using parser in the top of your code.&amp;nbsp; I'm using ready(function(){.....}, does that make a difference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2015 15:57:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/kml-placemarks/m-p/299760#M27502</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2015-07-25T15:57:55Z</dc:date>
    </item>
  </channel>
</rss>

