2
我正在GoogleMap上工作,我的项目是MapView.Part,我正在触摸地图,我正在添加pin.My问题是我想删除之前可以添加的pin。我怎么做,我想给Geopoint的功能。删除PIN地图视图?
有人可以给我建议吗?
这是我的代码:`
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();
}`
我可以使用它,但如果我添加5针,如果我打电话给这个代码,我认为它会删除所有pin.İ只想删除我可以touch.I不知道它是否工作? – DuyguK 2012-01-16 13:03:44
首先改变你的问题,根据你的评论,,,,你必须把代码放在onTouchEvent清除特定项目(pin).... – 2012-01-16 13:10:11