You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to render a custom marker component on top of a google map with a custom map layout (using the code of this blog post: https://www.codenameone.com/blog/map-layout-update.html), my marker position is lagging out (bounce effect) when I move the map.
What I was expecting is performances similar to the one achieved with react-native, where markers seems like part of the map image itself (I made a short video with a dynamic marker (just a counter that increment by 1 every second) to show you how this looks like in react-native using https://github.com/react-community/react-native-maps to render the map and a standard custom react-native component (javascript) for the marker): https://streamable.com/ahtor
My CN1 map Form is extremely simple (It was just to test for now):
public class Map extends com.codename1.ui.Form {
private static final String HTML_API_KEY = "I put my private API key here";
public Map()
{
setLayout(new BorderLayout());
final MapContainer mc = new MapContainer(HTML_API_KEY);
Container mrc = LayeredLayout.encloseIn(
BorderLayout.center(mc)
);
add(BorderLayout.CENTER, mrc);
Container markers = new Container();
markers.setLayout(new MapLayout(mc, markers));
mrc.add(markers);
Coord moscone = new Coord(45.757350, 4.834434);
Button mosconeButton = new Button("");
FontImage.setMaterialIcon(mosconeButton, FontImage.MATERIAL_PLACE);
markers.add(moscone, mosconeButton);
mc.zoom(moscone, 20);
}
}
I've moved the MapLayout inside the GoogleMaps cn1lib, and it shouldn't be necessary anymore as I've also added an API to add Components directly as markers in the MapContainer. codenameone/codenameone-google-maps@614f77f
myMap.addMarker(myComponent, myCoord);
These components are converted directly into image markers when the map is being dragged so that they are effectively native markers. This resolves the latency issue.
When trying to render a custom marker component on top of a google map with a custom map layout (using the code of this blog post: https://www.codenameone.com/blog/map-layout-update.html), my marker position is lagging out (bounce effect) when I move the map.
Here is a short video to show the issue:
https://streamable.com/4rocw
What I was expecting is performances similar to the one achieved with react-native, where markers seems like part of the map image itself (I made a short video with a dynamic marker (just a counter that increment by 1 every second) to show you how this looks like in react-native using https://github.com/react-community/react-native-maps to render the map and a standard custom react-native component (javascript) for the marker):
https://streamable.com/ahtor
My CN1 map Form is extremely simple (It was just to test for now):
As for my MapLayout class, the code is exactly the same as the one in this post: https://www.codenameone.com/blog/map-layout-update.html
This issue has already been discussed here:
http://www.codenameone.com/discussion-forum.html?place=topic%2Fcodenameone-discussions%2F6BghRd4sFNM%2Fdiscussion
The text was updated successfully, but these errors were encountered: