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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:14:18+00:00 2026-05-27T06:14:18+00:00

I have a view that I am using as an overlay on a MKMapView

  • 0

I have a view that I am using as an overlay on a MKMapView (it uses OpenGL to draw). For the drawing to be performed correctly, the frame of the glView needs to be exactly the same as the frame of the mapView. I also cannot have the view just be on top of the map, because I want other annotations and overlays to be on top of it.

The way I have tried to do it is to create an MKOverlayView that’s boundingMapRect = MKMapRectWorld. I then add the glView as a subview to the overlayView and manually set the glView.frame = mapView.frame. The problem is that the frame of the glView is using a different coordinate system than the mapView is.

The mapView’s frame is in the coordinates that you would expect for a standard view (something like 0,0,320,250). The glView’s frame seems to be using MKMapPoints as its coordinate base.

So my idea was to do something like this in my MKOverlayView subclass…

glView.frame = [self rectForMapRect:[mapView visibleMapRect]];

This gives me a rect in the correct coordinates (something like 61612032.000000, 105586688.000000, 5275648.000000, 5685248.000000), but it is not perfectly alligned with the map. The y-direction is off and the zoom is sometimes wrong as well.

So my question would be this.

  1. Is there a way to just set the frame of MKOverlayView (or one of its subviews) using normal screen coordinates?
  2. Or is there another way that I could achieve the same thing that I am just missing?
  • 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-27T06:14:19+00:00Added an answer on May 27, 2026 at 6:14 am

    You can convert cgpoint into mkmappoint by using the mkoverlay method
    - (MKMapPoint)mapPointForPoint:(CGPoint)point

    I hope it helps you

    SOURCE: http://developer.apple.com/library/ios/documentation/MapKit/Reference/MKOverlayView_class/Reference/Reference.html#//apple_ref/occ/instm/MKOverlayView/mapPointForPoint:

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

Sidebar

Related Questions

I have a view using a master page that contains some javascript that needs
I'm using MVC2 with VS2010 I have a view that has two partial views
I am using a webview and on that web view i have a image.
I have an SSIS package that queries data from a view using an SQL
Why is using '*' to build a view bad ? Suppose that you have
I have an application, built using MVC, that produces a view which delivers summary
I have a view that I want to add some custom drawing to. I
I have an edit form that I'm displaying as an overlay using Jquery Tools.
I have a View that contains a usercontrol. The usercontrol is rendered using: <%
I have a UIView that contains a drawing that I've made using CALayers added

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.