func BuildTileURL(template string, x, y, z uint64) string {
	r := strings.NewReplacer(
		"{x}", strconv.Itoa(int(x)),
		"{y}", strconv.Itoa(int(y)),
		"{z}", strconv.Itoa(int(z)),
		"{zoom}", strconv.Itoa(int(z)),
	)
	return r.Replace(template)
}
BuildTileURL will fill in a template URL of something like http://host.com/{z}/{x}/{y}.png
package utils
import (
	"fmt"
	"io"
	"net/http"
	"strconv"
	"strings"
)
func FetchURL(url string, retries int) (io.ReadCloser, error) {
	var err error
	var resp *http.Response
	for i := 0; i < retries; i++ {
		resp, err = http.Get(url)
		if err == nil && resp.StatusCode == http.StatusOK {
			return resp.Body, err
		}
	}
	if err != nil {
		return nil, err
	}
	return nil, fmt.Errorf("bad status code: %d", resp.StatusCode)
}