augustine-jkmap 1.1.2 → 1.1.3
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/dist/augustine-jkmap.common.js +558 -561
- package/dist/augustine-jkmap.common.js.map +1 -1
- package/dist/augustine-jkmap.umd.js +63 -66
- package/dist/augustine-jkmap.umd.js.map +1 -1
- package/dist/augustine-jkmap.umd.min.js +1 -1
- package/dist/augustine-jkmap.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/utils/index.js +19 -0
- package/src/README.md +0 -46
|
@@ -3083,7 +3083,7 @@ if (typeof window !== 'undefined') {
|
|
|
3083
3083
|
// Indicate to webpack that this file can be concatenated
|
|
3084
3084
|
/* harmony default export */ const setPublicPath = (null);
|
|
3085
3085
|
|
|
3086
|
-
;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/vue2/augustineGjMap.vue?vue&type=template&id=
|
|
3086
|
+
;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/vue2/augustineGjMap.vue?vue&type=template&id=5cdfceff
|
|
3087
3087
|
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('loading-box',{attrs:{"loading":_vm.isLoading}},[_c('div',{staticClass:"arcgisMap-box"},[_c('div',{staticClass:"arcgisMapBox",attrs:{"id":_vm.mapId}}),(_vm.pathCoordinates.length > 0 && _vm.noAbleMoving)?_c('div',{staticClass:"controls",class:'controls_' + _vm.postion},[_c('div',{staticClass:"controls-item",class:{ 'controls-active': _vm.currentPathIndex > 0 },on:{"click":_vm.changeMove}},[_vm._v(" "+_vm._s(_vm.currentPathIndex == 0 ? '开始' : _vm.isPaused ? '继续' : '暂停')+" ")]),_c('div',{staticClass:"controls-item",on:{"click":_vm.changeSpeed}},[_c('p',[_vm._v(_vm._s(_vm.speedNum)+" "),_c('svgIcon',{attrs:{"name":"close","width":"14","color":"#000"}})],1),_c('p',[_vm._v("加速")])]),_c('div',{staticClass:"controls-item",on:{"click":_vm.stopAnimation}},[_vm._v("重置")]),(_vm.postion == 'top' || _vm.postion == 'bottom')?_c('div',{staticClass:"controls-item",on:{"click":function($event){return _vm.drawMeasurement('distance')}}},[_vm._v(" 测距 ")]):_vm._e(),(_vm.postion == 'top' || _vm.postion == 'bottom')?_c('div',{staticClass:"controls-item",on:{"click":function($event){return _vm.drawMeasurement('area')}}},[_vm._v("测面积")]):_vm._e(),(_vm.postion == 'top' || _vm.postion == 'bottom')?_c('div',{staticClass:"controls-item",on:{"click":_vm.clearMeasurement}},[_vm._v("清除")]):_vm._e()]):_vm._e(),_c('CustomTooltip',{ref:"tooltip",scopedSlots:_vm._u([{key:"default",fn:function({ data }){return [_c('div',[_vm._v(" 经纬度: "),_c('b',[_vm._v(_vm._s(data.longitude)+"-"+_vm._s(data.latitude))])]),_c('div',[_vm._v(" 时间: "),_c('b',[_vm._v(_vm._s(data.time))])])]}}])})],1)])
|
|
3088
3088
|
}
|
|
3089
3089
|
var staticRenderFns = []
|
|
@@ -5411,6 +5411,24 @@ async function createMaskLayer(polygonDataList = [], options, context = null, ma
|
|
|
5411
5411
|
return null
|
|
5412
5412
|
}
|
|
5413
5413
|
}
|
|
5414
|
+
/**
|
|
5415
|
+
* 防抖
|
|
5416
|
+
* @param {*} fn
|
|
5417
|
+
* @param {*} delay
|
|
5418
|
+
* @returns
|
|
5419
|
+
*/
|
|
5420
|
+
function debounce(fn, delay = 300) {
|
|
5421
|
+
let timer = null // 存储定时器
|
|
5422
|
+
return function (...args) {
|
|
5423
|
+
// 清除上一次的定时器
|
|
5424
|
+
if (timer) clearTimeout(timer)
|
|
5425
|
+
// 重新设置定时器,延迟执行
|
|
5426
|
+
timer = setTimeout(() => {
|
|
5427
|
+
fn.apply(this, args) // 保留 this 指向和函数参数
|
|
5428
|
+
timer = null // 执行后清空定时器
|
|
5429
|
+
}, delay)
|
|
5430
|
+
}
|
|
5431
|
+
}
|
|
5414
5432
|
|
|
5415
5433
|
|
|
5416
5434
|
;// ./src/utils/bearing.js
|
|
@@ -5765,7 +5783,7 @@ var jk_map,
|
|
|
5765
5783
|
/**
|
|
5766
5784
|
* 防抖
|
|
5767
5785
|
*/
|
|
5768
|
-
function
|
|
5786
|
+
function augustineGjMapvue_type_script_lang_js_debounce(fn, delay) {
|
|
5769
5787
|
let timer
|
|
5770
5788
|
return (...args) => {
|
|
5771
5789
|
clearTimeout(timer)
|
|
@@ -5780,9 +5798,9 @@ function debounce(fn, delay) {
|
|
|
5780
5798
|
type: Object,
|
|
5781
5799
|
default: mapGj_config
|
|
5782
5800
|
},
|
|
5783
|
-
|
|
5784
|
-
type:
|
|
5785
|
-
default:
|
|
5801
|
+
noAbleMoving: {
|
|
5802
|
+
type: Boolean,
|
|
5803
|
+
default: true
|
|
5786
5804
|
},
|
|
5787
5805
|
center: {
|
|
5788
5806
|
type: Array,
|
|
@@ -5819,8 +5837,6 @@ function debounce(fn, delay) {
|
|
|
5819
5837
|
mapId: 'map' + Math.round(Math.random() * 10000),
|
|
5820
5838
|
//地图加载loading
|
|
5821
5839
|
isLoading: true,
|
|
5822
|
-
gjParams: null,
|
|
5823
|
-
apiToken: null,
|
|
5824
5840
|
currentPathIndex: 0,
|
|
5825
5841
|
//轨迹点
|
|
5826
5842
|
pathCoordinates: [],
|
|
@@ -5829,19 +5845,9 @@ function debounce(fn, delay) {
|
|
|
5829
5845
|
isPaused: false,
|
|
5830
5846
|
speedNum: 1,
|
|
5831
5847
|
speed: 500,
|
|
5832
|
-
noAbleMoving: true,
|
|
5833
5848
|
imgPathData: null
|
|
5834
5849
|
}
|
|
5835
5850
|
},
|
|
5836
|
-
activated() {
|
|
5837
|
-
let route = this.$route
|
|
5838
|
-
this.gjParams = route.query
|
|
5839
|
-
this.noAbleMoving = route.query && route.query.cannotMove ? false : true
|
|
5840
|
-
this.isLoading = true
|
|
5841
|
-
if (route.query.token) {
|
|
5842
|
-
this.apiToken = route.query.token
|
|
5843
|
-
}
|
|
5844
|
-
},
|
|
5845
5851
|
mounted() {
|
|
5846
5852
|
this.isLoading = true
|
|
5847
5853
|
this.init(this.mapParams)
|
|
@@ -6186,7 +6192,7 @@ function debounce(fn, delay) {
|
|
|
6186
6192
|
measurement = new window.jkEsri.Measurement({
|
|
6187
6193
|
view: jk_view
|
|
6188
6194
|
})
|
|
6189
|
-
jk_view.on('pointer-move',
|
|
6195
|
+
jk_view.on('pointer-move', augustineGjMapvue_type_script_lang_js_debounce(this.debouncedHover, 300))
|
|
6190
6196
|
this.loadMapData()
|
|
6191
6197
|
})
|
|
6192
6198
|
},
|
|
@@ -11069,9 +11075,9 @@ const mapLocationMixin = {
|
|
|
11069
11075
|
},
|
|
11070
11076
|
setupMapEvents(view) {
|
|
11071
11077
|
// 点击
|
|
11072
|
-
this._clickHandler = view.on('click',
|
|
11078
|
+
this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
|
|
11073
11079
|
// 悬浮
|
|
11074
|
-
this._hoverHandler = view.on('pointer-move',
|
|
11080
|
+
this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
|
|
11075
11081
|
},
|
|
11076
11082
|
|
|
11077
11083
|
handleMapClick(e) {
|
|
@@ -11127,14 +11133,6 @@ const mapLocationMixin = {
|
|
|
11127
11133
|
} else arcgisView.container.style.cursor = 'default'
|
|
11128
11134
|
},
|
|
11129
11135
|
|
|
11130
|
-
debounce(fn, delay) {
|
|
11131
|
-
let timer
|
|
11132
|
-
return (...args) => {
|
|
11133
|
-
clearTimeout(timer)
|
|
11134
|
-
timer = setTimeout(() => fn.apply(this, args), delay)
|
|
11135
|
-
}
|
|
11136
|
-
},
|
|
11137
|
-
|
|
11138
11136
|
cleanupMapEvents() {
|
|
11139
11137
|
this._clickHandler?.remove()
|
|
11140
11138
|
this._hoverHandler?.remove()
|
|
@@ -11939,6 +11937,7 @@ class SketchManager {
|
|
|
11939
11937
|
this.drawIngArea = this.getArea(event.graphic.geometry)
|
|
11940
11938
|
}
|
|
11941
11939
|
}
|
|
11940
|
+
this.isActive = true
|
|
11942
11941
|
if (event.state === 'complete') {
|
|
11943
11942
|
const graphic = event.graphic
|
|
11944
11943
|
this.isActive = false
|
|
@@ -11958,6 +11957,7 @@ class SketchManager {
|
|
|
11958
11957
|
if (selectedGrahic && selectedGrahic.length > 0) {
|
|
11959
11958
|
this.drawIngArea = this.getArea(selectedGrahic[0].geometry)
|
|
11960
11959
|
}
|
|
11960
|
+
this.isActive = true
|
|
11961
11961
|
if (event.state === 'complete') {
|
|
11962
11962
|
this.isActive = false
|
|
11963
11963
|
this.isNextList = []
|
|
@@ -12057,7 +12057,7 @@ const mapMixin = {
|
|
|
12057
12057
|
module: {
|
|
12058
12058
|
type: Array,
|
|
12059
12059
|
default: () => {
|
|
12060
|
-
return [
|
|
12060
|
+
return [] //edit:编辑,screen:全屏,search:搜索-'search', 'edit', 'screen'
|
|
12061
12061
|
}
|
|
12062
12062
|
},
|
|
12063
12063
|
//最大可绘制的图形数量
|
|
@@ -12097,9 +12097,17 @@ const mapMixin = {
|
|
|
12097
12097
|
isPer: false,
|
|
12098
12098
|
drawIngArea: 0,
|
|
12099
12099
|
isDel: false,
|
|
12100
|
-
isDelAll: false
|
|
12100
|
+
isDelAll: false,
|
|
12101
|
+
debouncedRetuanGraphics: null
|
|
12101
12102
|
}
|
|
12102
12103
|
},
|
|
12104
|
+
created() {
|
|
12105
|
+
// 包装 retuanGraphics 为防抖方法,延迟 500ms(可自定义)
|
|
12106
|
+
// 此处用箭头函数确保 this 指向组件实例,或用 bind(this)
|
|
12107
|
+
this.debouncedRetuanGraphics = debounce(() => {
|
|
12108
|
+
this.retuanGraphics()
|
|
12109
|
+
}, 500) // 防抖延迟与原 setTimeout 一致,也可调整
|
|
12110
|
+
},
|
|
12103
12111
|
methods: {
|
|
12104
12112
|
/**
|
|
12105
12113
|
* 给数值添加千分位(强制保留2位小数,兼容负数/0/超长字符串等场景)
|
|
@@ -12133,8 +12141,8 @@ const mapMixin = {
|
|
|
12133
12141
|
* @param {*} view
|
|
12134
12142
|
*/
|
|
12135
12143
|
setupMapEvents(view) {
|
|
12136
|
-
this._clickHandler = view.on('click',
|
|
12137
|
-
this._hoverHandler = view.on('pointer-move',
|
|
12144
|
+
this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
|
|
12145
|
+
this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
|
|
12138
12146
|
},
|
|
12139
12147
|
/**
|
|
12140
12148
|
* 鼠标点击
|
|
@@ -12183,13 +12191,6 @@ const mapMixin = {
|
|
|
12183
12191
|
mapMixin_arcgisView.container.style.cursor = 'default'
|
|
12184
12192
|
}
|
|
12185
12193
|
},
|
|
12186
|
-
debounce(fn, delay) {
|
|
12187
|
-
let timer
|
|
12188
|
-
return (...args) => {
|
|
12189
|
-
clearTimeout(timer)
|
|
12190
|
-
timer = setTimeout(() => fn.apply(this, args), delay)
|
|
12191
|
-
}
|
|
12192
|
-
},
|
|
12193
12194
|
/**
|
|
12194
12195
|
* 清除监听
|
|
12195
12196
|
*/
|
|
@@ -12241,9 +12242,8 @@ const mapMixin = {
|
|
|
12241
12242
|
: 0
|
|
12242
12243
|
graphics = data.graphics
|
|
12243
12244
|
this.isDelAll = graphics.length > 0
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
}, 500)
|
|
12245
|
+
|
|
12246
|
+
this.debouncedRetuanGraphics()
|
|
12247
12247
|
})
|
|
12248
12248
|
}
|
|
12249
12249
|
this.setupMapEvents(data.view)
|
|
@@ -12356,7 +12356,6 @@ const mapMixin = {
|
|
|
12356
12356
|
form.mArea = Number(area) * 0.0015 // 亩
|
|
12357
12357
|
form.hectareArea = Number(area) * 0.0001 // 公顷
|
|
12358
12358
|
}
|
|
12359
|
-
console.log('formatMapData00', form, graphics)
|
|
12360
12359
|
return form
|
|
12361
12360
|
},
|
|
12362
12361
|
/**
|
|
@@ -12371,8 +12370,9 @@ const mapMixin = {
|
|
|
12371
12370
|
* @param {*} type
|
|
12372
12371
|
*/
|
|
12373
12372
|
batchDraw(graphics) {
|
|
12374
|
-
|
|
12375
|
-
|
|
12373
|
+
if (graphics.length > 0 && sketchLayer) {
|
|
12374
|
+
sketchLayer && sketchLayer.removeAll()
|
|
12375
|
+
|
|
12376
12376
|
let sketchArr = []
|
|
12377
12377
|
graphics.map((item) => {
|
|
12378
12378
|
let grahic = null
|
|
@@ -12393,8 +12393,8 @@ const mapMixin = {
|
|
|
12393
12393
|
} else this.goToCenter()
|
|
12394
12394
|
},
|
|
12395
12395
|
batchNnselectDraw(graphics, textKey = 'text') {
|
|
12396
|
-
|
|
12397
|
-
|
|
12396
|
+
if (graphics.length > 0 && unselectableLayer) {
|
|
12397
|
+
unselectableLayer && unselectableLayer.removeAll()
|
|
12398
12398
|
let sketchArr = []
|
|
12399
12399
|
graphics.map((item) => {
|
|
12400
12400
|
let grahic = null
|
|
@@ -12430,10 +12430,15 @@ const mapMixin = {
|
|
|
12430
12430
|
destroy() {
|
|
12431
12431
|
this.cleanupMapEvents()
|
|
12432
12432
|
if (mapMixin_sketch && mapMixin_sketch.destroy) mapMixin_sketch.destroy()
|
|
12433
|
+
unselectableLayer && unselectableLayer.removeAll()
|
|
12433
12434
|
this.goToCenter()
|
|
12434
12435
|
if (this.$refs.searchRef && this.$refs.searchRef.clearSearch) {
|
|
12435
12436
|
this.$refs.searchRef.clearSearch()
|
|
12436
12437
|
}
|
|
12438
|
+
if (this.debouncedRetuanGraphics) {
|
|
12439
|
+
// 若防抖函数支持取消,可在此处取消(需修改防抖函数)
|
|
12440
|
+
clearTimeout(this.debouncedRetuanGraphics.timer)
|
|
12441
|
+
}
|
|
12437
12442
|
}
|
|
12438
12443
|
},
|
|
12439
12444
|
beforeUnmount() {
|
|
@@ -12537,9 +12542,9 @@ const mapListMixin = {
|
|
|
12537
12542
|
},
|
|
12538
12543
|
setupMapEvents(view) {
|
|
12539
12544
|
// 点击
|
|
12540
|
-
this._clickHandler = view.on('click',
|
|
12545
|
+
this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
|
|
12541
12546
|
// 悬浮
|
|
12542
|
-
this._hoverHandler = view.on('pointer-move',
|
|
12547
|
+
this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
|
|
12543
12548
|
},
|
|
12544
12549
|
changeGraphic(data) {
|
|
12545
12550
|
if (mapListMixin_pointLayer && mapListMixin_pointLayer.graphics && mapListMixin_pointLayer.graphics._items) {
|
|
@@ -12613,13 +12618,6 @@ const mapListMixin = {
|
|
|
12613
12618
|
this.$emit('mapEventMouse', hitData)
|
|
12614
12619
|
} else mapListMixin_arcgisView.container.style.cursor = 'default'
|
|
12615
12620
|
},
|
|
12616
|
-
debounce(fn, delay) {
|
|
12617
|
-
let timer
|
|
12618
|
-
return (...args) => {
|
|
12619
|
-
clearTimeout(timer)
|
|
12620
|
-
timer = setTimeout(() => fn.apply(this, args), delay)
|
|
12621
|
-
}
|
|
12622
|
-
},
|
|
12623
12621
|
cleanupMapEvents() {
|
|
12624
12622
|
this._clickHandler?.remove()
|
|
12625
12623
|
this._hoverHandler?.remove()
|
|
@@ -12731,17 +12729,16 @@ var mapList_component = normalizeComponent(
|
|
|
12731
12729
|
|
|
12732
12730
|
|
|
12733
12731
|
|
|
12734
|
-
// export { augustineGjMap, augustineMap, locationMap, mapList };
|
|
12735
12732
|
// 所有组件列表
|
|
12736
|
-
const components = [augustineGjMap, augustineMap, locationMap, mapList]
|
|
12733
|
+
const components = [augustineGjMap, augustineMap, locationMap, mapList]
|
|
12737
12734
|
// install 方法
|
|
12738
12735
|
const install = (Vue) => {
|
|
12739
|
-
if (install.installed) return
|
|
12740
|
-
install.installed = true
|
|
12736
|
+
if (install.installed) return
|
|
12737
|
+
install.installed = true
|
|
12741
12738
|
components.forEach((comp) => {
|
|
12742
|
-
Vue.component(comp.name, comp)
|
|
12743
|
-
})
|
|
12744
|
-
}
|
|
12739
|
+
Vue.component(comp.name, comp)
|
|
12740
|
+
})
|
|
12741
|
+
}
|
|
12745
12742
|
|
|
12746
12743
|
// 支持 Vue.use(MyLib)
|
|
12747
12744
|
/* harmony default export */ const src_0 = ({
|
|
@@ -12773,12 +12770,12 @@ const install = (Vue) => {
|
|
|
12773
12770
|
drawPolyline: drawPolyline,
|
|
12774
12771
|
drawPolygon: drawPolygon,
|
|
12775
12772
|
drawPolygonArr: drawPolygonArr,
|
|
12776
|
-
getArea: getArea
|
|
12773
|
+
getArea: getArea
|
|
12777
12774
|
});
|
|
12778
12775
|
|
|
12779
12776
|
// 浏览器环境自动安装
|
|
12780
|
-
if (typeof window !==
|
|
12781
|
-
install(window.Vue)
|
|
12777
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
12778
|
+
install(window.Vue)
|
|
12782
12779
|
}
|
|
12783
12780
|
|
|
12784
12781
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|