当前位置: 首页 > news >正文

免费虚拟主机网站网页设计个人网站设计

免费虚拟主机网站,网页设计个人网站设计,网站建设需要企业,单位举报网站建设维护情况报告目前#xff0c;我能够在代码中显示第一个点(pointStatie)的一点#xff0c;但我希望显示两个点。我想要显示我所在的位置#xff0c;以及我从另一个班级通过坐标的另一点。我目前的代码是#xff1a;package aexp.elistcbox;import android.os.Bundle;import android.prov…目前我能够在代码中显示第一个点(pointStatie)的一点但我希望显示两个点。我想要显示我所在的位置以及我从另一个班级通过坐标的另一点。我目前的代码是package aexp.elistcbox;import android.os.Bundle;import android.provider.SyncStateContract.Constants;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.MapController;import com.google.android.maps.GeoPoint;import android.content.Context;import android.content.Intent;import android.content.res.Resources;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.location.Criteria;import android.util.Log;import android.widget.Toast;import android.location.Geocoder;import android.location.Address;import java.util.List;import java.util.Locale;import java.io.*;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;import android.graphics.Canvas;import android.graphics.Point;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.drawable.Drawable;public class GPSLocatorActivity extends MapActivity{public MapView mapView;public MapController mapController;public LocationManager locationManager;public LocationListener locationListener;public String best;Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.map_view);mapView (MapView) findViewById(R.id.mapView);mapView.setSatellite(false);mapView.setBuiltInZoomControls(true);mapController mapView.getController();mapController.setZoom(13);locationManager (LocationManager)getSystemService(Context.LOCATION_SERVICE);locationListener new GPSLocationListener();Bundle extras getIntent().getExtras();if(extras !null){double longitudine extras.getDouble(long);double latitudine extras.getDouble(lat);((GPSLocationListener) locationListener).setLongitudine(longitudine);((GPSLocationListener) locationListener).setLatitudine(latitudine);Log.e(longitudine, * ((GPSLocationListener) locationListener).setLongitudine(longitudine));Log.e(latitudine, * ((GPSLocationListener) locationListener).setLatitudine(latitudine));}String provider null;if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {provider LocationManager.GPS_PROVIDER;} elseif(locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {provider LocationManager.NETWORK_PROVIDER;}if(provider ! null) {locationManager.requestLocationUpdates(provider, 60000, 15, locationListener);}Criteria crit new Criteria();crit.setAccuracy(Criteria.ACCURACY_FINE);best locationManager.getBestProvider(crit, false);locationManager.requestLocationUpdates(best, 60000, 15, locationListener);Location loc locationManager.getLastKnownLocation(provider);locationListener.onLocationChanged(loc);}Overrideprotected boolean isRouteDisplayed() {return false;}Overrideprotected void onResume() {super.onResume();//locationManager.requestLocationUpdates(best, 10000, 1, locationListener);Toast.makeText(this, GPS tracking started,Toast.LENGTH_SHORT).show();// Start location updates; 5s/5mLocationManager locManager (LocationManager)getSystemService(Context.LOCATION_SERVICE);locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,60000, 15, locationListener);Criteria crit new Criteria();crit.setAccuracy(Criteria.ACCURACY_FINE);String provider locManager.getBestProvider(crit, true);Location loc locManager.getLastKnownLocation(provider);}Overrideprotected void onPause() {super.onPause();//locationManager.removeUpdates(locationListener);Toast.makeText(this, GPS tracking stopped,Toast.LENGTH_SHORT).show();LocationManager locManager (LocationManager)getSystemService(Context.LOCATION_SERVICE);locManager.removeUpdates(locationListener);}private class GPSLocationListener implements LocationListener{double longitudine;double latitudine;public double setLongitudine(double longitudine) {return this.longitudine longitudine;}public double setLatitudine(double latitudine) {return this.latitudine latitudine ;}public void onLocationChanged(Location location) {Toast.makeText(GPSLocatorActivity.this, Te plimbi,Toast.LENGTH_SHORT).show();if (location ! null) {Log.e(longitudine, *2 longitudine);Log.e(latitudine, *2 latitudine);GeoPoint pointStatie new GeoPoint((int) (latitudine * 1E6),(int) (longitudine * 1E6));GeoPoint point new GeoPoint((int) (location.getLatitude() * 1E6),(int) (location.getLongitude() * 1E6));// afisaza coordonatele/*Toast.makeText(getBaseContext(),Latitude: location.getLatitude() Longitude: location.getLongitude(),Toast.LENGTH_SHORT).show();*/mapController.animateTo(point);mapController.animateTo(pointStatie);mapController.setZoom(13);//mapView.invalidate();// add marker for people pointMapOverlay mapOverlay new MapOverlay();mapOverlay.setPointToDraw(point);mapOverlay.setPointToDraw(pointStatie);List listOfOverlays mapView.getOverlays();listOfOverlays.clear();listOfOverlays.add(mapOverlay);String address ConvertPointToLocation(point);Toast.makeText(getBaseContext(), address, Toast.LENGTH_SHORT).show();String addressStatie ConvertPointToLocation(pointStatie);Toast.makeText(getBaseContext(), addressStatie, Toast.LENGTH_SHORT).show();}}public String ConvertPointToLocation(GeoPoint point) {String address ;Geocoder geoCoder new Geocoder(getBaseContext(), Locale.getDefault());try {List addresses geoCoder.getFromLocation(point.getLatitudeE6() / 1E6,point.getLongitudeE6() / 1E6, 1);if (addresses.size() 0) {for (int index 0;index addresses.get(0).getMaxAddressLineIndex(); index)address addresses.get(0).getAddressLine(index) ;}}catch (IOException e) {e.printStackTrace();}return address;}class MapOverlay extends Overlay{private GeoPoint pointToDraw;public void setPointToDraw(GeoPoint point) {pointToDraw point;}public GeoPoint getPointToDraw() {return pointToDraw;}Overridepublic boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {super.draw(canvas, mapView, shadow);// convert point to pixelsPoint screenPts new Point();mapView.getProjection().toPixels(pointToDraw, screenPts);// add markerBitmap bmp BitmapFactory.decodeResource(getResources(), R.drawable.mark_red);canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);return true;}}public void onProviderDisabled(String provider) {}public void onProviderEnabled (String provider) {}public void onStatusChanged(String provider, int status, Bundle extras) {}}}
http://www.yutouwan.com/news/149419/

