code: def follow(self, object):
          '''follow an object on the map'''
          state = self.state
          (px,py) = state.panel.pixmapper(object.latlon)
          ratio = 0.25
          if (px > ratio*state.width and
              px < (1.0-ratio)*state.width and
              py > ratio*state.height and
              py < (1.0-ratio)*state.height):
              # we're in the mid part of the map already, don't move
              return
  
          if not state.follow:
              # the user has disabled following
              return
  
          (lat, lon) = object.latlon
          state.panel.re_center(state.width/2, state.height/2, lat, lonf follow(self, object):
          '''follow an object on the map'''
          state = self.state
          (px,py) = state.panel.pixmapper(object.latlon)
          ratio = 0.25
          if (px > ratio*state.width and
              px < (1.0-ratio)*state.width and
              py > ratio*state.height and
              py < (1.0-ratio)*state.height):
              # we're in the mid part of the map already, don't move
              return
  
          if not state.follow:
              # the user has disabled following
              return
  
          (lat, lon) = object.latlon
          state.panel.re_center(state.width/2, state.height/2, lat, lon)
docs: follow an object on the map