私の地図上にpolyline
を描いていますので、今すぐユーザーにデータを表示する必要があります。GoogleマップAndroid API v2 - ポリライン上のInfoWindow?
polyline
にテキストまたはインフォウィンドウを描く方法はありますか?
私のようなpolyline
を追加します。私は、これに必要なたとえば
ArrayList<LatLng> points = null;
PolylineOptions lineOptions = null;
MarkerOptions markerOptions = new MarkerOptions();
// Traversing through all the routes
for(int i=0;i<result.size();i++){
points = new ArrayList<LatLng>();
lineOptions = new PolylineOptions();
String color = colors[i % colors.length];
// Fetching i-th route
List<HashMap<String, String>> path = result.get(i);
// Fetching all the points in i-th route
for(int j=0;j<path.size();j++){
HashMap<String,String> point = path.get(j);
double lat = Double.parseDouble(point.get("lat"));
double lng = Double.parseDouble(point.get("lng"));
LatLng position = new LatLng(lat, lng);
points.add(position);
}
// Adding all the points in the route to LineOptions
lineOptions.addAll(points);
lineOptions.width(5);
lineOptions.color(Color.parseColor(color));
// Drawing polyline in the Google Map for the i-th route
mMap.addPolyline(lineOptions);
}
:
私はGoogleマップアンドロイドなどのポリラインに設定する必要がマーカー上の情報を設定する必要はありません。 –
私は理解していますが、組み込みの方法はないので、ポリライン上に不可視のマーカーを作成し、インフォメーションウィンドウを開いてインフォメーションウィンドウを開いたように見えるようにする必要がありますポリラインの場合上記の私の改訂された答えを見てください。 –
私はそれを試しましたが、一度に1つのinfoWindowしか表示されません。 3つのinfoWindowを同時に開く必要がある場合 – NetDemo