From b29cbeda17bcc5173d92fe2071eafb48db67c214 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 26 Mar 2022 15:43:00 -0400 Subject: [PATCH] Add ability to provide a URL dictionary for multires tiles. --- src/js/libpannellum.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/libpannellum.js b/src/js/libpannellum.js index efb26e8..d7d71ab 100644 --- a/src/js/libpannellum.js +++ b/src/js/libpannellum.js @@ -1115,7 +1115,10 @@ function Renderer(container, context) { this.level = level; this.x = x; this.y = y; - this.path = path.replace('%s',side).replace('%l0',level-1).replace('%l',level).replace('%x',x).replace('%y',y); + // Use tile key if paths need to be looked up in a dictionary, which needs a `tileKey` entry + var p = typeof path === 'object' ? path.tileKey : path; + p = p.replace('%s',side).replace('%l0',level-1).replace('%l',level).replace('%x',x).replace('%y',y); + this.path = typeof path === 'object' ? path[p] : p; this.parentPath = parentPath; }