S3MTilesLayer

new SuperMap3D.S3MTilesLayer(options)

S3M (Spatial 3D Model) layer class, through which the 3D s3m tiles can be loaded, including oblique photogrammetric models, BIM models, point cloud data, man-made models, vector data, symbols, etc.

Add the published 3D service in the *.s3m format to the scene through Scene.addS3MTilesLayerByScp(url, options).

Note: Services published through local SCP files do not support the field thematic mapping functionality.
Name Type Description
options Object optional The parameter object has the following properties:
Name Type Default Description
gl WebGLRenderingContext optional WebGL rendering context.
servers Array optional An array containing server addresses.
urls Array optional An array containing xml addresses.
position Array optional The position of the layer insertion point ([Longitude, Latitude, Height]).
name Array optional The layer name.
WaterEffectSet Object optional Water surface special effects parameters.
urlType UrlType optional Entity data request form.
urlArguments String optional The parameters of the data service URL.
format Boolean optional Whether to support texture compression.
cacheEntityCount Number 0 optional The number of entities cached during LOD scheduling
layerBounds Rectangle optional The extent of the layer. Deprecated the set method, retained the get method.
tileSpliteType String 'LOCAL' optional The type of tile division.
volumeObj Object optional Volume rendering parameter object.
boundingSphereColc Array optional The root node boundingSphere.
MaxInstensity Number optional Maximum intensity.
MinInstensity Number optional Minimum intensity.
MaxHeight Number optional Maximum height.
MinHeight Number optional Minimum height.
HorizontalLine Number optional Horizontal contours (Deprecated).
fileType String optional File type (data type).
ProcessType String optional Processing method.
cullEnabled Boolean false optional Whether to exclude the back side (default is No, that is, double-sided rendering).
cacheKey String optional 3D tile key, that is set when SuperMap iServer publishes 3D tile services.
keyframes Object optional point in time.
duration Object optional Animation duration.
interpolationType Object optional Interpolation type, the default value is Linear.
emissionTextureUnit EmissionTextureUnit optional Sets the emissive texture unit.
cullMode WindingOrder optional When rendering on one side, it can be set to render clockwise and counterclockwise when rendering.
CategoryFieldName CategoryFieldName optional Sets the feature value fields of Point Cloud.
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

staticSuperMap3D.S3MTilesLayer.DEFAULT_TRANSPARENT_BACK_COLOR : Color

The default color of the layer's transparent target color is black (Color.BLACK).

staticSuperMap3D.S3MTilesLayer.DEFAULT_TRANSPARENT_BACK_COLOR_TOLERANCE : number

The default value of layer transparency tolerance is 0.0, that is, opaque
Default Value: 0.0

allTilesLoaded : Event

The event that all slices in the current view are loaded. This event fires when all tiles have loaded.

attributeDownloaded : Event

An event to determine whether the property file has been downloaded. This event fires when all properties files have been downloaded. Note: When using some attribute fields to set the thematic map, the attribute file will be downloaded after setting queryFiledNames, and there is no need to enable isAttributesSave of indexedDB.
Example:
layer.queryFieldNames = ['FLOOR','HEIGHT']

readonlybloomEffect : BloomEffect

Get the floodlight effect of the scene, including floodlight intensity value, floodlight brightness threshold, etc.

bloomEnable : boolean

Get whether the floodlight effect is turned on.

bReleaseColor : Number

Release the vertex color memory and restore the vertex color.(Deprecated)

brightness : Number

Set the layer brightness value to adjust the color.

clearMemoryImmediately : Boolean

