【问题标题】:Android Google Maps v2 clickable marker titleAndroid Google Maps v2 可点击标记标题
【发布时间】:2015-02-12 18:01:05
【问题描述】:

我的应用中有 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;
    }
    }

无论如何我可以使标题可点击?谢谢

【问题讨论】:

    标签: java android google-maps maps


    【解决方案1】:

    你想使用GoogleMap.OnInfoWindowClickListener

    类概述 标记信息窗口中点击/点击事件的回调接口。

    public abstract void onInfoWindowClick (Marker marker)
    

    在点击标记的信息窗口时调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-28
      • 2012-12-22
      • 1970-01-01
      • 1970-01-01
      • 2013-06-14
      • 2013-01-12
      • 1970-01-01
      • 2013-03-29
      相关资源
      最近更新 更多