移动端iOS 10 i 导航路径分析崩溃
导航数据加载
DatasourceConnectionInfo *info = [[DatasourceConnectionInfo alloc]init];
[info setEngineType:ET_UDB];
[info setServer:fileUdb];
info.alias = @"NewData";
Datasource *naviData = [[m_workspace datasources] open:info];
DatasetVector *roadDataset = (DatasetVector*)[[naviData datasets]getWithName:@"luwang_Network"];
m_navigation = [m_mapControl getNavigation2];
[m_navigation setPathVisible: true];
[m_navigation setDeviateTolerance:500.00];
[m_navigation setNetworkDataset:roadDataset];
[m_navigation loadModel:filesnm];
路径分析如下
Point2Ds *point2Ds = [[Point2Ds alloc]init];
[point2Ds add:_startPoint2D];
[point2Ds add:_endPoint2D];
if ([m_mapControl.map.prjCoordSys type]!= PCST_EARTH_LONGITUDE_LATITUDE)
{
PrjCoordSys *desPrjCoorSys = [[PrjCoordSys alloc]init];
[desPrjCoorSys setType:PCST_EARTH_LONGITUDE_LATITUDE];
CoordSysTransParameter *param = [[CoordSysTransParameter alloc]init];
[CoordSysTranslator convert:point2Ds PrjCoordSys:desPrjCoorSys PrjCoordSys:m_mapControl.map.prjCoordSys CoordSysTransParameter:param CoordSysTransMethod:MTH_GEOCENTRIC_TRANSLATION];
}
[m_navigation setStartPoint:_startPoint2D.x sPointY:_startPoint2D.y];
[m_navigation setDestinationPoint:_endPoint2D.x dPointY:_endPoint2D.y];
if([m_navigation isGuiding])
{
[m_navigation cleanPath];
[m_navigation stopGuide];
}
NSLog(@"%@",[m_navigation routeAnalyst]);
if(![m_navigation routeAnalyst])
{
NSLog(@"无相关路径");
}
[m_navigation setPathVisible:true];
[m_mapControl.map refresh];
会在,[m_navigation routeAnalyst]处崩溃