【发布时间】:2012-08-22 15:15:52
【问题描述】:
我正在尝试仅绘制可见的 OverlayItems,这就是为什么我确定地图可见 rect 但我无法确定 Canvas 将在其中绘制 OverlayItem 的 Rect。
这就是我到目前为止所做的(逐项叠加中的方法).. 但是 getClipBounds() 没有返回正确的 Rect
@Override
public void draw(Canvas canvas, MapView map, boolean shadow) {
if (getMapBounds().intersect(canvas.getClipBounds())) {
super.draw(canvas, map, false);
}
}
我不想绘制其他 OverlayItem,我想知道我的画布是否在地图视图的可见矩形内绘制了一些东西 因为如果不是我不画这个画布 这样做是为了加快具有近 2000 个叠加项的地图视图
【问题讨论】:
-
问题看不懂,有详细解释吗?
标签: android google-maps canvas overlay itemizedoverlay