I have created a KML file with CSS formatting for the contents of the balloon. The CSS is read and displays fine in Google Earth, but not when using the Google Maps API. Can anyone tell me why and how to overcome this please?
Here's the relevant snippets from the KML file...
<Style id="Summit_Target">
<IconStyle>
<Icon><href>http://www.virtualmountains.co.uk/shared/Summit_Target.png</href></Icon>
</IconStyle>
<BalloonStyle>
<text>$[description]</text>
<bgColor>white</bgColor>
<text><![CDATA[
<font color="#674A32" face="arial" align="justify">$[description]</font>
]]></text>
</BalloonStyle>
<LabelStyle>
<color>FF14B450</color>
<scale>0.8</scale>
</LabelStyle>
</Style>
<Placemark>
<name>High Street</name>
<description>
<![CDATA[
<style>
H1{text-align:left; font-size:12pt; font-weight:bold;} P{font-size:10pt;}
img{width:96px; height:120px; float:left; border:0; margin-right:8px}
</style>
<H1>High Street</H1>
<P>
<IMG SRC="High_Street_Summit.jpg" title="High Street" alt="High Street">
At 828m, with a 373m drop, High Street appears in many a hill bagger's list includings a Nuttell, Marilyn, Simm, Hewitt, Wainwright, Birkett, and Trail 100.<BR><BR>Roman engineers built a road across the summit linking their forts at Brougham and Ambleside, thus giving the hill its name.<BR><BR>A second name <i>’Racecourse Hill’</i> is derived from the summer fairs and horseraces that were held here unp until 1835.<BR><BR>The mountain's summit is crowned by an Ordnance Survey triangulation pillar.
</P>
]]>
</description>
<styleUrl>#Summit_Target</styleUrl>
<Point><coordinates>-2.864838,54.491697,0</coordinates></Point>
</Placemark>
Here's how the balloon appears in Google Earth, i.e. as I'm expecting it too...
But here is how it appears on the web when read by the Google Maps API...
- The title is centred, not left justified.
- The title is not in 12pt Arial bold .
- The main text starts near the bottom of the image, not to the right at the top.
- The line spacing (though not specified) looks great in Google Earth, but not in Google Maps.
If anyone can help me correct this, it will be much appreciated.