AtlasCT.com
User Manual v5.0

LBS

Inheritance: EventListener > LBS

The LBS class is used to communicate with Atlas LBS API.

By using Atlas LBS API you can focus on your application's special features, and let us manage for you your users, groups, presence information, locations, media, messaging and points of interest.

Atlas LBS API includes about 100 APIs which gives you exactly the platform you need for a great location based social network application.

Atlas LBS is the optimal tool for developers who wish to create new application or add social networking abilities to existing applications. The API is accessible by simple http requests from any platform.

This class is not part of the basic SDK.
In order to use this class you must get an application id from AtlasCT.

Summary
Inheritance: EventListener > LBS
The LBS constructor.
Execute Users API's.
Execute Social API's.
Execute Messages API's.
Execute Locations API's.
Execute POIs API's.
Execute Alerts API's.
Execute ResponseStatus API's.
Execute MobileAngel API's.
Sets a new application id.
This event dispatches after the LBS has been initialized.
This event dispatches after a LBS response has arrived from the server.

Constructors

LBS

LBS()

The LBS constructor.

Methods

setAppId

setAppId( string appId)

Sets a new application id.

Parameters

appIdThe new application id.

LBS Events

LBS. EVENT_LBS_FLASH_INITIALIZE

This event dispatches after the LBS has been initialized.

Example

var myLBS = new LBS();
myLBS.addListener(LBS.EVENT_LBS_FLASH_INITIALIZE,onLBSInitialize,myLBS);
function onLBSInitialize(sender) {
Debug.clear();
Debug.write("initialize");
}

LBS. EVENT_LBS_RESULT

This event dispatches after a LBS response has arrived from the server.

Example

var myLBS = new LBS();
myLBS.addListener(LBS.EVENT_LBS_RESULT,onLBSResult,myLBS);
function onLBSResult(sender,moduleResponseType,typeNumber,cmd) {
Debug.clear();
Debug.write("sender:"+sender);
Debug.write("moduleResponseType:"+moduleResponseType);
Debug.write("typeNumber:"+typeNumber);
Debug.write("cmd:"+cmd);
if (myLBS.responseStatus.responseStatusCode!="100") {
if (myLBS.responseStatus.responseCausesList!=null) {
Debug.write('responseCausesList:');
for (i=0;i<=myLBS.responseStatus.responseCausesList.length-1;i++) {
Debug.write('name:'+myLBS.responseStatus
.responseCausesList[i].name);
Debug.write('value:'+myLBS.responseStatus
.responseCausesList[i].value);
}
Debug.write('------------');
}
}
else {
switch (moduleResponseType.toLowerCase()) {
case "users":
if ((myLBS.users.userList!=null) && (myLBS.users.user!=null)) {
for (i=0;i<=myLBS.users.userList.length-1;i++) {
Debug.write('username:'+myLBS.users.userList[i].name);
}
}
else {
Debug.write("No Users");
}
break;
case "alerts":
switch (typeNumber) {
case "0": // alerts
if ((myLBS.alerts.alertList!=null) &&
(myLBS.alerts.alert!=null)) {
for (i=0;i<=myLBS.alerts.alertList.length-1;i++) {
Debug.write('ruleId:'+myLBS.alerts.alertList[i].ruleId);
}
}
else {
Debug.write("No alerts");
}
break;
case "1": // rules
if ((myLBS.alerts.ruleList!=null) &&
(myLBS.alerts.rule!=null)) {
for (i=0;i<=myLBS.alerts.ruleList.length-1;i++) {
printRuleResponse('Is rule enabled? '+
myLBS.alerts.ruleList[i].enabled);
}
}
else {
Debug.write("No rules");
}
break;
}
break;
case "pois":
switch (typeNumber) {
case "0": // category
if ((myLBS.pois.categoryList!=null) &&
(myLBS.pois.category!=null)) {
for (i=0;i<=myLBS.pois.categoryList.length-1;i++) {
printCategoryResponse('Category name:'+
myLBS.pois.categoryList[i].name);
}
}
else {
Debug.write("No category");
}
break;
case "1": // poi
if ((myLBS.pois.poiList!=null) && (myLBS.pois.poi!=null)) {
for (i=0;i<=myLBS.pois.poiList.length-1;i++) {
printPoiResponse('Poi title:'+myLBS.pois.poiList[i].title);
}
}
else {
Debug.write("No poi");
}
break;
}
break;
case "social":
switch (typeNumber) {
case "0": // groups
if ((myLBS.social.groupList!=null) &&
(myLBS.social.group!=null)) {
for (i=0;i<=myLBS.social.groupList.length-1;i++) {
printGroupResponse('Group access type:'+
myLBS.social.groupList[i].accessType);
}
}
else {
Debug.write("No groups");
}
break;
}
break;
}
}
}
The EventListener class helps you to register event handlers defined by this API.
Some of the classes that inherit from this class are: Map, OverviewMap, LayersManager
Geocode()
The Geocode constructor.
find(Address address)
Convert an address to geographical location.
coordinateToAddress(Coordinate coordinate)
Convert a geographical location to an address.
An integer that contains the search result code.
An Address object that contains the geocode response address.
An array that contains a list of addresses that matching the requested address/coordinate.
This event dispatches after a geocode response has arrived from the server.
The Address class represent a specific address information, with its coordinates.
This is the base class of the provided coordinates classes.