From 9ad02908b4d0451004eece2397c003328a289770 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 18 Sep 2008 20:14:43 +0200 Subject: [PATCH] Make labels smaller. --- igc2kmz/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/igc2kmz/__init__.py b/igc2kmz/__init__.py index eb9bee7..0c7560d 100644 --- a/igc2kmz/__init__.py +++ b/igc2kmz/__init__.py @@ -23,13 +23,14 @@ class Stock(object): def __init__(self): self.kmz = kmz.kmz() + self.label_scales = [math.sqrt(x) for x in [0.8, 0.6, 0.4]] self.radio_folder_style = kml.Style(kml.ListStyle(listItemType='radioFolder')) self.kmz.add_roots(self.radio_folder_style) self.check_hide_children_style = kml.Style(kml.ListStyle(listItemType='checkHideChildren')) self.kmz.add_roots(self.check_hide_children_style) balloon_style = kml.BalloonStyle(text=kml.CDATA('

$[name]

$[description]')) icon_style = kml.IconStyle(kml.Icon.palette(4, 24), scale=0.5) - label_style = kml.LabelStyle(color='880033ff', scale=math.sqrt(0.8)) + label_style = kml.LabelStyle(color='880033ff', scale=self.label_scales[1]) line_style = kml.LineStyle(color='880033ff', width=4) self.thermal_style = kml.Style(balloon_style, icon_style, label_style, line_style) self.kmz.add_roots(self.thermal_style) @@ -55,7 +56,7 @@ class Globals(object): for c in self.altitude_scale.colors(): balloon_style = kml.BalloonStyle(text='$[description]') icon_style = kml.IconStyle(kml.Icon.palette(4, 24), scale=0.5) - label_style = kml.LabelStyle(color=c) + label_style = kml.LabelStyle(color=c, scale=self.stock.label_scales[1]) self.altitude_styles.append(kml.Style(balloon_style, icon_style, label_style)) self.stock.kmz.add_roots(*self.altitude_styles) self.climb_scale = scale.ZeroCenteredScale(self.bounds.climb.tuple(), title='climb', step=0.1, gradient=color.bilinear_gradient)