1
votes

I have integrated native map lib in my project. The map loads quickly in the simulator using javascript key as a parameter in MapContainer. But in android devices I've to remove the parameter to make it work. Ps: all the required api are kept in build hint. But it loads very slowly in the android devices. I've to wait several minutes for map to load. And if I zoom in, the map disappears and white screen is seen. If I zoom out, then the map appears.

You can see the video on zooming issue here.

My code:

    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();
1

1 Answers

0
votes

That's not a native map. That's the fallback map component. You need to verify that Android native map is enabled. I suggest connecting the device with a cable and looking at the errors Google throws in the console.