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

  • Home
  • SEARCH
  • 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 7023279
In Process

The Archive Base Latest Questions

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

I already checked this answer , but the example does nothing else than show

  • 0

I already checked this answer, but the example does nothing else than show gray tiles (I’m in offline mode) for zoom level greater than the limit I give (4 in my case)…

OnlineTileSourceBase source = new XYTileSource("tiles", ResourceProxy.string.offline_mode, 0, 4, 256, ".png", "");

The following code shows maxZoom=4:

int zoomLevel = source.getMaximumZoomLevel();
Toast.makeText(this, "maxZoom=" + zoomLevel, Toast.LENGTH_SHORT).show();

For zoom levels between 0 and 4 my code works as expected: it loads map tiles from the SD card. My understanding of the problem is that the code shows all the tiles for each zoom it finds and when no other zooms are found it still zooms in.

The API clearly specifies setting the max zoom level in the constructor of XYTileSource (final int aZoomMaxLevel):

public XYTileSource(final String aName, final string aResourceId, final int aZoomMinLevel,
                        final int aZoomMaxLevel, final int aTileSizePixels, final String aImageFilenameEnding,
                        final String... aBaseUrl)

Any workarounds? What am I doing wrong? How can I block the zoom so that the user can’t go beyond level 4?

  • 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:41:27+00:00Added an answer on May 27, 2026 at 11:41 pm

    We found a workaround to set the maximum zoomlevel globally for the whole application.You have to change the value to your desired level in the file OpenStreetMapTileProviderConstants in the package org.osmdroid.tileprovider.constants in the osmdroid-android project. It´s not the proper way, but works quite fine for us! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I checked this post already. But it doesn't answer my question. I want to
I've already checked this.. similar question but I am not convinced about the answers...
Sorry if this question has already been answered but I can't find an answer.
I already know the obvious answer to this question: just download <insert favorite windows
I already asked this question at the JOS-.NET board but Joel is closing that
I'm sure this has already been done, but Google isn't helping me - I'm
I know there's already tons of similar questions, but I checked over twenty answers
Several related questions already exist on this site and elsewhere, but none of the
Introduction: I asked this question on the P2-forum already but I couldnt get any
I have this piece of Javascript and it just won't work. I allready checked

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.