Add features at certain scales to Android App

2897
1
08-06-2014 05:57 PM
christopherbeattie
New Contributor

Hi,

 

I have designed an application to collect the location of bamboo species. However, I want to ensure that users are at the appropriate scale before adding points. I wanted to check the scale before allowing the menu to select features to be created:

 

 

@Override

  public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu items for use in the action bar

              if (mMapView.getScale()<25) {

              Toast.makeText(getApplicationContext(),

                  "Please zoom in to Add Bamboo Features",Toast.LENGTH_LONG).show();

              }

              else mMapView.getScale();

              MenuInflater inflater = getMenuInflater();

              inflater.inflate(R.menu.actions, menu);

              mOptionsMenu = menu;

              updateActionBar();

        

              return super.onCreateOptionsMenu(menu);

      }

 

Cheers.

Tags (3)
0 Kudos
1 Reply
WillCrick
Occasional Contributor

Can you describe the actual problem you are experiencing here? Is the scale not being reported properly or is something else not working as expected?

0 Kudos