def places(args): # demo uses static map of Silicon Valley mapWidth = float(499) mapHeight = float(416) top = 37.681984 left = -122.476479 bottom = 37.186651 right = -121.683392 # convert arguments x = float(args.get("x")) lon = ((right - left) * (x / mapWidth)) + left y = float(args.get("y")) lat = top - ((top - bottom) * (y / mapHeight)) tilesize = int(args.get("range")) amenity = str(args.get("amenity")) pp = pprint.PrettyPrinter() return pp.pformat(jauntlib.getPlaces(lat, lon, tilesize, amenity))
def places(args): # demo uses static map of Silicon Valley mapWidth = float(499) mapHeight = float(416) top = 37.681984 left = -122.476479 bottom = 37.186651 right = -121.683392 # convert arguments x = float(args.get("x")) lon = ((right-left) * (x / mapWidth)) + left y = float(args.get("y")) lat = top - ((top-bottom) * (y / mapHeight)) tilesize = int(args.get("range")) amenity = str(args.get("amenity")) pp = pprint.PrettyPrinter() return pp.pformat(jauntlib.getPlaces(lat, lon, tilesize, amenity))
import jauntlib j = jauntlib.getPlaces(37.426301, -122.141162, 1, 'restaurant') print j