xy-map 1.1.34 → 1.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/xy-map.common.js +73 -19
- package/xy-map.umd.js +73 -19
- package/xy-map.umd.min.js +3 -3
package/package.json
CHANGED
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
|
|
|
@@ -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
|
|
|
@@ -43830,6 +43830,8 @@ var style_map = __webpack_require__(7193);
|
|
|
43830
43830
|
var html2canvas = __webpack_require__(2269);
|
|
43831
43831
|
var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
43832
43832
|
;// CONCATENATED MODULE: ./src/package/map.js
|
|
43833
|
+
// 天地图token
|
|
43834
|
+
const tdtToken = (/* unused pure expression or super */ null && (['150bad890e9d004885a4b2a94062a46e', '337996a733e1ea41cd73124f67f4795d', '48282c15cce091a1154a674512372eec', 'f3c2ca3a170f5712abd7b6858e038f18']));
|
|
43833
43835
|
var defaultOptions = {
|
|
43834
43836
|
container: 'map',
|
|
43835
43837
|
zoom: 12,
|
|
@@ -43874,7 +43876,7 @@ var defaultOptions = {
|
|
|
43874
43876
|
// 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', // ArcGIS
|
|
43875
43877
|
// 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', // 高德
|
|
43876
43878
|
// '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=
|
|
43879
|
+
// '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
43880
|
],
|
|
43879
43881
|
|
|
43880
43882
|
'tileSize': 512
|
|
@@ -44194,6 +44196,7 @@ class mapSdk {
|
|
|
44194
44196
|
popup.on('close', e => {
|
|
44195
44197
|
popup = null;
|
|
44196
44198
|
});
|
|
44199
|
+
return popup;
|
|
44197
44200
|
}
|
|
44198
44201
|
|
|
44199
44202
|
/**
|
|
@@ -119041,8 +119044,8 @@ var mapStyle_component = normalizeComponent(
|
|
|
119041
119044
|
)
|
|
119042
119045
|
|
|
119043
119046
|
/* harmony default export */ var mapStyle = (mapStyle_component.exports);
|
|
119044
|
-
;// 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=
|
|
119045
|
-
var
|
|
119047
|
+
;// 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&
|
|
119048
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_render = function render() {
|
|
119046
119049
|
var _vm = this,
|
|
119047
119050
|
_c = _vm._self._c;
|
|
119048
119051
|
return _c('div', [_c('div', {
|
|
@@ -119173,7 +119176,7 @@ var drawvue_type_template_id_551ff8b1_scoped_true_render = function render() {
|
|
|
119173
119176
|
staticClass: "right-fixed"
|
|
119174
119177
|
}, [_vm._t("right-fixed")], 2)]);
|
|
119175
119178
|
};
|
|
119176
|
-
var
|
|
119179
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns = [];
|
|
119177
119180
|
|
|
119178
119181
|
// EXTERNAL MODULE: ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js
|
|
119179
119182
|
var mapbox_gl_draw = __webpack_require__(5884);
|
|
@@ -119359,6 +119362,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119359
119362
|
|
|
119360
119363
|
|
|
119361
119364
|
|
|
119365
|
+
|
|
119362
119366
|
/* harmony default export */ var drawvue_type_script_lang_js_ = ({
|
|
119363
119367
|
components: {
|
|
119364
119368
|
mapFullScreen: mapFullScreen,
|
|
@@ -119428,7 +119432,8 @@ var shpFile_component = normalizeComponent(
|
|
|
119428
119432
|
activeFeatures: '',
|
|
119429
119433
|
lng: '',
|
|
119430
119434
|
lat: '',
|
|
119431
|
-
geoJson: ''
|
|
119435
|
+
geoJson: '',
|
|
119436
|
+
selectPoint: []
|
|
119432
119437
|
};
|
|
119433
119438
|
},
|
|
119434
119439
|
computed: {
|
|
@@ -119456,6 +119461,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119456
119461
|
return filter;
|
|
119457
119462
|
}
|
|
119458
119463
|
},
|
|
119464
|
+
mounted() {},
|
|
119459
119465
|
methods: {
|
|
119460
119466
|
initDraw(map) {
|
|
119461
119467
|
this.map = map;
|
|
@@ -119473,6 +119479,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119473
119479
|
|
|
119474
119480
|
map.on('draw.create', this.drawEnd);
|
|
119475
119481
|
map.on('draw.update', this.drawUpdate);
|
|
119482
|
+
// map.on('draw.delete', this.delete)
|
|
119476
119483
|
map.on('draw.selectionchange', this.select);
|
|
119477
119484
|
// this.getCenter()
|
|
119478
119485
|
|
|
@@ -119487,8 +119494,47 @@ var shpFile_component = normalizeComponent(
|
|
|
119487
119494
|
// }
|
|
119488
119495
|
// }
|
|
119489
119496
|
// })
|
|
119490
|
-
},
|
|
119491
119497
|
|
|
119498
|
+
// 删除选中锚点
|
|
119499
|
+
document.onkeydown = e => {
|
|
119500
|
+
if (this.selectPoint.length === 0 || this.activeFeatures.length === 0) return;
|
|
119501
|
+
const type = this.activeFeatures[0].geometry.type;
|
|
119502
|
+
if (type != 'LineString') return;
|
|
119503
|
+
const keyCode = e.keyCode || e.which || e.charCode;
|
|
119504
|
+
if (keyCode == 46) {
|
|
119505
|
+
// 按下delete键
|
|
119506
|
+
// console.log('删除锚点', this.selectPoint)
|
|
119507
|
+
this.selectPoint.forEach(point => {
|
|
119508
|
+
// if (type === 'Polygon') {
|
|
119509
|
+
// this.activeFeatures[0].geometry.coordinates.forEach((list, eq) => {
|
|
119510
|
+
// list.forEach((item, index) => {
|
|
119511
|
+
// if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119512
|
+
// this.activeFeatures[0].geometry.coordinates[eq].splice(index, 1)
|
|
119513
|
+
// console.log(this.activeFeatures, '删除成功')
|
|
119514
|
+
// }
|
|
119515
|
+
// })
|
|
119516
|
+
// })
|
|
119517
|
+
// }
|
|
119518
|
+
if (type === 'LineString') {
|
|
119519
|
+
this.activeFeatures[0].geometry.coordinates.forEach((item, index) => {
|
|
119520
|
+
if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119521
|
+
this.activeFeatures[0].geometry.coordinates.splice(index, 1);
|
|
119522
|
+
console.log(this.activeFeatures, '删除锚点成功');
|
|
119523
|
+
}
|
|
119524
|
+
});
|
|
119525
|
+
}
|
|
119526
|
+
});
|
|
119527
|
+
const geometry = this.activeFeatures[0].geometry;
|
|
119528
|
+
// console.log(geometry, 'geometry')
|
|
119529
|
+
this.draw.delete(this.activeFeatures[0].id);
|
|
119530
|
+
if (geometry.coordinates.length > 1) {
|
|
119531
|
+
this.draw.add(geometry);
|
|
119532
|
+
}
|
|
119533
|
+
this.drawUpdate();
|
|
119534
|
+
this.selectPoint = [];
|
|
119535
|
+
}
|
|
119536
|
+
};
|
|
119537
|
+
},
|
|
119492
119538
|
getDraw() {
|
|
119493
119539
|
// 获取绘制内容
|
|
119494
119540
|
const data = this.draw.getAll();
|
|
@@ -119536,8 +119582,12 @@ var shpFile_component = normalizeComponent(
|
|
|
119536
119582
|
this.activeFeatures.forEach(item => {
|
|
119537
119583
|
this.draw.delete(item.id);
|
|
119538
119584
|
const data = this.getDraw();
|
|
119539
|
-
|
|
119540
|
-
|
|
119585
|
+
if (data.features && data.features.length > 0) {
|
|
119586
|
+
this.$emit('delete', data);
|
|
119587
|
+
} else {
|
|
119588
|
+
this.$emit('delete', '');
|
|
119589
|
+
}
|
|
119590
|
+
console.log('删除选中对象', this.activeFeatures[0]);
|
|
119541
119591
|
this.activeFeatures = [];
|
|
119542
119592
|
});
|
|
119543
119593
|
} else {
|
|
@@ -119554,6 +119604,10 @@ var shpFile_component = normalizeComponent(
|
|
|
119554
119604
|
}
|
|
119555
119605
|
},
|
|
119556
119606
|
select(e) {
|
|
119607
|
+
if (e.points && e.points.length > 0) {
|
|
119608
|
+
console.log('选中锚点', e.points);
|
|
119609
|
+
this.selectPoint = e.points;
|
|
119610
|
+
}
|
|
119557
119611
|
this.activeFeatures = e.features;
|
|
119558
119612
|
console.log('选中对象', this.activeFeatures);
|
|
119559
119613
|
this.$emit('select', e.features);
|
|
@@ -119612,9 +119666,9 @@ var shpFile_component = normalizeComponent(
|
|
|
119612
119666
|
});
|
|
119613
119667
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=script&lang=js&
|
|
119614
119668
|
/* harmony default export */ var package_drawvue_type_script_lang_js_ = (drawvue_type_script_lang_js_);
|
|
119615
|
-
// 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=
|
|
119616
|
-
var
|
|
119617
|
-
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=
|
|
119669
|
+
// 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&
|
|
119670
|
+
var drawvue_type_style_index_0_id_4ba1db1c_prod_lang_scss_scoped_true_ = __webpack_require__(3531);
|
|
119671
|
+
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=4ba1db1c&prod&lang=scss&scoped=true&
|
|
119618
119672
|
|
|
119619
119673
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue
|
|
119620
119674
|
|
|
@@ -119627,11 +119681,11 @@ var drawvue_type_style_index_0_id_551ff8b1_prod_lang_scss_scoped_true_ = __webpa
|
|
|
119627
119681
|
|
|
119628
119682
|
var draw_component = normalizeComponent(
|
|
119629
119683
|
package_drawvue_type_script_lang_js_,
|
|
119630
|
-
|
|
119631
|
-
|
|
119684
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_render,
|
|
119685
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns,
|
|
119632
119686
|
false,
|
|
119633
119687
|
null,
|
|
119634
|
-
"
|
|
119688
|
+
"4ba1db1c",
|
|
119635
119689
|
null
|
|
119636
119690
|
|
|
119637
119691
|
)
|
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
|
|
|
@@ -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
|
|
|
@@ -43848,6 +43848,8 @@ var style_map = __webpack_require__(4321);
|
|
|
43848
43848
|
var html2canvas = __webpack_require__(5507);
|
|
43849
43849
|
var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
43850
43850
|
;// CONCATENATED MODULE: ./src/package/map.js
|
|
43851
|
+
// 天地图token
|
|
43852
|
+
const tdtToken = (/* unused pure expression or super */ null && (['150bad890e9d004885a4b2a94062a46e', '337996a733e1ea41cd73124f67f4795d', '48282c15cce091a1154a674512372eec', 'f3c2ca3a170f5712abd7b6858e038f18']));
|
|
43851
43853
|
var defaultOptions = {
|
|
43852
43854
|
container: 'map',
|
|
43853
43855
|
zoom: 12,
|
|
@@ -43892,7 +43894,7 @@ var defaultOptions = {
|
|
|
43892
43894
|
// 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', // ArcGIS
|
|
43893
43895
|
// 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', // 高德
|
|
43894
43896
|
// '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=
|
|
43897
|
+
// '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
43898
|
],
|
|
43897
43899
|
|
|
43898
43900
|
'tileSize': 512
|
|
@@ -44212,6 +44214,7 @@ class mapSdk {
|
|
|
44212
44214
|
popup.on('close', e => {
|
|
44213
44215
|
popup = null;
|
|
44214
44216
|
});
|
|
44217
|
+
return popup;
|
|
44215
44218
|
}
|
|
44216
44219
|
|
|
44217
44220
|
/**
|
|
@@ -119059,8 +119062,8 @@ var mapStyle_component = normalizeComponent(
|
|
|
119059
119062
|
)
|
|
119060
119063
|
|
|
119061
119064
|
/* harmony default export */ var mapStyle = (mapStyle_component.exports);
|
|
119062
|
-
;// 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=
|
|
119063
|
-
var
|
|
119065
|
+
;// 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&
|
|
119066
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_render = function render() {
|
|
119064
119067
|
var _vm = this,
|
|
119065
119068
|
_c = _vm._self._c;
|
|
119066
119069
|
return _c('div', [_c('div', {
|
|
@@ -119191,7 +119194,7 @@ var drawvue_type_template_id_551ff8b1_scoped_true_render = function render() {
|
|
|
119191
119194
|
staticClass: "right-fixed"
|
|
119192
119195
|
}, [_vm._t("right-fixed")], 2)]);
|
|
119193
119196
|
};
|
|
119194
|
-
var
|
|
119197
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns = [];
|
|
119195
119198
|
|
|
119196
119199
|
// EXTERNAL MODULE: ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js
|
|
119197
119200
|
var mapbox_gl_draw = __webpack_require__(1512);
|
|
@@ -119377,6 +119380,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119377
119380
|
|
|
119378
119381
|
|
|
119379
119382
|
|
|
119383
|
+
|
|
119380
119384
|
/* harmony default export */ var drawvue_type_script_lang_js_ = ({
|
|
119381
119385
|
components: {
|
|
119382
119386
|
mapFullScreen: mapFullScreen,
|
|
@@ -119446,7 +119450,8 @@ var shpFile_component = normalizeComponent(
|
|
|
119446
119450
|
activeFeatures: '',
|
|
119447
119451
|
lng: '',
|
|
119448
119452
|
lat: '',
|
|
119449
|
-
geoJson: ''
|
|
119453
|
+
geoJson: '',
|
|
119454
|
+
selectPoint: []
|
|
119450
119455
|
};
|
|
119451
119456
|
},
|
|
119452
119457
|
computed: {
|
|
@@ -119474,6 +119479,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119474
119479
|
return filter;
|
|
119475
119480
|
}
|
|
119476
119481
|
},
|
|
119482
|
+
mounted() {},
|
|
119477
119483
|
methods: {
|
|
119478
119484
|
initDraw(map) {
|
|
119479
119485
|
this.map = map;
|
|
@@ -119491,6 +119497,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119491
119497
|
|
|
119492
119498
|
map.on('draw.create', this.drawEnd);
|
|
119493
119499
|
map.on('draw.update', this.drawUpdate);
|
|
119500
|
+
// map.on('draw.delete', this.delete)
|
|
119494
119501
|
map.on('draw.selectionchange', this.select);
|
|
119495
119502
|
// this.getCenter()
|
|
119496
119503
|
|
|
@@ -119505,8 +119512,47 @@ var shpFile_component = normalizeComponent(
|
|
|
119505
119512
|
// }
|
|
119506
119513
|
// }
|
|
119507
119514
|
// })
|
|
119508
|
-
},
|
|
119509
119515
|
|
|
119516
|
+
// 删除选中锚点
|
|
119517
|
+
document.onkeydown = e => {
|
|
119518
|
+
if (this.selectPoint.length === 0 || this.activeFeatures.length === 0) return;
|
|
119519
|
+
const type = this.activeFeatures[0].geometry.type;
|
|
119520
|
+
if (type != 'LineString') return;
|
|
119521
|
+
const keyCode = e.keyCode || e.which || e.charCode;
|
|
119522
|
+
if (keyCode == 46) {
|
|
119523
|
+
// 按下delete键
|
|
119524
|
+
// console.log('删除锚点', this.selectPoint)
|
|
119525
|
+
this.selectPoint.forEach(point => {
|
|
119526
|
+
// if (type === 'Polygon') {
|
|
119527
|
+
// this.activeFeatures[0].geometry.coordinates.forEach((list, eq) => {
|
|
119528
|
+
// list.forEach((item, index) => {
|
|
119529
|
+
// if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119530
|
+
// this.activeFeatures[0].geometry.coordinates[eq].splice(index, 1)
|
|
119531
|
+
// console.log(this.activeFeatures, '删除成功')
|
|
119532
|
+
// }
|
|
119533
|
+
// })
|
|
119534
|
+
// })
|
|
119535
|
+
// }
|
|
119536
|
+
if (type === 'LineString') {
|
|
119537
|
+
this.activeFeatures[0].geometry.coordinates.forEach((item, index) => {
|
|
119538
|
+
if (JSON.stringify(item) === JSON.stringify(point.geometry.coordinates)) {
|
|
119539
|
+
this.activeFeatures[0].geometry.coordinates.splice(index, 1);
|
|
119540
|
+
console.log(this.activeFeatures, '删除锚点成功');
|
|
119541
|
+
}
|
|
119542
|
+
});
|
|
119543
|
+
}
|
|
119544
|
+
});
|
|
119545
|
+
const geometry = this.activeFeatures[0].geometry;
|
|
119546
|
+
// console.log(geometry, 'geometry')
|
|
119547
|
+
this.draw.delete(this.activeFeatures[0].id);
|
|
119548
|
+
if (geometry.coordinates.length > 1) {
|
|
119549
|
+
this.draw.add(geometry);
|
|
119550
|
+
}
|
|
119551
|
+
this.drawUpdate();
|
|
119552
|
+
this.selectPoint = [];
|
|
119553
|
+
}
|
|
119554
|
+
};
|
|
119555
|
+
},
|
|
119510
119556
|
getDraw() {
|
|
119511
119557
|
// 获取绘制内容
|
|
119512
119558
|
const data = this.draw.getAll();
|
|
@@ -119554,8 +119600,12 @@ var shpFile_component = normalizeComponent(
|
|
|
119554
119600
|
this.activeFeatures.forEach(item => {
|
|
119555
119601
|
this.draw.delete(item.id);
|
|
119556
119602
|
const data = this.getDraw();
|
|
119557
|
-
|
|
119558
|
-
|
|
119603
|
+
if (data.features && data.features.length > 0) {
|
|
119604
|
+
this.$emit('delete', data);
|
|
119605
|
+
} else {
|
|
119606
|
+
this.$emit('delete', '');
|
|
119607
|
+
}
|
|
119608
|
+
console.log('删除选中对象', this.activeFeatures[0]);
|
|
119559
119609
|
this.activeFeatures = [];
|
|
119560
119610
|
});
|
|
119561
119611
|
} else {
|
|
@@ -119572,6 +119622,10 @@ var shpFile_component = normalizeComponent(
|
|
|
119572
119622
|
}
|
|
119573
119623
|
},
|
|
119574
119624
|
select(e) {
|
|
119625
|
+
if (e.points && e.points.length > 0) {
|
|
119626
|
+
console.log('选中锚点', e.points);
|
|
119627
|
+
this.selectPoint = e.points;
|
|
119628
|
+
}
|
|
119575
119629
|
this.activeFeatures = e.features;
|
|
119576
119630
|
console.log('选中对象', this.activeFeatures);
|
|
119577
119631
|
this.$emit('select', e.features);
|
|
@@ -119630,9 +119684,9 @@ var shpFile_component = normalizeComponent(
|
|
|
119630
119684
|
});
|
|
119631
119685
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=script&lang=js&
|
|
119632
119686
|
/* harmony default export */ var package_drawvue_type_script_lang_js_ = (drawvue_type_script_lang_js_);
|
|
119633
|
-
// 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=
|
|
119634
|
-
var
|
|
119635
|
-
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=
|
|
119687
|
+
// 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&
|
|
119688
|
+
var drawvue_type_style_index_0_id_4ba1db1c_prod_lang_scss_scoped_true_ = __webpack_require__(9521);
|
|
119689
|
+
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=style&index=0&id=4ba1db1c&prod&lang=scss&scoped=true&
|
|
119636
119690
|
|
|
119637
119691
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue
|
|
119638
119692
|
|
|
@@ -119645,11 +119699,11 @@ var drawvue_type_style_index_0_id_551ff8b1_prod_lang_scss_scoped_true_ = __webpa
|
|
|
119645
119699
|
|
|
119646
119700
|
var draw_component = normalizeComponent(
|
|
119647
119701
|
package_drawvue_type_script_lang_js_,
|
|
119648
|
-
|
|
119649
|
-
|
|
119702
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_render,
|
|
119703
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns,
|
|
119650
119704
|
false,
|
|
119651
119705
|
null,
|
|
119652
|
-
"
|
|
119706
|
+
"4ba1db1c",
|
|
119653
119707
|
null
|
|
119654
119708
|
|
|
119655
119709
|
)
|