首页 / 浏览问题 / 移动GIS / 问题详情
iOS 地图创建成功,但是运行后崩溃
1EXP 2016年11月19日

整个类就只有这一个方法,在 viewDidLoad里执行完最后一句,挂掉了

-(void)openMap

{

    

    if (m_workspace == nil) {

        // 初始化

        m_workspace = [[Workspace alloc]init];

    }

    m_ConnectionInfo = [[DatasourceConnectionInfo alloc] init];

    m_ConnectionInfo.server = @"http://supermapcloud.com";

    m_ConnectionInfo.engineType = ET_SuperMapCloud;

    m_ConnectionInfo.alias = @"SuperMapCloud";

    Datasource *dsClond = [m_workspace.datasources open:m_ConnectionInfo];

    

    [_m_mapcontrol mapControlInit];

    

    _m_mapcontrol.map.workspace = m_workspace;

    

    if (dsClond) {

        DebugLog(@"共计:%zi",dsClond.datasets.count);

        Dataset *ds = [dsClond.datasets get:0];

        [_m_mapcontrol.map close];

        [_m_mapcontrol.map.layers addDataset:ds ToHead:YES];

    }

    _m_mapcontrol.map.scale = 0.1f/5000;

    //获取地图坐标系

    PrjCoordSys *prjCoordSys = _m_mapcontrol.map.prjCoordSys;

    //坐标系转换

    Point2Ds *point2ds =  [[Point2Ds alloc] init];

    //默认成都地址

    [point2ds add:[[Point2D alloc] initWithX:106.06 Y:30.04]];

    

    BOOL isOk= [CoordSysTranslator forward:point2ds PrjCoordSys:prjCoordSys];

    if (isOk) {

        

    }

    if (point2ds.getCount > 0) {

        Point2D *point2d=[point2ds getItem:0];

        _m_mapcontrol.map.center = point2d;

    }

    [_m_mapcontrol.map refresh];

    [_m_mapcontrol setAction:PAN];

//    [_m_mapcontrol.map viewEntire];

  

 报错:

/Users/imobile/Documents/SourceCode/fabu/jni/Src/GraphicsMem/UGFreeTypeLib.cpp:147: OGDCASSERT(error == 0) failed.

/Users/imobile/Documents/SourceCode/fabu/jni/Src/GraphicsMem/UGFreeTypeLib.cpp:620: OGDCASSERT(error == 0) failed.

libc++abi.dylib: 

(lldb) bt

* thread #1: tid = 0x1cc839, 0x1e2e3ad4 libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT  

1个回答

您检测下工程中是否加入了SuperMap.bundle文件,如果没有请按照帮助文档上的方法进行添加
1,747EXP 2016年11月21日
我已经对照了好几次文档呢,bundle文件也是加入了的,许可也是加入了的。
你把你的工程发我看下呢,上传到网盘把链接分享给我
您好,后来不崩溃了,在新建的一个空工程里 这样做是没有问题的,但是我挪到自己的项目里就各种报错,因为原来的项目第三方的使用比较多。我按照项目配置了,出现很多冲突,最后 还是卡在这里了。

Undefined symbols for architecture armv7:

  "_wrapper_compressor_ZLibCompressor", referenced from:

      ___cxx_global_var_init14 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init14 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init14 in SuperMap(UGOSGToolkit.o)

  "_osgdb_tga", referenced from:

      ___cxx_global_var_init8 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init8 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init8 in SuperMap(UGOSGToolkit.o)

  "_osgdb_rgb", referenced from:

      ___cxx_global_var_init7 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init7 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init7 in SuperMap(UGOSGToolkit.o)

  "_osgdb_osg", referenced from:

      ___cxx_global_var_init5 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init5 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init5 in SuperMap(UGOSGToolkit.o)

  "_dotosgwrapper_library_osg", referenced from:

      ___cxx_global_var_init11 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init11 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init11 in SuperMap(UGOSGToolkit.o)

  "_osgdb_jpeg", referenced from:

      ___cxx_global_var_init10 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init10 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init10 in SuperMap(UGOSGToolkit.o)

  "_dotosgwrapper_library_osgText", referenced from:

      ___cxx_global_var_init12 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init12 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init12 in SuperMap(UGOSGToolkit.o)

  "_wrapper_serializer_library_osg", referenced from:

      ___cxx_global_var_init13 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init13 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init13 in SuperMap(UGOSGToolkit.o)

  "_osgdb_osg2", referenced from:

      ___cxx_global_var_init6 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init6 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init6 in SuperMap(UGOSGToolkit.o)

  "_osgdb_bmp", referenced from:

      ___cxx_global_var_init9 in SuperMap(UGFileParserOSG.o)

      ___cxx_global_var_init9 in SuperMap(UGFileParseFactory3DModel.o)

      ___cxx_global_var_init9 in SuperMap(UGOSGToolkit.o)

ld: symbol(s) not found for architecture armv7

h哦呵呵~~~ 我之前工程配了个 -all_load 去掉了 就 ok了 laugh

...