World map coding challenge (iOS)

The goal of this coding challenge is to build a world map that can be scrolled and zoomed into by the user. Here’s a video that shows how the end result might look like:

Requirements

  • Draw a world map using vector data from this JSON file: countries_small.geojson
  • Make sure the user can scroll the map by panning vertically or horizontally (see video)
  • Make sure the user can zoom in by pinching the screen (see video)
  • The solution should run on iPhone 6 on iOS 9.

Extra kudos if you make it perform well outside the iOS simulator (e.g. on slower iOS devices).

How to draw the vector data

The JSON file is in the GeoJSON format, it contains data about countries and their geometry. The file for this coding challenge contains arrays of Polygons and MultiPolygons that should be used for drawing. Coordinates of the vector points range roughly from -20.000.000 to +20.000.000, so you may have to rescale the values to fit on screen.

Please don’t use any third-party frameworks or libraries for this that are not available by default on iOS 9.

Example GeoJSON File:

 { "type": "FeatureCollection",
    "features": [
      { "type": "Feature",
         "geometry": {
           "type": "Polygon",
           "coordinates": [
             [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
               [100.0, 1.0], [100.0, 0.0] ]
             ]
...

(Each “feature” represents a country, and the “coordinates” property in the above example shows the list of x and y coordinates of the country’s polygons to be drawn to create the world map. More information about the GeoJSON format and its specification here: http://geojson.org/ )

For this coding challenge, only Polygons and MultiPolygons (which is a collection of Polygons for larger countries) are used.

Further information

It’s best for us if you send your solution as a .zip file with an Xcode project or workspace that we can build right away. You may also put it on your GitHub account and send us a link.

Good luck, and be sure to send us even a partial solution rather than nothing at all! We’ll send back to you a complete solution for the problem in any case.

Please send your solution to christian@journiapp.com.

This entry was posted in Uncategorized. Bookmark the permalink.