Giter Club home page Giter Club logo

mapbox-maps's Introduction

Mapbox Maps

A user-friendly interface for Mapbox maps

screen shot 2017-03-29 at 5 11 20 pm

Weekend project: building a replacement for Google Maps from scratch

tl;dr Working at a mapping company, I was tired of still opening Google maps when looking for a place or directions. So I built an minimal, open version of Google Maps web. It uses open-source libraries and Mapbox services.

Why this project?

My day job involves maps. Lots of them. Yet I still open Google Maps on the web whenever I look for a place or need traffic directions. At Mapbox, we have all the building blocks that allow to build this ourselves. My goal was to create a web application with enough features to be able to switch my personal usage to it completely.

It was also a great way to learn React and Redux, the new Assembly CSS framework, and finally be on the consumer side of the APIs I build at work.

I wanted to show that it's possible to build a similar experience as Google Maps assembling Mapbox legos, from scratch, in a few days.

Tech

The summary:

This project was bootstrapped with create-react-app, which configures all the boring Webpack, Babel, polyfills, etc. for you. Our needs don't require any special configuration, especially because the app that we're building is static - all it does is call Mapbox's and Wikidata's APIs.

I'm using Redux to manage the state, with a middleware component (the api-caller) responsible for all the asynchronous calls.

I used our own Assembly.css framework, which shrinks the main CSS code below 60 lines. I usually don't like CSS, but I kinda enjoyed using this. It delivers on its promise of making the hard parts of web design easy.

The search bar is a fork from react-geocoder, with minor tweaks to be better integrated in the app. When available, additional POI information is retrieved from Wikidata (images, phone numbers, websites, etc.).

The directions are powered by the Directions Traffic API (which I'm very proud to be working on day to day). It leverages anonymous data from millions of users to provide the freshest live traffic information, in order to route you around traffic and give you the best ETAs.

Do it yourself!

This is open-source and MIT licensed. All you need to get this working is a Mapbox token.

git clone [email protected]:benjamintd/mapbox-maps.git
cd mapbox-maps
echo "export REACT_APP_MAPBOX_TOKEN=<your access token>" > .env
npm install
npm start

Feel free to fork and contribute, or open issues if you notice a bug of missing feature.

What's next?

  • Adding tests, I've been lazy
  • More traffic-related features
  • Ads (just kidding)

mapbox-maps's People

Watchers

James Cloos avatar Ivan Rigovsky avatar

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.