1

Fixing distance calc

This commit is contained in:
Alex Yatskov 2015-06-29 13:31:04 +09:00
parent 890659a771
commit 32329bcce4
3 changed files with 4 additions and 3 deletions

View File

@ -454,7 +454,8 @@
} }
function modeClick(event, x, y) { function modeClick(event, x, y) {
alert('mode clicked'); var mode = _data.mode === 'prod' ? 'dist' : 'prod';
updateState(_data.value, mode);
} }
this.update = function(data, scale) { this.update = function(data, scale) {

View File

@ -50,7 +50,7 @@ type jsonQueryRequest struct {
Geo *jsonGeoData `json:"geo"` Geo *jsonGeoData `json:"geo"`
MaxResults int `json:"maxResults"` MaxResults int `json:"maxResults"`
MinScore float64 `json:"minScore"` MinScore float64 `json:"minScore"`
Modes map[string]string `json:"modeMap"` Modes map[string]string `json:"modes"`
Profile featureMap `json:"profile"` Profile featureMap `json:"profile"`
Resolution int `json:"resolution"` Resolution int `json:"resolution"`
SortAsc bool `json:"sortAsc"` SortAsc bool `json:"sortAsc"`

View File

@ -82,7 +82,7 @@ func compare(features1 featureMap, features2 featureMap, modes modeMap) float64
switch mode, _ := modes[key]; mode { switch mode, _ := modes[key]; mode {
case ModeTypeDist: case ModeTypeDist:
result += 1 - math.Abs(value1-value2)/2 result += 1 - math.Abs(value1-value2)
default: default:
result += value1 * value2 result += value1 * value2
} }