Class: S3MTilesLayer

S3MTilesLayer

new S3MTilesLayer()

S3M (Spatial 3D Model) layer class is used to load 3D tiles, including oblique photography models, BIM models, point cloud data, fine models, vector data, symbols, etc. Add the published 3D service in *. s3m format to the scene using Scene. addS3MTilesLayerByScp (URL, options). Note: The service published through local 3D tiles (. scp) does not support the field thematic map function.

Name Type Default Description
options.gl WebGLRenderingContext optional

WebGL context.

options.servers Array optional

An array containing server addresses.

options.urls Array optional

An array containing XML addresses.

options.position Array optional

Layer insertion point location (longitude, latitude, altitude).

options.name Array optional

Layer name.

options.WaterEffectSet Object optional

Water surface special effect parameters.

options.urlType UrlType optional

Entity data request format.

options.urlArguments String optional

The parameters carried by the data service URL.

options.format Boolean optional

Does it support texture compression.

options.cacheEntityCount Number 0 optional

The number of entities in tiles during LOD scheduling.

options.layerBounds Rectangle optional

Layer range. (Abandon the set method and keep the get method)

options.tileSpliteType String 'LOCAL' optional

Types of tile segmentation.

options.volumeObj Object optional

Body rendering parameter object.

options.boundingSphereColc Array optional

The root node boundingsphere.

options.MaxInstensity Number optional

Maximum intensity.

options.MinInstensity Number optional

Minimum intensity.

options.MaxHeight Number optional

Maximum height.

options.MinHeight Number optional

Minimum height.

options.HorizontalLine Number optional

Horizontal contour lines. (Abandoned)

options.fileType String optional

File type (data type).

options.ProcessType String optional

Handling method.

options.cullEnabled Boolean false optional

Whether to remove the backside (default is no, i.e. double-sided rendering).

options.cacheKey String optional

The 3D tile key is the 3D tile key set by iServer for publishing 3D tile services.

options.keyframes Object optional

point of time.

options.duration Object optional

Animation duration.

options.interpolationType Object optional

Interpolation type, default value is Linear.

options.emissionTextureUnit EmissionTextureUnit optional

Sets up emissive texture units.

options.cullMode WindingOrder optional

When rendering on one side, you can set the rendering to be clockwise or counterclockwise.

options.CategoryFieldName CategoryFieldName optional

The characteristic value field of point cloud data.

Example
//new S3MTilesLayer instance
var S3MTilesLayer = new S3MTilesLayer({
 gl : gl,
 servers : ["http://localhost:8090"],
 urls : ["http://localhost:8090/data/tile_001.xml","http://localhost:8090/data/tile_002.xml"],
 position : [10,20],
 name : ["S3MTilesLayer"]
});

Members

allTilesLoadedEvent

The event where all tiles have completed loading from the current perspective. This event will be triggered when all tiles have been loaded.

attributeDownloadedEvent

The event of determining whether the property file has been downloaded completely. This event will be triggered when all property files have been downloaded. Explanation: When using some attribute fields to set a thematic map, setting queryFiledNames will start downloading the attribute files, and there is no need to enable isAttributesSave for IndexedDB.

Example
layer.queryFieldNames = ['FLOOR','HEIGHT']

bloomEffectS3MPolylineEffect

Get S3M layer flood effect object

bloomEnableboolean

Obtain whether the floodlight is turned on or not

brightnessNumber

Set the brightness value of the layer to adjust the color.

clearMemoryImmediatelyBoolean

Whether to release memory in a timely manner, default value is true. If set to false, a value needs to be set for setCacheSize. (Abandoned) Currently, resources can be dynamically allocated based on the type of graphics card. If you want to release memory immediately, please use SuperMap3D. MeryMnager. setCacheSize() to release it as a whole, without the need to set individual layers.

