Flight Management


Introduction

SuperMap iClient3D for WebGL provides a flight management module for managing flight browsing scenarios in the scene.

    • Description: The flight management module reads the fpf file edited and generated by SuperMap iDesktop, and constructs routes and stops.
    • Application scenario: The flight management module is very suitable for the automatic browsing of three-dimensional scenes, as well as the background introduction of browsing to related scenic spots. The visual effects are shocking and the experience is smooth.

Use

1. Generate fpf file.

Use Supermap iDesktop to edit each site (including latitude and longitude elevation information, camera heading pitch roll parameters, site waiting time, speed, etc.) to generate fpf files.

2. create a route collection object

                    var routes = new SuperMap3D.RouteCollection();

3. load the fpf file

                    routes.fromFile(url);

4. Create flight management objects

                    var flyManager = new SuperMap3D.FlyManager(scene,routes);

5. If necessary, add the corresponding monitoring of site arrival events

                    flyManager.stopArrived.addEventListener(function(routeStop){
                            //to do
                            //Note: If the asynchronous processing is done when the site arrival event is activated, you should use routeStop.promise to handle it, such as playing a piece of audio:
                            audio.play();
                            var defer = SuperMap3D.when.defer();
                            routeStop.promise = defer;
                            audio.onended = function(){
                                defer.resolve(true);
                                routeStop.promise = undefined;
                            };
                            //If it is a synchronous execution event, it can be executed sequentially.
                    });

6. Start flying

The camera starts to fly with the parameters set in the stations. According to the settings in the fpf file, each station can have different speeds and camera parameters, etc. There are two default flight modes: timed flight mode and constant speed flight mode. Timing mode: the camera's flight interval between every two stations is the same, the default is 10 seconds; Constant speed mode: the camera always keeps the same speed during the whole flight, flying at a constant speed, the speed is determined by the settings in the fpf file, and it can also be adjusted in real time during the flight.

                    flyManager.play();

7. Pause

You can pause at any time during the flight, and then execute flyManager.play() to continue the flight from the current paused position.

                     flyManager.pause();

8. stop

You can stop the flight at any time during the flight, and then execute flyManager.stop() to restart the flight from the starting position.

                     flyManager.stop();

The flight effect is as follows:

Copyright © 2000-2023 SuperMap Software Co., Ltd. All rights reserved Beijing Public Network Security 11010502008721 A test capital word 11002074