0

Initial commit to drop gmaps and to add support for leaflet

Many things do not work at the moment:
* Missing world selector
* Missing overlays (overlay tilesets and markers)
* Missing urlhash code
* Probably other stuff
This commit is contained in:
Andrew Chin
2016-06-28 10:42:29 -04:00
parent b81661dc94
commit e58d23b1a0
8 changed files with 604 additions and 823 deletions

View File

@@ -85,18 +85,19 @@ overviewer.gmap = {
* @param string pathExt
*/
'getTileUrlGenerator': function(path, pathBase, pathExt) {
return function(tile, zoom) {
return function(o) {
var url = path;
var zoom = o.z;
var urlBase = ( pathBase ? pathBase : '' );
if(tile.x < 0 || tile.x >= Math.pow(2, zoom) ||
tile.y < 0 || tile.y >= Math.pow(2, zoom)) {
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(tile.x / Math.pow(2, z)) % 2;
var y = Math.floor(tile.y / Math.pow(2, z)) % 2;
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);
}
}