Skip to content

Instantly share code, notes, and snippets.

@joshuahouston
Last active August 29, 2015 14:22
Show Gist options
  • Save joshuahouston/ef223430b5293483ab02 to your computer and use it in GitHub Desktop.
Save joshuahouston/ef223430b5293483ab02 to your computer and use it in GitHub Desktop.
baranof.tm2

Sharing the code for the Mapbox Studio map I made.

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Crossing The Island</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="paths.js"></script>
<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; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoiamZhY3RvcnkiLCJhIjoiZXdJam1yZyJ9.-AOTWD0gk1_3wuciI3DbsQ';
var map = L.mapbox.map('map', 'jfactory.73009218').setView([57.06, -135], 11);
</script>
</body>
</html>
#poi_label [type='Peak'][zoom>=12] {
marker-width: 4;
marker-fill: #fff;
marker-line-width: 1;
marker-line-color: #4f4f4f;
text-name: [name];
text-face-name: @sans;
text-fill: @border;
text-size: 18;
text-halo-fill: #fff;
text-halo-radius: 1;
text-halo-rasterizer: fast;
text-dy: 12;
text-line-spacing: -4;
text-wrap-width: 30;
text-wrap-before: true;
text-allow-overlap: true;
[zoom>=13] { text-size: 11; }
}
#labels {
text-name: [name];
text-face-name: @droid_italic;
text-fill: darken(saturate(@water, 10), 50);
text-placement: line;
text-max-char-angle-delta: 30;
}
#labels [zoom>=12] {
text-character-spacing: 0;
text-size: 9;
}
#labels [zoom>=13] {
text-character-spacing: 4;
text-size: 14;
[name='Springs'] { text-character-spacing: 1; }
[name='Medvejie Lake'] {
text-character-spacing: 0;
text-size: 10;
}
}
#labels [zoom>=14] {
text-character-spacing: 14;
text-size: 20;
[name='Springs'] { text-character-spacing: 8; }
[name='Medvejie Lake'] {
text-character-spacing: 2;
text-size: 16;
}
[name='Silver'] { text-avoid-edges: true; }
}
#labels [zoom>=15] {
text-character-spacing: 12;
text-size: 26;
text-avoid-edges: true;
[name='Medvejie Lake'] {
text-character-spacing: 10;
text-avoid-edges: true;
text-size: 15;
}
}
#labels [zoom>=16]
{
text-character-spacing: 17;
text-size: 28;
text-avoid-edges: true;
[name='Warm'] {
text-character-spacing: 25;
} [name='Medvejie Lake'] {
text-character-spacing: 16;
} [name='Bay'] {
text-character-spacing: 38;
text-size: 50;
} [name='Silver'] {
text-character-spacing: 38;
text-size: 42;
}
}
_prefs:
mapid: jfactory.73009218
saveCenter: false
_properties: {}
attribution: ''
bounds:
- -180
- -85.0511
- 180
- 85.0511
center:
- -134.8744
- 57.0878
- 14
description: ''
format: "png8:m=h"
interactivity_layer: ''
layers:
- waterways
- water.ocean
- landcover
- landuse.gen
- hillshade
- water.lakes
- contours
- landuse.glacier
- aeroway
- barrier_line
- building
- landuse_overlay
- tunnel
- road
- bridge
- admin
- country_label_line
- country_label
- marine_label
- state_label
- place_label
- water_label
- poi_label
- road_label
- waterway_label
- labels
maxzoom: 17
minzoom: 10
name: Baranof Island
source: "mapbox:///mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v5,jfactory.c1fb19a0,jfactory.c6d0463a"
styles:
- style.mss
- poi.mss
template: ''
Map {
background-color: @land;
}
@land: #cce8a1;
@contours: #834225;
@border: #212830;
@snow: #fff;
@ice: #00b0ff;
@water: #c7ecec;
@streams: #27a8b2;
@yellow: #fcf302;
//Fonts
@contfont: "Source Sans Pro Bold Italic";
@sans: "Open Sans Semibold","Arial Unicode MS Regular";
@droid_italic: "Droid Serif Italic";
#water {
::outline {
line-width: 8;
line-color: #fff;
}
line-width: 2;
line-color: @streams;
}
#water {
line-width: 2.5;
polygon-fill: @water;
polygon-opacity: 1;
}
#landcover [class="snow"] {
line-color:@snow;
line-width:0.5;
polygon-opacity:1;
polygon-fill:@snow;
}
#landuse.glacier [class="glacier"] {
line-color:@ice;
line-width:0.5;
polygon-opacity:1;
polygon-fill:@ice;
polygon-comp-op: screen;
}
#contours[zoom>=10][con500!='Y']{
line-width:0.3;
line-color:@contours;
[zoom>=13] { line-width: 0.4; }
[zoom>=15] { line-width: 0.8; }
}
#contours[zoom>=10][con500='Y']{
line-width:0.5;
line-color: @contours;
[zoom>=13] { line-width: 0.8; }
[zoom>=14] { line-width: 1; }
[zoom>=15] {
line-width: 1.5;
text-name: [elev];
text-face-name:@contfont;
text-fill:@contours;
text-size: 11;
text-placement: line;
text-avoid-edges: true;
text-spacing: 600;
}
}
#lakes {
line-color:#594;
line-width:0.5;
polygon-opacity:1;
polygon-fill:@water;
}
#waterways [zoom>=11]{
line-width:0.5;
line-color:@streams;
[zoom>=13] { line-width: 0.8; }
[zoom>=14] { line-width: 1; }
}
#hillshade {
::0[zoom<=13],
::1[zoom=14],
::2[zoom>=15][zoom<=16],
::3[zoom>=17][zoom<=18],
::4[zoom>=19] {
comp-op: hard-light;
polygon-clip: false;
image-filters-inflate: true;
[class='shadow'] {
polygon-fill: #035;
polygon-comp-op: multiply;
[zoom>=0][zoom<=4] { polygon-opacity: 0.12; }
[zoom>=5][zoom<=14] { polygon-opacity: 0.10; }
[zoom>=15][zoom<=16] { polygon-opacity: 0.06; }
[zoom>=17][zoom<=18] { polygon-opacity: 0.04; }
[zoom>=18] { polygon-opacity: 0.02; }
}
[class='highlight'] {
polygon-fill: #ffd;
polygon-opacity: 0.3;
[zoom>=15][zoom<=16] { polygon-opacity: 0.25; }
[zoom>=17][zoom<=18] { polygon-opacity: 0.2; }
[zoom>=18] { polygon-opacity: 0.1; }
}
}
::1 { image-filters: agg-stack-blur(2,2); }
::2 { image-filters: agg-stack-blur(8,8); }
::3 { image-filters: agg-stack-blur(16,16); }
::4 { image-filters: agg-stack-blur(32,32); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment