Added configurable option for controlling how long a tile will live in the browser's cache before being refetched. Good for configurations where the map will be automatically updated ona regular basis and the web browser's cache would get out of sync. Default is 24 hours.
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
fileExt: 'png',
|
||||
tileSize: 384,
|
||||
defaultZoom: 1,
|
||||
maxZoom: {maxzoom}
|
||||
maxZoom: {maxzoom},
|
||||
cacheMinutes: {cachelife}
|
||||
};
|
||||
|
||||
var MCMapOptions = {
|
||||
@@ -34,6 +35,8 @@
|
||||
}
|
||||
}
|
||||
url = url + '.' + config.fileExt;
|
||||
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),
|
||||
|
||||
Reference in New Issue
Block a user