Exemple #1
0
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))
Exemple #2
0
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))
Exemple #3
0
import jauntlib

j = jauntlib.getPlaces(37.426301, -122.141162, 1, 'restaurant')
print j