Android: add overlay to MapView?
I have subclassed Overlay as LandMarkOverlay (and implemented an onTap(GeoPoint) method).
In the main activity I do this:
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
开发者_StackOverflow中文版landmarkOverlay = new LandmarkOverlay();
//add the landmarkOverlay to the list
mapView.getOverlays().add(landmarkOverlay);
What else do I need to do so that when the user taps the screen, landmarkOverlay
's onTap(GeoPoint)
method gets called?
It should get called. I assume your method is onTap(GeoPoint point, MapView mapView)
?
精彩评论