Whether to release memory in time, the default value is true. If set to false, you need to set a value for setCacheSize. (Deprecated)
Default Value: true
Example:
Set the size of the cache space, in MB
SuperMap3D.MemoryManager.setCacheSize(512);
Choose not to release memory in time
SuperMap3D.when.all ([promise],function (layers){
layers[0].forEach ((layer)=>{
layer.clearMemoryImmediately = false
})

clipLineColor : Color

Gets or sets the color of the clipping line when BOX clipping the S3M layer.

clippingType : ClippingType

Get or set the clipping mode.

clipPlaneColor : Color

Get or set the color of the cropped section

ColorDictTableMode : String

Set the color table mode.

colorTableChanged : Event

The event when the application of the color table of all volume data slices under the current view angle is completed. This event will be triggered when the color table application of the volume data slice is completed.

computeHeight : Boolean

It is used to specify whether to automatically calculate the height of the model at the front end, the default value is false and no height is calculated. Specifying true for data without height can ensure that operations such as inundation analysis and setting contour lines run normally.
Default Value: false

contrast : Number

The event when the application of the color table of all volume data slices under the current view angle is completed. This event will be triggered when the color table application of the volume data slice is completed.

coveredMap : VectorTileMap|RasterTileLayer

Get or set the overlay vector tile layer, which is used for mapping onto the surface of oblique photography 3D models.

coverImageryLayer : ImageryLayer

Get or set the overlay image layer or MVT layer (used to be pasted to the inclined model surface).

cullMode : WindingOrder

When rendering on one side, get or set the clockwise and counterclockwise rendering

customRequestHeaders : Object

custom request header

dataMaxValue : Number

Get the maximum height value or maximum intensity value of the data. For point cloud data, this attribute is height value or intensity value (the default is intensity value); for other 3D data, this attribute is height value.
Example:
//Get the maximum value of the data
var dataMaxValue = S3MTilesLayer.DataMaxValue;

dataMinValue : Number

Get the minimum height value or minimum intensity value of the data. For point cloud data, this attribute is height value or intensity value (the default is intensity value); for other 3D data, this attribute is height value.
Example:
//Get the minimum value of the data
var dataMinValue = S3MTilesLayer.DataMinValue;
Gets or sets the line symbol of the S3M layer.

enableHighlight : Boolean

Get or set whether the layer is highlighted
Default Value: True

gamma : Number

color adjustment gamma

readonlygroupName : String

Get the name of the group to which the layer belongs

hasLight : Boolean

Gets or sets whether the layer has lighting effects enabled.

readonlyhasWireframe : Boolean

Gets whether the layer has a wireframe.

heading : Number

Get or set the heading angle of the camera (unit: radian)。

heightScale : Number

Set the model z-direction pull height value, the default value is 1
Default Value: 1

horizontalColor : Color

Gets or sets the color of the horizontal line.(Deprecated)

horizontalline : Number

Gets or sets the height of the horizontal line.(Deprecated)

hue : Number

Set the layer tone value to adjust the color.

hypsometricSetting : Object

Get or set the layered coloring expression of the layer.
Example:
//Set layer layer tinting properties
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
}
//Set layer layer tinting properties
var hyp = S3MTilesLayer.hypsometricSetting ;

iconRelatedTextLayerID : Number|Undefined

Get or set the ID of the text layer. This interface specifies a text layer according to the ID, so that the icon layer follows the layer for avoidance. Note: It will only take effect when overlapDisplayOptions.allowIconWithTextDisplay is true.
Default Value: undefined

readonlyid : Number

Get the layer id.

ignoreNormal : Boolean

Get or set whether to automatically calculate the normal in the GPU, the default value is false. When the value is true, the normal is automatically calculated in the GPU, and the normal that comes with the data is not used. When the value is false, the normal is not automatically calculated in the GPU, and the normal that comes with the data is used.

indexedDBSetting : Object

Get or set indexedDB attribute information (IE browser does not support). Among them, when setting the indexDB property, There are three Boolean branch attributes: isGeoTilesSave——whether to save tiles; isAttributesSave--whether to save attributes; isGeoTilesRootNodeSave--whether to save the root node.
Example:
//Turn on the Config layer for skewed data
var layer = scene.layers.find('Config');
//Set whether to save the tile cache
layer.indexedDBSetting.isGeoTilesSave = true

isOverlapDisplayed : Boolean

Get or set whether to display the overlapping parts of layers. When set to true, the overlapping part is still displayed, that is, it does not participate in avoidance. The default value is false.
Default Value: false

labelStyle : S3MTilesLabelStyle

Get or set the layer text label style.

layerBounds : Rectangle

Get or set the layer range. Deprecated the set method, retained the get method.

LoadingMode : Number

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

LoadingPriority : LoadingPriorityMode

Get or set the priority mode of loading, including depth-first, layer-first, spatial index, and depth-first nonlinear switching.
Default Value: Child_Priority : 1

loadVolumeData : Boolean

Get or set whether to load volume data, the default value is true.
Default Value: true

lodRangeScale : Number

Gets or sets the LOD level switching distance scaling factor of the layer.

maximumMemoryUsage : Number

The maximum amount of memory (unit: MB) that can be used by the slice dataset, the default value is 512MB.
Default Value: 512

maxTransparentAlpha : number

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

maxVisibleAltitude : Number

Gets or sets the maximum visible height of the layer.

minTransparentAlpha : number

Get or set the minimum transparency threshold (below this value will be filtered out)
Default Value: 0.1

minVisibleAltitude : Number

Gets or sets the minimum visible height of the layer.

mipmapEnabled : Boolean

It is used to specify whether to create a mipmap for the texture. The default value is true to create a mipmap; set it to false to not create a mipmap.
Default Value: true

mixColorType : MixColorType

Set texture display mode (blend, replace)

multiChoose : Boolean

Get or set whether the layer supports multi-selection.

multiTemporalUseWater : Boolean

Used for time series data acquisition or setting water surface material
Default Value: {false}

readonlyname : String

get layer name

orderIndependentTranslucency : Boolean

Get or set whether to enable the transparent ordering function (OIT), the default is true.
Default Value: true

overlapWeightAttributeName : String

Get or set the attribute field name of the specified avoidance weight, and the avoidance priority can be distinguished according to this field.

partlyTransparent : Boolean

Get and set whether the display effect of the transparent material is optimized when OIT is turned on.
Default Value: false

PBRMaterialType : Number

Get or set PBR material type.(Deprecated)
Default Value: true

pointCloudShading : Object

Get the encapsulated point cloud rendering parameter object pointCloudShading

priorityScale : Number

Get or set the update priority coefficient, which can control the update priority order among multiple layers.

constantrainEffect

Set or get rainwater material influence factors.

rasterPerFrame : Boolean

Whether to draw rasterized vector lines in real time to ensure that the line thickness is consistent at different levels. The default value is false.
Default Value: false

receiveObjectClamp : Boolean

Get or set whether the layer accepts pasting objects, the default setting is true, and when it is set to false, no objects will be pasted.
Default Value: true

residentRootTile : boolean

Set whether the root node is resident in memory and not deleted. The default value is false.

RGBTOBGR : Boolean

When the texture compression format is webp, when the texture red and green are reversed, use the color channel RGB to BGR.
Default Value: false

S3MTileLoadedEvent : Event

Get the event triggered when the S3M slice is loaded. The event handler will be passed the slice's BoundingSphere as a parameter.

saturation : Number

Set the layer saturation value to adjust the color.

selectBound : Rectangle

Get and set the marquee range.

selectColorType : SelectColorType

Get or set the display style of the selected object, model texture and color mixed display or solid color display.

selectedColor : Color

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

selectedLineColor : Color

Get or set the highlight color of the luminous outline of the wireframe of the selected object in the layer.
Default Value: new Color(1.0,1.0,1.0,1.0)

selectedSkeletonId : Number

Get or set the child object ID

selectedTranslate : Cartesian3

Get or set the offset position of the selected object.

selectEnabled : Boolean

Get or set whether the layer is optional.

selectionFiltrateByTransparency : Number

Get or set the transparent selection filter threshold.

shadowType : ShadowType

Gets or sets the range type of the model participating in the shadow display in the layer.

shadowVolumeBottomHeight : Number

Gets and sets the minimum height for the shadow body to pull down.

shadowVolumeTopHeight : Number

Gets and sets the maximum height that the shadow body can be pulled up.

showCallout : Boolean

Get or set whether to display the leader line.

showIcon : Boolean

Get or set whether to display icons.

showLabel : Boolean

Get or set whether to display labels.

constantsilhouetteColor : Color

Set or get the edge outline color, the default is blue

constantsilhouetteSize : Number

Set or get the edge contour size, default 2, unit pixel
Default Value: 2.0

skeletonSelectedColor : Color

Get or set the highlighted color of sub-object selection

skeletonSelectEnable : Boolean

Get or set whether sub-objects in the layer are selectable

splitDirection : SplitDirection

Get or set the shutter direction.

splitPosition : Number

Get or set the shutter position.

style3D : Style3D

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 needs to be refreshed after setting
S3MTilesLayer.refresh();

subdomains : String

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

swipeEnabled : Boolean

Get or set whether to enable the rolling shutter function.

swipeRegion : BoundingRectangle

Get or set the quadrilateral area of ​​the shutter.

textureUVSpeed : Number

Get or set the movement speed of the model texture on the UV coordinates

themeStyle : Cesium3DTileStyle

Get or set the style of the thematic map. Currently, it supports the thematic map with the ground vector cache and set the filling color and texture according to the ID at the front end. Note: When using model data to make thematic maps, you need to change the "attribute storage type" to "ATTRIBUTR" in the desktop software when generating the cache

transparentBackColor : Color

Get or set the transparent target color of the layer.

transparentBackColorTolerance : Number

Get or set the transparency tolerance of the layer.

triangleFiltratePixel : Number

Gets and sets the filter pixel size.

urlType : UrlType

Get or set the request form of layer data.

visible : Boolean

Get or set layer visibility。
Example:
//Get layer visibility
var isVisible = S3MTilesLayer.visible;
//Set layer visibility
S3MTilesLayer.visible = false;

visibleDistanceMax : Number

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

visibleDistanceMin : Number

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

volName : String

Get or set volume data name.

waterParameter : WaterParameter

Get the water surface effect parameters.
Get or set the water surface ripple strength.

wireFrameMode : Number

Get or set the layer wireframe mode.

Methods

addExcavationRegion(options)Boolean

Add an excavation face.
Name Type Description
options Object Excavation Area Parameters:
Name Type Description
position Array Location information of the excavation area.
name String Excavation area name.
Returns:
bool Returns true on success and false on failure.

addFlattenRegion(options)Boolean

Adds flattening planes for flattening model surfaces.
Name Type Description
options Object Flattened Area Parameters:
Name Type Description
position Array Specifies the location information of the flattened area.
name String Flatten zone names.
Returns:
Returns true on success and false on failure.
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()});