相关文章:

  • 网站建设规划书300字wordpress网站设计
  • 网站需要备案才能建设吗asp漂亮的办公家具公司网站源码
  • 生物医药基地网站建设重庆购物狂论坛
  • 纯静态网站做优化有什么影响绍兴住房和城乡建设厅网站
  • 企业网站上的二维码怎么获得宁化县建设局网站
  • 亚当学院网站视频建设教程视频模板在线制作网站
  • 网站外部外链建设全国免费发布信息网站大全
  • 网站制作知识济南地铁建设
  • 备案网站用户名是什么wordpress 首页 修改
  • 嵩明县住房和城乡建设局网站e时代网站制作
  • 外贸网站设计与推广无锡小程序开发工作室
  • 徐州市铜山新区建设局网站沈阳网站制作全过程
  • 网站集约化建设的建议数字营销公司排行榜
  • 男女做那个那个的视频网站wordpress php文件上传
  • 网站建设发帖论坛社区wordpress 默认字体
  • 百度关键词优化系统企业网站优化之如何做需求分析
  • 美食网站建设设计方案手机兼职项目
  • 网站须知网站更换备案
  • 盐城seo网站优化软件望城经开区建设开发公司门户网站
  • 自己怎么建个网站wordpress 解释符号
  • 厦门微信商城网站建设神马seo排名关键词点击
  • 滁州 来安县建设局网站网络服务公司
  • 微网站与微信网站网站建设项目进展情况汇报
  • 免费建站建设网站国外采购平台有哪些
  • 企业网站seo手机兰州网站建设cheng
  • 做外链网站装修公司走心文案
  • 本地化网站建设邹平建设局网站
  • 怎么样查看网站开发语言无锡高端网站建设公司哪家好
  • 织梦茶叶网站模板最火网页游戏
  • 辽阳建网站网络项目怎么推广