私の他のすべてのプロジェクトでは、任意の MapView オブジェクトで getProjection() を呼び出すことができます。このプロジェクトは何らかの理由で異なります...Googleマップに新しいAPIv2を使用しているためですか? 何か案は?
package com.example.proximitystuff;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.Projection;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.maps.MapActivity;
import android.app.Activity;
import android.app.Fragment;
import android.graphics.Point;
import android.os.Bundle;
import android.view.MotionEvent;
public class MyMapActivity extends MapActivity {
private MapView map =null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_map);
MapView map = (MapView)findViewById(R.id.map);
//this line of code wont work... says projection cannot be resolved or is not a field
Projection projection= map.getProjection;
}
@Override
public boolean onTouchEvent(MotionEvent event){
int x = (int)event.getX();
int y = (int)event.getY();
Point p = new Point(x, y);
switch (event.getAction()){
case MotionEvent.ACTION_DOWN: //todo
case MotionEvent.ACTION_MOVE: //todo
case MotionEvent.ACTION_UP: //todo
}
return false;
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}