AddImageArray(imgArray)

Use a set of texture images to perform volume rendering on the S3M layer. Volume rendering needs to set the range of volume rendering.
Name Type Description
imgArray Promise.<Image> array of textures.

addOverlayImage(options)Boolean

The specified range of the S3M layer superimposes pictures.
Name Type Description
options Object Objects have the following properties:
Name Type Description
name String Specifies the name of the range.
bounds Array An array of point sets for the specified range.
image Element html image element, texture image for overlay。
Returns:
bool Returns true on success and false on failure.

clearCustomClipBox()

Clear custom clipping planes.
Example:
S3MTilesLayer.clearCustomClipBox();

clearModifyRegions()

Clear polygon object clipping S3M layer.

datasetInfo()Promise.Array

Obtain the name of the layer dataset and the corresponding Id range (applicable for generating caches with multiple datasets).
Returns:
The array contains information about all datasets, and each dataset object contains the dataset name, start Id, and end Id.
Example:
var data =  layer.datasetInfo();
SuperMap3D.when(data,function(dataSet){
       var length = dataSet.length;
       .......
        });

destroy()

Destroy layers, release memory, release webgl resources

fillStyleChange()

The border line does not disappear after setting the fill mode

getAttributesById(id)

Get local object attribute information (svd in indexedDB, IE browser does not support).
Name Type Description
id Number Index

