Skip to content

Instantly share code, notes, and snippets.

@lxbarth
lxbarth / index.html
Created February 25, 2015 05:16
Mapbox Directions
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Driving directions</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }

Using custom map layers in OpenStreetMap editors

Here's how you use a custom map layer URL in OpenStreetMap's web-browser editor iD or in the desktop editor JOSM.

Example URL:

https://a.tiles.mapbox.com/v4/ruben.l2634ham/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicnViZW4iLCJhIjoiYlBrdkpRWSJ9.JgDDxJkvDn3us36aGzR6vg

Add a custom map layer in iD

host a.tile.openstreetmap.org
a.tile.openstreetmap.org is an alias for tile.geo.openstreetmap.org.
tile.geo.openstreetmap.org is an alias for us.tile.openstreetmap.org.
us.tile.openstreetmap.org is an alias for corvallis.tile.openstreetmap.org.
corvallis.tile.openstreetmap.org has address 140.211.167.105
@lxbarth
lxbarth / animating-osm.md
Created July 9, 2014 13:51
A simple process for animating mapping progress in OpenStreetMap

A simple process for animating mapping progress in OpenStreetMap

With this simple process I worked on this week, I can now create an animation of mapping progress in OpenStreetMap within 2 hours or less, it depends from how many files it needs to process for GIF.

For that a have made a tutorial where explain step by step how to make a GIF animation of progress tracing in OSM, maybe is not unique way to do that, but it is a good way using Tilemill how doing that.

Progress from all tracing and import buildings in New York between 10/01/2013 and 04/08/2014

@lxbarth
lxbarth / index.html
Created June 19, 2014 13:31
Simple Mapbox + OpenStreetMap attribution on Mapbox Streets for small maps.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Attribution</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.js'></script>
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.css' rel='stylesheet' />
@lxbarth
lxbarth / index.html
Last active August 29, 2015 14:02
Standard attribution for Mapbox Streets and Mapbox Satellite.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Attribution</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.6/mapbox.js'></script>
<script src='https:////api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.6/mapbox.css' rel='stylesheet' />
@lxbarth
lxbarth / index.html
Last active August 29, 2015 14:01
Attribution on OpenStreetMap based Mapbox maps
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Attribution</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script>
<script src='https:////api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

More Open. Today’s OpenStreetMap license is open, but due to a feature in it called share alike it is not compatible with any other license, open or proprietary. In a world where we use more and more data in raw formats, this kills OpenStreetMap’s potential. In order to build the best dataset in the world, we need to drop share alike.

@lxbarth
lxbarth / index.html
Created April 1, 2014 19:31
Mapbox logo with expanded attribution
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href='//api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' />
<script src='//api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script>
<style>
#map { position:absolute; top:0; bottom:0; width:100%; }
.mapbox-maplogo {
position:absolute;