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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:26:44+00:00 2026-06-04T05:26:44+00:00

I have a case where I need to import an overlay map in top

  • 0

I have a case where I need to import an overlay map in top of MkMapView.
The overlay totally covers the google tiles below so there is no need loading, plus it adds overhead to the app.

Is there a way to tell mkMapView to stop loading tiles?

  • 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-04T05:26:45+00:00Added an answer on June 4, 2026 at 5:26 am

    Actually there are 2 ways to implement the real “Hide Google tiles” method (johndope solution only puts an overlay on top of it but doesn’t prevent the tiles from loading).

    Beware that option one described below might get your application rejected while option 2 will not but is a bit more complex.

    Common Part: Retrieve the MKMapTileView object

    Inside each MKMapView lies an undocumented class of type: MKMapTileView. Retrieving it is NOT a reason for rejection. In this code the MKMapView instance will be called mapView

    UIView* scrollview = [[[[mapView subviews] objectAtIndex:0] subviews] objectAtIndex:0];
    UIView* mkTiles = [[scrollview subviews] objectAtIndex:0]; // <- MKMapTileView instance
    

    Option 1: Undocumented Method (!! can be a reason for rejection !! )

    if ( [mkTiles respondsToSelector:@selector(setDrawingEnabled:)])
        [mkTiles performSelector:@selector(setDrawingEnabled:) withObject:(id)NO];
    

    This will prevent the undocumented method setDrawingEnabled to be called on the MKMapTileView instance.

    Option 2: Method Swizzling

    Outside of your controller implementation you will write someting like:

    // Import runtime.h to unleash the power of objective C 
    #import <objc/runtime.h>
    
    // this will hold the old drawLayer:inContext: implementation
    static void (*_origDrawLayerInContext)(id, SEL, CALayer*, CGContextRef);
    
    // this will override the drawLayer:inContext: method
    static void OverrideDrawLayerInContext(UIView *self, SEL _cmd, CALayer *layer, CGContextRef context)
    {
        // uncommenting this next line will still perform the old behavior
        //_origDrawLayerInContext(self, _cmd, layer, context);
    
        // change colors if needed so that you don't have a black background
        layer.backgroundColor = RGB(35, 160, 211).CGColor;
    
        CGContextSetRGBFillColor(context, 35/255.0f, 160/255.0f, 211/255.0f, 1.0f);
        CGContextFillRect(context, layer.bounds);
    }
    

    And somewhere in your code (once your map view is loaded!) :

    // Retrieve original method object
    Method  origMethod = class_getInstanceMethod([mkTiles class], 
                                                 @selector(drawLayer:inContext:));
    
    // from this method, retrieve its implementation (actual work done)
    _origDrawLayerInContext = (void *)method_getImplementation(origMethod);
    
    // override this method with the one you created    
    if(!class_addMethod([mkTiles class],
                        @selector(drawLayer:inContext:), 
                        (IMP)OverrideDrawLayerInContext,
                        method_getTypeEncoding(origMethod)))
    {
        method_setImplementation(origMethod, (IMP)OverrideDrawLayerInContext);
    }
    

    Hope this helps anyone, this code was originally described in this blog post.

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

Sidebar

Related Questions

I have a case where I need to select a random item, but I
I have a case where I need to load bitmap from a resource dll
I have a case where I need to update a jqgrid based on some
I have a use case where I need to call a (non-static) method in
I have a use case where I only need to store certain fields to
I have a complicated problem, and I need help. I have a base case,
I have a strong use case for pre-allocating all the memory I need upfront
I have put my problem case below, which simplifies a real world problem I
I have this case <WrapPanel> <CheckBox>Really long name</CheckBox> <CheckBox>Short</CheckBox> <CheckBox>Longer again</CheckBox> <CheckBox>Foo</CheckBox> <Slider MinWidth=200
I have a case where i want to submit a form and get the

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.