Following Mexico’s Journey in the 2018 FIFA World Cup using Mapbox

Riding the waves of this year’s World Cup, Mapbox setup an online competition to showcase our favorite team’s story using maps. Having used Mapbox to build a few interactive maps for work, I thought this would be a great opportunity to let loose and build something different.

I started off building a style for the map using Cartogram, an amazing tool by Mapbox that pulls color schemes from images to create custom map styles in seconds. Crazy right?

From there I took my new Mapbox style into Studio and refined the theme to better fit the data that I would be displaying. After a few rounds, some additional data layers (bathymetry, country/sovereign polygons, and names), and a lot of hex code pushing, I polished off the design of the map and got it setup into my html document.

For this project I wanted to create a slideshow of Mexico’s matches using a dual map setup so users could quickly go through each match and see a side-by-side comparison of each team’s geographic location. Using Foundation Sites to build the framework of the site, in combination with Luke Haas Scrollify jQuery plugin, I was able to choreograph the slides and scrolling of the site’s content with the map using a switch to turn on-and-off the different map layers as well as positions. Using this in sync with Scrollify’s $ $.scrollify.previous() functions I was able to combine each slide with it’s corresponding home and away countries.

Here’s the init script for Scrollify and Mapbox:

After finalizing the content and the choreography, I optimized the layout I originally built to work responsively on mobile and desktop. Try resizing the browser and you’ll see the the map switch from a horizontal split to a vertical split.

You can also click on the vector maps of each country for an example of Mapbox’s flyTo({}) function.

First slide and dual map layout on tablets. Shoutout to Rishad Amarkhel for creating this cool FIFA 2018 World Map Cup graphic!
Knockout Match between Brazil and Mexico on Mobile.
Wide screen view of Match Two, Mexico vs South Korea.

Check out the live site at

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store