diff --git a/app.js b/app.js index ec8a2d2..aad0867 100644 --- a/app.js +++ b/app.js @@ -11,7 +11,7 @@ var port = 5044, fontsLocation = path.resolve(__dirname, "fonts"), stylesLocation = path.resolve(__dirname, "styles"), // TODO(yuri): Multiple styles for a source? - sourceStylesMap = {Geelong: "Geelong_Roofs.tm2"}; + sourceStylesMap = {What: "exploring-style.tm2"}; // TODO(yuri): Implement tilecache? require("mbtiles").registerProtocols(tilelive); diff --git a/fonts/OpenSans-ExtraBold.ttf b/fonts/OpenSans-ExtraBold.ttf new file mode 100755 index 0000000..21f6f84 Binary files /dev/null and b/fonts/OpenSans-ExtraBold.ttf differ diff --git a/geelong_roofs.tm2z b/geelong_roofs.tm2z new file mode 100644 index 0000000..bb076a2 Binary files /dev/null and b/geelong_roofs.tm2z differ diff --git a/styles/Geelong_Roofs.tm2/.thumb.png b/styles/Geelong_Roofs.tm2/.thumb.png new file mode 100644 index 0000000..e23bce5 Binary files /dev/null and b/styles/Geelong_Roofs.tm2/.thumb.png differ diff --git a/styles/Geelong_Roofs.tm2/README.md b/styles/Geelong_Roofs.tm2/README.md new file mode 100644 index 0000000..7df3d4d --- /dev/null +++ b/styles/Geelong_Roofs.tm2/README.md @@ -0,0 +1,3 @@ +mapbox-studio-default-style +=========================== +Default style used by new style projects in Mapbox Studio. diff --git a/styles/Geelong_Roofs.tm2/project.xml b/styles/Geelong_Roofs.tm2/project.xml new file mode 100644 index 0000000..83c1c21 --- /dev/null +++ b/styles/Geelong_Roofs.tm2/project.xml @@ -0,0 +1,344 @@ + + + + + + © Mapbox © OpenStreetMap Improve this map]]> + -180,-85.0511,180,85.0511 + 144.4012,-38.1615,13 + png8:m=h + 18 + 12 + + + + + + + + road + + + + roof + + + + suburb + + \ No newline at end of file diff --git a/styles/Geelong_Roofs.tm2/project.yml b/styles/Geelong_Roofs.tm2/project.yml new file mode 100644 index 0000000..93fd8c2 --- /dev/null +++ b/styles/Geelong_Roofs.tm2/project.yml @@ -0,0 +1,26 @@ +_prefs: + saveCenter: true +_properties: + bridge: + "group-by": layer +attribution: "© Mapbox © OpenStreetMap Improve this map" +bounds: + - -180 + - -85.0511 + - 180 + - 85.0511 +center: + - 144.4012 + - -38.1615 + - 13 +description: '' +format: "png8:m=h" +interactivity_layer: '' +layers: null +maxzoom: 18 +minzoom: 12 +name: Check out my Roofage +source: "tmsource:///Users/arrayjam/Documents/mapbox-studio-geelong-roofs.tm2source" +styles: + - style.mss +template: '' diff --git a/styles/Geelong_Roofs.tm2/roads.mss b/styles/Geelong_Roofs.tm2/roads.mss new file mode 100644 index 0000000..ad79521 --- /dev/null +++ b/styles/Geelong_Roofs.tm2/roads.mss @@ -0,0 +1,88 @@ +@road: #202020; + +// dummy styles to set ordering (case below fill) +#tunnel, #bridge, #road { + ::case { opacity: 1; } + ::fill { opacity: 1; } +} + +// consistent case size +@case: 2; + +// Road & Railway Fills // +#tunnel { opacity: 0.5; } + +#geelong_roads[zoom<11], +#tunnel[zoom<11], +#bridge[zoom<11] { + line-color: @road; + line-width: 0.5; + [class='motorway'] { line-width: 1;} +} + +#geelong_roads::fill[zoom>=11], +#tunnel::fill[zoom>=11], +#bridge::fill[zoom>=11] { + ['mapnik::geometry_type'=2] { + line-color: @road; + line-width: 0.5; + [zoom>=15] { line-width: 1; } + [class='path'] { line-dasharray: 2,2;} + [class='major_rail'], + [class='minor_rail'] { line-dasharray: 3,3; } + [class='motorway'] { + [zoom>=11] { line-width: 2; } + [zoom>=12] { line-width: 3; } + [zoom>=14] { line-width: 4; } + [zoom>=16] { line-width: 7; } + [zoom>=18] { line-width: 10; } + } + [class='motorway_link'], + [class='main'] { + [zoom>=11] { line-width: 1; } + [zoom>=12] { line-width: 2; } + [zoom>=14] { line-width: 3; } + [zoom>=16] { line-width: 5; } + [zoom>=18] { line-width: 7; } + } + [class='street'], + [class='street_limited'] { + [zoom>=14] { line-width: 1; } + [zoom>=16] { line-width: 2; } + [zoom>=18] { line-width: 4; } + } + [class='street_limited'] { line-dasharray: 4,2; } + } +} + +// Casing for high-zoom roads // +#geelong_roads::case[zoom>=11], +#tunnel::case[zoom>=11], +#bridge::case[zoom>=11] { + ['mapnik::geometry_type'=2] { + line-color: @land; + line-width: 1; + [class='motorway_link'] { + [zoom>=11] { line-width: 2 + @case; } + [zoom>=12] { line-width: 3 + @case; } + [zoom>=14] { line-width: 4 + @case; } + [zoom>=16] { line-width: 7 + @case; } + [zoom>=18] { line-width: 10 + @case; } + } + [class='motorway_link'], + [class='main'] { + [zoom>=11] { line-width: 1 + @case; } + [zoom>=12] { line-width: 2 + @case; } + [zoom>=14] { line-width: 3 + @case; } + [zoom>=16] { line-width: 5 + @case; } + [zoom>=18] { line-width: 7 + @case; } + } + [class='street'], + [class='street_limited'] { + [zoom>=14] { line-width: 1 + @case; } + [zoom>=16] { line-width: 2 + @case; } + [zoom>=18] { line-width: 4 + @case; } + } + [class='street_limited'] { line-dasharray: 4,2; } + } +} \ No newline at end of file diff --git a/styles/Geelong_Roofs.tm2/style.mss b/styles/Geelong_Roofs.tm2/style.mss new file mode 100644 index 0000000..3e89deb --- /dev/null +++ b/styles/Geelong_Roofs.tm2/style.mss @@ -0,0 +1,110 @@ +Map { + background-color: #050505; +} + +@sans_bold: 'Open Sans Extrabold'; + +#road { + line-color: #2f2f2f; + line-opacity: 0.5; + line-width: 0.2; + [zoom>=13] { + line-opacity: 1; + line-width: 0.75; + } + [zoom>=15] { line-width: 1; } + [zoom>=16] { + line-width: 2; + [roadclass=0] { + line-width: 1; + } + } + [zoom>=17] { line-width: 3; } + [zoom>=18] { line-width: 6; } + +} + +@text-size: 15; + +#suburb { + text-name: [SSC_NAME]; + text-face-name: @sans_bold; + text-placement: interior; + text-fill: #fcff49; + text-halo-fill: black; + text-halo-radius: 1.5; + text-halo-opacity: 1; +// text-min-padding: 1; + text-margin: 5; + text-size: @text-size; + + [SSC_NAME=~'^.{10,}$'] { + text-size: @text-size * 0.8; + } + [SSC_NAME=~'^.{14,}$'] { + text-size: @text-size * 0.6; + } +} + +#roof { + [zoom>=17] { + building-height: [ROOF_HT]; + building-fill: #303030; + building-fill-opacity: 0.8; + + [const_yr>=1800] { building-fill: #d0cb35; } + [const_yr>=1850] { building-fill: #ff6855; } + [const_yr>=1900] { building-fill: #7f3eaf; } + [const_yr>=1905] { building-fill: #6d3fa9; } + [const_yr>=1910] { building-fill: #6848b8; } + [const_yr>=1915] { building-fill: #6152c5; } + [const_yr>=1920] { building-fill: #595dd0; } + [const_yr>=1925] { building-fill: #5069d8; } + [const_yr>=1930] { building-fill: #4676de; } + [const_yr>=1935] { building-fill: #3c83e1; } + [const_yr>=1940] { building-fill: #3291e0; } + [const_yr>=1945] { building-fill: #299fdd; } + [const_yr>=1950] { building-fill: #22add6; } + [const_yr>=1955] { building-fill: #1cbacd; } + [const_yr>=1965] { building-fill: #19c7c1; } + [const_yr>=1970] { building-fill: #19d2b4; } + [const_yr>=1975] { building-fill: #1cdca6; } + [const_yr>=1980] { building-fill: #22e596; } + [const_yr>=1985] { building-fill: #2bec87; } + [const_yr>=1990] { building-fill: #38f179; } + [const_yr>=1995] { building-fill: #47f46d; } + [const_yr>=2000] { building-fill: #59f663; } + [const_yr>=2005] { building-fill: #6df65b; } + [const_yr>=2010] { building-fill: #82f557; } + } + + [zoom<17] { + polygon-fill: #303030; + polygon-opacity: 1; + + [const_yr>=1800] { polygon-fill: #d0cb35; } + [const_yr>=1850] { polygon-fill: #ff6855; } + [const_yr>=1900] { polygon-fill: #7f3eaf; } + [const_yr>=1905] { polygon-fill: #6d3fa9; } + [const_yr>=1910] { polygon-fill: #6848b8; } + [const_yr>=1915] { polygon-fill: #6152c5; } + [const_yr>=1920] { polygon-fill: #595dd0; } + [const_yr>=1925] { polygon-fill: #5069d8; } + [const_yr>=1930] { polygon-fill: #4676de; } + [const_yr>=1935] { polygon-fill: #3c83e1; } + [const_yr>=1940] { polygon-fill: #3291e0; } + [const_yr>=1945] { polygon-fill: #299fdd; } + [const_yr>=1950] { polygon-fill: #22add6; } + [const_yr>=1955] { polygon-fill: #1cbacd; } + [const_yr>=1965] { polygon-fill: #19c7c1; } + [const_yr>=1970] { polygon-fill: #19d2b4; } + [const_yr>=1975] { polygon-fill: #1cdca6; } + [const_yr>=1980] { polygon-fill: #22e596; } + [const_yr>=1985] { polygon-fill: #2bec87; } + [const_yr>=1990] { polygon-fill: #38f179; } + [const_yr>=1995] { polygon-fill: #47f46d; } + [const_yr>=2000] { polygon-fill: #59f663; } + [const_yr>=2005] { polygon-fill: #6df65b; } + [const_yr>=2010] { polygon-fill: #82f557; } + } +} \ No newline at end of file diff --git a/styles/exploring-style.tm2/.thumb.png b/styles/exploring-style.tm2/.thumb.png new file mode 100644 index 0000000..0339421 Binary files /dev/null and b/styles/exploring-style.tm2/.thumb.png differ diff --git a/styles/exploring-style.tm2/README.md b/styles/exploring-style.tm2/README.md new file mode 100644 index 0000000..7df3d4d --- /dev/null +++ b/styles/exploring-style.tm2/README.md @@ -0,0 +1,3 @@ +mapbox-studio-default-style +=========================== +Default style used by new style projects in Mapbox Studio. diff --git a/styles/exploring-style.tm2/project.xml b/styles/exploring-style.tm2/project.xml new file mode 100644 index 0000000..f333364 --- /dev/null +++ b/styles/exploring-style.tm2/project.xml @@ -0,0 +1,36 @@ + + + + + + -180,-85.0511,180,85.0511 + 144.9535,-37.8087,16 + + png8:m=h + 19 + 13 + + + + + + + + Footpath + + + + Buildings + + \ No newline at end of file diff --git a/styles/exploring-style.tm2/project.yml b/styles/exploring-style.tm2/project.yml new file mode 100644 index 0000000..0949e66 --- /dev/null +++ b/styles/exploring-style.tm2/project.yml @@ -0,0 +1,25 @@ +_prefs: + mapid: '' + saveCenter: true +_properties: {} +attribution: '' +bounds: + - -180 + - -85.0511 + - 180 + - 85.0511 +center: + - 144.9535 + - -37.8087 + - 16 +description: description +format: "png8:m=h" +interactivity_layer: '' +layers: null +maxzoom: 19 +minzoom: 13 +name: Explorer +source: "tmsource:///Users/arrayjam/Data/Explore.tm2source" +styles: + - style.mss +template: '' diff --git a/styles/exploring-style.tm2/style.mss b/styles/exploring-style.tm2/style.mss new file mode 100644 index 0000000..74138e4 --- /dev/null +++ b/styles/exploring-style.tm2/style.mss @@ -0,0 +1,15 @@ +Map { + background-color: #fff; +} + +#Buildings { + line-width: 1; + building-height: [HEIGHT] * 0.3; + building-fill: #f6f6f6; + building-fill-opacity: 1; +} + +#Footpath { + line-width: 1; + line-color: #C1C1C1; +}