【发布时间】:2017-06-14 12:16:54
【问题描述】:
我在我的项目中集成了原生地图库。地图使用 javascript 键作为 MapContainer 中的参数在模拟器中快速加载。但在 android 设备中,我必须删除参数才能使其工作。 Ps:所有需要的api都保存在构建提示中。但它在 android 设备中加载非常缓慢。我必须等待几分钟才能加载地图。如果我放大,地图会消失并看到白屏。如果我缩小,地图就会出现。
您可以观看有关缩放问题here 的视频。
我的代码:
Form hi = new Form("Native Maps Test");
hi.setLayout(new BorderLayout());
final MapContainer cnt = new MapContainer();
Style s = new Style();
s.setFgColor(0xff0000);
s.setBgTransparency(0);
FontImage markerImg = FontImage.createMaterial(FontImage.MATERIAL_PLACE, s, 4);
cnt.setCameraPosition(new Coord(27.6738908, 85.3181375));
cnt.addMarker(
EncodedImage.createFromImage(markerImg, false),
new Coord(27.6738908, 85.3181375),
"Hi marker",
"Optional long description",
evt -> {
ToastBar.showMessage("You clicked the marker", FontImage.MATERIAL_PLACE);
}
);
hi.add(BorderLayout.CENTER, cnt);
hi.show();
hi.revalidate();
【问题讨论】:
标签: codenameone