<commit_before>package ui

import(
	"html/template"
	"fmt"
	"net/http"

	"golang.org/x/net/context"

	"github.com/skypies/geo"
	"github.com/skypies/geo/sfo"
	hw "github.com/skypies/util/handlerware"
	"github.com/skypies/util/widget"
)

// {{{ getGoogleMapsParams

//  &whiteveil=1         (bleach out the map, to make vecctor lines more prominent
//  &map_zoom=10
//  &map_center_lat=37&map_center_long=-122 (alternate center point)
//     &map_center_name=ZORSA           (or use known entities (KSFO, waypoints))
//  &maptype=terrain  (roadmap, satellite, hybrid)
//  &noclassb=1                     (hide the class B overlay)

func getGoogleMapsParams(r *http.Request, params map[string]interface{}) {
	classBOverlay := ! widget.FormValueCheckbox(r, "noclassb")
	whiteVeil := widget.FormValueCheckbox(r, "whiteveil")

	zoom := widget.FormValueInt64(r, "map_zoom")
	if zoom == 0 { zoom = 10 }	


	center := sfo.KFixes["EDDYY"]
	if nll := sfo.FormValueNamedLatlong(r, "map_center"); !nll.Latlong.IsNil() {
		center = nll.Latlong
	}

	mapType := r.FormValue("maptype")
	if mapType == "" { mapType = "Silver" }
	
	params["ClassBOverlay"] = classBOverlay
	params["WhiteOverlay"] = whiteVeil
	params["Center"] = center
	params["Zoom"] = zoom
	params["MapType"] = mapType
	params["MapsAPIKey"] = "<KEY>" // prod key
	params["MapsAPIKey"] = "<KEY>" // dev key
	//params["MapsAPIKey"] = ""//kGoogleMapsAPIKey,
}

// }}}
// {{{ WaypointMapVar

func WaypointMapVar(in map[string]geo.Latlong) template.JS {
	str := "{\n"
	for name,pos := range in {
		if len(name)>2 && name[0] == 'X' && name[1] == '_' { continue }<commit_msg>Sigh, pushed the wrong key before. It's now been deleted.<commit_after>package ui

import(
	"html/template"
	"fmt"
	"net/http"

	"golang.org/x/net/context"

	"github.com/skypies/geo"
	"github.com/skypies/geo/sfo"
	hw "github.com/skypies/util/handlerware"
	"github.com/skypies/util/widget"
)

// {{{ getGoogleMapsParams

//  &whiteveil=1         (bleach out the map, to make vecctor lines more prominent
//  &map_zoom=10
//  &map_center_lat=37&map_center_long=-122 (alternate center point)
//     &map_center_name=ZORSA           (or use known entities (KSFO, waypoints))
//  &maptype=terrain  (roadmap, satellite, hybrid)
//  &noclassb=1                     (hide the class B overlay)

func getGoogleMapsParams(r *http.Request, params map[string]interface{}) {
	classBOverlay := ! widget.FormValueCheckbox(r, "noclassb")
	whiteVeil := widget.FormValueCheckbox(r, "whiteveil")

	zoom := widget.FormValueInt64(r, "map_zoom")
	if zoom == 0 { zoom = 10 }	


	center := sfo.KFixes["EDDYY"]
	if nll := sfo.FormValueNamedLatlong(r, "map_center"); !nll.Latlong.IsNil() {
		center = nll.Latlong
	}

	mapType := r.FormValue("maptype")
	if mapType == "" { mapType = "Silver" }
	
	params["ClassBOverlay"] = classBOverlay
	params["WhiteOverlay"] = whiteVeil
	params["Center"] = center
	params["Zoom"] = zoom
	params["MapType"] = mapType
	params["MapsAPIKey"] = "<KEY>" // prod key
}

// }}}
// {{{ WaypointMapVar

func WaypointMapVar(in map[string]geo.Latlong) template.JS {
	str := "{\n"
	for name,pos := range in {
		if len(name)>2 && name[0] == 'X' && name[1] == '_' { continue }
{'fraction_non_alphanumeric': 0.16854990583804144, 'fraction_numerical': 0.010671688637790333, 'mean_word_length': 3.9258114374034, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1134432', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1203, 'n_words': 237}