diff --git a/static/index.html b/static/index.html
index 7c90389..4b4d177 100644
--- a/static/index.html
+++ b/static/index.html
@@ -128,7 +128,7 @@
{{#each records}}
- {{name}} |
+ {{name}} |
{{#prettyFloat 2}}{{distanceToUser}}{{/prettyFloat}} km |
{{closestStn}} |
{{#prettyFloat 2}}{{distanceToStn}}{{/prettyFloat}} km |
diff --git a/static/scripts/search.js b/static/scripts/search.js
index 4cabb22..0a1dd4c 100644
--- a/static/scripts/search.js
+++ b/static/scripts/search.js
@@ -47,10 +47,6 @@
return parseFloat(options.fn(this)).toFixed(precision);
});
- Handlebars.registerHelper('urlEncode', function(options) {
- return encodeURIComponent(options.fn(this));
- });
-
$('#minScore,#resolution,#walkingDist,#maxResults').change(onSearch);
$('#profileDlg').on('hidden.bs.modal', onSearch);
$('#resetStorage').click(function() {
diff --git a/types.go b/types.go
index 12ef761..141360c 100644
--- a/types.go
+++ b/types.go
@@ -63,8 +63,8 @@ type record struct {
Name string `json:"name"`
Score float64 `json:"score"`
Address string `json:"address"`
+ Geo geoData `json:"geo"`
features map[string]float64
- geo geoData
}
type queryContext struct {
diff --git a/util.go b/util.go
index fb59c38..52f3d74 100644
--- a/util.go
+++ b/util.go
@@ -169,7 +169,7 @@ func computeRecordGeo(entries []record, context queryContext) {
if context.geo != nil {
userPoint := geo.NewPoint(context.geo.Latitude, context.geo.Longitude)
- entryPoint := geo.NewPoint(entry.geo.Latitude, context.geo.Longitude)
+ entryPoint := geo.NewPoint(entry.Geo.Latitude, context.geo.Longitude)
entry.DistanceToUser = userPoint.GreatCircleDistance(entryPoint)
}
@@ -283,7 +283,8 @@ func fetchRecords(db *sql.DB, context queryContext) ([]record, error) {
&distanceToStn,
&closestStn,
&accessCount,
- &id)
+ &id,
+ )
entry := record{
Name: name,
@@ -291,14 +292,16 @@ func fetchRecords(db *sql.DB, context queryContext) ([]record, error) {
DistanceToStn: distanceToStn,
ClosestStn: closestStn,
AccessCount: accessCount,
- geo: geoData{latitude, longitude},
- Id: id}
+ Geo: geoData{latitude, longitude},
+ Id: id,
+ }
entry.features = map[string]float64{
"delicious": delicious,
"accommodating": accommodating,
"affordable": affordable,
- "atmospheric": atmospheric}
+ "atmospheric": atmospheric,
+ }
entries = append(entries, entry)
}