getClipRegion()

Get the extent of section clipping.

getHistoryDataKeys()

Get historical data key value

getLodRangeScale()Number

Get the lOD level switching distance scaling factor of the layer.
Returns:
LOD level switching distance scaling factor
Example:
var num = S3MTilesLayer.getLodRangeScale();

getObjsColor()Color

Get the color table of the corresponding primitive object according to the ID.
Returns:
The color corresponding to the ID.

getObjsVisible(id)Boolean

Get the object visibility for the specified ID.
Name Type Description
id Number The specified object ID.
Returns:
Whether the object is visible.
Example:
var id = 12;
S3MTilesLayer.getObjsVisible(id);

getPointCloudClassificationInfos()

Get point cloud classification information array.(Deprecated)
Returns:
The first request for data returns a promise.

getPointCloudGroupBounds(name)undefined|*

Get the corresponding range of the point cloud group.
Name Type Description
name String The name of the corresponding range.
Returns:
Obtain the range (Bounds) of the point cloud group by the point cloud name, if not obtained, return undefined
Example:
layer.getPointCloudGroupBounds(name);

getPointCloudGroupInfos()

Get point cloud grouping information
Example:
layer.getPointCloudGroupInfos();

getQueryParameter()Object

Get attribute query parameters.
Returns:
Property query parameter object.

