SuperMapTerrainProvider

new SuperMap3D.SuperMapTerrainProvider(options)

Provide terrain tiles through STK terrain service or SuperMap iServer REST API.
Name Type Description
options Object an object containing the following properties:
Name Type Default Description
url String The url of the terrain service.
proxy Proxy optional service agent.
requestVertexNormals Boolean false optional Whether to request normals (for lighting effects), the default is not requested.
requestWaterMask Boolean false optional Whether to request the water surface flag (used for water surface special effects), the default is not requested.
ellipsoid Ellipsoid optional Ellipsoid, default is WGS84.
credit Credit | String optional Service description information.
isSct Boolean true optional Whether it is the TIN terrain service released by iServer, and the stk terrain is set to false.
isShowGlobe Boolean optional Whether to exclude invalid terrain areas, the default is true (global display).
invisibility Boolean optional Whether to enable the function of setting terrain display or hiding, the default is false.
packingRequest PackingRequest optional Batch request encoding method.
Example:
var  terrainProvider = new SuperMap3D.SuperMapTerrainProvider({
	                        url : ‘http://localhost:8090/Terrain’,
		                    requestWaterMask : true,
		                    requestVertexNormals : true,
		                    isSct : true
                     });
var viewer = new SuperMap3D.Viewer(‘Container’,{
                  terrainProvider : terrainProvider
             });

Members

credit : Credit

Get the description information of this terrain service.

currentVersion : String

Get or set the version of the currently used terrain data. Currently only supports tin terrain data.

customRequestHeaders : Object

Get or set a custom request header.

hasVertexNormals : Boolean

Get whether the current terrain has vertex normals. It cannot be called before SuperMapTerrainProvider#ready returns TRUE.

hasWaterMask : Boolean

Whether there is a water mark.

readonlyhistoryVersions : String

Get all historical version information of terrain data. Currently only supports tin terrain data.

indexedDBSetting : Object

Get or set whether the indexedDB cache of the terrain is enabled (IE browser does not support it).
Example:
//Set whether to save the terrain cache to the browser's indexedDB database
viewer.terrainProvider.indexedDBSetting.isOpen = true

isCreateSkirt : Boolean

Get or set whether to create a skirt. The skirt is used to avoid terrain cracks. The default is true to display normally, otherwise false to close.

isShowGlobe : Boolean

Get or set whether to exclude invalid terrain areas (for TIN terrain), the default is true, and the global display.

packingRequest

Batch request encoding method.
See:

ready : Boolean

Get whether the terrain service is ready.

readonlyreadyPromise : Promise.<Boolean>

Get the ready state promise of this terrain service.

requestVertexNormals : Boolean

Whether to request vertex normals.

requestWaterMask : Boolean

Whether to request the water surface flag.

subdomains : String

Get or set the subdomain name. Through this interface, data can be requested from the specified subdomain.

tilingScheme : GeographicTilingScheme

Get the projection object (latitude-longitude or Mercator projection) of the terrain service.

visible : Boolean

Get or set whether the terrain is visible. Using this interface, you can set the visibility of terrain without refreshing the earth. Need to set invisibility to true when creating CesiumTerrainProvider.
Example:
var viewer = new SuperMap3D.Viewer('Container',{
        //Create an instance of the terrain service provider, the url is the TIN terrain service published by SuperMap iServer
        terrainProvider : new SuperMap3D. SuperMapTerrainProvider({
            url : URL_CONFIG.SiChuan_TERRAIN,
            isSct : true, //Terrain service originating from SuperMap iServer needs to set isSct to true
            invisibility:true//When hiding terrain, you need to set invisibility to true
        }),
    });
         //Add the image service published by SuperMap iServer
         var layer = viewer.imageryLayers.addImageryProvider(new SuperMap3D.SuperMapImageryProvider({
        url : URL_CONFIG.SiChuan_IMG
     }));

Methods

getLevelMaximumGeometricError(level)Number

Get the maximum geometric error for this level.
Name Type Description
level Number tile Level
Returns:
Maximum geometric error.

getTileDataAvailable(x, y, level)Boolean

Get whether the tile data corresponding to x y level is available.
Name Type Description
x Number x coordinate。
y Number y coordinate。
level Number tile level。
Returns:
is useable