Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.skobbler.sdkdemo.activity;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.Menu;
- import android.view.MenuItem;
- import com.skobbler.ngx.map.SKMapSurfaceView;
- import com.skobbler.ngx.map.SKMapViewHolder;
- import com.skobbler.sdkdemo.R;
- public class NewMapActivity extends Activity
- {
- private SKMapSurfaceView mapView;
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_new_map2);
- SKMapViewHolder mapViewGroup = (SKMapViewHolder) findViewById(R.id.view_group_map);
- mapView = mapViewGroup.getMapSurfaceView();
- applySettingsOnMapView();
- }
- @Override
- protected void onPause() {
- super.onPause();
- mapView.onPause();
- }
- @Override
- protected void onResume() {
- super.onResume();
- mapView.onResume();
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu)
- {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.menu_new_map, menu);
- return true;
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item)
- {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings)
- {
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
- private void applySettingsOnMapView()
- {
- mapView.getMapSettings().setMapRotationEnabled(true);
- mapView.getMapSettings().setMapZoomingEnabled(true);
- mapView.getMapSettings().setMapPanningEnabled(true);
- mapView.getMapSettings().setZoomWithAnchorEnabled(true);
- mapView.getMapSettings().setInertiaRotatingEnabled(true);
- mapView.getMapSettings().setInertiaZoomingEnabled(true);
- mapView.getMapSettings().setInertiaPanningEnabled(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement