Search in sources :

Example 1 with MapView

use of com.amap.api.maps.MapView in project YourEyes by SevenLJY.

the class MapActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);
    img_toNavi = (RoundImageView) findViewById(R.id.img_toNavi);
    img_toHelp = (RoundImageView) findViewById(R.id.img_toHelp);
    //初始化传感器
    sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    //初始化地图对象
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    //初始化AMap对象
    init();
    /**
         * 给定位图标添加点击事件
         * 点击后简单的跳转到输入目的地界面
         * */
    img_toNavi.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MapActivity.this, PoiSearchActivity.class);
            startActivity(intent);
        }
    });
    img_toHelp.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MapActivity.this, MenuActivity.class);
            startActivity(intent);
        }
    });
}
Also used : Intent(android.content.Intent) MapView(com.amap.api.maps.MapView) View(android.view.View) RoundImageView(com.example.menfer.byoureyes.NewViews.RoundImageView)

Aggregations

Intent (android.content.Intent)1 View (android.view.View)1 MapView (com.amap.api.maps.MapView)1 RoundImageView (com.example.menfer.byoureyes.NewViews.RoundImageView)1