addr.setLatitude(result.getJSONObject("geometry").getJSONObject("location").getDouble("lat")); addr.setLongitude(result.getJSONObject("geometry").getJSONObject("location").getDouble("lng")); retList.add(addr);
private Address makeAddress() { Address address = new Address(Locale.getDefault()); address.setLatitude(simulatedLatitude); address.setLongitude(simulatedLongitude); ReflectionHelpers.setField(address, "mHasLatitude", hasLatitude); ReflectionHelpers.setField(address, "mHasLongitude", hasLongitude); return address; }
@Implementation public List<Address> getFromLocationName(String locationName, int maxResults) throws IOException { didResolution = true; this.lastLocationName = locationName; if (shouldSimulateGeocodeException) { throw new IOException("Simulated geocode exception"); } if (returnNoResults) { return new ArrayList<Address>(); } else { Address address = makeAddress(); address.setLatitude(simulatedLatitude); address.setLongitude(simulatedLongitude); return oneElementList(address); } }
gAddress.setLatitude(jPoint.get("lat").getAsDouble()); gAddress.setLongitude(jPoint.get("lng").getAsDouble());
address.setLatitude(result.getDouble(WIRE_LATITUDE)); address.setLongitude(result.getDouble(WIRE_LONGITUDE));
return null; gAddress.setLatitude(jResult.get("lat").getAsDouble()); gAddress.setLongitude(jResult.get("lon").getAsDouble()); JsonObject jAddress = jResult.get("address").getAsJsonObject();
public CustomAddress(Address address) { super(address.getLocale()); for (int i = 0; i <= address.getMaxAddressLineIndex(); i++){ super.setAddressLine(i, address.getAddressLine(i)); } super.setFeatureName(address.getFeatureName()); super.setAdminArea(address.getAdminArea()); super.setSubAdminArea(address.getSubAdminArea()); super.setLocality(address.getLocality()); super.setSubLocality(address.getSubLocality()); super.setThoroughfare(address.getThoroughfare()); super.setSubThoroughfare(address.getSubThoroughfare()); super.setPostalCode(address.getPostalCode()); super.setCountryCode(address.getCountryCode()); super.setCountryName(address.getCountryName()); super.setLatitude(address.getLatitude()); super.setLongitude(address.getLongitude()); super.setPhone(address.getPhone()); super.setUrl(address.getUrl()); super.setExtras(address.getExtras()); }