Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 42 additions & 6 deletions modules/services/mapilio.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const imgZoom = d3_zoom()
const pannellumViewerCSS = 'pannellum/pannellum.css';
const pannellumViewerJS = 'pannellum/pannellum.js';
const resolution = 1080;
const hdResolution = 2080;

let _activeImage;
let _cache;
Expand Down Expand Up @@ -331,17 +332,51 @@ export default {
let wrap = context.container().select('.photoviewer .mapilio-wrapper');
let attribution = wrap.selectAll('.photo-attribution').text('\u00A0');

let _username = '';

getUserData(d.created_by_id).then((username) => {
if (username) {
_username = username;
}

}).finally(() => {

attribution
.append('input')
.attr('type','checkbox')
.on('click',(e) => {
e.stopPropagation();
let isChecked = e.target.checked;
let parts = _sceneOptions.panorama.split('/');

if (isChecked){
parts[parts.length - 1] = hdResolution;
_sceneOptions.panorama= parts.join('/');
loadTheImage();
} else {
parts[parts.length - 1] = resolution;
_sceneOptions.panorama=parts.join('/');
loadTheImage();
}
});

attribution
.append('span')
.text('High Resolution');

attribution
.append('span')
.text('|');

attribution
.append('span')
.attr('class', 'captured_by')
.text('@' + username);
.text('@' + _username);

attribution
.append('span')
.text('|');
}
}).finally(() => {

if (d.capture_time) {
attribution
.append('span')
Expand Down Expand Up @@ -376,8 +411,7 @@ export default {
.classed('hide', !_cache.images.forImageId.hasOwnProperty(+id + 1));


getImageData(d.id,d.sequence_id).then(function () {

function loadTheImage(){
if (d.isPano) {
if (!_pannellumViewer) {
that.initViewer();
Expand All @@ -400,7 +434,9 @@ export default {
// make non-panoramic photo viewer
that.initOnlyPhoto(context);
}
});
}

getImageData(d.id,d.sequence_id).then(loadTheImage);

return this;
},
Expand Down