Package com.googlecode.mashups.services.generic.api

Examples of com.googlecode.mashups.services.generic.api.LocationService


import com.googlecode.mashups.services.generic.api.LocationService;
import com.googlecode.mashups.services.generic.api.PlaceMark;

public class LocationServiceTest extends TestCase {
    public void testGetAddressFromLocation() throws Exception {
        LocationService locationService = GenericServicesFactory.getLocationService();
       
        try {
            PlaceMark placeMark = locationService.getAddressFromLocation("37.4216410", "-122.08550160");
           
            System.out.println("Address for (\"37.4216410\", \"-122.08550160\") is: " + placeMark.getAddress() +
                           ", postalCode is: " + placeMark.getPostalCodeNumber());
           
        } catch (Exception e) {
View Full Code Here


            fail("Unable to get the address from the location ...");
        }       
    }
   
    public void testGetLocationFromAddress() throws Exception {
        LocationService locationService = GenericServicesFactory.getLocationService();
       
        try {
            Location location = locationService.getLocationFromAddress("Cairo, Egypt");
           
            System.out.println("LatLng for (\"Cairo, Egypt\") is: " + location.getLatitude() +", " + location.getLongitude());
        } catch (Exception e) {
            e.printStackTrace();
            fail("Unable to get the location from the address ...");
View Full Code Here

TOP

Related Classes of com.googlecode.mashups.services.generic.api.LocationService

Copyright © 2018 www.massapicom. 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.