We have been using the KML utility to display KML files in our JavaScript app for over a year. Yesterday or day before it suddenly stopped handling images that are served over HTTPS. Is this by design or a bug?
Solved! Go to Solution.
Yes, the number is BUG-000082517. Thanks for looking into it!
Daniel Walton
Lead Developer, intterra
daniel.walton@intterragroup.com
(612) 232-6784
Update: this has been filed as a software defect with ESRI. I will update when a resolution is reached.
I ran a quick test using the following sample code and running the page via https. In my test the KML layer loaded fine. In your testing do you see any errors in the browser developer console?
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title></title>
<link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.11/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" type="text/css" href="https://community.esri.com//js.arcgis.com/3.11/esri/css/esri.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map { height: 100%; margin: 0; padding: 0; }
#meta {
position: absolute;
left: 20px;
bottom: 20px;
width: 300px;
height: 100px;
z-index: 40;
background: #fff;
color: #777;
padding: 5px;
border: 2px solid #666;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family: arial;
font-size: 0.9em;
}
#meta h3 {
color: #666;
font-size: 1.1em;
padding: 0px;
margin: 0px;
display: inline-block;
}
#loading {
float: right;
}
</style>
<script src="//js.arcgis.com/3.11/"></script>
<script>
var map;
require([
"esri/map", "esri/layers/KMLLayer",
"dojo/parser", "dojo/dom-style",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"
], function(
Map, KMLLayer,
parser, domStyle
) {
map = new Map("map", {
basemap: "topo",
center: [-108.663, 42.68],
zoom: 6
});
parser.parse();
var kmlUrl = document.location.protocol + "//dl.dropbox.com/u/2654618/kml/Wyoming.kml";
var kml = new KMLLayer(kmlUrl);
map.addLayer(kml);
});
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'">
<div id="meta">
The map displays a simple KML file that was created using Google Earth and
is hosted on an Esri server. Symbology and attributes are honored.
<div>
</div>
</div>
</body>
</html>
The issue is not related to the ink file itself, but images referenced
within the kml file that are https.
Do you have an example of a KML file with the referenced images?
Here is a sample:
http://codepen.io/anon/pen/FkjxH
Daniel,
Thanks for the test case. Yes this looks like a bug in the KML utility. Did support file a bug for this one? If so do you have the bug number?
Yes, the number is BUG-000082517. Thanks for looking into it!
Daniel Walton
Lead Developer, intterra
daniel.walton@intterragroup.com
(612) 232-6784