首页 / 浏览问题 / 移动GIS / 问题详情
导入kml的问题
24EXP 2019年08月07日
使用产品:iMobile 9.1.2 操作系统:win10 x64
数据类型: 文件型
问题详细描述:在导入kml数据集后,kml中的文字转换成了文字类型的数据集,问题是尺寸特别大,要如何解决?

1个回答

您好,1.在导入时,最后一个参数boolean importAsCAD如果设置设置为true就是导入为复合数据集,如果设置为false会导入为简单数据集,这样的话文本会导入为文本数据集。

2.尺寸大小的问题,这个应该是因为kml中存储的文本大小与我们中的大小不一致导致的,你可以在桌面软件中导入kml数据看一下效果,与移动端是否一致
9,127EXP 2019年08月07日
您好,

1.我是按照第一种方式,参数为false,

2.移动端和桌面端导入后的大小不一致,桌面端导入后大小勉强还可以能用,移动端导入后大小非常大,比中国地图都大了
对于文本大小只能通过去设置文本的风格GeoText,然后设置Textstyle

我设置后不起作用,代码如下:

if(dataset.getType() == DatasetType.TEXT) {
    layer.setEditable(true);

    TextStyle textStyle = new TextStyle();
    textStyle.setRotation(30.0);
    textStyle.setShadow(true);
    textStyle.setAlignment(TextAlignment.TOPCENTER);
    textStyle.setForeColor(new Color(0, 0,0));
    textStyle.setBackOpaque(true);
    textStyle.setBold(true);
    textStyle.setFontName("宋体");
    textStyle.setFontHeight(1.0);
    textStyle.setFontWidth(1.0);
    textStyle.setSizeFixed(true);
    textStyle.setItalic(true);
    textStyle.setOutline(true);
    textStyle.setStrikeout(true);
    textStyle.setUnderline(true);
    textStyle.setWeight(500);


    Recordset recordset = ((DatasetVector)dataset).getRecordset(false, CursorType.DYNAMIC);
    recordset.edit();

    boolean status = recordset.moveFirst();
    while(status) {
        GeoText text = (GeoText)recordset.getGeometry();
        if(text != null) {
            text.setTextStyle(textStyle);
        }
        status = recordset.moveNext();
    }

    recordset.update();

    recordset.close();
    recordset.dispose();

    layer.setEditable(false);
}
您好,对GeoText设置完风格后,需要使用recortset.setGeometry()方法,最后在update
...