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.common.js
CHANGED
|
@@ -245,7 +245,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".snow[data-v-20664206]{position:absolu
|
|
|
245
245
|
|
|
246
246
|
/***/ }),
|
|
247
247
|
|
|
248
|
-
/***/
|
|
248
|
+
/***/ 1816:
|
|
249
249
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
250
250
|
|
|
251
251
|
"use strict";
|
|
@@ -259,7 +259,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
259
259
|
|
|
260
260
|
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()));
|
|
261
261
|
// Module
|
|
262
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".tools[data-v-
|
|
262
|
+
___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}", ""]);
|
|
263
263
|
// Exports
|
|
264
264
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
265
265
|
|
|
@@ -287,7 +287,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".upload[data-v-57aca7b6]{position:rela
|
|
|
287
287
|
|
|
288
288
|
/***/ }),
|
|
289
289
|
|
|
290
|
-
/***/
|
|
290
|
+
/***/ 5406:
|
|
291
291
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
292
292
|
|
|
293
293
|
"use strict";
|
|
@@ -301,7 +301,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
301
301
|
|
|
302
302
|
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()));
|
|
303
303
|
// Module
|
|
304
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".upload[data-v-
|
|
304
|
+
___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}", ""]);
|
|
305
305
|
// Exports
|
|
306
306
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
307
307
|
|
|
@@ -42928,19 +42928,19 @@ var update = add("4a7b31d4", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
42928
42928
|
|
|
42929
42929
|
/***/ }),
|
|
42930
42930
|
|
|
42931
|
-
/***/
|
|
42931
|
+
/***/ 3531:
|
|
42932
42932
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
42933
42933
|
|
|
42934
42934
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
42935
42935
|
|
|
42936
42936
|
// load the styles
|
|
42937
|
-
var content = __webpack_require__(
|
|
42937
|
+
var content = __webpack_require__(1816);
|
|
42938
42938
|
if(content.__esModule) content = content.default;
|
|
42939
42939
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
42940
42940
|
if(content.locals) module.exports = content.locals;
|
|
42941
42941
|
// add the styles to the DOM
|
|
42942
42942
|
var add = (__webpack_require__(7037)/* ["default"] */ .Z)
|
|
42943
|
-
var update = add("
|
|
42943
|
+
var update = add("1175a95a", content, true, {"sourceMap":false,"shadowMode":false});
|
|
42944
42944
|
|
|
42945
42945
|
/***/ }),
|
|
42946
42946
|
|
|
@@ -42960,19 +42960,19 @@ var update = add("f559c59c", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
42960
42960
|
|
|
42961
42961
|
/***/ }),
|
|
42962
42962
|
|
|
42963
|
-
/***/
|
|
42963
|
+
/***/ 4112:
|
|
42964
42964
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
42965
42965
|
|
|
42966
42966
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
42967
42967
|
|
|
42968
42968
|
// load the styles
|
|
42969
|
-
var content = __webpack_require__(
|
|
42969
|
+
var content = __webpack_require__(5406);
|
|
42970
42970
|
if(content.__esModule) content = content.default;
|
|
42971
42971
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
42972
42972
|
if(content.locals) module.exports = content.locals;
|
|
42973
42973
|
// add the styles to the DOM
|
|
42974
42974
|
var add = (__webpack_require__(7037)/* ["default"] */ .Z)
|
|
42975
|
-
var update = add("
|
|
42975
|
+
var update = add("81936f9e", content, true, {"sourceMap":false,"shadowMode":false});
|
|
42976
42976
|
|
|
42977
42977
|
/***/ }),
|
|
42978
42978
|
|
|
@@ -43697,6 +43697,24 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43697
43697
|
"shpFile": function() { return /* reexport */ shpFile; }
|
|
43698
43698
|
});
|
|
43699
43699
|
|
|
43700
|
+
// NAMESPACE OBJECT: ./src/package/util/mapTools.js
|
|
43701
|
+
var mapTools_namespaceObject = {};
|
|
43702
|
+
__webpack_require__.r(mapTools_namespaceObject);
|
|
43703
|
+
__webpack_require__.d(mapTools_namespaceObject, {
|
|
43704
|
+
"YK": function() { return clearDraw; },
|
|
43705
|
+
"TE": function() { return mapTools_distance; },
|
|
43706
|
+
"N5": function() { return drawArea; },
|
|
43707
|
+
"tL": function() { return geometryCollectionToFeatureCollection; },
|
|
43708
|
+
"yQ": function() { return getElevation; },
|
|
43709
|
+
"yJ": function() { return lineCenter; },
|
|
43710
|
+
"po": function() { return loadImage; },
|
|
43711
|
+
"bZ": function() { return pointToGeoJson; },
|
|
43712
|
+
"j_": function() { return polygonCenter; },
|
|
43713
|
+
"Do": function() { return ranging; },
|
|
43714
|
+
"b4": function() { return spArray; },
|
|
43715
|
+
"rg": function() { return toGeoJson; }
|
|
43716
|
+
});
|
|
43717
|
+
|
|
43700
43718
|
// NAMESPACE OBJECT: ./node_modules/@loaders.gl/gltf/dist/esm/lib/extensions/EXT_meshopt_compression.js
|
|
43701
43719
|
var EXT_meshopt_compression_namespaceObject = {};
|
|
43702
43720
|
__webpack_require__.r(EXT_meshopt_compression_namespaceObject);
|
|
@@ -43829,7 +43847,130 @@ var style_map = __webpack_require__(7193);
|
|
|
43829
43847
|
// EXTERNAL MODULE: ./node_modules/html2canvas/dist/html2canvas.js
|
|
43830
43848
|
var html2canvas = __webpack_require__(2269);
|
|
43831
43849
|
var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
43850
|
+
;// CONCATENATED MODULE: ./src/package/layers/index.js
|
|
43851
|
+
// import mapBoxGl from 'mapbox-gl'
|
|
43852
|
+
|
|
43853
|
+
|
|
43854
|
+
// 更新数据
|
|
43855
|
+
const setSource = (id, data) => {
|
|
43856
|
+
let {
|
|
43857
|
+
map
|
|
43858
|
+
} = package_map;
|
|
43859
|
+
let hasSource = map.getSource(id);
|
|
43860
|
+
if (hasSource) {
|
|
43861
|
+
map.getSource(id).setData(data);
|
|
43862
|
+
}
|
|
43863
|
+
};
|
|
43864
|
+
// 判断图层是否存在
|
|
43865
|
+
const hasLayer = id => {
|
|
43866
|
+
let {
|
|
43867
|
+
map
|
|
43868
|
+
} = package_map;
|
|
43869
|
+
return map.getLayer(id);
|
|
43870
|
+
};
|
|
43871
|
+
|
|
43872
|
+
// 判断数据是否存在
|
|
43873
|
+
const hasSource = id => {
|
|
43874
|
+
let {
|
|
43875
|
+
map
|
|
43876
|
+
} = package_map;
|
|
43877
|
+
return map.getSource(id);
|
|
43878
|
+
};
|
|
43879
|
+
|
|
43880
|
+
// 删除图层
|
|
43881
|
+
const removeLayer = id => {
|
|
43882
|
+
let {
|
|
43883
|
+
map
|
|
43884
|
+
} = package_map;
|
|
43885
|
+
map.removeLayer(id);
|
|
43886
|
+
let arr = getLayerAll();
|
|
43887
|
+
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
43888
|
+
layers.forEach(item => {
|
|
43889
|
+
if (hasLayer(item.id)) {
|
|
43890
|
+
map.removeLayer(item.id);
|
|
43891
|
+
}
|
|
43892
|
+
});
|
|
43893
|
+
};
|
|
43894
|
+
|
|
43895
|
+
/**
|
|
43896
|
+
* 获取所有图层
|
|
43897
|
+
*/
|
|
43898
|
+
const getLayerAll = () => {
|
|
43899
|
+
let {
|
|
43900
|
+
map
|
|
43901
|
+
} = package_map;
|
|
43902
|
+
let data = map.getStyle().layers;
|
|
43903
|
+
// console.log(data)
|
|
43904
|
+
return data;
|
|
43905
|
+
};
|
|
43906
|
+
|
|
43907
|
+
// 显示隐藏图层
|
|
43908
|
+
const showLayer = (id, show = false) => {
|
|
43909
|
+
let {
|
|
43910
|
+
map
|
|
43911
|
+
} = package_map;
|
|
43912
|
+
show = show ? 'visible' : 'none';
|
|
43913
|
+
map.setLayoutProperty(id, 'visibility', show);
|
|
43914
|
+
let arr = getLayerAll();
|
|
43915
|
+
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
43916
|
+
layers.forEach(item => {
|
|
43917
|
+
if (hasLayer(item.id)) {
|
|
43918
|
+
map.setLayoutProperty(item.id, 'visibility', show);
|
|
43919
|
+
}
|
|
43920
|
+
});
|
|
43921
|
+
};
|
|
43922
|
+
|
|
43923
|
+
// 显隐文字
|
|
43924
|
+
const showLayerText = (show, id = '') => {
|
|
43925
|
+
let {
|
|
43926
|
+
map
|
|
43927
|
+
} = package_map;
|
|
43928
|
+
if (id) {
|
|
43929
|
+
setPaint(id, 'text-opacity', show ? 1 : 0);
|
|
43930
|
+
} else {
|
|
43931
|
+
let textLayer = map.getStyle().layers;
|
|
43932
|
+
textLayer.forEach(layer => {
|
|
43933
|
+
if (layer.type === 'symbol') {
|
|
43934
|
+
setPaint(layer.id, 'text-opacity', show ? 1 : 0);
|
|
43935
|
+
}
|
|
43936
|
+
});
|
|
43937
|
+
}
|
|
43938
|
+
};
|
|
43939
|
+
|
|
43940
|
+
// 修改Layout
|
|
43941
|
+
const setLayout = (id, key, value) => {
|
|
43942
|
+
let {
|
|
43943
|
+
map
|
|
43944
|
+
} = package_map;
|
|
43945
|
+
map.setLayoutProperty(id, key, value);
|
|
43946
|
+
};
|
|
43947
|
+
|
|
43948
|
+
// 修改Paint
|
|
43949
|
+
const setPaint = (id, key, value) => {
|
|
43950
|
+
let {
|
|
43951
|
+
map
|
|
43952
|
+
} = package_map;
|
|
43953
|
+
map.setPaintProperty(id, key, value);
|
|
43954
|
+
};
|
|
43955
|
+
|
|
43956
|
+
// 修改Filter
|
|
43957
|
+
const setFilter = (key, filter) => {
|
|
43958
|
+
let {
|
|
43959
|
+
map
|
|
43960
|
+
} = package_map;
|
|
43961
|
+
map.setFilter(key, filter);
|
|
43962
|
+
};
|
|
43963
|
+
|
|
43964
|
+
// 设置高亮
|
|
43965
|
+
const setHigh = (id, filter) => {
|
|
43966
|
+
let {
|
|
43967
|
+
map
|
|
43968
|
+
} = package_map;
|
|
43969
|
+
map.setFilter(id + '-high', filter);
|
|
43970
|
+
};
|
|
43832
43971
|
;// CONCATENATED MODULE: ./src/package/map.js
|
|
43972
|
+
// 天地图token
|
|
43973
|
+
const tdtToken = (/* unused pure expression or super */ null && (['150bad890e9d004885a4b2a94062a46e', '337996a733e1ea41cd73124f67f4795d', '48282c15cce091a1154a674512372eec', 'f3c2ca3a170f5712abd7b6858e038f18']));
|
|
43833
43974
|
var defaultOptions = {
|
|
43834
43975
|
container: 'map',
|
|
43835
43976
|
zoom: 12,
|
|
@@ -43874,7 +44015,7 @@ var defaultOptions = {
|
|
|
43874
44015
|
// 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', // ArcGIS
|
|
43875
44016
|
// 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', // 高德
|
|
43876
44017
|
// 'https://map.ynmdgq.com/{z}/{x}/{y}.png' // 本地
|
|
43877
|
-
// '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=
|
|
44018
|
+
// '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)], // 天地图
|
|
43878
44019
|
],
|
|
43879
44020
|
|
|
43880
44021
|
'tileSize': 512
|
|
@@ -43906,6 +44047,7 @@ var defaultOptions = {
|
|
|
43906
44047
|
|
|
43907
44048
|
|
|
43908
44049
|
|
|
44050
|
+
|
|
43909
44051
|
// import { Message } from 'element-ui'
|
|
43910
44052
|
|
|
43911
44053
|
var popup = null;
|
|
@@ -44047,6 +44189,7 @@ class mapSdk {
|
|
|
44047
44189
|
'star-intensity': 0.1
|
|
44048
44190
|
});
|
|
44049
44191
|
} else {
|
|
44192
|
+
if (hasLayer('sky')) return;
|
|
44050
44193
|
// 天空
|
|
44051
44194
|
map.addLayer({
|
|
44052
44195
|
'id': 'sky',
|
|
@@ -44356,127 +44499,6 @@ class mapSdk {
|
|
|
44356
44499
|
}
|
|
44357
44500
|
}
|
|
44358
44501
|
/* harmony default export */ var package_map = (new mapSdk());
|
|
44359
|
-
;// CONCATENATED MODULE: ./src/package/layers/index.js
|
|
44360
|
-
// import mapBoxGl from 'mapbox-gl'
|
|
44361
|
-
|
|
44362
|
-
|
|
44363
|
-
// 更新数据
|
|
44364
|
-
const setSource = (id, data) => {
|
|
44365
|
-
let {
|
|
44366
|
-
map
|
|
44367
|
-
} = package_map;
|
|
44368
|
-
let hasSource = map.getSource(id);
|
|
44369
|
-
if (hasSource) {
|
|
44370
|
-
map.getSource(id).setData(data);
|
|
44371
|
-
}
|
|
44372
|
-
};
|
|
44373
|
-
// 判断图层是否存在
|
|
44374
|
-
const hasLayer = id => {
|
|
44375
|
-
let {
|
|
44376
|
-
map
|
|
44377
|
-
} = package_map;
|
|
44378
|
-
return map.getLayer(id);
|
|
44379
|
-
};
|
|
44380
|
-
|
|
44381
|
-
// 判断数据是否存在
|
|
44382
|
-
const hasSource = id => {
|
|
44383
|
-
let {
|
|
44384
|
-
map
|
|
44385
|
-
} = package_map;
|
|
44386
|
-
return map.getSource(id);
|
|
44387
|
-
};
|
|
44388
|
-
|
|
44389
|
-
// 删除图层
|
|
44390
|
-
const removeLayer = id => {
|
|
44391
|
-
let {
|
|
44392
|
-
map
|
|
44393
|
-
} = package_map;
|
|
44394
|
-
map.removeLayer(id);
|
|
44395
|
-
let arr = getLayerAll();
|
|
44396
|
-
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
44397
|
-
layers.forEach(item => {
|
|
44398
|
-
if (hasLayer(item.id)) {
|
|
44399
|
-
map.removeLayer(item.id);
|
|
44400
|
-
}
|
|
44401
|
-
});
|
|
44402
|
-
};
|
|
44403
|
-
|
|
44404
|
-
/**
|
|
44405
|
-
* 获取所有图层
|
|
44406
|
-
*/
|
|
44407
|
-
const getLayerAll = () => {
|
|
44408
|
-
let {
|
|
44409
|
-
map
|
|
44410
|
-
} = package_map;
|
|
44411
|
-
let data = map.getStyle().layers;
|
|
44412
|
-
// console.log(data)
|
|
44413
|
-
return data;
|
|
44414
|
-
};
|
|
44415
|
-
|
|
44416
|
-
// 显示隐藏图层
|
|
44417
|
-
const showLayer = (id, show = false) => {
|
|
44418
|
-
let {
|
|
44419
|
-
map
|
|
44420
|
-
} = package_map;
|
|
44421
|
-
show = show ? 'visible' : 'none';
|
|
44422
|
-
map.setLayoutProperty(id, 'visibility', show);
|
|
44423
|
-
let arr = getLayerAll();
|
|
44424
|
-
let layers = arr.filter(item => item.id.includes(id + '-'));
|
|
44425
|
-
layers.forEach(item => {
|
|
44426
|
-
if (hasLayer(item.id)) {
|
|
44427
|
-
map.setLayoutProperty(item.id, 'visibility', show);
|
|
44428
|
-
}
|
|
44429
|
-
});
|
|
44430
|
-
};
|
|
44431
|
-
|
|
44432
|
-
// 显隐文字
|
|
44433
|
-
const showLayerText = (show, id = '') => {
|
|
44434
|
-
let {
|
|
44435
|
-
map
|
|
44436
|
-
} = package_map;
|
|
44437
|
-
if (id) {
|
|
44438
|
-
setPaint(id, 'text-opacity', show ? 1 : 0);
|
|
44439
|
-
} else {
|
|
44440
|
-
let textLayer = map.getStyle().layers;
|
|
44441
|
-
textLayer.forEach(layer => {
|
|
44442
|
-
if (layer.type === 'symbol') {
|
|
44443
|
-
setPaint(layer.id, 'text-opacity', show ? 1 : 0);
|
|
44444
|
-
}
|
|
44445
|
-
});
|
|
44446
|
-
}
|
|
44447
|
-
};
|
|
44448
|
-
|
|
44449
|
-
// 修改Layout
|
|
44450
|
-
const setLayout = (id, key, value) => {
|
|
44451
|
-
let {
|
|
44452
|
-
map
|
|
44453
|
-
} = package_map;
|
|
44454
|
-
map.setLayoutProperty(id, key, value);
|
|
44455
|
-
};
|
|
44456
|
-
|
|
44457
|
-
// 修改Paint
|
|
44458
|
-
const setPaint = (id, key, value) => {
|
|
44459
|
-
let {
|
|
44460
|
-
map
|
|
44461
|
-
} = package_map;
|
|
44462
|
-
map.setPaintProperty(id, key, value);
|
|
44463
|
-
};
|
|
44464
|
-
|
|
44465
|
-
// 修改Filter
|
|
44466
|
-
const setFilter = (key, filter) => {
|
|
44467
|
-
let {
|
|
44468
|
-
map
|
|
44469
|
-
} = package_map;
|
|
44470
|
-
map.setFilter(key, filter);
|
|
44471
|
-
};
|
|
44472
|
-
|
|
44473
|
-
// 设置高亮
|
|
44474
|
-
const setHigh = (id, filter) => {
|
|
44475
|
-
let {
|
|
44476
|
-
map
|
|
44477
|
-
} = package_map;
|
|
44478
|
-
map.setFilter(id + '-high', filter);
|
|
44479
|
-
};
|
|
44480
44502
|
;// CONCATENATED MODULE: ./src/package/layers/Text.js
|
|
44481
44503
|
|
|
44482
44504
|
|
|
@@ -66801,8 +66823,8 @@ const Line_defaultOptions = {
|
|
|
66801
66823
|
click: null
|
|
66802
66824
|
};
|
|
66803
66825
|
|
|
66804
|
-
/**
|
|
66805
|
-
* 添加线图层
|
|
66826
|
+
/**
|
|
66827
|
+
* 添加线图层
|
|
66806
66828
|
*/
|
|
66807
66829
|
const addLayerLine = (option, layerId) => {
|
|
66808
66830
|
let {
|
|
@@ -66871,9 +66893,9 @@ const addLayerLine = (option, layerId) => {
|
|
|
66871
66893
|
}
|
|
66872
66894
|
};
|
|
66873
66895
|
|
|
66874
|
-
/**
|
|
66875
|
-
* 添加动画线图层
|
|
66876
|
-
* addLayerLine配置图层
|
|
66896
|
+
/**
|
|
66897
|
+
* 添加动画线图层
|
|
66898
|
+
* addLayerLine配置图层
|
|
66877
66899
|
*/
|
|
66878
66900
|
const addLayerLineAnimation = (option, layerId) => {
|
|
66879
66901
|
let {
|
|
@@ -69764,9 +69786,9 @@ let after = null;
|
|
|
69764
69786
|
let textColor = '#fff';
|
|
69765
69787
|
let lineColor = '#f00';
|
|
69766
69788
|
|
|
69767
|
-
/**
|
|
69768
|
-
* 测距
|
|
69769
|
-
* @param mapObject
|
|
69789
|
+
/**
|
|
69790
|
+
* 测距
|
|
69791
|
+
* @param mapObject
|
|
69770
69792
|
*/
|
|
69771
69793
|
function measureLineLength(mapObject) {
|
|
69772
69794
|
const currentMapContainerId = mapObject._container.getAttribute('id');
|
|
@@ -69884,9 +69906,9 @@ function measureLineLength(mapObject) {
|
|
|
69884
69906
|
deleteTips.remove();
|
|
69885
69907
|
}
|
|
69886
69908
|
});
|
|
69887
|
-
/**
|
|
69888
|
-
* 点击测距点位触发
|
|
69889
|
-
* @param event
|
|
69909
|
+
/**
|
|
69910
|
+
* 点击测距点位触发
|
|
69911
|
+
* @param event
|
|
69890
69912
|
* */
|
|
69891
69913
|
// eslint-disable-next-line no-undef,no-inner-declarations
|
|
69892
69914
|
function clickMeasurePointsHandler(event) {
|
|
@@ -69970,8 +69992,8 @@ function measureLineLength(mapObject) {
|
|
|
69970
69992
|
resultData.map.on('dblclick', dblclickHandler);
|
|
69971
69993
|
}
|
|
69972
69994
|
|
|
69973
|
-
/**
|
|
69974
|
-
* 清除测距相关
|
|
69995
|
+
/**
|
|
69996
|
+
* 清除测距相关
|
|
69975
69997
|
*/
|
|
69976
69998
|
function clearMeasureLine(mapObject) {
|
|
69977
69999
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -69993,9 +70015,9 @@ function clearMeasureLine(mapObject) {
|
|
|
69993
70015
|
}
|
|
69994
70016
|
}
|
|
69995
70017
|
|
|
69996
|
-
/**
|
|
69997
|
-
* 创建label marker
|
|
69998
|
-
* @returns {*} 返回marker对象
|
|
70018
|
+
/**
|
|
70019
|
+
* 创建label marker
|
|
70020
|
+
* @returns {*} 返回marker对象
|
|
69999
70021
|
*/
|
|
70000
70022
|
function createMeasurLineLabelMarkerHandler(mapObject) {
|
|
70001
70023
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70018,11 +70040,11 @@ function createMeasurLineLabelMarkerHandler(mapObject) {
|
|
|
70018
70040
|
};
|
|
70019
70041
|
}
|
|
70020
70042
|
|
|
70021
|
-
/**
|
|
70022
|
-
* 创建测距需要的layers,points、line、measure-line-move
|
|
70023
|
-
* @param jsonPoint
|
|
70024
|
-
* @param jsonLine
|
|
70025
|
-
* @param mapObject
|
|
70043
|
+
/**
|
|
70044
|
+
* 创建测距需要的layers,points、line、measure-line-move
|
|
70045
|
+
* @param jsonPoint
|
|
70046
|
+
* @param jsonLine
|
|
70047
|
+
* @param mapObject
|
|
70026
70048
|
*/
|
|
70027
70049
|
function createMeasureLinePLLHandler(jsonPoint, jsonLine, mapObject) {
|
|
70028
70050
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70083,8 +70105,8 @@ function createMeasureLinePLLHandler(jsonPoint, jsonLine, mapObject) {
|
|
|
70083
70105
|
moveLayerHandler(resultData.map);
|
|
70084
70106
|
}
|
|
70085
70107
|
|
|
70086
|
-
/**
|
|
70087
|
-
* 将测距的三个图层移到最上层级
|
|
70108
|
+
/**
|
|
70109
|
+
* 将测距的三个图层移到最上层级
|
|
70088
70110
|
*/
|
|
70089
70111
|
function moveLayerHandler(mapObject) {
|
|
70090
70112
|
const {
|
|
@@ -70102,12 +70124,12 @@ function moveLayerHandler(mapObject) {
|
|
|
70102
70124
|
}
|
|
70103
70125
|
}
|
|
70104
70126
|
|
|
70105
|
-
/**
|
|
70106
|
-
* 添加点位layer
|
|
70107
|
-
* @param jsonPoint
|
|
70108
|
-
* @param jsonLine
|
|
70109
|
-
* @param coords
|
|
70110
|
-
* @param mapObject
|
|
70127
|
+
/**
|
|
70128
|
+
* 添加点位layer
|
|
70129
|
+
* @param jsonPoint
|
|
70130
|
+
* @param jsonLine
|
|
70131
|
+
* @param coords
|
|
70132
|
+
* @param mapObject
|
|
70111
70133
|
*/
|
|
70112
70134
|
function addMeasureLinePoint(jsonPoint, jsonLine, coords, mapObject) {
|
|
70113
70135
|
const {
|
|
@@ -70150,11 +70172,11 @@ function addMeasureLinePoint(jsonPoint, jsonLine, coords, mapObject) {
|
|
|
70150
70172
|
map.getSource('measure-line-points').setData(jsonPoint);
|
|
70151
70173
|
}
|
|
70152
70174
|
|
|
70153
|
-
/**
|
|
70154
|
-
* 获取两坐标点之间的距离
|
|
70155
|
-
* @param points
|
|
70156
|
-
* @param coords
|
|
70157
|
-
* @returns {string}
|
|
70175
|
+
/**
|
|
70176
|
+
* 获取两坐标点之间的距离
|
|
70177
|
+
* @param points
|
|
70178
|
+
* @param coords
|
|
70179
|
+
* @returns {string}
|
|
70158
70180
|
*/
|
|
70159
70181
|
function getMeasureLineLength(points, coords) {
|
|
70160
70182
|
const _points = points.concat([coords]);
|
|
@@ -70170,12 +70192,12 @@ function getMeasureLineLength(points, coords) {
|
|
|
70170
70192
|
return len;
|
|
70171
70193
|
}
|
|
70172
70194
|
|
|
70173
|
-
/**
|
|
70174
|
-
* 点击地图添加点位触发给当前点位绑定测距结果的labelMarker
|
|
70175
|
-
* @param points
|
|
70176
|
-
* @param jsonPoint
|
|
70177
|
-
* @param coords
|
|
70178
|
-
* @param mapObject
|
|
70195
|
+
/**
|
|
70196
|
+
* 点击地图添加点位触发给当前点位绑定测距结果的labelMarker
|
|
70197
|
+
* @param points
|
|
70198
|
+
* @param jsonPoint
|
|
70199
|
+
* @param coords
|
|
70200
|
+
* @param mapObject
|
|
70179
70201
|
* */
|
|
70180
70202
|
function addMeasureLineRes(points, jsonPoint, coords, mapObject) {
|
|
70181
70203
|
const {
|
|
@@ -70203,11 +70225,11 @@ function addMeasureLineRes(points, jsonPoint, coords, mapObject) {
|
|
|
70203
70225
|
new (mapbox_gl_default()).Marker(option).setLngLat(coords).addTo(map);
|
|
70204
70226
|
}
|
|
70205
70227
|
|
|
70206
|
-
/**
|
|
70207
|
-
* 点击测距点位重新触发计算两点位之间的距离
|
|
70208
|
-
* @param resultPoints
|
|
70209
|
-
* @param coords
|
|
70210
|
-
* @returns {string}
|
|
70228
|
+
/**
|
|
70229
|
+
* 点击测距点位重新触发计算两点位之间的距离
|
|
70230
|
+
* @param resultPoints
|
|
70231
|
+
* @param coords
|
|
70232
|
+
* @returns {string}
|
|
70211
70233
|
*/
|
|
70212
70234
|
function getMetersHandler(resultPoints, coords) {
|
|
70213
70235
|
if (resultPoints.length > 1) {
|
|
@@ -70225,13 +70247,13 @@ function getMetersHandler(resultPoints, coords) {
|
|
|
70225
70247
|
}
|
|
70226
70248
|
}
|
|
70227
70249
|
|
|
70228
|
-
/**
|
|
70229
|
-
* 获取两点位之间的角度
|
|
70230
|
-
* @param lng1
|
|
70231
|
-
* @param lat1
|
|
70232
|
-
* @param lng2
|
|
70233
|
-
* @param lat2
|
|
70234
|
-
* @returns {number}
|
|
70250
|
+
/**
|
|
70251
|
+
* 获取两点位之间的角度
|
|
70252
|
+
* @param lng1
|
|
70253
|
+
* @param lat1
|
|
70254
|
+
* @param lng2
|
|
70255
|
+
* @param lat2
|
|
70256
|
+
* @returns {number}
|
|
70235
70257
|
*/
|
|
70236
70258
|
function getAngleHandle(lng1, lat1, lng2, lat2) {
|
|
70237
70259
|
const a = (90 - lat2) * Math.PI / 180;
|
|
@@ -70262,11 +70284,11 @@ function getAngleHandle(lng1, lat1, lng2, lat2) {
|
|
|
70262
70284
|
return res;
|
|
70263
70285
|
}
|
|
70264
70286
|
|
|
70265
|
-
/**
|
|
70266
|
-
* 创建关闭按钮
|
|
70267
|
-
* @param clickMeasurePointsHandler
|
|
70268
|
-
* @param coords
|
|
70269
|
-
* @param mapObject
|
|
70287
|
+
/**
|
|
70288
|
+
* 创建关闭按钮
|
|
70289
|
+
* @param clickMeasurePointsHandler
|
|
70290
|
+
* @param coords
|
|
70291
|
+
* @param mapObject
|
|
70270
70292
|
*/
|
|
70271
70293
|
function createCloseMarkerHandler(clickMeasurePointsHandler, coords, mapObject) {
|
|
70272
70294
|
const resultData = getBeforeOrAfterDataByMapContainerIdHandler(mapObject);
|
|
@@ -70289,8 +70311,8 @@ function createCloseMarkerHandler(clickMeasurePointsHandler, coords, mapObject)
|
|
|
70289
70311
|
};
|
|
70290
70312
|
}
|
|
70291
70313
|
|
|
70292
|
-
/**
|
|
70293
|
-
* 关闭触发
|
|
70314
|
+
/**
|
|
70315
|
+
* 关闭触发
|
|
70294
70316
|
*/
|
|
70295
70317
|
function closeMeasureLine(mapObject) {
|
|
70296
70318
|
if (!mapObject) return;
|
|
@@ -70583,20 +70605,19 @@ const pointToGeoJson = (position = [0, 0]) => {
|
|
|
70583
70605
|
return data;
|
|
70584
70606
|
};
|
|
70585
70607
|
|
|
70586
|
-
//
|
|
70587
|
-
const
|
|
70588
|
-
|
|
70589
|
-
|
|
70590
|
-
|
|
70591
|
-
|
|
70592
|
-
|
|
70593
|
-
|
|
70594
|
-
type: 'Feature',
|
|
70595
|
-
geometry: item,
|
|
70596
|
-
properties: {}
|
|
70597
|
-
});
|
|
70608
|
+
// geoJson 格式 GeometryCollection 转 FeatureCollection
|
|
70609
|
+
const geometryCollectionToFeatureCollection = geometryCollection => {
|
|
70610
|
+
const features = [];
|
|
70611
|
+
|
|
70612
|
+
// 遍历 GeometryCollection 中的每个几何对象
|
|
70613
|
+
geometryCollection.geometries.forEach(geometry => {
|
|
70614
|
+
const feature = es_feature(geometry);
|
|
70615
|
+
features.push(feature);
|
|
70598
70616
|
});
|
|
70599
|
-
|
|
70617
|
+
|
|
70618
|
+
// 创建 FeatureCollection
|
|
70619
|
+
const featureCollection = es_featureCollection(features);
|
|
70620
|
+
return featureCollection;
|
|
70600
70621
|
};
|
|
70601
70622
|
|
|
70602
70623
|
// 3857墨卡托坐标系转换为4326 (WGS84)经纬度坐标
|
|
@@ -71264,8 +71285,8 @@ const Polygon_defaultOptions = {
|
|
|
71264
71285
|
click: null
|
|
71265
71286
|
};
|
|
71266
71287
|
|
|
71267
|
-
/**
|
|
71268
|
-
* 添加面图层
|
|
71288
|
+
/**
|
|
71289
|
+
* 添加面图层
|
|
71269
71290
|
*/
|
|
71270
71291
|
const addLayerPolygon = (option, layerId) => {
|
|
71271
71292
|
let {
|
|
@@ -71367,8 +71388,8 @@ const circle_defaultOptions = {
|
|
|
71367
71388
|
click: null
|
|
71368
71389
|
};
|
|
71369
71390
|
|
|
71370
|
-
/**
|
|
71371
|
-
* 添加面图层
|
|
71391
|
+
/**
|
|
71392
|
+
* 添加面图层
|
|
71372
71393
|
*/
|
|
71373
71394
|
const addLayerCircle = (option, layerId) => {
|
|
71374
71395
|
let {
|
|
@@ -71498,8 +71519,8 @@ const circleAnimate_defaultOptions = {
|
|
|
71498
71519
|
click: null
|
|
71499
71520
|
};
|
|
71500
71521
|
|
|
71501
|
-
/**
|
|
71502
|
-
* 添加圆图层
|
|
71522
|
+
/**
|
|
71523
|
+
* 添加圆图层
|
|
71503
71524
|
*/
|
|
71504
71525
|
const addCircleAnimate = (option, layerId) => {
|
|
71505
71526
|
let {
|
|
@@ -77311,6 +77332,168 @@ const addLayerModel = (option, layerId = '') => {
|
|
|
77311
77332
|
}
|
|
77312
77333
|
});
|
|
77313
77334
|
};
|
|
77335
|
+
;// CONCATENATED MODULE: ./src/package/layers/pipe.js
|
|
77336
|
+
|
|
77337
|
+
|
|
77338
|
+
|
|
77339
|
+
|
|
77340
|
+
|
|
77341
|
+
|
|
77342
|
+
|
|
77343
|
+
|
|
77344
|
+
|
|
77345
|
+
|
|
77346
|
+
const pipe_defaultOptions = {
|
|
77347
|
+
id: 'pipe',
|
|
77348
|
+
position: [103.353557, 23.362395],
|
|
77349
|
+
// 位置
|
|
77350
|
+
hight: 0,
|
|
77351
|
+
// 高度
|
|
77352
|
+
edit: false
|
|
77353
|
+
};
|
|
77354
|
+
|
|
77355
|
+
/**
|
|
77356
|
+
* 添加管道
|
|
77357
|
+
*/
|
|
77358
|
+
const addLayerPipe = (option, layerId = '') => {
|
|
77359
|
+
return new Promise(resolve => {
|
|
77360
|
+
let {
|
|
77361
|
+
map
|
|
77362
|
+
} = package_map;
|
|
77363
|
+
let opt = Object.assign({}, pipe_defaultOptions, option);
|
|
77364
|
+
let camera = '';
|
|
77365
|
+
let scene = '';
|
|
77366
|
+
let group = '';
|
|
77367
|
+
let renderer = '';
|
|
77368
|
+
let customLayer = '';
|
|
77369
|
+
let pipeMesh = '';
|
|
77370
|
+
if (hasLayer(opt.id)) {
|
|
77371
|
+
removeLayer(opt.id);
|
|
77372
|
+
}
|
|
77373
|
+
addPipe();
|
|
77374
|
+
map.addLayer(customLayer, layerId);
|
|
77375
|
+
resolve(group);
|
|
77376
|
+
function addPipe() {
|
|
77377
|
+
const modelOrigin = opt.position; // 中心点
|
|
77378
|
+
const modelAltitude = opt.elevation; // 海拔高度
|
|
77379
|
+
const modelRotate = [Math.PI / 2, 0, 0];
|
|
77380
|
+
const modelAsMercatorCoordinate = mapbox_gl_default().MercatorCoordinate.fromLngLat(modelOrigin, modelAltitude);
|
|
77381
|
+
const modelTransform = {
|
|
77382
|
+
translateX: modelAsMercatorCoordinate.x,
|
|
77383
|
+
translateY: modelAsMercatorCoordinate.y,
|
|
77384
|
+
translateZ: modelAsMercatorCoordinate.z,
|
|
77385
|
+
rotateX: modelRotate[0],
|
|
77386
|
+
rotateY: modelRotate[1],
|
|
77387
|
+
rotateZ: modelRotate[2],
|
|
77388
|
+
scale: modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()
|
|
77389
|
+
};
|
|
77390
|
+
|
|
77391
|
+
// 根据CustomLayerInterface为三维模型配置自定义层
|
|
77392
|
+
customLayer = {
|
|
77393
|
+
id: opt.id,
|
|
77394
|
+
type: 'custom',
|
|
77395
|
+
renderingMode: '3d',
|
|
77396
|
+
onAdd: (map, gl) => {
|
|
77397
|
+
const container = map.getCanvas();
|
|
77398
|
+
|
|
77399
|
+
// 摄像机
|
|
77400
|
+
camera = new PerspectiveCamera(50, container.clientWidth / container.clientHeight, 1, 5000);
|
|
77401
|
+
|
|
77402
|
+
// 场景
|
|
77403
|
+
scene = new Scene();
|
|
77404
|
+
group = new Group();
|
|
77405
|
+
group.name = 'pipe';
|
|
77406
|
+
scene.add(group);
|
|
77407
|
+
|
|
77408
|
+
// 管道
|
|
77409
|
+
let geometry = getPipeGeometry(modelAsMercatorCoordinate, opt);
|
|
77410
|
+
const bottomMat = new MeshBasicMaterial({
|
|
77411
|
+
color: opt.color || 0x7597dc,
|
|
77412
|
+
side: DoubleSide,
|
|
77413
|
+
transparent: true,
|
|
77414
|
+
opacity: 0.5
|
|
77415
|
+
});
|
|
77416
|
+
pipeMesh = new Mesh(geometry, bottomMat);
|
|
77417
|
+
scene.position.y = opt.hight;
|
|
77418
|
+
group.add(pipeMesh);
|
|
77419
|
+
group.rotation.x = -Math.PI / 2;
|
|
77420
|
+
|
|
77421
|
+
// 渲染器
|
|
77422
|
+
renderer = new WebGLRenderer({
|
|
77423
|
+
canvas: map.getCanvas(),
|
|
77424
|
+
context: gl,
|
|
77425
|
+
logarithmicDepthBuffer: true,
|
|
77426
|
+
antialias: true
|
|
77427
|
+
});
|
|
77428
|
+
renderer.autoClear = false;
|
|
77429
|
+
renderer.physicallyCorrectLights = true;
|
|
77430
|
+
// renderer.outputEncoding = THREE.sRGBEncoding
|
|
77431
|
+
renderer.setSize(container.clientWidth, container.clientHeight);
|
|
77432
|
+
|
|
77433
|
+
// 调试工具
|
|
77434
|
+
const gui = opt.edit ? new GUI$1() : null;
|
|
77435
|
+
if (gui) {
|
|
77436
|
+
gui.add(group.position, 'y').step(0.1).name('高度(米)');
|
|
77437
|
+
gui.add(group.rotation, 'x').step(0.1).name('旋转x');
|
|
77438
|
+
gui.add(group.rotation, 'y').step(0.1).name('旋转y');
|
|
77439
|
+
gui.add(group.rotation, 'z').step(0.1).name('旋转z');
|
|
77440
|
+
}
|
|
77441
|
+
},
|
|
77442
|
+
render: (gl, matrix) => {
|
|
77443
|
+
const rotationX = new three_module_Matrix4().makeRotationAxis(new three_module_Vector3(1, 0, 0), modelTransform.rotateX);
|
|
77444
|
+
const rotationY = new three_module_Matrix4().makeRotationAxis(new three_module_Vector3(0, 1, 0), modelTransform.rotateY);
|
|
77445
|
+
const rotationZ = new three_module_Matrix4().makeRotationAxis(new three_module_Vector3(0, 0, 1), modelTransform.rotateZ);
|
|
77446
|
+
const m = new three_module_Matrix4().fromArray(matrix);
|
|
77447
|
+
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);
|
|
77448
|
+
camera.projectionMatrix.elements = matrix;
|
|
77449
|
+
camera.projectionMatrix = m.multiply(l);
|
|
77450
|
+
renderer.resetState();
|
|
77451
|
+
renderer.render(scene, camera);
|
|
77452
|
+
map.triggerRepaint();
|
|
77453
|
+
}
|
|
77454
|
+
};
|
|
77455
|
+
return customLayer;
|
|
77456
|
+
|
|
77457
|
+
//获取管道
|
|
77458
|
+
function getPipeGeometry(center, opt) {
|
|
77459
|
+
if (opt.data) {
|
|
77460
|
+
let points = [];
|
|
77461
|
+
opt.data.features.forEach(geo => {
|
|
77462
|
+
geo.geometry.coordinates.forEach(item => {
|
|
77463
|
+
let mercatorCoordinate = mapbox_gl_default().MercatorCoordinate.fromLngLat(item, 0);
|
|
77464
|
+
let units = mercatorCoordinate.meterInMercatorCoordinateUnits();
|
|
77465
|
+
points.push(new three_module_Vector2((mercatorCoordinate.x - center.x) / units, -1 * (mercatorCoordinate.y - center.y) / units));
|
|
77466
|
+
});
|
|
77467
|
+
});
|
|
77468
|
+
let mesh = '';
|
|
77469
|
+
if (points.length > 1) {
|
|
77470
|
+
// const shape = new THREE.Shape(points)
|
|
77471
|
+
points = points.map(vector => {
|
|
77472
|
+
return new three_module_Vector3(vector.x, vector.y, 0);
|
|
77473
|
+
});
|
|
77474
|
+
mesh = transition3d(points); // 创建管道
|
|
77475
|
+
}
|
|
77476
|
+
|
|
77477
|
+
return mesh;
|
|
77478
|
+
} else {
|
|
77479
|
+
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)]);
|
|
77480
|
+
return new TubeGeometry(curve, 4, 2, 8, false);
|
|
77481
|
+
}
|
|
77482
|
+
}
|
|
77483
|
+
|
|
77484
|
+
// 将shape转换为ExtrudeGeometry
|
|
77485
|
+
function transition3d(points) {
|
|
77486
|
+
// console.log(points, 'points')
|
|
77487
|
+
// 创建一条曲线
|
|
77488
|
+
const curve = new CatmullRomCurve3(points, false, 'catmullrom', 0.5);
|
|
77489
|
+
|
|
77490
|
+
// 创建管道
|
|
77491
|
+
const geometry = new TubeGeometry(curve, 4, 1, 8, false);
|
|
77492
|
+
return geometry;
|
|
77493
|
+
}
|
|
77494
|
+
}
|
|
77495
|
+
});
|
|
77496
|
+
};
|
|
77314
77497
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
77315
77498
|
var defineProperty = __webpack_require__(2482);
|
|
77316
77499
|
;// CONCATENATED MODULE: ./node_modules/@luma.gl/engine/dist/esm/animation/timeline.js
|
|
@@ -119042,8 +119225,8 @@ var mapStyle_component = normalizeComponent(
|
|
|
119042
119225
|
)
|
|
119043
119226
|
|
|
119044
119227
|
/* harmony default export */ var mapStyle = (mapStyle_component.exports);
|
|
119045
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
119046
|
-
var
|
|
119228
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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&
|
|
119229
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_render = function render() {
|
|
119047
119230
|
var _vm = this,
|
|
119048
119231
|
_c = _vm._self._c;
|
|
119049
119232
|
return _c('div', [_c('div', {
|
|
@@ -119174,7 +119357,7 @@ var drawvue_type_template_id_551ff8b1_scoped_true_render = function render() {
|
|
|
119174
119357
|
staticClass: "right-fixed"
|
|
119175
119358
|
}, [_vm._t("right-fixed")], 2)]);
|
|
119176
119359
|
};
|
|
119177
|
-
var
|
|
119360
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns = [];
|
|
119178
119361
|
|
|
119179
119362
|
// EXTERNAL MODULE: ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js
|
|
119180
119363
|
var mapbox_gl_draw = __webpack_require__(5884);
|
|
@@ -119222,7 +119405,7 @@ var jsonFilevue_type_template_id_57aca7b6_scoped_true_staticRenderFns = [];
|
|
|
119222
119405
|
if (json) {
|
|
119223
119406
|
json = JSON.parse(json);
|
|
119224
119407
|
if (!json.features) {
|
|
119225
|
-
json = arcGisToGeoJson(json);
|
|
119408
|
+
json = (0,mapTools_namespaceObject.arcGisToGeoJson)(json);
|
|
119226
119409
|
}
|
|
119227
119410
|
const bbox = es(json);
|
|
119228
119411
|
if (bbox.length > 0 && bbox[0] > 180) {
|
|
@@ -119263,8 +119446,8 @@ var jsonFile_component = normalizeComponent(
|
|
|
119263
119446
|
)
|
|
119264
119447
|
|
|
119265
119448
|
/* harmony default export */ var jsonFile = (jsonFile_component.exports);
|
|
119266
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
119267
|
-
var
|
|
119449
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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&
|
|
119450
|
+
var shpFilevue_type_template_id_3b26555c_scoped_true_render = function render() {
|
|
119268
119451
|
var _vm = this,
|
|
119269
119452
|
_c = _vm._self._c;
|
|
119270
119453
|
return _c('el-button', {
|
|
@@ -119284,7 +119467,7 @@ var shpFilevue_type_template_id_3bd5e448_scoped_true_render = function render()
|
|
|
119284
119467
|
}
|
|
119285
119468
|
})]);
|
|
119286
119469
|
};
|
|
119287
|
-
var
|
|
119470
|
+
var shpFilevue_type_template_id_3b26555c_scoped_true_staticRenderFns = [];
|
|
119288
119471
|
|
|
119289
119472
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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&
|
|
119290
119473
|
|
|
@@ -119307,7 +119490,7 @@ const shapeFile = __webpack_require__(1393); // 导入shpfile.js
|
|
|
119307
119490
|
shapeFile.read(result).then(json => {
|
|
119308
119491
|
const bbox = es(json);
|
|
119309
119492
|
if (!json.features) {
|
|
119310
|
-
json =
|
|
119493
|
+
json = geometryCollectionToFeatureCollection(json);
|
|
119311
119494
|
}
|
|
119312
119495
|
if (bbox.length > 0 && bbox[0] > 180) {
|
|
119313
119496
|
// 墨卡托坐标需要转换
|
|
@@ -119325,9 +119508,9 @@ const shapeFile = __webpack_require__(1393); // 导入shpfile.js
|
|
|
119325
119508
|
});
|
|
119326
119509
|
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue?vue&type=script&lang=js&
|
|
119327
119510
|
/* harmony default export */ var draw_shpFilevue_type_script_lang_js_ = (shpFilevue_type_script_lang_js_);
|
|
119328
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.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-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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=
|
|
119329
|
-
var
|
|
119330
|
-
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue?vue&type=style&index=0&id=
|
|
119511
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.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-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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&
|
|
119512
|
+
var shpFilevue_type_style_index_0_id_3b26555c_prod_lang_scss_scoped_true_ = __webpack_require__(4112);
|
|
119513
|
+
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue?vue&type=style&index=0&id=3b26555c&prod&lang=scss&scoped=true&
|
|
119331
119514
|
|
|
119332
119515
|
;// CONCATENATED MODULE: ./src/package/draw/shpFile.vue
|
|
119333
119516
|
|
|
@@ -119340,11 +119523,11 @@ var shpFilevue_type_style_index_0_id_3bd5e448_prod_lang_scss_scoped_true_ = __we
|
|
|
119340
119523
|
|
|
119341
119524
|
var shpFile_component = normalizeComponent(
|
|
119342
119525
|
draw_shpFilevue_type_script_lang_js_,
|
|
119343
|
-
|
|
119344
|
-
|
|
119526
|
+
shpFilevue_type_template_id_3b26555c_scoped_true_render,
|
|
119527
|
+
shpFilevue_type_template_id_3b26555c_scoped_true_staticRenderFns,
|
|
119345
119528
|
false,
|
|
119346
119529
|
null,
|
|
119347
|
-
"
|
|
119530
|
+
"3b26555c",
|
|
119348
119531
|
null
|
|
119349
119532
|
|
|
119350
119533
|
)
|
|
@@ -119360,6 +119543,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119360
119543
|
|
|
119361
119544
|
|
|
119362
119545
|
|
|
119546
|
+
|
|
119363
119547
|
/* harmony default export */ var drawvue_type_script_lang_js_ = ({
|
|
119364
119548
|
components: {
|
|
119365
119549
|
mapFullScreen: mapFullScreen,
|
|
@@ -119429,7 +119613,8 @@ var shpFile_component = normalizeComponent(
|
|
|
119429
119613
|
activeFeatures: '',
|
|
119430
119614
|
lng: '',
|
|
119431
119615
|
lat: '',
|
|
119432
|
-
geoJson: ''
|
|
119616
|
+
geoJson: '',
|
|
119617
|
+
selectPoint: []
|
|
119433
119618
|
};
|
|
119434
119619
|
},
|
|
119435
119620
|
computed: {
|
|
@@ -119457,6 +119642,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119457
119642
|
return filter;
|
|
119458
119643
|
}
|
|
119459
119644
|
},
|
|
119645
|
+
mounted() {},
|
|
119460
119646
|
methods: {
|
|
119461
119647
|
initDraw(map) {
|
|
119462
119648
|
this.map = map;
|
|
@@ -119474,6 +119660,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119474
119660
|
|
|
119475
119661
|
map.on('draw.create', this.drawEnd);
|
|
119476
119662
|
map.on('draw.update', this.drawUpdate);
|
|
119663
|
+
// map.on('draw.delete', this.delete)
|
|
119477
119664
|
map.on('draw.selectionchange', this.select);
|
|
119478
119665
|
// this.getCenter()
|
|
119479
119666
|
|
|
@@ -119488,8 +119675,47 @@ var shpFile_component = normalizeComponent(
|
|
|
119488
119675
|
// }
|
|
119489
119676
|
// }
|
|
119490
119677
|
// })
|
|
119491
|
-
},
|
|
119492
119678
|
|
|
119679
|
+
// 删除选中锚点
|
|
119680
|
+
document.onkeydown = e => {
|
|
119681
|
+
if (this.selectPoint.length === 0 || this.activeFeatures.length === 0) return;
|
|
119682
|
+
const type = this.activeFeatures[0].geometry.type;
|
|
119683
|
+
if (type != 'LineString') return;
|
|
119684
|
+
const keyCode = e.keyCode || e.which || e.charCode;
|
|
119685
|
+
if (keyCode == 46) {
|
|
119686
|
+
// 按下delete键
|
|
119687
|
+
// console.log('删除锚点', this.selectPoint)
|
|
119688
|
+
this.selectPoint.forEach(point => {
|
|
119689
|
+
// if (type === 'Polygon') {
|
|
119690
|
+
// this.activeFeatures[0].geometry.coordinates.forEach((list, eq) => {
|
|
119691
|
+
// list.forEach((item, index) => {
|
|
119692
|
+
// if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119693
|
+
// this.activeFeatures[0].geometry.coordinates[eq].splice(index, 1)
|
|
119694
|
+
// console.log(this.activeFeatures, '删除成功')
|
|
119695
|
+
// }
|
|
119696
|
+
// })
|
|
119697
|
+
// })
|
|
119698
|
+
// }
|
|
119699
|
+
if (type === 'LineString') {
|
|
119700
|
+
this.activeFeatures[0].geometry.coordinates.forEach((item, index) => {
|
|
119701
|
+
if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119702
|
+
this.activeFeatures[0].geometry.coordinates.splice(index, 1);
|
|
119703
|
+
console.log(this.activeFeatures, '删除锚点成功');
|
|
119704
|
+
}
|
|
119705
|
+
});
|
|
119706
|
+
}
|
|
119707
|
+
});
|
|
119708
|
+
const geometry = this.activeFeatures[0].geometry;
|
|
119709
|
+
// console.log(geometry, 'geometry')
|
|
119710
|
+
this.draw.delete(this.activeFeatures[0].id);
|
|
119711
|
+
if (geometry.coordinates.length > 1) {
|
|
119712
|
+
this.draw.add(geometry);
|
|
119713
|
+
}
|
|
119714
|
+
this.drawUpdate();
|
|
119715
|
+
this.selectPoint = [];
|
|
119716
|
+
}
|
|
119717
|
+
};
|
|
119718
|
+
},
|
|
119493
119719
|
getDraw() {
|
|
119494
119720
|
// 获取绘制内容
|
|
119495
119721
|
const data = this.draw.getAll();
|
|
@@ -119537,8 +119763,12 @@ var shpFile_component = normalizeComponent(
|
|
|
119537
119763
|
this.activeFeatures.forEach(item => {
|
|
119538
119764
|
this.draw.delete(item.id);
|
|
119539
119765
|
const data = this.getDraw();
|
|
119540
|
-
|
|
119541
|
-
|
|
119766
|
+
if (data.features && data.features.length > 0) {
|
|
119767
|
+
this.$emit('delete', data);
|
|
119768
|
+
} else {
|
|
119769
|
+
this.$emit('delete', '');
|
|
119770
|
+
}
|
|
119771
|
+
console.log('删除选中对象', this.activeFeatures[0]);
|
|
119542
119772
|
this.activeFeatures = [];
|
|
119543
119773
|
});
|
|
119544
119774
|
} else {
|
|
@@ -119555,6 +119785,10 @@ var shpFile_component = normalizeComponent(
|
|
|
119555
119785
|
}
|
|
119556
119786
|
},
|
|
119557
119787
|
select(e) {
|
|
119788
|
+
if (e.points && e.points.length > 0) {
|
|
119789
|
+
console.log('选中锚点', e.points);
|
|
119790
|
+
this.selectPoint = e.points;
|
|
119791
|
+
}
|
|
119558
119792
|
this.activeFeatures = e.features;
|
|
119559
119793
|
console.log('选中对象', this.activeFeatures);
|
|
119560
119794
|
this.$emit('select', e.features);
|
|
@@ -119613,9 +119847,9 @@ var shpFile_component = normalizeComponent(
|
|
|
119613
119847
|
});
|
|
119614
119848
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=script&lang=js&
|
|
119615
119849
|
/* harmony default export */ var package_drawvue_type_script_lang_js_ = (drawvue_type_script_lang_js_);
|
|
119616
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.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-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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=
|
|
119617
|
-
var
|
|
119618
|
-
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=
|
|
119850
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.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-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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&
|
|
119851
|
+
var drawvue_type_style_index_0_id_4ba1db1c_prod_lang_scss_scoped_true_ = __webpack_require__(3531);
|
|
119852
|
+
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=4ba1db1c&prod&lang=scss&scoped=true&
|
|
119619
119853
|
|
|
119620
119854
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue
|
|
119621
119855
|
|
|
@@ -119628,11 +119862,11 @@ var drawvue_type_style_index_0_id_551ff8b1_prod_lang_scss_scoped_true_ = __webpa
|
|
|
119628
119862
|
|
|
119629
119863
|
var draw_component = normalizeComponent(
|
|
119630
119864
|
package_drawvue_type_script_lang_js_,
|
|
119631
|
-
|
|
119632
|
-
|
|
119865
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_render,
|
|
119866
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns,
|
|
119633
119867
|
false,
|
|
119634
119868
|
null,
|
|
119635
|
-
"
|
|
119869
|
+
"4ba1db1c",
|
|
119636
119870
|
null
|
|
119637
119871
|
|
|
119638
119872
|
)
|
|
@@ -120278,6 +120512,7 @@ var polygon_component = normalizeComponent(
|
|
|
120278
120512
|
|
|
120279
120513
|
|
|
120280
120514
|
|
|
120515
|
+
|
|
120281
120516
|
// 图层操作
|
|
120282
120517
|
const mapLayers = {
|
|
120283
120518
|
showLayerText: showLayerText,
|
|
@@ -120306,6 +120541,7 @@ const mapDraw = {
|
|
|
120306
120541
|
addLayerCircle: addLayerCircle,
|
|
120307
120542
|
addCircleAnimate: addCircleAnimate,
|
|
120308
120543
|
addLayerModel: addLayerModel,
|
|
120544
|
+
addLayerPipe: addLayerPipe,
|
|
120309
120545
|
addLayerWater: addLayerWater,
|
|
120310
120546
|
load3DTiles: load3DTiles
|
|
120311
120547
|
};
|
|
@@ -120323,7 +120559,8 @@ const mapTools = {
|
|
|
120323
120559
|
polygonCenter: polygonCenter,
|
|
120324
120560
|
GeoAddress: GeoAddress,
|
|
120325
120561
|
Geolocation: Geolocation,
|
|
120326
|
-
getElevation: getElevation
|
|
120562
|
+
getElevation: getElevation,
|
|
120563
|
+
geometryCollectionToFeatureCollection: geometryCollectionToFeatureCollection
|
|
120327
120564
|
};
|
|
120328
120565
|
|
|
120329
120566
|
// 地图事件
|