augustine-jkmap 1.1.2 → 1.1.4
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 +118 -89
- package/dist/augustine-jkmap.common.js.map +1 -1
- package/dist/augustine-jkmap.umd.js +118 -89
- 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 +3 -3
- 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
|
},
|
|
@@ -6303,10 +6309,10 @@ const map_config_mapConfig = {
|
|
|
6303
6309
|
}
|
|
6304
6310
|
/* harmony default export */ const map_config = (map_config_mapConfig);
|
|
6305
6311
|
|
|
6306
|
-
;// ./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/search_map.vue?vue&type=template&id=
|
|
6307
|
-
var
|
|
6312
|
+
;// ./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/search_map.vue?vue&type=template&id=7f480c77
|
|
6313
|
+
var search_mapvue_type_template_id_7f480c77_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"arcgis-search-wrapper"},[_c('div',{staticClass:"arcigs-search-box"},[_c('CustomSearchInput',{on:{"checked-point":_vm.changeCheckedPoint,"search":_vm.searchMap,"clear":_vm.clearSearch},model:{value:(_vm.keyWord),callback:function ($$v) {_vm.keyWord=$$v},expression:"keyWord"}}),(_vm.keyWord && _vm.isSearch && !_vm.checkedPoint)?_c('div',{staticClass:"search-item-box"},[_c('div',{staticClass:"arcgis-line"}),_c('div',{staticClass:"search-item-wrapper"},[(_vm.mapNameList.length > 0)?[_vm._l((_vm.mapNameList),function(item,idx){return _c('div',{key:idx,staticClass:"search-item",on:{"click":function($event){$event.stopPropagation();return _vm.goDetail(item)}}},[_c('div',{staticClass:"search-name"},[_vm._v(_vm._s(item.name))]),_c('div',{staticClass:"search-address"},[_vm._v(_vm._s(item.address))])])}),(_vm.loadPage)?_c('div',{staticClass:"loaded-box"},[_vm._v(" "+_vm._s(_vm.finished ? '数据加载中...' : '数据已到底!!!')+" ")]):_vm._e()]:_c('div',{staticClass:"search-no-data"},[_vm._v(" "+_vm._s(_vm.loadSearch ? '数据加载中...' : '暂无数据')+" ")])],2)]):_vm._e()],1),_c('CustomModal',{ref:"message",attrs:{"z-index":2000,"animation":"fade","width":"400px"}},[_c('p',[_vm._v("这是淡入弹框")])])],1)
|
|
6308
6314
|
}
|
|
6309
|
-
var
|
|
6315
|
+
var search_mapvue_type_template_id_7f480c77_staticRenderFns = []
|
|
6310
6316
|
|
|
6311
6317
|
|
|
6312
6318
|
;// ./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/CustomModal.vue?vue&type=template&id=867722ce
|
|
@@ -10858,7 +10864,6 @@ function getDriveRoute(data) {
|
|
|
10858
10864
|
|
|
10859
10865
|
|
|
10860
10866
|
|
|
10861
|
-
var search_Map = null
|
|
10862
10867
|
/* harmony default export */ const search_mapvue_type_script_lang_js = ({
|
|
10863
10868
|
name: 'SearchMap',
|
|
10864
10869
|
components: { CustomSearchInput: CustomSearchInput, CustomModal: CustomModal },
|
|
@@ -10892,12 +10897,10 @@ var search_Map = null
|
|
|
10892
10897
|
changeCheckedPoint(val) {
|
|
10893
10898
|
this.checkedPoint = val
|
|
10894
10899
|
},
|
|
10895
|
-
initMap(
|
|
10896
|
-
search_Map = data.map
|
|
10900
|
+
initMap() {
|
|
10897
10901
|
this.isSearch = false
|
|
10898
10902
|
this.checkedPoint = false
|
|
10899
10903
|
this.clearSearch()
|
|
10900
|
-
search_Map
|
|
10901
10904
|
},
|
|
10902
10905
|
goDetail(item) {
|
|
10903
10906
|
if (item.lonlat) {
|
|
@@ -10980,8 +10983,8 @@ var search_Map = null
|
|
|
10980
10983
|
;
|
|
10981
10984
|
var search_map_component = normalizeComponent(
|
|
10982
10985
|
vue2_search_mapvue_type_script_lang_js,
|
|
10983
|
-
|
|
10984
|
-
|
|
10986
|
+
search_mapvue_type_template_id_7f480c77_render,
|
|
10987
|
+
search_mapvue_type_template_id_7f480c77_staticRenderFns,
|
|
10985
10988
|
false,
|
|
10986
10989
|
null,
|
|
10987
10990
|
null,
|
|
@@ -11069,9 +11072,9 @@ const mapLocationMixin = {
|
|
|
11069
11072
|
},
|
|
11070
11073
|
setupMapEvents(view) {
|
|
11071
11074
|
// 点击
|
|
11072
|
-
this._clickHandler = view.on('click',
|
|
11075
|
+
this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
|
|
11073
11076
|
// 悬浮
|
|
11074
|
-
this._hoverHandler = view.on('pointer-move',
|
|
11077
|
+
this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
|
|
11075
11078
|
},
|
|
11076
11079
|
|
|
11077
11080
|
handleMapClick(e) {
|
|
@@ -11127,14 +11130,6 @@ const mapLocationMixin = {
|
|
|
11127
11130
|
} else arcgisView.container.style.cursor = 'default'
|
|
11128
11131
|
},
|
|
11129
11132
|
|
|
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
11133
|
cleanupMapEvents() {
|
|
11139
11134
|
this._clickHandler?.remove()
|
|
11140
11135
|
this._hoverHandler?.remove()
|
|
@@ -11255,9 +11250,7 @@ const mapLocationMixin = {
|
|
|
11255
11250
|
} else this.moveCenterPoint()
|
|
11256
11251
|
},
|
|
11257
11252
|
|
|
11258
|
-
clearSearchMap() {
|
|
11259
|
-
console.log('')
|
|
11260
|
-
},
|
|
11253
|
+
clearSearchMap() {},
|
|
11261
11254
|
clearSketch() {
|
|
11262
11255
|
mapLocationMixin_pointLayer && mapLocationMixin_pointLayer.removeAll()
|
|
11263
11256
|
if (this.$refs.searchRef && this.$refs.searchRef.clearSearch)
|
|
@@ -11289,7 +11282,7 @@ const mapLocationMixin = {
|
|
|
11289
11282
|
this.pointData.address = ''
|
|
11290
11283
|
if (options) {
|
|
11291
11284
|
if (options.address) {
|
|
11292
|
-
this.address =
|
|
11285
|
+
this.address = options.address
|
|
11293
11286
|
}
|
|
11294
11287
|
if (
|
|
11295
11288
|
options.center &&
|
|
@@ -11297,7 +11290,7 @@ const mapLocationMixin = {
|
|
|
11297
11290
|
options.center[0] &&
|
|
11298
11291
|
options.center[1]
|
|
11299
11292
|
) {
|
|
11300
|
-
this.center =
|
|
11293
|
+
this.center = options.center
|
|
11301
11294
|
}
|
|
11302
11295
|
if (arcgisMap && arcgisView) {
|
|
11303
11296
|
setTimeout(() => {
|
|
@@ -11329,12 +11322,18 @@ const mapLocationMixin = {
|
|
|
11329
11322
|
}
|
|
11330
11323
|
return datas
|
|
11331
11324
|
} else return datas
|
|
11325
|
+
},
|
|
11326
|
+
destroy() {
|
|
11327
|
+
this.moveCenterPoint()
|
|
11328
|
+
setTimeout(() => {
|
|
11329
|
+
this.clearSketch()
|
|
11330
|
+
this._clickHandler?.remove()
|
|
11331
|
+
this._hoverHandler?.remove()
|
|
11332
|
+
}, 200)
|
|
11332
11333
|
}
|
|
11333
11334
|
},
|
|
11334
11335
|
beforeUnmount() {
|
|
11335
|
-
this.
|
|
11336
|
-
this._clickHandler?.remove()
|
|
11337
|
-
this._hoverHandler?.remove()
|
|
11336
|
+
this.destroy()
|
|
11338
11337
|
}
|
|
11339
11338
|
}
|
|
11340
11339
|
|
|
@@ -11939,6 +11938,7 @@ class SketchManager {
|
|
|
11939
11938
|
this.drawIngArea = this.getArea(event.graphic.geometry)
|
|
11940
11939
|
}
|
|
11941
11940
|
}
|
|
11941
|
+
this.isActive = true
|
|
11942
11942
|
if (event.state === 'complete') {
|
|
11943
11943
|
const graphic = event.graphic
|
|
11944
11944
|
this.isActive = false
|
|
@@ -11958,6 +11958,7 @@ class SketchManager {
|
|
|
11958
11958
|
if (selectedGrahic && selectedGrahic.length > 0) {
|
|
11959
11959
|
this.drawIngArea = this.getArea(selectedGrahic[0].geometry)
|
|
11960
11960
|
}
|
|
11961
|
+
this.isActive = true
|
|
11961
11962
|
if (event.state === 'complete') {
|
|
11962
11963
|
this.isActive = false
|
|
11963
11964
|
this.isNextList = []
|
|
@@ -12057,7 +12058,7 @@ const mapMixin = {
|
|
|
12057
12058
|
module: {
|
|
12058
12059
|
type: Array,
|
|
12059
12060
|
default: () => {
|
|
12060
|
-
return [
|
|
12061
|
+
return [] //edit:编辑,screen:全屏,search:搜索-'search', 'edit', 'screen'
|
|
12061
12062
|
}
|
|
12062
12063
|
},
|
|
12063
12064
|
//最大可绘制的图形数量
|
|
@@ -12097,9 +12098,17 @@ const mapMixin = {
|
|
|
12097
12098
|
isPer: false,
|
|
12098
12099
|
drawIngArea: 0,
|
|
12099
12100
|
isDel: false,
|
|
12100
|
-
isDelAll: false
|
|
12101
|
+
isDelAll: false,
|
|
12102
|
+
debouncedRetuanGraphics: null
|
|
12101
12103
|
}
|
|
12102
12104
|
},
|
|
12105
|
+
created() {
|
|
12106
|
+
// 包装 retuanGraphics 为防抖方法,延迟 500ms(可自定义)
|
|
12107
|
+
// 此处用箭头函数确保 this 指向组件实例,或用 bind(this)
|
|
12108
|
+
this.debouncedRetuanGraphics = debounce(() => {
|
|
12109
|
+
this.retuanGraphics()
|
|
12110
|
+
}, 500) // 防抖延迟与原 setTimeout 一致,也可调整
|
|
12111
|
+
},
|
|
12103
12112
|
methods: {
|
|
12104
12113
|
/**
|
|
12105
12114
|
* 给数值添加千分位(强制保留2位小数,兼容负数/0/超长字符串等场景)
|
|
@@ -12133,8 +12142,8 @@ const mapMixin = {
|
|
|
12133
12142
|
* @param {*} view
|
|
12134
12143
|
*/
|
|
12135
12144
|
setupMapEvents(view) {
|
|
12136
|
-
this._clickHandler = view.on('click',
|
|
12137
|
-
this._hoverHandler = view.on('pointer-move',
|
|
12145
|
+
this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
|
|
12146
|
+
this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
|
|
12138
12147
|
},
|
|
12139
12148
|
/**
|
|
12140
12149
|
* 鼠标点击
|
|
@@ -12183,13 +12192,6 @@ const mapMixin = {
|
|
|
12183
12192
|
mapMixin_arcgisView.container.style.cursor = 'default'
|
|
12184
12193
|
}
|
|
12185
12194
|
},
|
|
12186
|
-
debounce(fn, delay) {
|
|
12187
|
-
let timer
|
|
12188
|
-
return (...args) => {
|
|
12189
|
-
clearTimeout(timer)
|
|
12190
|
-
timer = setTimeout(() => fn.apply(this, args), delay)
|
|
12191
|
-
}
|
|
12192
|
-
},
|
|
12193
12195
|
/**
|
|
12194
12196
|
* 清除监听
|
|
12195
12197
|
*/
|
|
@@ -12241,9 +12243,8 @@ const mapMixin = {
|
|
|
12241
12243
|
: 0
|
|
12242
12244
|
graphics = data.graphics
|
|
12243
12245
|
this.isDelAll = graphics.length > 0
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
}, 500)
|
|
12246
|
+
|
|
12247
|
+
this.debouncedRetuanGraphics()
|
|
12247
12248
|
})
|
|
12248
12249
|
}
|
|
12249
12250
|
this.setupMapEvents(data.view)
|
|
@@ -12356,7 +12357,6 @@ const mapMixin = {
|
|
|
12356
12357
|
form.mArea = Number(area) * 0.0015 // 亩
|
|
12357
12358
|
form.hectareArea = Number(area) * 0.0001 // 公顷
|
|
12358
12359
|
}
|
|
12359
|
-
console.log('formatMapData00', form, graphics)
|
|
12360
12360
|
return form
|
|
12361
12361
|
},
|
|
12362
12362
|
/**
|
|
@@ -12371,8 +12371,9 @@ const mapMixin = {
|
|
|
12371
12371
|
* @param {*} type
|
|
12372
12372
|
*/
|
|
12373
12373
|
batchDraw(graphics) {
|
|
12374
|
-
|
|
12375
|
-
|
|
12374
|
+
if (graphics.length > 0 && sketchLayer) {
|
|
12375
|
+
sketchLayer && sketchLayer.removeAll()
|
|
12376
|
+
|
|
12376
12377
|
let sketchArr = []
|
|
12377
12378
|
graphics.map((item) => {
|
|
12378
12379
|
let grahic = null
|
|
@@ -12393,8 +12394,8 @@ const mapMixin = {
|
|
|
12393
12394
|
} else this.goToCenter()
|
|
12394
12395
|
},
|
|
12395
12396
|
batchNnselectDraw(graphics, textKey = 'text') {
|
|
12396
|
-
|
|
12397
|
-
|
|
12397
|
+
if (graphics.length > 0 && unselectableLayer) {
|
|
12398
|
+
unselectableLayer && unselectableLayer.removeAll()
|
|
12398
12399
|
let sketchArr = []
|
|
12399
12400
|
graphics.map((item) => {
|
|
12400
12401
|
let grahic = null
|
|
@@ -12430,10 +12431,15 @@ const mapMixin = {
|
|
|
12430
12431
|
destroy() {
|
|
12431
12432
|
this.cleanupMapEvents()
|
|
12432
12433
|
if (mapMixin_sketch && mapMixin_sketch.destroy) mapMixin_sketch.destroy()
|
|
12434
|
+
unselectableLayer && unselectableLayer.removeAll()
|
|
12433
12435
|
this.goToCenter()
|
|
12434
12436
|
if (this.$refs.searchRef && this.$refs.searchRef.clearSearch) {
|
|
12435
12437
|
this.$refs.searchRef.clearSearch()
|
|
12436
12438
|
}
|
|
12439
|
+
if (this.debouncedRetuanGraphics) {
|
|
12440
|
+
// 若防抖函数支持取消,可在此处取消(需修改防抖函数)
|
|
12441
|
+
clearTimeout(this.debouncedRetuanGraphics.timer)
|
|
12442
|
+
}
|
|
12437
12443
|
}
|
|
12438
12444
|
},
|
|
12439
12445
|
beforeUnmount() {
|
|
@@ -12497,7 +12503,8 @@ var mapListMixin_arcgisMap = null,
|
|
|
12497
12503
|
mapListMixin_arcgisView = null,
|
|
12498
12504
|
mapListMixin_currentAbortController,
|
|
12499
12505
|
mapListMixin_isClickLocked = false,
|
|
12500
|
-
mapListMixin_pointLayer = null
|
|
12506
|
+
mapListMixin_pointLayer = null,
|
|
12507
|
+
textLayer = null
|
|
12501
12508
|
const mapListMixin = {
|
|
12502
12509
|
components: { loadingBox: loading },
|
|
12503
12510
|
props: {
|
|
@@ -12510,6 +12517,10 @@ const mapListMixin = {
|
|
|
12510
12517
|
default: () => {
|
|
12511
12518
|
return []
|
|
12512
12519
|
}
|
|
12520
|
+
},
|
|
12521
|
+
mapKey: {
|
|
12522
|
+
type: String,
|
|
12523
|
+
default: 'name'
|
|
12513
12524
|
}
|
|
12514
12525
|
},
|
|
12515
12526
|
computed: {},
|
|
@@ -12537,9 +12548,9 @@ const mapListMixin = {
|
|
|
12537
12548
|
},
|
|
12538
12549
|
setupMapEvents(view) {
|
|
12539
12550
|
// 点击
|
|
12540
|
-
this._clickHandler = view.on('click',
|
|
12551
|
+
this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
|
|
12541
12552
|
// 悬浮
|
|
12542
|
-
this._hoverHandler = view.on('pointer-move',
|
|
12553
|
+
this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
|
|
12543
12554
|
},
|
|
12544
12555
|
changeGraphic(data) {
|
|
12545
12556
|
if (mapListMixin_pointLayer && mapListMixin_pointLayer.graphics && mapListMixin_pointLayer.graphics._items) {
|
|
@@ -12547,10 +12558,16 @@ const mapListMixin = {
|
|
|
12547
12558
|
let url = item.attributes.url,
|
|
12548
12559
|
width = item.attributes.width,
|
|
12549
12560
|
height = item.attributes.height
|
|
12550
|
-
if (
|
|
12561
|
+
if (
|
|
12562
|
+
data &&
|
|
12563
|
+
item &&
|
|
12564
|
+
item.attributes &&
|
|
12565
|
+
item.attributes[this.mapKey] == data[this.mapKey]
|
|
12566
|
+
) {
|
|
12551
12567
|
url = data.activeUrl ? data.activeUrl : data.url
|
|
12552
|
-
width = data.width +
|
|
12568
|
+
width = data.width + 10
|
|
12553
12569
|
height = (data.height * width) / data.width
|
|
12570
|
+
mapJumpTo(data)
|
|
12554
12571
|
}
|
|
12555
12572
|
item.symbol = getPictureMarker({
|
|
12556
12573
|
url: url,
|
|
@@ -12613,13 +12630,6 @@ const mapListMixin = {
|
|
|
12613
12630
|
this.$emit('mapEventMouse', hitData)
|
|
12614
12631
|
} else mapListMixin_arcgisView.container.style.cursor = 'default'
|
|
12615
12632
|
},
|
|
12616
|
-
debounce(fn, delay) {
|
|
12617
|
-
let timer
|
|
12618
|
-
return (...args) => {
|
|
12619
|
-
clearTimeout(timer)
|
|
12620
|
-
timer = setTimeout(() => fn.apply(this, args), delay)
|
|
12621
|
-
}
|
|
12622
|
-
},
|
|
12623
12633
|
cleanupMapEvents() {
|
|
12624
12634
|
this._clickHandler?.remove()
|
|
12625
12635
|
this._hoverHandler?.remove()
|
|
@@ -12633,6 +12643,9 @@ const mapListMixin = {
|
|
|
12633
12643
|
setTimeout(() => {
|
|
12634
12644
|
mapListMixin_pointLayer = new window.jkEsri.GraphicsLayer({ id: 'pointLayer' })
|
|
12635
12645
|
mapListMixin_arcgisMap.add(mapListMixin_pointLayer, 10)
|
|
12646
|
+
textLayer = new window.jkEsri.GraphicsLayer({ id: 'textLayer' })
|
|
12647
|
+
mapListMixin_arcgisMap.add(textLayer, 10)
|
|
12648
|
+
|
|
12636
12649
|
this.drawPoints()
|
|
12637
12650
|
this.setupMapEvents(data.view)
|
|
12638
12651
|
this.$emit('loadEdMap', data)
|
|
@@ -12660,10 +12673,26 @@ const mapListMixin = {
|
|
|
12660
12673
|
*/
|
|
12661
12674
|
drawPoints() {
|
|
12662
12675
|
if (this.pointsList && this.pointsList.length > 0) {
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12676
|
+
let validGraphics = [],
|
|
12677
|
+
textGrahics = []
|
|
12678
|
+
this.pointsList.map((item) => {
|
|
12679
|
+
const pointGraphic = drawPoint({ ...item, symbol: getPictureMarker(item) })
|
|
12680
|
+
const textGrahic = drawPoint({
|
|
12681
|
+
...item,
|
|
12682
|
+
symbol: getSimpleText(
|
|
12683
|
+
{
|
|
12684
|
+
...item,
|
|
12685
|
+
yoffset: item.yoffset ? item.yoffset : -(item.height / 2 + 15)
|
|
12686
|
+
},
|
|
12687
|
+
this.mapKey
|
|
12688
|
+
)
|
|
12689
|
+
})
|
|
12690
|
+
if (pointGraphic) validGraphics.push(pointGraphic)
|
|
12691
|
+
if (textGrahic) textGrahics.push(textGrahic)
|
|
12692
|
+
})
|
|
12693
|
+
|
|
12666
12694
|
mapListMixin_pointLayer.addMany(validGraphics)
|
|
12695
|
+
textLayer.addMany(textGrahics)
|
|
12667
12696
|
mapJumpTo(mapListMixin_pointLayer)
|
|
12668
12697
|
} else this.moveCenterPoint()
|
|
12669
12698
|
},
|
|
@@ -12675,6 +12704,7 @@ const mapListMixin = {
|
|
|
12675
12704
|
this.pointsList = data || []
|
|
12676
12705
|
if (mapListMixin_arcgisMap && mapListMixin_arcgisView) {
|
|
12677
12706
|
if (mapListMixin_pointLayer) mapListMixin_pointLayer.removeAll()
|
|
12707
|
+
if (textLayer) textLayer.removeAll()
|
|
12678
12708
|
this.drawPoints()
|
|
12679
12709
|
}
|
|
12680
12710
|
}
|
|
@@ -12731,17 +12761,16 @@ var mapList_component = normalizeComponent(
|
|
|
12731
12761
|
|
|
12732
12762
|
|
|
12733
12763
|
|
|
12734
|
-
// export { augustineGjMap, augustineMap, locationMap, mapList };
|
|
12735
12764
|
// 所有组件列表
|
|
12736
|
-
const components = [augustineGjMap, augustineMap, locationMap, mapList]
|
|
12765
|
+
const components = [augustineGjMap, augustineMap, locationMap, mapList]
|
|
12737
12766
|
// install 方法
|
|
12738
12767
|
const install = (Vue) => {
|
|
12739
|
-
if (install.installed) return
|
|
12740
|
-
install.installed = true
|
|
12768
|
+
if (install.installed) return
|
|
12769
|
+
install.installed = true
|
|
12741
12770
|
components.forEach((comp) => {
|
|
12742
|
-
Vue.component(comp.name, comp)
|
|
12743
|
-
})
|
|
12744
|
-
}
|
|
12771
|
+
Vue.component(comp.name, comp)
|
|
12772
|
+
})
|
|
12773
|
+
}
|
|
12745
12774
|
|
|
12746
12775
|
// 支持 Vue.use(MyLib)
|
|
12747
12776
|
/* harmony default export */ const src_0 = ({
|
|
@@ -12773,12 +12802,12 @@ const install = (Vue) => {
|
|
|
12773
12802
|
drawPolyline: drawPolyline,
|
|
12774
12803
|
drawPolygon: drawPolygon,
|
|
12775
12804
|
drawPolygonArr: drawPolygonArr,
|
|
12776
|
-
getArea: getArea
|
|
12805
|
+
getArea: getArea
|
|
12777
12806
|
});
|
|
12778
12807
|
|
|
12779
12808
|
// 浏览器环境自动安装
|
|
12780
|
-
if (typeof window !==
|
|
12781
|
-
install(window.Vue)
|
|
12809
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
12810
|
+
install(window.Vue)
|
|
12782
12811
|
}
|
|
12783
12812
|
|
|
12784
12813
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|