diff --git a/gmap.py b/gmap.py index 7cf832e..5578f30 100755 --- a/gmap.py +++ b/gmap.py @@ -15,7 +15,7 @@ helptext = """ def main(): parser = OptionParser(usage=helptext) parser.add_option("-p", "--processes", dest="procs", help="How many chunks to render in parallel. A good number for this is 1 more than the number of cores in your computer. Default 2", default=2, action="store", type="int") - parser.add_option("-c", "--cachelife", dest="cachelife", help="How many minutes a tile will be considered valid by the web browser before it fetches a new copy. Used if you have a crontab or similar running this every once in a while. Default is 24 hours.", default=1440, action="store", type="int") + parser.add_option("-c", "--cachelife", dest="cachelife", help="How many minutes a tile will be considered valid by the web browser before it fetches a new copy. Used if you have a crontab or similar running this every once in a while. Default is 24 hours.", default=0, action="store", type="int") options, args = parser.parse_args() diff --git a/template.html b/template.html index 4d86b25..e5eee0d 100644 --- a/template.html +++ b/template.html @@ -35,8 +35,10 @@ } } url = url + '.' + config.fileExt; - var d = new Date(); - url += '?c=' + Math.floor(d.getTime() / (1000 * 60 * config.cacheMinutes)); + if(config.cacheMinutes > 0) { + var d = new Date(); + url += '?c=' + Math.floor(d.getTime() / (1000 * 60 * config.cacheMinutes)); + } return(url); }, tileSize: new google.maps.Size(config.tileSize, config.tileSize),