本文整理汇总了Python中map.Map.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Map.__init__方法的具体用法?Python Map.__init__怎么用?Python Map.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map.Map
的用法示例。
在下文中一共展示了Map.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import __init__ [as 别名]
def __init__(self, cols, rows,
frameWidth, frameHeight, widthMM, heightMM,
title, menu = None, keybindings = []):
""" TkMap extends Map and Tkinter """
Map.__init__(self, cols=cols, rows=rows,
widthMM=widthMM, heightMM=heightMM)
import pyrobot.system.share as share
if not share.gui:
share.gui = Tkinter.Tk()
share.gui.withdraw()
Tkinter.Toplevel.__init__(self,share.gui)
self.wm_title(title)
if menu == None:
menu = [('File',[['Exit',self.destroy]])]
self.menuButtons = {}
self.debug = 0
self.application = 0
self.frameWidth = frameWidth
self.frameHeight = frameHeight
self.reScale()
self.addMenu(menu)
self.frame = Tkinter.Frame(self,relief=Tkinter.RAISED,borderwidth=2)
self.frame.pack(side = "top", expand = "yes", fill = "both")
self.canvas = Tkinter.Canvas(self.frame,width=self.frameWidth,
height=self.frameHeight)
self.canvas.pack(side = "top", expand = "yes", fill = "both")
self.addKeyBindings(keybindings)
self.protocol('WM_DELETE_WINDOW', self.destroy)
self.update_idletasks()
self.canvas.focus_set()
self.canvas_width_diff = int(self.winfo_width()) - \
int(self.canvas["width"])
self.canvas_height_diff = int(self.winfo_height()) - \
int(self.canvas["height"])
示例2: __init__
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import __init__ [as 别名]
def __init__(self, lines ):
Map.__init__( self )
self.parse( lines )
示例3: __init__
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import __init__ [as 别名]
def __init__(self, lat, lng, resolution, size, proj):
Map.__init__(self, lat, lng, resolution, size, proj)
self.heights = numpy.zeros((size, size), dtype=float)