xy-map 1.1.35 → 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 +72 -19
- package/xy-map.umd.js +72 -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
|
|
@@ -119042,8 +119044,8 @@ var mapStyle_component = normalizeComponent(
|
|
|
119042
119044
|
)
|
|
119043
119045
|
|
|
119044
119046
|
/* 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
|
|
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() {
|
|
119047
119049
|
var _vm = this,
|
|
119048
119050
|
_c = _vm._self._c;
|
|
119049
119051
|
return _c('div', [_c('div', {
|
|
@@ -119174,7 +119176,7 @@ var drawvue_type_template_id_551ff8b1_scoped_true_render = function render() {
|
|
|
119174
119176
|
staticClass: "right-fixed"
|
|
119175
119177
|
}, [_vm._t("right-fixed")], 2)]);
|
|
119176
119178
|
};
|
|
119177
|
-
var
|
|
119179
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns = [];
|
|
119178
119180
|
|
|
119179
119181
|
// EXTERNAL MODULE: ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js
|
|
119180
119182
|
var mapbox_gl_draw = __webpack_require__(5884);
|
|
@@ -119360,6 +119362,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119360
119362
|
|
|
119361
119363
|
|
|
119362
119364
|
|
|
119365
|
+
|
|
119363
119366
|
/* harmony default export */ var drawvue_type_script_lang_js_ = ({
|
|
119364
119367
|
components: {
|
|
119365
119368
|
mapFullScreen: mapFullScreen,
|
|
@@ -119429,7 +119432,8 @@ var shpFile_component = normalizeComponent(
|
|
|
119429
119432
|
activeFeatures: '',
|
|
119430
119433
|
lng: '',
|
|
119431
119434
|
lat: '',
|
|
119432
|
-
geoJson: ''
|
|
119435
|
+
geoJson: '',
|
|
119436
|
+
selectPoint: []
|
|
119433
119437
|
};
|
|
119434
119438
|
},
|
|
119435
119439
|
computed: {
|
|
@@ -119457,6 +119461,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119457
119461
|
return filter;
|
|
119458
119462
|
}
|
|
119459
119463
|
},
|
|
119464
|
+
mounted() {},
|
|
119460
119465
|
methods: {
|
|
119461
119466
|
initDraw(map) {
|
|
119462
119467
|
this.map = map;
|
|
@@ -119474,6 +119479,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119474
119479
|
|
|
119475
119480
|
map.on('draw.create', this.drawEnd);
|
|
119476
119481
|
map.on('draw.update', this.drawUpdate);
|
|
119482
|
+
// map.on('draw.delete', this.delete)
|
|
119477
119483
|
map.on('draw.selectionchange', this.select);
|
|
119478
119484
|
// this.getCenter()
|
|
119479
119485
|
|
|
@@ -119488,8 +119494,47 @@ var shpFile_component = normalizeComponent(
|
|
|
119488
119494
|
// }
|
|
119489
119495
|
// }
|
|
119490
119496
|
// })
|
|
119491
|
-
},
|
|
119492
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
|
+
},
|
|
119493
119538
|
getDraw() {
|
|
119494
119539
|
// 获取绘制内容
|
|
119495
119540
|
const data = this.draw.getAll();
|
|
@@ -119537,8 +119582,12 @@ var shpFile_component = normalizeComponent(
|
|
|
119537
119582
|
this.activeFeatures.forEach(item => {
|
|
119538
119583
|
this.draw.delete(item.id);
|
|
119539
119584
|
const data = this.getDraw();
|
|
119540
|
-
|
|
119541
|
-
|
|
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]);
|
|
119542
119591
|
this.activeFeatures = [];
|
|
119543
119592
|
});
|
|
119544
119593
|
} else {
|
|
@@ -119555,6 +119604,10 @@ var shpFile_component = normalizeComponent(
|
|
|
119555
119604
|
}
|
|
119556
119605
|
},
|
|
119557
119606
|
select(e) {
|
|
119607
|
+
if (e.points && e.points.length > 0) {
|
|
119608
|
+
console.log('选中锚点', e.points);
|
|
119609
|
+
this.selectPoint = e.points;
|
|
119610
|
+
}
|
|
119558
119611
|
this.activeFeatures = e.features;
|
|
119559
119612
|
console.log('选中对象', this.activeFeatures);
|
|
119560
119613
|
this.$emit('select', e.features);
|
|
@@ -119613,9 +119666,9 @@ var shpFile_component = normalizeComponent(
|
|
|
119613
119666
|
});
|
|
119614
119667
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=script&lang=js&
|
|
119615
119668
|
/* 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=
|
|
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&
|
|
119619
119672
|
|
|
119620
119673
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue
|
|
119621
119674
|
|
|
@@ -119628,11 +119681,11 @@ var drawvue_type_style_index_0_id_551ff8b1_prod_lang_scss_scoped_true_ = __webpa
|
|
|
119628
119681
|
|
|
119629
119682
|
var draw_component = normalizeComponent(
|
|
119630
119683
|
package_drawvue_type_script_lang_js_,
|
|
119631
|
-
|
|
119632
|
-
|
|
119684
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_render,
|
|
119685
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns,
|
|
119633
119686
|
false,
|
|
119634
119687
|
null,
|
|
119635
|
-
"
|
|
119688
|
+
"4ba1db1c",
|
|
119636
119689
|
null
|
|
119637
119690
|
|
|
119638
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
|
|
@@ -119060,8 +119062,8 @@ var mapStyle_component = normalizeComponent(
|
|
|
119060
119062
|
)
|
|
119061
119063
|
|
|
119062
119064
|
/* 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
|
|
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() {
|
|
119065
119067
|
var _vm = this,
|
|
119066
119068
|
_c = _vm._self._c;
|
|
119067
119069
|
return _c('div', [_c('div', {
|
|
@@ -119192,7 +119194,7 @@ var drawvue_type_template_id_551ff8b1_scoped_true_render = function render() {
|
|
|
119192
119194
|
staticClass: "right-fixed"
|
|
119193
119195
|
}, [_vm._t("right-fixed")], 2)]);
|
|
119194
119196
|
};
|
|
119195
|
-
var
|
|
119197
|
+
var drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns = [];
|
|
119196
119198
|
|
|
119197
119199
|
// EXTERNAL MODULE: ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js
|
|
119198
119200
|
var mapbox_gl_draw = __webpack_require__(1512);
|
|
@@ -119378,6 +119380,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119378
119380
|
|
|
119379
119381
|
|
|
119380
119382
|
|
|
119383
|
+
|
|
119381
119384
|
/* harmony default export */ var drawvue_type_script_lang_js_ = ({
|
|
119382
119385
|
components: {
|
|
119383
119386
|
mapFullScreen: mapFullScreen,
|
|
@@ -119447,7 +119450,8 @@ var shpFile_component = normalizeComponent(
|
|
|
119447
119450
|
activeFeatures: '',
|
|
119448
119451
|
lng: '',
|
|
119449
119452
|
lat: '',
|
|
119450
|
-
geoJson: ''
|
|
119453
|
+
geoJson: '',
|
|
119454
|
+
selectPoint: []
|
|
119451
119455
|
};
|
|
119452
119456
|
},
|
|
119453
119457
|
computed: {
|
|
@@ -119475,6 +119479,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119475
119479
|
return filter;
|
|
119476
119480
|
}
|
|
119477
119481
|
},
|
|
119482
|
+
mounted() {},
|
|
119478
119483
|
methods: {
|
|
119479
119484
|
initDraw(map) {
|
|
119480
119485
|
this.map = map;
|
|
@@ -119492,6 +119497,7 @@ var shpFile_component = normalizeComponent(
|
|
|
119492
119497
|
|
|
119493
119498
|
map.on('draw.create', this.drawEnd);
|
|
119494
119499
|
map.on('draw.update', this.drawUpdate);
|
|
119500
|
+
// map.on('draw.delete', this.delete)
|
|
119495
119501
|
map.on('draw.selectionchange', this.select);
|
|
119496
119502
|
// this.getCenter()
|
|
119497
119503
|
|
|
@@ -119506,8 +119512,47 @@ var shpFile_component = normalizeComponent(
|
|
|
119506
119512
|
// }
|
|
119507
119513
|
// }
|
|
119508
119514
|
// })
|
|
119509
|
-
},
|
|
119510
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
|
+
},
|
|
119511
119556
|
getDraw() {
|
|
119512
119557
|
// 获取绘制内容
|
|
119513
119558
|
const data = this.draw.getAll();
|
|
@@ -119555,8 +119600,12 @@ var shpFile_component = normalizeComponent(
|
|
|
119555
119600
|
this.activeFeatures.forEach(item => {
|
|
119556
119601
|
this.draw.delete(item.id);
|
|
119557
119602
|
const data = this.getDraw();
|
|
119558
|
-
|
|
119559
|
-
|
|
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]);
|
|
119560
119609
|
this.activeFeatures = [];
|
|
119561
119610
|
});
|
|
119562
119611
|
} else {
|
|
@@ -119573,6 +119622,10 @@ var shpFile_component = normalizeComponent(
|
|
|
119573
119622
|
}
|
|
119574
119623
|
},
|
|
119575
119624
|
select(e) {
|
|
119625
|
+
if (e.points && e.points.length > 0) {
|
|
119626
|
+
console.log('选中锚点', e.points);
|
|
119627
|
+
this.selectPoint = e.points;
|
|
119628
|
+
}
|
|
119576
119629
|
this.activeFeatures = e.features;
|
|
119577
119630
|
console.log('选中对象', this.activeFeatures);
|
|
119578
119631
|
this.$emit('select', e.features);
|
|
@@ -119631,9 +119684,9 @@ var shpFile_component = normalizeComponent(
|
|
|
119631
119684
|
});
|
|
119632
119685
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue?vue&type=script&lang=js&
|
|
119633
119686
|
/* 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=
|
|
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&
|
|
119637
119690
|
|
|
119638
119691
|
;// CONCATENATED MODULE: ./src/package/draw/index.vue
|
|
119639
119692
|
|
|
@@ -119646,11 +119699,11 @@ var drawvue_type_style_index_0_id_551ff8b1_prod_lang_scss_scoped_true_ = __webpa
|
|
|
119646
119699
|
|
|
119647
119700
|
var draw_component = normalizeComponent(
|
|
119648
119701
|
package_drawvue_type_script_lang_js_,
|
|
119649
|
-
|
|
119650
|
-
|
|
119702
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_render,
|
|
119703
|
+
drawvue_type_template_id_4ba1db1c_scoped_true_staticRenderFns,
|
|
119651
119704
|
false,
|
|
119652
119705
|
null,
|
|
119653
|
-
"
|
|
119706
|
+
"4ba1db1c",
|
|
119654
119707
|
null
|
|
119655
119708
|
|
|
119656
119709
|
)
|