Tutorial 8 — Default Tile

Adding a gray grid to show the user when tiles are loading

In Tutorial 7 we added a new tile provider to access MapBox LandSat tiles. The one minor problem with that app is the fact that it does not let the user know where the app is loading tiles. In this tutorial we will add a gray grid that solves this problem.

Step 1

Let's first bring in the code for this tutorial and run it to see what this new app can do. If you have been working through all of the tutorials, type:

git checkout tutorial8

Run the app. It is identical to Tutorial 7, except for this: as tiles are loading, you will see a gray grid that displays wherever the mapping engine is waiting for tiles.

Step 2

Where does the gray grid come from? If you look in the project's Images folder in Xcode, there are two files named grayGrid.png and [email protected]. The second one handles Retina displays. These are standard PNG files — you could put anything here that you like in place of the gray grid.

Step 3

Now there are three lines of code that reference this image.

1) In MEInternetMaps.m, look for this line:

2) In the requestTile method of MEInternetTileProvider.m, search for this code:

3) In the initializeMappingEngine method ViewController.m, look for:

You can learn more about the Altus Mapping Engine classes used in this tutorial in the Documentation. If you have any questions about the Altus Mapping Engine, any feature requests or suggestions for improving the Altus Mapping Engine, please send them to [email protected].