Exemplo n.º 1
0
 def on_selection_change(self, selected):
     if selected and self.action:
         logger.debug("Loading the map : %s" % self.name)
         self.action()
     else:
         logger.debug("Unselecting the map %s. Does nothing for instance." %
                      self.name)
Exemplo n.º 2
0
    def cleanup(self, tile_list, *largs):
        """
        Cleanup is achieved when the app is considered inactive, ie when self.idle = True.
        """
        if not self.idle:
            return
        zoom = self.zoom
        zoom_int = int(zoom if zoom == int(zoom) else int(zoom) + 1)

        print "debut cleanup, conserve zoom", zoom_int
        for _zoom in TileCache.get_unnecessary_zooms(self.tileCache.container.keys(), zoom_int):
            try:
                print "suppr zoom", _zoom
                self.map_layer.remove_group(str(_zoom))
                self.tileCache.remove_tiles_for_zoom(_zoom)
            except:
                logger.debug("the canvas doesn't contains the zoom %s" % _zoom)

        if self.tileCache.is_tile_overfull(zoom_int):
            self.map_cleanup_scheduled = True
Exemplo n.º 3
0
 def on_calibration(self):
     logger.debug("Calibrating the map : %s" % self.name)
     self.calibration_action()
Exemplo n.º 4
0
 def getCalibrationCoord(self, widget, *p):
     logger.debug("pos du clic (relatif) (%s, %s)" %
                  self.mapviewer.to_local(*p))
     logger.debug("pos du centre du reticule (relatif): (%s, %s)" %
                  self.mapviewer.to_local(*widget.center))
Exemplo n.º 5
0
 def out_of_scope(self):
     logger.debug("OUT OF SCOPE")
     return []