首页 / 浏览问题 / 移动 / 问题详情
android 无法加载在线矢量瓦片服务 白屏
曹半斤  (65分)  初出茅庐
6月9日, 2020
 private void test(String idcard) {
        //将地图显示控件和工作空间关联
        Workspace mWorkspace = new Workspace();
 
        Map mMap = m_mapcontrol.getMap(); //获取在地图控件中显示的地图对象
        mMap.setWorkspace(mWorkspace); //设置当前地图所关联的工作空间
 
        DatasourceConnectionInfo info=new DatasourceConnectionInfo();
        info.setServer("http://120.86.184.34:8090/iserver/services/map-mvt-mdhMap/rest/maps/mdhMap");
        info.setEngineType(EngineType.MVTCache);
        Datasource ds=mWorkspace.getDatasources().open(info);

        //地图显示范围可在iDesktop中,通过地图属性查看
        mMap.getLayers().add(ds.getDatasets().get(0), true);
        mMap.setScale(0.00022153311965710320);

        Point2D point2D = new Point2D(113.61, 22.72);
        Point2D point2D2 = new Point2D(113.84, 22.89);
        Rectangle2D rectangle2D = new Rectangle2D(point2D, point2D2);
        mMap.setViewBounds(new Rectangle2D(rectangle2D));

        Log.i("MainActivity", "left: " + ds.getDatasets().get(0).getBounds().getLeft() + ", right: " + ds.getDatasets().get(0).getBounds().getRight());
        Log.i("MainActivity", "count:" + ds.getDatasets().getCount() + "");
        Log.i("MainActivity", "layers:" + mMap.getLayers().getCount() + "");


        m_mapcontrol.setGestureDetector(new GestureDetector(this,gesture));

        mMap.refresh();
 
    }

1个回答

您好,移动端加载MVT目前研发正在修改,等修改完成后我第一时间给你临时版本
董懿鑫  (8,992分)  登峰造极
6月9日, 2020
...