1. Loading SceneControl and Default Scene |
SceneControl is the 3D scene control, which is mainly used to view the work window of the 3D operations, such as view the 3D scene, view the dynamic fly, control layers, etc.
A 3D scene control (SceneControl) corresponds to a 3D scene (Scene), indicating that a 3D scene window only displays a 3D scene.
This section mainly shows how to load a 3D scene control and open the default 3D scene.
Interface | Description | |
---|---|---|
layer3DServicesList | Gets the 3D layer set service list which is published by the SuperMap iServer. | |
asyncHelper | Sets the asynchronous assistant of the current setting, which allows users obtain layers in the scene by the way of asynchronous download. | |
scene | Obtains the 3D scene. A 3D scene control only supports a 3D scene, but you can use the open interface of the scene to open different scenes, and you need to close the old scene before opening a new scene. | |
sceneAction | Gets or sets the current operation type of the user. | |
sceneServicesList | Gets all the 3D scene service lists published by the SuperMap iServer. |
Interface | Description | |
---|---|---|
addEvent | Adds events to the map control, and bind events with the callback functions. Indicating that the operation of the handler callback function is completed when the event specified by the eventName occurs. | |
checkPluginVersion | Determines whether the version of the local control is the latest. If not, get the download address of the new version. | |
getPluginVersion | Gets the version number of the local plugin. | |
pixelToGlobe | Converts the 2D point Point in the screen into the 3D point Point3D in the geographic coordinate system. | |
removeEvent | Removes the specified callback function handler which is bound with the event. | |
resetTerrain | Resets the terrain layer. You need to call this function to refresh the terrain display when the terrain layer is added, deleted or set to be visible or invisible. | |
save | Saves the current scene configuration as an XML file in GML standard, and upload to the server. | |
setRefreshRaster | Sets whether the real-time rasterization is refreshed. If there are display problems for the raster data in the 3D system, this function can be called to refresh the display of raster data only. | |
viewEntire | Zooms the 3D map scene to full extent. |
New a folder named “GettingStarted” anywhere, the users also can customize the folder name.
Put the picture folders "images" in the script library folder "lib" and the folder samplecode/samplecode into the folder “GettingStarted” .
Create a folder named “Scripts” which is used to store script files in the folder " GettingStarted ".
Then create two script files named "“SuperMap.Include.js" and "GettingStarted.js" respectively in the folder "Scripts”", where the "GettingStarted.js" file implements the specific functions, the "SuperMap.Include.js" file is the reference file list of the code library. Note that the two js files need to be saved as the UTF-8 format. Add the following code in the "SuperMap.Include.js" folder:
JavaScript | copy code |
---|---|
|
JavaScript | copy code |
---|---|
|
JavaScript | copy code |
---|---|
|
Figure1 Load the map control and the default scene