public GeoCoOrdVo getGPSCoordinatesForPostCode(String postCode) { GeoCoOrdVo geoCoOrdvo = new GeoCoOrdVo(); AddressManagmentProvider amf = new AddressManagmentProvider(); ims.core.vo.PersonAddress lpa = new ims.core.vo.PersonAddress(); lpa.setPostCode(postCode); double[] coOrds; try { coOrds = amf.getLatitudeLogitude(lpa); } catch (DomainRuntimeException e) { return null; } if (coOrds != null && coOrds.length == 2) { geoCoOrdvo.setLatitude((float)coOrds[0]); geoCoOrdvo.setLogitude((float)coOrds[1]); return geoCoOrdvo; } return null; }
protected void onBtnShowGeoCoOrdsClick() throws PresentationLogicException { try { if (form.txtPost().getValue() != null && form.txtPost().getValue() != "") { GeoCoOrdVo vo = domain.getGeoCoOrds(form.txtPost().getValue()); if (vo != null) { if (vo.getLatitudeIsNotNull() && vo.getLogitudeIsNotNull()) { String format = String.format("Lattitude: %f Longitude: %f",vo.getLatitude(),vo.getLogitude()); engine.showMessage(format); } } } } catch (DomainInterfaceException e) { throw new PresentationLogicException(e.getMessage()); } /* double[] coOrds; ims.core.vo.PersonAddress lpa = new ims.core.vo.PersonAddress(); if (form.txtPost().getValue() != null) { if (form.getGlobalContext().Core.getPersonAddressIsNotNull()) coOrds = engine.getAddressProvider().getLatitudeLogitude(form.getGlobalContext().Core.getPersonAddress()); else { lpa.setAddressPostCode(form.txtPost().getValue()); coOrds = engine.getAddressProvider().getLatitudeLogitude(lpa); } if (coOrds != null) { if (coOrds.length == 2) { String format = String.format("Lattitude: %f Longitude: %f",coOrds[0],coOrds[1]); engine.showMessage(format); } } } */ }
public GeoCoOrdVo getGPSCoordinatesForPostCode(String postCode) { AddressManagmentProvider amf = new AddressManagmentProvider(); return amf.getGPSCoordinatesForPostCode(postCode); }
public GeoCoOrdVo getGeoCoOrds(String poscode) throws DomainInterfaceException { AddressManagmentProvider amf = new AddressManagmentProvider(); return amf.getGPSCoordinatesForPostCode(poscode); }