私は本当にこの上で立ち往生していますに経度/緯度の存在を計算する方法:現在のビュー
私はAndroidアプリでGoogleマップ上に描画するための経度/緯度ポイントを持っています。 そのため私は介してビューの現在の経度/緯度の部分を取得...
オーバーレイを拡張するクラスを作成した:
GeoPoint topLeft = proj.fromPixels(0, 0);
GeoPoint bottomRight = proj.fromPixels(width-1, height-1);
int topLat = topLeft.getLatitudeE6();
int topLon = topLeft.getLongitudeE6();
int bottomLat = bottomRight.getLatitudeE6();
int bottomLon = bottomRight.getLongitudeE6();
次の作品(のみ緯度):
if(latLon[0] >= bottomLat && latLon[0] <= topLat){ // do something; }
をけれどもこれは機能しません(経度):
if(latLon[1] >= topLon && latLon[1] <= bottomLon) { // do something; }
latLon [0]はl atitude私はチェックしたい latLon [1]は確認したい経度です
誰かアイデア?
Greetz!
@ n3bul4したがって、あなたのtopLon、または最大経度、またはほとんどの東経は画面の右側にあります。左には書いたとおりではありません。 – NickT