getSelection()AssociativeArray

Get the selection set.
Returns:
A relational array containing all selected IDs.
Example:
S3MTilesLayer.getSelection();

getValidCategoryFields()

Get the array of valid feature fields of point cloud data.

getVisibleInViewport(index)Boolean

Gets the visibility of the corresponding viewport of the layer.
Name Type Description
index Number Index
Returns:
visible
Throws:

getVolNames()Array

Get all volume data names.
Returns:
An array of all volume data names.

refresh()

Refresh the layer.

releaseSelection()

Release the selection set.
Example:
S3MTilesLayer.releaseSelection();

removeAllExcavationRegion()

Remove all excavation faces.

removeAllFlattenRegion()

Remove all flattened planes.
Example:
S3MTilesLayer. removeAllFlattenRegion();

removeAllObjectsOperation()

An operation that removes all primitives.

removeAllObjsColor()

Removes the color set by all primitives.

removeAllObjsExtendHeight()

Removes all set extrude heights.

removeAllObjsOffset()

Clears all object offsets.

removeAllObjsTranslate()

Removes offsets from all objects.

removeExcavationRegion(name)Boolean

Removes the excavation face with the specified name.
Name Type Description
name String The name of the excavation face.
Returns:
bool Returns true on success and false on failure.

removeFlattenRegion(name)Boolean

Removes the applanation plane with the specified name.
Name Type Description
name String The name of the applanation plane to remove.
Returns:
If the removal is successful, return true, and if it fails, return false.
Example:
S3MTilesLayer. removeFlattenRegion(regionName);

removeObjectsOperation(ids)

According to the primitive ID list, remove the operation (clipping or offset) of the specified primitive.
Name Type Description
ids Array A list of primitive IDs.

removeObjsColor(ids)

Remove the set color of the corresponding primitive according to the primitive ID list.
Name Type Description
ids Array A list of primitive IDs.

removeObjsExtendHeight(ids)

Remove the stretch height set by the object according to the primitive ID list.
Name Type Description
ids Array A list of primitive IDs.

removeObjsOffset(ids)

Clear object offsets against a list of object ids.
Name Type Description
ids Array A list of object IDs.

removeObjsTranslate(ids)

Remove the offset of the specified id object.
Name Type Description
ids Array A collection of ids of objects whose offsets are to be removed.

removeOverlayImage(name)Boolean

Remove the overlay region with the specified name
Name Type Description
name String Overlay area name
Returns:
Success returns true, failure returns false

removePBRMaterial()

Used to remove PBR materials

setAnimation(keyframes, duration, InterpolationType)

Animate the layer.
Name Type Description
keyframes Object point in time.
duration Object Animation duration.
InterpolationType Object Indicates the interpolation type, the default value is Linear
Throws:
Example:
var promise = layer.setAnimation({
                                keyframes: {
                                    '0%': { // point in time
                                        translation: SuperMap3D.Cartesian3.fromDegrees(layer.lon, layer.lat, layer.height),
                                        rotation: new SuperMap3D.HeadingPitchRoll(0, 0, 0),
                                        scale: new SuperMap3D.Cartesian3(1, 1, 1),
                                        interpolationType: SuperMap3D.InterpolationType.SmoothStep //The interpolation type from this time point to the next time point, if not set, use the InterpolationType of the same level as keyframes.
                                    },
                                    // '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, // How many seconds does the animation last
                                interpolationType: SuperMap3D.InterpolationType.Linear // Interpolation type, the default value is Linear
})

setBatchObjsTranslate(option)

Set object offsets in batches.
Name Type Description
option Object A collection of ids and offsets of objects whose offsets are to be removed.
Example:
var option = {
     id1:Cartesian3,
     id2: Cartesian3,
     }
layer.setBatchObjsTranslate(option);

SetBound3D(left, bottom, right, top, minHeight, maxHeight)

Set a bounding box for the layer, the model in the box area has a volume rendering effect, and the model outside the area remains as it is.
Name Type Description
left Number The longitude of the left side of the bounding box, in degrees.
bottom Number The latitude below the bounding box, in degrees.
right Number The longitude of the right side of the bounding box, in degrees.
top Number The latitude above the bounding box, in degrees.
minHeight Number The minimum height of the bounding box, in meters.
maxHeight Number The maximum height of the bounding box, in meters.

setCategoriesVisible(categories, mode)

Hide the display object according to the W bit feature value
Name Type Description
categories Array.<Number> | Number array of eigenvalues, or eigenvalues
mode CategoryVisibleMode hide, show, reset

setClipSection(firstPoint, secondPoint, thirdPoint, renderClipSection)

set clipping plane
Name Type Description
firstPoint Cartesian3 Draw the first point of the clipping plane.
secondPoint Cartesian3 Draw the second point of the clipping plane.
thirdPoint Cartesian3 Draw the third point of the clipping plane.
renderClipSection Boolean Draw the crop 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);
  }

