The project to add elevation profiles to each ham radio QSO on a QSO map is moving along. I've started to prototype inserting elevation charts into the map—via kml—of elevation profiles per QSO today.
I had a slight bit of consternation that the charts might not be visible at all after coming across a post on stackoverflow that indicated text encoded images cannot be used as icons in kml files for Google Earth.
I am happy to report however, that text encoded images in description fields for kml Placemark tabs work great!
A tag like:
<Placemark>
<name>kj7dt
</name>
..............
<description>
<![CDATA[<div width="400px"<h1>kj7dt
</h1>Date/Time GMT: <div><br></div>"2023-02-12T21:58:00"<div><br></div><div><img width="100%" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAH..............
.......FTkSuQmCC"></div></div>]]></description>
...........................
</Placemark>
Produces:
on Google Earth Web.
In the above kml, the chart is added by the
<img width="100%" src="data:image/png;base64,iVBORw0KGgo.........
tag. The chart's png is stored as text encoded data directly in the kml file so that Google Earth Web users can easily read the file. Google Earth Web does not open kmz files at the time of this writing. See this for more info on how the png data was created. [The series of dots in the kml above indicate that unrelated tags or the remaining encoded image text have been omitted.]
If the width="100%" parameter is left out of the img tag, then the chart has to be horizontally scrolled on Google Earth Web. I'll talk more about that in the next TIL.
Comments
Post a Comment
Please leave your comments on this topic: