new EarthCompass(param)
构造函数
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object | 参数列表 Properties
|
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// 添加指南针控件 使用3d内元素创建
var compass = app.addControl(new THING.EarthCompass({
'image': 'https://speech.uinnova.com/static/images/compass.png',
'offset': [50, 50],//选填 偏移值 x y 默认值 25
'position': THING.CornerType.RightTop //选填 默认值 RightBottom
})
);
function create_html() {
var html
= `<div id='earthCompass' style="position: absolute;top: 50px;right: 50px;z-index: 10;">
<image src='https://www.thingjs.com/uearth/res/compass.png' width=50 height=50></image>
</div>`;
return $(html)[0];
}
var elem = create_html();
// 添加指南针控件 使用dom元素创建 指北针不在3d内
app.addControl(new THING.EarthCompass({
useElement: true,
element: elem,
rotateToNorthSpeed: 0.5
})
);
Extends
- THING.CompassControl