Should the user use URL configuration for their panorama and then
specify an option/key but leave the value empty, previously this
would stop the panorama from being displayed due to the generated
JSON config from src/standalone/standalone.js being invalid.
This commit omits creating an on-the-fly JSON string and instead
uses a JavaScript object (which the generated JSON string was
converted to anyway).
The background of wanting to enable URL options with possibly empty
values relates to using Pannellum with static site generators.
Depending on the static site generator, specifying default values
for undefined template variables can result in lots of template
notation whereas outputting a value for a variable that isn't
defined usuallly simply outputs an empty string. It would hence be
desirable to treat the empty-string value of an option/key in URL
config as if that option/key were not user-supplied at all and
hence the Pannellum default value for that option/key be used.
With a fixed coefficient affecting touchmove pan speed, at large
values of config.hfov (zoomed out) panning will feel "sluggish"
due to panorama panning less than finger is moved on screen.
On the other hand, at small config.hfov values (zoomed in),
panning will be perceived to move faster.
To improve usability at both small and large config.hfov
(zoomed-out and zoomed-in) we introduce a dynamic coefficient
affected by the config.hfov value.
Currently this seems to roughly keep initial drag/pan start position
close to the user's finger while panning regardless of zoom level.
Now the following can also be set from URL:
- minHfov, maxHfov
- minPitch, maxPitch
- minYaw, maxYaw
The motivation for this was making it easier to create auto-generated
panoramas using Jekyll/Hugo and other static site generators without
needing to create JSON files for panoramas.
If a given panorama is not a full 360x180 panorama, then the above
parameters are needed in addition to haov and vaov parameters
in order for the user not to see black areas in the panorama.
Hence suggesting adding URL support.