use of com.genexus.GXSimpleCollection 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.GXSimpleCollection in project JavaClasses by genexuslabs.
the class GXMaps method reverseGeocode.
public static GXSimpleCollection<String> reverseGeocode(GXGeospatial coordinate) {
GXSimpleCollection<String> addresses = new GXSimpleCollection<String>();
String location = coordinate.getLatitude().toString() + "," + coordinate.getLongitude().toString();
java.util.Vector listaddr = GXGeolocation.getAddress(location);
for (Object var : listaddr) {
addresses.add((String) var);
}
return addresses;
}
use of com.genexus.GXSimpleCollection in project JavaClasses by genexuslabs.
the class EnterpriseConnect method getValue.
/* --- Get Return Values --- */
public void getValue(String parameterName, GXSimpleCollection[] value) {
if (value.length != 0) {
GXSimpleCollection col = value[0];
col.clear();
JCoTable tbl = function.getTableParameterList().getTable(parameterName);
JSONArray jCol = new JSONArray();
try {
for (int i = 0; i < tbl.getNumRows(); i++) {
JSONObject jRow = new JSONObject();
tbl.setRow(i);
for (JCoField field : tbl) {
if (field.getType() == JCoMetaData.TYPE_INT || (field.getType() == JCoMetaData.TYPE_NUM && field.getDecimals() == 0)) {
jRow.put(field.getName(), field.getLong());
} else if (field.getType() == JCoMetaData.TYPE_INT2 || field.getType() == JCoMetaData.TYPE_INT1 || field.getType() == JCoMetaData.TYPE_BYTE) {
jRow.put(field.getName(), field.getInt());
} else if (field.getType() == JCoMetaData.TYPE_NUM || field.getType() == JCoMetaData.TYPE_FLOAT || field.getType() == JCoMetaData.TYPE_BCD) {
jRow.put(field.getName(), field.getDouble());
} else {
jRow.put(field.getName(), field.getString());
}
}
jCol.put(jRow);
}
col.FromJSONObject(jCol);
} catch (JSONException ex) {
throw new RuntimeException(ex.toString());
}
}
}
Aggregations