I'm trying to dump Google Earth placemark content into a div outside the plugin, and it works as expected in FireFox, but not in Chrome, Safari, or IE. The later 3 display:
<!--Content-type: mhtml-die-die-die-->
at the beginning of the placemark contents and the HTML markup is shown with the other contents. FF parses the contents as actual HTML and so it displays correctly formatted as expected.
Would anybody know how to get the other browsers to parse the content as HTML as opposed to whatever they are doing right now?
The following is my GE plugin code:
currentKmlObject = kmlObject;
ge.getFeatures().appendChild(currentKmlObject);
google.earth.addEventListener(kmlObject, 'click', function(event) {
event.preventDefault();
var placemark = event.getTarget();
var content = placemark.getBalloonHtml();
document.getElementById('balloonContents').innerHTML = content;
document.getElementById('balloonContents').innerText = content;
I am using fetchKml to load the KML data from another URL which is setup as follows:
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document>
<Placemark>
<name></name>
<description>
<![CDATA[ HTML CONTENTS ]]>
</description>
<Point>
<coordinates></coordinates>
</Point>
</Placemark>
</Document></kml>
Many thanks in advance.