Fix global leak and incorrect var
This commit is contained in:
parent
64da1d441a
commit
ce63ef9ac2
|
@ -323,7 +323,7 @@ DataAccessObject.find = function find(params, cb) {
|
||||||
if(near) {
|
if(near) {
|
||||||
if(supportsGeo) {
|
if(supportsGeo) {
|
||||||
// convert it
|
// convert it
|
||||||
this.schema.adapter.buildNearFilter(filter, near);
|
this.schema.adapter.buildNearFilter(params, near);
|
||||||
} else if(params.where) {
|
} else if(params.where) {
|
||||||
// do in memory query
|
// do in memory query
|
||||||
// using all documents
|
// using all documents
|
||||||
|
|
|
@ -185,9 +185,9 @@ function geoDistance(x1, y1, x2, y2, options) {
|
||||||
x2 = x2 * DEG2RAD;
|
x2 = x2 * DEG2RAD;
|
||||||
y2 = y2 * DEG2RAD;
|
y2 = y2 * DEG2RAD;
|
||||||
|
|
||||||
a = Math.pow(Math.sin(( y2-y1 ) / 2.0 ), 2);
|
var a = Math.pow(Math.sin(( y2-y1 ) / 2.0 ), 2);
|
||||||
b = Math.pow(Math.sin(( x2-x1 ) / 2.0 ), 2);
|
var b = Math.pow(Math.sin(( x2-x1 ) / 2.0 ), 2);
|
||||||
c = Math.sqrt( a + Math.cos( y2 ) * Math.cos( y1 ) * b );
|
var c = Math.sqrt( a + Math.cos( y2 ) * Math.cos( y1 ) * b );
|
||||||
|
|
||||||
var type = (options && options.type) || 'miles';
|
var type = (options && options.type) || 'miles';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue