def __init__(self, tile_dir): wx.Frame.__init__(self, None, size=DefaultAppSize, title='PySlip view-relative text test') self.SetMinSize(DefaultAppSize) self.panel = wx.Panel(self, wx.ID_ANY) self.panel.SetBackgroundColour(wx.WHITE) self.panel.ClearBackground() # create the tile source object self.tile_src = Tiles(tile_dir) # build the GUI box = wx.BoxSizer(wx.HORIZONTAL) self.panel.SetSizer(box) self.pyslip = pyslip.PySlip(self.panel, tile_src=self.tile_src, min_level=MinTileLevel) box.Add(self.pyslip, proportion=1, border=1, flag=wx.EXPAND) self.panel.SetSizerAndFit(box) self.panel.Layout() self.Centre() self.Show(True) # set initial view position self.pyslip.GotoLevelAndPosition(InitViewLevel, InitViewPosition) # add test test layer self.text_layer = self.pyslip.AddTextLayer(TextViewData, map_rel=False, name='<text_view_layer>', offset_x=20, offset_y=20, fontsize=20, colour='red')
def __init__(self, tile_dir): wx.Frame.__init__(self, None, size=DefaultAppSize, title=('PySlip %s - map-relative image test' % pyslip.__version__)) self.SetMinSize(DefaultAppSize) self.panel = wx.Panel(self, wx.ID_ANY) self.panel.SetBackgroundColour(wx.WHITE) self.panel.ClearBackground() # create the tile source object self.tile_src = Tiles(tile_dir) # build the GUI box = wx.BoxSizer(wx.HORIZONTAL) self.panel.SetSizer(box) self.pyslip = pyslip.PySlip(self.panel, tile_src=self.tile_src, min_level=MinTileLevel) box.Add(self.pyslip, proportion=1, border=1, flag=wx.EXPAND) self.panel.SetSizerAndFit(box) self.panel.Layout() self.Centre() self.Show(True) # set initial view position self.pyslip.GotoLevelAndPosition(InitViewLevel, InitViewPosition) # add test layers self.poly_layer = self.pyslip.AddPolygonLayer(PolygonMapData) self.image_layer = self.pyslip.AddImageLayer(ImageMapData, map_rel=True, placement='ce', name='<image_map_layer>')
def __init__(self, tile_dir): wx.Frame.__init__(self, None, size=DefaultAppSize, title=('PySlip %s - view-relative image test' % pyslip.__version__)) self.SetMinSize(DefaultAppSize) self.panel = wx.Panel(self, wx.ID_ANY) self.panel.SetBackgroundColour(wx.WHITE) self.panel.ClearBackground() # create the tile source object self.tile_src = Tiles(tile_dir) # build the GUI box = wx.BoxSizer(wx.VERTICAL) self.pyslip = pyslip.PySlip(self.panel, tile_src=self.tile_src, min_level=MinTileLevel) box.Add(self.pyslip, proportion=1, border=1, flag=wx.EXPAND) self.panel.SetSizer(box) self.panel.Layout() self.Centre() self.Show(True) # set initial view position and add test layer(s) self.pyslip.GotoLevelAndPosition(InitViewLevel, InitViewPosition) self.text_layer = self.pyslip.AddImageLayer(ImageViewData, map_rel=False, name='<image_view_layer>', offset_x=0, offset_y=0)
def make_gui(self, parent): """Create application GUI.""" # start application layout all_display = wx.BoxSizer(wx.HORIZONTAL) parent.SetSizer(all_display) self.pyslip = pyslip.PySlip(parent, tile_src=self.tile_src, min_level=MinTileLevel) all_display.Add(self.pyslip, proportion=1, border=1, flag=wx.EXPAND) parent.SetSizerAndFit(all_display)
def make_gui_view(self, parent): """Build the map view widget parent reference to the widget parent Returns the static box sizer. """ # create gui objects sb = wx.StaticBox(parent) self.pyslip = pyslip.PySlip(parent, tile_src=tiles.Tiles()) # lay out objects box = wx.StaticBoxSizer(sb, orient=wx.HORIZONTAL) box.Add(self.pyslip, proportion=1, flag=wx.EXPAND) return box
def make_gui_view(self, parent): """Build the map view widget parent reference to the widget parent Returns the static box sizer. """ # create gui objects sb = AppStaticBox(parent, '') self.pyslip = pyslip.PySlip(parent, tile_src=self.tile_source, min_level=MinTileLevel, tilesets=['./tilesets']) # lay out objects box = wx.StaticBoxSizer(sb, orient=wx.HORIZONTAL) box.Add(self.pyslip, proportion=1, border=0, flag=wx.EXPAND) return box
def __init__(self, tile_dir): wx.Frame.__init__(self, None, size=DefaultAppSize, title=('PySlip %s - view-relative point test' % pyslip.__version__)) self.SetMinSize(DefaultAppSize) self.panel = wx.Panel(self, wx.ID_ANY) self.panel.SetBackgroundColour(wx.WHITE) self.panel.ClearBackground() # create the tile source object self.tile_src = Tiles(tile_dir) # build the GUI box = wx.BoxSizer(wx.HORIZONTAL) self.panel.SetSizer(box) self.pyslip = pyslip.PySlip(self.panel, tile_src=self.tile_src, min_level=MinTileLevel) box.Add(self.pyslip, proportion=1, border=1, flag=wx.EXPAND) self.panel.SetSizer(box) self.panel.Layout() self.Centre() self.Show(True) # add test point layers self.pyslip.AddPointLayer(PointViewDataNW, placement='nw', map_rel=False, colour='blue', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataCN, placement='cn', map_rel=False, colour='red', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataNE, placement='ne', map_rel=False, colour='green', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataCE, placement='ce', map_rel=False, colour='black', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataSE, placement='se', map_rel=False, colour='yellow', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataCS, placement='cs', map_rel=False, colour='gray', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataSW, placement='sw', map_rel=False, colour='#7f7fff', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataCW, placement='cw', map_rel=False, colour='#ff7f7f', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') self.pyslip.AddPointLayer(PointViewDataCC, placement='cc', map_rel=False, colour='#7fff7f', radius=2, offset_x=0, offset_y=0, name='<point_map_layer>') # set initial view position self.pyslip.GotoLevelAndPosition(InitViewLevel, InitViewPosition)