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

Examples of 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) {
            e.printStackTrace();
            fail("Unable to get the address from the location ...");
        }       
View Full Code Here


                                     + latitude.trim()
                                     + ","
                                     + longitude.trim()
                                     + "&sensor=false");
           
            PlaceMark      placeMark = new PlaceMark();
            JSONObject     json      = new JSONObject(readURL(url));
            JSONArray      results   = (JSONArray) json.getJSONArray(Mashups4JSFConstants.RESULTS_LABEL);
           
            JSONObject placeMarkPrimaryData = (JSONObject) results.get(0);
           
View Full Code Here

    public void processValueChangeForMarker(ValueChangeEvent valueChangeEvent) {
      Position value = (Position) valueChangeEvent.getNewValue();
       
        if (value != null) {
            try {
                PlaceMark placeMark = GenericServicesFactory.getLocationService().getAddressFromLocation (value.getLatitude(), value.getLongitude());
               
                address    = placeMark.getAddress();
                postalCode = placeMark.getPostalCodeNumber();
                location   = value.getLatitude() + ", " + value.getLongitude();
               
                System.out.println("LatLng: " + value.getLatitude() + ", " + value.getLongitude());
                System.out.println("address: " + address);
                System.out.println("postalCode: " + postalCode);
View Full Code Here

TOP

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

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.