+ String baseUrl = pickServerUrl(_baseUrls[inLayerNum]);
+ return makeUrl(baseUrl, inLayerNum, inZoom, inX, inY);
+ }
+
+ public String makeUrl(String baseUrl, int inLayerNum, int inZoom, int inX, int inY)
+ {
+ // If the base URL has {x}/{y} placeholders, use them
+ if (baseUrl.contains("{x}")) {
+ baseUrl = baseUrl.replace("{z}", Integer.toString(inZoom))
+ .replace("{x}", Integer.toString(inX))
+ .replace("{y}", Integer.toString(inY));
+ return baseUrl;
+ }
+
+ // Else simply append the tile indices and file extension
+ StringBuffer url = new StringBuffer(baseUrl);