1
This commit is contained in:
Alex Yatskov 2015-09-23 11:11:34 +09:00
parent 480408b9cd
commit 1cad44584e
3 changed files with 10 additions and 10 deletions

View File

@ -19,7 +19,7 @@
<!-- busy spinner -->
<div class="page-header">
<img id="spinner" alt="loading" class="pull-right" src="images/spinner.gif" style="display: none;" width="32" height="32">
<h1>Restaurant Search with Predictive Multispace Queries</h1>
<h1>Restaurant Search</h1>
</div>
<!-- profile dialog -->
@ -137,10 +137,6 @@
<a href="javascript:sortReviewsBy('score');">Score</a>
<span class="sort-icon glyphicon text-muted" data-sort="score"></span>
</th>
<th>
<a href="javascript:sortReviewsBy('accessCount');">Access count</a>
<span class="sort-icon glyphicon text-muted" data-sort="accessCount"></span>
</th>
</tr>
</thead>
{{#each records}}
@ -151,7 +147,6 @@
<td>{{#prettyFloat 2}}{{distanceToStn}}{{/prettyFloat}} km</td>
<td>{{#prettyFloat 4}}{{compatibility}}{{/prettyFloat}}</td>
<td>{{#prettyFloat 4}}{{score}}{{/prettyFloat}}</td>
<td>{{accessCount}}</td>
</tr>
{{/each}}
</table>

View File

@ -59,7 +59,7 @@
});
$('.nav-tabs a[href="#mapTab"]').one('shown.bs.tab', function(e) {
var options = {
center: { lat: 35.6833, lng: 139.7667 }, zoom: 8
center: { lat: 35.6833, lng: 139.7667 }, zoom: 10
};
if (geo !== null) {

11
util.go
View File

@ -182,10 +182,15 @@ func computeRecordGeo(entries []record, context queryContext) {
for index := range entries {
entry := &entries[index]
var accessible, nearby float64
if distUserRange > 0 {
nearby = -((entry.DistanceToUser-distUserMin)/distUserRange - 0.5) * 2.0
var nearby float64
if distUserRange > 0.0 {
nearby = 1.0 - ((entry.DistanceToUser-distUserMin)/distUserRange)*2
}
var accessible float64
if context.walkingDist <= 0 {
accessible = -1.0
} else {
accessible = 1.0 - entry.DistanceToStn/context.walkingDist
accessible = math.Max(accessible, -1.0)
accessible = math.Min(accessible, 1.0)