gpt4 book ai didi

java - 了解在 Android 中更改点击叠加标记的代码

转载 作者:行者123 更新时间:2023-12-01 15:27:55 25 4
gpt4 key购买 nike

我尝试了answer by Sherif elKhatibHow to change the marker for the overlay on tap for android? ,但有些事情我不明白。

protected boolean onTap(int index)
{
// Here, what is mOverlays? I mean it is the object of what?
OverlayItem item = mOverlays.get(index);
// Is the mContext, the object of Context?
Drawable marker = mContext.getResources().getDrawable(R.drawable.icon);
marker.setBounds(0,0,marker.getIntrinsicWidth(),marker.getIntrinsicHeight());
item.setMarker(marker);
return true;
}

什么是mOverlaysmContext

最佳答案

What are mOverlays and mContext?

mOverlays大概是 List<OverlayItem> ,因为它响应 get()OverlayItem .

mContextContext ,可能是你的MapActivity .

关于java - 了解在 Android 中更改点击叠加标记的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9946546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com