xy-map 1.1.58 → 1.1.60
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 +54 -0
- package/xy-map.umd.js +54 -0
- package/xy-map.umd.min.js +3 -3
package/package.json
CHANGED
package/xy-map.common.js
CHANGED
|
@@ -70779,6 +70779,12 @@ const gcj02ToWgs84 = coord => {
|
|
|
70779
70779
|
return [lng, lat];
|
|
70780
70780
|
}
|
|
70781
70781
|
|
|
70782
|
+
// 使用迭代法求解,提高迭代次数以增加精度
|
|
70783
|
+
let dLng = 0,
|
|
70784
|
+
dLat = 0;
|
|
70785
|
+
let mLng = lng,
|
|
70786
|
+
mLat = lat;
|
|
70787
|
+
|
|
70782
70788
|
// 增加迭代次数到10次提高精度
|
|
70783
70789
|
for (let i = 0; i < 10; i++) {
|
|
70784
70790
|
// 使用wgs84ToGcj02获取当前估计值对应的gcj02坐标
|
|
@@ -72205,10 +72211,17 @@ const addLayerLine = (option, layerId) => {
|
|
|
72205
72211
|
if (opt.click) {
|
|
72206
72212
|
mapClick(opt.id, opt.click);
|
|
72207
72213
|
}
|
|
72214
|
+
|
|
72215
|
+
//添加动画
|
|
72208
72216
|
if (opt.animate) {
|
|
72209
72217
|
addLayerLineAnimation(opt, layerId);
|
|
72210
72218
|
}
|
|
72211
72219
|
|
|
72220
|
+
//添加虚线
|
|
72221
|
+
if (opt.dash) {
|
|
72222
|
+
addLayerLineDash(opt, layerId);
|
|
72223
|
+
}
|
|
72224
|
+
|
|
72212
72225
|
// 添加文本图层
|
|
72213
72226
|
if (opt.text && opt.text.show) {
|
|
72214
72227
|
addLayerText('line', opt, layerId);
|
|
@@ -72295,6 +72308,47 @@ const addLayerLineAnimation = (option, layerId) => {
|
|
|
72295
72308
|
}
|
|
72296
72309
|
});
|
|
72297
72310
|
};
|
|
72311
|
+
|
|
72312
|
+
/**
|
|
72313
|
+
* 添加虚线图层
|
|
72314
|
+
*/
|
|
72315
|
+
const addLayerLineDash = (option, layerId) => {
|
|
72316
|
+
let {
|
|
72317
|
+
map
|
|
72318
|
+
} = package_map;
|
|
72319
|
+
let opt = option;
|
|
72320
|
+
let parentId = opt.id;
|
|
72321
|
+
let id = parentId + '-dash';
|
|
72322
|
+
if (hasLayer(id)) {
|
|
72323
|
+
setSource(id, opt.data);
|
|
72324
|
+
return;
|
|
72325
|
+
}
|
|
72326
|
+
let layout = opt.dash ? opt.dash.layout : {};
|
|
72327
|
+
let layoutOpt = Object.assign({
|
|
72328
|
+
'visibility': 'visible'
|
|
72329
|
+
}, layout);
|
|
72330
|
+
let paint = opt.dash ? opt.dash.paint : {};
|
|
72331
|
+
let paintOpt = Object.assign({
|
|
72332
|
+
'line-color': '#28b2ff',
|
|
72333
|
+
'line-dasharray': [4, 4],
|
|
72334
|
+
'line-width': 3,
|
|
72335
|
+
'line-opacity': 1
|
|
72336
|
+
}, paint);
|
|
72337
|
+
if (!hasSource(id)) {
|
|
72338
|
+
map.addSource(id, {
|
|
72339
|
+
type: 'geojson',
|
|
72340
|
+
data: opt.data
|
|
72341
|
+
});
|
|
72342
|
+
}
|
|
72343
|
+
map.addLayer({
|
|
72344
|
+
id: id,
|
|
72345
|
+
type: 'line',
|
|
72346
|
+
source: id,
|
|
72347
|
+
layout: layoutOpt,
|
|
72348
|
+
paint: paintOpt,
|
|
72349
|
+
...opt.other
|
|
72350
|
+
}, layerId);
|
|
72351
|
+
};
|
|
72298
72352
|
;// CONCATENATED MODULE: ./src/package/layers/Point.js
|
|
72299
72353
|
|
|
72300
72354
|
|
package/xy-map.umd.js
CHANGED
|
@@ -70797,6 +70797,12 @@ const gcj02ToWgs84 = coord => {
|
|
|
70797
70797
|
return [lng, lat];
|
|
70798
70798
|
}
|
|
70799
70799
|
|
|
70800
|
+
// 使用迭代法求解,提高迭代次数以增加精度
|
|
70801
|
+
let dLng = 0,
|
|
70802
|
+
dLat = 0;
|
|
70803
|
+
let mLng = lng,
|
|
70804
|
+
mLat = lat;
|
|
70805
|
+
|
|
70800
70806
|
// 增加迭代次数到10次提高精度
|
|
70801
70807
|
for (let i = 0; i < 10; i++) {
|
|
70802
70808
|
// 使用wgs84ToGcj02获取当前估计值对应的gcj02坐标
|
|
@@ -72223,10 +72229,17 @@ const addLayerLine = (option, layerId) => {
|
|
|
72223
72229
|
if (opt.click) {
|
|
72224
72230
|
mapClick(opt.id, opt.click);
|
|
72225
72231
|
}
|
|
72232
|
+
|
|
72233
|
+
//添加动画
|
|
72226
72234
|
if (opt.animate) {
|
|
72227
72235
|
addLayerLineAnimation(opt, layerId);
|
|
72228
72236
|
}
|
|
72229
72237
|
|
|
72238
|
+
//添加虚线
|
|
72239
|
+
if (opt.dash) {
|
|
72240
|
+
addLayerLineDash(opt, layerId);
|
|
72241
|
+
}
|
|
72242
|
+
|
|
72230
72243
|
// 添加文本图层
|
|
72231
72244
|
if (opt.text && opt.text.show) {
|
|
72232
72245
|
addLayerText('line', opt, layerId);
|
|
@@ -72313,6 +72326,47 @@ const addLayerLineAnimation = (option, layerId) => {
|
|
|
72313
72326
|
}
|
|
72314
72327
|
});
|
|
72315
72328
|
};
|
|
72329
|
+
|
|
72330
|
+
/**
|
|
72331
|
+
* 添加虚线图层
|
|
72332
|
+
*/
|
|
72333
|
+
const addLayerLineDash = (option, layerId) => {
|
|
72334
|
+
let {
|
|
72335
|
+
map
|
|
72336
|
+
} = package_map;
|
|
72337
|
+
let opt = option;
|
|
72338
|
+
let parentId = opt.id;
|
|
72339
|
+
let id = parentId + '-dash';
|
|
72340
|
+
if (hasLayer(id)) {
|
|
72341
|
+
setSource(id, opt.data);
|
|
72342
|
+
return;
|
|
72343
|
+
}
|
|
72344
|
+
let layout = opt.dash ? opt.dash.layout : {};
|
|
72345
|
+
let layoutOpt = Object.assign({
|
|
72346
|
+
'visibility': 'visible'
|
|
72347
|
+
}, layout);
|
|
72348
|
+
let paint = opt.dash ? opt.dash.paint : {};
|
|
72349
|
+
let paintOpt = Object.assign({
|
|
72350
|
+
'line-color': '#28b2ff',
|
|
72351
|
+
'line-dasharray': [4, 4],
|
|
72352
|
+
'line-width': 3,
|
|
72353
|
+
'line-opacity': 1
|
|
72354
|
+
}, paint);
|
|
72355
|
+
if (!hasSource(id)) {
|
|
72356
|
+
map.addSource(id, {
|
|
72357
|
+
type: 'geojson',
|
|
72358
|
+
data: opt.data
|
|
72359
|
+
});
|
|
72360
|
+
}
|
|
72361
|
+
map.addLayer({
|
|
72362
|
+
id: id,
|
|
72363
|
+
type: 'line',
|
|
72364
|
+
source: id,
|
|
72365
|
+
layout: layoutOpt,
|
|
72366
|
+
paint: paintOpt,
|
|
72367
|
+
...opt.other
|
|
72368
|
+
}, layerId);
|
|
72369
|
+
};
|
|
72316
72370
|
;// CONCATENATED MODULE: ./src/package/layers/Point.js
|
|
72317
72371
|
|
|
72318
72372
|
|