I am trying to add a KML layer to ESRI javascript project. That part is easy enough.
I want the KML file to appear, but do not want any infowindow to display for items within that KML. All that I want is the kml image on the map as shown below.
I had it working as I described using the following dojo.connect code... but then read that this method is deprecated, so I am trying to make an I made the changes to support a kml.on("load"...) style event.
With the dojo connect function the kml layer appears without the ability to click on that layer and have an infowindow display. This is the result that I want to achieve by using the kml.on event function.
However, once I changed my code from this:
dojo.connect(kml, 'onLoad', function(lyr) {
var layers = lyr.getLayers();
dojo.forEach(layers, function(lyr) {
lyr.setInfoTemplate(null);
});
});
to
kml.on("load", function(lyr) {
var layers = lyr.getLayers();
array.forEach(layers, function(lyr) {
lyr.setInfoTemplate(null);
});
});
This new kml.on code is now causing the entire kml shape to no longer display in the map. As shown in the image below.
Any Ideas?