【发布时间】:2013-11-01 07:30:53
【问题描述】:
我正在使用 MapView 处理 GoogleMap。我在地图上触摸我的项目的一部分,我正在添加 pin。我的问题是我想删除之前可以添加的 pin。我怎么能做到这一点,我想将 Geopoint 赋予该功能。
有人可以给我建议吗?
这是我的代码:`
public void AddPoint(Drawable drawable, MapView mapView, MotionEvent motionEvent) {
p = mapView.getProjection().fromPixels(
(int) motionEvent.getX(),
(int) motionEvent.getY()-50);
final MapController mc = mapView.getController();
mc.setZoom(16);
CustomItemizedOverlay<CustomOverlayItem> itemizedOverlay = new CustomItemizedOverlay<CustomOverlayItem>(drawable, mapView);
itemizedOverlay.addOverlay(new CustomOverlayItem(p,"","",""));
mapView.getOverlays().add(itemizedOverlay);
mc.animateTo(p);
mapView.invalidate();
}`
【问题讨论】: