diff --git a/overviewer_core/data/js_src/overviewer.js b/overviewer_core/data/js_src/overviewer.js index 752a0c9..4a76879 100644 --- a/overviewer_core/data/js_src/overviewer.js +++ b/overviewer_core/data/js_src/overviewer.js @@ -86,40 +86,3 @@ overviewer.classes = { } }; - - -overviewer.gmap = { - - /** - * Generate a function to get the path to a tile at a particular location - * and zoom level. - * - * @param string path - * @param string pathBase - * @param string pathExt - */ - 'getTileUrlGenerator': function(path, pathBase, pathExt) { - return function(o) { - var url = path; - var zoom = o.z; - var urlBase = ( pathBase ? pathBase : '' ); - if(o.x < 0 || o.x >= Math.pow(2, zoom) || - o.y < 0 || o.y >= Math.pow(2, zoom)) { - url += '/blank'; - } else if(zoom === 0) { - url += '/base'; - } else { - for(var z = zoom - 1; z >= 0; --z) { - var x = Math.floor(o.x / Math.pow(2, z)) % 2; - var y = Math.floor(o.y / Math.pow(2, z)) % 2; - url += '/' + (x + 2 * y); - } - } - url = url + '.' + pathExt; - if(typeof overviewerConfig.map.cacheTag !== 'undefined') { - url += '?c=' + overviewerConfig.map.cacheTag; - } - return(urlBase + url); - }; - } -}; diff --git a/overviewer_core/data/js_src/util.js b/overviewer_core/data/js_src/util.js index 2d10a6f..4029c89 100644 --- a/overviewer_core/data/js_src/util.js +++ b/overviewer_core/data/js_src/util.js @@ -161,7 +161,7 @@ overviewer.util = { minZoom: obj.minZoom, errorTileUrl: obj.base + obj.path + "/blank.png", }); - myLayer.getTileUrl = overviewer.gmap.getTileUrlGenerator(obj.path, obj.base, obj.imgextension); + myLayer.getTileUrl = overviewer.util.getTileUrlGenerator(obj.path, obj.base, obj.imgextension); if (obj.isOverlay) { overviewer.collections.overlays[obj.world][obj.name] = myLayer; @@ -600,5 +600,37 @@ overviewer.util = { overviewer.map.setZoom(zoom); var locationmarker = new overviewer.views.LocationIconView(); locationmarker.render(); + }, + /** + * Generate a function to get the path to a tile at a particular location + * and zoom level. + * + * @param string path + * @param string pathBase + * @param string pathExt + */ + 'getTileUrlGenerator': function(path, pathBase, pathExt) { + return function(o) { + var url = path; + var zoom = o.z; + var urlBase = ( pathBase ? pathBase : '' ); + if(o.x < 0 || o.x >= Math.pow(2, zoom) || + o.y < 0 || o.y >= Math.pow(2, zoom)) { + url += '/blank'; + } else if(zoom === 0) { + url += '/base'; + } else { + for(var z = zoom - 1; z >= 0; --z) { + var x = Math.floor(o.x / Math.pow(2, z)) % 2; + var y = Math.floor(o.y / Math.pow(2, z)) % 2; + url += '/' + (x + 2 * y); + } + } + url = url + '.' + pathExt; + if(typeof overviewerConfig.map.cacheTag !== 'undefined') { + url += '?c=' + overviewerConfig.map.cacheTag; + } + return(urlBase + url); + }; } };