xy-map 1.1.79 → 1.1.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/xy-map.common.js +18 -11
- package/xy-map.umd.js +18 -11
- package/xy-map.umd.min.js +2 -2
package/package.json
CHANGED
package/xy-map.common.js
CHANGED
|
@@ -72488,15 +72488,20 @@ class mapSdk {
|
|
|
72488
72488
|
setTerrain(val) {
|
|
72489
72489
|
if (typeof val === 'boolean') val = defaultOptions.terrain;
|
|
72490
72490
|
let map = this.map;
|
|
72491
|
-
map.addSource('
|
|
72491
|
+
map.addSource('custom-dem', {
|
|
72492
72492
|
'type': 'raster-dem',
|
|
72493
|
-
'url': this.options.terrainUrl
|
|
72493
|
+
'url': this.options.terrainUrl ? undefined : 'mapbox://mapbox.mapbox-terrain-dem-v1',
|
|
72494
|
+
//官方高程源
|
|
72495
|
+
'tiles': [this.options.terrainUrl],
|
|
72496
|
+
//自定义高程源
|
|
72494
72497
|
'tileSize': 512,
|
|
72495
72498
|
'maxzoom': 14
|
|
72496
72499
|
});
|
|
72500
|
+
|
|
72501
|
+
// 启用 3D 地形效果
|
|
72497
72502
|
map.setTerrain({
|
|
72498
|
-
|
|
72499
|
-
|
|
72503
|
+
source: 'custom-dem',
|
|
72504
|
+
exaggeration: val // 地形高度放大系数
|
|
72500
72505
|
});
|
|
72501
72506
|
}
|
|
72502
72507
|
|
|
@@ -120078,7 +120083,7 @@ const coreMath = __webpack_require__(9912);
|
|
|
120078
120083
|
/**
|
|
120079
120084
|
* 添加模型
|
|
120080
120085
|
*/
|
|
120081
|
-
const load3DTiles = (option, layerId = '') => {
|
|
120086
|
+
const load3DTiles = (option, isFly = true, layerId = '') => {
|
|
120082
120087
|
return new Promise(resolve => {
|
|
120083
120088
|
const {
|
|
120084
120089
|
map
|
|
@@ -120109,12 +120114,14 @@ const load3DTiles = (option, layerId = '') => {
|
|
|
120109
120114
|
x: 0,
|
|
120110
120115
|
y: 0
|
|
120111
120116
|
};
|
|
120112
|
-
|
|
120113
|
-
|
|
120114
|
-
|
|
120115
|
-
|
|
120116
|
-
|
|
120117
|
-
|
|
120117
|
+
if (isFly) {
|
|
120118
|
+
package_map.flyTo({
|
|
120119
|
+
center: [cartographicCenter[0] + centerOffset.x, cartographicCenter[1] + centerOffset.y],
|
|
120120
|
+
zoom: zoom + 4,
|
|
120121
|
+
pitch: 72,
|
|
120122
|
+
bearing: 15
|
|
120123
|
+
});
|
|
120124
|
+
}
|
|
120118
120125
|
const center = [cartographicCenter[0] + centerOffset.x, cartographicCenter[1] + centerOffset.y];
|
|
120119
120126
|
resolve({
|
|
120120
120127
|
center: center
|
package/xy-map.umd.js
CHANGED
|
@@ -72506,15 +72506,20 @@ class mapSdk {
|
|
|
72506
72506
|
setTerrain(val) {
|
|
72507
72507
|
if (typeof val === 'boolean') val = defaultOptions.terrain;
|
|
72508
72508
|
let map = this.map;
|
|
72509
|
-
map.addSource('
|
|
72509
|
+
map.addSource('custom-dem', {
|
|
72510
72510
|
'type': 'raster-dem',
|
|
72511
|
-
'url': this.options.terrainUrl
|
|
72511
|
+
'url': this.options.terrainUrl ? undefined : 'mapbox://mapbox.mapbox-terrain-dem-v1',
|
|
72512
|
+
//官方高程源
|
|
72513
|
+
'tiles': [this.options.terrainUrl],
|
|
72514
|
+
//自定义高程源
|
|
72512
72515
|
'tileSize': 512,
|
|
72513
72516
|
'maxzoom': 14
|
|
72514
72517
|
});
|
|
72518
|
+
|
|
72519
|
+
// 启用 3D 地形效果
|
|
72515
72520
|
map.setTerrain({
|
|
72516
|
-
|
|
72517
|
-
|
|
72521
|
+
source: 'custom-dem',
|
|
72522
|
+
exaggeration: val // 地形高度放大系数
|
|
72518
72523
|
});
|
|
72519
72524
|
}
|
|
72520
72525
|
|
|
@@ -120096,7 +120101,7 @@ const coreMath = __webpack_require__(9659);
|
|
|
120096
120101
|
/**
|
|
120097
120102
|
* 添加模型
|
|
120098
120103
|
*/
|
|
120099
|
-
const load3DTiles = (option, layerId = '') => {
|
|
120104
|
+
const load3DTiles = (option, isFly = true, layerId = '') => {
|
|
120100
120105
|
return new Promise(resolve => {
|
|
120101
120106
|
const {
|
|
120102
120107
|
map
|
|
@@ -120127,12 +120132,14 @@ const load3DTiles = (option, layerId = '') => {
|
|
|
120127
120132
|
x: 0,
|
|
120128
120133
|
y: 0
|
|
120129
120134
|
};
|
|
120130
|
-
|
|
120131
|
-
|
|
120132
|
-
|
|
120133
|
-
|
|
120134
|
-
|
|
120135
|
-
|
|
120135
|
+
if (isFly) {
|
|
120136
|
+
package_map.flyTo({
|
|
120137
|
+
center: [cartographicCenter[0] + centerOffset.x, cartographicCenter[1] + centerOffset.y],
|
|
120138
|
+
zoom: zoom + 4,
|
|
120139
|
+
pitch: 72,
|
|
120140
|
+
bearing: 15
|
|
120141
|
+
});
|
|
120142
|
+
}
|
|
120136
120143
|
const center = [cartographicCenter[0] + centerOffset.x, cartographicCenter[1] + centerOffset.y];
|
|
120137
120144
|
resolve({
|
|
120138
120145
|
center: center
|