Default Value:
true
See:
Example
设置缓存空间大小,单位MB
SuperMap3D.MemoryManager.setCacheSize(512);
选择不及时释放内存
SuperMap3D.when.all ([promise],function (layers){
layers[0].forEach ((layer)=>{
layer.clearMemoryImmediately = false
})

clipLineColorColor

Get or set the color of the crop line when performing BOX cropping on S3M layers.

clippingTypeClippingType

Get or set the cropping mode.

clipPlaneColorColor

Get or set the color of the cropped section.

colorStyleNumber

Set or obtain the color blending mode for layer style, applied to fillForeColor and lineColor on layer style3D.

colorTableChangedEvent

The event when the color table application of all volume data tiles is completed from the current perspective. This event will be triggered when the color table application of the volume data tile is completed.

computeHeightBoolean

Used to specify whether to automatically calculate the height of the model in the front-end. The default value is false and the height is not calculated. Setting true for data without height can ensure the normal operation of submergence analysis, contour setting, and other operations.

Default Value:
false

contrastNumber

Set the contrast value of the layer to adjust the color.

coveredMapVectorTileMap RasterTileLayer

Get or set the overlay vector tile layer (used for pasting onto the surface of oblique photography 3D models).

coverImageryLayerImageryLayer

Get or set the overlay image layer (used for pasting onto the surface of oblique photography 3D models), currently does not support pasting the 3857 coordinate system function.

cullEnabledBoolean

Get or set whether to render double-sided (remove backside)

cullModeWindingOrder

When rendering on one side, obtain or set clockwise or counterclockwise rendering.

customRequestHeadersObject

Get or set custom request headers.

dataMaxValueNumber

Obtain the maximum height or intensity value of the data. For point cloud data, this attribute is either a height value or an intensity value (default is intensity value); For other 3D data, this attribute is a height value.

Example
// Obtain the maximum value of data
var dataMaxValue = S3MTilesLayer.DataMaxValue;

dataMinValueNumber

Obtain the minimum height or intensity value of the data. For point cloud data, this attribute is either a height value or an intensity value (default is intensity value); For other 3D data, this attribute is a height value.

Example
// Obtain the minimum value of data
var dataMinValue = S3MTilesLayer.DataMinValue;

Get or set the line symbol for the S3M layer.

enableDepthTestBoolean

Obtain or set whether to perform depth testing on S3M layers

enableHighlightBoolean

Get or set whether the layer is highlighted.

Default Value:
True

gammaNumber

Set the gamma value of the layer to adjust the color.

readonly groupNameString

Get the group name where the layer is located

hasLightBoolean

Get or set whether the layer has lighting effects enabled.

readonly hasWireframeBoolean

Retrieve whether the layer has a wireframe.

headingNumber

Get or set the camera's heading angle (in radians).

heightRangeAttributeNameString

获取或者设置高度范围属性字段名称。

heightScaleNumber

设置图层模型z方向拉升高度比例,默认值为1。(主要用于矢量拉伸的白膜数据)

Default Value:
1

hueNumber

Set the layer tone value to adjust the color.

hypsometricSettingHypsometricSetting

Get or set the layered color representation of a layer.

Example
// Set the hypsometric tint properties of the layer
var hypsometricSetting = new SuperMap3D.HypsometricSetting();
hypsometricSetting.MinVisibleValue = 30;
hypsometricSetting.MaxVisibleValue = 150;
var colorTable = new SuperMap3D.ColorTable();
colorTable.insert(150, new SuperMap3D.Color(1, 0, 0));
colorTable.insert(30, new SuperMap3D.Color(0, 0, 1));
hypsometricSetting.ColorTable= colorTable;
S3MTilesLayer.hypsometricSetting = {
hypsometricSetting : hypsometricSetting,
analysisMode: SuperMap3D.HypsometricSettingEnum.AnalysisRegionMode.ARM_ALL
}
// Get the hypsometric tint properties of the layer
var hyp = S3MTilesLayer.hypsometricSetting ;

iconRelatedTextLayerIDNumber Undefined

Get or set the ID of the text layer. This interface specifies a text layer based on the ID, allowing the icon layer to follow and avoid it. Note: It will only take effect when the OverlapDisplay Options. allIconWithTextDisplay is true.

Default Value:
undefined

readonly idNumber

Get layer ID

ignoreNormalBoolean

Gets or sets whether normals are automatically calculated in the GPU, with a default value of false. When the value is true, normals are automatically calculated in the GPU without using the normals that come with the data. When the value is false, normals are not automatically calculated in the GPU and the data's built-in normals are used.

ignoreVertexColorBoolean

Do you want to ignore the vertex color of the data itself

indexedDBSettingObject

Retrieve or set the indexedDB attribute information (not supported by IE browser). Among them, when setting the indexeDB property, there are three Boolean branch properties: isGeoTilesSave - whether to save tiles; IsAttributesSave - whether to save attributes; IsGeoTilesRootNodeSave - Whether to save the root node.

Example
// Open the Config layer of oblique data.
var layer = scene.layers.find('Config');
// Set whether to save tiles.
layer.indexedDBSetting.isGeoTilesSave = true

isOverlapDisplayedBoolean

Get or set whether the overlapping parts of layers are displayed. When set to true, the overlapping parts are still displayed and do not participate in avoidance. The default value is false.

Default Value:
false

labelStyleS3MTilesLabelStyle

Get or set the style of layer text labels.

layerBoundsRectangle

Get or set the layer range. (Abandon the set method and keep the get method)

LoadingModeNumber

Get or set the loading mode when switching point cloud levels, divided into append mode and replace mode.

LoadingPriorityLoadingPriorityMode

Get or set the loading priority mode, which can be divided into depth first, layer first, spatial index, and depth first non-linear switching.

Default Value:
Child_Priority : 1

loadVolumeDataBoolean

Get or set whether to load body data, default value is true.

Default Value:
true

lodRangeScaleNumber

Get or set the LOD level switch distance scaling factor for a layer.

deprecated maximumMemoryUsageNumber

Default Value:
512

maximumScreenSpaceErrorNumber

S3M slice root node pixel filtering threshold. When the pixel value of the screen space occupied by the slice enclosing sphere is less than this threshold, it will be filtered out. The default value is 0, and no filtering will be applied

maxTransparentAlphanumber

Get or set the maximum transparency threshold (foreground color transparency set to [0, maxTransparentAlpha] will be considered as the same transparency effect, and [maxTransparentAlpha, 1] will have a transparent transition effect).

Default Value:
0.98

maxVisibleAltitudeNumber

Get or set the maximum visible height of a layer.

minTransparentAlphanumber

Get or set the minimum transparency threshold (values below this will be filtered out)

Default Value:
0.1

minVisibleAltitudeNumber

Get or set the minimum visible height of a layer.

mipmapEnabledBoolean

Used to specify whether to create mipmaps for textures. The default value is true, indicating the creation of mipmaps; Setting to false means not creating.

Default Value:
true

mixColorTypeMixColorType

设置或者获取图元对象的颜色混合模式,如作用于setObjsColor方法。

multiChooseBoolean

Get or set whether layers support multiple selection

multiTemporalUseWaterBoolean

Turn on or off the water surface effect with time-series water flow data.

Default Value:
{false}

readonly nameString

Get layer name

orderIndependentTranslucencyBoolean

获取或者设置图层中的物体是否参与顺序无关透明渲染,默认是true。 当场景整体启用顺序无关的透明渲染时,此接口可以强制指定某些图层的透明物体被当作非透明物体渲染。从而避免一些瑕疵产生。

Default Value:
true

overlapWeightAttributeNameString

Get or set the attribute field name that specifies the avoidance weight, and distinguish the avoidance priority based on this field.

particleVelocityFieldEffectParticleVelocityFieldEffect

Obtain three-dimensional flow field effects.

deprecated partlyTransparentBoolean

Default Value:
false

PBRMaterialTypeNumber

Get or set PBR material type. (Abandoned)

Default Value:
true

pointCloudShadingObject

Get the encapsulated point cloud rendering parameter object pointCloudShading.

priorityScaleNumber

Obtaining or setting update priority coefficients can control the priority order of updates between multiple layers.

constant rainEffect

Set or obtain factors affecting rainwater material.

rasterPerFrameBoolean

Whether to draw rasterized vector lines in real-time to ensure consistency in line thickness at different levels.

Default Value:
false

receiveObjectClampBoolean

Get or set whether the layer accepts pasting objects. The default setting is true, and when set to false, objects will not be pasted.

Default Value:
true

RGBTOBGRBoolean

When the texture compression format is webp, when the texture is reversed from red to green, use the color channel RGB to BGR.

Default Value:
false

S3MTileLoadedEventEvent

Get the event triggered when the S3M tile is loaded, and the handling function of this event will be passed in the tile's bounding sphere as a parameter.

saturationNumber

Set the saturation value of the layer to adjust the color.

selectBoundRectangle

Get and set the selection range.

selectColorTypeSelectColorType

Get or set the display style of the selected object, whether the model texture is mixed with color or displayed as a solid color.

selectedColorColor

Get or set the highlight color displayed on the selected layer. When the current mode is wireframe mode, it is used to obtain or set the highlight color of the selected contour line.

selectedLineColorColor

Get or set the highlight color of the wireframe outline of the selected object in the layer.

Default Value:
new Color(1.0,1.0,1.0,1.0)

selectedSkeletonIdNumber

Get or set the sub object ID.

selectedTranslateCartesian3

Get or set the offset position of the selected object.

selectEnabledBoolean

Get or set whether the layer is optional.

selectionFiltrateByTransparencyNumber

Get or set transparent selection filtering threshold.

shadowTypeSHADOWTYPE

Get or set the range type of shadow displayed by the model in the layer.

shadowVolumeBottomHeightNumber

Get and set the minimum height for the shadow body to rise downwards.

shadowVolumeTopHeightNumber

Get and set the maximum height at which the shadow body can be lifted upwards.

showCalloutBoolean

Get or set whether to display the traction line.

showIconBoolean

Get or set whether to display icons.

showLabelBoolean

Get or set whether to display labels.

skeletonSelectedColorColor

Get or set the highlighted color for selecting sub objects.

skeletonSelectEnableBoolean

Gets or sets whether sub objects in a layer are selectable.

splitDirectionSplitDirection

Get or set the direction of the roller blind.

splitPositionNumber

Get or set the position of the roller blind.

style3DStyle3D

Get or set the layer style.

Example
// Get the layer style
var style = S3MTilesLayer.style3D;
// Set the layer style
var style3D = new SuperMap3D.Style3D();
var color = new SuperMap3D.Color(1.0, 0.0, 0.0);
style3D.fillForeColor = color;
S3MTilesLayer.style3D = style3D;
// The layer must be refreshed after setting
S3MTilesLayer.refresh();

subdomainsString

Get or set the subdomain name. This interface allows you to request data from a specified subdomain.

swipeEnabledBoolean

Gets or sets whether to enable the swipe function.

swipeRegionBoundingRectangle

Gets or sets the quadrilateral region for the swipe.

temporaInfosS3MCategoryFieldInfo

Retrieve an array of external attribute field information associated with a layer.

temporalCount

Obtain multiple temporal frame rates. This interface has been abandoned. The S3M layer supports multiple businesses with their own time sequence information, and each time sequence can have a different number of time sequences, so it cannot be represented by the same time sequence number

temporalSettingTemporalSetting

Retrieve objects with multiple temporal parameters.

textureUVSpeedNumber

Get or set the motion speed of the model texture on UV coordinates.

themeStyleCesium3DTileStyle

Obtain or set the theme image style, currently supporting the use of ground mounted vector tiles in the front-end to set the color and texture of the theme image based on the ID. Note: When using model data to create thematic maps and generate tiles, it is necessary to change the "Attribute Storage Type" to "ATTRIBUTR" in the desktop software.

translucencyByDistanceboolean

Get or set whether the layer has the maximum visible distance transparency effect enabled.

Default Value:
{false}

transparentBackColorColor

Get or set the transparent target color of the layer.

transparentBackColorToleranceNumber

Get or set the transparency tolerance of the layer.

urlTypeUrlType

Request format for obtaining or setting layer data.

vertexColorLinearBoolean

Is the vertex color of the model in linear space, default to gamma space

visibleBoolean

Get or set layer visibility.

Example
// Get visibility
var isVisible = S3MTilesLayer.visible;
// Set invisible
S3MTilesLayer.visible = false;

visibleDistanceMaxNumber

Get or set the maximum visible distance value of the layer, in meters. This distance value is used for distance filtering function. When the distance between the camera and the layer is greater than this distance value, the layer will not be visible.

visibleDistanceMinNumber

Get or set the minimum visible distance value of the layer, in meters. This distance value is used for distance filtering function. When the distance between the camera and the layer is less than this distance value, the layer will not be visible.

volNameString

Get or set the body data name.

waterParameterWaterParameter

Obtain water surface effect parameters.

wireFrameModeNumber

Get or set the layer wireframe mode.

wireFrameNearfarRangeCartesian2

Obtain or set the effect that the transparency of layer wireframes gradually decreases as the camera's field of view distance increases, in meters. The default value Cartesian2 (100020000) indicates that the wireframe gradually fades from 1000 meters until it completely disappears at 20000 meters.

Methods

addExcavationRegion(options){Boolean}

Add excavation face.

Name Type Description
options Object

Excavation area parameters:

Name Type Description
position Array

Location information of the excavation area.

name String

Name of excavation area.

Returns:
Type Description
Boolean Boolean, returns true for success, false for failure.

addFlattenRegion(options){Boolean}

Add a pressure plane to flatten the surface of the model.

Name Type Description
options Object

Flatten area parameters:

Name Type Description
position Array

Specify the location information of the flattened area.

name String

Flatten area name.

Returns:
Type Description
Boolean Success returns true, failure returns false.
Example
S3MTilesLayer.addFlattenRegion({
    position : [13.0500640714, 47.8279189759, 400.0,
                13.0500640714, 47.8230189759, 400.0,
                13.0530640714, 47.8260189759, 400.0,
                13.0538640714, 47.8230189759, 400.0,
                13.0538640714, 47.8279189759, 400.0],
       name : 'flatten' + SuperMap3D.createGuid()});

addOverlayImage(){Boolean}

S3M layer specifies the range for overlaying images.

Name Type Description
options.name String

Specify the name of the scope.

options.bounds Array

An array of point sets within a specified range.

options.image Element

HTML image element, used for overlaying texture images.

Returns:
Type Description
Boolean Boolean, returns true for success, false for failure.

appendQueryFieldName(value){Promise}

添加查询字段名称。

Name Type Description
value Array

要添加的查询字段名称数组。

Returns:
Type Description
Promise 返回一个Promise对象。
Example
// 添加查询字段
layer.appendQueryFieldName(['name', 'type']);

clearCustomClipBox()

Clears the custom clipping plane.

Example
S3MTilesLayer.clearCustomClipBox();

clearDataRequestRegions()

Remove the scope of control data requests from the layer.

clearModifyRegions()

Clear polygon objects and crop the S3M layer.

datasetInfo(){Promise.Array}

Obtain the name of the layer dataset and the corresponding Id range (applicable for generating tiles from multiple datasets).

Returns:
Type Description
Promise.Array The array contains all information related to the dataset, and each dataset object includes the dataset name, starting ID, and ending ID.
Example
var data =  layer.datasetInfo();
SuperMap3D.when(data,function(dataSet){
       var length = dataSet.length;
       .......
        });

destroy()

Destroy layers, release memory, and free WebGL resources

getAllFieldValues(fieldType){Array}

Retrieve all attribute values of the attribute fields corresponding to the point cloud array.

Name Type Description
fieldType S3MFieldType optional

Attribute value

Returns:
Type Description
Array The type depends on the type of the field value
Example
layer.getAllFieldValues(SuperMap3D.S3MFieldType.PointCloudClassification)

getAttributesById(id)

Retrieve local object property information (scvd in IndexedDB, not supported by IE browser).

Name Type Description
id Number

Indexes.

Example
layer.getAttributesById(id).then(function (data) { })

getAttributesByVertexId(vertexId)

获取顶点属性信息。

Name Type Description
vertexId Number

Indexes.

Example
layer.getAttributesByVertexId(vertexId).then(function (data) { })

getFieldInfos()

Retrieve an array of attribute information for all objects in the layer.

Returns:
Example
layer.getFieldInfos().then(function (infos) { })

getFieldValuesByID(id){Promise.<fieldValue>}

Retrieve the property values of the object based on its ID.

Name Type Description
id Number

Query the model ID.

Returns:
Type Description
Promise.<fieldValue> Return the attribute value result
Example
const layerInfos = await layer.getFieldInfos(); // First, get the attribute information of all objects on the layer.
layer.getFieldValuesByID(id).then(function (fieldValue) { 
     const {values, indexs} = fieldValue;
     const fieldInfos = []; 
     indexs.forEach((i)=>{
         fieldInfos.push(layerInfos[i]);  // Get the attribute field by index, corresponding to the attribute values.
     })
})

getHistoryDataKeys()

Retrieve historical data key values.

getLodRangeScale(){Number}

Obtain the lOD level switching distance scaling factor of the layer.

Returns:
Type Description
Number LOD level switch distance scaling factor.
Example
var num = S3MTilesLayer.getLodRangeScale();

getObjsColor(){Color}

Retrieve the color table of the corresponding graphic object based on its ID

Returns:
Type Description
Color The color corresponding to the ID

getObjsVisible(id){Boolean}

Obtain object visibility for the specified ID.

Name Type Description
id Number

The specified object ID.

Returns:
Type Description
Boolean Whether the object is visible.
Example
var id = 12;
S3MTilesLayer.getObjsVisible(id);

getPointCloudGroupBounds(name){undefined|*}

Obtain the corresponding range of point cloud grouping.

Name Type Description
name String

The name of the corresponding scope.

Returns:
Type Description
undefined | * Obtain the boundaries of the point cloud group by its name, and return undefined if not obtained.
Example
layer.getPointCloudGroupBounds(name);

getPointCloudGroupInfos()

Obtain grouping information for point clouds.

Example
layer.getPointCloudGroupInfos();

getQueryParameter(){Object}

Retrieve attribute query parameters.

Returns:
Type Description
Object Attribute query parameter object.

getSelection(){AssociativeArray}

Get the selection set.

Returns:
Type Description
AssociativeArray A relational array containing all selected IDs.
Example
S3MTilesLayer.getSelection();

getVisibleInViewport(index){Boolean}

Obtain the visibility of the viewport corresponding to the layer.

Name Type Description
index Number

Indexes.

Throws:

The index value range is 0-3.

Type
DeveloperError
Returns:
Type Description
Boolean Visible visibility.

getVolNames(){Array}

Retrieve all volume data names.

Returns:
Type Description
Array All volume data name arrays.

refresh()

Refresh the layer.

refreshVolume()

Refresh body data

releaseSelection()

Release the selection set.

Example
S3MTilesLayer.releaseSelection();

removeAllExcavationRegion()

Remove all excavation faces.

removeAllFlattenRegion()

Remove all pressure planes.

Example
S3MTilesLayer. removeAllFlattenRegion();

removeAllObjsColor()

Remove the color settings from all graphic elements.

removeAllObjsExtendHeight()

Remove all set stretching heights. (Abandoned)

removeAllObjsOffset()

Remove the offset of all graphic elements

removeAllObjsTranslate()

Remove all object offsets.

removeExcavationRegion(name){Boolean}

Remove the excavation face with the specified name.

Name Type Description
name String

Name of excavation face.

Returns:
Type Description
Boolean Boolean, returns true for success, false for failure.

removeFlattenRegion(name){Boolean}

Remove the pressure plane with the specified name.

Name Type Description
name String

The name of the compressed surface to be removed.

Returns:
Type Description
Boolean Return true for successful removal and false for failure.
Example
S3MTilesLayer. removeFlattenRegion(regionName);

removeObjsColor(ids)

Remove the color set for the corresponding graphic element from the graphic element ID list.

Name Type Description
ids Array

List of graphic element IDs.

removeObjsExtendHeight(ids)

Remove the set stretching height of the object based on the element ID list (discard)

Name Type Description
ids Array

Element ID List

removeObjsOffset(ids)

Remove the offset of the corresponding graphic element based on the graphic element ID list

Name Type Description
ids Array

Element ID List

removeObjsTranslate(ids)

Remove the offset of the specified ID object.

Name Type Description
ids Array

The set of IDs of the object to be removed from the offset.

removeOverlayImage(name){Boolean}

Remove the coverage area with the specified name.

Name Type Description
name String

Name of the coverage area.

Returns:
Type Description
Boolean Success returns true, failure returns false.

removePBRMaterial()

Used to remove PBR material.

setAnimation(options)

Animate the layers.

Name Type Description
options Object

参数选项

Name Type Description
keyframes Object

关键帧动画状态

duration Object

Animation duration.

InterpolationType InterpolationType

表示插值类型,默认值Linear(线性插值)。

Example
var promise = layer.setAnimation({
     keyframes: {
         '0%': { // Time point
             translation: SuperMap3D.Cartesian3.fromDegrees(layer.lon, layer.lat, layer.height),
             rotation: new SuperMap3D.HeadingPitchRoll(0, 0, 0),
             scale: new SuperMap3D.Cartesian3(1, 1, 1),
        },
     // '20%': {},
        '100%': {
             translation: SuperMap3D.Cartesian3.fromDegrees(layer.lon, layer.lat, layer.height),
             rotation: new SuperMap3D.HeadingPitchRoll(0, 0, 0),
             scale: new SuperMap3D.Cartesian3(5, 5, 5)
        },
     },
     duration: 5, // Animation duration in seconds
     interpolationType: SuperMap3D.InterpolationType.Linear // Interpolation type, default is Linear
})

setBatchObjsTranslate(option)

Batch set object offset.

Name Type Description
option Object

The set of ID and offset of the object to be removed from the offset.

Example
var option = {
     id1:Cartesian3,
     id2: Cartesian3,
     }
layer.setBatchObjsTranslate(option);

setCategoriesVisible(categories, mode)

Hide display objects based on W-bit feature values.

Name Type Description
categories Array.<Number> | Number

Eigenvalue array, or eigenvalues.

mode CategoryVisibleMode

Hide, Show, Reset.

setClipSection(firstPoint, secondPoint, thirdPoint, renderClipSection)

Set the cutting surface. 注意:2D模式下不支持

Name Type Description
firstPoint Cartesian3

Draw the first point on the sanction cutting surface.

secondPoint Cartesian3

Draw the second point on the sanction cutting surface.

thirdPoint Cartesian3

Draw the third point on the sanction cutting surface.

renderClipSection Boolean

Draw a cropped section.

Example
var p1 =  new SuperMap3D.Cartesian3(-8787.4,2084.7,7021.04335128);
 var p2 =  new SuperMap3D.Cartesian3(-8786.3,2081.8,7024.90146083);
 var p3 =  new SuperMap3D.Cartesian3(-8783.2,2086.8,7021.04335128);
 for(var i = 0;i < layers.length;i++){
    layers[i].setClipSection(p1,p2,p3,true);
  }

setCustomClipBox(options){Boolean}

Adds a custom clipping plane. 注意:2D模式下不支持

Name Type Description
options Object

Cutting surface parameters:

Name Type Description
dimensions Cartesian3

Specify the length, width, and height of the cropping box.

position Cartesian3

Specify the cutting surface position.

clipMode String

指定裁剪模式。 裁剪模式包括以下几类:

clip_behind_any_plane:裁剪掉位于任何裁剪面后面的部分(只要在任意一个裁剪面后方就会被裁剪)。

clip_behind_all_plane:裁剪掉位于所有裁剪面后面的部分(只有在所有裁剪面后方才会被裁剪)。

only_keep_line:只保留裁剪线,裁剪掉其他部分。

Throws:

options and options.dimensions and options.position are required.

Type
DeveloperError
Returns:
Type Description
Boolean Add successfully returns true, fail returns false.
Example
var boxOptions = {
      dimensions : new SuperMap3D.Cartesian3(10, 10, 10)
      position : SuperMap3D.Cartesian3.fromDegrees(120, 40, 20),
      clipMode : "clip_behind_all_plane"
};
S3MTilesLayer.setCustomClipBox(boxOptions);

setCustomClipCross()

Set region cropping parameters. 注意:2D模式下不支持

Name Type Description
options.position Cartesian3 optional

Center point position coordinates.

options.dimensions Cartesian2 optional

The width and height of the cropping area, in meters.

options.heading Number optional

The rotation angle of the cutting surface around the Z-axis, in degrees.

options.pitch Number optional

The rotation angle of the cutting surface around the X-axis, in degrees.

options.roll Number optional

The rotation angle of the cutting surface around the Y-axis, in degrees.

options.extrudeDistance Number optional

The stretching distance of the center point of the cropping area, in meters.

setCustomClipGeometry()

Set polyhedral clipping parameters. 注意:2D模式下不支持

Name Type Description
options.geometry Geometry3D optional

Geometric objects (currently only support convex polyhedra).

options.clippingType ClippingType optional

Crop type.

options.spatialQuery SpatialQuery3D optional

Spatial query object.

Example
var geometry = new Geometry3D(pts)
geometry.extrudedHeight = 100;
var spatialQuery = new SpatialQuery3D();
spatialQuery.build();
layer.setCustomClipGeometry({
 geometry : geometry;
 clippingType : ClippingType.KeepOutside;
 spatialQuery : spatialQuery
 })

setCustomClipPlane(firstPoint, secondPoint, thirdPoint, clipPlaneMode)

Profile analysis. 注意:2D模式下不支持

Name Type Description
firstPoint Cartesian3

Draw the first point of the profile.

secondPoint Cartesian3

Draw the second point of the profile.

thirdPoint Cartesian3

Draw the third point of the profile.

clipPlaneMode ClipPlaneMode

Crop section mode.

Example
var p1 =  new SuperMap3D.Cartesian3(-8787.4,2084.7,7021.04335128);
 var p2 =  new SuperMap3D.Cartesian3(-8786.3,2081.8,7024.90146083);
 var p3 =  new SuperMap3D.Cartesian3(-8783.2,2086.8,7021.04335128);
 for(var i = 0;i < layers.length;i++){
    layers[i].setCustomClipPlane(p1,p2,p3);
  }

setDataRequestRegions(regions)

Set the area range for layer loading and display.

Name Type Description
regions Array | Array

Set one or more polygon request ranges. When requesting S3M data, only request data contained within the polygon area. The polygon request range array consists of multiple vertices, each of which is measured in geographic coordinates represented by latitude and longitude.

setExtrudedPolygons()

Display the specified object on the front floor by floor. (Abandoned)

setFlattenRegionVisibleInViewport(index){Boolean}

Set the flattening area to split the screen.

Name Type Description
index Number

Indexes.

Throws:

The index value range is 0~8.

Type
DeveloperError
Returns:
Type Description
Boolean Visible visibility.

setHistoryDataByKey(key)

Set historical data.

Name Type Description
key String optional

Historical data key values.

setHypsometricSetting(hypsometricSetting, param)

图层按字段做分层设色

Name Type Description
hypsometricSetting HypsometricSetting

Layered coloring

param Param

parameter

setLodRangeScale(lodrange)

Set the lOD level of the layer to switch the distance scaling factor.

Name Type Description
lodrange Number

LOD level switch distance scaling factor.

Example
S3MTilesLayer.setLodRangeScale();

setModifyRegions(regions, mode)

Crop the S3M layer based on polygon objects.

Name Type Description
regions Array

Polygon array.

mode ModifyRegionMode

Crop mode, set the internal or external range for cropping polygon objects. When the value is CLIP_INSIDE, the internal range is cropped, and when the value is CLIP_OUTSIDE, the external range is cropped.

setObjsColor(ids, color)

Set the color of the corresponding graphic element based on the graphic element IDS list.

Name Type Description
ids Array

List of graphic element IDs.

color Color

The color of the graphic element.

setObjsExtendHeight(ids, height)

Set the stretching height of the object based on the IDS list. (Abandoned)

Name Type Description
ids Array

List of graphic element IDs.

height Number

Object stretching height value.

setObjsOffset(ids)

Set object offset based on the object ID list.

Name Type Description
ids Array

List of object IDs.

setObjsTranslate(ids, translate)

Set the offset of the object based on the specified ID.

Name Type Description
ids Array

Specify the ID of the object to be offset.

translate Cartesian3

Specify the offset.

setObjsVisible(ids, isVisible)

According to the list of element IDs, set the visibility of the corresponding element and establish a mutually exclusive visible relationship with other elements in that layer.

Name Type Description
ids Array

List of graphic element IDs.

isVisible Boolean

Is it visible.

Example
// Set the primitive with layer ID 1 to be visible, and all other primitives invisible.
layer.setObjsVisible([1],true);
// Set the primitive with id=1 to be hidden, and all other primitives visible.
layer.setObjsVisible([1],false);

setOnlyObjsVisible(ids, isVisible)

According to the list of element IDs, set the visibility of the corresponding element (manually set). If ids is empty, isVisible sets the visibility of all layers.

Name Type Description
ids Array

List of graphic element IDs.

isVisible Boolean

Is it visible.

Example
// Set the primitives with ids 1 and 2 to be invisible, leaving the visibility of other primitives unchanged.
layer.setOnlyObjsVisible([1,2],false);
// Set the primitives with ids 1 and 2 to be visible, leaving the visibility of other primitives unchanged.
layer.setOnlyObjsVisible([1,2],true);

setPBRMaterial()

Set PBR material type (discard).

See:
  • PBRMaterialType

setPBRMaterialFromJSON()

Used to import PBR materials from JSON files, with the parameter being the URL of the JSON file.

setPointCloudGroupsVisible(groupNames, isVisible)

Set the visibility of point cloud grouping.

Name Type Description
groupNames Array

Layer grouping name.

isVisible Boolean

Is it visible.

Example
// Set the object with group name "group1" on this layer to be visible
layer.setPointCloudGroupsVisible(["group1"],true);

setPolygonoffset(factor, units)

Set polygon offset.

Name Type Description
factor Number

Offset slope factor, default to 0.

units Number

Offset unit, default is 0.

Example
layer.setPolygonoffset(-1,-1);

setQueryParameter()

Set attribute query parameters.

Name Type Default Description
options.url String optional

Data service URL.

options.dataSourceName String optional

Data source name.

options.dataSetName String optional

Dataset name.

options.isMerge Boolean optional

Is this layer for merging datasets? If so, there is no need to specify the dataset name.

options.hasGeometry Boolean false optional

Whether the attribute query returns results containing geometric information.

Example
layer.setQueryParameter({
 url: 'localhost:8090/services/realspace/services/xxx/rest/data',
 dataSourceName: 'xxx',
 dataSetName: 'xxx'
});

setSelection(ids)

Set a selection set for selection during scene.pick.

Name Type Description
ids Array

Element ID set.

setTextureEmissive()

Set up self luminous unit (abandoned).

See:
  • EmissionTextureUnit

setVisibleInViewport(index, visible)

Set the visibility of the viewport corresponding to the layer.

Name Type Description
index Number

Indexes.

visible Boolean

Visibility.

Throws:

The index value range is 0-3.

Type
DeveloperError