GithubHelp home page GithubHelp logo

mfincker / interactive_map_tutorial Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 285 KB

Interactive web map with MapboxGL.js - tutorial

CSS 9.17% HTML 13.19% JavaScript 77.64%
mapbox-gl-js webmapping

interactive_map_tutorial's Introduction

Interactive web map with MapBox - tutorial

In this tutorial, I will show you how to build an interactive web map from scratch, from gathering and formatting the data, to styling your map and adding user interactivity with MapBoxGL.js.

Tutorial parts:

  1. Data gathering and formatting: first, we will download demographic data from the Census bureau programatically and format it to only retain the information we need.
  2. Geographic information and GeoJSON creation: second, we will obtain the geographic boundaries from the Census bureau and merge our data with it to obtain GeoJSON files containing both data and geographies.
  3. GeoJSON to Mbtiles: the GeoJSON files contain all the information we need but can be too heavy to transfer over the internet. Instead, we will cut it in small pieces, called vector tiles, that are much lighter to query.
  4. Mapbox set up: MapBox will host our tiles and serve them whenver we need them. In this step, we will set up a MapBox account and upload our tiles.
  5. First map using MapBoxGl.js: In this step, we will build our first map and we will set it up so that the layer displayed depends on the zoom level. You can see the live version of the map here.
  6. Making the map more legible: We will add a legend to explain the chloropleth colors using D3.js. We will also add the ability to switch between demographic variables using radio buttons. Live version here.
  7. Adding interaction: To make the map more iteractive, we will add polygon highlighting when the mouse moves over a region, as well as tooltips displaying more information about the currently highlighted region. Live version here.

UNDER CONSTRUCTION, might not work all the time. Watch the repo for updates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.