Preview — our store opens soon.

krpano Plugins

Plugin krpano v1.0.0 New

Detail Loupe

A magnifier lens for photos in krpano tours – with mouse, pen and touch.

€29 One-time price, excl. VAT
Store opens soon Try the demo

Compatibility

Verified for krpano 1.23.2–1.24

How it works.

Visitors want to see the small details of the photos you show in popups, but krpano has no magnifier for image layers. Detail Loupe adds a lens that follows the mouse on desktop and the finger on phones and tablets, with pinch to zoom and an optional high-resolution source. Every setting is an attribute of the plugin element in your own tour XML – the plugin file stays untouched.

Installation.

  1. 1

    Copy the file

    Copy detailloupe.js into the plugins folder of your tour.

  2. 2

    Add the plugin element

    Add one <plugin> element to your tour XML and set target to the name of the image layer.

  3. 3

    Fine-tune

    Set attributes such as zoom, size, shape or hires, or change them while the tour runs with set() and tween().

Why it makes a difference.

Made for touch

The lens appears above the finger, so the finger does not cover it, and two fingers change the zoom while the panorama stays still.

Everything in your XML

Every option is an attribute of the plugin element. The events onshow, onhide and onzoomchange let your tour react with its own actions.

Sharp details

Point the lens to a high-resolution copy of the photo and show details the popup cannot show.

Screenshots.

Try the demo
Desktop The lens magnifies a map in a popup on desktop.
Phone The lens above the finger on a phone.
Detail Rounded lens with an orange border.
The lens magnifies a map in a popup on desktop.

Desktop The lens magnifies a map in a popup on desktop.

1 / 3

Settings.

Set as attributes in your tour XML.

SettingTypeDefaultDescription
target TextName of the image layer the lens magnifies, e.g. showcase_photo.
zoom Number2.5Magnification relative to the displayed photo, e.g. 2.5. Always contains the current zoom.
min_zoom Number1.5Smallest zoom that pinch, wheel, keys and set() can reach.
max_zoom Number8Largest zoom that pinch, wheel, keys and set() can reach.
size Number180Width and height of the lens in pixels, including the border.
shape ListcircleShape of the lens: circle, rounded or square. circleroundedsquare
border Number3Border width in pixels; 0 removes the border.
border_color Color0xFFFFFFBorder color, e.g. 0xFF9F0A.
shadow Yes / NotrueDrop shadow under the lens.
background Color0x000000Color shown in the lens beyond the edges of the photo, or transparent.
touch_offset TextautoDistance in pixels between the finger and the lens centre; auto places the lens just above the finger.
trigger ListhoverMouse and pen: show the lens on hover or only while the button is pressed. hoverpress
lens_cursor ListcrosshairMouse pointer over the photo; keep leaves the cursor of the layer. crosshairzoom-innonekeep
pinch Yes / NotrueTwo fingers change the zoom.
wheel Yes / NotrueThe mouse wheel changes the zoom while the lens is shown, instead of zooming the panorama.
keyboard Yes / NotrueThe photo can get keyboard focus; arrow keys move the lens, + and - zoom.
animation Yes / NotrueShort fade when the lens appears; always off when the visitor prefers reduced motion.
hires TextSuffix of a high-resolution copy, e.g. _hd loads showcase_hd.jpg for showcase.jpg.
hires_url TextPath of a high-resolution copy with a different name; has priority over hires.
lens_enabled Yes / Notruefalse switches the lens off and leaves the photo as without the plugin (except for the cursor); true switches it on again.
lens_visible Yes / NofalseRead-only: true while the lens is shown.
onshow TextActions called when the lens appears.
onhide TextActions called when the lens disappears.
onzoomchange TextActions called when the zoom changes; get(zoom) returns the new zoom.
Example
<plugin name="loupe_showcase"
        url="%CURRENTXML%/plugins/detailloupe.js"
        keep="true"
        target="showcase_photo"
        zoom="3" size="220" shape="rounded"
        hires="_hd"
        onzoomchange="trace('zoom=', get(zoom));" />

Features

  • One lens for mouse, pen and touch (Pointer Events)
  • Lens above the finger, beside it at the screen edge
  • Pinch, mouse wheel and keyboard change the zoom; the panorama does not move
  • Optional high-resolution source (file suffix or explicit URL)
  • Circle, rounded or square lens; size, border, shadow and colors
  • Several photos, each with its own settings; changing image URLs, popups that open and close, crop
  • Every setting changeable at runtime with set() and tween()
  • Events onshow, onhide and onzoomchange for your own actions
  • Keyboard access and reduced-motion support
  • One file for krpano 1.23.2–1.24, registered and unregistered viewers
  • Limits: image layers only (no hotspots, VR or rotated layers); Protect Tool -pplg viewers are not supported

What's included

  • plugins/detailloupe.js – the plugin for krpano 1.23.2–1.24
  • Demo tour with one panorama and two photos (add your own krpano viewer)
  • Manual (English)