本文整理汇总了Python中map.Map.set_zoom方法的典型用法代码示例。如果您正苦于以下问题:Python Map.set_zoom方法的具体用法?Python Map.set_zoom怎么用?Python Map.set_zoom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map.Map
的用法示例。
在下文中一共展示了Map.set_zoom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_map
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import set_zoom [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 set_zoom [as 别名]
#.........这里部分代码省略.........
self.networks.notify_remove_list["map"] = self.map.remove_marker
self.main_window.network_list.crypt_cache = self.crypt_cache
self.battery_max = None
self.battery = None
path = "/proc/acpi/battery/"
if os.path.exists(path):
for name in os.listdir(path):
self.battery = name
f = open("%s%s/info" % (path, name))
for line in f.readlines():
if line.startswith("last full capacity:"):
max = line.split(":")[1].strip()
self.battery_max = int(max.split()[0])
break
GObject.timeout_add(30000, self.update_battery_bar)
break
self.update_battery_bar()
GLib.timeout_add(500, self.queue_handler)
GLib.timeout_add(300, self.queue_handler_networks)
GLib.idle_add(self.networks.apply_filters)
def init_map(self):
if self.map_error is not None:
self.map = None
else:
try:
from .map import Map
except SystemError:
from map import Map
self.map = Map(self.config["map"])
self.map.set_zoom(16)
pos = self.config["map"]["last_position"].split("/")
self.map.set_position(float(pos[0]), float(pos[1]), True)
def init_client_thread(self):
self.client_thread = ClientThread(self.config["kismet"]["server"])
self.client_thread.client.set_capabilities(
('status', 'source', 'info', 'gps', 'bssid', 'bssidsrc', 'ssid'))
if "--create-kismet-dump" in sys.argv:
self.client_thread.client.enable_dump()
def client_start(self):
if self.client_thread.is_running is True:
self.client_stop()
self.sources = {}
self.init_client_thread()
if "--load-kismet-dump" in sys.argv:
self.client_thread.client.load_dump(sys.argv[2])
self.client_thread.start()
def client_stop(self):
self.client_thread.stop()
def queue_handler(self):
if self.main_window.gtkwin is None:
return False
if len(self.client_thread.client.error) > 0:
for error in self.client_thread.client.error:
self.main_window.log_list.add(error)
self.client_thread.client.error = []
#gps