def getLink(tiles, childIdx): zoom, x, y = childIdx ctx = { 'name': '{}/{}/{}'.format(zoom, x, y), 'kmlUrl': '../../{}/{}/{}.kml'.format(zoom, x, y), } ctx.update(tileBoundsLonLat(*childIdx)) return LINK_TEMPLATE.format(**ctx)
def getTileKml(tiles, idx): imgPath = tiles[idx] zoom, x, y = idx ctx = { 'name': '{}/{}/{}'.format(zoom, x, y), 'links': getChildLinks(tiles, idx), 'drawOrder': zoom, 'imageUrl': os.path.basename(imgPath), } ctx.update(tileBoundsLonLat(*idx)) return TILE_TEMPLATE.format(**ctx)