Code Monkey home page Code Monkey logo

map-print's Introduction

Map Print

Print a map of roads on a mug.

demo

Here is how the final product look like:

Final product

Why?

I love maps and travels. Every time I grab a Vancouver mug - not only it is filled with hot coffee, it is also filled with warm memories.

vancouver mug

Now you too can make a mug from the roads network of a city that you've visited (or planning to visit). Or give it as a gift to those whom you care about. I hope you like what this project does.

I'm giving away the entire source code for free. Yet I think you should know: with every purchase coming from this project, Zazzle gives me a small revenue from the sale. So every purchase supports this project.

Your ideas and suggestions are more than welcomed!

How?

The original map is rendered with mapbox-gl. When you find an area that you like and click the "Start" button - I send request to the OpenStreet Map with Overpass-Turbo API to fetch all the roads in a given bounding box.

These roads are then rendered with my own tiny-toy WebGL rendering engine w-gl. The engine is not ready for production use, but it can render millions of roads very quickly.

Virtualization is a common technique used by mapping software to reduce amount of things rendered on the screen and focus user's attention on major facets of a map. w-gl gives unique opportunity to see how road networks look without virtualization. I.e. every single road is rendered on the screen, regardless of the zoom level.

Sometimes it's just a single large blob of ink, but more often you'd see beautiful patterns on the screen.

That said, I wouldn't recommend zooming out too far. When I tried it - I had either OpenStreetMap failing my requests, or my browser running out of memory. You will see a warning on the screen if you zoom out too far.

Local Development

Get the package and its dependencies

git clone https://github.com/anvaka/map-print.git
npm install
cd map-print

And then start the local server:

npm start

This should open a server on http://localhost:8080

License

MIT.

If you'd like to support the project - here is my Patreon page: https://www.patreon.com/anvaka ๐Ÿง™

map-print's People

Contributors

anvaka avatar

Watchers

 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.