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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:56:32+00:00 2026-05-24T04:56:32+00:00

I have this code into the – (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context method (into a MKOverlayView

  • 0

I have this code into the - (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context method (into a MKOverlayView subclass) to prevent drawing segments that are less than 10 pixels long on a map overlay :

            CGPoint origin = [self pointForMapPoint:poly.points[0]];
            CGPoint lastPoint = origin;

            CGContextMoveToPoint(context, origin.x, origin.y);

            for (int i=1; i<poly.pointCount; i++) {
                CGPoint point = [self pointForMapPoint:poly.points[i]];

                CGFloat xDist = (point.x - lastPoint.x);
                CGFloat yDist = (point.y - lastPoint.y);
                CGFloat distance = sqrt((xDist * xDist) + (yDist * yDist)) * zoomScale;

                if (distance >= 10.0) {
                    lastPoint = point;
                    CGContextAddLineToPoint(context, point.x, point.y);
                }
            }

will the test >= 10.0 will take care about the screen resolution, or may I introduce some [UIScreen mainScreen].scale parameter ?

  • 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-24T04:56:33+00:00Added an answer on May 24, 2026 at 4:56 am

    I believe that test >= 10.0 does not take into account the screen resolution. Apple does most of their drawing arithmetic using “points” instead of pixels- that way code does not have to change for a retina display compared to a normal display.

    If you want to draw something just 10.0 pixels wide, you will need to take into account the screen resolution; however, if you do this you’ll have to write the method to support both retina display and normal display.

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

Sidebar

Related Questions

I have this code to register dlls into my gac Assembly asm = Assembly.LoadFrom(argument);
I have this code: myVariable which I want to change into trace(myVariable: + myVariable);
I have this code that performs an ajax call and loads the results into
I have the following code in Ruby. I want to convert this code into
I have this small code library that I'm considering releasing into Open Source. I
When performing many inserts into a database I would usually have code like this:
Is there a way to automatically insert code into a method? I have the
I have this code to split a string into groups of 3 bytes: str=hello
I have this code I'm using to generate a list of records categorized into
i have this code to open the messaging. i wanna add body text into

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.