setCurrentCategoryField(fieldName)

Set the feature fields of point clouds.
Name Type Description
fieldName CategoryFieldName optional Feature field.

setCustomClipBox(options)Boolean

Add custom clipping planes.
Name Type Description
options Object Clipping plane parameters:
Name Type Description
dimensions Cartesian3 Specify the length, width and height of the clipping box.
position Cartesian3 Specifies the clipping plane location.
clipMode String Specifies the cropping mode. Crop modes include the following categories:

clip_behind_any_plane:Clips away the portion that lies behind any clipping planes.

clip_behind_all_plane:Clips away the portion that lies behind all clipping planes.

only_keep_line:Only the crop line is kept, and the rest is cropped.
Returns:
Returns true if the addition is successful, and returns false if it fails.
Throws:
  • DeveloperError : options and options.dimensions and options.position are required.
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(options)

Set region clipping parameters.
Name Type Description
options Object The parameter object contains the following properties:
Name Type Description
position Cartesian3 optional The position coordinates of the center point.
dimensions Cartesian2 optional The width and height of the clipping area, unit: meter.
heading Number optional The rotation angle of the clipping plane around the Z axis, unit: degree.
pitch Number optional The rotation angle of the clipping plane around the X axis, unit: degree.
roll Number optional The rotation angle of the clipping plane around the Y axis, unit: degree.
extrudeDistance Number optional The stretching distance of the center point of the clipping area, unit: meter.

setCustomClipGeometry(options)

Set the polyhedron clipping parameters.
Name Type Description
options Object The parameter object contains the following properties:
Name Type Description
geometry Geometry3D optional Geometry objects (currently only convex polyhedra are supported).
clippingType ClippingType optional cropping type
spatialQuery SpatialQuery3D optional Spatial query object.
Example:
var geometry = new Geometry3D(pts)
geometry.extrudeHeight = 100;
var spatialQuery = new SpatialQuery3D();
spatialQuery.build();
layer.setCustomClipGeometry({
 geometry : geometry;
 clippingType : ClippingType.KeepOutside;
 spatialQuery : spatialQuery
 })

setCustomClipPlane(firstPoint, secondPoint, thirdPoint, clipPlaneMode)

Profile analysis.
Name Type Description
firstPoint Cartesian3 Draw the first point of the section。
secondPoint Cartesian3 Draw the second point of the section.
thirdPoint Cartesian3 Draw the third point of the profile.
clipPlaneMode ClipPlaneMode Cropped 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);
  }

setExtrudedPolygons()

Display the specified object on the front end by floors

setFlattenRegionVisibleInViewport(index)Boolean

Set the flattened area split screen.
Name Type Description
index Number Index
Returns:
visible
Throws:

setHistoryDataByKey(key)

Set historical data
Name Type Description
key String optional Historical data key value

setLodRangeScale(lodrange)

Set the lOD level switching distance scaling factor of the layer.
Name Type Description
lodrange Number LOD level toggle distance scaling factor.
Example:
S3MTilesLayer.setLodRangeScale();

setModifyRegions(regions, mode)

Clip S3M layers according to polygonal objects.
Name Type Description
regions Array Polygon array.
mode mode Clipping mode, set the inner extent or outer extent of the clipping polygon object. Clips the inner range when the value is CLIP_INSIDE, and clips the outer range when the value is CLIP_OUTSIDE.

