[英]Android Google Maps v2 clickable marker title
我的应用上有一张Google地图。 标记已经可以单击,但是我正在寻找一种方法来使标题可单击以执行操作(例如转到场所“描述”页面)。 这就是我的意思
public class MapFragment extends Fragment {
private GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_map, container,
false);
String myTag = getTag();
((PlacesAndMapActivity) getActivity()).setTabFragmentMap(myTag);
map = ((SupportMapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();
map.addMarker(new MarkerOptions().position(new LatLng(34.039407, -118.254763))
.title("Restaurant 1"));
return rootView;
}
}
无论如何,我可以使标题可点击吗? 谢谢
您想使用GoogleMap.OnInfoWindowClickListener
类概述回调界面,用于标记的信息窗口上的单击/点击事件。
public abstract void onInfoWindowClick (Marker marker)
单击标记的信息窗口时调用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.