Reputation: 3077
I'm trying to create a MapView with built-in zoom controllers, here's the code:
MapView mMapView;
mMapView=new MapView(this, GMAPS_API_KEY);
mMapView.setBuiltInZoomControls(true);
mMapView.setSatellite(false);
mMapView.getController().setZoom(16);
someView.addView(mMapView);
The map works fine; I've also added a MyLocationOverlay on it and it works fine. However, the zoom controls do NOT show up. The call to setBuiltInZoomControls(true) is completely ignored. No error message is logged.
What may I be missing that is needed to have setBuiltInZoomControls work as expected?
Yes, my activity extends MapActivity.
Upvotes: 3
Views: 3252
Reputation: 3307
Try
mMapView.setClickable(true);
I just ran into this myself and it's how I eventually solved it (though I did it with an XML attribute instead of within the Activity code).
Upvotes: 3