enivironment:
eclipse-SDK-3.4.1-win32
android-sdk-windows-1.0_r1
jre1.6.0_07
Using java Syntax Highlighting
- package com.android.MapView;
- import com.google.android.maps.GeoPoint;
- import com.google.android.maps.MapActivity;
- import com.google.android.maps.MapController;
- import com.google.android.maps.MapView;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.ViewGroup;
- public class MapViewActivity extends MapActivity {
- MapView mapView;
- MapController mapController;
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- mapView = (MapView) findViewById(R.id.map);
- ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom);
- zoom.addView(mapView.getZoomControls());
- mapController = mapView.getController();
- mapController.setZoom(15);
- updateView();
- }
- @Override
- protected boolean isRouteDisplayed() {
- // TODO Auto-generated method stub
- return false;
- }
- private void updateView(){
- Double lat = 1*1E6;
- Double lng = 1*1E6;
- GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
- mapController.setCenter(point);
- }
- }
Parsed in 0.171 seconds, using GeSHi 1.0.8.4
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.MapView"
- android:versionCode="1"
- android:versionName="1.0.0">
- <uses-permission android:name="android.permission.INTERNET">
- <uses-permission
- android:name="android.permission.ACCESS_COARSE_LOCATION" />
- </uses-permission>
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".MapViewActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <uses-library android:name="com.google.android.maps" />
- </application>
- </manifest>
Parsed in 0.008 seconds, using GeSHi 1.0.8.4
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <com.google.android.maps.MapView android:id="@+id/map"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:apiKey="Map_Demo"
- android:clickable="true" />
- <LinearLayout android:id="@+id/zoom"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true" />
- <EditText android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="输入查询地址?"
- android:selectAllOnFocus="true"/>
- </RelativeLayout>
Parsed in 0.008 seconds, using GeSHi 1.0.8.4









