MkMapView cancel loading google tiles

后端 未结 3 1438
情深已故
情深已故 2020-12-21 04:16

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

3条回答
  •  醉酒成梦
    2020-12-21 04:28

    I encountered a related problem but in my case my overlay didn't cover all the google tiles. If anyone has this problem, and is trying to stop loading the google tiles, I managed to superimpose one gray tile(256x256) overlay over the google map tiles. To do this, the top level tile must be /FakeTiles/1/1/0.png and add this directory to resources to project. (N.B. don't drag this into project > Add files > Folders > Create folder references for any folders)

    //hack to overlay grey tiles
    NSString *fakeTileDirectory = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"FakeTiles"];
    TileOverlay *greyOverlay = [[TileOverlay alloc] initWithTileDirectory:fakeTileDirectory];
    [mapView addOverlay:greyOverlay];
    [greyOverlay release];
    

    then add your custom tile overlay.

    Then you need this code to scale the grey tile Calculating tiles to display in a MapRect when "over-zoomed" beyond the overlay tile set

提交回复
热议问题