xy-map 1.1.35 → 1.1.37
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 +11 -11
- package/xy-map.common.js +472 -235
- package/xy-map.umd.js +472 -235
- package/xy-map.umd.min.js +3 -3
package/xy-map.umd.js
CHANGED
|
@@ -255,7 +255,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".snow[data-v-20664206]{position:absolu
|
|
|
255
255
|
|
|
256
256
|
/***/ }),
|
|
257
257
|
|
|
258
|
-
/***/
|
|
258
|
+
/***/ 4492:
|
|
259
259
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
260
260
|
|
|
261
261
|
"use strict";
|
|
@@ -269,7 +269,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
269
269
|
|
|
270
270
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
271
271
|
// Module
|
|
272
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".tools[data-v-
|
|
272
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".tools[data-v-4ba1db1c]{position:absolute;left:0;top:0;margin:15px;background-color:hsla(0,0%,100%,.9);padding:14px;border-radius:5px}.tools .tools-bar[data-v-4ba1db1c]{cursor:pointer}.right-fixed[data-v-4ba1db1c]{position:absolute;right:0;top:0;margin:15px}", ""]);
|
|
273
273
|
// Exports
|
|
274
274
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
275
275
|
|
|
@@ -297,7 +297,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".upload[data-v-57aca7b6]{position:rela
|
|
|
297
297
|
|
|
298
298
|
/***/ }),
|
|
299
299
|
|
|
300
|
-
/***/
|
|
300
|
+
/***/ 1235:
|
|
301
301
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
302
302
|
|
|
303
303
|
"use strict";
|
|
@@ -311,7 +311,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
311
311
|
|
|
312
312
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
313
313
|
// Module
|
|
314
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".upload[data-v-
|
|
314
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".upload[data-v-3b26555c]{position:relative}.upload input[data-v-3b26555c]{position:absolute;width:100%;height:100%;left:0;top:0;opacity:0}", ""]);
|
|
315
315
|
// Exports
|
|
316
316
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
317
317
|
|
|
@@ -42938,19 +42938,19 @@ var update = add("33a2ac54", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
42938
42938
|
|
|
42939
42939
|
/***/ }),
|
|
42940
42940
|
|
|
42941
|
-
/***/
|
|
42941
|
+
/***/ 9521:
|
|
42942
42942
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
42943
42943
|
|
|
42944
42944
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
42945
42945
|
|
|
42946
42946
|
// load the styles
|
|
42947
|
-
var content = __webpack_require__(
|
|
42947
|
+
var content = __webpack_require__(4492);
|
|
42948
42948
|
if(content.__esModule) content = content.default;
|
|
42949
42949
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
42950
42950
|
if(content.locals) module.exports = content.locals;
|
|
42951
42951
|
// add the styles to the DOM
|
|
42952
42952
|
var add = (__webpack_require__(208)/* ["default"] */ .Z)
|
|
42953
|
-
var update = add("
|
|
42953
|
+
var update = add("343c43da", content, true, {"sourceMap":false,"shadowMode":false});
|
|
42954
42954
|
|
|
42955
42955
|
/***/ }),
|
|
42956
42956
|
|
|
@@ -42970,19 +42970,19 @@ var update = add("2348509c", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
42970
42970
|
|
|
42971
42971
|
/***/ }),
|
|
42972
42972
|
|
|
42973
|
-
/***/
|
|
42973
|
+
/***/ 3740:
|
|
42974
42974
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
42975
42975
|
|
|
42976
42976
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
42977
42977
|
|
|
42978
42978
|
// load the styles
|
|
42979
|
-
var content = __webpack_require__(
|
|
42979
|
+
var content = __webpack_require__(1235);
|
|
42980
42980
|
if(content.__esModule) content = content.default;
|
|
42981
42981
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
42982
42982
|
if(content.locals) module.exports = content.locals;
|
|
42983
42983
|
// add the styles to the DOM
|
|
42984
42984
|
var add = (__webpack_require__(208)/* ["default"] */ .Z)
|
|
42985
|
-
var update = add("
|
|
42985
|
+
var update = add("dfa8ba9e", content, true, {"sourceMap":false,"shadowMode":false});
|
|
42986
42986
|
|
|
42987
42987
|
/***/ }),
|
|
42988
42988
|
|
|
@@ -43715,6 +43715,24 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43715
43715
|
"shpFile": function() { return /* reexport */ shpFile; }
|
|
43716
43716
|
});
|
|
43717
43717
|
|
|
43718
|
+
// NAMESPACE OBJECT: ./src/package/util/mapTools.js
|
|
43719
|
+
var mapTools_namespaceObject = {};
|
|
43720
|
+
__webpack_require__.r(mapTools_namespaceObject);
|
|
43721
|
+
__webpack_require__.d(mapTools_namespaceObject, {
|
|
43722
|
+
"YK": function() { return clearDraw; },
|
|
43723
|
+
"TE": function() { return mapTools_distance; },
|
|
43724
|
+
"N5": function() { return drawArea; },
|
|
43725
|
+
"tL": function() { return geometryCollectionToFeatureCollection; },
|
|
43726
|
+
"yQ": function() { return getElevation; },
|
|
43727
|
+
"yJ": function() { return lineCenter; },
|
|
43728
|
+
"po": function() { return loadImage; },
|
|
43729
|
+
"bZ": function() { return pointToGeoJson; },
|
|
43730
|
+
"j_": function() { return polygonCenter; },
|
|
43731
|
+
"Do": function() { return ranging; },
|
|
43732
|
+
"b4": function() { return spArray; },
|
|
43733
|
+
"rg": function() { return toGeoJson; }
|
|
43734
|
+
});
|
|
43735
|
+
|
|
43718
43736
|
// NAMESPACE OBJECT: ./node_modules/@loaders.gl/gltf/dist/esm/lib/extensions/EXT_meshopt_compression.js
|
|
43719
43737
|
var EXT_meshopt_compression_namespaceObject = {};
|
|
43720
43738
|
__webpack_require__.r(EXT_meshopt_compression_namespaceObject);
|
|
@@ -43847,7 +43865,130 @@ var style_map = __webpack_require__(4321);
|
|
|
43847
43865
|
// EXTERNAL MODULE: ./node_modules/html2canvas/dist/html2canvas.js
|
|
43848
43866
|
var html2canvas = __webpack_require__(5507);
|
|
43849
43867
|
var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
43868
|
+
;// CONCATENATED MODULE: ./src/package/layers/index.js
|
|
43869
|
+
// import mapBoxGl from 'mapbox-gl'
|
|
43870
|
+
|
|
43871
|
+
|
|
43872
|
+
// 更新数据
|
|
43873
|
+
const setSource = (id, data) => {
|
|
43874
|
+
let {
|
|
43875
|
+
map
|
|
43876
|
+
} = package_map;
|
|
43877
|
+
let hasSource = map.getSource(id);
|
|
43878
|
+
if (hasSource) {
|
|
43879
|
+
map.getSource(id).setData(data);
|
|
43880
|
+
}
|
|
43881
|
+
};
|
|
43882
|
+
// 判断图层是否存在
|
|
43883
|
+
const hasLayer = id => {
|
|
43884
|
+
let {
|
|
43885
|
+
map
|
|
43886
|
+
} = package_map;
|
|
43887
|
+
return map.getLayer(id);
|
|
43888
|
+
};
|
|
43889
|
+
|
|
43890
|
+
// 判断数据是否存在
|
|
43891
|
+
const hasSource = id => {
|
|
43892
|
+
let {
|
|
43893
|
+
map
|
|
43894
|
+
} = package_map;
|
|
43895
|
+
return map.getSource(id);
|
|
43896
|
+
};
|
|
43897
|
+
|
|
43898
|
+
// 删除图层
|
|
43899
|
+
const removeLayer = id => {
|
|
43900
|
+
let {
|
|
43901
|
+
map
|
|
43902
|
+
} = package_map;
|
|
43903
|
+
map.removeLayer(id);
|
|
43904
|
+
let arr = getLayerAll();
|
|
43905
|
+
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
43906
|
+
layers.forEach(item => {
|
|
43907
|
+
if (hasLayer(item.id)) {
|
|
43908
|
+
map.removeLayer(item.id);
|
|
43909
|
+
}
|
|
43910
|
+
});
|
|
43911
|
+
};
|
|
43912
|
+
|
|
43913
|
+
/**
|
|
43914
|
+
* 获取所有图层
|
|
43915
|
+
*/
|
|
43916
|
+
const getLayerAll = () => {
|
|
43917
|
+
let {
|
|
43918
|
+
map
|
|
43919
|
+
} = package_map;
|
|
43920
|
+
let data = map.getStyle().layers;
|
|
43921
|
+
// console.log(data)
|
|
43922
|
+
return data;
|
|
43923
|
+
};
|
|
43924
|
+
|
|
43925
|
+
// 显示隐藏图层
|
|
43926
|
+
const showLayer = (id, show = false) => {
|
|
43927
|
+
let {
|
|
43928
|
+
map
|
|
43929
|
+
} = package_map;
|
|
43930
|
+
show = show ? 'visible' : 'none';
|
|
43931
|
+
map.setLayoutProperty(id, 'visibility', show);
|
|
43932
|
+
let arr = getLayerAll();
|
|
43933
|
+
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
43934
|
+
layers.forEach(item => {
|
|
43935
|
+
if (hasLayer(item.id)) {
|
|
43936
|
+
map.setLayoutProperty(item.id, 'visibility', show);
|
|
43937
|
+
}
|
|
43938
|
+
});
|
|
43939
|
+
};
|
|
43940
|
+
|
|
43941
|
+
// 显隐文字
|
|
43942
|
+
const showLayerText = (show, id = '') => {
|
|
43943
|
+
let {
|
|
43944
|
+
map
|
|
43945
|
+
} = package_map;
|
|
43946
|
+
if (id) {
|
|
43947
|
+
setPaint(id, 'text-opacity', show ? 1 : 0);
|
|
43948
|
+
} else {
|
|
43949
|
+
let textLayer = map.getStyle().layers;
|
|
43950
|
+
textLayer.forEach(layer => {
|
|
43951
|
+
if (layer.type === 'symbol') {
|
|
43952
|
+
setPaint(layer.id, 'text-opacity', show ? 1 : 0);
|
|
43953
|
+
}
|
|
43954
|
+
});
|
|
43955
|
+
}
|
|
43956
|
+
};
|
|
43957
|
+
|
|
43958
|
+
// 修改Layout
|
|
43959
|
+
const setLayout = (id, key, value) => {
|
|
43960
|
+
let {
|
|
43961
|
+
map
|
|
43962
|
+
} = package_map;
|
|
43963
|
+
map.setLayoutProperty(id, key, value);
|
|
43964
|
+
};
|
|
43965
|
+
|
|
43966
|
+
// 修改Paint
|
|
43967
|
+
const setPaint = (id, key, value) => {
|
|
43968
|
+
let {
|
|
43969
|
+
map
|
|
43970
|
+
} = package_map;
|
|
43971
|
+
map.setPaintProperty(id, key, value);
|
|
43972
|
+
};
|
|
43973
|
+
|
|
43974
|
+
// 修改Filter
|
|
43975
|
+
const setFilter = (key, filter) => {
|
|
43976
|
+
let {
|
|
43977
|
+
map
|
|
43978
|
+
} = package_map;
|
|
43979
|
+
map.setFilter(key, filter);
|
|
43980
|
+
};
|
|
43981
|
+
|
|
43982
|
+
// 设置高亮
|
|
43983
|
+
const setHigh = (id, filter) => {
|
|
43984
|
+
let {
|
|
43985
|
+
map
|
|
43986
|
+
} = package_map;
|
|
43987
|
+
map.setFilter(id + '-high', filter);
|
|
43988
|
+
};
|
|
43850
43989
|
;// CONCATENATED MODULE: ./src/package/map.js
|
|
43990
|
+
// 天地图token
|
|
43991
|
+
const tdtToken = (/* unused pure expression or super */ null && (['150bad890e9d004885a4b2a94062a46e', '337996a733e1ea41cd73124f67f4795d', '48282c15cce091a1154a674512372eec', 'f3c2ca3a170f5712abd7b6858e038f18']));
|
|
43851
43992
|
var defaultOptions = {
|
|
43852
43993
|
container: 'map',
|
|
43853
43994
|
zoom: 12,
|
|
@@ -43892,7 +44033,7 @@ var defaultOptions = {
|
|
|
43892
44033
|
// 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', // ArcGIS
|
|
43893
44034
|
// 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', // 高德
|
|
43894
44035
|
// 'https://map.ynmdgq.com/{z}/{x}/{y}.png' // 本地
|
|
43895
|
-
// 'http://t7.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=
|
|
44036
|
+
// 'http://t7.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=' + tdtToken[Math.floor(Math.random() * tdtToken.length)], // 天地图
|
|
43896
44037
|
],
|
|
43897
44038
|
|
|
43898
44039
|
'tileSize': 512
|
|
@@ -43924,6 +44065,7 @@ var defaultOptions = {
|
|
|
43924
44065
|
|
|
43925
44066
|
|
|
43926
44067
|
|
|
44068
|
+
|
|
43927
44069
|
// import { Message } from 'element-ui'
|
|
43928
44070
|
|
|
43929
44071
|
var popup = null;
|
|
@@ -44065,6 +44207,7 @@ class mapSdk {
|
|
|
44065
44207
|
'star-intensity': 0.1
|
|
44066
44208
|
});
|
|
44067
44209
|
} else {
|
|
44210
|
+
if (hasLayer('sky')) return;
|
|
44068
44211
|
// 天空
|
|
44069
44212
|
map.addLayer({
|
|
44070
44213
|
'id': 'sky',
|
|
@@ -44374,127 +44517,6 @@ class mapSdk {
|
|
|
44374
44517
|
}
|
|
44375
44518
|
}
|
|
44376
44519
|
/* harmony default export */ var package_map = (new mapSdk());
|
|
44377
|
-
;// CONCATENATED MODULE: ./src/package/layers/index.js
|
|
44378
|
-
// import mapBoxGl from 'mapbox-gl'
|
|
44379
|
-
|
|
44380
|
-
|
|
44381
|
-
// 更新数据
|
|
44382
|
-
const setSource = (id, data) => {
|
|
44383
|
-
let {
|
|
44384
|
-
map
|
|
44385
|
-
} = package_map;
|
|
44386
|
-
let hasSource = map.getSource(id);
|
|
44387
|
-
if (hasSource) {
|
|
44388
|
-
map.getSource(id).setData(data);
|
|
44389
|
-
}
|
|
44390
|
-
};
|
|
44391
|
-
// 判断图层是否存在
|
|
44392
|
-
const hasLayer = id => {
|
|
44393
|
-
let {
|
|
44394
|
-
map
|
|
44395
|
-
} = package_map;
|
|
44396
|
-
return map.getLayer(id);
|
|
44397
|
-
};
|
|
44398
|
-
|
|
44399
|
-
// 判断数据是否存在
|
|
44400
|
-
const hasSource = id => {
|
|
44401
|
-
let {
|
|
44402
|
-
map
|
|
44403
|
-
} = package_map;
|
|
44404
|
-
return map.getSource(id);
|
|
44405
|
-
};
|
|
44406
|
-
|
|
44407
|
-
// 删除图层
|
|
44408
|
-
const removeLayer = id => {
|
|
44409
|
-
let {
|
|
44410
|
-
map
|
|
44411
|
-
} = package_map;
|
|
44412
|
-
map.removeLayer(id);
|
|
44413
|
-
let arr = getLayerAll();
|
|
44414
|
-
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
44415
|
-
layers.forEach(item => {
|
|
44416
|
-
if (hasLayer(item.id)) {
|
|
44417
|
-
map.removeLayer(item.id);
|
|
44418
|
-
}
|
|
44419
|
-
});
|
|
44420
|
-
};
|
|
44421
|
-
|
|
44422
|
-
/**
|
|
44423
|
-
* 获取所有图层
|
|
44424
|
-
*/
|
|
44425
|
-
const getLayerAll = () => {
|
|
44426
|
-
let {
|
|
44427
|
-
map
|
|
44428
|
-
} = package_map;
|
|
44429
|
-
let data = map.getStyle().layers;
|
|
44430
|
-
// console.log(data)
|
|
44431
|
-
return data;
|
|
44432
|
-
};
|
|
44433
|
-
|
|
44434
|
-
// 显示隐藏图层
|
|
44435
|
-
const showLayer = (id, show = false) => {
|
|
44436
|
-
let {
|
|
44437
|
-
map
|
|
44438
|
-
} = package_map;
|
|
44439
|
-
show = show ? 'visible' : 'none';
|
|
44440
|
-
map.setLayoutProperty(id, 'visibility', show);
|
|
44441
|
-
let arr = getLayerAll();
|
|
44442
|
-
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
44443
|
-
layers.forEach(item => {
|
|
44444
|
-
if (hasLayer(item.id)) {
|
|
44445
|
-
map.setLayoutProperty(item.id, 'visibility', show);
|
|
44446
|
-
}
|
|
44447
|
-
});
|
|
44448
|
-
};
|
|
44449
|
-
|
|
44450
|
-
// 显隐文字
|
|
44451
|
-
const showLayerText = (show, id = '') => {
|
|
44452
|
-
let {
|
|
44453
|
-
map
|
|
44454
|
-
} = package_map;
|
|
44455
|
-
if (id) {
|
|
44456
|
-
setPaint(id, 'text-opacity', show ? 1 : 0);
|
|
44457
|
-
} else {
|
|
44458
|
-
let textLayer = map.getStyle().layers;
|
|
44459
|
-
textLayer.forEach(layer => {
|
|
44460
|
-
if (layer.type === 'symbol') {
|
|
44461
|
-
setPaint(layer.id, 'text-opacity', show ? 1 : 0);
|
|
44462
|
-
}
|
|
44463
|
-
});
|
|
44464
|
-
}
|
|
44465
|
-
};
|
|
44466
|
-
|
|
44467
|
-
// 修改Layout
|
|
44468
|
-
const setLayout = (id, key, value) => {
|
|
44469
|
-
let {
|
|
44470
|
-
map
|
|
44471
|
-
} = package_map;
|
|
44472
|
-
map.setLayoutProperty(id, key, value);
|
|
44473
|
-
};
|
|
44474
|
-
|
|
44475
|
-
// 修改Paint
|
|
44476
|
-
const setPaint = (id, key, value) => {
|
|
44477
|
-
let {
|
|
44478
|
-
map
|
|
44479
|
-
} = package_map;
|
|
44480
|
-
map.setPaintProperty(id, key, value);
|
|
44481
|
-
};
|
|
44482
|
-
|
|
44483
|
-
// 修改Filter
|
|
44484
|
-
const setFilter = (key, filter) => {
|
|
44485
|
-
let {
|
|
44486
|
-
map
|
|
44487
|
-
} = package_map;
|
|
44488
|
-
map.setFilter(key, filter);
|
|
44489
|
-
};
|
|
44490
|
-
|
|
44491
|
-
// 设置高亮
|
|
44492
|
-
const setHigh = (id, filter) => {
|
|
44493
|
-
let {
|
|
44494
|
-
map
|
|
44495
|
-
} = package_map;
|
|
44496
|
-
map.setFilter(id + '-high', filter);
|
|
44497
|
-
};
|
|
44498
44520
|
;// CONCATENATED MODULE: ./src/package/layers/Text.js
|
|
44499
44521
|
|
|
44500
44522
|
|
|
@@ -66819,8 +66841,8 @@ const Line_defaultOptions = {
|
|
|
66819
66841
|
click: null
|
|
66820
66842
|
};
|
|
66821
66843
|
|
|
66822
|
-
/**
|
|
66823
|
-
* 添加线图层
|
|
66844
|
+
/**
|
|
66845
|
+
* 添加线图层
|
|
66824
66846
|
*/
|
|
66825
66847
|
const addLayerLine = (option, layerId) => {
|
|
66826
66848
|
let {
|
|
@@ -66889,9 +66911,9 @@ const addLayerLine = (option, layerId) => {
|
|
|
66889
66911
|
}
|
|
66890
66912
|
};
|
|
66891
66913
|
|
|
66892
|
-
/**
|
|
66893
|
-
* 添加动画线图层
|
|
66894
|
-
* addLayerLine配置图层
|
|
66914
|
+
/**
|
|
66915
|
+
* 添加动画线图层
|
|
66916
|
+
* addLayerLine配置图层
|
|
66895
66917
|
*/
|
|
66896
66918
|
const addLayerLineAnimation = (option, layerId) => {
|
|
66897
66919
|
let {
|
|
@@ -69782,9 +69804,9 @@ let after = null;
|
|
|
69782
69804
|
let textColor = '#fff';
|
|
69783
69805
|
let lineColor = '#f00';
|
|
69784
69806
|
|
|
69785
|
-
/**
|
|
69786
|
-
* 测距
|
|
69787
|
-
* @param mapObject
|
|
69807
|
+
/**
|
|
69808
|
+
* 测距
|
|
69809
|
+
* @param mapObject
|
|
69788
69810
|
*/
|
|
69789
69811
|
function measureLineLength(mapObject) {
|
|
69790
69812
|
const currentMapContainerId = mapObject._container.getAttribute('id');
|
|
@@ -69902,9 +69924,9 @@ function measureLineLength(mapObject) {
|
|
|
69902
69924
|
deleteTips.remove();
|
|
69903
69925
|
}
|
|
69904
69926
|
});
|
|
69905
|
-
/**
|
|
69906
|
-
* 点击测距点位触发
|
|
69907
|
-
* @param event
|
|
69927
|
+
/**
|
|
69928
|
+
* 点击测距点位触发
|
|
69929
|
+
* @param event
|
|
69908
69930
|
* */
|
|
69909
69931
|
// eslint-disable-next-line no-undef,no-inner-declarations
|
|
69910
69932
|
function clickMeasurePointsHandler(event) {
|
|
@@ -69988,8 +70010,8 @@ function measureLineLength(mapObject) {
|
|
|
69988
70010
|
resultData.map.on('dblclick', dblclickHandler);
|
|
69989
70011
|
}
|
|
69990
70012
|
|
|
69991
|
-
/**
|
|
69992
|
-
* 清除测距相关
|
|
70013
|
+
/**
|
|
70014
|
+
* 清除测距相关
|
|
69993
70015
|
*/
|
|
69994
70016
|
function clearMeasureLine(mapObject) {
|
|
69995
70017
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70011,9 +70033,9 @@ function clearMeasureLine(mapObject) {
|
|
|
70011
70033
|
}
|
|
70012
70034
|
}
|
|
70013
70035
|
|
|
70014
|
-
/**
|
|
70015
|
-
* 创建label marker
|
|
70016
|
-
* @returns {*} 返回marker对象
|
|
70036
|
+
/**
|
|
70037
|
+
* 创建label marker
|
|
70038
|
+
* @returns {*} 返回marker对象
|
|
70017
70039
|
*/
|
|
70018
70040
|
function createMeasurLineLabelMarkerHandler(mapObject) {
|
|
70019
70041
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70036,11 +70058,11 @@ function createMeasurLineLabelMarkerHandler(mapObject) {
|
|
|
70036
70058
|
};
|
|
70037
70059
|
}
|
|
70038
70060
|
|
|
70039
|
-
/**
|
|
70040
|
-
* 创建测距需要的layers,points、line、measure-line-move
|
|
70041
|
-
* @param jsonPoint
|
|
70042
|
-
* @param jsonLine
|
|
70043
|
-
* @param mapObject
|
|
70061
|
+
/**
|
|
70062
|
+
* 创建测距需要的layers,points、line、measure-line-move
|
|
70063
|
+
* @param jsonPoint
|
|
70064
|
+
* @param jsonLine
|
|
70065
|
+
* @param mapObject
|
|
70044
70066
|
*/
|
|
70045
70067
|
function createMeasureLinePLLHandler(jsonPoint, jsonLine, mapObject) {
|
|
70046
70068
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70101,8 +70123,8 @@ function createMeasureLinePLLHandler(jsonPoint, jsonLine, mapObject) {
|
|
|
70101
70123
|
moveLayerHandler(resultData.map);
|
|
70102
70124
|
}
|
|
70103
70125
|
|
|
70104
|
-
/**
|
|
70105
|
-
* 将测距的三个图层移到最上层级
|
|
70126
|
+
/**
|
|
70127
|
+
* 将测距的三个图层移到最上层级
|
|
70106
70128
|
*/
|
|
70107
70129
|
function moveLayerHandler(mapObject) {
|
|
70108
70130
|
const {
|
|
@@ -70120,12 +70142,12 @@ function moveLayerHandler(mapObject) {
|
|
|
70120
70142
|
}
|
|
70121
70143
|
}
|
|
70122
70144
|
|
|
70123
|
-
/**
|
|
70124
|
-
* 添加点位layer
|
|
70125
|
-
* @param jsonPoint
|
|
70126
|
-
* @param jsonLine
|
|
70127
|
-
* @param coords
|
|
70128
|
-
* @param mapObject
|
|
70145
|
+
/**
|
|
70146
|
+
* 添加点位layer
|
|
70147
|
+
* @param jsonPoint
|
|
70148
|
+
* @param jsonLine
|
|
70149
|
+
* @param coords
|
|
70150
|
+
* @param mapObject
|
|
70129
70151
|
*/
|
|
70130
70152
|
function addMeasureLinePoint(jsonPoint, jsonLine, coords, mapObject) {
|
|
70131
70153
|
const {
|
|
@@ -70168,11 +70190,11 @@ function addMeasureLinePoint(jsonPoint, jsonLine, coords, mapObject) {
|
|
|
70168
70190
|
map.getSource('measure-line-points').setData(jsonPoint);
|
|
70169
70191
|
}
|
|
70170
70192
|
|
|
70171
|
-
/**
|
|
70172
|
-
* 获取两坐标点之间的距离
|
|
70173
|
-
* @param points
|
|
70174
|
-
* @param coords
|
|
70175
|
-
* @returns {string}
|
|
70193
|
+
/**
|
|
70194
|
+
* 获取两坐标点之间的距离
|
|
70195
|
+
* @param points
|
|
70196
|
+
* @param coords
|
|
70197
|
+
* @returns {string}
|
|
70176
70198
|
*/
|
|
70177
70199
|
function getMeasureLineLength(points, coords) {
|
|
70178
70200
|
const _points = points.concat([coords]);
|
|
@@ -70188,12 +70210,12 @@ function getMeasureLineLength(points, coords) {
|
|
|
70188
70210
|
return len;
|
|
70189
70211
|
}
|
|
70190
70212
|
|
|
70191
|
-
/**
|
|
70192
|
-
* 点击地图添加点位触发给当前点位绑定测距结果的labelMarker
|
|
70193
|
-
* @param points
|
|
70194
|
-
* @param jsonPoint
|
|
70195
|
-
* @param coords
|
|
70196
|
-
* @param mapObject
|
|
70213
|
+
/**
|
|
70214
|
+
* 点击地图添加点位触发给当前点位绑定测距结果的labelMarker
|
|
70215
|
+
* @param points
|
|
70216
|
+
* @param jsonPoint
|
|
70217
|
+
* @param coords
|
|
70218
|
+
* @param mapObject
|
|
70197
70219
|
* */
|
|
70198
70220
|
function addMeasureLineRes(points, jsonPoint, coords, mapObject) {
|
|
70199
70221
|
const {
|
|
@@ -70221,11 +70243,11 @@ function addMeasureLineRes(points, jsonPoint, coords, mapObject) {
|
|
|
70221
70243
|
new (mapbox_gl_default()).Marker(option).setLngLat(coords).addTo(map);
|
|
70222
70244
|
}
|
|
70223
70245
|
|
|
70224
|
-
/**
|
|
70225
|
-
* 点击测距点位重新触发计算两点位之间的距离
|
|
70226
|
-
* @param resultPoints
|
|
70227
|
-
* @param coords
|
|
70228
|
-
* @returns {string}
|
|
70246
|
+
/**
|
|
70247
|
+
* 点击测距点位重新触发计算两点位之间的距离
|
|
70248
|
+
* @param resultPoints
|
|
70249
|
+
* @param coords
|
|
70250
|
+
* @returns {string}
|
|
70229
70251
|
*/
|
|
70230
70252
|
function getMetersHandler(resultPoints, coords) {
|
|
70231
70253
|
if (resultPoints.length > 1) {
|
|
@@ -70243,13 +70265,13 @@ function getMetersHandler(resultPoints, coords) {
|
|
|
70243
70265
|
}
|
|
70244
70266
|
}
|
|
70245
70267
|
|
|
70246
|
-
/**
|
|
70247
|
-
* 获取两点位之间的角度
|
|
70248
|
-
* @param lng1
|
|
70249
|
-
* @param lat1
|
|
70250
|
-
* @param lng2
|
|
70251
|
-
* @param lat2
|
|
70252
|
-
* @returns {number}
|
|
70268
|
+
/**
|
|
70269
|
+
* 获取两点位之间的角度
|
|
70270
|
+
* @param lng1
|
|
70271
|
+
* @param lat1
|
|
70272
|
+
* @param lng2
|
|
70273
|
+
* @param lat2
|
|
70274
|
+
* @returns {number}
|
|
70253
70275
|
*/
|
|
70254
70276
|
function getAngleHandle(lng1, lat1, lng2, lat2) {
|
|
70255
70277
|
const a = (90 - lat2) * Math.PI / 180;
|
|
@@ -70280,11 +70302,11 @@ function getAngleHandle(lng1, lat1, lng2, lat2) {
|
|
|
70280
70302
|
return res;
|
|
70281
70303
|
}
|
|
70282
70304
|
|
|
70283
|
-
/**
|
|
70284
|
-
* 创建关闭按钮
|
|
70285
|
-
* @param clickMeasurePointsHandler
|
|
70286
|
-
* @param coords
|
|
70287
|
-
* @param mapObject
|
|
70305
|
+
/**
|
|
70306
|
+
* 创建关闭按钮
|
|
70307
|
+
* @param clickMeasurePointsHandler
|
|
70308
|
+
* @param coords
|
|
70309
|
+
* @param mapObject
|
|
70288
70310
|
*/
|
|
70289
70311
|
function createCloseMarkerHandler(clickMeasurePointsHandler, coords, mapObject) {
|
|
70290
70312
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70307,8 +70329,8 @@ function createCloseMarkerHandler(clickMeasurePointsHandler, coords, mapObject)
|
|
|
70307
70329
|
};
|
|
70308
70330
|
}
|
|
70309
70331
|
|
|
70310
|
-
/**
|
|
70311
|
-
* 关闭触发
|
|
70332
|
+
/**
|
|
70333
|
+
* 关闭触发
|
|
70312
70334
|
*/
|
|
70313
70335
|
function closeMeasureLine(mapObject) {
|
|
70314
70336
|
if (!mapObject) return;
|
|
@@ -70601,20 +70623,19 @@ const pointToGeoJson = (position = [0, 0]) => {
|
|
|
70601
70623
|
return data;
|
|
70602
70624
|
};
|
|
70603
70625
|
|
|
70604
|
-
//
|
|
70605
|
-
const
|
|
70606
|
-
|
|
70607
|
-
|
|
70608
|
-
|
|
70609
|
-
|
|
70610
|
-
|
|
70611
|
-
|
|
70612
|
-
type: 'Feature',
|
|
70613
|
-
geometry: item,
|
|
70614
|
-
properties: {}
|
|
70615
|
-
});
|
|
70626
|
+
// geoJson 格式 GeometryCollection 转 FeatureCollection
|
|
70627
|
+
const geometryCollectionToFeatureCollection = geometryCollection => {
|
|
70628
|
+
const features = [];
|
|
70629
|
+
|
|
70630
|
+
// 遍历 GeometryCollection 中的每个几何对象
|
|
70631
|
+
geometryCollection.geometries.forEach(geometry => {
|
|
70632
|
+
const feature = es_feature(geometry);
|
|
70633
|
+
features.push(feature);
|
|
70616
70634
|
});
|
|
70617
|
-
|
|
70635
|
+
|
|
70636
|
+
// 创建 FeatureCollection
|
|
70637
|
+
const featureCollection = es_featureCollection(features);
|
|
70638
|
+
return featureCollection;
|
|
70618
70639
|
};
|
|
70619
70640
|
|
|
70620
70641
|
// 3857墨卡托坐标系转换为4326 (WGS84)经纬度坐标
|
|
@@ -71282,8 +71303,8 @@ const Polygon_defaultOptions = {
|
|
|
71282
71303
|
click: null
|
|
71283
71304
|
};
|
|
71284
71305
|
|
|
71285
|
-
/**
|
|
71286
|
-
* 添加面图层
|
|
71306
|
+
/**
|
|
71307
|
+
* 添加面图层
|
|
71287
71308
|
*/
|
|
71288
71309
|
const addLayerPolygon = (option, layerId) => {
|
|
71289
71310
|
let {
|
|
@@ -71385,8 +71406,8 @@ const circle_defaultOptions = {
|
|
|
71385
71406
|
click: null
|
|
71386
71407
|
};
|
|
71387
71408
|
|
|
71388
|
-
/**
|
|
71389
|
-
* 添加面图层
|
|
71409
|
+
/**
|
|
71410
|
+
* 添加面图层
|
|
71390
71411
|
*/
|
|
71391
71412
|
const addLayerCircle = (option, layerId) => {
|
|
71392
71413
|
let {
|
|
@@ -71516,8 +71537,8 @@ const circleAnimate_defaultOptions = {
|
|
|
71516
71537
|
click: null
|
|
71517
71538
|
};
|
|
71518
71539
|
|
|
71519
|
-
/**
|
|
71520
|
-
* 添加圆图层
|
|
71540
|
+
/**
|
|
71541
|
+
* 添加圆图层
|
|
71521
71542
|
*/
|
|
71522
71543
|
const addCircleAnimate = (option, layerId) => {
|
|
71523
71544
|
let {
|
|
@@ -77329,6 +77350,168 @@ const addLayerModel = (option, layerId = '') => {
|
|
|
77329
77350
|
}
|
|
77330
77351
|
});
|
|
77331
77352
|
};
|
|
77353
|
+
;// CONCATENATED MODULE: ./src/package/layers/pipe.js
|
|
77354
|
+
|
|
77355
|
+
|
|
77356
|
+
|
|
77357
|
+
|
|
77358
|
+
|
|
77359
|
+
|
|
77360
|
+
|
|
77361
|
+
|
|
77362
|
+
|
|
77363
|
+
|
|
77364
|
+
const pipe_defaultOptions = {
|
|
77365
|
+
id: 'pipe',
|
|
77366
|
+
position: [103.353557, 23.362395],
|
|
77367
|
+
// 位置
|
|
77368
|
+
hight: 0,
|
|
77369
|
+
// 高度
|
|
77370
|
+
edit: false
|
|
77371
|
+
};
|
|
77372
|
+
|
|
77373
|
+
/**
|
|
77374
|
+
* 添加管道
|
|
77375
|
+
*/
|
|
77376
|
+
const addLayerPipe = (option, layerId = '') => {
|
|
77377
|
+
return new Promise(resolve => {
|
|
77378
|
+
let {
|
|
77379
|
+
map
|
|
77380
|
+
} = package_map;
|
|
77381
|
+
let opt = Object.assign({}, pipe_defaultOptions, option);
|
|
77382
|
+
let camera = '';
|
|
77383
|
+
let scene = '';
|
|
77384
|
+
let group = '';
|
|
77385
|
+
let renderer = '';
|
|
77386
|
+
let customLayer = '';
|
|
77387
|
+
let pipeMesh = '';
|
|
77388
|
+
if (hasLayer(opt.id)) {
|
|
77389
|
+
removeLayer(opt.id);
|
|
77390
|
+
}
|
|
77391
|
+
addPipe();
|
|
77392
|
+
map.addLayer(customLayer, layerId);
|
|
77393
|
+
resolve(group);
|
|
77394
|
+
function addPipe() {
|
|
77395
|
+
const modelOrigin = opt.position; // 中心点
|
|
77396
|
+
const modelAltitude = opt.elevation; // 海拔高度
|
|
77397
|
+
const modelRotate = [Math.PI / 2, 0, 0];
|
|
77398
|
+
const modelAsMercatorCoordinate = mapbox_gl_default().MercatorCoordinate.fromLngLat(modelOrigin, modelAltitude);
|
|
77399
|
+
const modelTransform = {
|
|
77400
|
+
translateX: modelAsMercatorCoordinate.x,
|
|
77401
|
+
translateY: modelAsMercatorCoordinate.y,
|
|
77402
|
+
translateZ: modelAsMercatorCoordinate.z,
|
|
77403
|
+
rotateX: modelRotate[0],
|
|
77404
|
+
rotateY: modelRotate[1],
|
|
77405
|
+
rotateZ: modelRotate[2],
|
|
77406
|
+
scale: modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()
|
|
77407
|
+
};
|
|
77408
|
+
|
|
77409
|
+
// 根据CustomLayerInterface为三维模型配置自定义层
|
|
77410
|
+
customLayer = {
|
|
77411
|
+
id: opt.id,
|
|
77412
|
+
type: 'custom',
|
|
77413
|
+
renderingMode: '3d',
|
|
77414
|
+
onAdd: (map, gl) => {
|
|
77415
|
+
const container = map.getCanvas();
|
|
77416
|
+
|
|
77417
|
+
// 摄像机
|
|
77418
|
+
camera = new PerspectiveCamera(50, container.clientWidth / container.clientHeight, 1, 5000);
|
|
77419
|
+
|
|
77420
|
+
// 场景
|
|
77421
|
+
scene = new Scene();
|
|
77422
|
+
group = new Group();
|
|
77423
|
+
group.name = 'pipe';
|
|
77424
|
+
scene.add(group);
|
|
77425
|
+
|
|
77426
|
+
// 管道
|
|
77427
|
+
let geometry = getPipeGeometry(modelAsMercatorCoordinate, opt);
|
|
77428
|
+
const bottomMat = new MeshBasicMaterial({
|
|
77429
|
+
color: opt.color || 0x7597dc,
|
|
77430
|
+
side: DoubleSide,
|
|
77431
|
+
transparent: true,
|
|
77432
|
+
opacity: 0.5
|
|
77433
|
+
});
|
|
77434
|
+
pipeMesh = new Mesh(geometry, bottomMat);
|
|
77435
|
+
scene.position.y = opt.hight;
|
|
77436
|
+
group.add(pipeMesh);
|
|
77437
|
+
group.rotation.x = -Math.PI / 2;
|
|
77438
|
+
|
|
77439
|
+
// 渲染器
|
|
77440
|
+
renderer = new WebGLRenderer({
|
|
77441
|
+
canvas: map.getCanvas(),
|
|
77442
|
+
context: gl,
|
|
77443
|
+
logarithmicDepthBuffer: true,
|
|
77444
|
+
antialias: true
|
|
77445
|
+
});
|
|
77446
|
+
renderer.autoClear = false;
|
|
77447
|
+
renderer.physicallyCorrectLights = true;
|
|
77448
|
+
// renderer.outputEncoding = THREE.sRGBEncoding
|
|
77449
|
+
renderer.setSize(container.clientWidth, container.clientHeight);
|
|
77450
|
+
|
|
77451
|
+
// 调试工具
|
|
77452
|
+
const gui = opt.edit ? new GUI$1() : null;
|
|
77453
|
+
if (gui) {
|
|
77454
|
+
gui.add(group.position, 'y').step(0.1).name('高度(米)');
|
|
77455
|
+
gui.add(group.rotation, 'x').step(0.1).name('旋转x');
|
|
77456
|
+
gui.add(group.rotation, 'y').step(0.1).name('旋转y');
|
|
77457
|
+
gui.add(group.rotation, 'z').step(0.1).name('旋转z');
|
|
77458
|
+
}
|
|
77459
|
+
},
|
|
77460
|
+
render: (gl, matrix) => {
|
|
77461
|
+
const rotationX = new three_module_Matrix4().makeRotationAxis(new three_module_Vector3(1, 0, 0), modelTransform.rotateX);
|
|
77462
|
+
const rotationY = new three_module_Matrix4().makeRotationAxis(new three_module_Vector3(0, 1, 0), modelTransform.rotateY);
|
|
77463
|
+
const rotationZ = new three_module_Matrix4().makeRotationAxis(new three_module_Vector3(0, 0, 1), modelTransform.rotateZ);
|
|
77464
|
+
const m = new three_module_Matrix4().fromArray(matrix);
|
|
77465
|
+
const l = new three_module_Matrix4().makeTranslation(modelTransform.translateX, modelTransform.translateY, modelTransform.translateZ).scale(new three_module_Vector3(modelTransform.scale, -modelTransform.scale, modelTransform.scale)).multiply(rotationX).multiply(rotationY).multiply(rotationZ);
|
|
77466
|
+
camera.projectionMatrix.elements = matrix;
|
|
77467
|
+
camera.projectionMatrix = m.multiply(l);
|
|
77468
|
+
renderer.resetState();
|
|
77469
|
+
renderer.render(scene, camera);
|
|
77470
|
+
map.triggerRepaint();
|
|
77471
|
+
}
|
|
77472
|
+
};
|
|
77473
|
+
return customLayer;
|
|
77474
|
+
|
|
77475
|
+
//获取管道
|
|
77476
|
+
function getPipeGeometry(center, opt) {
|
|
77477
|
+
if (opt.data) {
|
|
77478
|
+
let points = [];
|
|
77479
|
+
opt.data.features.forEach(geo => {
|
|
77480
|
+
geo.geometry.coordinates.forEach(item => {
|
|
77481
|
+
let mercatorCoordinate = mapbox_gl_default().MercatorCoordinate.fromLngLat(item, 0);
|
|
77482
|
+
let units = mercatorCoordinate.meterInMercatorCoordinateUnits();
|
|
77483
|
+
points.push(new three_module_Vector2((mercatorCoordinate.x - center.x) / units, -1 * (mercatorCoordinate.y - center.y) / units));
|
|
77484
|
+
});
|
|
77485
|
+
});
|
|
77486
|
+
let mesh = '';
|
|
77487
|
+
if (points.length > 1) {
|
|
77488
|
+
// const shape = new THREE.Shape(points)
|
|
77489
|
+
points = points.map(vector => {
|
|
77490
|
+
return new three_module_Vector3(vector.x, vector.y, 0);
|
|
77491
|
+
});
|
|
77492
|
+
mesh = transition3d(points); // 创建管道
|
|
77493
|
+
}
|
|
77494
|
+
|
|
77495
|
+
return mesh;
|
|
77496
|
+
} else {
|
|
77497
|
+
const curve = new CatmullRomCurve3([new three_module_Vector3(-10, 0, 0), new three_module_Vector3(0, 10, 0), new three_module_Vector3(10, 0, 0)]);
|
|
77498
|
+
return new TubeGeometry(curve, 4, 2, 8, false);
|
|
77499
|
+
}
|
|
77500
|
+
}
|
|
77501
|
+
|
|
77502
|
+
// 将shape转换为ExtrudeGeometry
|
|
77503
|
+
function transition3d(points) {
|
|
77504
|
+
// console.log(points, 'points')
|
|
77505
|
+
// 创建一条曲线
|
|
77506
|
+
const curve = new CatmullRomCurve3(points, false, 'catmullrom', 0.5);
|
|
77507
|
+
|
|
77508
|
+
// 创建管道
|
|
77509
|
+
const geometry = new TubeGeometry(curve, 4, 1, 8, false);
|
|
77510
|
+
return geometry;
|
|
77511
|
+
}
|
|
77512
|
+
}
|
|
77513
|
+
});
|
|
77514
|
+
};
|
|
77332
77515
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
77333
77516
|
var defineProperty = __webpack_require__(1080);
|
|
77334
77517
|
;// CONCATENATED MODULE: ./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js
|
|
@@ -119060,8 +119243,8 @@ var mapStyle_component = normalizeComponent(
|
|
|
119060
119243
|
)
|
|
119061
119244
|
|
|
119062
119245
|
/* harmony default export */ var mapStyle = (mapStyle_component.exports);
|
|
119063
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/index.vue?vue&type=template&id=
|
|
119064
|
-
var
|
|
119246
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/index.vue?vue&type=template&id=4ba1db1c&scoped=true&
|
|
119247
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_render = function render() {
|
|
119065
119248
|
var _vm = this,
|
|
119066
119249
|
_c = _vm._self._c;
|
|
119067
119250
|
return _c('div', [_c('div', {
|
|
@@ -119192,7 +119375,7 @@ var drawvue_type_template_id_551ff8b1_scoped_true_render = function render() {
|
|
|
119192
119375
|
staticClass: "right-fixed"
|
|
119193
119376
|
}, [_vm._t("right-fixed")], 2)]);
|
|
119194
119377
|
};
|
|
119195
|
-
var
|
|
119378
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns = [];
|
|
119196
119379
|
|
|
119197
119380
|
// EXTERNAL MODULE: ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js
|
|
119198
119381
|
var mapbox_gl_draw = __webpack_require__(1512);
|
|
@@ -119240,7 +119423,7 @@ var jsonFilevue_type_template_id_57aca7b6_scoped_true_staticRenderFns = [];
|
|
|
119240
119423
|
if (json) {
|
|
119241
119424
|
json = JSON.parse(json);
|
|
119242
119425
|
if (!json.features) {
|
|
119243
|
-
json = arcGisToGeoJson(json);
|
|
119426
|
+
json = (0,mapTools_namespaceObject.arcGisToGeoJson)(json);
|
|
119244
119427
|
}
|
|
119245
119428
|
const bbox = es(json);
|
|
119246
119429
|
if (bbox.length > 0 && bbox[0] > 180) {
|
|
@@ -119281,8 +119464,8 @@ var jsonFile_component = normalizeComponent(
|
|
|
119281
119464
|
)
|
|
119282
119465
|
|
|
119283
119466
|
/* harmony default export */ var jsonFile = (jsonFile_component.exports);
|
|
119284
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/shpFile.vue?vue&type=template&id=
|
|
119285
|
-
var
|
|
119467
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/shpFile.vue?vue&type=template&id=3b26555c&scoped=true&
|
|
119468
|
+
var shpFilevue_type_template_id_3b26555c_scoped_true_render = function render() {
|
|
119286
119469
|
var _vm = this,
|
|
119287
119470
|
_c = _vm._self._c;
|
|
119288
119471
|
return _c('el-button', {
|
|
@@ -119302,7 +119485,7 @@ var shpFilevue_type_template_id_3bd5e448_scoped_true_render = function render()
|
|
|
119302
119485
|
}
|
|
119303
119486
|
})]);
|
|
119304
119487
|
};
|
|
119305
|
-
var
|
|
119488
|
+
var shpFilevue_type_template_id_3b26555c_scoped_true_staticRenderFns = [];
|
|
119306
119489
|
|
|
119307
119490
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/shpFile.vue?vue&type=script&lang=js&
|
|
119308
119491
|
|
|
@@ -119325,7 +119508,7 @@ const shapeFile = __webpack_require__(4952); // 导入shpfile.js
|
|
|
119325
119508
|
shapeFile.read(result).then(json => {
|
|
119326
119509
|
const bbox = es(json);
|
|
119327
119510
|
if (!json.features) {
|
|
119328
|
-
json =
|
|
119511
|
+
json = geometryCollectionToFeatureCollection(json);
|
|
119329
119512
|
}
|
|
119330
119513
|
if (bbox.length > 0 && bbox[0] > 180) {
|
|
119331
119514
|
// 墨卡托坐标需要转换
|
|
@@ -119343,9 +119526,9 @@ const shapeFile = __webpack_require__(4952); // 导入shpfile.js
|
|
|
119343
119526
|
});
|
|
119344
119527
|
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue?vue&type=script&lang=js&
|
|
119345
119528
|
/* harmony default export */ var draw_shpFilevue_type_script_lang_js_ = (shpFilevue_type_script_lang_js_);
|
|
119346
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/shpFile.vue?vue&type=style&index=0&id=
|
|
119347
|
-
var
|
|
119348
|
-
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue?vue&type=style&index=0&id=
|
|
119529
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/shpFile.vue?vue&type=style&index=0&id=3b26555c&prod&lang=scss&scoped=true&
|
|
119530
|
+
var shpFilevue_type_style_index_0_id_3b26555c_prod_lang_scss_scoped_true_ = __webpack_require__(3740);
|
|
119531
|
+
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue?vue&type=style&index=0&id=3b26555c&prod&lang=scss&scoped=true&
|
|
119349
119532
|
|
|
119350
119533
|
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue
|
|
119351
119534
|
|
|
@@ -119358,11 +119541,11 @@ var shpFilevue_type_style_index_0_id_3bd5e448_prod_lang_scss_scoped_true_ = __we
|
|
|
119358
119541
|
|
|
119359
119542
|
var shpFile_component = normalizeComponent(
|
|
119360
119543
|
draw_shpFilevue_type_script_lang_js_,
|
|
119361
|
-
|
|
119362
|
-
|
|
119544
|
+
shpFilevue_type_template_id_3b26555c_scoped_true_render,
|
|
119545
|
+
shpFilevue_type_template_id_3b26555c_scoped_true_staticRenderFns,
|
|
119363
119546
|
false,
|
|
119364
119547
|
null,
|
|
119365
|
-
"
|
|
119548
|
+
"3b26555c",
|
|
119366
119549
|
null
|
|
119367
119550
|
|
|
119368
119551
|
)
|
|
@@ -119378,6 +119561,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119378
119561
|
|
|
119379
119562
|
|
|
119380
119563
|
|
|
119564
|
+
|
|
119381
119565
|
/* harmony default export */ var drawvue_type_script_lang_js_ = ({
|
|
119382
119566
|
components: {
|
|
119383
119567
|
mapFullScreen: mapFullScreen,
|
|
@@ -119447,7 +119631,8 @@ var shpFile_component = normalizeComponent(
|
|
|
119447
119631
|
activeFeatures: '',
|
|
119448
119632
|
lng: '',
|
|
119449
119633
|
lat: '',
|
|
119450
|
-
geoJson: ''
|
|
119634
|
+
geoJson: '',
|
|
119635
|
+
selectPoint: []
|
|
119451
119636
|
};
|
|
119452
119637
|
},
|
|
119453
119638
|
computed: {
|
|
@@ -119475,6 +119660,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119475
119660
|
return filter;
|
|
119476
119661
|
}
|
|
119477
119662
|
},
|
|
119663
|
+
mounted() {},
|
|
119478
119664
|
methods: {
|
|
119479
119665
|
initDraw(map) {
|
|
119480
119666
|
this.map = map;
|
|
@@ -119492,6 +119678,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119492
119678
|
|
|
119493
119679
|
map.on('draw.create', this.drawEnd);
|
|
119494
119680
|
map.on('draw.update', this.drawUpdate);
|
|
119681
|
+
// map.on('draw.delete', this.delete)
|
|
119495
119682
|
map.on('draw.selectionchange', this.select);
|
|
119496
119683
|
// this.getCenter()
|
|
119497
119684
|
|
|
@@ -119506,8 +119693,47 @@ var shpFile_component = normalizeComponent(
|
|
|
119506
119693
|
// }
|
|
119507
119694
|
// }
|
|
119508
119695
|
// })
|
|
119509
|
-
},
|
|
119510
119696
|
|
|
119697
|
+
// 删除选中锚点
|
|
119698
|
+
document.onkeydown = e => {
|
|
119699
|
+
if (this.selectPoint.length === 0 || this.activeFeatures.length === 0) return;
|
|
119700
|
+
const type = this.activeFeatures[0].geometry.type;
|
|
119701
|
+
if (type != 'LineString') return;
|
|
119702
|
+
const keyCode = e.keyCode || e.which || e.charCode;
|
|
119703
|
+
if (keyCode == 46) {
|
|
119704
|
+
// 按下delete键
|
|
119705
|
+
// console.log('删除锚点', this.selectPoint)
|
|
119706
|
+
this.selectPoint.forEach(point => {
|
|
119707
|
+
// if (type === 'Polygon') {
|
|
119708
|
+
// this.activeFeatures[0].geometry.coordinates.forEach((list, eq) => {
|
|
119709
|
+
// list.forEach((item, index) => {
|
|
119710
|
+
// if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119711
|
+
// this.activeFeatures[0].geometry.coordinates[eq].splice(index, 1)
|
|
119712
|
+
// console.log(this.activeFeatures, '删除成功')
|
|
119713
|
+
// }
|
|
119714
|
+
// })
|
|
119715
|
+
// })
|
|
119716
|
+
// }
|
|
119717
|
+
if (type === 'LineString') {
|
|
119718
|
+
this.activeFeatures[0].geometry.coordinates.forEach((item, index) => {
|
|
119719
|
+
if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119720
|
+
this.activeFeatures[0].geometry.coordinates.splice(index, 1);
|
|
119721
|
+
console.log(this.activeFeatures, '删除锚点成功');
|
|
119722
|
+
}
|
|
119723
|
+
});
|
|
119724
|
+
}
|
|
119725
|
+
});
|
|
119726
|
+
const geometry = this.activeFeatures[0].geometry;
|
|
119727
|
+
// console.log(geometry, 'geometry')
|
|
119728
|
+
this.draw.delete(this.activeFeatures[0].id);
|
|
119729
|
+
if (geometry.coordinates.length > 1) {
|
|
119730
|
+
this.draw.add(geometry);
|
|
119731
|
+
}
|
|
119732
|
+
this.drawUpdate();
|
|
119733
|
+
this.selectPoint = [];
|
|
119734
|
+
}
|
|
119735
|
+
};
|
|
119736
|
+
},
|
|
119511
119737
|
getDraw() {
|
|
119512
119738
|
// 获取绘制内容
|
|
119513
119739
|
const data = this.draw.getAll();
|
|
@@ -119555,8 +119781,12 @@ var shpFile_component = normalizeComponent(
|
|
|
119555
119781
|
this.activeFeatures.forEach(item => {
|
|
119556
119782
|
this.draw.delete(item.id);
|
|
119557
119783
|
const data = this.getDraw();
|
|
119558
|
-
|
|
119559
|
-
|
|
119784
|
+
if (data.features && data.features.length > 0) {
|
|
119785
|
+
this.$emit('delete', data);
|
|
119786
|
+
} else {
|
|
119787
|
+
this.$emit('delete', '');
|
|
119788
|
+
}
|
|
119789
|
+
console.log('删除选中对象', this.activeFeatures[0]);
|
|
119560
119790
|
this.activeFeatures = [];
|
|
119561
119791
|
});
|
|
119562
119792
|
} else {
|
|
@@ -119573,6 +119803,10 @@ var shpFile_component = normalizeComponent(
|
|
|
119573
119803
|
}
|
|
119574
119804
|
},
|
|
119575
119805
|
select(e) {
|
|
119806
|
+
if (e.points && e.points.length > 0) {
|
|
119807
|
+
console.log('选中锚点', e.points);
|
|
119808
|
+
this.selectPoint = e.points;
|
|
119809
|
+
}
|
|
119576
119810
|
this.activeFeatures = e.features;
|
|
119577
119811
|
console.log('选中对象', this.activeFeatures);
|
|
119578
119812
|
this.$emit('select', e.features);
|
|
@@ -119631,9 +119865,9 @@ var shpFile_component = normalizeComponent(
|
|
|
119631
119865
|
});
|
|
119632
119866
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=script&lang=js&
|
|
119633
119867
|
/* harmony default export */ var package_drawvue_type_script_lang_js_ = (drawvue_type_script_lang_js_);
|
|
119634
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/index.vue?vue&type=style&index=0&id=
|
|
119635
|
-
var
|
|
119636
|
-
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=
|
|
119868
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/package/draw/index.vue?vue&type=style&index=0&id=4ba1db1c&prod&lang=scss&scoped=true&
|
|
119869
|
+
var drawvue_type_style_index_0_id_4ba1db1c_prod_lang_scss_scoped_true_ = __webpack_require__(9521);
|
|
119870
|
+
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=4ba1db1c&prod&lang=scss&scoped=true&
|
|
119637
119871
|
|
|
119638
119872
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue
|
|
119639
119873
|
|
|
@@ -119646,11 +119880,11 @@ var drawvue_type_style_index_0_id_551ff8b1_prod_lang_scss_scoped_true_ = __webpa
|
|
|
119646
119880
|
|
|
119647
119881
|
var draw_component = normalizeComponent(
|
|
119648
119882
|
package_drawvue_type_script_lang_js_,
|
|
119649
|
-
|
|
119650
|
-
|
|
119883
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_render,
|
|
119884
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns,
|
|
119651
119885
|
false,
|
|
119652
119886
|
null,
|
|
119653
|
-
"
|
|
119887
|
+
"4ba1db1c",
|
|
119654
119888
|
null
|
|
119655
119889
|
|
|
119656
119890
|
)
|
|
@@ -120296,6 +120530,7 @@ var polygon_component = normalizeComponent(
|
|
|
120296
120530
|
|
|
120297
120531
|
|
|
120298
120532
|
|
|
120533
|
+
|
|
120299
120534
|
// 图层操作
|
|
120300
120535
|
const mapLayers = {
|
|
120301
120536
|
showLayerText: showLayerText,
|
|
@@ -120324,6 +120559,7 @@ const mapDraw = {
|
|
|
120324
120559
|
addLayerCircle: addLayerCircle,
|
|
120325
120560
|
addCircleAnimate: addCircleAnimate,
|
|
120326
120561
|
addLayerModel: addLayerModel,
|
|
120562
|
+
addLayerPipe: addLayerPipe,
|
|
120327
120563
|
addLayerWater: addLayerWater,
|
|
120328
120564
|
load3DTiles: load3DTiles
|
|
120329
120565
|
};
|
|
@@ -120341,7 +120577,8 @@ const mapTools = {
|
|
|
120341
120577
|
polygonCenter: polygonCenter,
|
|
120342
120578
|
GeoAddress: GeoAddress,
|
|
120343
120579
|
Geolocation: Geolocation,
|
|
120344
|
-
getElevation: getElevation
|
|
120580
|
+
getElevation: getElevation,
|
|
120581
|
+
geometryCollectionToFeatureCollection: geometryCollectionToFeatureCollection
|
|
120345
120582
|
};
|
|
120346
120583
|
|
|
120347
120584
|
// 地图事件
|