From 002332594ce25164805462678e379e59336ee243 Mon Sep 17 00:00:00 2001 From: steven Date: Tue, 5 Mar 2019 10:14:28 -0700 Subject: [PATCH] Add hostname to labels --- render.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/render.go b/render.go index fe5aa52..9e38669 100644 --- a/render.go +++ b/render.go @@ -9,6 +9,7 @@ import ( "math" "math/cmplx" "net/http" + "os" "runtime" "strconv" "strings" @@ -174,7 +175,13 @@ func renderTile(w http.ResponseWriter, r *http.Request) { wg.Wait() if r.FormValue("label") == "1" { - addLabel(img, 10, 10, fmt.Sprintf("%d/%d/%d", tileZoom, tileX, tileY)) + addLabel(img, 1, 10, fmt.Sprintf("%d/%d/%d", tileZoom, tileX, tileY)) + + hostname, err := os.Hostname() + if err != nil { + hostname = fmt.Sprintf("failed to get hostname: %v", err) + } + addLabel(img, 1, 22, hostname) } w.Header().Set("Content-Type", "image/png") png.Encode(w, img)