setObjectsOperationByID(ids, operationType)

Perform functional operations on the specified ID object.
Name Type Description
ids Array A list of object IDs.
operationType Number Function operation type, the value is CLIP, which takes effect for the clipping function.

setObjsColor(ids, color)

According to the primitive IDS list, set the color of the corresponding primitive.
Name Type Description
ids Array A list of primitive IDs.
color Color The color of the primitive.

setObjsExtendHeight(ids, height)

According to the IDS list, set the stretch height of the object.(Deprecated)
Name Type Description
ids Array A list of primitive IDs.
height Number Object extruded height value.

setObjsOffset(ids)

Sets object offsets based on a list of object IDs.
Name Type Description
ids Array A list of object IDs.

setObjsTranslate(ids, translate)

Sets the object's offset based on the specified id.
Name Type Description
ids Array Specifies the id of the object whose offset is to be set.
translate Cartesian3 Specifies the offset.

setObjsVisible(ids, isVisible)

According to the list of primitive IDs, set the visibility of the corresponding primitive, and form a mutually exclusive visible relationship with other primitives of this layer.
Name Type Description
ids Array A list of primitive IDs.
isVisible Boolean is visible.
Example:
//Set the graphic element whose id is 1 to be displayed, and all other graphic elements are invisible.
        layer.setObjsVisible([1],true);
        //Set the hidden primitive with id=1, and make all other primitives visible.
        layer.setObjsVisible([1],false);

setOnlyObjsVisible(ids, isVisible)

According to the list of primitive IDs, set the visibility of the corresponding primitive (manually set). If ids is empty, isVisible is to set the visibility of all layers.
Name Type Description
ids Array A list of primitive IDs.
isVisible Boolean is visible.
Example:
//Set the primitives with id 1 and 2 as invisible, and the visible state of other primitives remains unchanged.
        layer.setOnlyObjsVisible([1,2],false);
        //Set the primitives with id 1 and 2 as visible, and the visible state of other primitives remains unchanged.
        layer.setOnlyObjsVisible([1,2],true);

setPBRMaterial()

Used to set the PBR material type. (Deprecated)
See:

setPBRMaterialFromJSON()

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

setPointCloudGroupsVisible(groupNames, isVisible)

Sets the visibility of point cloud grouping.
Name Type Description
groupNames Array Layer group name.
isVisible Boolean is visible.
Example:
//Set the layer group named "group1" to be visible
layer.setPointCloudGroupsVisible(["group1"],true);

setPolygonoffset(factor, units)

Sets the polygon offset.
Name Type Description
factor Number Offset slope factor, default is 0.
units Number Offset unit, default is 0.
Example:
layer.setPolygonoffset(-1,-1);

setQueryParameter(options)

Set property query parameters.
Name Type Description
options Object Objects have the following properties:
Name Type Default Description
url String optional Data service url.
dataSourceName String optional Data source name.
dataSetName String optional Dataset name.
isMerge Boolean optional Whether the layer is merged dataset, if yes, don't specify the dataset name.
hasGeometry Boolean false optional Attribute query returns whether the result contains geometry information.
Example:
layer.setQueryParameter({
                    url: 'localhost:8090/services/realspace/services/xxx/rest/data',
                    dataSourceName: 'xxx',
                    dataSetName: 'xxx'
});

setSelection(ids)

Set the selection set, used for selection when scene.pick.
Name Type Description
ids Array Primitive ID set.

setTextureEmissive()

Used to set the emissive unit.(Deprecated)
See:

setVisibleInViewport(index, visible)

Sets the visibility of the layer corresponding to the viewport.
Name Type Description
index Number Index
visible Boolean visibility
Throws:

updateObjsColor(ids)

Traverse all primitives, and update the color of corresponding primitives according to the ID list.
Name Type Description
ids AssociativeArray An array of relations between primitive ID lists and colors.

updateObjsVisible(ids, visible)

Traverse all primitives, update the visibility of corresponding primitives according to the ID list, and mutually exclusive visible relationship. If [1,2] is set to be visible, the rest of the primitives are not visible, and if [1,2] is set to be invisible. Then the rest of the primitives are visible.
Name Type Description
ids AssociativeArray An array of relations between primitive ID lists and colors.
visible Boolean is visible

updateRenderState()

Update the rendering state.