redraw the map with current settings

def redraw_map(self):
        '''redraw the map with current settings'''
        state = self.state

        view_same = (self.last_view is not None and self.map_img is not None and self.last_view == self.current_view())

        if view_same and not state.need_redraw:
            return

        # get the new map
        self.map_img = state.mt.area_to_image(state.lat, state.lon,
                                              state.width, state.height, state.ground_width)
        if state.brightness != 0: # valid state.brightness range is [-255, 255]
            brightness = np.uint8(np.abs(state.brightness))
            if state.brightness > 0:
                self.map_img = np.where((255 - self.map_img) < brightness, 255, self.map_img + brightness)
            else:
                self.map_img = np.where((255 + self.map_img) < brightness, 0, self.map_img - brightness)
            
        # find display bounding box
        (lat2,lon2) = self.coordinates(state.width-1, state.height-1)
        bounds = (lat2, state.lon, state.lat-lat2, lon2-state.lon)

        # get the image
        img = self.map_img.copy()

        # possibly draw a grid
        if state.grid:
            SlipGrid('grid', layer=3, linewidth=1, colour=(255,255,0)).draw(img, self.pixmapper, bounds)

        # draw layer objects
        keys = state.layers.keys()
        keys = sorted(list(keys))
        for k in keys:
            self.draw_objects(state.layers[k], bounds, img)

        # draw information objects
        for key in state.info:
            state.info[key].draw(state.panel, state.panel.information)

        # display the image
        self.imagePanel.set_image(img)

        self.update_position()

        self.mainSizer.Fit(self)
        self.Refresh()
        self.last_view = self.current_view()
        self.SetFocus()
        state.need_redraw = False