Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7024581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:51:33+00:00 2026-05-27T23:51:33+00:00

I have been working on an offline map using OSMdroid I have map tiles

  • 0

I have been working on an offline map using OSMdroid

I have map tiles of two zoom levels namely 12 and 15

Now the usual double tap zooms the mapview by 1 level

What i m trying to do is to setZoomLevel() as 15 after the user double taps on the map,

Is it possible?

I tried using onGestureListener , but somehow it is not working

Any hint or clues in that direction or sample codes would be a big help , Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:51:33+00:00Added an answer on May 27, 2026 at 11:51 pm

    I had a similar requirement with the Osmdroid MapView, in that I didn’t want it to do the ‘centre on the double tapped location and zoom in’ default functionality. I wanted it to pop up a Toast. In my case I had an overlay on top of the MapView, so I just had the overlay consume the double tap in its onDoubleTap method. For your purposes you could just add an overlay which draws nothing but has its own double tap functionality.

    So at the end of your onCreate, you could add the overlay. This little app seems to demonstrate what you want – (you’ll need to add conditional code for checking zoom level and other tinkering):

    public class OsmdroidDemoMap extends Activity {
    
        private MapView         mMapView;
        private MapController   mMapController;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.osm_main);
            mMapView = (MapView) findViewById(R.id.mapview);
            mMapView.setTileSource(TileSourceFactory.MAPNIK);
            mMapView.setBuiltInZoomControls(true);
            mMapController = mMapView.getController();
            mMapController.setZoom(13);
            GeoPoint gPt = new GeoPoint(51500000, -150000);
            mMapController.setCenter(gPt);
            DummyOverlay dumOverlay = new DummyOverlay(this);
            List<Overlay> listOfOverlays = mMapView.getOverlays();
            listOfOverlays.clear();
            listOfOverlays.add(dumOverlay);
        }
    
        public class DummyOverlay extends org.osmdroid.views.overlay.Overlay {
    
            public DummyOverlay(Context ctx) {
                super(ctx); // TODO Auto-generated constructor stub
            }
    
            @Override
            protected void draw(Canvas c, MapView osmv, boolean shadow) {}
    
            @Override
            public boolean onDoubleTap(MotionEvent e, MapView mapView) {
                // This stops the 'jump to, and zoom in' of the default behaviour
                int zoomLevel = mMapView.getZoomLevel();
                mMapController.setZoom(zoomLevel + 3);
                return true;// This stops the double tap being passed on to the mapview
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working as a native C++ programmer for last few years. Now
I have been working on a website using MVC Preview 1 since it came
I have been working on a Notes integration project and I am using the
I have been working offline for a couple of days so I didn't have
I have been working on an application in Xcode for a while now and
I have been working in Python for a few months now, and it has
I have been working with the slider and am using the following code: $(function(){
I have been working on winforms using C# in my company for quite a
I have been working with android for a little while now and feel pretty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.