From cba0928a65bb32e5025303a38d7e4a3786ba9c76 Mon Sep 17 00:00:00 2001 From: Johann Richard Date: Sun, 28 Oct 2018 16:42:17 +0100 Subject: [PATCH] Patch for a Map (#62) Add map --- http/http.go | 14 +++++++++++--- index.html | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/http/http.go b/http/http.go index 8245ce2..843cdaf 100644 --- a/http/http.go +++ b/http/http.go @@ -222,12 +222,20 @@ func (s *Server) DefaultHandler(w http.ResponseWriter, r *http.Request) *appErro } var data = struct { Response - Host string - JSON string - Port bool + Host string + BoxLatTop float64 + BoxLatBottom float64 + BoxLonLeft float64 + BoxLonRight float64 + JSON string + Port bool }{ response, r.Host, + response.Latitude + 0.05, + response.Latitude - 0.05, + response.Longitude - 0.05, + response.Longitude + 0.05, string(json), s.LookupPort != nil, } diff --git a/index.html b/index.html index 385f5a4..39f5c2c 100644 --- a/index.html +++ b/index.html @@ -97,6 +97,12 @@ $ http {{ .Host }}/port/8080 } {{ end }} +{{ if .City }} +
+

Map

+ +
+{{ end }}

FAQ

How do I force IPv4 or IPv6 lookup?