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 7888621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:52:43+00:00 2026-06-03T05:52:43+00:00

Following the Google Tile Wrapper example, I have implemented a google MapView with an

  • 0

Following the Google Tile Wrapper example, I have implemented a google MapView with an osmdroid GoogleTilesOverlay.

    com.google.android.maps.MapView googleMapView;
    org.osmdroid.google.wrapper.MapView osmdMapView;
    org.osmdroid.google.overlay.GoogleTilesOverlay tiles;

    final MapView googleMapView = (com.google.android.maps.MapView.MapView) findViewById(R.id.plan_mapview);
    osmdMapView = new org.osmdroid.google.wrapper.MapView(gMapView);

    // snip Provider instantiation etc.

   overlayTiles = new GoogleTilesOverlay(provider, getApplicationContext());
   gMapView.getOverlays().add(overlayTiles);

At rest, the overlay tiles render fine however when zooming (pinch or via the controls) the underlying google tiles resize and are replaced smoothly however the osmd overlays aren’t resizing.

The result: when zooming in the tiles that remain in view begin to overlap. Conversely when zooming out a gap becomes visible between each tile.

It looks to me like the first step is to sub-class GoogleTilesOverlay so that I can modify the draw() method. But then what?

I’ve googled hard and found a few pointers towards:
a) short-circuiting out of the draw() method when in the middle of an animation
b) using the Projector / Matrix classes to determine how to scale the overlay on the fly

Unfortunately I’m not an expert on the Android APIs so not sure which way to go… and then how to best implement a solution.

  • 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-06-03T05:52:44+00:00Added an answer on June 3, 2026 at 5:52 am

    You need to do a slight modification on the draw method in GoogleTilesOverlay.

    As it is draws a rectangle of a constant size (x,y,x+tileSizePx,y+tileSizePx).

    Easy and rudimentary way to do it, just get two tiles (x,y and x+1,y+1) and Subtract the difference in pixels.

    Look below code:

                    final GeoPoint geoPointUL = new GeoPoint(
                            (int) (Mercator.tile2lat(y, zoomLevel) * 1E6),
                            (int) (Mercator.tile2lon(x, zoomLevel) * 1E6));                    
    
                    final GeoPoint geoPointLR = new GeoPoint(
                            (int) (Mercator.tile2lat(y+1, zoomLevel) * 1E6),
                            (int) (Mercator.tile2lon(x+1, zoomLevel) * 1E6));
    
                    Point pointUL=new Point(), pointLR=new Point();
                    pj.toPixels(geoPointUL, pointUL);
                    pj.toPixels(geoPointLR, pointLR);
                    tileSizePx = pointLR.x - pointUL.x;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application, i have following uses of google maps List
I have the following google chart code that im working with as an example:
My goal is to understand every single bit of the following example: http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager I
all I have downloaded source code from google android website following google's guide. My
I'm using the google maps API with openstreetmap (see the following example code), I'd
I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but
Let's say I have the following code in Google App Engine: from urllib import
I'm trying the following code http://code.google.com/apis/ajax/playground/#change_the_playing_video It works well when runned from the playground
I have written the following: var pages=[[www.google.co.uk] This is the WWW. ,[www.yahoo.co.uk] This is
I made a test a program which uses Google maps following a tutorial. I

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.