regular krpano plugin/layer attributes will give the radar svg a position and size
this code is enough to display the default radar!
(note: you can skew the radar by setting the height different than the width)
for each of the five paths you can set the line width, color, alpha, fill color and alpha
and a radius attribute which allows to define the paths shape.
the styling possibilites are shown in the examples
the provided reset view action can be used in the onclick attribute
about plugins, layers, hotspots and WebVR:
plugins/layers and hotspots with renderer="css3d" do not show in inWebVR
in WebVR only hotspots with renderer="webgl" can be displayed.
for this zRadar has to be loaded as hotspot (requires krpano 1.21+)
note: krpano <layer> or <plugin> elements are the same, only with different names!
(also see documentation of the <plugin> and <hotspot> elements)
about the display size:
sizing and positioning generally works as with any regular krpano plugin and hotspot
(see documentation of the <plugin> and <hotspot> elements)
note: the display size is set by the plugins or hotspots width and height,
not by the internal svgsize or canvassize values!
about positioning:
sizing and positioning generally works as with any regular krpano plugin and hotspot
(see documentation of the <plugin> and <hotspot> elements)
additionally zRadar allows unified align positioning on desktop and WebVR for hotspots
using the zalign, zx/zy and vrscale attributes
this is an example of an align positioned flying hotspot (requires krpano 1.21+)
about svg and canvas mode:
for plugins/layers and hotspots with renderer="css3d" an SVG is used
for hotspots with renderer="webgl" (needed for WebVR) a canvas element is used
forcecanvas="true" will force canvas mode for layers and css3d hotspots
about the foreground and background images:
these images are intended to create a pixel based compass
the fg image rotates with the view angle and is normally used for a compass needle
the svg is always displayed on top (in front of the foreground image)
svgalpha, fgalpha and bgalpha can be used to blend the components
about performance:
svg mode has better scaling, a better performance and uses less memory!
for images and canvas size use the smallest size possible!
foreground and background image sizes and the canvas size
should match or stay close to the used display size.
mode - radar (default) or compass design for svg paths3 and 4
the view angle (fov) is only shown in radar mode
heading - base rotation for the svg
to align the pano orientation with the radar/compass
note: heading=auto uses the active scene heading, if present
headingoffset - rotation offset for the radar/compass
default is 90, which means heading=0 is pointing to right/east by default
headingoffset=0 lets heading=0 point to top/north
invert - exchanges all styles for the svg paths3 and 4
(this is a short cut for exchanging the path styles directly)
svgsize - the size of the svg in pixels
note: this is an internal setting, to set the display size use the plugins width and height !
note: the line width and dash values are interpreted in relation to the used svg size,
therefore changing svgsize scales these values accordingly
canvassize - the size of the canvas in pixels
note: this is an internal setting, to set the display size use the plugins width and height !
note: on retina displays the internal size is 2-4x the given canvas size !
to save performance the canvas size should be always as small as possible
canvaspixelratio - allows to override the pixelratio for the canvas
canvaspixelratio="auto" uses device.pixelratio (default)
note: setting the pixelratio to 1.0 would save memory and performance,
but also results in antialising issues on retina screens
forcecanvas - can be used to prioritize canvas over svg mode
forcecanvas="false" will use svg mode whenever possible (default)
forcecanvas="true" forces canvas mode for layers and css3d hotspots
note: by default canvas mode is only used for webgl hotspots
note: using svg or canvas mode is decided on plugin init
and can not be changed dynamically later on.
refreshrate - the refresh / update rate per second
if set to 0 (default) the onviewchanged event is used
note: this is an internal setting, for performance reasons best left at default
svgalpha - the icons's opacity
can be used to hide the icon in favour of a foreground (compass needle) image
note: the display order is icon, foreground, background image and can't be changed.
fgurl - the url for a foreground image (typically used for a compass needle)
the foreground image rotates with the view angle
fgalpha - the foreground image's opacity
bgurl - the url for a background image (typically used for a compass background)
the background image is fixed and doesnt rotate
bgalpha - the background image's opacity
rscale - globally scales all radiuses so that the largest path fits the svg size
lscale - globally scales the line widths for all paths
dscale - globally scales the dash values for all paths
pathorder - the svg path order from bottom to top
e.g. pathorder="12435" would switch the order for paths 3 and 4
radius1 - radius5 can hold multiple values (eg. "0.5", "0.2|0.8", "0.2|0.8|0.2")
the larger of the first two values is used as outer, the smaller as inner radius
using one value creates a circle, two values a ring shape
in mode="radius" (default)
radius1, 2 and 5 are circles or ring shapes
radius3 and 4 are a cut circles (or rings) showing the field of view (fov)
in mode="compass"
radius1, 2 and 5 are circles or ring shapes
radius3 and 4 are defining the compass needles (tip and base position)
the 3rd value is used for the needles base width
the value range for all values is 0.0 to 1.0
with the exception that in compass mode the inner radius can be negative
both rgb and rgba values are supported.
rgba value have an additional byte to the right, which defines the alpha
example: 0xffffff80 = white at 50% alpha
rgba value are multiplied with the according alpha
example: fill1 effective alpha = fill1color * fill1alpha
to define a gradient, two colors can be passed like
fill3color="0xff0000|0x00ff00" (red to green)
fill4color="0xffffff00|0xffffff00 (white to transparent)
line1cap - line5cap is the stroke shape at the end of open paths
possible values are: butt, round, square
(see developer.mozilla.org stroke-linecap)
note: with all paths closed this setting is only visible with dashed lines
line1join - line5join is the stroke shape to be used at path corners
possible values are: crop, arcs, bevel, miter, round
(see developer.mozilla.org stroke-linejoin)
line1dash - line5dash is the stroke dash
example line1dash="10" or line1dash="20|10"
(see developer.mozilla.org stroke-dasharray)
note: the dash values are interpreted in relation to the used svg size
line1gradient/fill1gradient - line5gradient/fill5gradient define the gradient details
if a gradient is used by setting line1color/fill1color - line5color/fill5color to two colors.
the first value is the gradient radius,
the 2nd and 3rd value are the stop offsets
the 4th and 5th value are the center coordinates
example fill3gradient="1.0|0.0|1.0|1.0|0.5" will move the center to the right and increase the radius to 1.0
(see developer.mozilla.org radial gradient)
zalign - corresponds to the regular hotspot align attribute (krpano 1.21+)
but with support for fakeVR and WebVR
zx/zy - corresponds to the regular hotspot ox/oy attributes
supports pixel or percent values
vrscale - allows to scale the stage extents
for WebVR or separately for mobileVR and trueVR
vrscale="webVR" or
vrscale="x webVR|y webVR" or
vrscale="x mobileVR|y mobileVR|trueVR"
vrscale="x mobileVR|y mobileVR|x trueVR|y trueVR"
supports numbers only, eg. vrscale="0.9|1"
align positioning for hotspots:
in general zradars are placed like any regular krpano layer/hotspot !
hotspot align was introduced with krpano 1.21+, but it doesn't support WebVR zalign allows unified align positioning on desktop and WebVR for hotspots
this also works on krpano 1.20+ which has no support for hotspot align at all
eg. <hotspot name="..." flying="1" align="right" ox="100" />
works in krpano 1.21+ but only on desktop, not in WebVR
eg. <hotspot name="..." flying="1" zalign="right" zx="100" />
works in krpano 1.20+, on desktop and in WebVR
zalign is only used with hotspots and if a value is set !
in this case the hotspots align/ox/oy values are controlled by zalign/zx/zy
the vrscale values scale the stage extents in webvr
the default of "1.25|1.0|0.25|0.25" scales the x direction by 1.25 in mobileVR
and both directions by 0.25 for trueVR
note: for flying hotspots zradar automatically controls hotspot.scaleflying:
desktop and fakeVR : scaleflying = true
mobileVR and trueVR : scaleflying = false
resets or tweens the view to the initial scene view
the time parameter is optional and defaults to 3 (seconds)
the tweentype parameter is optional and defaults to easeinoutquad
This is a commercial plugin - to use it, it must be purchased.
Before you buy, please check the Compatibility / Requirements / Limitations!
Compatibility / Requirements / Limitations
krpano 1.20 or newer, html5 only! (Flash is not supported)
support for all features requires krpano 1.21 or higher
canvas mode for webgl hotspots (support for WebVR) requires krpano 1.21 or newer
hotspot align positioning (zalign) is experimental and comes without warranty
zRadar is tied to your krpano license
(needs a registered version of krpano)
License & Withdrawal period
All copyrights to zRadar are exclusively owned by indexofrefraction.
This plugin is offered as a commercial product and provided “as is”, without warranty of any kind, either express or implied, including but not limited to any warranty of quality, merchantability, or fitness for a particular purpose.
In no event shall the author be liable for loss of data, costs of procurement of substitute goods or services, or any special, consequential, or incidental damages, under any cause of action and regardless of whether or not the author has been advised of the possibility of such damages. This limitation applies notwithstanding any failure of essential purpose of any limited remedy provided herein. In any event, the plugin author shall have no liability arising out of or related to this agreement.
Third parties are not permitted to use your licensed plugin to create new projects, including modified versions of your existing projects.
You are not allowed to rent, lease, lend, or sublicense your plugin.
Offering your licensed plugin to third parties through any hosting or online platform (for example, integration in content management or automation services) is not permitted without a separate hosting license. For such cases, please contact: support@refraction.ch
By purchasing this digital content, you acknowledge that your right of withdrawal expires 14 days after purchase, or immediately upon starting the download of the content — whichever occurs first. Once downloaded, the content will remain accessible to you, and the withdrawal right can no longer be exercised.
The author may provide updates, improvements, or bug fixes at their sole discretion. No guarantee is made for the availability of future updates, ongoing support, or compatibility with future versions of the host software. (krpano)
This agreement shall be governed by and construed in accordance with the laws of Switzerland, without regard to conflict-of-law principles. Any disputes arising from or in connection with this agreement shall be subject to the exclusive jurisdiction of the courts of Zurich, Switzerland.
Radar and Compass examples
Various designs for radar and compass mode.
xml: tour.xml,
use right-click to enable fullscreen
CLICK TO VIEW EXAMPLE
Image based compass example
A fully image based compass to the right and a mixed svg / image based compass to the left.
xml: tour.xml,
use right-click to enable fullscreen
CLICK TO VIEW EXAMPLE
Hotspots example
Svg and image based examples as hotspots, working in webvr!
xml: tour.xml,
use right-click to enable fullscreen
CLICK TO VIEW EXAMPLE
zalign positioning example
align positioning with support for desktop and WebVR (krpano 1.20+)
xml: tour.xml,
use right-click to enable fullscreen
CLICK TO VIEW EXAMPLE
Path options example
Circle and ring shape path possibilites in radar and compass mode.
xml: tour.xml,
use right-click to enable fullscreen