Mapgis问题集锦

1. mapview annotation setCalloutView()无法控制弹出气泡的大小.

解决办法: 给inflate进来的view的子view设置高宽,则会有就能控制气泡的大小.

AnnotationView annotationView = new AnnotationView(annotation, context);
View contentView = LayoutInflater.from(context).inflate(R.layout.content_annotation_jingq, null);

DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
int width = displayMetrics.widthPixels / 2;
View ll = contentView.findViewById(R.id.ll_xxx);
LinearLayout.LayoutParams p = (LinearLayout.LayoutParams) ll.getLayoutParams();
p.width = width;
ll.setLayoutParams(p);

2. scrollView嵌套mapview滑动事件冲突. 

解决办法: 重写mapview的Ontouch事件.

mapview.getChildAt(0).setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if(event.getAction() == MotionEvent.ACTION_UP){
            scrollView.requestDisallowInterceptTouchEvent(false);
        }else{
            scrollView.requestDisallowInterceptTouchEvent(true);
        }
        return false;
    }
});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值