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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:20:54+00:00 2026-06-14T19:20:54+00:00

I’m working on a simple Android app for plotting routes on a map. All

  • 0

I’m working on a simple Android app for plotting routes on a map. All is going well, but I have an issue when zooming in on my Samsung Galaxy S2. It works fine on a Galaxy S3, so I’m wondering whether it’s related to memory management on the lower specced device. It also works fine on the emulator.

Here is equivalent code located in the overlays onDraw method, just condensed for posting here:

Point current = new Point();
Path path = new Path();
Projection projection = mapView.getProjection();

Iterator<GeoPoint> iterator = pointList.iterator();
if (iterator.hasNext()) {
    projection.toPixels(iterator.next(), current);
    path.moveTo((float) current.x, (float) current.y);
} else return path;
while(iterator.hasNext()) {
    projection.toPixels(iterator.next(), current);
    path.lineTo((float) current.x, (float) current.y);
}

Paint roadPaint = new Paint();
roadPaint.setAntiAlias(true);
roadPaint.setStrokeWidth(8.0f);
roadPaint.setColor(Color.BLACK);
roadPaint.setStyle(Paint.Style.STROKE);

canvas.drawPath(path, roadPaint);

It’s not too dissimilar to most of the sample code floating around for doing this. I’m just wondering if anyone can confirm my suspicions and advise if there is anything I can do in terms of configuration or tweaks that I can do to force drawing at all zoom levels?

Thanks in advance.

Cheers,
Nathan

  • 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-14T19:20:55+00:00Added an answer on June 14, 2026 at 7:20 pm

    You said that code above was an equivalent (not the real code you are running) and that’s clear because you are returning a Path object in a onDraw() which you couldn’t.

    The “compressed form” of code you show should work as well as using the drawLine(). So the problem should come from something else (may the original code).

    Anyway, I’ll give you a couple of hints:

    • When the top and bottom of object you are drawing to a canvas are both out of screen, the object is ignored and not drawn. Check if this is not whats happening with your path. See my answer in this post Android Map Overlay Disappears on Zoom
    • You don’t need to rebuild the path object every time. You are probably already doing it, and that’s why you made the short version above. See my answer in this post with some suggestions to improve path drawing: Overlay behavior when zooming
    • If for some reason you really want to use the slower approach of drawLine(), you can use the follwing to make the line look better:

      paint = new Paint();
      paint.setStyle(Paint.Style.STROKE);
      paint.setStrokeJoin(Paint.Join.ROUND);
      paint.setStrokeCap(Paint.Cap.ROUND);
      paint.setColor(...);
      paint.setAlpha(...);
      paint.setStrokeWidth(...);
      

    Finally, if the issue remains, update your question with more relevant code and let me know. Maybe I can help further.

    Regards.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I have a text area in my form which accepts all possible characters from
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

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.