Created
November 30, 2012 15:34
-
-
Save cbetta/4176464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def namedObjectsNear(lat: Double, long: Double): Seq[Venue] = { | |
def call(lat: Double, long: Double, distances: List[Int]): Seq[Venue] = { | |
var res = List[Venue]() | |
var remainingDistances = distances | |
while (distance.tail.size != 0 && res.size <= 20) | |
res = API.getResults(lat, long, distance) | |
remainingDistances = remainingDistances.tail | |
res | |
} | |
val distances = List(100, 300, 1000, 3000) | |
call(lat, long, distances) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment