Skip to content

Commit

Permalink
update styling, access random canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Sep 27, 2015
1 parent ace4731 commit 450055d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ var Map = React.createClass({
$.getJSON(this.state.mapid, function (data) {
_this.setState({ mapInfo: data });
_this.map.attributionControl.addAttribution(data.attribution);
var iiifLayer = L.tileLayer.iiif(data.sequences[0].canvases[0].images[0].resource.service['@id'] + '/info.json', {
var randomCanvas = Math.floor(Math.random() * data.sequences[0].canvases.length - 1) + 1;
var iiifLayer = L.tileLayer.iiif(data.sequences[0].canvases[randomCanvas].images[0].resource.service['@id'] + '/info.json', {
tileSize: 1024
});

Expand Down
5 changes: 5 additions & 0 deletions assets/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,8 @@ h3 {
transform: rotate(360deg);
}
}

.leaflet-container .leaflet-control-attribution a {
color: #404040;
font-weight: 600;
}
3 changes: 2 additions & 1 deletion lib/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ var Map = React.createClass({
$.getJSON(this.state.mapid, function(data) {
_this.setState({mapInfo: data});
_this.map.attributionControl.addAttribution(data.attribution);
var iiifLayer = L.tileLayer.iiif(data.sequences[0].canvases[0].images[0].resource.service['@id'] + '/info.json', {
var randomCanvas = (Math.floor(Math.random() * data.sequences[0].canvases.length - 1) + 1);
var iiifLayer = L.tileLayer.iiif(data.sequences[0].canvases[randomCanvas].images[0].resource.service['@id'] + '/info.json', {
tileSize: 1024
});

Expand Down

0 comments on commit 450055d

Please sign in to comment.