Location:

Control Interaction

Map controls include compass, navigation buttons, scale controls, and zoom buttons.

Compass, Scale and Zoom Controls

Whether to display the default controls including the compass, scale, and zoom controls via the configuration of the MapView in the xml file. Sample Center:

XML
                <com.navinfo.DemoMapView
                    android:id="@+id/demoMap"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:clickable="true"
                    smallView="true"
                    smallViewLeft="0"
                    smallViewTop="0"
                    smallViewRight="300"
                    smallViewBottom="300"
                    smallViewEnableEvent="true"
                    useBuiltInControl="true" />
            

useBuiltInControl is of type boolean. When true, it means to use built-in controls, including scale, zoom and compass. By default, this item is not set to indicate that the built-in controls are not used. When the client implements a custom control, it can implement custom background by calling setZoomInBackground(int[], int[]) and setZoomOutBackground(int[], int[]), overriding onMeasure(int, int) and onLayout(boolean , int, int, int, int) Method to customize the position and size of the control.

Location Button

Implementation principle of positioning button After obtaining the position by positioning, record the position information, and after clicking the positioning button, set the positioning position to the center point of the map, and implement the demo in detail.

TOP