This setting goals thing just might work.
The day after I set the goal to find a new time icon solution for the animated kml QSO maps a solution appeared. I was studying (again) the new Google Charts API, hoping it might be similar enough to the old visualization API to provide a solution—it was not—when I looked at the new map chart, more for the fun of it than for any other reason, and there it was: the answer I'd been looking for. Mind you, the answer was not in fact the chart API itself. The answer came in the form of map marker icons.
Allow me to give you a little background and/or catch you up. Google Earth Pro map animations are very cool. We use them to watch QSO frequency during POTA and SOTA activations, and have more than once used them to observe that our overseas QSO were in fact gray line QSOs. But, it's very difficult to see the tiny time indicator on the animation play controls.
That's OK though because there's a way to fix the issue. The kml screen overlay tag displays images on a map. Clearly, I just need an image that contains text designating each time of interest. With the deprecated chart API, this was a simple matter. The API returned PNG images intended to be displayed on web pages. I used the text bubble visualization specifically. It accepted an argument for the text it displayed. Simple. Then, it went away. (To be fair, the API has been 'deprecated' for a little over a decade.
So, I was back out on the streets looking for a way to get pictures of arbitrary timestamps from somewhere... anywhere really... on the web. Which leads us back to the new Google Charts API. For supported charts there's a getImageURI method that outputs raw PNG data representing the chart. (I'm going to use this method to display elevation charts, and therein lies the solution for displaying callsigns with the timestamps ala elevation chart titles... Anyway.)
That solution wouldn't work for timestamps thought, and as of today, there are no charts whatsoever that just dump out text. So, seemingly no solutions there, but wait! As I was browsing through the map chart docs, I noticed an offhanded reference to an online icon warehouse that could be used for map pins. It was exactly what I needed! I only had to browse the icon catalog for a few minute to find what I was looking for: a collection of 48 pixel wide icons each displaying a single decimal digit. To display a single one of these digits, I can use a URL like this:
https://icons.iconarchive.com/icons/twitter/twemoji-alphabet/48/Number-0-icon.png
To display the time down to the minute in the kml jinja template I used four blocks like this one:
<ScreenOverlay>
<name>Map Time{{loop.index}}</name>
<Icon>
<href><![CDATA[https://icons.iconarchive.com/icons/twitter/twemoji-alphabet/48/Number-{{ map_minute.11 }}-icon.png]]></href>
</Icon>
<drawOrder>{{loop.index}}</drawOrder>
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="0.10" y="0.1" xunits="fraction" yunits="fraction"/>
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
<size x="0" y="0" xunits="fraction" yunits="fraction"/>
<TimeStamp>{{ map_minute }}</TimeStamp>
</ScreenOverlay>
And voila! The time labels are back!
Comments
Post a Comment
Please leave your comments on this topic: