def __init__(self, default_reticule, **kwargs):
super(MapBoard, self).__init__(**kwargs)
# Create the map viewer
self.mapviewer = MapViewer(**kwargs)
self.add_widget(self.mapviewer)
# Load the reticule
self.load_reticule(default_reticule)
# Create compass button
self.compass_button = CompassButton()
self.add_widget(self.compass_button)
# Add a reticule for calibration
self.reticule_calib = Builder.load_file('ui/ScatterReticule.kv')
# Create center_on_pos button
self.load_center_on_pos()
# Create path button
path_button = PathButton()
path_button.bind(on_press=self.mapviewer.toggle_tracking_path)
self.add_widget(path_button)
# Create the distance to center button
self.dist_to_center_widget = None
self.dist_to_center_visible =False
self._dist_to_center_update_trigger = Clock.create_trigger(
lambda x: self.dist_to_center_widget.set_distance(self.mapviewer.get_dist_to_center()), timeout=0.1)
self.load_dist_to_center_button()
评论列表
文章目录