Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package net.learn2develop.GoogleMaps; import java.io.IOException; import java.util.List; import java.util.Locale; 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 com.google.android.maps.Overlay; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Point; import android.location.Address; import android.location.Geocoder; import android.os.Bundle; import com.google.android.maps.MapView.LayoutParams; import android.telephony.SmsMessage; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.widget.LinearLayout; import android.widget.Toast; public class MapsActivity extends MapActivity { MapView mapView; MapController mc; GeoPoint p; public static final String PREF_FILE_NAME = "PrefFile"; String[] coordinates = new String[2]; String[] location = new String[2]; String temp; Bundle bundle; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapView); LinearLayout zoomLayout = (LinearLayout) findViewById(R.id.zoom); View zoomView = mapView.getZoomControls(); zoomLayout.addView(zoomView, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mapView.displayZoomControls(true); // mapView.setSatellite(true); /**显示卫星视图 // mapView.setStreetView(true); /**显示街道视图 mc = mapView.getController(); bundle = getIntent().getExtras(); try { if (bundle == null) { temp = "40.849165,123.328739"; } else { temp = bundle.getString("location"); } location = temp.split(","); } catch (NumberFormatException e) { e.toString(); } for (int i = 0; i < location.length; i++) { coordinates[i] = location[i]; } double lat = Double.parseDouble(coordinates[0]); double lng = Double.parseDouble(coordinates[1]); p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6)); mc.animateTo(p); mc.setZoom(17); MapOverlay mapOverlay = new MapOverlay(); List listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); mapView.invalidate(); } class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); // ---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); // ---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.icon); canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 50, null); return true; } public boolean onTouchEvent(MotionEvent event, MapView mapView) { // ---when user lifts his finger--- if (event.getAction() == 1) { GeoPoint p = mapView.getProjection().fromPixels( (int) event.getX(), (int) event.getY()); /** 通过获取坐标来拿到地理名称加上坐标显示 **/ Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); try { List
addresses = geoCoder.getFromLocation( p.getLatitudeE6() / 1E6, p.getLongitudeE6() / 1E6, 1); String add = ""; if (addresses.size() > 0) { for (int i = 0; i < addresses.get(0) .getMaxAddressLineIndex(); i++) add += addresses.get(0).getAddressLine(i) + "\n" + p.getLatitudeE6() / 1E6 + "," + p.getLongitudeE6() / 1E6 + "\n"; } Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT) .show(); } catch (IOException e) { e.printStackTrace(); } /** * 通过已知的地名找出位置 Geocoder geoCoder = new * Geocoder(getBaseContext(), Locale.getDefault()); try { * List
addresses = geoCoder.getFromLocationName( * "empire state building", 5); String add = ""; if * (addresses.size() > 0) { p = new GeoPoint( (int) * (addresses.get(0).getLatitude() * 1E6), (int) * (addresses.get(0).getLongitude() * 1E6)); mc.animateTo(p); * mapView.invalidate(); } } catch (IOException e) { * e.printStackTrace(); } */ return true; } else return false; } } /** Called when the activity is first created. */ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { MapController mc = mapView.getController(); switch (keyCode) { case KeyEvent.KEYCODE_3: mc.zoomIn(); break; case KeyEvent.KEYCODE_1: mc.zoomOut(); break; } return super.onKeyDown(keyCode, event); } @Override protected boolean isRouteDisplayed() { return false; } }