IList<geopoint> geoPointsList = new List<geopoint>();
GeoPoint gp = new GeoPoint();
gp.SetMarker("Maplewood, NJ");
gp.SetLat(-74.2713);
gp.SetLng(40.73137);
geoPointsList.Add(gp);
App42Callback requestCallback = this; /* This function used the App42Callback interface */
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
GeoService geoService = api.BuildGeoService();
geoService.CreateGeoPoints(geoStorageName,geoPointsList,requestCallback);
OnSuccess(Object obj)
{
Geo geo = (Geo) obj;
String jsonResponse = geo.ToString();
}
public class CallBack : App42Callback
{
public override void OnSuccess(Object obj)
{
Geo geo = (Geo) obj;
//Do whatever you want with the object
}
public override void OnException(App42Exception e)
{
//Do whatever you want with the exception
}
}
String geoStorageName = "geoTest";
Vector geoList = new Vector();
GeoPoint gp = new GeoPoint();
gp.setMarker("Maplewood, NJ");
gp.setLat(new Double(-74.2713));
gp.setLng(new Double(40.73137));
geoList.addElement(gp);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
GeoService geoService = api.buildGeoService();
Geo geo = geoService.createGeoPoints(geoStorageName,geoList);
String jsonResponse = geo.toString();
String geoStorageName = "geoTest";
ArrayList<GeoPoint> geoList = new ArrayList<GeoPoint>();
GeoPoint gp11 = new GeoPoint();
gp11.setMarker("Maplewood, NJ");
gp11.setLat(new BigDecimal(-74.2713));
gp11.setLng(new BigDecimal(40.73137));
geoList.add(gp11);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
GeoService geoService = api.buildGeoService();
Geo geo = geoService.createGeoPoints(geoStorageName,geoList);
String jsonResponse = geo.toString();
NSString *geoStorageName = @"geoTest";
NSMutableArray *geoList = [[NSMutableArray alloc]init];
GeoPoint *gp = [[GeoPoint alloc]init];
gp.marker = @"Maplewood,NJ";
gp.latitude = -74.2713;
gp.longitude = 40.73137;
[geoList addObject:gp];
ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init];
serviceAPIObj.apiKey = @"<API_KEY>";
serviceAPIObj.secretKey = @"<SECRET_KEY>";
GeoService *geoService = [serviceAPIObj buildGeoService];
Geo *geo = [geoService createGeoPoints:geoStorageName geoPointsList:geoPointsList];
NSString *jsonResponse = [geo toString];
String geoStorageName = "geoTest";
ArrayList<GeoPoint> geoList = new ArrayList<GeoPoint>();
GeoPoint gp = new GeoPoint();
gp.setMarker("Maplewood, NJ");
gp.setLat(new BigDecimal(-74.2713));
gp.setLng(new BigDecimal(40.73137));
geoList.add(gp);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
GeoService geoService = api.buildGeoService();
Geo geo = geoService.createGeoPoints(geoStorageName,geoList);
String jsonResponse = geo.toString();
String geoStorageName = "geoTest";
IList<GeoPoint> geoList = new List<GeoPoint>();
GeoPoint gp = new GeoPoint();
gp.SetMarker("Maplewood, NJ");
gp.SetLat(-74.2713);
gp.SetLng(40.73137);
geoList.Add(gp);
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
GeoService geoService = api.BuildGeoService();
Geo geo = geoService.CreateGeoPoints(geoStorageName,geoList);
String jsonResponse = geo.ToString();
geoStorageName = "geoTest";
geoPointsList = Array.new();
gp = App42::Geo::GeoPoint.new();
gp.lat = "-74.2713";
gp.lng = "40.73137";
gp.marker = "Maplewood, NJ";
geoPointsList.push(gp);
api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>");
geoService = api.buildGeoService();
geo = geoService.create_geo_points(geoStorageName,geoPointsList);
jsonResponse = geo.to_s();
The request format for createGeoPoints is
URL : https://api.shephertz.com/cloud/1.0/geo/createGeoPoints
Method : POST
QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP>
Accept : application/json
Content-Type : application/json
Body : {"app42": {"geo": {"storage": {"storageName": "geoTest","points": {"point": [{"lat": -73.99171,"lng": 40.73887,"marker": "10gen Office"},{"lat": -73.99781,"lng": 40.73913,"marker": "Players Club"}]}}}}}
var geo = new App42Geo();
var geoStorageName = "geoStorageName";
var pointList = new Array();
var point1={
lat:-73.99171,
lng:40.738868,
marker: "test1"
};
var point2={
lat:-72.99171,
lng:41.738868,
marker:"test2"
};
pointList.push(point1)
pointList.push(point2)
// In order to use the various functions available under a particular API, a developer will have to call the
// App42.initialize method by passing the apiKey and the secretKey.
App42.initialize("<API_KEY>","<SECRET_KEY>");
geo.createGeoPoints(geoStorageName,pointList,{
success: function(object) {
// Geo Object creation
},
error: function(error) {
// Geo exception handled
}
});
$geoStorageName = "geoTest";
$geoList = array();
$gp = new GeoPoint();
gp.setMarker("Maplewood, NJ");
gp.setLat((-74.2713);
gp.setLng(40.73137);
geoList.add(gp);
$api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");
$geoService = $api->buildGeoService();
$geo = $geoService->createGeoPoints($geoStorageName,$geoList);
$jsonResponse = $geo->toString();