Giter Site home page Giter Site logo

sprockets's Introduction

Sprockets for Java Maven Central

Query the Google Places API and Google Street View Image API in Java.

Google Places API

Full support for Place Search, Details, Photos, Autocomplete, and Query Autocomplete requests, including all parameters and returned fields. Getting a list of places can be as simple as:

Places.textSearch(Params.create().query("pizza near willis tower")).getResult();

More detailed searches can include lat/long with radius, specific types of places, keywords, price range, places that are open now, etc. For each returned place, you can also retrieve its full details, reviews, and photos.

The Google Places API can return a lot of information about each place and most of the time you probably won't need every detail. For maximum performance and minimum memory usage, you can specify which fields you want and limit the number of results.

Places.nearbySearch(Params.create()
        .latitude(47.60567).longitude(-122.3315).radius(5000)
        .keyword("swimming").openNow(true).maxResults(5),
        FIELD_NAME | FIELD_VICINITY | FIELD_PHOTOS).getResult();

Places Javadoc

Google Street View Image API

Download a Google Street View Image by supplying lat/long or location name.

StreetView.image(Params.create().location("18 Rue Cujas, Paris, France")).getResult();

For fine control of the camera, you can also specify the heading, pitch, and field of view.

StreetView.image(Params.create().latitude(40.748769).longitude(-73.985332)
        .heading(210).pitch(33).fov(110)).getResult();

StreetView Javadoc

Install

1. Add the dependency.

<dependency>
	<groupId>net.sf.sprockets</groupId>
	<artifactId>sprockets</artifactId>
	<version>3.0.0</version>
</dependency>

2. Add your Google API key to sprockets.xml and place it in the root of your application classpath (e.g. src/main/resources/ in a Maven project). See the Sprockets class description for more information about configuring the library settings.

sprockets's People

Contributors

pushbit avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.