作为第一步,您需要创建目标位置的数字地图。在Navigine网站注册你的账户并创建一个新位置。使用室内地图创建添加子位置和上传平面图。
为了开始实施,你需要得到大约10蓝牙信标每1000平方米你的位置。这些信标必须均匀地部署,并通过室内地图绘制器连接到平面图上的位置。
一旦设备部署完毕,地图上传完毕,即可开始开发自己的室内导航app。可以使用iOS/Android平台的Navigine SDK添加室内导航、推送通知和跟踪功能。
// your personal security key in the profile
NSString *userHash = @"0000-0000-0000-0000";
// your API server
NSString *server = @"https://api.navigine.com";
NavigineCore *navigineCore = [[NavigineCore alloc] initWithUserHash:userHash server:server];
// location id from web site
NSInteger locationId = 1;
BOOL forced = YES;
// If YES, the content data would be loaded even if the same version has been downloaded already earlier.
// If NO, the download process compares the current downloaded version with the last version on the server.
// If server version equals to the current downloaded version, the re-downloading is not done.
[navigineCore downloadLocationById:locationId forceReload:forced processBlock:^(NSInteger loadProcess) {
NSLog(@"%zd",loadProcess);
} successBlock:^(NSDictionary *userInfo) {
[navigineCore startNavigine];
} failBlock:^(NSError *error) {
NSLog(@"%@",error);
}];
// Initializing Navigation library (USER_HASH is your personal security key)
if (!NavigineSDK.initialize(getApplicationContext(), USER_HASH, null)) Toast.makeText(this, "Unable to initialize Navigation library!", Toast.LENGTH_LONG).show();
// Download a location archive from the server
class LoadTask extends AsyncTask<Void, Void, Boolean>
{
@Override protected Boolean doInBackground(Void... params)
{
return NavigineSDK.loadLocation(LOCATION_ID, 30) ?
Boolean.TRUE : Boolean.FALSE;
}
@Override protected void onPostExecute(Boolean result)
{
if (result.booleanValue())
{
// Location is successully loaded
// Do whatever you want here, e.g. you can start navigation
NavigationThread navigation = NavigineSDK.getNavigation();
if (navigation != null)
navigation.setMode(NavigationThread.MODE_NORMAL);
}
else
{
// Error downloading location
// Try again later or contact technical support
Log.d(TAG, "Error downloading location!");
}
}
}
(new LoadTask()).execute();
探索室内定位和跟踪的力量 - 立即联系我们!
我们的优势