from tilefetcher_download import TileFetcher_Download class TileFetcher_GoogleMaps(TileFetcher_Download): googleservers = ["mt0.google.com", "mt1.google.com", "mt2.google.com", "mt3.google.com"] def _init(self, queuesize = 32): TileFetcher_Download._init(self, self.googleservers, queuesize) def has_tile(self, coords): if coords.x < 0 or coords.y < 0: return False if coords.zoom < 0 or coords.zoom > 17: return False divs = 2 ** coords.zoom if coords.x >= divs or coords.y >= divs: return False return True def get_path(self, coords): return "/mt?x=%d&y=%d&zoom=%d" % (coords.x, coords.y, 17 - coords.zoom) if __name__ == "__main__": import time from tilemanager import TileCoord, TileManager tm = TileManager() tm.fetchers.append(TileFetcher_GoogleMaps(tm)) image = None while not image: image = tm.get_tile(TileCoord(0,0,1)) print image time.sleep(0.1)