私はバルーンを表示するためにandroid-mapviewballoonsライブラリを使用します。 ユーザーがマーカーをクリックすると、バルーンが表示されます。マップが表示されたら、MapViewにバルーンを表示する方法は?
私が持っている質問:ユーザーのクリックを待たずに特定のアイテムのバルーンを表示する方法は?
Upd。私はどのように識別するのですか? 現在、私は次のようにあります
public class Map extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
// here I have extras.getDouble("lat") and extras.getDouble("lng") -
// the location balloon should be shown for
...
itemizedOverlay = new MapOverlay(drawable, mapView);
for (int i = 0; i < items.getCount(); i++) {
// here I add markers, one of them will have lat and lng equal to
// the values passed in extras
public class MapOverlay extends BalloonItemizedOverlay<OverlayItem> {
...
protected OverlayItem createItem(int i) {
また、次のコードに関して:
// BalloonOverlayView is a raw type. References to generic type BalloonOverlayView<Item> should be parameterized
BalloonOverlayView bov = new BalloonOverlayView(context, 50);
// What is item there? should be getItem(i)?
bov.setData(item);
// The method setPosition(int) is undefined for the type BalloonOverlayView
BalloonOverlayView.setPosition(i);
このライブラリの開発者には、このStackOverflowの質問が表示される場合と表示されない場合があります。 – CommonsWare
ありがとう、@ CommonSWare。実際には、私はすでに彼にメッセージを送ってきましたが、ここで誰かが同じことを既に実行していることを願っています。 –