use of com.genexus.GXGeospatial in project JavaClasses by genexuslabs.
the class GXMaps method geocodeAddress.
public static GXSimpleCollection<GXGeospatial> geocodeAddress(String address) {
GXSimpleCollection<GXGeospatial> loclist = new GXSimpleCollection<GXGeospatial>();
java.util.Vector listPoints = GXGeolocation.getLocation(address);
for (Object var : listPoints) {
GXGeospatial gPoint = new GXGeospatial((String) var);
loclist.add(gPoint);
}
return loclist;
}
use of com.genexus.GXGeospatial in project JavaClasses by genexuslabs.
the class GXMaps method calculateDirections.
public static GXXMLSerializable calculateDirections(GXGeospatial a, GXGeospatial b, String transportType, boolean requestAlternateRoutes) {
try {
Class<?> DirectionsParametersSDTClass = Class.forName(DIRECTIONS_PARAMETERS_SDT_CLASS_NAME);
Object directionsParametersSDT = DirectionsParametersSDTClass.getDeclaredConstructor().newInstance();
DirectionsParametersSDTClass.getMethod("setgxTv_SdtDirectionsRequestParameters_Sourcelocation", GXGeospatial.class).invoke(directionsParametersSDT, a);
DirectionsParametersSDTClass.getMethod("setgxTv_SdtDirectionsRequestParameters_Destinationlocation", GXGeospatial.class).invoke(directionsParametersSDT, b);
DirectionsParametersSDTClass.getMethod("setgxTv_SdtDirectionsRequestParameters_Transporttype", String.class).invoke(directionsParametersSDT, transportType);
DirectionsParametersSDTClass.getMethod("setgxTv_SdtDirectionsRequestParameters_Requestalternateroutes", Boolean.TYPE).invoke(directionsParametersSDT, requestAlternateRoutes);
return calculateDirections(directionsParametersSDT);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
use of com.genexus.GXGeospatial in project JavaClasses by genexuslabs.
the class LocationInfo method FromJSONObject.
public void FromJSONObject(IJsonFormattable obj) {
JSONObject jObj = (JSONObject) obj;
this.setDescription(jObj.optString("description"));
this.setHeading(jObj.optDouble("heading"));
this.setSpeed(jObj.optDouble("speed"));
this.setPrecision(jObj.optDouble("precision"));
// /this.setTime( );
this.setLocation(new GXGeospatial(jObj.optString("location")));
}
Aggregations