+ def recenter ( self , latlon ) :
+
+ center = self.gps2pix( latlon , self.center() )
+ pixel = self.gps2pix( (self.conf.lat,self.conf.lon) , self.center() )
+
+ distance = math.sqrt( (pixel[0]-center[0])**2 + (pixel[1]-center[1])**2 )
+
+ # FIXME : instead of hardcoded, should depend on the actual display size
+ if distance > 150 :
+ self.conf.lat , self.conf.lon = latlon
+
+ self.reftile_x , self.refpix_x = self.lon2tilex( self.conf.lon , self.conf.zoom )
+ self.reftile_y , self.refpix_y = self.lat2tiley( self.conf.lat , self.conf.zoom )
+
+ self.composeMap()
+