From 450055d5e127fc2349a131c98031b10d6620a63f Mon Sep 17 00:00:00 2001 From: Jack Reed Date: Sun, 27 Sep 2015 16:31:29 -0700 Subject: [PATCH] update styling, access random canvas --- assets/bundle.js | 3 ++- assets/css/site.css | 5 +++++ lib/map.js | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/bundle.js b/assets/bundle.js index 7ae708e..92077da 100644 --- a/assets/bundle.js +++ b/assets/bundle.js @@ -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 }); diff --git a/assets/css/site.css b/assets/css/site.css index 00c121e..bc2068f 100644 --- a/assets/css/site.css +++ b/assets/css/site.css @@ -176,3 +176,8 @@ h3 { transform: rotate(360deg); } } + +.leaflet-container .leaflet-control-attribution a { + color: #404040; + font-weight: 600; +} diff --git a/lib/map.js b/lib/map.js index 84e4249..4435d79 100644 --- a/lib/map.js +++ b/lib/map.js @@ -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 });