首页 / 浏览问题 / 组件GIS / 问题详情
超图FAQ:【iObjects Java】用Java组件生成新地图,并将地图保存成图片,outputMapToFile接口返回false
64,468EXP 2024年04月09日
【iObjects Java】用Java组件生成新地图,并将地图保存成图片,outputMapToFile接口返回false

1个回答

【解决办法】需要为添加图层的地图设置地图范围,可以通过设置“全幅显示本图层”的方式 Map map = new Map(workspace); DatasetVector dataset = (DatasetVector) workspace.getDatasources().get(0).getDatasets().get(0); LayerSettingVector layerSettingVector = new LayerSettingVector(); Layer layer = map.getLayers().add(dataset, layerSettingVector, true); map.refresh(); map.ensureVisible(layer); map.setLineAntialias(true); workspace.getMaps().add("new", map.toXML()); workspace.save(); boolean b = map.outputMapToFile(filePath,ImageType.PNG, 96, dataset.getBounds(), true);
64,468EXP 2024年04月09日
热门文章
关注我们
...