Skip to content

Commit

Permalink
Merge branch 'master' into zoomify
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGermuska committed Mar 19, 2014
2 parents ec03f18 + d9f9d83 commit 17c5c4a
Show file tree
Hide file tree
Showing 19 changed files with 560 additions and 293 deletions.
550 changes: 292 additions & 258 deletions codekit-config.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions compiled/css/fonts/font.knightlab.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions compiled/css/fonts/font.ubuntu.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion compiled/css/storymap.css

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions compiled/examples/population.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- CSS-->
<link rel="stylesheet" href="../css/storymap.css?v1">
<!--FONT-->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Bevan%7CPontano+Sans&amp;amp;subset=latin,latin">
<link rel="stylesheet" href="../css/fonts/font.knightlab.css?v1">
<!-- Style-->
<style>
html, body {
Expand All @@ -19,13 +19,6 @@
padding: 0px;
margin: 0px;
}
.vco-storymap {
font-family:'Pontano Sans',sans-serif !important;
}
.vco-storymap h1, .vco-storymap h2, .vco-storymap h3, .vco-storymap h4, .vco-storymap h5, .vco-storymap h6 {
font-family:'Bevan',serif !important;
font-weight: normal;
}

</style>
<!-- HTML5 shim, for IE6-8 support of HTML elements-->
Expand All @@ -39,7 +32,8 @@
<script src="../js/storymap-min.js"></script>
<script>
var storymap = new VCO.StoryMap('storymap', 'population.json', {
map_type:"mapbox:zachwise.hgmmh8ho"
//map_type:"mapbox:zachwise.hgmmh8ho"
//map_type:"stamen:toner"
});
window.onresize = function(event) {
storymap.updateDisplay();
Expand Down
6 changes: 6 additions & 0 deletions compiled/examples/usecase_test_01.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
html, body {
width:100%;
padding: 0px;

margin: 0px;
}
.vco-storymap {
Expand All @@ -37,16 +38,19 @@
#storymap1 {
width:620px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap2 {
width:994px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap3 {
width:994px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap4 {
Expand Down Expand Up @@ -82,11 +86,13 @@
#storymap9 {
width:600px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap10 {
width:600px;
height:400px;
margin-left:20px;
border: 1px solid #999;
}
</style>
Expand Down
5 changes: 5 additions & 0 deletions compiled/examples/usecase_test_02.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#storymap1 {
width:600px;
height:900px;
margin-left:20px;
border: 1px solid #999;
}
#storymap2 {
Expand All @@ -48,21 +49,25 @@
#storymap3 {
width:520px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap4 {
width:1180px;
height:600px;
margin-left:20px;
border: 1px solid #999;
}
#storymap5 {
width:600px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap6 {
width:603px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
</style>
Expand Down
1 change: 1 addition & 0 deletions compiled/examples/usecase_test_03.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
html, body {
width:100%;
padding: 0px;
padding-left:20px;
margin: 0px;
}
.vco-storymap {
Expand Down
6 changes: 3 additions & 3 deletions compiled/js/storymap-min.js

Large diffs are not rendered by default.

41 changes: 35 additions & 6 deletions compiled/js/storymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6895,8 +6895,6 @@ VCO.SlideNav = VCO.Class.extend({
slideLoaded
slideRemoved
TODO
Fix overflow scoll in landscape view
================================================== */

Expand Down Expand Up @@ -7316,7 +7314,7 @@ VCO.StorySlider = VCO.Class.extend({
bg_color_rgb,
bg_percent_start = this.options.slide_default_fade,
bg_percent_end = "15%",
bg_alpha_end = "0.90",
bg_alpha_end = "0.87",
bg_css = "";

if (bg.color_value) {
Expand Down Expand Up @@ -16585,7 +16583,7 @@ VCO.Map.Leaflet = VCO.Map.extend({
_createBackgroundMap: function(tiles) {

// TODO Check width and height
trace("CREATE BACKGROUND MAP")
trace("CREATE BACKGROUND MAP");
if (!this._image_layer) {
// Make Image Layer a Group
this._image_layer = new L.layerGroup();
Expand All @@ -16602,8 +16600,8 @@ VCO.Map.Leaflet = VCO.Map.extend({
var target_tile = tiles[x],
image = {},
tile = {
x: parseInt(target_tile.style.left.split("px")[0]),
y: parseInt(target_tile.style.top.split("px")[0]),
x: 0,
y: 0,
url: target_tile.src,
height: parseInt(target_tile.style.height.split("px")[0]),
width: parseInt(target_tile.style.width.split("px")[0]),
Expand All @@ -16612,7 +16610,37 @@ VCO.Map.Leaflet = VCO.Map.extend({
end: 0
}
};

if (target_tile.style.left || target_tile.style.top) {
if (target_tile.style.left) {
tile.x = parseInt(target_tile.style.left.split("px")[0]);
}
if (target_tile.style.top) {
tile.y = parseInt(target_tile.style.top.split("px")[0]);
}
} else if (target_tile.style["-webkit-transform"] || target_tile.style["transform"] || target_tile.style["-ms-transform"]) {
var t_array;

if (target_tile.style["-webkit-transform"]) {
t_array = target_tile.style["-webkit-transform"].split("3d(")[1].split(", 0)")[0].split(", ");
} else if (target_tile.style["transform"]) {
t_array = target_tile.style["transform"].split("3d(")[1].split(", 0)")[0].split(", ");
} else if (target_tile.style["-ms-transform"]) {
t_array = target_tile.style["-ms-transform"].split("3d(")[1].split(", 0)")[0].split(", ");
}

tile.x = parseInt(t_array[0].split("px")[0]);
tile.y = parseInt(t_array[1].split("px")[0]);
}


// If using toner, switch to toner lines
if (tile.url.match("toner")) {
//tile.url = tile.url.replace("/toner-lite/","/toner-lines/");
tile.url = tile.url.replace("/toner-hybrid/","/toner-lines/");
tile.url = tile.url.replace("/toner/","/toner-background/");
}

tile.pos.start = this._map.containerPointToLatLng([tile.x, tile.y]);
tile.pos.end = this._map.containerPointToLatLng([tile.x + tile.width, tile.y + tile.height]);

Expand Down Expand Up @@ -16645,6 +16673,7 @@ VCO.Map.Leaflet = VCO.Map.extend({
break;
case 'stamen':
_tilelayer = new L.StamenTileLayer(_map_type_arr[1] || 'toner-lite', _options);
this._map.getContainer().style.backgroundColor = "#FFFFFF";
break;
case 'zoomify':
_options.width = this.options.zoomify.width;
Expand Down
12 changes: 3 additions & 9 deletions source/jade/population.jade
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ html(lang="en")
// CSS
link(rel='stylesheet', href='../css/storymap.css?v1')
//FONT
link(rel='stylesheet', href='http://fonts.googleapis.com/css?family=Bevan%7CPontano+Sans&amp;subset=latin,latin')
link(rel='stylesheet', href='../css/fonts/font.knightlab.css?v1')

// Style
style
Expand All @@ -20,13 +20,6 @@ html(lang="en")
padding: 0px;
margin: 0px;
}
.vco-storymap {
font-family:'Pontano Sans',sans-serif !important;
}
.vco-storymap h1, .vco-storymap h2, .vco-storymap h3, .vco-storymap h4, .vco-storymap h5, .vco-storymap h6 {
font-family:'Bevan',serif !important;
font-weight: normal;
}

// HTML5 shim, for IE6-8 support of HTML elements
//if lt IE 9
Expand All @@ -41,7 +34,8 @@ html(lang="en")
script(src='../js/storymap-min.js')
script
var storymap = new VCO.StoryMap('storymap', 'population.json', {
map_type:"mapbox:zachwise.hgmmh8ho"
//map_type:"mapbox:zachwise.hgmmh8ho"
//map_type:"stamen:toner"
});
window.onresize = function(event) {
storymap.updateDisplay();
Expand Down
6 changes: 6 additions & 0 deletions source/jade/usecase_test_01.jade
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ html(lang="en")
html, body {
width:100%;
padding: 0px;

margin: 0px;

}
Expand All @@ -41,16 +42,19 @@ html(lang="en")
#storymap1 {
width:620px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap2 {
width:994px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap3 {
width:994px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap4 {
Expand Down Expand Up @@ -86,11 +90,13 @@ html(lang="en")
#storymap9 {
width:600px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap10 {
width:600px;
height:400px;
margin-left:20px;
border: 1px solid #999;
}
//
Expand Down
6 changes: 6 additions & 0 deletions source/jade/usecase_test_02.jade
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ html(lang="en")

width:100%;
padding: 0px;

margin: 0px;

}
Expand All @@ -42,6 +43,7 @@ html(lang="en")
#storymap1 {
width:600px;
height:900px;
margin-left:20px;
border: 1px solid #999;
}
#storymap2 {
Expand All @@ -53,21 +55,25 @@ html(lang="en")
#storymap3 {
width:520px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap4 {
width:1180px;
height:600px;
margin-left:20px;
border: 1px solid #999;
}
#storymap5 {
width:600px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
#storymap6 {
width:603px;
height:800px;
margin-left:20px;
border: 1px solid #999;
}
// HTML5 shim, for IE6-8 support of HTML elements
Expand Down
1 change: 1 addition & 0 deletions source/jade/usecase_test_03.jade
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ html(lang="en")

width:100%;
padding: 0px;
padding-left:20px;
margin: 0px;

}
Expand Down
37 changes: 34 additions & 3 deletions source/js/map/leaflet/VCO.Map.Leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ VCO.Map.Leaflet = VCO.Map.extend({
_createBackgroundMap: function(tiles) {

// TODO Check width and height
trace("CREATE BACKGROUND MAP")
trace("CREATE BACKGROUND MAP");
if (!this._image_layer) {
// Make Image Layer a Group
this._image_layer = new L.layerGroup();
Expand All @@ -102,8 +102,8 @@ VCO.Map.Leaflet = VCO.Map.extend({
var target_tile = tiles[x],
image = {},
tile = {
x: parseInt(target_tile.style.left.split("px")[0]),
y: parseInt(target_tile.style.top.split("px")[0]),
x: 0,
y: 0,
url: target_tile.src,
height: parseInt(target_tile.style.height.split("px")[0]),
width: parseInt(target_tile.style.width.split("px")[0]),
Expand All @@ -112,7 +112,37 @@ VCO.Map.Leaflet = VCO.Map.extend({
end: 0
}
};

if (target_tile.style.left || target_tile.style.top) {
if (target_tile.style.left) {
tile.x = parseInt(target_tile.style.left.split("px")[0]);
}
if (target_tile.style.top) {
tile.y = parseInt(target_tile.style.top.split("px")[0]);
}
} else if (target_tile.style["-webkit-transform"] || target_tile.style["transform"] || target_tile.style["-ms-transform"]) {
var t_array;

if (target_tile.style["-webkit-transform"]) {
t_array = target_tile.style["-webkit-transform"].split("3d(")[1].split(", 0)")[0].split(", ");
} else if (target_tile.style["transform"]) {
t_array = target_tile.style["transform"].split("3d(")[1].split(", 0)")[0].split(", ");
} else if (target_tile.style["-ms-transform"]) {
t_array = target_tile.style["-ms-transform"].split("3d(")[1].split(", 0)")[0].split(", ");
}

tile.x = parseInt(t_array[0].split("px")[0]);
tile.y = parseInt(t_array[1].split("px")[0]);
}


// If using toner, switch to toner lines
if (tile.url.match("toner")) {
//tile.url = tile.url.replace("/toner-lite/","/toner-lines/");
tile.url = tile.url.replace("/toner-hybrid/","/toner-lines/");
tile.url = tile.url.replace("/toner/","/toner-background/");
}

tile.pos.start = this._map.containerPointToLatLng([tile.x, tile.y]);
tile.pos.end = this._map.containerPointToLatLng([tile.x + tile.width, tile.y + tile.height]);

Expand Down Expand Up @@ -145,6 +175,7 @@ VCO.Map.Leaflet = VCO.Map.extend({
break;
case 'stamen':
_tilelayer = new L.StamenTileLayer(_map_type_arr[1] || 'toner-lite', _options);
this._map.getContainer().style.backgroundColor = "#FFFFFF";
break;
case 'zoomify':
_options.width = this.options.zoomify.width;
Expand Down
Loading

0 comments on commit 17c5c4a

Please sign in to comment.