0

ユーザーの現在の Location をロードする Main Activity クラスがあります。ItemizedOverlay を拡張する別のクラスがあります。このクラスは、ピンポイントの配置を処理します。近くのATMの場所を取得するクラスがもう1つあります。そのため、近くのすべてのATMの場所にピンポイントを配置するためにforループを使用します。特定のピンをタップするとアプリがポップアップするようにします。その場所の周辺を示しています。

for(int i=0; i < placeName.length;i++){
nearbylatitude= (int) (lati[i]*1E6);
nearbylongitude=(int) (longi[i]*1E6);
Log.e("Location", nearbylatitude+"\t \t"+ nearbylongitude);
GeoPoint myLocation_nearby_place= new GeoPoint(nearbylatitude, nearbylongitude);    
OverlayItem overlayPlaces=new             OverlayItem(myLocation_nearby_place,placeName[i],vicinity[i]);
custom_Places=new CustomPinpoint(drawable_places,     MainMapActivity.this);
    custom_Places.addPinPoints(overlayPlaces);
     overlayList.add(custom_Places);

    }

これは、ピンポイントを近くの Location に配置する for ループです。ItemizedOverlay を使用したメソッド onTap() があることは知っていますが、その関数をいつ呼び出すか、どのピンがタップされているかを取得する方法がわかりません。

緊急の助けが必要..

4

1 に答える 1

0

以下を使用します。

public OverlayItem(GeoPoint point, java.lang.String title, java.lang.String snippet) パラメータ: point - アイテムの位置。タイトル - タイトル テキスト。snippet - スニペット テキスト。

OverlayItem currentOverlay = new OverlayItem(CurrLocGeoPoint(),"Text for bubble","");
于 2012-08-29T12:07:11.703 に答える