GPS

PowenKo, Android Tutorial 84-3, GPS, get mapView lat and long on the pixel point.

November 18, 2011   ·   0 Comments

//取得實際螢幕的寬高 來換算經緯度
	int width = display.getWidth();
	int height = display.getHeight();

GeoPoint t_lefttop=mapView.getProjection().fromPixels(0,0);
GeoPoint t_rightdown=mapView.getProjection().fromPixels(width,height);
double t_lefttop_long=t_lefttop.getLongitudeE6()/1E6;
double t_lefttop_lat=t_lefttop.getLatitudeE6()/1E6;
double t_rightdown_long=t_rightdown.getLongitudeE6()/1E6;
double t_rightdown_lat=t_rightdown.getLatitudeE6()/1E6;
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon