• Resolved Michael M?ller

    (@unomobil)


    Is it possible to add a fixed element to the “Control view” ?.

    I would like to have an icon at left on the screen, where I have a Map icon, that link to a page or scene with a map, to get an overview. just like the navigation an control are showed in the view, so the user don’t have to look around for my marker in the scene, to find the map icon. :-).

    Demo: https://hederytmer.unoweb.dk

    At the moment, I am using this Crazy image for “navigation, here the google maps icon are directing to: https://hederytmer.unoweb.dk/pladskort/

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Avirtum

    (@avirtum)

    It can be done with the js code. Below is the code you can test. It adds the extra loading bar to the container.

    JS Custom Section

    
    const plugin = this;
    const $ = jQuery;
    const $loading = $('<div>').addClass('myloading').text('loading');
    
    plugin.$container.append($loading);
    
    plugin.$container.on('ipanorama:scene-progress', (e, data) => {
       const flag = data.progress.loaded == data.progress.total;
       $loading.toggleClass('active', !flag);
    });

    CSS Custom Section

    .myloading {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: none;
        justify-content: center;
        align-items: center;
        pointer-events: none;
    }
    .myloading.active {
        display: flex;
    }
    Thread Starter Michael M?ller

    (@unomobil)

    Great, thanks. I will try to insert it.
    i have never been working with JS, so I am completely blank at this ??.

    Thread Starter Michael M?ller

    (@unomobil)

    hmm… i am not getting any thing, after adding the codes. ?

    I might not described my needs the right way ?? .
    Just as there are a: max the view option in the right corner. I would like to have an option in one of the other corners, with an icon of a map, that link to a page, or a marker, instead of having to make a marker on the ground, in each scenes.

    Plugin Author Avirtum

    (@avirtum)

    I created a sample with the top-right button, if a user click on it he will go to the google.com. Sample – https://imgur.com/a/e8N13OQ

    Styles

    .mybutton {
        display: block;
        position: absolute;
        top: 5px;
        right: 5px;
        width: 32px;
        height: 32px;
        background: #000;
        text-decoration: none;
    }

    JS

    
    const plugin = this;
    const $ = jQuery;
    const $btn = $('<a>').addClass('mybutton').attr({'href':'https://google.com','target':'_blank'});
    
    plugin.$container.append($btn);
    • This reply was modified 1 year, 7 months ago by Avirtum.

    I’ve been following along with this. This works, my question would be, “I get a black box for the link, (I can change the color though.) how do I add an icon there?” I may have it, would this be correct? Changing the background-image to any icon file?

    .mybutton {
    display: block;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background-image:url(https://kasdorf.name/SMLC/pics/Compass-North-Red-N2.png);
    background-size:contain;
    text-decoration: none;
    }

    There is a small issue depending on which widget is used. i.e. In the “List” Widget, the Scene button is already there, so it sits on top of it. It needs to go beside it if possible?

    • This reply was modified 1 year, 7 months ago by kaz2.

    Never mind, changing the “right: 5px” to “right: 25px” fixed that.

    Thread Starter Michael M?ller

    (@unomobil)

    use left: instead of right: :-). or add more px.

    I just did it.

    Thread Starter Michael M?ller

    (@unomobil)

    Tanhkt, it work great , just what I needed :-).

    Just curious… What was the first code for ?

    Plugin Author Avirtum

    (@avirtum)

    “What was the first code for?” Can you be more specific about what you’re talking about?

    Thread Starter Michael M?ller

    (@unomobil)

    this one:

    const plugin = this; const $ = jQuery; const $loading = $(‘<div>’).addClass(‘myloading’).text(‘loading’); plugin.$container.append($loading); plugin.$container.on(‘ipanorama:scene-progress’, (e, data) => { const flag = data.progress.loaded == data.progress.total; $loading.toggleClass(‘active’, !flag); });

    Plugin Author Avirtum

    (@avirtum)

    I see. It’s show the custom message by center when the scene data is loading. It uses ‘ipanorama:scene-progress’ event for this action. This is just an example how to customize a virtual tour a little by code.

    Thread Starter Michael M?ller

    (@unomobil)

    okay, thank for your help ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘ad fixet element to view (Widget)’ is closed to new replies.