![](https://static.wixstatic.com/media/e5cb35_6c90bde769b042a185847406bc7551c3~mv2.jpg/v1/fill/w_800,h_575,al_c,q_85,enc_auto/e5cb35_6c90bde769b042a185847406bc7551c3~mv2.jpg)
The Adventures of Tintin remains a classic series which brings joy to readers who pick up the book for their first or umpteenth time. To celebrate this series, we decided to create a map which provides both a time and location-based illustration of Tintin’s global escapades.
![](https://static.wixstatic.com/media/e5cb35_96e499a44a354d63a4829a39cc5d4d33~mv2.png/v1/fill/w_980,h_519,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/e5cb35_96e499a44a354d63a4829a39cc5d4d33~mv2.png)
The map features a time slider so that you can follow Tintin’s chronological journey across the world. Amazing to see almost every populated continent covered — Tintin technically even makes it to the Australian continent, though this is is not explicitly shown in the book (Flight 714 to Sydney). While there were many Tintin adventures which took place in Brussels, we gave a special shoutout to Marlinspike Hall (Moulinsart) in its first appearance (The Secret of the Unicorn).
Creating the App:
The process of creating the map involved two main components: the React components and the styling.
React Components:
We built the map with React and Visgl’s react-map-gl package, before adding the slider, side bar, and popup features. Data points were compiled in a csv file, before being converted to JSON format. For this, we used Mapbox’s csv2geojson package, allowing for an easy conversion. We imported the data directly from the JSON file, before being loaded as a component with the ComponentDidMount() method:
![](https://static.wixstatic.com/media/e5cb35_ab5389471d064711a600f9ad42ef6ded~mv2.png/v1/fill/w_668,h_78,al_c,q_85,enc_auto/e5cb35_ab5389471d064711a600f9ad42ef6ded~mv2.png)
![](https://static.wixstatic.com/media/e5cb35_262208ec17cb4bbb88cb0f4e493981b1~mv2.png/v1/fill/w_418,h_210,al_c,q_85,enc_auto/e5cb35_262208ec17cb4bbb88cb0f4e493981b1~mv2.png)
The data is filtered based on the value of the slider. A change in this value alters the state variable selectedYear, which in gturn invokes the filterYear function. For example, if the slider value is changed to 1949, the selectedYear variable will be set to 1949, and the filterYear function will filter the data from 1930 to 1949 (inclusive).
![](https://static.wixstatic.com/media/e5cb35_adcc1073833e4d6a94b654ab66de4dc9~mv2.png/v1/fill/w_980,h_296,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/e5cb35_adcc1073833e4d6a94b654ab66de4dc9~mv2.png)
Our data points are displayed using the react-map-gl Marker component and a generic Font Awesome icon. We loop over our data and return a marker for each lat/long value.
![](https://static.wixstatic.com/media/e5cb35_98a5d86fd31a44c492a769ab9cfc5dc6~mv2.png/v1/fill/w_976,h_656,al_c,q_90,enc_auto/e5cb35_98a5d86fd31a44c492a769ab9cfc5dc6~mv2.png)
When the user clicks on a specific marker, the selectedLocation state variable is set to the new location, allowing the popup to appear — this displays the book’s French cover, along with its release year and the marker location. The react-map-gl package contains a Popup component, which simplifies this process. When our state variable selectedLocation is not null, it will show the popup; clicking anywhere aside from the popup and markers will change the state of selectedLocation back to null.
![](https://static.wixstatic.com/media/e5cb35_3c0ac3c4eacd4a19886a57fa05fcfd06~mv2.png/v1/fill/w_980,h_465,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/e5cb35_3c0ac3c4eacd4a19886a57fa05fcfd06~mv2.png)
Style:
The first step was to create a palette representative of Tintin. We made sure to shout out Hergé’s classic Tintin shirt by giving all bodies of water a characteristically light blue color. Meanwhile, the distinctive orange hue that represents the low lying regions of the world is a shoutout to Tintin’s hair — you’ll also notice that color as a background to Hergé’s name on the title of Le Temple Du Soleil. The markers show the color of Captain Haddock’s characteristic dark blue sweater.
![](https://static.wixstatic.com/media/e5cb35_65330c171b45459b9aa350f99ee21104~mv2.jpg/v1/fill/w_980,h_550,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/e5cb35_65330c171b45459b9aa350f99ee21104~mv2.jpg)
The popups are styled with some simple CSS formatting. We decided to give the .side-bar and .popup an opacity of .95 so that the basemap can always be showing to a degree. We also decided to keep the Tintin covers at a fixed 20% of the screen, so that they remain prominent whether you’re at Zoom 1 or Zoom 20.
![](https://static.wixstatic.com/media/e5cb35_5a44eefb259d4790bc8b35c2f084522a~mv2.png/v1/fill/w_472,h_608,al_c,q_85,enc_auto/e5cb35_5a44eefb259d4790bc8b35c2f084522a~mv2.png)
This was a fun map to build, and opened the door to a world of possibilities and use cases for using a time slider to illustrate an amazing journey over the years. We hope Tintin enthusiasts find this map to be a visual, refreshing reminder of the joy Tintin and Snowy (Milou) have brought us all.
Github Link: https://github.com/stefangouyet/tintin_map
Map Link: http://tintin-map.uc.r.appspot.com/
This post was originally published on Medium on August 6, 2020.
Commentaires