### startScanning Source: https://cdn.uino.cn/thing-earth-space/docs/BigBuildingLayer Starts the scanning process with specified properties. ```APIDOC ## startScanning ### Description Starts the scanning process. This method can be overridden by specific implementations. ### Method POST (assumed, based on common practice for initiating actions) ### Endpoint /websites/cdn_uino_cn_thing-earth-space/startScanning ### Parameters #### Query Parameters - **type** (THING.EARTH.ScanningType) - Optional - The type of scanning. - **mode** (THING.EARTH.ScanningMode) - Optional - The mode of scanning. - **angle** (Number) - Optional - The scanning angle, defaults to 0. - **speed** (number) - Optional - The scanning speed, defaults to 1. - **color** (Array) - Optional - The scanning color, defaults to white. - **opacity** (number) - Optional - The scanning opacity, defaults to 1. - **blending** (boolean) - Optional - Whether to enable blending, defaults to true. - **effect** (boolean) - Optional - Whether to enable glow effect, defaults to false. ### Request Example ```json { "type": "THING.EARTH.ScanningType.POINT", "mode": "THING.EARTH.ScanningMode.CIRCLE", "angle": 45, "speed": 1.5, "color": [255, 0, 0], "opacity": 0.8, "blending": false, "effect": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "Scanning started successfully." } ``` ``` -------------------------------- ### PointClusterLayer Methods Source: https://cdn.uino.cn/thing-earth-space/docs/PointClusterLayer Methods for managing the lifecycle and behavior of a PointClusterLayer, including destroying, hiding, showing, and starting scanning effects. ```APIDOC ## PointClusterLayer Methods ### Description These methods provide control over the PointClusterLayer's lifecycle and visual effects, such as layer destruction, visibility toggling, and the initiation of scanning animations. ### Method `PointClusterLayer` instance methods. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript let layer = new THING.EARTH.PointClusterLayer({ /* ... style and data ... */ }); // Show the layer layer.show(); // Hide the layer layer.hide(); // Start scanning with custom parameters layer.startScanning({ type: THING.EARTH.ScanningType.Circle, mode: THING.EARTH.ScanningMode.Radar, angle: 45, speed: 2, color: [0, 1, 0], opacity: 0.8, blending: true, effect: true }); // Pause scanning layer.pauseScanning(); // Resume scanning layer.resumeScanning(); // Destroy the layer const destroyed = layer.destroy(); console.log('Layer destroyed:', destroyed); ``` ### Response #### Success Response (200) - **destroy()** - Returns `Boolean` indicating if the layer was successfully destroyed. - **destroyScanning()** - Removes the scanning effect. - **hide()** - Hides the layer. - **pauseScanning()** - Pauses the scanning effect. - **resumeScanning()** - Resumes the scanning effect. - **show()** - Shows the layer. - **startScanning(params)** - Starts a scanning effect with optional parameters. - **params** (Object) - Optional - Scanning parameters. - **type** (THING.EARTH.ScanningType) - Optional - The type of scan. - **mode** (THING.EARTH.ScanningMode) - Optional - The mode of the scan. - **angle** (Number) - Optional - The scanning angle, defaults to 0. - **speed** (number) - Optional - The scanning speed, defaults to 1. - **color** (Array) - Optional - The scanning color, defaults to white. - **opacity** (number) - Optional - The scanning opacity, defaults to 1. - **blending** (boolean) - Optional - Whether to enable blending, defaults to true. - **effect** (boolean) - Optional - Whether to enable glow effect, defaults to false. #### Response Example (Boolean for destroy, void for other methods) ``` -------------------------------- ### MapBackgroundConfig Properties Source: https://cdn.uino.cn/thing-earth-space/docs/MapBackgroundConfig Accessors for getting and setting properties of the map background configuration. ```APIDOC ## MapBackgroundConfig Properties ### Description Provides accessors to get or set various properties of the background configuration. ### Method N/A (These are object properties) ### Endpoint N/A ### Parameters None ### Request Example ```javascript // Example usage for setting properties const background = new MapBackgroundConfig({ type: 'color', color: [255, 0, 0] }); // Example usage for getting properties console.log(background.type); // 'color' console.log(background.visibleLevel); // undefined (if not set) ``` ### Response #### Success Response (N/A) N/A #### Response Example ```json // No direct response, properties are accessed/modified on the object instance. ``` ### Properties Details - **`color`** (String) - Getter/Setter - Retrieves or sets the background color. Effective when the background type is 'color'. - **`type`** (String) - Getter/Setter - Retrieves or sets the background type. Possible values are 'image', 'skybox', and 'color'. - **`url`** (String | Array.) - Getter/Setter - Retrieves or sets the URL(s) for the background image. Effective when the background type is 'image' or 'skybox'. - **`visibleLevel`** (Array.) - Getter/Setter - Retrieves or sets the visible levels for the background. ``` -------------------------------- ### Set GeoPoint Image or Model URL Source: https://cdn.uino.cn/thing-earth-space/docs/GeoPointStyle Provides an example of setting the URL for a GeoPoint when its type is 'Image' or 'Model'. This allows specifying external resources for visual representation. ```javascript geoPoint.style.pointType = 'Image';//设置geoPoint渲染类型为图片 geoPoint.style.url = '/uGeo/image/pop.png';//设置图片url ``` -------------------------------- ### GeoDiffusion Methods Source: https://cdn.uino.cn/thing-earth-space/docs/GeoDiffusion Details the available methods for interacting with GeoDiffusion objects, such as calculating area, getting extent, moving along paths, and exporting data. ```APIDOC ## GeoDiffusion Methods ### Methods - **getArea() → {Number}** * Description: Returns the area in square meters. * Overrides: GeoObject#getArea - **getExtent() → {Object}** * Description: Returns the longitude and latitude range of the object. * Overrides: GeoObject#getExtent - **getLength(isSpherical) → {Number}** * Description: Returns the distance in meters. If `isSpherical` is true, calculates the spherical distance; otherwise, calculates the straight-line distance. * Parameters: - **isSpherical** (Boolean) - Optional - Defaults to true. Determines if the spherical or straight-line distance is calculated. * Overrides: GeoObject#getLength - **movePath(path, param)** * Description: Moves the object along a specified path. * Parameters: - **path** (Array>) - Required - A list of coordinates representing the path (supports world coordinates or longitude/latitude). - **param** (THING.LerpArgs) - Required - Interpolation parameters for the movement. * Overrides: GeoObject#movePath - **movePathAsync(path, param) → {Promise}** * Description: Asynchronously moves the object along a specified path. * Parameters: - **path** (Array>) - Required - A list of coordinates representing the path (supports world coordinates or longitude/latitude). - **param** (THING.LerpArgs) - Required - Interpolation parameters for the movement. * Returns: A Promise object. * Overrides: GeoObject#movePathAsync - **toGeoJSON() → {GeoJSON}** * Description: Exports the object as a GeoJSON Feature object. * Returns: A GeoJSON formatted Feature object. * Overrides: GeoObject#toGeoJSON - **toGeoJSONGeometry() → {GeoJSON}** * Description: Exports the geometry of the object as a GeoJSON object. * Returns: A GeoJSON formatted Geometry object. * Overrides: GeoObject#toGeoJSONGeometry - **update(param, shareMaterialopt)** * Description: Updates all properties of the object, including style, offsetHeight, and extrudeHeight. * Parameters: - **param** (GeoStyle) - Required - The style object to update with. - **shareMaterial** (Boolean) - Optional - Defaults to false. Set to true if materials should be shared, typically only when layers have multiple levels. * Overrides: GeoObject#update - **updateStyle(value, shareMaterialopt)** * Description: Updates the object's style comprehensively. * Parameters: - **value** (Object) - Required - The style object to apply. - **shareMaterial** (Boolean) - Optional - Defaults to false. Set to true if materials should be shared, typically only when layers have multiple levels. * Overrides: GeoObject#updateStyle ``` -------------------------------- ### Set GeoBaseStyle Opacity Source: https://cdn.uino.cn/thing-earth-space/docs/GeoBaseStyle Sets the opacity level for a geographical object. This property accepts a number, where 1.0 is fully opaque and 0.0 is fully transparent. The example shows how to set it to fully opaque. ```javascript geoItem.style.opacity = 1; ``` -------------------------------- ### Set GeoLineStyle Outline Color Source: https://cdn.uino.cn/thing-earth-space/docs/GeoLineStyle This example shows how to set the outline color for a GeoLineStyle. You can specify a color using an array of numbers or set it to null to disable the outline. ```javascript geoPoint.style.outlineColor = [1,0,0]; // Set geoPoint outline to red geoPoint.style.outlineColor = null; // Disable outline ``` -------------------------------- ### Get Elevation by Coordinates (JavaScript) Source: https://cdn.uino.cn/thing-earth-space/docs/Utils Retrieves the elevation at a given longitude and latitude. This method relies on loaded terrain and tilt data for picking the height, so accuracy depends on the loaded data's availability and precision. It takes an array of coordinates and returns a Number representing the elevation. ```javascript // Example usage (assuming 'coordinates' is defined) // const elevation = Utils.getHeightByCoordinates(coordinates); ``` -------------------------------- ### Enable GeoLineStyle Effect Source: https://cdn.uino.cn/thing-earth-space/docs/GeoLineStyle This example shows how to enable the glowing effect for a GeoLineStyle. The 'effect' property controls whether the line will have a glow. The 'glowStrength' property can be used to adjust the intensity of the glow. ```javascript geoObject.style.effect = true; // Enable glow effect ``` -------------------------------- ### Get Elevation by Coordinates Asynchronously (JavaScript) Source: https://cdn.uino.cn/thing-earth-space/docs/Utils Asynchronously retrieves the elevation at a given longitude and latitude using terrain data. This method supports fetching elevation via network requests from a terrain service and is optimized for high-precision terrain data, but does not support 3D tiles. It takes an array of coordinates and returns a Promise that resolves with the elevation value. ```javascript // Example usage (assuming 'coordinates' is defined) // Utils.getHeightByCoordinatesAsync(coordinates).then(elevation => { // console.log('Elevation:', elevation); // }); ``` -------------------------------- ### Create BigPointLayer Instance Source: https://cdn.uino.cn/thing-earth-space/docs/BigPointLayer Demonstrates how to create and configure a BigPointLayer instance. This includes setting the data source (GeoJSON), defining extensive styling options such as color, opacity, point type, size, and alpha mapping for dynamic effects, as well as configuring elevation properties. ```javascript var bigPointLayer = new THING.EARTH.BigPointLayer({ dataSource: data, //一个geojson格式的对象 style:{ color: [0, 0, 1], opacity: 0.5, pointTyle: 'Vector', size:3, vectorType:'Circle', lineColor:[255,0,0], lineOpacity:1, alphaMap:{ url:'../uGeo/uvMap71.png;//透明图路径 speed:[10, 0],//透明图流动速度 loopType:THING.LoopType.Repeat //循环方式 } }, offsetHeight:100, //抬高 offsetHeightField:'height' //抬高字段 }); ``` -------------------------------- ### BigPointLayer Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/BigPointLayer Initializes a new BigPointLayer with specified parameters for data source, style, and visual properties. ```APIDOC ## POST /websites/cdn_uino_cn_thing-earth-space/BigPointLayer ### Description Initializes a new BigPointLayer instance. This layer type is optimized for displaying a large quantity of points and is often used as a background layer. It shares similarities with FeatureLayer but has limitations in style updates and individual point retrieval. ### Method `new BigPointLayer(param)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param** (Object) - Required - Parameter list for initializing the BigPointLayer. - **style** (Object) - Optional - Rendering style for the large point layer. Refer to the style property documentation for details. - **url** (String) - Optional - URL of the layer's data source. - **offsetHeight** (Number) - Optional - Height above the ground for the points. - **offsetHeightField** (String) - Optional - Field name to use for determining the height above ground. - **offsetHeightFactor** (Number) - Optional - Multiplier for the height above ground. Defaults to 1. - **dataSource** (GeoJSONFeatureCollection) - Optional - Data source. Currently only supports GeoJSON data in Point format. - **usePickId** (Boolean) - Optional - Whether to write pickId when creating vertices for individual object picking. Defaults to true. - **useInVisibleIndices** (Boolean) - Optional - Whether to write invisible object indices when creating vertices to control individual object visibility. Requires `usePickId` to be true. Defaults to true. ### Request Example ```json { "param": { "dataSource": data, // A GeoJSON formatted object "style": { "color": [0, 0, 1], "opacity": 0.5, "pointTyle": "Vector", "size": 3, "vectorType": "Circle", "lineColor": [255, 0, 0], "lineOpacity": 1, "alphaMap": { "url": "../uGeo/uvMap71.png", // Path to transparency map "speed": [10, 0], // Transparency map flow speed "loopType": "THING.LoopType.Repeat" // Loop type } }, "offsetHeight": 100, // Height adjustment "offsetHeightField": "height" // Field for height adjustment } } ``` ### Response #### Success Response (200) - **BigPointLayer instance** - Description: A successfully created BigPointLayer object. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### MapBackgroundConfig Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/MapBackgroundConfig Initializes a new MapBackgroundConfig object with optional parameters to set background properties. ```APIDOC ## MapBackgroundConfig Constructor ### Description Initializes a new MapBackgroundConfig object with optional parameters. This class provides the base data structure for backgrounds on the map, supporting various visibility levels. ### Method `new MapBackgroundConfig(paramopt)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body ##### `param` (Object) - Optional Parameter object for configuring the background. - **`visibleLevel`** (Array.) - Optional - Specifies the visible levels for the background. - **`type`** (String) - Optional - The type of background. Accepts 'image', 'skybox', or 'color'. - **`url`** (String | Array.) - Optional - The URL of the background image. Effective when type is 'image' or 'skybox'. - **`color`** (Array.) - Optional - The background color. Effective when type is 'color'. ### Request Example ```json { "param": { "visibleLevel": [1, 2, 3], "type": "image", "url": "http://example.com/background.jpg" } } ``` ### Response This is a constructor, so there is no direct response. The object is instantiated with the provided parameters. #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### InfoWindow Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/InfoWindow Initializes a new InfoWindow object. This constructor is used to create an information window associated with a specific geographical object and configure its parameters. ```APIDOC ## new InfoWindow(object, param) ### Description Constructs a new InfoWindow associated with a given geographical object. ### Method Constructor ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **object** (Object) - Required - The geographical object to be annotated. - **param** (Object) - Required - A list of parameters for configuring the InfoWindow. - **relativePositionToDefault** (Array.) - Optional - Offset from the parent object's default label position in meters [x,y,z]. Defaults to [0,0,0]. - **visible** (Boolean) - Optional - Whether the InfoWindow is visible. Defaults to true. - **text** (String) - Required - The content of the annotation. - **pivot** (Array.) - Optional - The pivot point of the InfoWindow. Defaults to [0.5,0]. - **type** (String) - Optional - The type of the InfoWindow, supporting 'Standard' and 'Custom'. Defaults to 'Standard'. - **customHtml** (String) - Optional - Custom HTML text for the InfoWindow, effective only when type is 'custom'. - **displayMode** (String) - Optional - How the InfoWindow is displayed (e.g., 'MouseEnter', 'Click', 'Always', 'None'). Defaults to 'Always'. - **title** (String) - Optional - The title of the InfoWindow. Defaults to '详细信息'. - **style** (String) - Optional - The style of the InfoWindow (e.g., 'Default', 'Blue', 'White'). Defaults to 'Default'. - **localPosition** (Array.) - Optional - Offset of the InfoWindow in [x,y,z] coordinates. Defaults to [0,0,0]. - **pivot** (Array.) - Optional - The pivot point of the InfoWindow as a percentage [0,0] for top-left, [1,1] for bottom-right. Defaults to [0.5,0]. - **fieldData** (Array) - Optional - Data fields to display in the InfoWindow. ### Request Example ```javascript // Example of creating an InfoWindow const geoObject = ...; // Your geographical object const infoWindow = new THING.InfoWindow(geoObject, { text: 'Some important information', customHtml: '
Custom HTML content
', displayMode: THING.EARTH.DisplayMode.Click }); ``` ### Response #### Success Response (200) - **InfoWindow** (Object) - The newly created InfoWindow object. ``` -------------------------------- ### CanvasLayer Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/CanvasLayer Initializes a new CanvasLayer. The constructor accepts an optional parameter object for configuration. ```APIDOC ## CanvasLayer Constructor ### Description Initializes a new CanvasLayer. The constructor accepts an optional parameter object for configuration. ### Method `new CanvasLayer(param)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param** (Object) - Optional - Configuration parameters for the CanvasLayer. ### Request Example ```json { "param": { "id": "myCanvasLayer", "visible": true } } ``` ### Response #### Success Response (200) N/A (Constructor does not return a value in the traditional sense). #### Response Example N/A ``` -------------------------------- ### Get Center of Gravity Point Source: https://cdn.uino.cn/thing-earth-space/docs/Utils Calculates the center of gravity (centroid) for a polygon defined by its coordinates. This is useful for finding a representative central point within a geographic area. ```javascript // 返回多边形的重心的经纬度坐标 const center = Utils.getCenterOfGravityPoint([[[116.4757, 39.9851], [116.4755, 39.9852], [116.4761, 39.9857], [116.4762, 39.9856], [116.4757, 39.9851]]]); ``` -------------------------------- ### PointClusterLayer Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/PointClusterLayer Initializes a new PointClusterLayer with specified parameters for data source, styling, and behavior. ```APIDOC ## PointClusterLayer Constructor ### Description Constructs a new PointClusterLayer instance. This layer is designed to visualize and cluster points from a given data source, applying specified styles and custom rendering logic. ### Method `new PointClusterLayer(param)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param** (Object) - Required - Parameter list for the PointClusterLayer. - **name** (String) - Optional - The name of the layer. - **dataSource** (Array.) - Optional - The data source for the layer, supporting GeoJSON point data. This is prioritized over `url`. - **url** (String) - Optional - The URL to fetch GeoJSON point data. The interface should respond with GeoJSON point data via a GET request. This has lower priority than `dataSource`. - **style** (PointClusterLayerStyle) - Required - The rendering style for the cluster layer. - **customRenderer** (function) - Optional - A custom function for rendering. - **pixelRange** (Number) - Optional - The pixel range to expand the bounding box of the screen space, in pixels. Defaults to 100. - **minimumClusterSize** (Number) - Optional - The minimum number of objects to form a cluster. Defaults to 2. - **onChange** (function) - Optional - A callback function triggered whenever the clustering result changes. It's also triggered on the first aggregation result when passed during initialization. If registered after creation, the first aggregation result won't trigger `onChange`. ### Request Example ```javascript $.ajax({ type: 'GET', url: 'https://www.thingjs.com/uearth/res/beijing-POIs-3211.geojson', dataType: 'json', success: function (data) { var pointClusterLayer = new THING.EARTH.PointClusterLayer({ dataSource: data, //数据源 geojson格式 name: 'pointClusterLayer', minimumClusterSize:5, //最小聚合点个数 style:{ url:'./uGeo/circle.png', //图标路径 showNonCluster:true, //是否显示未聚合的点 size:3, // 图标尺寸 fontColor:[1,0,0], //字体颜色 fontSize:50, //字体大小 在给定图标尺寸的情况下 fontSize越大 字体在图表内所占得尺寸越大 }, onChange:function(ev){ //每次聚合结果改变时会触发该事件 console.log(ev.data); } }); map.addLayer(pointClusterLayer); } }); ``` ### Response #### Success Response (200) - **PointClusterLayer** - The newly created PointClusterLayer instance. #### Response Example (Instance of PointClusterLayer) ``` -------------------------------- ### BigPointLayer Methods Source: https://cdn.uino.cn/thing-earth-space/docs/BigPointLayer Documentation for the methods available on the BigPointLayer class, including methods for managing the layer's lifecycle, appearance, and scanning effects. ```APIDOC ## BigPointLayer Methods ### Description Methods provided by the BigPointLayer class allow for interaction and control over the layer, including destruction, style manipulation, and scanning effects. ### Methods - **destroy() → {Boolean}** Destroys the layer. Returns `true` if successful. Overrides `BigDataLayer#destroy`. - **destroyScanning()** Removes the scanning effect. Overrides `BigDataLayer#destroyScanning`. - **getExtent() → {Extent}** Gets the data extent of the layer. Returns an `Extent` object. Overrides `BigDataLayer#getExtent`. - **hide()** Hides the layer. Overrides `BigDataLayer#hide`. - **pauseScanning()** Pauses the scanning effect. Overrides `BigDataLayer#pauseScanning`. - **resumeScanning()** Resumes the scanning effect. Overrides `BigDataLayer#resumeScanning`. - **setStyle(style)** Sets the style effect by applying a complete style object, replacing the existing style. #### Parameters: - **style** (GeoBaseStyle) - Required - The style object to update. A complete style object must be provided. Overrides `BigDataLayer#setStyle`. - **show()** Shows the layer. Overrides `BigDataLayer#show`. - **startScanning(params)** Starts the scanning effect. #### Parameters: - **params** (Object) - Optional - Parameters for the scanning effect. - **type** (THING.EARTH.ScanningType) - Optional - The type of scan. - **mode** (THING.EARTH.ScanningMode) - Optional - The mode of the scan. - **angle** (Number) - Optional - The scan angle. Defaults to 0. - **speed** (number) - Optional - The scan speed. Defaults to 1. - **color** (Array) - Optional - The scan color. Defaults to white. - **opacity** (number) - Optional - The scan opacity. Defaults to 1. - **blending** (boolean) - Optional - Whether to enable blending. Defaults to true. - **effect** (boolean) - Optional - Whether to enable glow effect. Defaults to false. Overrides `BigDataLayer#startScanning`. - **stopScanning()** Stops the scanning effect. Overrides `BigDataLayer#stopScanning`. - **updateStyle(style)** Updates the style effect by applying only the changed parts of the style (incremental update). #### Parameters: - **style** (Object) - Required - The style object to update. Overrides `BigDataLayer#updateStyle`. ``` -------------------------------- ### Set GeoBaseStyle Color Source: https://cdn.uino.cn/thing-earth-space/docs/GeoBaseStyle Sets the overlay color for a geographical object. This property accepts an array of three numbers representing RGB values. For example, setting it to [1,0,0] will make the object red. ```javascript geoPoint.style.color = [1,0,0]; ``` -------------------------------- ### GeoFlyLine Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/GeoFlyLine Initializes a new GeoFlyLine object with specified parameters. This object represents a flyline effect with customizable visual and behavioral properties. ```APIDOC ## Constructor GeoFlyLine(param) ### Description Constructs a new GeoFlyLine object. ### Method `new GeoFlyLine(param)` ### Parameters #### Request Body - **param** (Object) - Required - Constructor parameters. - **coordinates** (Array) - Required - Coordinate data. Supports LineString and MultiLineString. Flylines are generated between each pair of points. - **heights** (Array) - Optional - Ground elevation for each node. - **curveVertexCount** (Number) - Optional - The number of vertices between the start and end points of each flyline segment when generating a curved line. Defaults to 51. - **id** (String) - Optional - Object ID. - **name** (String) - Optional - Object name. - **userData** (Object) - Optional - Custom user data for the object. - **renderOrder** (Number) - Optional - Rendering order. Defaults to 0. - **offsetHeight** (Number) - Optional - Ground elevation. Defaults to 0. - **offsetHeightField** (Number) - Optional - Ground elevation field. If set, the final ground elevation is the sum of `offsetHeight` and `userData[offsetHeightField]`. - **label** (GeoLabel) - Optional - Label for the object. - **infoWindow** (InfoWindow) - Optional - Info window for the object. - **visible** (Boolean) - Optional - Whether the object is visible. Defaults to true. - **style** (GeoLineStyle) - Required - Style properties for the flyline. - **onComplete** (function) - Optional - Callback function executed after the geographical object is created. ### Request Example ```javascript var flyLine = new THING.EARTH.GeoFlyLine({ id: 'geoFlyLine', name: 'geoFlyLine', coordinates: [[116.4405, 39.9612],[116.4408, 39.9613]],// Note: Fly coordinates can only have two points heightArray:[100,200], // Ground elevation for start and end points style:{ lineType: 'Line', // Can be Line, Plane, Pipe url:'./image/line.png', // URL of the line texture color:[1,1,1], // Color of the line effect:true, // Enable glow effect width: 10, // Effective only for Plane and Pipe line types, represents the line width speed:0 // Flow speed of the line texture. Defaults to 0 (no flow). Speed can be positive or negative to indicate flow direction. } }); ``` ``` -------------------------------- ### GeoLineStyle Constructor Source: https://cdn.uino.cn/thing-earth-space/docs/GeoLineStyle Initializes a new GeoLineStyle object. The constructor accepts an optional parameter object to set initial style properties. ```APIDOC ## GeoLineStyle(param) ### Description Constructs a new GeoLineStyle object with optional initial properties. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param** (Object) - Optional. An object containing properties to initialize the style. - **lineType** (LineType) - Optional. The type of the geographical line (e.g., Route, Pipe, Plane, Line). - **opacity** (Number) - Optional. The opacity of the line, a value between 0 and 1. Defaults to 1. - **color** (Array.) - Optional. An array representing the superimposed color [R, G, B]. Defaults to [1,1,1] (white). - **blending** (Boolean) - Optional. Whether to enable color blending. Defaults to false. - **tailing** (Boolean) - Optional. Whether to enable trailing effect (vertical glow). Defaults to false. - **radial** (Boolean) - Optional. Whether to enable radial screen trailing effect (diffuse glow). Defaults to false. - **effect** (Boolean) - Optional. Whether to enable glow effect. Defaults to false. - **glowStrength** (Number) - Optional. The strength of the glow effect. Defaults to 0.5. - **url** (String) - Optional. The path to a texture image. - **width** (Number) - Optional. The width of the line. Defaults to 5. - **textureWrap** (TextureWrapMode) - Optional. The texture wrapping mode (e.g., Repeat, Stretch). Defaults to Stretch. - **textureSize** (Number) - Optional. The size of the texture along the line direction in meters. Effective when textureWrap is Repeat. Defaults to 100. - **gradient** (Object) - Optional. Defines a gradient color. Format: { '0': 'rgba(R,G,B,A)', '0.5': 'rgba(R,G,B,A)', '1.0': 'rgba(R,G,B,A)' }. - **repeat** (Array.) - Optional. The number of times the texture repeats on the x and y axes. Defaults to [1,1]. - **speed** (Number) - Optional. The speed of flow. Defaults to 0. - **growSpeed** (Number) - Optional. The speed of growth. Defaults to 0. - **growLoop** (String) - Optional. The loop mode for growth (e.g., Repeat). ### Request Example ```json { "lineType": "Route", "opacity": 0.8, "color": [0, 0, 1], "width": 10, "gradient": { "0": "rgba(255,0,0,1)", "1.0": "rgba(0,0,255,1)" } } ``` ### Response N/A (Constructor) ``` -------------------------------- ### Set GeoGroundPolygonStyle Blending Property Source: https://cdn.uino.cn/thing-earth-space/docs/GeoGroundPolygonStyle This example shows how to enable or disable blending for a GeoGroundPolygonStyle object. The 'blending' property is a boolean value. Setting it to 'true' enables blending, while 'false' disables it. This property is inherited from GeoBaseStyle. ```javascript geoObject.style.blending = true; ``` -------------------------------- ### Utils Class Methods Source: https://cdn.uino.cn/thing-earth-space/docs/Utils This section details the static methods available within the Utils class for various utility functions. ```APIDOC ## Utils Class Methods This section details the static methods available within the Utils class for various utility functions. ### `static convertColorToZeroToOne(color)` Converts a color array with a maximum value of 255 to a color array with a maximum value of 1. #### Parameters - **color** (Array) - The color array with values up to 255. #### Returns - Array - The color array with values up to 1. #### Example ```javascript const color = Utils.convertColorToZeroToOne([255,0,0]); // returns [1,0,0] ``` ### `static convertGeoJSONCrs(geojson, origin, dest)` Converts GeoJSON data from one coordinate reference system to another. #### Parameters - **geojson** (Object) - The GeoJSON data. - **origin** (string, optional) - The origin coordinate system. Supported values: 'wgs84', 'gcj02', 'bd09'. Defaults to 'wgs84'. - **dest** (string, optional) - The destination coordinate system. Supported values: 'wgs84', 'gcj02', 'bd09'. Defaults to 'gcj02'. #### Returns - Object - The converted GeoJSON object. ### `static convertLonlatToWebMercator(lonLat)` Converts longitude and latitude coordinates to Web Mercator projection coordinates. #### Parameters - **lonLat** (Array) - The longitude and latitude coordinates in [longitude, latitude] format. #### Returns - Array - The Web Mercator projection coordinates [x, y]. #### Example ```javascript const coords = Utils.convertLonlatToWebMercator([119.5,36.5]); // returns [12968720.675611112, 4793547.458437541] ``` ### `static convertLonlatToWorld(lonLat, height)` Converts longitude and latitude coordinates to world coordinates. #### Parameters - **lonLat** (Array) - The longitude and latitude coordinates in [longitude, latitude] format. - **height** (Number, optional) - The height above the ground. Defaults to 0. #### Returns - Array - The world coordinates [x, y, z]. ### `static convertWebMercatorToLonlat(mercator)` Converts Web Mercator projection coordinates to longitude and latitude coordinates. #### Parameters - **mercator** (Array) - The Web Mercator coordinates in [x, y] format. #### Returns - Array - The longitude and latitude coordinates in [longitude, latitude] format. #### Example ```javascript const coords = Utils.convertWebMercatorToLonlat([12968720.675611112, 4793547.458437541]); // returns [116.5,36.5] ``` ### `static convertWgs84ToGcj02(lonlat)` Converts WGS84 coordinates to GCJ02 coordinates. #### Parameters - **lonlat** (Array) - The WGS84 longitude and latitude coordinates in [longitude, latitude] format. #### Returns - Array - The GCJ02 longitude and latitude coordinates in [longitude, latitude] format. #### Example ```javascript const gcj02Coords = Utils.convertWgs84ToGcj02([116.5,39.5]); // returns [116.5059564261526, 39.501157091519175] ``` ### `static convertWindowToWorld(windowPosition)` Converts screen coordinates to world coordinates. #### Parameters - **windowPosition** (Array) - The screen coordinates in [x, y] format. #### Returns - Array - The world coordinates [x, y, z]. ### `static convertWorldToLonlat(pos)` Converts world coordinates to longitude and latitude coordinates. #### Parameters - **pos** (Array) - The world coordinates in [x, y, z] format. #### Returns - Array - The longitude and latitude coordinates with height [longitude, latitude, height]. ### `static getAnglesFromLonlat(lonlat, azimuth, pitch)` Calculates rotation information to make an object adhere to the ground based on longitude, latitude, and optional azimuth and pitch. #### Parameters - **lonlat** (Array) - The longitude and latitude. - **azimuth** (Number, optional) - The azimuth angle. Defaults to 0. - **pitch** (Number, optional) - The pitch angle of the object. Defaults to 0. #### Returns - Array - The rotation angles [x, y, z]. ### `static getAnglesFromPosition(pos, azimuth, pitch)` Calculates rotation information to make an object adhere to the ground based on world coordinates and optional azimuth and pitch. #### Parameters - **pos** (Array) - The world coordinates. - **azimuth** (Number, optional) - The azimuth angle. Defaults to 0. - **pitch** (Number, optional) - The pitch angle of the object. Defaults to 0. #### Returns - Array - The rotation angles [x, y, z]. ### `static getAzimuth(lonlat1, lonlat2)` Calculates the azimuth angle between two points. #### Parameters - **lonlat1** (Array) - The longitude and latitude of the starting point. - **lonlat2** (Array) - The longitude and latitude of the ending point. #### Returns - Number - The azimuth angle. ### `static getCenterCoordinates(coordinates)` Gets the center point of a set of coordinates. #### Parameters - **coordinates** (Array) - An array of coordinate points. #### Returns - Array - The center point coordinates [x, y]. ### `static getCenterOfGravityPoint(coordinates)` Gets the center of gravity (centroid) of a polygon. #### Parameters - **coordinates** (Array) - An array of longitude and latitude coordinates representing a polygon, conforming to GeoJSON LineString and Polygon `coordinates` structure. #### Returns - Array - The coordinates of the center of gravity [x, y]. #### Example ```javascript // Returns the longitude and latitude coordinates of the polygon's center of gravity const center = Utils.getCenterOfGravityPoint([[[116.4757, 39.9851], [116.4755, 39.9852], [116.4761, 39.9857], [116.4762, 39.9856], [116.4757, 39.9851]]]); ``` ### `static getEuclideanDistance(lonlat1, lonlat2)` Calculates the Euclidean distance (straight-line distance) between two points in meters. #### Parameters - **lonlat1** (Array) - The longitude and latitude of the starting point. - **lonlat2** (Array) - The longitude and latitude of the ending point. #### Returns - Number - The Euclidean distance in meters. ### `static getExtent(coordinates)` Gets the extent (minimum and maximum longitude and latitude) of a set of coordinates. #### Parameters - **coordinates** (Array) - The coordinates. #### Returns - Extent - The result containing the extent information. ``` -------------------------------- ### Events Source: https://cdn.uino.cn/thing-earth-space/docs/BigBuildingLayer Documentation for various events emitted by the BigDataLayer. ```APIDOC ## Events ### Description This section details the events emitted by the BigDataLayer, which can be subscribed to for various lifecycle and error notifications. ### Event: Destroyed - **Description**: Triggered when the BigDataLayer instance is destroyed. - **Overrides**: BigDataLayer#event:Destroyed ### Event: Load - **Description**: Triggered when the BigDataLayer has successfully loaded. - **Overrides**: BigDataLayer#event:Load ### Event: LoadError - **Description**: Triggered when an error occurs during the loading process of the BigDataLayer. - **Overrides**: BigDataLayer#event:LoadError ### Event: LoadStart - **Description**: Triggered at the beginning of the BigDataLayer loading process. - **Overrides**: BigDataLayer#event:LoadStart ### Event Examples ```javascript // Example of subscribing to the Load event bigDataLayer.on('Load', () => { console.log('BigDataLayer has loaded.'); }); ``` ``` -------------------------------- ### Enable GeoGroundPolygonStyle Effect Source: https://cdn.uino.cn/thing-earth-space/docs/GeoGroundPolygonStyle This example illustrates how to enable or disable the glow effect for a GeoGroundPolygonStyle object. The 'effect' property is a boolean. Setting it to 'true' activates the glow effect, while 'false' deactivates it. This property is inherited from GeoBaseStyle. ```javascript geoObject.style.effect = true; //开启发光效果 ``` -------------------------------- ### Instantiate GeoFlyLine Source: https://cdn.uino.cn/thing-earth-space/docs/GeoFlyLine Demonstrates how to create a new GeoFlyLine object with specified coordinates, height arrays, and style properties. This includes setting line type, texture URL, color, glow effect, width, and animation speed. ```javascript var flyLine = new THING.EARTH.GeoFlyLine({ id: 'geoFlyLine', name: 'geoFlyLine', coordinates: [[116.4405, 39.9612],[116.4408, 39.9613]],//注 飞坐标只可以有两个点 heightArray:[100,200], style:{ lineType: 'Line', //可以是Line Plane Pipe url:'./image/line.png',//线的贴图url color:[1,1,1], //线的颜色 effect:true, //是否开启发光特效 width: 10, //只在线类型为Plane,Pipe下生效,代表线的宽度 speed:0 //线贴图流动速度,默认是0,不流动 speed可以大于0也可以小于0,代表流动方向 } }); ``` -------------------------------- ### Configure PointClusterLayer Pixel Range Source: https://cdn.uino.cn/thing-earth-space/docs/PointClusterLayer This example shows how to set the pixel range for a PointClusterLayer, which defines the area around a cluster to consider for aggregation. The pixel range can be set during initialization or modified later. The default value is 100 pixels. ```javascript let layer = new THING.EARTH.PointClusterLayer({ style:{ url:'./uGeo/circle.png', showNonCluster:true, size:3, fontColor:[1,0,0], fontSize:50 } }); // @expect(layer.pixelRange == 100) layer.pixelRange = 200; // @expect(object.pixelRange == 200) ``` -------------------------------- ### Set GeoGroundPolygonStyle Outline Color Source: https://cdn.uino.cn/thing-earth-space/docs/GeoGroundPolygonStyle This example demonstrates how to set or remove the outline color for a GeoGroundPolygonStyle object. The 'outlineColor' property accepts an array of RGB values to set the color, or 'null' to disable the outline. This property is inherited from GeoBaseStyle. ```javascript geoPoint.style.outlineColor = [1,0,0];//设置geoPoint红色勾边 geoPoint.style.outlineColor = null;//取消勾边 ```