Ver a proveniência

Missing cubemap faces now need to be defined as null in the configuration

pull/570/head
David von Oheimb há 6 anos
ascendente
cometimento
70dcb087ae
2 ficheiros alterados com 11 adições e 12 eliminações
  1. +1
    -2
      doc/json-config-parameters.md
  2. +10
    -10
      src/js/pannellum.js

+ 1
- 2
doc/json-config-parameters.md Ver ficheiro

@@ -361,8 +361,7 @@ said data will override any existing settings. Defaults to `false`.
This is an array of URLs for the six cube faces in the order front, right,
back, left, up, down. These are relative to `basePath` if it is set, else they
are relative to the location of `pannellum.htm`. Absolute URLs can also be
used.

used. Partial cubemap images may be specified by giving `null` instead of a URL.


## `multires` specific options


+ 10
- 10
src/js/pannellum.js Ver ficheiro

@@ -350,11 +350,6 @@ function init() {
};
var onError = function(e) {
if (1) { // support partial cubemap image, i.e., missing faces
console.log(config.strings.fileAccessError.replace('%s', e.target.src)+'; will use background instead');
onLoad();
return;
}
var a = document.createElement('a');
a.href = e.target.src;
a.innerHTML = a.href;
@@ -362,13 +357,18 @@ function init() {
};
for (i = 0; i < panoImage.length; i++) {
panoImage[i].onload = onLoad;
panoImage[i].onerror = onError;
p = config.cubeMap[i];
if (config.basePath && !absoluteURL(p)) {
p = config.basePath + p;
if (p == "null") { // support partial cubemap image with explicitly empty faces
console.log('Will use background instead of missing cubemap face ' + i);
onLoad();
} else {
if (config.basePath && !absoluteURL(p)) {
p = config.basePath + p;
}
panoImage[i].onload = onLoad;
panoImage[i].onerror = onError;
panoImage[i].src = encodeURI(p);
}
panoImage[i].src = encodeURI(p);
}
} else if (config.type == 'multires') {
onImageLoad();


Carregando…
Cancelar
Guardar