本文整理汇总了Python中map.Map.add_track方法的典型用法代码示例。如果您正苦于以下问题:Python Map.add_track方法的具体用法?Python Map.add_track怎么用?Python Map.add_track使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map.Map
的用法示例。
在下文中一共展示了Map.add_track方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_map
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import add_track [as 别名]
def test_map(self):
from gi.repository import Gtk
try:
from .config import Config
from .map import Map
except SystemError:
from config import Config
from map import Map
test_config = Config(None).default_config["map"]
test_map = Map(test_config)
test_map.set_zoom(16)
test_map.set_position(52.513, 13.323)
test_map.add_marker("111", "green", 52.513, 13.322)
test_map.add_marker("222", "red", 52.512, 13.322)
test_map.add_marker("333", "orange", 52.512, 13.322)
test_map.locate_marker("111")
test_map.add_marker("222", "red", 52.510, 13.321)
test_map.add_marker("333", "orange", 52.511, 13.322)
test_map.add_marker("444", "green", 52.511, 13.322)
test_map.add_marker("server1", "server1", 52.511, 13.321)
test_map.set_position(52.513,13.323)
test_map.zoom_out()
test_map.zoom_in()
test_map.on_map_pressed(None, None)
test_map.change_source("openstreetmap")
test_map.change_source("opencyclemap")
test_map.remove_marker("333")
test_map.add_track(52.513, 13.323,'server1', color=(0,16621,19455))
test_map.add_track(52.510, 13.321,'server1')
test_map.add_track(52.511, 13.321,'server1')
test_map.set_track_color('server1', (65535,1,65535))
test_window = Gtk.Window()
test_window.set_title("Kismon Test Map")
test_window.connect("destroy", Gtk.main_quit)
test_window.show()
test_window.set_size_request(640, 480)
test_window.add(test_map.widget)
test_window.show_all()
示例2: __init__
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import add_track [as 别名]
#.........这里部分代码省略.........
return False
thread = self.client_threads[server_id]
if len(thread.client.error) > 0:
for error in thread.client.error:
self.main_window.log_list.add(server_name, error)
thread.client.error = []
self.main_window.server_tabs[server_id].server_switch.set_active(False)
page_num = self.main_window.notebook.page_num(self.main_window.log_list.widget)
self.main_window.notebook.set_current_page(page_num)
#gps
gps = None
fix = None
gps_queue = thread.get_queue("gps")
while True:
try:
data = gps_queue.pop()
if gps is None:
gps = data
if data["fix"] > 1:
fix = (data["lat"], data["lon"])
break
except IndexError:
break
if gps is not None:
self.main_window.server_tabs[server_id].update_gps_table(gps)
if fix is not None and self.map is not None:
server = "server%s" % (server_id + 1)
if server_id == 0:
self.map.set_position(fix[0], fix[1])
else:
self.map.add_marker(server, server, fix[0], fix[1])
self.map.add_track(fix[0], fix[1], server_id)
#status
for data in thread.get_queue("status"):
self.main_window.log_list.add(server_name, data["text"])
#info
info_queue = thread.get_queue("info")
try:
data = info_queue.pop()
self.main_window.server_tabs[server_id].update_info_table(data)
except IndexError:
pass
#source
update = False
for data in thread.get_queue("source"):
uuid = data["uuid"]
if uuid == "00000000-0000-0000-0000-000000000000":
continue
self.sources[server_id][uuid] = data
update = True
if update is True:
self.main_window.server_tabs[server_id].update_sources_table(self.sources[server_id])
def queues_handler(self):
for server_id in self.client_threads:
self.queue_handler(server_id)
return True
def queue_handler_networks(self, server_id):
thread = self.client_threads[server_id]