MapContainer container = new MapContainer(new
GoogleMapsProvider(Constants.ANDROID_GMAPS_API_KEY));
Coord myLocation = new Coord(lat, lon);
container.setCameraPosition(myLocation);
container.zoom(myLocation, 15);
container.setShowMyLocation(true);
FloatingActionButton fab =
FloatingActionButton.createFAB(FontImage.MATERIAL_SORT);
fab.createSubFAB(FontImage.MATERIAL_FLIGHT, "");
Container root = LayeredLayout.encloseIn(BorderLayout.center(container),
BorderLayout.north(new AutoCompleteTextField()),
BorderLayout.south(FlowLayout.encloseBottom(fab)));
this.add(BorderLayout.CENTER, root);
Display.getInstance().callSerially(() -> {
mapContainer.repaint();
});
I do a lot more with the AutoCompleteTextField and FAB, but for the sake of
brevity, just using this still produces the screen flicker.
You're saying I don't need to pass in a GoogleMapsProvider with the API
string param to the MapContainer for use with Android/iOS devices? If I
don't, doesn't that default to OpenMapsStreetProvider then?
On a side note, right now, I have a few network intensive api calls to my
own db to fetch custom markers, which I believe should go in a
scheduleBackgroundTask(). So, do I need to use callSerially() for when I
add/remove markers to the map container or only when I repaint() or
revalidate()? And is repaint() or revalidate() even the correct use for
after I add/remove markers?
I'm also wondering if you can move the location of the icon that snaps to
your location or if I need to make my own "button."
>
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/9d001719-d9d4-4fbc-b747-57817883d904%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.