I'm new to the ArcGIS API. I have experience with Google Earth API so please bare with me on this question as it might be simple. Below is my attached codepen I can't figure out why the KML will not show up when I use the Tiled Map service with adding the KML. I suspect that it is being placed behind the REST map, but I'm not entirely sure.
Could someone point me in the right direction or provide some input.
V/r
Jeremy
Solved! Go to Solution.
Actually, I was incorrect... it's this bit of code that's preventing the KML from rendering:
kml.on("load", function() { domStyle.set("loading", "display", "none"); });
But, you can still set-up the basemap in the map constructor as an alternative way to show the topo layer. If you are curious, here's how it would look:
map = new Map("map", { basemap: "topo" });
Many ways to skin a cat in the ArcGIS JSAPI!
Jeremy,
Try setting your basemap in the map's constructor. That's one way to solve it!
Actually, I was incorrect... it's this bit of code that's preventing the KML from rendering:
kml.on("load", function() { domStyle.set("loading", "display", "none"); });
But, you can still set-up the basemap in the map constructor as an alternative way to show the topo layer. If you are curious, here's how it would look:
map = new Map("map", { basemap: "topo" });
Many ways to skin a cat in the ArcGIS JSAPI!
I failed to mention I'm behind a firewall and need to utilize my ArcGIS REST server. I can see that the code wants to go to the services.arcgisonline.com REST server.
Jeremy,
Straight from the KMLLayer docs:
Note: The KMLLayer uses a utility service from ArcGIS.com, therefore your kml/kmz must be publicly accessible on the internet. If your kml/kmz files are behind the firewall you will need to set the
esriConfig.defaults.kmlService
to your own utility service. (Requires Portal for ArcGIS).
I know and researched this information regarding the loading of KMLLayers. I have my KML rendering to the internal server with the esri/config code to achieve this.
However it is hit or miss when it renders so I assumed it was the REST services causing this problem or my coding.
Thank removined the on load piece resolved this issue and I can still use my REST services. Much appreciated.