diff --git a/docs/html/guide/tutorials/views/hello-mapview.jd b/docs/html/guide/tutorials/views/hello-mapview.jd index 868bfaa6a081d..50cb0303f0ef4 100644 --- a/docs/html/guide/tutorials/views/hello-mapview.jd +++ b/docs/html/guide/tutorials/views/hello-mapview.jd @@ -93,28 +93,6 @@ protected boolean isRouteDisplayed() { }
You can actually run this now, but all it does is allow you to pan around the map.
-Android provides a handy {@link android.widget.ZoomControls} widget for zooming in and out of a View.
-MapView can automatically hook one for us by requesting it with the getZoomControls()
-method. Let's do this.
-<LinearLayout - android:id="@+id/zoomview" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignBottom="@id/mapview" - android:layout_centerHorizontal="true" -/>- -
It doesn't really matter what kind of ViewGroup we use, because we just want a - container that we can position within our root RelativeLayout.
- -The last two attributes are available only to an element that's a child of a
- RelativeLayout. layout_alignBottom aligns the bottom of this element to the bottom of
- the element identified with a resource tag (which must be a sibling to this element).
- layout_centerHorizontal centers this on the horizontal plane.
LinearLayout linearLayout; MapView mapView; -ZoomControls mZoom;
onCreate(). We'll capture the LinearLayout and
MapView through their layout resources. Then get the ZoomControls from the MapView::
-linearLayout = (LinearLayout) findViewById(R.id.zoomview); mapView = (MapView) findViewById(R.id.mapview); -mZoom = (ZoomControls) mapView.getZoomControls();+mapView.setBuiltInZoomControls(true); + -
By using the ZoomControls object provided by MapView, we don't have to do any of the work - required to actually perform the zoom operations. The ZoomControls widget that MapView - returns for us is already hooked into the MapView and works as soon as we add it to the - layout. The controls will appear whenever the user touches the map, then dissapear after - a few moments of inactivity.
linearLayout.addView(mZoom);
By using the built-in zoom control provided by MapView, we don't have to do any of the work + required to actually perform the zoom operations. The controls will appear whenever the user + touches the map, then disappear after a few moments of inactivity.