지도에서 샘플을 만들고 있는데이 곳에서 텍스트와 함께 표시자를 표시하려고합니다.codameone의지도에 텍스트로 표시자를 표시하는 방법
그것에 대해 내가 코드를 아래에 사용.
MapContainer mapContainer = new MapContainer("xxxxxxxxxxxxxxxxxxxxxx");
Coord coord = new Coord(latitude,longitude);
mapContainer.setCameraPosition(coord);
mapContainer.addMarker(EncodedImage.createFromImage(image,false), mapContainer.getCameraPosition(), "Text", "Text", null);
그러나이 코드는 마커를 표시하는 데 도움이되지만 텍스트와 함께 표시하지는 않습니다. 그래서 누군가가 텍스트로 마커를 표시 할 생각이라면/이것을 성취하도록 도와주세요.
미리 감사드립니다. 여기
는 MapContainer 및 (대답 아래) MapLayout를 사용하여 코드를입니다 ..if(BrowserComponent.isNativeBrowserSupported()) {
MapContainer mc = new MapContainer("AIzaSyDLIu4RfdXVQPvRqOYLP6N8ocCQpPNqtIk");
mapDemo.add(mc);
Container markers = new Container();
markers.setLayout(new MapLayout(mc, markers));
mapDemo.add(markers);
Coord moscone = new Coord(37.7831, -122.401558);
Button mosconeButton = new Button("");
FontImage.setMaterialIcon(mosconeButton, FontImage.MATERIAL_PLACE);
markers.add(moscone, mosconeButton);
Coord moscone1 = new Coord(36.6139, -120.2090);
Button mosconeButton1 = new Button("");
FontImage.setMaterialIcon(mosconeButton1, FontImage.MATERIAL_PLACE);
markers.add(moscone1, mosconeButton1);
mc.zoom(moscone1, 5);
} else {
// iOS Screenshot process...
mapDemo.add(new Label("Loading, please wait...."));
}
https://stackoverflow.com/help/how-to-ask – dda