Examples of ElevationResponse


Examples of slash.navigation.googlemaps.elevation.ElevationResponse

    private static Unmarshaller newUnmarshallerGeocode() {
        return JAXBHelper.newUnmarshaller(newContext(slash.navigation.googlemaps.geocode.ObjectFactory.class));
    }

    private static ElevationResponse unmarshalElevation(StringReader reader) throws JAXBException {
        ElevationResponse result = null;
        try {
            result = (ElevationResponse) newUnmarshallerElevation().unmarshal(reader);
        } catch (ClassCastException e) {
            throw new JAXBException("Parse error: " + e, e);
        } finally {
View Full Code Here

Examples of slash.navigation.googlemaps.elevation.ElevationResponse

        String url = getElevationUrl("locations=" + latitude + "," + longitude); // TODO could be up to 512 locations
        Get get = get(url);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                ElevationResponse elevationResponse = unmarshalElevation(result);
                if (elevationResponse != null) {
                    String status = elevationResponse.getStatus();
                    if (status.equals(OK)) {
                        List<Double> elevations = extractElevations(elevationResponse.getResult());
                        return elevations != null && elevations.size() > 0 ? elevations.get(0) : null;
                    }
                    if (status.equals(OVER_QUERY_LIMIT))
                        throw new ServiceUnavailableException("maps.googleapis.com", url);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.