On the link below [1] I can see how to get the URL of the tile for specific latlon.
var zoom = 15;
var lat = 47;
var lon = 8;
function long2tile(lon,zoom) { return (Math.floor((lon+180)/360*Math.pow(2,zoom))); }
function lat2tile(lat,zoom) { return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom))); }
var x = long2tile(lon, zoom); // get x long2tile
var y = lat2tile(lat, zoom); // get y lat2tile
tileUrl = "tile.osm.org/" + zoom + "/" + x + "/" + y + ".png"
What I want to know is how to get all the tile URL's for the surrounding tiles. Usually there is a grid of say 3x3 tiles and I'm looking in the one in the middle, that would be my base latlon. How do I get URL's for all the other neighboring tiles?
