A map trivia game in memory of Alex Trebek

Guest

No items found.

Guest

November 19, 2020

A map trivia game in memory of Alex Trebek

Guest

No items found.

Guest

November 19, 2020

Test your geography knowledge with a fun game to identify the countries of the world

In honor of Alex Trebek and to celebrate Geography Awareness Week, we created a fun map trivia game for everyone to test their global geography knowledge. 

Mapbox map trivia game

At Mapbox, we echo Alex Trebek’s passion for geography and believe that when maps are fun and informative, they can transform our perspective of a topic. We hope that our digital reimagination of a country quiz is fun for all. And that the key facts and flags we show for each sovereign state and territory from the open database of human knowledge - Wikidata - can make the world feel smaller and more connected, just like Alex predicted. 

“The world is intertwined, and it’s getting smaller and smaller and smaller. Right now, the world is about the size of a cellular telephone.”

— Alex Trebek

Read on to learn how we built this, try our quiz, and tweet us @Mapbox with your scores!

How we built this

The map trivia game leverages various Mapbox tilesets, Mapbox APIs and open datasets to deliver a highly interactive web map experience.

Mapbox Studio & tilesets

Mapbox Countries for country outlines: The high resolution country polygons from the Mapbox Countries tileset is used to create outlines for every country of interest. During every trivia round, a GL expression using the target ISO 3166-1 code is applied to selectively mask the basemap for the country of interest.

The detected country location of the user is used to automatically set the worldview filters on the Mapbox Countries tileset at runtime to ensure an appropriate depiction of international boundaries for disputed areas.

Mapbox Satellite for basemap: The vibrant Mapbox Satellite basemap is used as the background to emphasize the unique geographic landforms that define every country.

Mapbox Streets for overlay labels: Mapbox Studio style components were used to quickly add overlay labels for places, natural features and points of interest to provide the user with additional context for the selected country from the Mapbox Streets tileset. During every trivia round, a GL expression using the target ISO 3166-1 code is applied at runtime to these layers and the detected user language is used to set the language used for the map labels.

Mapbox GL-JS + open source tools

Map and interface localization: Every visitor is instantly geolocated using their IP address via the FreeGeoIP API to detect their country of origin. This information along with the language settings detected from the user’s browser using the `navigator.language` variable is used to customize disputed boundaries and language used for the quiz and the map.

Frontend: The user interface is coded with Svelte, an open source JavaScript framework to create reactive web applications. Svelte allows us to easily manage the connections between the dynamic Mapbox GL-JS map, various html interface elements of the quiz and backend requests to Wikidata to deliver a highly responsive user experience.

Open data

Country facts

For every country, additional metadata and facts are queried live from the crowdsourced knowledge database of Wikidata using the Wikidata Query Service.

This includes information on the country name, flag, anthem, official languages and the capital which is requested in the user’s detected language to enable a user experience localised to the user. Any missing information can be contributed directly to Wikidata to have it updated in the quiz.

Looking for more ways to celebrate Geography Awareness Week and GIS Day? We can help! For workshop materials, guest speakers, and more connect with our Community team: https://www.mapbox.com/community/



Heading 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 3

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 4

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 5

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

response = requests.get(

  "https://api.mapbox.com/v4/mapbox.temperature-raster-tileset/tilequery/40,-105.json",

    params={

        "layers": "temperature,wind_speed",

        "bands": "1708304400,1708311600",

    },

Optional caption
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque euismod maximus porta. Pellentesque vitae augue elit. Nam semper eros leo, nec hendrerit nunc aliquet quis. Morbi ac sapien tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur porta imperdiet lorem, ut aliquet orci pellentesque quis. Donec magna augue, molestie aliquam enim eu, auctor feugiat metus."

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

No items found.
No items found.

Related articles