سؤال

This issue has been plaguing me for about 2 days Google isn't helping me figure this one out. Basically, the code below should be defining the text within the balloon. Unfortunately, it's not working that way. We're ending up with what seems to be the fallback if GE can't handle the style defined in the KML.

Here's one (of many) ways I've tried injecting the KML straight into the GE plugin for rendering.

var kmlString = '' +
'<?xml version="1.0" encoding="UTF-8"?>' +
'<kml xmlns="http://www.opengis.net/kml/2.2">' +
'  <Document>' +
'    <Style id="sitegeom">' +
'      <BalloonStyle>' +
'       <text>' +
'           <![CDATA[' +
'           this is<br>a test' +
'           ]]>' +          
'       </text>' +
'      </BalloonStyle>' +
'    </Style>' +
'  </Document>' +
'</kml>';

var kmlObject = $wnd.ge.parseKml(kmlString);
$wnd.ge.getFeatures().appendChild(kmlObject);

The code on which this snippet is based came directly from the GE docs. Go figure. Anyone have an idea?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top