使用Markerclicklistener打开SlideView图片

时间:2016-01-08 13:50:38

标签: google-maps-markers slideshow onclicklistener

如何通过点击地图中的标记来打开幻灯片图片? 我已经尝试将viewPager放在弹出窗口上,但是没有用。请帮忙

MapsActiviy

    mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {

            LayoutInflater layoutInflater
                    = (LayoutInflater) getBaseContext()
                    .getSystemService(LAYOUT_INFLATER_SERVICE);
            View popupView = layoutInflater.inflate(R.layout.popupwindow, null);



            final PopupWindow popupWindow = new PopupWindow(
                    popupView,
                    LayoutParams.WRAP_CONTENT,
                    LayoutParams.WRAP_CONTENT);

            popupWindow.showAtLocation(findViewById(R.id.map), Gravity.CENTER_HORIZONTAL, 0, 0);

            ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
            ImageAdapter adapter = new ImageAdapter(this);
            viewPager.setAdapter(adapter);

            return false;
        }
    });

0 个答案:

没有答案