我设置了Polyline点击监听器,如下所示:
map.setOnPolylineClickListener(new GoogleMap.OnPolylineClickListener() {
public void onPolylineClick(Polyline polyline) {
int strokeColor = polyline.getColor() ^ 0x0000CC00;
polyline.setColor(strokeColor);
Log.e("TAG", "Polyline points @ " + polyline.getPoints());
Toast.makeText(Draw_Route.this, "Polyline klick: " + polyline.getPoints(), Toast.LENGTH_LONG).show();
}
});
但我需要在用户点击折线时获取该点的坐标,我也使用此代码获取codrinates - >
map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng clickCoords) {
Log.e("TAG", "Found @ " + clickCoords.latitude + " " + clickCoords.longitude);
}
});
但它只有在我点击地图时才有效,我需要在点击折线时获得该点坐标,所以请帮助我,如何实现。
由于