AddLabel WebGL

by cbcomputer » Fri Aug 31, 2018 9:37 am

Bonjour,
j'essaye d'ajouter un label dynamique apres le chargement du plugin WebGl ViewHome mais ca marche pas
pouvez vous m'aider ?
Merci

Code: Select all


 var retour = viewHome("viewerCanvas",    // Id of the canvas
            homeUrl,           // URL or relative URL of the home to display
            onerror,           // Callback called in case of error
            onprogression,     // Callback called while loading
            {
                roundsPerMinute: 0,                    // Rotation speed of the animation launched once home is loaded in rounds per minute, no animation if missing or equal to 0
                navigationPanel: "none",               // Displayed navigation arrows, "none" or "default" for default one or an HTML string containing elements with data-simulated-key
                // attribute set "UP", "DOWN", "LEFT", "RIGHT"... to replace the default navigation panel, "none" if missing
                aerialViewButtonId: "aerialView",      // Id of the aerial view radio button, radio buttons hidden if missing

                levelsAndCamerasListId: "levelsAndCameras",          // Id of the levels and cameras select component, hidden if missing
                /* level: "Roof", */                                    // Uncomment to select the displayed level, default level if missing */
                /* selectableLevels: ["Ground floor", "Roof"], */       // Uncomment to choose the list of displayed levels, no select component if empty array */
                /* camera: "Exterior view", */                          // Uncomment to select a camera, default camera if missing */
                /* selectableCameras: ["Exterior view", "Kitchen"], */  // Uncomment to choose the list of displayed cameras, no camera if missing */
                activateCameraSwitchKey: true                        // Switch between top view / virtual visit with space bar if not false or missing */
            });



            //r = <label level='level0' x='1222.611' y='218.17773' elevation='250.0' pitch='0.0'>
              //  <textStyle fontSize='100.0' />
                //<text>OTA</text>
            //</label>


            // var l = this.createLabel(r, "test");
            //this.setLabelAttributes(l, "label", r);
           // this.home.addLabel(l);

        

        setTimeout(macreationlabel, 5000,retour);

           
        function macreationlabel(retour) {

            var mylabel = new Label();
            mylabel.x = '1200.00';
            mylabel.y = '218.00';
            mylabel.pitch = '0.0';
            mylabel.elevation = '250.0';
            mylabel.text = "toto";
            mylabel.level = 'level0';
            mylabel.setStyle("fontSize='100.0'");
                    

            this.retour.home.addLabel(mylabel);
          
            
           
        }


    </script>